 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
108 if (oc.
isSet(
"configuration-file")) {
110 }
else if (oc.
isSet(
"net-file")) {
127 oc.
set(
"verbose",
"true");
139 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
165 std::vector<std::string> guiSettingsFiles;
166 bool osgView =
false;
175 std::map<int, TraCIServer::CmdExecutor> execs;
184 NLHandler handler(
"", *net, db, tb, *eb, jb);
186 NLBuilder builder(oc, *net, *eb, jb, db, handler);
190 if (!builder.
build()) {
198 osgView = oc.
getBool(
"osg-view");
200 if (oc.
isSet(
"edgedata-files")) {
211 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
218 }
catch (std::exception& e) {
224 if (net ==
nullptr) {
229 oc.
getBool(
"registry-viewport"));
238 const std::vector<std::string>& guiSettingsFiles,
240 const bool viewportFromRegistry) {
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
static void fillOptions()
Inserts options used by the simulation into the OptionsCont-singleton.
static void initRandomness()
initializes all RNGs
static bool UseMesoSim
this should be set at the same time as MSGlobals::gUseMesoSim
TRACI_CONST int CMD_SET_GUI_VARIABLE
The main interface for loading a microsim.
static void initOutputOptions()
init output options
static void setMSGlobals(OptionsCont &oc)
Sets the global microsim-options.
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xcc: Change GUI State)
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.
static bool processGet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a get value command (Command 0xac: Get GUI Variable)
The message is only something to show.
void resetWritable()
Resets all options to be writeable.
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
bool myLoadNet
Information whether only the network shall be loaded.
Encapsulates an object's method for using it as a message retriever.
The message is a warning.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
virtual void inform(std::string msg, bool addType=true)
adds a new error to the list
GUIApplicationWindow * myParent
the parent window to inform about the loading
void setHandler(NLHandler *handler)
Sets the parent handler to use for nested parsing.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
static void clearAll()
Clears all dictionaries.
The class responsible for building and deletion of vehicles (gui-version)
GUILoadThread(FXApp *app, GUIApplicationWindow *mw, FXSynchQue< GUIEvent * > &eq, FXEX::FXThreadEvent &ev)
constructor
const std::string & getFileName() const
The class responsible for building and deletion of vehicles (gui-version)
Stores time-dependant events and executes them at the proper time (guisim)
std::string myTitle
the title string for the application
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
virtual void clear()
Clears information whether an error occurred previously.
bool loadEdgeData(const std::string &file)
load edgeData from file
Builder of microsim-junctions and tls.
Builds detectors for guisim.
bool isUsableFileList(const std::string &name) const
Checks whether the named option is usable as a file list (with at least a single file)
Derivation of NLEdgeControlBuilder which builds gui-edges.
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
Builds trigger objects for guisim.
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on.
The main window of the SUMO-gui.
OutputDevice * myMessageRetriever
void initGUIStructures()
Initialises gui wrappers.
OutputDevice * myWarningRetriever
A storage for options typed value containers)
static void allowTextures(const bool val)
switch texture drawing on and off
static bool gQuitOnEnd
the window shall be closed when the simulation has ended
std::string myFile
the path to load the simulation from
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
SUMOTime string2time(const std::string &r)
static double gTrackerInterval
the aggregation period for tracker windows in seconds
static void openSocket(const std::map< int, CmdExecutor > &execs)
Initialises the server.
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
virtual bool build()
Builds and initialises the simulation.
static void getOptions(const bool commandLineOnly=false)
Parses the command line arguments and loads the configuration.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
TRACI_CONST int CMD_GET_GUI_VARIABLE
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
FXEX::FXThreadEvent & myEventThrow
virtual void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
static bool gDemoAutoReload
the simulation shall reload when it has ended (demo)
void loadConfigOrNet(const std::string &file, bool isNet)
begins the loading of the given file
The XML-Handler for network loading.
The class responsible for building and deletion of vehicles.
static bool gRunAfterLoad
the simulation shall start direct after loading
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
virtual ~GUILoadThread()
destructor
A MSNet extended by some values for usage within the gui.
void addRecentFile(const FX::FXString &f, const bool isNet)
void clear()
Removes all information from the container.
static bool checkOptions()
Checks the set options.
FXSynchQue< GUIEvent * > & myEventQue
virtual void removeRetriever(OutputDevice *retriever)
Removes the retriever from the handler.
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.