57 myNet(nullptr), myHalting(true), myQuit(false), mySimulationInProgress(false), myOk(true), myHaveSignaledEnd(false),
58 mySimDelay(simDelay), myEventQue(eq), myEventThrow(ev) {
97 if (std::string(e2.what()) != std::string(
"Process Error") && std::string(e2.what()) != std::string(
"")) {
218 if (std::string(e2.what()) != std::string(
"Process Error") && std::string(e2.what()) != std::string(
"")) {
275 return myNet !=
nullptr;
288 if (
myNet !=
nullptr) {
345 window->getView()->waitForSnapshots(snapshotTime);
Event sent when the the simulation is over.
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.
virtual FXint run()
starts the execution
virtual bool init(GUINet *net, SUMOTime start, SUMOTime end)
initialises the thread with the new simulation
std::string time2string(SUMOTime t)
virtual bool simulationIsStopable() const
void setCurrentTimeStep(const SUMOTime step)
Sets the current simulation step (used by state loading)
The final simulation step has been performed.
virtual void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
std::vector< std::string > & getLoadArgs()
void clear()
Clears this container.
SimulationState
Possible states of a simulation - running or stopped with different reasons.
virtual bool simulationIsStepable() const
void setIdleDuration(int val)
Sets the duration of the last step's idle part.
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
static OptionsCont & getOptions()
Retrieves the options.
void retrieveMessage(const MsgHandler::MsgType type, const std::string &msg)
Retrieves messages from the loading module.
bool myHalting
information whether the simulation is halting (is not being executed)
bool myHaveSignaledEnd
whether the simulation already ended
The simulation does not contain further vehicles.
An error occurred during the simulation step.
std::vector< SUMOTime > myBreakpoints
List of breakpoints.
static void cleanupOnEnd()
Removes pending handler.
SimulationState simulationState(SUMOTime stopTime) const
Called after a simulation step, this method returns the current simulation state. ...
static void sleep(long ms)
virtual ~GUIRunThread()
destructor
static GUIMainWindow * getInstance()
void closeSimulation(SUMOTime start)
Closes the simulation (all files, connections, etc.)
FXSynchQue< GUIEvent * > & myEventQue
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
virtual bool simulationIsStartable() const
The connection to a client was closed by the client.
The simulation is running.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
bool simulationAvailable() const
virtual void removeRetriever(OutputDevice *retriever)
Removes the retriever from the handler.
bool mySimulationInProgress
static MsgHandler * getMessageInstance()
Returns the instance to add normal messages to.
OutputDevice * myWarningRetriever
GUINet * myNet
the loaded simulation network
OutputDevice * myMessageRetriever
The message is a warning.
void setSimDuration(int val)
Sets the duration of the last step's simulation part.
Encapsulates an object's method for using it as a message retriever.
The simulation is loading.
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on...
void prepareDestruction()
A MSNet extended by some values for usage within the gui.
const std::vector< GUIGlChildWindow * > & getViews() const
void waitForSnapshots(const SUMOTime snapshotTime)
static TraCIServer * getInstance()
virtual void inform(std::string msg, bool addType=true)
adds a new error to the list
The simulation had too many teleports.
FXMutex myBreakpointLock
Lock for modifying the list of breakpoints.
static void closeAll(bool keepErrorRetrievers=false)
static std::string getStateMessage(SimulationState state)
Returns the message to show if a certain state occurs.
void simulationStep()
Performs a single simulation step (locking the simulation)
static long getCurrentMillis()
Returns the current time in milliseconds.
void loadRoutes()
loads routes for the next few steps
FXEX::FXThreadEvent & myEventThrow
SUMOTime mySimStartTime
the times the simulation starts and ends with
#define WRITE_MESSAGE(msg)
void guiSimulationStep()
Some further steps needed for gui processing.
GUIRunThread(FXApp *app, MFXInterThreadEventClient *mw, double &simDelay, FXSynchQue< GUIEvent *> &eq, FXEX::FXThreadEvent &ev)
constructor
static bool wasClosed()
check whether close was requested