SUMO - Simulation of Urban MObility
GNETLSEditor Class Reference

#include <GNETLSEditor.h>

Inheritance diagram for GNETLSEditor:
Inheritance graph
Collaboration diagram for GNETLSEditor:
Collaboration graph

Public Member Functions

bool controlsEdge (GNEEdge &edge) const
 whether the given edge is controlled by the currently edited tlDef More...
 
void editJunction (GNEJunction *junction)
 edits the traffic light for the given junction More...
 
FXFont * getHeaderFont ()
 
 GNETLSEditor (FXComposite *parent, GNEViewNet *updateTarget, GNEUndoList *undoList)
 Constructor. More...
 
void handleChange (GNEInternalLane *lane)
 update phase definition for the current traffic light and phase More...
 
void handleMultiChange (GNELane *lane, FXObject *obj, FXSelector sel, void *data)
 update phase definition for the current traffic light and phase More...
 
 ~GNETLSEditor ()
 Destructor. More...
 
FOX-callbacks
long onCmdOK (FXObject *, FXSelector, void *)
 Called when the user presses the OK-Button saves any modifications. More...
 
long onCmdCancel (FXObject *, FXSelector, void *)
 Called when the user presses the Cancel-button discards any modifications. More...
 
long onCmdToggle (FXObject *, FXSelector, void *)
 Called when the user presses the Corresponding-button. More...
 
long onCmdGuess (FXObject *, FXSelector, void *)
 
long onCmdDefCreate (FXObject *, FXSelector, void *)
 
long onCmdDefDelete (FXObject *, FXSelector, void *)
 
long onCmdDefOffset (FXObject *, FXSelector, void *)
 
long onCmdDefSwitch (FXObject *, FXSelector, void *)
 
long onCmdDefRename (FXObject *, FXSelector, void *)
 
long onCmdDefSubRename (FXObject *, FXSelector, void *)
 
long onCmdDefAddOff (FXObject *, FXSelector, void *)
 
long onCmdPhaseSwitch (FXObject *, FXSelector, void *)
 
long onCmdPhaseCreate (FXObject *, FXSelector, void *)
 
long onCmdPhaseDelete (FXObject *, FXSelector, void *)
 
long onCmdPhaseEdit (FXObject *, FXSelector, void *)
 
long onCmdMakeRILSAConforming (FXObject *, FXSelector, void *)
 
long onUpdDefSwitch (FXObject *, FXSelector, void *)
 
long onUpdNeedsDef (FXObject *, FXSelector, void *)
 
long onUpdNeedsDefAndPhase (FXObject *, FXSelector, void *)
 
long onUpdDefCreate (FXObject *, FXSelector, void *)
 
long onUpdModified (FXObject *, FXSelector, void *)
 

Protected Member Functions

 GNETLSEditor ()
 FOX needs this. More...
 

Private Types

typedef std::map< int, std::vector< GNEInternalLane * > > TLIndexMap
 the internal lanes belonging the the current junction indexed by their tl-index More...
 

Private Member Functions

void buildIinternalLanes (NBTrafficLightDefinition *tlDef)
 
void cleanup ()
 cleans up previous lanes More...
 
const std::vector< NBTrafficLightLogic::PhaseDefinition > & getPhases ()
 the phase of the current traffic light More...
 
void initDefinitions ()
 
void initPhaseTable (unsigned int index=0)
 
void updateCycleDuration ()
 recomputes cycle duration and updates label More...
 
void updateDescription () const
 

Static Private Member Functions

static SUMOTime getSUMOTime (const FXString &string)
 converts to SUMOTime More...
 

Private Attributes

FXVerticalFrame * myContentFrame
 the panel to hold all member widgets More...
 
GNEJunctionmyCurrentJunction
 the junction of the tls is being modified More...
 
FXLabel * myCycleDuration
 
FXListBox * myDefBox
 the listbox for selecting the tl-definition to edit More...
 
std::vector< NBTrafficLightDefinition * > myDefinitions
 the list of Definitions for the current junction More...
 
FXLabel * myDescription
 the label that shows the current editing state More...
 
NBLoadedSUMOTLDefmyEditedDef
 the traffic light definition being edited More...
 
bool myHaveModifications
 whether the current tls was modified More...
 
FXFont * myHeaderFont
 Font for the widget. More...
 
TLIndexMap myInternalLanes
 
FXTextField * myOffset
 the control for modifying offset More...
 
unsigned int myPhaseIndex
 index of the phase being shown More...
 
FXTable * myPhaseTable
 table for selecting and rearranging phases and for changing duration More...
 
FXFont * myTableFont
 font for the phase table More...
 
GNEUndoListmyUndoList
 the undolist with wich to register changes More...
 
GNEViewNetmyUpdateTarget
 

Static Private Attributes

static const int WIDTH = 140
 the width of the widget More...
 

Detailed Description

The Widget for modifying selections of network-elements

Definition at line 57 of file GNETLSEditor.h.

Member Typedef Documentation

typedef std::map<int, std::vector<GNEInternalLane*> > GNETLSEditor::TLIndexMap
private

the internal lanes belonging the the current junction indexed by their tl-index

Definition at line 158 of file GNETLSEditor.h.

Constructor & Destructor Documentation

GNETLSEditor::GNETLSEditor ( FXComposite *  parent,
GNEViewNet updateTarget,
GNEUndoList undoList 
)

Constructor.

Parameters
[in]parentThe parent window

Definition at line 102 of file GNETLSEditor.cpp.

References MID_CANCEL, MID_GNE_DEF_CREATE, MID_GNE_DEF_DELETE, MID_GNE_DEF_OFFSET, MID_GNE_DEF_SWITCH, MID_GNE_PHASE_CREATE, MID_GNE_PHASE_DELETE, MID_GNE_PHASE_TABLE, and MID_OK.

GNETLSEditor::~GNETLSEditor ( )

Destructor.

Definition at line 186 of file GNETLSEditor.cpp.

References cleanup(), myHeaderFont, and myTableFont.

GNETLSEditor::GNETLSEditor ( )
inlineprotected

FOX needs this.

Definition at line 130 of file GNETLSEditor.h.

Member Function Documentation

void GNETLSEditor::cleanup ( )
private
bool GNETLSEditor::controlsEdge ( GNEEdge edge) const

whether the given edge is controlled by the currently edited tlDef

Definition at line 655 of file GNETLSEditor.cpp.

References NBTrafficLightDefinition::getControlledLinks(), GUIGlObject::getMicrosimID(), and myEditedDef.

Referenced by getHeaderFont(), and GNELane::getPopUpMenu().

void GNETLSEditor::editJunction ( GNEJunction junction)

edits the traffic light for the given junction

Parameters
[in]junctionThe junction of which the traffic light shall be edited

Definition at line 194 of file GNETLSEditor.cpp.

References initDefinitions(), myCurrentJunction, myHaveModifications, myUndoList, myUpdateTarget, onCmdCancel(), GNEUndoList::p_begin(), GNEJunction::selectTLS(), and GNEViewNet::setStatusBarText().

Referenced by getHeaderFont(), onCmdDefCreate(), and GNEViewNet::onLeftBtnPress().

const std::vector< NBTrafficLightLogic::PhaseDefinition > & GNETLSEditor::getPhases ( )
private

the phase of the current traffic light

Definition at line 587 of file GNETLSEditor.cpp.

References NBLoadedSUMOTLDef::getLogic(), NBTrafficLightLogic::getPhases(), and myEditedDef.

Referenced by handleChange(), initPhaseTable(), onCmdPhaseEdit(), onCmdPhaseSwitch(), and updateCycleDuration().

SUMOTime GNETLSEditor::getSUMOTime ( const FXString &  string)
staticprivate

converts to SUMOTime

Definition at line 669 of file GNETLSEditor.cpp.

References TIME2STEPS.

Referenced by onCmdDefOffset(), onCmdPhaseCreate(), and onCmdPhaseEdit().

void GNETLSEditor::initDefinitions ( )
private
void GNETLSEditor::initPhaseTable ( unsigned int  index = 0)
private
long GNETLSEditor::onCmdCancel ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Cancel-button discards any modifications.

Definition at line 208 of file GNETLSEditor.cpp.

References cleanup(), myCurrentJunction, myUndoList, myUpdateTarget, and GNEUndoList::p_abort().

Referenced by GNEViewNet::abortOperation(), editJunction(), getHeaderFont(), onCmdDefCreate(), onCmdDefDelete(), onCmdDefSwitch(), and onCmdOK().

long GNETLSEditor::onCmdDefAddOff ( FXObject *  ,
FXSelector  ,
void *   
)

Definition at line 360 of file GNETLSEditor.cpp.

Referenced by getHeaderFont().

long GNETLSEditor::onCmdDefCreate ( FXObject *  ,
FXSelector  ,
void *   
)
long GNETLSEditor::onCmdDefDelete ( FXObject *  ,
FXSelector  ,
void *   
)
long GNETLSEditor::onCmdDefOffset ( FXObject *  ,
FXSelector  ,
void *   
)
long GNETLSEditor::onCmdDefRename ( FXObject *  ,
FXSelector  ,
void *   
)

Definition at line 348 of file GNETLSEditor.cpp.

Referenced by getHeaderFont().

long GNETLSEditor::onCmdDefSubRename ( FXObject *  ,
FXSelector  ,
void *   
)

Definition at line 354 of file GNETLSEditor.cpp.

Referenced by getHeaderFont().

long GNETLSEditor::onCmdGuess ( FXObject *  ,
FXSelector  ,
void *   
)

Definition at line 366 of file GNETLSEditor.cpp.

Referenced by getHeaderFont().

long GNETLSEditor::onCmdMakeRILSAConforming ( FXObject *  ,
FXSelector  ,
void *   
)

Referenced by getHeaderFont().

long GNETLSEditor::onCmdOK ( FXObject *  ,
FXSelector  ,
void *   
)
long GNETLSEditor::onCmdPhaseCreate ( FXObject *  ,
FXSelector  ,
void *   
)
long GNETLSEditor::onCmdPhaseDelete ( FXObject *  ,
FXSelector  ,
void *   
)
long GNETLSEditor::onCmdPhaseSwitch ( FXObject *  ,
FXSelector  ,
void *   
)
long GNETLSEditor::onCmdToggle ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Corresponding-button.

Referenced by getHeaderFont().

long GNETLSEditor::onUpdDefCreate ( FXObject *  o,
FXSelector  ,
void *   
)

Definition at line 323 of file GNETLSEditor.cpp.

References myCurrentJunction, and myHaveModifications.

Referenced by getHeaderFont().

long GNETLSEditor::onUpdDefSwitch ( FXObject *  o,
FXSelector  ,
void *   
)

Definition at line 298 of file GNETLSEditor.cpp.

References myDefinitions, and myHaveModifications.

Referenced by getHeaderFont().

long GNETLSEditor::onUpdModified ( FXObject *  o,
FXSelector  ,
void *   
)

Definition at line 331 of file GNETLSEditor.cpp.

References myHaveModifications.

Referenced by getHeaderFont().

long GNETLSEditor::onUpdNeedsDef ( FXObject *  o,
FXSelector  ,
void *   
)

Definition at line 306 of file GNETLSEditor.cpp.

References myDefinitions.

Referenced by getHeaderFont().

long GNETLSEditor::onUpdNeedsDefAndPhase ( FXObject *  o,
FXSelector  ,
void *   
)

Definition at line 314 of file GNETLSEditor.cpp.

References myDefinitions, and myPhaseTable.

Referenced by getHeaderFont().

void GNETLSEditor::updateCycleDuration ( )
private

recomputes cycle duration and updates label

Definition at line 676 of file GNETLSEditor.cpp.

References getPhases(), myCycleDuration, STEPS2TIME, and toString().

Referenced by onCmdDefSwitch(), and onCmdPhaseEdit().

void GNETLSEditor::updateDescription ( ) const
private

Field Documentation

FXVerticalFrame* GNETLSEditor::myContentFrame
private

the panel to hold all member widgets

Definition at line 134 of file GNETLSEditor.h.

GNEJunction* GNETLSEditor::myCurrentJunction
private
FXLabel* GNETLSEditor::myCycleDuration
private

Definition at line 173 of file GNETLSEditor.h.

Referenced by cleanup(), and updateCycleDuration().

FXListBox* GNETLSEditor::myDefBox
private

the listbox for selecting the tl-definition to edit

Definition at line 168 of file GNETLSEditor.h.

Referenced by cleanup(), initDefinitions(), onCmdDefDelete(), onCmdDefSwitch(), and onCmdOK().

std::vector<NBTrafficLightDefinition*> GNETLSEditor::myDefinitions
private

the list of Definitions for the current junction

Definition at line 162 of file GNETLSEditor.h.

Referenced by cleanup(), initDefinitions(), initPhaseTable(), onCmdDefDelete(), onCmdDefSwitch(), onCmdOK(), onUpdDefSwitch(), onUpdNeedsDef(), and onUpdNeedsDefAndPhase().

FXLabel* GNETLSEditor::myDescription
private

the label that shows the current editing state

Definition at line 143 of file GNETLSEditor.h.

Referenced by updateDescription().

NBLoadedSUMOTLDef* GNETLSEditor::myEditedDef
private
bool GNETLSEditor::myHaveModifications
private
FXFont* GNETLSEditor::myHeaderFont
private

Font for the widget.

Definition at line 137 of file GNETLSEditor.h.

Referenced by getHeaderFont(), and ~GNETLSEditor().

TLIndexMap GNETLSEditor::myInternalLanes
private

Definition at line 159 of file GNETLSEditor.h.

Referenced by buildIinternalLanes(), handleMultiChange(), and onCmdPhaseSwitch().

FXTextField* GNETLSEditor::myOffset
private

the control for modifying offset

Definition at line 171 of file GNETLSEditor.h.

Referenced by cleanup(), onCmdDefOffset(), and onCmdDefSwitch().

unsigned int GNETLSEditor::myPhaseIndex
private

index of the phase being shown

Definition at line 179 of file GNETLSEditor.h.

FXTable* GNETLSEditor::myPhaseTable
private

table for selecting and rearranging phases and for changing duration

Definition at line 176 of file GNETLSEditor.h.

Referenced by handleChange(), initPhaseTable(), onCmdPhaseCreate(), onCmdPhaseDelete(), onCmdPhaseEdit(), onCmdPhaseSwitch(), and onUpdNeedsDefAndPhase().

FXFont* GNETLSEditor::myTableFont
private

font for the phase table

Definition at line 140 of file GNETLSEditor.h.

Referenced by ~GNETLSEditor().

GNEUndoList* GNETLSEditor::myUndoList
private

the undolist with wich to register changes

Definition at line 149 of file GNETLSEditor.h.

Referenced by editJunction(), onCmdCancel(), onCmdDefCreate(), onCmdDefDelete(), and onCmdOK().

GNEViewNet* GNETLSEditor::myUpdateTarget
private
const int GNETLSEditor::WIDTH = 140
staticprivate

the width of the widget

Definition at line 182 of file GNETLSEditor.h.

Referenced by initPhaseTable().


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