SUMO - Simulation of Urban MObility
GUITLLogicPhasesTrackerWindow Class Reference

This window displays a phase diagram for a chosen tl-logic. More...

#include <GUITLLogicPhasesTrackerWindow.h>

Inheritance diagram for GUITLLogicPhasesTrackerWindow:
Inheritance graph
Collaboration diagram for GUITLLogicPhasesTrackerWindow:
Collaboration graph

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, ValueSource< std::pair< SUMOTime, MSPhaseDefinition > > *src)
 Constructor to track current phases. More...
 
 GUITLLogicPhasesTrackerWindow (GUIMainWindow &app, MSTrafficLightLogic &logic, GUITrafficLightLogicWrapper &wrapper, const MSSimpleTrafficLightLogic::Phases &phases)
 Constructor to show the complete phase diagram. 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< MSPhaseDefinitionPhasesVector
 } More...
 
typedef std::vector< SUMOTimeDurationsVector
 Definition of a storage for durations. More...
 
GUIMainWindowmyApplication
 The main application. More...
 
MSTrafficLightLogicmyTLLogic
 The logic to display. More...
 
PhasesVector myPhases
 The list of phases. More...
 
DurationsVector myDurations
 The list of phase durations. More...
 
GUITLLogicPhasesTrackerPanelmyPanel
 The panel to draw on. More...
 
MFXMutex 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...
 

Detailed Description

This window displays a phase diagram for a chosen tl-logic.

Definition at line 65 of file GUITLLogicPhasesTrackerWindow.h.

Member Typedef Documentation

◆ DurationsVector

Definition of a storage for durations.

Definition at line 132 of file GUITLLogicPhasesTrackerWindow.h.

◆ PhasesVector

}

Definition of a storage for phases

Definition at line 129 of file GUITLLogicPhasesTrackerWindow.h.

Constructor & Destructor Documentation

◆ GUITLLogicPhasesTrackerWindow() [1/3]

GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow ( GUIMainWindow app,
MSTrafficLightLogic logic,
GUITrafficLightLogicWrapper wrapper,
ValueSource< std::pair< SUMOTime, MSPhaseDefinition > > *  src 
)

Constructor to track current phases.

Parameters
[in]appThe main application window
[in]logicThe logic to track
[in]wrapperThe tracked logic's wrapper
[in]srcThe value source to track

Definition at line 145 of file GUITLLogicPhasesTrackerWindow.cpp.

References GUIIconSubSys::getIcon(), MSTrafficLightLogic::getLinks(), GUIDesignToolBarGrip, GUIDesignToolBarShell3, GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::GUITLLogicPhasesTrackerPanel(), ICON_APP_TLSTRACKER, MID_SIMSTEP, myApplication, myBeginOffset, myConnector, myLinkNames, myPanel, myTLLogic, myToolBar, and myToolBarDrag.

◆ GUITLLogicPhasesTrackerWindow() [2/3]

GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow ( GUIMainWindow app,
MSTrafficLightLogic logic,
GUITrafficLightLogicWrapper wrapper,
const MSSimpleTrafficLightLogic::Phases phases 
)

Constructor to show the complete phase diagram.

Parameters
[in]appThe main application window
[in]logicThe logic to show
[in]wrapperThe shown logic's wrapper
[in]phasesThe 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::~GUITLLogicPhasesTrackerWindow ( )

◆ GUITLLogicPhasesTrackerWindow() [3/3]

GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow ( )
inlineprotected

protected constructor for FOX

Definition at line 244 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by GUITrafficLightLogicWrapper::begin2TrackPhases(), and GUITrafficLightLogicWrapper::showPhases().

Member Function Documentation

◆ addValue()

void GUITLLogicPhasesTrackerWindow::addValue ( std::pair< SUMOTime, MSPhaseDefinition def)
virtual

Adds a further phase definition.

Parameters
[in]defThe definition to add

Implements ValueRetriever< std::pair< SUMOTime, MSPhaseDefinition > >.

Definition at line 443 of file GUITLLogicPhasesTrackerWindow.cpp.

References DELTA_T, MFXMutex::lock(), myBeginTime, myDurations, myLastTime, myLock, myPhases, and MFXMutex::unlock().

◆ create()

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().

◆ drawValues()

◆ onConfigure()

long GUITLLogicPhasesTrackerWindow::onConfigure ( FXObject *  sender,
FXSelector  sel,
void *  data 
)

◆ onPaint()

long GUITLLogicPhasesTrackerWindow::onPaint ( FXObject *  sender,
FXSelector  sel,
void *  data 
)

◆ onSimStep()

long GUITLLogicPhasesTrackerWindow::onSimStep ( FXObject *  sender,
FXSelector  sel,
void *  data 
)

called on a simulation step

Definition at line 481 of file GUITLLogicPhasesTrackerWindow.cpp.

Referenced by GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onPaint().

◆ setBeginTime()

void GUITLLogicPhasesTrackerWindow::setBeginTime ( SUMOTime  time)

Sets the time the display shall be shown as beginning at.

Parameters
[in]timeThe time to start to show the phases from

Definition at line 489 of file GUITLLogicPhasesTrackerWindow.cpp.

References myBeginTime.

Referenced by GUITrafficLightLogicWrapper::showPhases().

Field Documentation

◆ myAmInTrackingMode

bool GUITLLogicPhasesTrackerWindow::myAmInTrackingMode
private

Information whether the tracking mode is on.

Definition at line 230 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by drawValues().

◆ myApplication

GUIMainWindow* GUITLLogicPhasesTrackerWindow::myApplication
private

The main application.

Definition at line 189 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by GUITLLogicPhasesTrackerWindow(), and ~GUITLLogicPhasesTrackerWindow().

◆ myBeginOffset

FXRealSpinner* GUITLLogicPhasesTrackerWindow::myBeginOffset
private

The offset changer (tracking mode)

Definition at line 239 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by drawValues(), and GUITLLogicPhasesTrackerWindow().

◆ myBeginTime

SUMOTime GUITLLogicPhasesTrackerWindow::myBeginTime
private

The first time a phase was added at.

Definition at line 221 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by addValue(), drawValues(), and setBeginTime().

◆ myConnector

GLObjectValuePassConnector<std::pair<SUMOTime, MSPhaseDefinition> >* GUITLLogicPhasesTrackerWindow::myConnector
private

The connector for retrieval of further phases.

Definition at line 227 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by GUITLLogicPhasesTrackerWindow(), and ~GUITLLogicPhasesTrackerWindow().

◆ myDurations

DurationsVector GUITLLogicPhasesTrackerWindow::myDurations
private

The list of phase durations.

Definition at line 198 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by addValue(), and drawValues().

◆ myFirstPhase2Show

int GUITLLogicPhasesTrackerWindow::myFirstPhase2Show
private

The index of the first phase that fits into the window.

Definition at line 212 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by drawValues().

◆ myFirstPhaseOffset

SUMOTime GUITLLogicPhasesTrackerWindow::myFirstPhaseOffset
private

The offset to draw the first phase (left offset)

Definition at line 215 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by drawValues().

◆ myFirstTime2Show

SUMOTime GUITLLogicPhasesTrackerWindow::myFirstTime2Show
private

The time the diagram begins at.

Definition at line 218 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by drawValues().

◆ myLastTime

SUMOTime GUITLLogicPhasesTrackerWindow::myLastTime
private

The last time a phase was added at.

Definition at line 224 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by addValue(), and drawValues().

◆ myLinkNames

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 209 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by drawValues(), and GUITLLogicPhasesTrackerWindow().

◆ myLock

MFXMutex GUITLLogicPhasesTrackerWindow::myLock
private

A lock to avoid addition of new values while drawing.

Definition at line 204 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by addValue(), drawValues(), and ~GUITLLogicPhasesTrackerWindow().

◆ myPanel

GUITLLogicPhasesTrackerPanel* GUITLLogicPhasesTrackerWindow::myPanel
private

The panel to draw on.

Definition at line 201 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by GUITLLogicPhasesTrackerWindow(), onConfigure(), and onPaint().

◆ myPhases

PhasesVector GUITLLogicPhasesTrackerWindow::myPhases
private

The list of phases.

Definition at line 195 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by addValue(), and drawValues().

◆ myTLLogic

MSTrafficLightLogic* GUITLLogicPhasesTrackerWindow::myTLLogic
private

The logic to display.

Definition at line 192 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by drawValues(), and GUITLLogicPhasesTrackerWindow().

◆ myToolBar

FXToolBar* GUITLLogicPhasesTrackerWindow::myToolBar
private

The tool bar (tracking mode)

Definition at line 236 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by GUITLLogicPhasesTrackerWindow().

◆ myToolBarDrag

FXToolBarShell* GUITLLogicPhasesTrackerWindow::myToolBarDrag
private

The tool bar drag (tracking mode)

Definition at line 233 of file GUITLLogicPhasesTrackerWindow.h.

Referenced by create(), GUITLLogicPhasesTrackerWindow(), and ~GUITLLogicPhasesTrackerWindow().


The documentation for this class was generated from the following files: