![]() |
Eclipse SUMO - Simulation of Urban MObility
|
This window displays a phase diagram for a chosen tl-logic. More...
#include <GUITLLogicPhasesTrackerWindow.h>
Data Structures | |
class | GUITLLogicPhasesTrackerPanel |
The canvas for the visualisation of phases. More... | |
Public Member Functions | |
void | addValue (std::pair< SUMOTime, MSPhaseDefinition > def) |
Adds a further phase definition. More... | |
void | create () |
Creates the window (FOX-Toolkit) More... | |
GUITLLogicPhasesTrackerWindow (GUIMainWindow &app, MSTrafficLightLogic &logic, GUITrafficLightLogicWrapper &wrapper, const MSSimpleTrafficLightLogic::Phases &phases) | |
Constructor to show the complete phase diagram. More... | |
GUITLLogicPhasesTrackerWindow (GUIMainWindow &app, MSTrafficLightLogic &logic, GUITrafficLightLogicWrapper &wrapper, ValueSource< std::pair< SUMOTime, MSPhaseDefinition > > *src) | |
Constructor to track current phases. More... | |
void | setBeginTime (SUMOTime time) |
Sets the time the display shall be shown as beginning at. More... | |
~GUITLLogicPhasesTrackerWindow () | |
Destructor. More... | |
FOX-callbacks | |
typedef std::vector< MSPhaseDefinition > | PhasesVector |
} More... | |
typedef std::vector< SUMOTime > | DurationsVector |
Definition of a storage for durations. More... | |
GUIMainWindow * | myApplication |
The main application. More... | |
MSTrafficLightLogic * | myTLLogic |
The logic to display. More... | |
PhasesVector | myPhases |
The list of phases. More... | |
DurationsVector | myDurations |
The list of phase durations. More... | |
GUITLLogicPhasesTrackerPanel * | myPanel |
The panel to draw on. More... | |
FXMutex | myLock |
A lock to avoid addition of new values while drawing. More... | |
std::vector< std::string > | myLinkNames |
The names of links. More... | |
int | myFirstPhase2Show |
The index of the first phase that fits into the window. More... | |
SUMOTime | myFirstPhaseOffset |
The offset to draw the first phase (left offset) More... | |
SUMOTime | myFirstTime2Show |
The time the diagram begins at. More... | |
SUMOTime | myBeginTime |
The first time a phase was added at. More... | |
SUMOTime | myLastTime |
The last time a phase was added at. More... | |
GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > > * | myConnector |
The connector for retrieval of further phases. More... | |
bool | myAmInTrackingMode |
Information whether the tracking mode is on. More... | |
FXToolBarShell * | myToolBarDrag |
The tool bar drag (tracking mode) More... | |
FXToolBar * | myToolBar |
The tool bar (tracking mode) More... | |
FXRealSpinner * | myBeginOffset |
The offset changer (tracking mode) More... | |
long | onConfigure (FXObject *sender, FXSelector sel, void *data) |
called on size change More... | |
long | onPaint (FXObject *sender, FXSelector sel, void *data) |
called if the widget shall be repainted More... | |
long | onSimStep (FXObject *sender, FXSelector sel, void *data) |
called on a simulation step More... | |
void | drawValues (GUITLLogicPhasesTrackerPanel &caller) |
Draws all values. More... | |
GUITLLogicPhasesTrackerWindow () | |
protected constructor for FOX More... | |
This window displays a phase diagram for a chosen tl-logic.
Definition at line 64 of file GUITLLogicPhasesTrackerWindow.h.
typedef std::vector<SUMOTime> GUITLLogicPhasesTrackerWindow::DurationsVector |
Definition of a storage for durations.
Definition at line 131 of file GUITLLogicPhasesTrackerWindow.h.
typedef std::vector<MSPhaseDefinition> GUITLLogicPhasesTrackerWindow::PhasesVector |
}
Definition of a storage for phases
Definition at line 128 of file GUITLLogicPhasesTrackerWindow.h.
GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow | ( | GUIMainWindow & | app, |
MSTrafficLightLogic & | logic, | ||
GUITrafficLightLogicWrapper & | wrapper, | ||
ValueSource< std::pair< SUMOTime, MSPhaseDefinition > > * | src | ||
) |
Constructor to track current phases.
[in] | app | The main application window |
[in] | logic | The logic to track |
[in] | wrapper | The tracked logic's wrapper |
[in] | src | The value source to track |
Definition at line 145 of file GUITLLogicPhasesTrackerWindow.cpp.
References GUIIconSubSys::getIcon(), MSTrafficLightLogic::getLinks(), GUIDesignToolBar, GUIDesignToolBarGrip, ICON_APP_TLSTRACKER, MID_SIMSTEP, myApplication, myBeginOffset, myConnector, myLinkNames, myPanel, myTLLogic, myToolBar, and myToolBarDrag.
GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow | ( | GUIMainWindow & | app, |
MSTrafficLightLogic & | logic, | ||
GUITrafficLightLogicWrapper & | wrapper, | ||
const MSSimpleTrafficLightLogic::Phases & | phases | ||
) |
Constructor to show the complete phase diagram.
[in] | app | The main application window |
[in] | logic | The logic to show |
[in] | wrapper | The shown logic's wrapper |
[in] | phases | The phases to show |
Definition at line 183 of file GUITLLogicPhasesTrackerWindow.cpp.
References GUIMainWindow::addChild(), GUIIconSubSys::getIcon(), Named::getID(), MSTrafficLightLogic::getLinks(), MSTrafficLightLogic::getProgramID(), ICON_APP_TLSTRACKER, myApplication, myConnector, myLinkNames, myPanel, and myTLLogic.
GUITLLogicPhasesTrackerWindow::~GUITLLogicPhasesTrackerWindow | ( | ) |
Destructor.
Definition at line 210 of file GUITLLogicPhasesTrackerWindow.cpp.
References myApplication, myConnector, myLock, myToolBarDrag, and GUIMainWindow::removeChild().
|
inlineprotected |
protected constructor for FOX
Definition at line 243 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by GUITrafficLightLogicWrapper::begin2TrackPhases(), and GUITrafficLightLogicWrapper::showPhases().
|
virtual |
Adds a further phase definition.
[in] | def | The definition to add |
Implements ValueRetriever< std::pair< SUMOTime, MSPhaseDefinition > >.
Definition at line 443 of file GUITLLogicPhasesTrackerWindow.cpp.
References DELTA_T, myBeginTime, myDurations, myLastTime, myLock, and myPhases.
void GUITLLogicPhasesTrackerWindow::create | ( | ) |
Creates the window (FOX-Toolkit)
Definition at line 222 of file GUITLLogicPhasesTrackerWindow.cpp.
References myToolBarDrag.
Referenced by GUITrafficLightLogicWrapper::begin2TrackPhases(), and GUITrafficLightLogicWrapper::showPhases().
void GUITLLogicPhasesTrackerWindow::drawValues | ( | GUITLLogicPhasesTrackerPanel & | caller | ) |
Draws all values.
[in] | The | target panel |
Definition at line 231 of file GUITLLogicPhasesTrackerWindow.cpp.
References GLHelper::drawText(), FONS_ALIGN_BOTTOM, FONS_ALIGN_LEFT, FONS_ALIGN_MIDDLE, GUIVisualizationSettings::getLinkColor(), MSTrafficLightLogic::getLinks(), MSSimpleTrafficLightLogic::getPhases(), LINKSTATE_TL_RED, LINKSTATE_TL_REDYELLOW, MAX2(), myAmInTrackingMode, myBeginOffset, myBeginTime, myDurations, myFirstPhase2Show, myFirstPhaseOffset, myFirstTime2Show, myLastTime, myLinkNames, myLock, myPhases, myTLLogic, GLHelper::setColor(), STEPS2TIME, TIME2STEPS, time2string(), RGBColor::WHITE, and WRITE_ERROR.
long GUITLLogicPhasesTrackerWindow::onConfigure | ( | FXObject * | sender, |
FXSelector | sel, | ||
void * | data | ||
) |
called on size change
Definition at line 465 of file GUITLLogicPhasesTrackerWindow.cpp.
References myPanel, and GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onConfigure().
long GUITLLogicPhasesTrackerWindow::onPaint | ( | FXObject * | sender, |
FXSelector | sel, | ||
void * | data | ||
) |
called if the widget shall be repainted
Definition at line 473 of file GUITLLogicPhasesTrackerWindow.cpp.
References myPanel, and GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onPaint().
long GUITLLogicPhasesTrackerWindow::onSimStep | ( | FXObject * | sender, |
FXSelector | sel, | ||
void * | data | ||
) |
called on a simulation step
Definition at line 481 of file GUITLLogicPhasesTrackerWindow.cpp.
void GUITLLogicPhasesTrackerWindow::setBeginTime | ( | SUMOTime | time | ) |
Sets the time the display shall be shown as beginning at.
[in] | time | The time to start to show the phases from |
Definition at line 489 of file GUITLLogicPhasesTrackerWindow.cpp.
References myBeginTime.
Referenced by GUITrafficLightLogicWrapper::showPhases().
|
private |
Information whether the tracking mode is on.
Definition at line 229 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by drawValues().
|
private |
The main application.
Definition at line 188 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by GUITLLogicPhasesTrackerWindow(), and ~GUITLLogicPhasesTrackerWindow().
|
private |
The offset changer (tracking mode)
Definition at line 238 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by drawValues(), and GUITLLogicPhasesTrackerWindow().
|
private |
The first time a phase was added at.
Definition at line 220 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by addValue(), drawValues(), and setBeginTime().
|
private |
The connector for retrieval of further phases.
Definition at line 226 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by GUITLLogicPhasesTrackerWindow(), and ~GUITLLogicPhasesTrackerWindow().
|
private |
The list of phase durations.
Definition at line 197 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by addValue(), and drawValues().
|
private |
The index of the first phase that fits into the window.
Definition at line 211 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by drawValues().
|
private |
The offset to draw the first phase (left offset)
Definition at line 214 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by drawValues().
|
private |
The time the diagram begins at.
Definition at line 217 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by drawValues().
|
private |
The last time a phase was added at.
Definition at line 223 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by addValue(), and drawValues().
|
private |
The names of links.
This holds an enumeration only - used to avoid time consuming string representation of ints
Definition at line 208 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by drawValues(), and GUITLLogicPhasesTrackerWindow().
|
private |
A lock to avoid addition of new values while drawing.
Definition at line 203 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by addValue(), drawValues(), and ~GUITLLogicPhasesTrackerWindow().
|
private |
The panel to draw on.
Definition at line 200 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by GUITLLogicPhasesTrackerWindow(), onConfigure(), and onPaint().
|
private |
The list of phases.
Definition at line 194 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by addValue(), and drawValues().
|
private |
The logic to display.
Definition at line 191 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by drawValues(), and GUITLLogicPhasesTrackerWindow().
|
private |
The tool bar (tracking mode)
Definition at line 235 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by GUITLLogicPhasesTrackerWindow().
|
private |
The tool bar drag (tracking mode)
Definition at line 232 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by create(), GUITLLogicPhasesTrackerWindow(), and ~GUITLLogicPhasesTrackerWindow().