SUMO - Simulation of Urban MObility
GUITLLogicPhasesTrackerWindow.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // A window displaying the phase diagram of a tl-logic
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 GUITLLogicPhasesTrackerWindow_h
23 #define GUITLLogicPhasesTrackerWindow_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 <vector>
36 #include <string>
37 #include <bitset>
38 #include <utility>
39 #include <fx.h>
40 #include <fx3d.h>
46 #include <utils/common/SUMOTime.h>
48 
49 
50 // ===========================================================================
51 // class declarations
52 // ===========================================================================
53 class GUIMainWindow;
56 class MFXMutex;
57 
58 
59 // ===========================================================================
60 // class definitions
61 // ===========================================================================
67  : public FXMainWindow,
68  public ValueRetriever<std::pair<SUMOTime, MSPhaseDefinition> > {
70 public:
79  ValueSource<std::pair<SUMOTime, MSPhaseDefinition> >* src);
80 
81 
89  GUIMainWindow& app,
91  const MSSimpleTrafficLightLogic::Phases& phases);
92 
93 
96 
97 
99  void create();
100 
101 
105  void addValue(std::pair<SUMOTime, MSPhaseDefinition> def);
106 
107 
111  void setBeginTime(SUMOTime time);
112 
113 
116 
118  long onConfigure(FXObject* sender, FXSelector sel, void* data);
119 
121  long onPaint(FXObject* sender, FXSelector sel, void* data);
122 
124  long onSimStep(FXObject* sender, FXSelector sel, void* data);
126 
127 
128 public:
130  typedef std::vector<MSPhaseDefinition> PhasesVector;
131 
133  typedef std::vector<SUMOTime> DurationsVector;
134 
135 
144  public:
150  GUITLLogicPhasesTrackerPanel(FXComposite* c,
152 
155 
158 
159 
162 
164  long onConfigure(FXObject*, FXSelector, void*);
165 
167  long onPaint(FXObject*, FXSelector, void*);
169 
170 
171  private:
174 
177 
178  protected:
181 
182  };
183 
184 
188  void drawValues(GUITLLogicPhasesTrackerPanel& caller);
189 
190 
191 private:
194 
197 
199  PhasesVector myPhases;
200 
202  DurationsVector myDurations;
203 
206 
209 
213  std::vector<std::string> myLinkNames;
214 
217 
220 
223 
226 
229 
232 
235 
237  FXToolBarShell* myToolBarDrag;
238 
240  FXToolBar* myToolBar;
241 
243  FXRealSpinDial* myBeginOffset;
244 
245 
246 protected:
249 
250 
251 };
252 
253 
254 #endif
255 
256 /****************************************************************************/
257 
std::vector< SUMOTime > DurationsVector
Definition of a storage for durations.
bool myAmInTrackingMode
Information whether the tracking mode is on.
GUIMainWindow * myApplication
The main application.
long onSimStep(FXObject *sender, FXSelector sel, void *data)
called on a simulation step
void create()
Creates the window (FOX-Toolkit)
std::vector< std::string > myLinkNames
The names of links.
PhasesVector myPhases
The list of phases.
DurationsVector myDurations
The list of phase durations.
long onConfigure(FXObject *sender, FXSelector sel, void *data)
called on size change
size_t myFirstPhase2Show
The index of the first phase that fits into the window.
void drawValues(GUITLLogicPhasesTrackerPanel &caller)
Draws all values.
SUMOTime myFirstTime2Show
The time the diagram begins at.
long onConfigure(FXObject *, FXSelector, void *)
called on size change
size_t myFirstPhaseOffset
The offset to draw the first phase (left offset)
FXRealSpinDial * myBeginOffset
The offset changer (tracking mode)
FXToolBarShell * myToolBarDrag
The tool bar drag (tracking mode)
SUMOTime myLastTime
The last time a phase was added at.
void addValue(std::pair< SUMOTime, MSPhaseDefinition > def)
Adds a further phase definition.
GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > > * myConnector
The connector for retrieval of further phases.
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
std::vector< MSPhaseDefinition > PhasesVector
}
MSTrafficLightLogic * myTLLogic
The logic to display.
long onPaint(FXObject *sender, FXSelector sel, void *data)
called if the widget shall be repainted
GUITLLogicPhasesTrackerPanel * myPanel
The panel to draw on.
This window displays a phase diagram for a chosen tl-logic.
The parent class for traffic light logics.
MFXMutex myLock
A lock to avoid addition of new values while drawing.
FXToolBar * myToolBar
The tool bar (tracking mode)
void setBeginTime(SUMOTime time)
Sets the time the display shall be shown as beginning at.
GUITLLogicPhasesTrackerWindow()
protected constructor for FOX
long onPaint(FXObject *, FXSelector, void *)
called if the widget shall be repainted
SUMOTime myBeginTime
The first time a phase was added at.
Class passing values from a GUIGlObject to another object.