109 if (oc.
isSet(
"configuration-file")) {
111 }
else if (oc.
isSet(
"net-file")) {
128 oc.
set(
"verbose",
"true");
140 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
166 std::vector<std::string> guiSettingsFiles;
167 bool osgView =
false;
176 std::map<int, TraCIServer::CmdExecutor> execs;
185 NLHandler handler(
"", *net, db, tb, *eb, jb);
187 NLBuilder builder(oc, *net, *eb, jb, db, handler);
191 if (!builder.
build()) {
199 osgView = oc.
getBool(
"osg-view");
201 if (oc.
isSet(
"edgedata-files")) {
212 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
219 }
catch (std::exception& e) {
225 if (net ==
nullptr) {
230 oc.
getBool(
"registry-viewport"));
239 const std::vector<std::string>& guiSettingsFiles,
241 const bool viewportFromRegistry) {
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.
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.
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)
bool loadEdgeData(const std::string &file)
load edgeData from file
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.
virtual void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
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.
static bool gDemoAutoReload
the simulation shall reload when it has ended (demo)
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 void fillOptions()
Inserts options used by the simulation into the OptionsCont-singleton.
Builds trigger objects for guisim.
virtual ~GUILoadThread()
destructor
FXSynchQue< GUIEvent * > & myEventQue
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.
bool isUsableFileList(const std::string &name) const
Checks whether the named option is usable as a file list (with at least a single file) ...
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)
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.
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) ...
virtual void removeRetriever(OutputDevice *retriever)
Removes the retriever from the handler.
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.
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.
static void initRandomness()
initializes all RNGs
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.
TRACI_CONST int CMD_GET_GUI_VARIABLE
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
GUILoadThread(FXApp *app, GUIApplicationWindow *mw, FXSynchQue< GUIEvent *> &eq, FXEX::FXThreadEvent &ev)
constructor
virtual 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 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
virtual void clear()
Clears information whether an error occurred previously.
static void initOutputOptions()
init output options
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xac: Get GUI Variable)
TRACI_CONST int CMD_SET_GUI_VARIABLE
The main window of the SUMO-gui.