69 myEventThrow(ev), myAmLibsumo(isLibsumo) {
106 if (oc.
isSet(
"configuration-file")) {
110 }
else if (oc.
isSet(
"net-file")) {
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;
188 NLHandler handler(
"", *net, db, tb, *eb, jb);
190 NLBuilder builder(oc, *net, *eb, jb, db, handler);
194 if (!builder.
build()) {
202 osgView = oc.
getBool(
"osg-view");
204 if (oc.
isSet(
"edgedata-files")) {
215 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
222 }
catch (std::exception& e) {
228 if (net ==
nullptr) {
233 oc.
getBool(
"registry-viewport"));
242 const std::vector<std::string>& guiSettingsFiles,
244 const bool viewportFromRegistry) {
#define WRITE_ERRORF(...)
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
The main window of the SUMO-gui.
void addRecentConfig(const FX::FXString &f)
add recent config to recent file list
void addRecentNetwork(const FX::FXString &f)
add recent network to recent file list
Builds detectors for guisim.
Derivation of NLEdgeControlBuilder which builds gui-edges.
Stores time-dependant events and executes them at the proper time (guisim)
static double gTrackerInterval
the aggregation period for tracker windows in seconds
static bool gRunAfterLoad
the simulation shall start direct after loading
static bool gQuitOnEnd
the window shall be closed when the simulation has ended
static bool gDemoAutoReload
the simulation shall reload when it has ended (demo)
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.
OutputDevice * myWarningRetriever
std::string myFile
the path to load the simulation from
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on.
virtual ~GUILoadThread()
destructor
void loadConfigOrNet(const std::string &file)
begins the loading of the given file
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
const std::string & getFileName() const
std::string myTitle
the title string for the application
OutputDevice * myMessageRetriever
GUILoadThread(FXApp *app, GUIApplicationWindow *mw, MFXSynchQue< GUIEvent * > &eq, FXEX::MFXThreadEvent &ev, const bool isLibsumo)
constructor
GUIApplicationWindow * myParent
the parent window to inform about the loading
FXEX::MFXThreadEvent & myEventThrow
const bool myAmLibsumo
whether we are running in libsumo
MFXSynchQue< GUIEvent * > & myEventQue
The class responsible for building and deletion of vehicles (gui-version)
A MSNet extended by some values for usage within the gui.
bool loadEdgeData(const std::string &file)
load edgeData from file
void initGUIStructures()
Initialises gui wrappers.
static void allowTextures(const bool val)
switch texture drawing on and off
Builds trigger objects for guisim.
The class responsible for building and deletion of vehicles (gui-version)
static bool UseMesoSim
this should be set at the same time as MSGlobals::gUseMesoSim
static void setMSGlobals(OptionsCont &oc)
Sets the global microsim-options.
static void fillOptions()
Inserts options used by the simulation into the OptionsCont-singleton.
static bool checkOptions()
Checks the set options.
static void clearAll()
Clears all dictionaries.
The class responsible for building and deletion of vehicles.
virtual void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
virtual void inform(std::string msg, bool addType=true)
adds a new error to the list
static void initOutputOptions()
init output options
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
virtual void clear(bool resetInformed=true)
Clears information whether an error occurred previously and print aggregated message summary.
virtual void removeRetriever(OutputDevice *retriever)
Removes the retriever from the handler.
@ MT_MESSAGE
The message is only something to show.
@ MT_ERROR
The message is an error.
@ MT_WARNING
The message is a warning.
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.
Encapsulates an object's method for using it as a message retriever.
The main interface for loading a microsim.
virtual bool build()
Builds and initialises the simulation.
static void initRandomness()
initializes all RNGs
The XML-Handler for network loading.
Builder of microsim-junctions and tls.
void setHandler(NLHandler *handler)
Sets the parent handler to use for nested parsing.
A storage for options typed value containers)
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
bool setDefault(const std::string &name, const std::string &value)
Sets the given value for the named option as new default value.
void clear()
Removes all information from the container.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
bool setByRootElement(const std::string &name, const std::string &value)
Sets the given value for the option which can handle the given XML root.
void resetWritable()
Resets all options to be writeable.
static OptionsCont & getOptions()
Retrieves the options.
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 void loadConfiguration()
Loads and parses the configuration.
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
static void getOptions(const bool commandLineOnly=false)
Parses the command line arguments and loads the configuration.
static std::string getRoot(const std::string &filename)
Retrieves the XML root element of a supposed configuration or net.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xac: Get GUI Variable)
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xcc: Change GUI State)
static void openSocket(const std::map< int, CmdExecutor > &execs)
Initialises the server.
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme, const std::string &routeValidationScheme)
Enables or disables validation.
static void registerStateListener()
TRACI_CONST int CMD_SET_GUI_VARIABLE
TRACI_CONST int CMD_GET_GUI_VARIABLE