SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
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>
38
#include <
utils/foxtools/FXSingleEventThread.h
>
39
#include <
utils/foxtools/FXRealSpinDial.h
>
40
#include <
utils/foxtools/FXThreadEvent.h
>
41
#include <
utils/foxtools/MFXEventQue.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
// ===========================================================================
62
class
GUIRunThread
:
public
FXSingleEventThread
{
63
public
:
65
GUIRunThread
(FXApp* app,
MFXInterThreadEventClient
* mw,
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
SUMOTime
getSimEndTime
()
const
{
111
return
mySimEndTime
;
112
}
113
114
std::vector<SUMOTime>&
getBreakpoints
() {
115
return
myBreakpoints
;
116
}
117
118
MFXMutex
&
getBreakpointLock
() {
119
return
myBreakpointLock
;
120
}
121
122
protected
:
123
void
makeStep
();
124
125
protected
:
127
GUINet
*
myNet
;
128
130
SUMOTime
mySimStartTime
,
mySimEndTime
;
131
133
bool
myHalting
;
134
137
bool
myQuit
;
138
142
bool
mySimulationInProgress
;
143
144
bool
myOk
;
145
147
bool
mySingle
;
148
151
OutputDevice
*
myErrorRetriever
, *
myMessageRetriever
, *
myWarningRetriever
;
152
153
FXRealSpinDial
&
mySimDelay
;
154
155
MFXEventQue
&
myEventQue
;
156
157
FXEX::FXThreadEvent
&
myEventThrow
;
158
159
MFXMutex
mySimulationLock
;
160
162
std::vector<SUMOTime>
myBreakpoints
;
163
165
MFXMutex
myBreakpointLock
;
166
167
};
168
169
170
#endif
171
172
/****************************************************************************/
173
tmp
buildd
sumo-0.21.0+dfsg
src
gui
GUIRunThread.h
Generated on Thu Nov 20 2014 19:49:54 for SUMO - Simulation of Urban MObility by
1.8.1.2