Eclipse SUMO - Simulation of Urban MObility
GUITLLogicPhasesTrackerWindow.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // A window displaying the phase diagram of a tl-logic
17 /****************************************************************************/
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <vector>
26 #include <iostream>
28 #include <utils/gui/div/GLHelper.h>
31 #include <microsim/MSLink.h>
32 #include <utils/common/ToString.h>
41 
42 
43 // ===========================================================================
44 // member method definitions
45 // ===========================================================================
46 /* -------------------------------------------------------------------------
47  * GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel-callbacks
48  * ----------------------------------------------------------------------- */
52 
53 };
54 
55 // Macro for the GLTestApp class hierarchy implementation
56 FXIMPLEMENT(GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel, FXGLCanvas, GUITLLogicPhasesTrackerPanelMap, ARRAYNUMBER(GUITLLogicPhasesTrackerPanelMap))
57 
58 
59 
60 /* -------------------------------------------------------------------------
61  * GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel-methods
62  * ----------------------------------------------------------------------- */
64  FXComposite* c, GUIMainWindow& app,
66  : FXGLCanvas(c, app.getGLVisual(), app.getBuildGLCanvas(), (FXObject*) nullptr, (FXSelector) 0, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y/*, 0, 0, 300, 200*/),
67  myParent(&parent) {}
68 
69 
71 
72 
73 long
75  FXObject*, FXSelector, void*) {
76  if (makeCurrent()) {
77  int widthInPixels = getWidth();
78  int heightInPixels = getHeight();
79  if (widthInPixels != 0 && heightInPixels != 0) {
80  glViewport(0, 0, widthInPixels - 1, heightInPixels - 1);
81  glClearColor(0, 0, 0, 1);
82  glDisable(GL_DEPTH_TEST);
83  glDisable(GL_LIGHTING);
84  glDisable(GL_LINE_SMOOTH);
85  glEnable(GL_BLEND);
86  glEnable(GL_ALPHA_TEST);
87  glDisable(GL_COLOR_MATERIAL);
88  glLineWidth(1);
89  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
90  }
91  }
92  return 1;
93 }
94 
95 
96 long
98  FXObject*, FXSelector, void*) {
99  if (!isEnabled()) {
100  return 1;
101  }
102  if (makeCurrent()) {
103  int widthInPixels = getWidth();
104  int heightInPixels = getHeight();
105  if (widthInPixels != 0 && heightInPixels != 0) {
106  glViewport(0, 0, widthInPixels - 1, heightInPixels - 1);
107  glClearColor(0, 0, 0, 1);
108  glDisable(GL_DEPTH_TEST);
109  glDisable(GL_LIGHTING);
110  glDisable(GL_LINE_SMOOTH);
111  glEnable(GL_BLEND);
112  glEnable(GL_ALPHA_TEST);
113  glDisable(GL_COLOR_MATERIAL);
114  glLineWidth(1);
115  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
116  // draw
117  glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
118  myParent->drawValues(*this);
119  swapBuffers();
120  }
121  makeNonCurrent();
122  }
123  return 1;
124 }
125 
126 
127 
128 /* -------------------------------------------------------------------------
129  * GUITLLogicPhasesTrackerWindow - FOX callback mapping
130  * ----------------------------------------------------------------------- */
131 FXDEFMAP(GUITLLogicPhasesTrackerWindow) GUITLLogicPhasesTrackerWindowMap[] = {
132  FXMAPFUNC(SEL_CONFIGURE, 0, GUITLLogicPhasesTrackerWindow::onConfigure),
133  FXMAPFUNC(SEL_PAINT, 0, GUITLLogicPhasesTrackerWindow::onPaint),
134  FXMAPFUNC(SEL_COMMAND, MID_SIMSTEP, GUITLLogicPhasesTrackerWindow::onSimStep),
135 
136 };
137 
138 FXIMPLEMENT(GUITLLogicPhasesTrackerWindow, FXMainWindow, GUITLLogicPhasesTrackerWindowMap, ARRAYNUMBER(GUITLLogicPhasesTrackerWindowMap))
139 
140 
141 /* -------------------------------------------------------------------------
142  * GUITLLogicPhasesTrackerWindow-methods
143  * ----------------------------------------------------------------------- */
145  GUIMainWindow& app,
147  ValueSource<std::pair<SUMOTime, MSPhaseDefinition> >* src)
148  : FXMainWindow(app.getApp(), "TLS-Tracker", nullptr, nullptr, DECOR_ALL,
149  20, 20, 300, 200),
150  myApplication(&app), myTLLogic(&logic), myAmInTrackingMode(true) {
151  // build the toolbar
152  myToolBarDrag = new FXToolBarShell(this, GUIDesignToolBar);
153  myToolBar = new FXToolBar(this, myToolBarDrag, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | FRAME_RAISED);
154  new FXToolBarGrip(myToolBar, myToolBar, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
155  // interval manipulation
156  myBeginOffset = new FXRealSpinner(myToolBar, 10, this, MID_SIMSTEP, LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK);
157  //myBeginOffset->setFormatString("%.0f");
158  //myBeginOffset->setIncrements(1, 10, 100);
159  myBeginOffset->setIncrement(10);
160  myBeginOffset->setRange(60, 3600);
161  myBeginOffset->setValue(240);
162  new FXLabel(myToolBar, "(s)", nullptr, LAYOUT_CENTER_Y);
163  //
165  FXint height = (FXint)(myTLLogic->getLinks().size() * 20 + 30 + 8 + 30);
166  app.addChild(this);
167  for (int i = 0; i < (int)myTLLogic->getLinks().size(); ++i) {
168  myLinkNames.push_back(toString<int>(i));
169  }
170  FXVerticalFrame* glcanvasFrame =
171  new FXVerticalFrame(this,
172  FRAME_SUNKEN | LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y,
173  0, 0, 0, 0, 0, 0, 0, 0);
174  myPanel = new
175  GUITLLogicPhasesTrackerPanel(glcanvasFrame, *myApplication, *this);
176  setTitle((logic.getID() + " - " + logic.getProgramID() + " - tracker").c_str());
178  setHeight(height);
179  setWidth(700);
180 }
181 
182 
184  GUIMainWindow& app,
186  const MSSimpleTrafficLightLogic::Phases& /*phases*/)
187  : FXMainWindow(app.getApp(), "TLS-Tracker", nullptr, nullptr, DECOR_ALL,
188  20, 20, 300, 200),
189  myApplication(&app), myTLLogic(&logic), myAmInTrackingMode(false),
190  myToolBarDrag(nullptr), myBeginOffset(nullptr) {
191  myConnector = nullptr;
192  FXint height = (FXint)(myTLLogic->getLinks().size() * 20 + 30 + 8);
193  setTitle("TLS-Tracker");
194  app.addChild(this);
195  for (int i = 0; i < (int)myTLLogic->getLinks().size(); ++i) {
196  myLinkNames.push_back(toString<int>(i));
197  }
198  FXVerticalFrame* glcanvasFrame =
199  new FXVerticalFrame(this,
200  FRAME_SUNKEN | LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y,
201  0, 0, 0, 0, 0, 0, 0, 0);
202  myPanel = new
203  GUITLLogicPhasesTrackerPanel(glcanvasFrame, *myApplication, *this);
204  setTitle((logic.getID() + " - " + logic.getProgramID() + " - tracker").c_str());
206  setHeight(height);
207  setWidth(700);
208 }
209 
210 
212  myApplication->removeChild(this);
213  delete myConnector;
214  // just to quit cleanly on a failure
215  if (myLock.locked()) {
216  myLock.unlock();
217  }
218  delete myToolBarDrag;
219 }
220 
221 
222 void
224  FXMainWindow::create();
225  if (myToolBarDrag != nullptr) {
226  myToolBarDrag->create();
227  }
228 }
229 
230 
231 void
233  // compute what shall be shown (what is visible)
234  myFirstPhase2Show = 0;
235  myFirstPhaseOffset = 0;
236  SUMOTime leftOffset = 0;
237  myFirstTime2Show = 0;
238  if (!myAmInTrackingMode) {
239  myPhases.clear();
240  myDurations.clear();
241  // insert phases
242  MSSimpleTrafficLightLogic* simpleTLLogic = dynamic_cast<MSSimpleTrafficLightLogic*>(myTLLogic);
243  if (simpleTLLogic == nullptr) {
244  return;
245  }
246  const MSSimpleTrafficLightLogic::Phases& phases = simpleTLLogic->getPhases();
247  MSSimpleTrafficLightLogic::Phases::const_iterator j;
248  myLastTime = 0;
249  myBeginTime = 0;
250  for (j = phases.begin(); j != phases.end(); ++j) {
251  myPhases.push_back(*(*j));
252  myDurations.push_back((*j)->duration);
253  myLastTime += (*j)->duration;
254  }
255  if (myLastTime <= myBeginTime) {
256  WRITE_ERROR("Overflow in time computation occurred.");
257  return;
258  }
259  } else {
260  SUMOTime beginOffset = TIME2STEPS(myBeginOffset->getValue());
261  myBeginTime = myLastTime - beginOffset;
263  // check whether no phases are known at all
264  if (myDurations.size() != 0) {
265  SUMOTime durs = 0;
266  int phaseOffset = (int)myDurations.size() - 1;
267  DurationsVector::reverse_iterator i = myDurations.rbegin();
268  while (i != myDurations.rend()) {
269  if (durs + (*i) > beginOffset) {
270  myFirstPhase2Show = phaseOffset;
271  myFirstPhaseOffset = (durs + (*i)) - beginOffset;
272  break;
273  }
274  durs += (*i);
275  phaseOffset--;
276  ++i;
277  }
278  if (i == myDurations.rend()) {
279  // there are too few information stored;
280  myFirstPhase2Show = 0;
281  myFirstPhaseOffset = 0;
282  leftOffset = beginOffset - durs;
283  }
284  }
285  }
286  // begin drawing
287  glMatrixMode(GL_PROJECTION);
288  glLoadIdentity();
289  glMatrixMode(GL_MODELVIEW);
290  glLoadIdentity();
291  glTranslated(-1, -1, 0);
292  glScaled(2, 2, 1);
293  glDisable(GL_TEXTURE_2D);
294  // draw the horizontal lines dividing the signal groups
295  glColor3d(1, 1, 1);
296  // compute some values needed more than once
297  const double height = (double) caller.getHeight();
298  const double width = (double) caller.getWidth();
299  const double barWidth = MAX2(1.0, width - 31);
300  const double fontHeight = 0.08 * 300. / height;
301  const double fontWidth = 0.08 * 300. / width;
302  const double h9 = ((double) 9 / height);
303  const double h10 = ((double) 10 / height);
304  const double h11 = ((double) 11 / height);
305  const double h16 = ((double) 16 / height);
306  const double h20 = ((double) 20 / height);
307  // draw the link names and the lines dividing them
308  double h = (double)(1.0 - h10);
309  double h2 = 12;
310  for (int i = 0; i < (int)myTLLogic->getLinks().size() + 1; ++i) {
311  // draw the bar
312  glBegin(GL_LINES);
313  glVertex2d(0, h);
314  glVertex2d((double)(30. / width), h);
315  glEnd();
316  // draw the name
317  if (i < (int)myTLLogic->getLinks().size()) {
318  glTranslated(0, h - h20, 0);
319  GLHelper::drawText(myLinkNames[i], Position(0, 0), 1, fontHeight, RGBColor::WHITE, 0, FONS_ALIGN_LEFT | FONS_ALIGN_BOTTOM, fontWidth);
320  glTranslated(0, -h + h20, 0);
321  h2 += 20;
322  }
323  h -= h20;
324  }
325  glBegin(GL_LINES);
326  glVertex2d(0, h + h20);
327  glVertex2d(1.0, h + h20);
328  glEnd();
329 
330  // draw the names closure (vertical line)
331  h += (double) 20 / height;
332  glColor3d(1, 1, 1);
333  glBegin(GL_LINES);
334  glVertex2d((double) 30 / width, 1.0);
335  glVertex2d((double) 30 / width, h);
336  glEnd();
337 
338 
339  // draw the phases
340  // disable value addition while drawing
341  myLock.lock();
342  // determine the initial offset
343  double x = ((double) 31. / width);
344  double ta = (double) leftOffset / width;
345  ta *= (double)((barWidth / ((double)(myLastTime - myBeginTime))));
346  x += ta;
347 
348  // and the initial phase information
349  PhasesVector::iterator pi = myPhases.begin() + myFirstPhase2Show;
350 
352 
353  // start drawing
354  for (DurationsVector::iterator pd = myDurations.begin() + myFirstPhase2Show; pd != myDurations.end(); ++pd) {
355  SUMOTime i = 30;
356  // the first phase may be drawn incompletely
357  SUMOTime duration = *pd - fpo;
358  // compute the heigh and the width of the phase
359  h = (double)(1.0 - h10);
360  double a = (double) duration / width;
361  a *= (double)((barWidth / ((double)(myLastTime - myBeginTime))));
362  const double x2 = x + a;
363 
364  // go through the links
365  for (int j = 0; j < (int) myTLLogic->getLinks().size(); ++j) {
366  // determine the current link's color
367  LinkState state = pi->getSignalState(j);
368  // draw the bar (red is drawn as a line)
370  switch (state) {
371  case LINKSTATE_TL_RED:
373  // draw a thin line
374  glBegin(GL_QUADS);
375  glVertex2d(x, h - h11);
376  glVertex2d(x, h - h9);
377  glVertex2d(x2, h - h9);
378  glVertex2d(x2, h - h11);
379  glEnd();
380  break;
381  default:
382  // draw a thick block
383  glBegin(GL_QUADS);
384  glVertex2d(x, h - h16);
385  glVertex2d(x, h);
386  glVertex2d(x2, h);
387  glVertex2d(x2, h - h16);
388  glEnd();
389  break;
390  }
391  // proceed to next link
392  h -= h20;
393  }
394  // proceed to next phase
395  i += duration;
396  ++pi;
397  x = x2;
398  // all further phases are drawn in full
399  fpo = 0;
400  }
401  // allow value addition
402  myLock.unlock();
403 
404  glColor3d(1, 1, 1);
405  if (myPhases.size() != 0) {
406  SUMOTime tickDist = TIME2STEPS(10);
407  // patch distances - hack
408  double t = myBeginOffset != nullptr ? (double) myBeginOffset->getValue() : STEPS2TIME(myLastTime - myBeginTime);
409  while (t > barWidth / 4.) {
410  tickDist += TIME2STEPS(10);
411  t -= (double)(barWidth / 4.);
412  }
413  // draw time information
414  //h = (double)(myTLLogic->getLinks().size() * 20 + 12);
415  double glh = (double)(1.0 - myTLLogic->getLinks().size() * h20 - h10);
416  // current begin time
417  // time ticks
418  SUMOTime currTime = myFirstTime2Show;
419  int pos = 31;// + /*!!!currTime*/ - myFirstTime2Show;
420  double glpos = (double) pos / width;
421  const double ticSize = 4 / height;
422  while (pos < width + 50) {
423  const std::string timeStr = (gHumanReadableTime
424  ? time2string(currTime % 3600000).substr(3) // only write mn:ss
425  : toString((int)STEPS2TIME(currTime)));
426  const double w = 50 / width;
427  glTranslated(glpos - w / 2., glh - h20, 0);
428  GLHelper::drawText(timeStr, Position(0, 0), 1, fontHeight, RGBColor::WHITE, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth);
429  glTranslated(-glpos + w / 2., -glh + h20, 0);
430 
431  glBegin(GL_LINES);
432  glVertex2d(glpos, glh);
433  glVertex2d(glpos, glh - ticSize);
434  glEnd();
435 
436  const double a = STEPS2TIME(tickDist) * barWidth / STEPS2TIME(myLastTime - myBeginTime);
437  pos += (int) a;
438  glpos += a / width;
439  currTime += tickDist;
440  }
441  }
442 }
443 
444 
445 void
446 GUITLLogicPhasesTrackerWindow::addValue(std::pair<SUMOTime, MSPhaseDefinition> def) {
447  // do not draw while adding
448  myLock.lock();
449  // set the first time if not set before
450  if (myPhases.size() == 0) {
451  myBeginTime = def.first;
452  }
453  // append or set the phase
454  if (myPhases.size() == 0 || *(myPhases.end() - 1) != def.second) {
455  myPhases.push_back(def.second);
456  myDurations.push_back(DELTA_T);
457  } else {
458  *(myDurations.end() - 1) += DELTA_T;
459  }
460  // set the last time a phase was added at
461  myLastTime = def.first;
462  // allow drawing
463  myLock.unlock();
464 }
465 
466 
467 long
469  FXSelector sel, void* data) {
470  myPanel->onConfigure(sender, sel, data);
471  return FXMainWindow::onConfigure(sender, sel, data);
472 }
473 
474 
475 long
477  FXSelector sel, void* data) {
478  myPanel->onPaint(sender, sel, data);
479  return FXMainWindow::onPaint(sender, sel, data);
480 }
481 
482 
483 long
485  FXSelector, void*) {
486  update();
487  return 1;
488 }
489 
490 
491 void
493  myBeginTime = time;
494 }
495 
496 
497 /****************************************************************************/
498 
GUITLLogicPhasesTrackerWindow::myApplication
GUIMainWindow * myApplication
The main application.
Definition: GUITLLogicPhasesTrackerWindow.h:187
GUITLLogicPhasesTrackerWindow::myBeginOffset
FXRealSpinner * myBeginOffset
The offset changer (tracking mode)
Definition: GUITLLogicPhasesTrackerWindow.h:237
ToString.h
GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel
The canvas for the visualisation of phases.
Definition: GUITLLogicPhasesTrackerWindow.h:139
GUIDesignToolBarGrip
#define GUIDesignToolBarGrip
design for toolbar grip (used to change the position of toolbar with mouse)
Definition: GUIDesigns.h:307
GUITLLogicPhasesTrackerWindow::~GUITLLogicPhasesTrackerWindow
~GUITLLogicPhasesTrackerWindow()
Destructor.
Definition: GUITLLogicPhasesTrackerWindow.cpp:211
GUITLLogicPhasesTrackerWindow::myAmInTrackingMode
bool myAmInTrackingMode
Information whether the tracking mode is on.
Definition: GUITLLogicPhasesTrackerWindow.h:228
GUITLLogicPhasesTrackerWindow::myLinkNames
std::vector< std::string > myLinkNames
The names of links.
Definition: GUITLLogicPhasesTrackerWindow.h:207
MSTrafficLightLogic::getProgramID
const std::string & getProgramID() const
Returns this tl-logic's id.
Definition: MSTrafficLightLogic.h:174
DELTA_T
SUMOTime DELTA_T
Definition: SUMOTime.cpp:36
GUITLLogicPhasesTrackerWindow
This window displays a phase diagram for a chosen tl-logic.
Definition: GUITLLogicPhasesTrackerWindow.h:65
MSTrafficLightLogic::Phases
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
Definition: MSTrafficLightLogic.h:61
MsgHandler.h
GUITLLogicPhasesTrackerWindow::onSimStep
long onSimStep(FXObject *sender, FXSelector sel, void *data)
called on a simulation step
Definition: GUITLLogicPhasesTrackerWindow.cpp:484
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
GUITLLogicPhasesTrackerWindow::create
void create()
Creates the window (FOX-Toolkit)
Definition: GUITLLogicPhasesTrackerWindow.cpp:223
FONS_ALIGN_LEFT
@ FONS_ALIGN_LEFT
Definition: fontstash.h:42
GUITLLogicPhasesTrackerWindow::onConfigure
long onConfigure(FXObject *sender, FXSelector sel, void *data)
called on size change
Definition: GUITLLogicPhasesTrackerWindow.cpp:468
GUITLLogicPhasesTrackerWindow::myFirstPhase2Show
int myFirstPhase2Show
The index of the first phase that fits into the window.
Definition: GUITLLogicPhasesTrackerWindow.h:210
GUITLLogicPhasesTrackerWindow::myPhases
PhasesVector myPhases
The list of phases.
Definition: GUITLLogicPhasesTrackerWindow.h:193
GUIVisualizationSettings.h
GLHelper.h
GUIDesigns.h
GUITLLogicPhasesTrackerWindow::drawValues
void drawValues(GUITLLogicPhasesTrackerPanel &caller)
Draws all values.
Definition: GUITLLogicPhasesTrackerWindow.cpp:232
GUIIconSubSys::getIcon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:609
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:621
GUITLLogicPhasesTrackerWindow::myDurations
DurationsVector myDurations
The list of phase durations.
Definition: GUITLLogicPhasesTrackerWindow.h:196
GUIMainWindow.h
GUIAppEnum.h
MAX2
T MAX2(T a, T b)
Definition: StdDefs.h:79
MSTrafficLightLogic.h
GLHelper::drawText
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
Definition: GLHelper.cpp:673
LinkState
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
Definition: SUMOXMLDefinitions.h:1137
TIME2STEPS
#define TIME2STEPS(x)
Definition: SUMOTime.h:58
LINKSTATE_TL_REDYELLOW
@ LINKSTATE_TL_REDYELLOW
The link has red light (must brake) but indicates upcoming green.
Definition: SUMOXMLDefinitions.h:1145
GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onConfigure
long onConfigure(FXObject *, FXSelector, void *)
called on size change
Definition: GUITLLogicPhasesTrackerWindow.cpp:74
GUITLLogicPhasesTrackerWindow.h
STEPS2TIME
#define STEPS2TIME(x)
Definition: SUMOTime.h:56
MID_SIMSTEP
@ MID_SIMSTEP
A Simulation step was performed.
Definition: GUIAppEnum.h:456
update
GUITrafficLightLogicWrapper.h
GUIMainWindow::removeChild
void removeChild(FXMainWindow *child)
Definition: GUIMainWindow.cpp:115
GUIDesignToolBar
#define GUIDesignToolBar
design for default toolbar
Definition: GUIDesigns.h:295
FONS_ALIGN_MIDDLE
@ FONS_ALIGN_MIDDLE
Definition: fontstash.h:47
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
MSSimpleTrafficLightLogic
A fixed traffic light logic.
Definition: MSSimpleTrafficLightLogic.h:54
time2string
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:67
GLObjectValuePassConnector
Class passing values from a GUIGlObject to another object.
Definition: GLObjectValuePassConnector.h:59
GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onPaint
long onPaint(FXObject *, FXSelector, void *)
called if the widget shall be repainted
Definition: GUITLLogicPhasesTrackerWindow.cpp:97
GUITLLogicPhasesTrackerWindow::myLock
FXMutex myLock
A lock to avoid addition of new values while drawing.
Definition: GUITLLogicPhasesTrackerWindow.h:202
GUITLLogicPhasesTrackerWindow::myFirstTime2Show
SUMOTime myFirstTime2Show
The time the diagram begins at.
Definition: GUITLLogicPhasesTrackerWindow.h:216
MSTrafficLightLogic
The parent class for traffic light logics.
Definition: MSTrafficLightLogic.h:55
GUITLLogicPhasesTrackerWindow::myToolBarDrag
FXToolBarShell * myToolBarDrag
The tool bar drag (tracking mode)
Definition: GUITLLogicPhasesTrackerWindow.h:231
GUITLLogicPhasesTrackerWindow::addValue
void addValue(std::pair< SUMOTime, MSPhaseDefinition > def)
Adds a further phase definition.
Definition: GUITLLogicPhasesTrackerWindow.cpp:446
GUIVisualizationSettings::getLinkColor
static const RGBColor & getLinkColor(const LinkState &ls)
map from LinkState to color constants
Definition: GUIVisualizationSettings.cpp:1608
GUIIconSubSys.h
GUITLLogicPhasesTrackerWindow::myConnector
GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > > * myConnector
The connector for retrieval of further phases.
Definition: GUITLLogicPhasesTrackerWindow.h:225
GLIncludes.h
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
MSTrafficLightLogic::getLinks
const LinkVectorVector & getLinks() const
Returns the list of lists of all affected links.
Definition: MSTrafficLightLogic.h:203
GUIMainWindow
Definition: GUIMainWindow.h:46
gHumanReadableTime
bool gHumanReadableTime
Definition: StdDefs.cpp:28
GUITLLogicPhasesTrackerWindow::myLastTime
SUMOTime myLastTime
The last time a phase was added at.
Definition: GUITLLogicPhasesTrackerWindow.h:222
GUITLLogicPhasesTrackerWindow::myToolBar
FXToolBar * myToolBar
The tool bar (tracking mode)
Definition: GUITLLogicPhasesTrackerWindow.h:234
GUITrafficLightLogicWrapper
Definition: GUITrafficLightLogicWrapper.h:47
GUITLLogicPhasesTrackerWindow::myTLLogic
MSTrafficLightLogic * myTLLogic
The logic to display.
Definition: GUITLLogicPhasesTrackerWindow.h:190
GUITLLogicPhasesTrackerWindow::onPaint
long onPaint(FXObject *sender, FXSelector sel, void *data)
called if the widget shall be repainted
Definition: GUITLLogicPhasesTrackerWindow.cpp:476
MSSimpleTrafficLightLogic::getPhases
const Phases & getPhases() const
Returns the phases of this tls program.
Definition: MSSimpleTrafficLightLogic.cpp:103
GUITLLogicPhasesTrackerWindow::myFirstPhaseOffset
SUMOTime myFirstPhaseOffset
The offset to draw the first phase (left offset)
Definition: GUITLLogicPhasesTrackerWindow.h:213
GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::~GUITLLogicPhasesTrackerPanel
~GUITLLogicPhasesTrackerPanel()
Destructor.
Definition: GUITLLogicPhasesTrackerWindow.cpp:70
config.h
ValueSource
Definition: ValueSource.h:32
ICON_APP_TLSTRACKER
@ ICON_APP_TLSTRACKER
Definition: GUIIcons.h:112
LINKSTATE_TL_RED
@ LINKSTATE_TL_RED
The link has red light (must brake)
Definition: SUMOXMLDefinitions.h:1143
GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow
GUITLLogicPhasesTrackerWindow()
protected constructor for FOX
Definition: GUITLLogicPhasesTrackerWindow.h:242
MSPhaseDefinition
The definition of a single phase of a tls logic.
Definition: MSPhaseDefinition.h:51
GUITLLogicPhasesTrackerWindow::setBeginTime
void setBeginTime(SUMOTime time)
Sets the time the display shall be shown as beginning at.
Definition: GUITLLogicPhasesTrackerWindow.cpp:492
FXDEFMAP
FXDEFMAP(GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel) GUITLLogicPhasesTrackerPanelMap[]
GUIMainWindow::addChild
void addChild(FXMainWindow *child)
Definition: GUIMainWindow.cpp:107
GUITLLogicPhasesTrackerWindow::myPanel
GUITLLogicPhasesTrackerPanel * myPanel
The panel to draw on.
Definition: GUITLLogicPhasesTrackerWindow.h:199
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:76
WRITE_ERROR
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:283
FONS_ALIGN_BOTTOM
@ FONS_ALIGN_BOTTOM
Definition: fontstash.h:48
GUITLLogicPhasesTrackerWindow::myBeginTime
SUMOTime myBeginTime
The first time a phase was added at.
Definition: GUITLLogicPhasesTrackerWindow.h:219
RGBColor::WHITE
static const RGBColor WHITE
Definition: RGBColor.h:196
fontstash.h