SUMO - Simulation of Urban MObility
GNELoadThread.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // The thread that performs the loading of a Netedit-net (adapted from
18 // GUILoadThread)
19 /****************************************************************************/
20 #ifndef GNELoadThread_h
21 #define GNELoadThread_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <utils/common/SUMOTime.h>
38 
39 
40 // ===========================================================================
41 // class declarations
42 // ===========================================================================
44 class GNENet;
45 class GUIEvent;
46 
47 
48 // ===========================================================================
49 // class definitions
50 // ===========================================================================
55 public:
59 
61  virtual ~GNELoadThread();
62 
64  FXint run();
65 
71  void loadConfigOrNet(const std::string& file, bool isNet, bool useStartupOptions, bool newNet = false);
72 
74  void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);
75 
77  static void fillOptions(OptionsCont& oc);
78 
80  static void setDefaultOptions(OptionsCont& oc);
81 
82 protected:
84  bool initOptions();
85 
91  void submitEndAndCleanup(GNENet* net, const std::string& guiSettingsFile = "", const bool viewportFromRegistry = false);
92 
93 protected:
96 
98  std::string myFile;
99 
102 
105 
108 
110  bool myLoadNet;
111 
113  bool myNewNet;
114 };
115 
116 
117 #endif
118 
119 /****************************************************************************/
FXEX::FXThreadEvent & myEventThrow
event throw
OutputDevice * myWarningRetriever
void loadConfigOrNet(const std::string &file, bool isNet, bool useStartupOptions, bool newNet=false)
begins the loading of a netconvert configuration or a a network
bool initOptions()
init options
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on...
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:91
MFXInterThreadEventClient * myParent
the parent window to inform about the loading
Definition: GNELoadThread.h:95
static void setDefaultOptions(OptionsCont &oc)
sets required options for proper functioning
bool myNewNet
if true, a new net is created
bool myLoadNet
Information whether only the network shall be loaded.
GNELoadThread(FXApp *app, MFXInterThreadEventClient *mw, MFXEventQue< GUIEvent *> &eq, FXEX::FXThreadEvent &ev)
constructor
FXint run()
starts the thread. The thread ends after the net has been loaded
MFXEventQue< GUIEvent * > & myEventQue
event Queue
OutputDevice * myMessageRetriever
A storage for options typed value containers)
Definition: OptionsCont.h:98
std::string myFile
the path to load the simulation from
Definition: GNELoadThread.h:98
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
void submitEndAndCleanup(GNENet *net, const std::string &guiSettingsFile="", const bool viewportFromRegistry=false)
Closes the loading process.
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
static void fillOptions(OptionsCont &oc)
clears and initializes the OptionsCont
virtual ~GNELoadThread()
destructor