50 #ifdef CHECK_MEMORY_LEAKS 52 #endif // CHECK_MEMORY_LEAKS 78 : FXGLCanvas(c, app.getGLVisual(), app.getBuildGLCanvas(), (FXObject*) 0, (FXSelector) 0, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y),
87 FXObject*, FXSelector,
void*) {
89 int widthInPixels = getWidth();
90 int heightInPixels = getHeight();
91 if (widthInPixels != 0 && heightInPixels != 0) {
92 glViewport(0, 0, widthInPixels - 1, heightInPixels - 1);
93 glClearColor(0, 0, 0, 1);
94 glDisable(GL_DEPTH_TEST);
95 glDisable(GL_LIGHTING);
96 glDisable(GL_LINE_SMOOTH);
98 glEnable(GL_ALPHA_TEST);
99 glDisable(GL_COLOR_MATERIAL);
101 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
110 FXObject*, FXSelector,
void*) {
115 int widthInPixels = getWidth();
116 int heightInPixels = getHeight();
117 if (widthInPixels != 0 && heightInPixels != 0) {
118 glViewport(0, 0, widthInPixels - 1, heightInPixels - 1);
119 glClearColor(0, 0, 0, 1);
120 glDisable(GL_DEPTH_TEST);
121 glDisable(GL_LIGHTING);
122 glDisable(GL_LINE_SMOOTH);
124 glEnable(GL_ALPHA_TEST);
125 glDisable(GL_COLOR_MATERIAL);
127 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
129 glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
160 : FXMainWindow(app.getApp(), "TLS-Tracker", NULL, NULL, DECOR_ALL,
173 new FXLabel(
myToolBar,
"(s)", 0, LAYOUT_CENTER_Y);
177 app.addChild(
this,
true);
181 FXVerticalFrame* glcanvasFrame =
182 new FXVerticalFrame(
this,
183 FRAME_SUNKEN | LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y,
184 0, 0, 0, 0, 0, 0, 0, 0);
187 setTitle((logic.getID() +
" - " + logic.getProgramID() +
" - tracker").c_str());
197 : FXMainWindow(app.getApp(),
"TLS-Tracker", NULL, NULL, DECOR_ALL,
203 setTitle(
"TLS-Tracker");
208 FXVerticalFrame* glcanvasFrame =
209 new FXVerticalFrame(
this,
210 FRAME_SUNKEN | LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y,
211 0, 0, 0, 0, 0, 0, 0, 0);
233 FXMainWindow::create();
252 MSSimpleTrafficLightLogic::Phases::const_iterator j;
255 for (j = phases.begin(); j != phases.end(); ++j) {
261 WRITE_ERROR(
"Overflow in time computation occured.");
272 DurationsVector::reverse_iterator i =
myDurations.rbegin();
274 if (durs + (*i) > beginOffset) {
287 leftOffset = beginOffset - durs;
292 glMatrixMode(GL_PROJECTION);
294 glMatrixMode(GL_MODELVIEW);
296 glTranslated(-1, -1, 0);
298 glDisable(GL_TEXTURE_2D);
318 glVertex2d((
SUMOReal)(30. / width), h);
322 glRotated(180, 1, 0, 0);
324 glTranslated(0.0, -h + h20 - h4, 0);
326 glTranslated(-0.0, h - h20 + h4, 0);
327 glRotated(-180, 1, 0, 0);
333 glVertex2d(0, h + h20);
334 glVertex2d(1.0, h + h20);
341 glVertex2d((
SUMOReal) 30 / width, 1.0);
342 glVertex2d((
SUMOReal) 30 / width, h);
382 glVertex2d(x, h - h11);
383 glVertex2d(x, h - h9);
384 glVertex2d(x2, h - h9);
385 glVertex2d(x2, h - h11);
391 glVertex2d(x, h - h16);
392 glVertex2d(x, h - h4);
393 glVertex2d(x2, h - h4);
394 glVertex2d(x2, h - h16);
416 while (t > (width - 31.) / 4.) {
418 t -= (
SUMOReal)((width - 31.) / 4.);
429 while (pos < width + 50) {
432 glRotated(180, 1, 0, 0);
434 glTranslated(glpos - w / 2., -glh + h20 - h4, 0);
436 glTranslated(-glpos + w / 2., glh - h20 + h4, 0);
437 glRotated(-180, 1, 0, 0);
440 glVertex2d(glpos, glh);
441 glVertex2d(glpos, glh - h4);
447 currTime += tickDist;
477 FXSelector sel,
void* data) {
479 return FXMainWindow::onConfigure(sender, sel, data);
485 FXSelector sel,
void* data) {
487 return FXMainWindow::onPaint(sender, sel, data);
int pfDrawString(const char *c)
bool myAmInTrackingMode
Information whether the tracking mode is on.
GUIMainWindow * myApplication
The main application.
GUITLLogicPhasesTrackerPanel()
protected constructor for FOX
long onSimStep(FXObject *sender, FXSelector sel, void *data)
called on a simulation step
void create()
Creates the window (FOX-Toolkit)
std::string time2string(SUMOTime t)
std::vector< std::string > myLinkNames
The names of links.
void pfSetPosition(SUMOReal x, SUMOReal y)
#define GUIDesignToolBarGrip
design for toolbar grip (used to change the position of toolbar with mouse)
int myFirstPhase2Show
The index of the first phase that fits into the window.
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
FXDEFMAP(GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel) GUITLLogicPhasesTrackerPanelMap[]
A fixed traffic light logic.
A Simulation step was performed.
void drawValues(GUITLLogicPhasesTrackerPanel &caller)
Draws all values.
const std::string & getID() const
Returns the id.
~GUITLLogicPhasesTrackerPanel()
Destructor.
void addChild(FXMDIChild *child, bool updateOnSimStep=true)
Adds a further child window to the list.
SUMOTime myFirstTime2Show
The time the diagram begins at.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
long onConfigure(FXObject *, FXSelector, void *)
called on size change
const LinkVectorVector & getLinks() const
Returns the list of lists of all affected links.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
FXRealSpinDial * myBeginOffset
The offset changer (tracking mode)
FXToolBarShell * myToolBarDrag
The tool bar drag (tracking mode)
void removeChild(FXMDIChild *child)
removes the given child window from the list
SUMOTime myLastTime
The last time a phase was added at.
void pfSetScaleXY(SUMOReal sx, SUMOReal sy)
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.
SUMOTime myFirstPhaseOffset
The offset to draw the first phase (left offset)
std::vector< MSPhaseDefinition * > Phases
Definition of a list of phases, being the junction logic.
void unlock()
release mutex lock
The link has red light (must brake)
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.
SUMOReal pfdkGetStringWidth(const char *c)
The parent class for traffic light logics.
The canvas for the visualisation of phases.
MFXMutex myLock
A lock to avoid addition of new values while drawing.
const std::string & getProgramID() const
Returns this tl-logic's id.
FXToolBar * myToolBar
The tool bar (tracking mode)
GUITLLogicPhasesTrackerWindow * myParent
}
void setBeginTime(SUMOTime time)
Sets the time the display shall be shown as beginning at.
#define GUIDesignToolBarShell3
GUITLLogicPhasesTrackerWindow()
protected constructor for FOX
long onPaint(FXObject *, FXSelector, void *)
called if the widget shall be repainted
The definition of a single phase of a tls logic.
static const RGBColor & getLinkColor(const LinkState &ls)
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
The link has red light (must brake) but indicates upcoming green.
SUMOTime myBeginTime
The first time a phase was added at.
~GUITLLogicPhasesTrackerWindow()
Destructor.
Class passing values from a GUIGlObject to another object.