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. | |
void | create () |
Creates the window (FOX-Toolkit) | |
GUITLLogicPhasesTrackerWindow (GUIMainWindow &app, MSTrafficLightLogic &logic, GUITrafficLightLogicWrapper &wrapper, ValueSource< std::pair< SUMOTime, MSPhaseDefinition > > *src) | |
Constructor to track current phases. | |
GUITLLogicPhasesTrackerWindow (GUIMainWindow &app, MSTrafficLightLogic &logic, GUITrafficLightLogicWrapper &wrapper, const MSSimpleTrafficLightLogic::Phases &phases) | |
Constructor to show the complete phase diagram. | |
void | setBeginTime (SUMOTime time) |
Sets the time the display shall be shown as beginning at. | |
~GUITLLogicPhasesTrackerWindow () | |
Destructor. | |
FOX-callbacks | |
typedef std::vector < MSPhaseDefinition > | PhasesVector |
} | |
typedef std::vector< SUMOTime > | DurationsVector |
Definition of a storage for durations. | |
GUIMainWindow * | myApplication |
The main application. | |
MSTrafficLightLogic * | myTLLogic |
The logic to display. | |
PhasesVector | myPhases |
The list of phases. | |
DurationsVector | myDurations |
The list of phase durations. | |
GUITLLogicPhasesTrackerPanel * | myPanel |
The panel to draw on. | |
MFXMutex | myLock |
A lock to avoid addition of new values while drawing. | |
std::vector< std::string > | myLinkNames |
The names of links. | |
size_t | myFirstPhase2Show |
The index of the first phase that fits into the window. | |
size_t | myFirstPhaseOffset |
The offset to draw the first phase (left offset) | |
SUMOTime | myFirstTime2Show |
The time the diagram begins at. | |
SUMOTime | myBeginTime |
The first time a phase was added at. | |
SUMOTime | myLastTime |
The last time a phase was added at. | |
GLObjectValuePassConnector < std::pair< SUMOTime, MSPhaseDefinition > > * | myConnector |
The connector for retrieval of further phases. | |
bool | myAmInTrackingMode |
Information whether the tracking mode is on. | |
FXToolBarShell * | myToolBarDrag |
The tool bar drag (tracking mode) | |
FXToolBar * | myToolBar |
The tool bar (tracking mode) | |
FXRealSpinDial * | myBeginOffset |
The offset changer (tracking mode) | |
long | onConfigure (FXObject *sender, FXSelector sel, void *data) |
called on size change | |
long | onPaint (FXObject *sender, FXSelector sel, void *data) |
called if the widget shall be repainted | |
long | onSimStep (FXObject *sender, FXSelector sel, void *data) |
called on a simulation step | |
void | drawValues (GUITLLogicPhasesTrackerPanel &caller) |
Draws all values. | |
GUITLLogicPhasesTrackerWindow () | |
protected constructor for FOX |
This window displays a phase diagram for a chosen tl-logic.
Definition at line 66 of file GUITLLogicPhasesTrackerWindow.h.
typedef std::vector<SUMOTime> GUITLLogicPhasesTrackerWindow::DurationsVector |
Definition of a storage for durations.
Definition at line 133 of file GUITLLogicPhasesTrackerWindow.h.
typedef std::vector<MSPhaseDefinition> GUITLLogicPhasesTrackerWindow::PhasesVector |
}
Definition of a storage for phases
Definition at line 130 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 159 of file GUITLLogicPhasesTrackerWindow.cpp.
References GUIIconSubSys::getIcon(), MSTrafficLightLogic::getLinks(), 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 196 of file GUITLLogicPhasesTrackerWindow.cpp.
References GUIMainWindow::addChild(), GUIIconSubSys::getIcon(), MSTrafficLightLogic::getID(), MSTrafficLightLogic::getLinks(), MSTrafficLightLogic::getProgramID(), ICON_APP_TLSTRACKER, myApplication, myConnector, myLinkNames, myPanel, and myTLLogic.
Destructor.
Definition at line 223 of file GUITLLogicPhasesTrackerWindow.cpp.
References MFXMutex::locked(), myApplication, myConnector, myLock, myToolBarDrag, GUIMainWindow::removeChild(), and MFXMutex::unlock().
GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow | ( | ) | [inline, protected] |
protected constructor for FOX
Definition at line 248 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by GUITrafficLightLogicWrapper::begin2TrackPhases(), and GUITrafficLightLogicWrapper::showPhases().
void GUITLLogicPhasesTrackerWindow::addValue | ( | std::pair< SUMOTime, MSPhaseDefinition > | def | ) | [virtual] |
Adds a further phase definition.
[in] | def | The definition to add |
Implements ValueRetriever< std::pair< SUMOTime, MSPhaseDefinition > >.
Definition at line 460 of file GUITLLogicPhasesTrackerWindow.cpp.
References DELTA_T, MFXMutex::lock(), myBeginTime, myDurations, myLastTime, myLock, myPhases, and MFXMutex::unlock().
Creates the window (FOX-Toolkit)
Definition at line 235 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 244 of file GUITLLogicPhasesTrackerWindow.cpp.
References MSTrafficLightLogic::getLinks(), LINKSTATE_TL_GREEN_MAJOR, LINKSTATE_TL_GREEN_MINOR, LINKSTATE_TL_RED, LINKSTATE_TL_YELLOW_MAJOR, LINKSTATE_TL_YELLOW_MINOR, MFXMutex::lock(), myAmInTrackingMode, myBeginOffset, myBeginTime, myDurations, myFirstPhase2Show, myFirstPhaseOffset, myFirstTime2Show, myLastTime, myLinkNames, myLock, myPhases, myTLLogic, pfdkGetStringWidth(), pfDrawString(), pfSetPosition(), pfSetScaleXY(), STEPS2TIME, SUMOReal, TIME2STEPS, time2string(), and MFXMutex::unlock().
long GUITLLogicPhasesTrackerWindow::onConfigure | ( | FXObject * | sender, |
FXSelector | sel, | ||
void * | data | ||
) |
called on size change
Definition at line 482 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 490 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 498 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 506 of file GUITLLogicPhasesTrackerWindow.cpp.
References myBeginTime.
Referenced by GUITrafficLightLogicWrapper::showPhases().
Information whether the tracking mode is on.
Definition at line 234 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by drawValues().
The main application.
Definition at line 193 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by GUITLLogicPhasesTrackerWindow(), and ~GUITLLogicPhasesTrackerWindow().
FXRealSpinDial* GUITLLogicPhasesTrackerWindow::myBeginOffset [private] |
The offset changer (tracking mode)
Definition at line 243 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by drawValues(), and GUITLLogicPhasesTrackerWindow().
The first time a phase was added at.
Definition at line 225 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by addValue(), drawValues(), and setBeginTime().
GLObjectValuePassConnector<std::pair<SUMOTime, MSPhaseDefinition> >* GUITLLogicPhasesTrackerWindow::myConnector [private] |
The connector for retrieval of further phases.
Definition at line 231 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by GUITLLogicPhasesTrackerWindow(), and ~GUITLLogicPhasesTrackerWindow().
The list of phase durations.
Definition at line 202 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by addValue(), and drawValues().
size_t GUITLLogicPhasesTrackerWindow::myFirstPhase2Show [private] |
The index of the first phase that fits into the window.
Definition at line 216 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by drawValues().
size_t GUITLLogicPhasesTrackerWindow::myFirstPhaseOffset [private] |
The offset to draw the first phase (left offset)
Definition at line 219 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by drawValues().
The time the diagram begins at.
Definition at line 222 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by drawValues().
The last time a phase was added at.
Definition at line 228 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by addValue(), and drawValues().
std::vector<std::string> GUITLLogicPhasesTrackerWindow::myLinkNames [private] |
The names of links.
This holds an enumeration only - used to avoid time consuming string representation of ints
Definition at line 213 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by drawValues(), and GUITLLogicPhasesTrackerWindow().
A lock to avoid addition of new values while drawing.
Definition at line 208 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by addValue(), drawValues(), and ~GUITLLogicPhasesTrackerWindow().
The panel to draw on.
Definition at line 205 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by GUITLLogicPhasesTrackerWindow(), onConfigure(), and onPaint().
The list of phases.
Definition at line 199 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by addValue(), and drawValues().
The logic to display.
Definition at line 196 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by drawValues(), and GUITLLogicPhasesTrackerWindow().
FXToolBar* GUITLLogicPhasesTrackerWindow::myToolBar [private] |
The tool bar (tracking mode)
Definition at line 240 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by GUITLLogicPhasesTrackerWindow().
FXToolBarShell* GUITLLogicPhasesTrackerWindow::myToolBarDrag [private] |
The tool bar drag (tracking mode)
Definition at line 237 of file GUITLLogicPhasesTrackerWindow.h.
Referenced by create(), GUITLLogicPhasesTrackerWindow(), and ~GUITLLogicPhasesTrackerWindow().