119 if (oc.
isSet(
"configuration-file")) {
121 }
else if (oc.
isSet(
"net-file")) {
138 oc.
set(
"verbose",
"true");
150 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
178 std::vector<std::string> guiSettingsFiles;
179 bool osgView =
false;
189 std::map<int, TraCIServer::CmdExecutor> execs;
199 NLHandler handler(
"", *net, db, tb, *eb, jb);
201 NLBuilder builder(oc, *net, *eb, jb, db, handler);
205 if (!builder.
build()) {
213 osgView = oc.
getBool(
"osg-view");
217 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
224 }
catch (std::exception& e) {
243 const std::vector<std::string>& guiSettingsFiles,
244 const bool osgView) {
void setHandler(NLHandler *handler)
Sets the parent handler to use for nested parsing.
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
The message is only something to show.
MFXEventQue< GUIEvent * > & myEventQue
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
The class responsible for building and deletion of vehicles (gui-version)
OutputDevice * myWarningRetriever
static void getOptions(const bool commandLineOnly=false)
Parses the command line arguments and loads the configuration.
void resetWritable()
Resets all options to be writeable.
GUILoadThread(FXApp *app, GUIApplicationWindow *mw, MFXEventQue< GUIEvent *> &eq, FXEX::FXThreadEvent &ev)
constructor
The main interface for loading a microsim.
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
const std::string & getFileName() const
void addRecentFile(const FX::FXString &f, const bool isNet)
static bool gRunAfterLoad
the simulation shall start direct after loading
FXEX::FXThreadEvent & myEventThrow
The class responsible for building and deletion of vehicles (gui-version)
void initGUIStructures()
Initialises gui wrappers.
void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
void submitEndAndCleanup(GUINet *net, const SUMOTime simStartTime, const SUMOTime simEndTime, const std::vector< std::string > &guiSettingsFiles=std::vector< std::string >(), const bool osgView=false)
Closes the loading process.
Derivation of NLEdgeControlBuilder which builds gui-edges.
Builds detectors for guisim.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on...
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
#define CMD_SET_GUI_VARIABLE
static bool gDemoAutoReload
the simulation shall reload when it has ended (demo)
static std::mt19937 * getEquipmentRNG()
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xcc: Change GUI State)
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
static OptionsCont & getOptions()
Retrieves the options.
OutputDevice * myMessageRetriever
static std::mt19937 * getParsingRNG()
static void fillOptions()
Inserts options used by the simulation into the OptionsCont-singleton.
Builds trigger objects for guisim.
virtual ~GUILoadThread()
destructor
void loadConfigOrNet(const std::string &file, bool isNet)
begins the loading of the given file
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
GUIApplicationWindow * myParent
the parent window to inform about the loading
void clear()
Removes all information from the container.
static double gTrackerInterval
the aggregation period for tracker windows in seconds
std::string myTitle
the title string for the application
Builder of microsim-junctions and tls.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
SUMOTime string2time(const std::string &r)
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
void removeRetriever(OutputDevice *retriever)
Removes the retriever from the handler.
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.
#define CMD_GET_GUI_VARIABLE
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
bool myLoadNet
Information whether only the network shall be loaded.
The XML-Handler for network loading.
static bool gQuitOnEnd
the window shall be closed when the simulation has ended
static bool checkOptions()
Checks the set options.
virtual bool build()
Builds and initialises the simulation.
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
The message is a warning.
Encapsulates an object's method for using it as a message retriever.
static void clearAll()
Clears all dictionaries.
static void openSocket(const std::map< int, CmdExecutor > &execs)
Initialises the server.
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
A MSNet extended by some values for usage within the gui.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
void inform(std::string msg, bool addType=true)
adds a new error to the list
A storage for options typed value containers)
Stores time-dependant events and executes them at the proper time (guisim)
static void initRandGlobal(std::mt19937 *which=0)
Reads the given random number options and initialises the random number generator in accordance...
static void setMSGlobals(OptionsCont &oc)
Sets the global microsim-options.
std::string myFile
the path to load the simulation from
static void allowTextures(const bool val)
switch texture drawing on and off
The class responsible for building and deletion of vehicles.
static bool UseMesoSim
this should be set at the same time as MSGlobals::gUseMesoSim
void clear()
Clears information whether an error occured previously.
static void initOutputOptions()
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xac: Get GUI Variable)
The main window of the SUMO-gui.