Eclipse SUMO - Simulation of Urban MObility
GUILoadThread.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2002-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Class describing the thread that performs the loading of a simulation
18 /****************************************************************************/
19 #ifndef GUILoadThread_h
20 #define GUILoadThread_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <utils/common/SUMOTime.h>
33 
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
39 class GUINet;
40 class GUIEvent;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
50 public:
54 
56  virtual ~GUILoadThread();
57 
60  FXint run();
61 
63  void loadConfigOrNet(const std::string& file, bool isNet);
64 
66  void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);
67 
68  const std::string& getFileName() const;
69 
70 protected:
76  void submitEndAndCleanup(GUINet* net, const SUMOTime simStartTime, const SUMOTime simEndTime,
77  const std::vector<std::string>& guiSettingsFiles = std::vector<std::string>(),
78  const bool osgView = false,
79  const bool viewportFromRegistry = false);
80 
81 protected:
84 
86  std::string myFile;
87 
89  std::string myTitle;
90 
94 
96 
98 
100  bool myLoadNet;
101 
102 };
103 
104 
105 #endif
106 
107 /****************************************************************************/
MsgHandler::MsgType
MsgType
Definition: MsgHandler.h:45
SUMOTime.h
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
GUILoadThread::submitEndAndCleanup
void submitEndAndCleanup(GUINet *net, const SUMOTime simStartTime, const SUMOTime simEndTime, const std::vector< std::string > &guiSettingsFiles=std::vector< std::string >(), const bool osgView=false, const bool viewportFromRegistry=false)
Closes the loading process.
Definition: GUILoadThread.cpp:235
GUILoadThread::myLoadNet
bool myLoadNet
Information whether only the network shall be loaded.
Definition: GUILoadThread.h:100
MsgHandler.h
GUILoadThread::myParent
GUIApplicationWindow * myParent
the parent window to inform about the loading
Definition: GUILoadThread.h:83
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
GUILoadThread::GUILoadThread
GUILoadThread(FXApp *app, GUIApplicationWindow *mw, FXSynchQue< GUIEvent * > &eq, FXEX::FXThreadEvent &ev)
constructor
Definition: GUILoadThread.cpp:66
GUILoadThread::getFileName
const std::string & getFileName() const
Definition: GUILoadThread.cpp:272
FXSynchQue.h
GUILoadThread::myTitle
std::string myTitle
the title string for the application
Definition: GUILoadThread.h:89
GUILoadThread
Definition: GUILoadThread.h:49
GUILoadThread::myErrorRetriever
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on.
Definition: GUILoadThread.h:93
FXSingleEventThread.h
GUIApplicationWindow
The main window of the SUMO-gui.
Definition: GUIApplicationWindow.h:66
GUILoadThread::myMessageRetriever
OutputDevice * myMessageRetriever
Definition: GUILoadThread.h:93
GUILoadThread::myWarningRetriever
OutputDevice * myWarningRetriever
Definition: GUILoadThread.h:93
GUILoadThread::myFile
std::string myFile
the path to load the simulation from
Definition: GUILoadThread.h:86
GUILoadThread::retrieveMessage
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
Definition: GUILoadThread.cpp:264
FXSynchQue< GUIEvent * >
GUILoadThread::myEventThrow
FXEX::FXThreadEvent & myEventThrow
Definition: GUILoadThread.h:97
GUIEvent
Definition: GUIEvent.h:76
GUILoadThread::loadConfigOrNet
void loadConfigOrNet(const std::string &file, bool isNet)
begins the loading of the given file
Definition: GUILoadThread.cpp:253
FXThreadEvent.h
config.h
FXSingleEventThread
Definition: FXSingleEventThread.h:34
FXEX::FXThreadEvent
Definition: FXThreadEvent.h:105
GUILoadThread::~GUILoadThread
virtual ~GUILoadThread()
destructor
Definition: GUILoadThread.cpp:77
GUINet
A MSNet extended by some values for usage within the gui.
Definition: GUINet.h:82
GUILoadThread::run
FXint run()
Definition: GUILoadThread.cpp:85
GUILoadThread::myEventQue
FXSynchQue< GUIEvent * > & myEventQue
Definition: GUILoadThread.h:95