SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIRunThread.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // The thread that runs the simulation
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef GUIRunThread_h
23 #define GUIRunThread_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <string>
36 #include <iostream>
37 #include <fx.h>
42 #include <utils/common/SUMOTime.h>
43 
44 
45 // ===========================================================================
46 // class declarations
47 // ===========================================================================
48 class GUINet;
49 class OutputDevice;
50 
51 
52 // ===========================================================================
53 // class definition
54 // ===========================================================================
63 public:
66  FXRealSpinDial& simDelay, MFXEventQue& eq, FXEX::FXThreadEvent& ev);
67 
69  virtual ~GUIRunThread();
70 
72  virtual bool init(GUINet* net, SUMOTime start, SUMOTime end);
73 
75  virtual FXint run();
76 
79  void resume();
80 
83  void singleStep();
84 
86  virtual void begin();
87 
89  void stop();
90 
92  bool simulationAvailable() const;
93 
94  virtual bool simulationIsStartable() const;
95  virtual bool simulationIsStopable() const;
96  virtual bool simulationIsStepable() const;
97 
99  virtual void deleteSim();
100 
102  GUINet& getNet() const;
103 
105  void prepareDestruction();
106 
108  void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg);
109 
110 protected:
111  void makeStep();
112 
113 protected:
116 
119 
121  bool myHalting;
122 
125  bool myQuit;
126 
131 
132  bool myOk;
133 
135  bool mySingle;
136 
140 
142 
144 
146 
148 
149 };
150 
151 
152 #endif
153 
154 /****************************************************************************/
155 
virtual bool simulationIsStepable() const
virtual FXint run()
starts the execution
virtual void deleteSim()
virtual bool init(GUINet *net, SUMOTime start, SUMOTime end)
initialises the thread with the new simulation
virtual bool simulationIsStartable() const
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)
Definition: GUIRunThread.h:121
MFXMutex mySimulationLock
Definition: GUIRunThread.h:147
virtual ~GUIRunThread()
destructor
SUMOTime mySimEndTime
Definition: GUIRunThread.h:118
bool mySimulationInProgress
Definition: GUIRunThread.h:130
virtual bool simulationIsStopable() const
GUIRunThread(FXApp *app, MFXInterThreadEventClient *mw, FXRealSpinDial &simDelay, MFXEventQue &eq, FXEX::FXThreadEvent &ev)
constructor
OutputDevice * myWarningRetriever
Definition: GUIRunThread.h:139
GUINet * myNet
the loaded simulation network
Definition: GUIRunThread.h:115
GUINet & getNet() const
OutputDevice * myMessageRetriever
Definition: GUIRunThread.h:139
MFXEventQue & myEventQue
Definition: GUIRunThread.h:143
OutputDevice * myErrorRetriever
The instances of message retriever encapsulations Needed to be deleted from the handler later on...
Definition: GUIRunThread.h:139
void prepareDestruction()
A MSNet extended by some values for usage within the gui.
Definition: GUINet.h:90
bool simulationAvailable() const
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
virtual void begin()
FXEX::FXThreadEvent & myEventThrow
Definition: GUIRunThread.h:145
SUMOTime mySimStartTime
the times the simulation starts and ends with
Definition: GUIRunThread.h:118
Spinner control.
FXRealSpinDial & mySimDelay
Definition: GUIRunThread.h:141