67 #include <mesogui/GUIMEVehicleControl.h>
75 #ifdef CHECK_MEMORY_LEAKS
77 #endif // CHECK_MEMORY_LEAKS
104 int simStartTime = 0;
106 std::vector<std::string> guiSettingsFiles;
107 bool osgView =
false;
133 if (oc.
isSet(
"configuration-file")) {
135 }
else if (oc.
isSet(
"net-file")) {
152 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
171 vehControl =
new GUIMEVehicleControl();
185 std::map<int, TraCIServer::CmdExecutor> execs;
195 NLHandler handler(
"", *net, db, tb, *eb, jb);
197 NLBuilder builder(oc, *net, *eb, jb, db, handler);
201 if (!builder.
build()) {
209 osgView = oc.
getBool(
"osg-view");
213 if (std::string(e.what()) != std::string(
"Process Error") && std::string(e.what()) != std::string(
"")) {
220 }
catch (std::exception& e) {
240 const std::vector<std::string>& guiSettingsFiles,
241 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
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) ...
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(bool loadConfig, int argc=0, char **argv=0)
Parses the command line arguments and loads the configuration optionally.
The main interface for loading a microsim.
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static MTRand * getParsingRNG()
static bool gRunAfterLoad
the simulation shall start direct after loading
FXEX::FXThreadEvent & myEventThrow
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.
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on...
#define CMD_SET_GUI_VARIABLE
static bool processSet(TraCIServer &server, tcpip::Storage &inputStorage, tcpip::Storage &outputStorage)
Processes a set value command (Command 0xcc: Change GUI State)
static OptionsCont & getOptions()
Retrieves the options.
static void initRandGlobal(MTRand *which=0)
Reads the given random number options and initialises the random number generator in accordance...
OutputDevice * myMessageRetriever
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
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
GUILoadThread(FXApp *app, MFXInterThreadEventClient *mw, MFXEventQue< GUIEvent * > &eq, FXEX::FXThreadEvent &ev)
constructor
void clear()
Removes all information from the container.
std::string myTitle
the title string for the application
Builder of microsim-junctions and tls.
void reloadConfigOrNet()
reloads according to the given input options
SUMOTime string2time(const std::string &r)
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
const std::string & getFileName() const
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 const bool gUseMesoSim
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)
don't draw any textures
The class responsible for building and deletion of vehicles.
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)
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.