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 /****************************************************************************/
18 // Class describing the thread that performs the loading of a simulation
19 /****************************************************************************/
20 #ifndef GUILoadThread_h
21 #define GUILoadThread_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
29 #include <utils/common/SUMOTime.h>
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
40 class GUINet;
41 class GUIEvent;
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
51 public:
55 
57  virtual ~GUILoadThread();
58 
61  FXint run();
62 
64  void loadConfigOrNet(const std::string& file, bool isNet);
65 
67  void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);
68 
69  const std::string& getFileName() const;
70 
71 protected:
77  void submitEndAndCleanup(GUINet* net, const SUMOTime simStartTime, const SUMOTime simEndTime,
78  const std::vector<std::string>& guiSettingsFiles = std::vector<std::string>(),
79  const bool osgView = false,
80  const bool viewportFromRegistry = false);
81 
82 protected:
85 
87  std::string myFile;
88 
90  std::string myTitle;
91 
95 
97 
99 
101  bool myLoadNet;
102 
103 };
104 
105 
106 #endif
107 
108 /****************************************************************************/
MsgHandler::MsgType
MsgType
Definition: MsgHandler.h:51
SUMOTime.h
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
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:236
GUILoadThread::myLoadNet
bool myLoadNet
Information whether only the network shall be loaded.
Definition: GUILoadThread.h:101
MsgHandler.h
GUILoadThread::myParent
GUIApplicationWindow * myParent
the parent window to inform about the loading
Definition: GUILoadThread.h:84
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
GUILoadThread::GUILoadThread
GUILoadThread(FXApp *app, GUIApplicationWindow *mw, FXSynchQue< GUIEvent * > &eq, FXEX::FXThreadEvent &ev)
constructor
Definition: GUILoadThread.cpp:67
GUILoadThread::getFileName
const std::string & getFileName() const
Definition: GUILoadThread.cpp:273
FXSynchQue.h
GUILoadThread::myTitle
std::string myTitle
the title string for the application
Definition: GUILoadThread.h:90
GUILoadThread
Definition: GUILoadThread.h:50
GUILoadThread::myErrorRetriever
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on.
Definition: GUILoadThread.h:94
FXSingleEventThread.h
GUIApplicationWindow
The main window of the SUMO-gui.
Definition: GUIApplicationWindow.h:66
GUILoadThread::myMessageRetriever
OutputDevice * myMessageRetriever
Definition: GUILoadThread.h:94
GUILoadThread::myWarningRetriever
OutputDevice * myWarningRetriever
Definition: GUILoadThread.h:94
GUILoadThread::myFile
std::string myFile
the path to load the simulation from
Definition: GUILoadThread.h:87
GUILoadThread::retrieveMessage
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
Definition: GUILoadThread.cpp:265
FXSynchQue< GUIEvent * >
GUILoadThread::myEventThrow
FXEX::FXThreadEvent & myEventThrow
Definition: GUILoadThread.h:98
GUIEvent
Definition: GUIEvent.h:77
GUILoadThread::loadConfigOrNet
void loadConfigOrNet(const std::string &file, bool isNet)
begins the loading of the given file
Definition: GUILoadThread.cpp:254
FXThreadEvent.h
config.h
FXSingleEventThread
Definition: FXSingleEventThread.h:35
FXEX::FXThreadEvent
Definition: FXThreadEvent.h:106
GUILoadThread::~GUILoadThread
virtual ~GUILoadThread()
destructor
Definition: GUILoadThread.cpp:78
GUINet
A MSNet extended by some values for usage within the gui.
Definition: GUINet.h:83
GUILoadThread::run
FXint run()
Definition: GUILoadThread.cpp:86
GUILoadThread::myEventQue
FXSynchQue< GUIEvent * > & myEventQue
Definition: GUILoadThread.h:96