SUMO - Simulation of Urban MObility
GNETLSEditorFrame Class Reference

#include <GNETLSEditorFrame.h>

Inheritance diagram for GNETLSEditorFrame:
Inheritance graph
Collaboration diagram for GNETLSEditorFrame:
Collaboration graph

Data Structures

class  TLSAttributes
 FOX-declaration. More...
 

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...
 
void focusUpperElement ()
 focus upper element of frame More...
 
FXFont * getFrameHeaderFont () const
 get font of the header's frame More...
 
FXLabel * getFrameHeaderLabel () const
 get the label for the frame's header More...
 
GNEViewNet * getViewNet () const
 get view net More...
 
 GNETLSEditorFrame (FXHorizontalFrame *horizontalFrameParent, GNEViewNet *viewNet)
 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...
 
virtual void hide ()
 hide Frame More...
 
void setFrameWidth (int newWidth)
 set width of GNEFrame More...
 
virtual void show ()
 show Frame More...
 
 ~GNETLSEditorFrame ()
 Destructor. More...
 
FOX-callbacks

Called when the user presses the OK-Button

Note
saves any modifications
long onCmdOK (FXObject *, FXSelector, void *)
 
long onCmdCancel (FXObject *, FXSelector, void *)
 Called when the user presses the Cancel-button. More...
 
long onCmdToggle (FXObject *, FXSelector, void *)
 Called when the user presses the button Toogle. More...
 
long onCmdGuess (FXObject *, FXSelector, void *)
 Called when the user presses the button Guess. More...
 
long onCmdDefCreate (FXObject *, FXSelector, void *)
 Called when the user creates a TLS. More...
 
long onCmdDefDelete (FXObject *, FXSelector, void *)
 Called when the user deletes a TLS. More...
 
long onCmdDefOffset (FXObject *, FXSelector, void *)
 Called when the user changes the offset of a TLS. More...
 
long onCmdDefSwitch (FXObject *, FXSelector, void *)
 Called when the user switchs a TLS. More...
 
long onCmdDefRename (FXObject *, FXSelector, void *)
 Called when the user renames a TLS. More...
 
long onCmdDefSubRename (FXObject *, FXSelector, void *)
 Called when the user sub-renames a TLS. More...
 
long onCmdDefAddOff (FXObject *, FXSelector, void *)
 Called when the user adds a OFF. More...
 
long onCmdPhaseSwitch (FXObject *, FXSelector, void *)
 Called when the user switchs a Phase. More...
 
long onCmdPhaseCreate (FXObject *, FXSelector, void *)
 Called when the user creates a Phase. More...
 
long onCmdPhaseDelete (FXObject *, FXSelector, void *)
 Called when the user deletes a Phase. More...
 
long onCmdPhaseEdit (FXObject *, FXSelector, void *)
 Called when the user edits a Phase. More...
 
long onCmdMakeRILSAConforming (FXObject *, FXSelector, void *)
 Called when the user makes RILSA. More...
 
long onUpdDefSwitch (FXObject *, FXSelector, void *)
 Called when occurs an update of switch definition. More...
 
long onUpdNeedsDef (FXObject *, FXSelector, void *)
 Called when occurs an update of needs definition. More...
 
long onUpdNeedsDefAndPhase (FXObject *, FXSelector, void *)
 Called when occurs an update of needs definition an dphase. More...
 
long onUpdDefCreate (FXObject *, FXSelector, void *)
 Called when occurs an update of create definition. More...
 
long onUpdModified (FXObject *, FXSelector, void *)
 Called when occurs an update of modified. More...
 

Protected Member Functions

 GNETLSEditorFrame ()
 FOX needs this. More...
 

Static Protected Member Functions

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

Protected Attributes

FXVerticalFrame * myContentFrame
 Vertical frame that holds all widgets of frame. More...
 
FXFont * myFrameHeaderFont
 Font for the Header. More...
 
FXLabel * myFrameHeaderLabel
 the label for the frame's header More...
 
FXHorizontalFrame * myHeaderFrame
 fame for header elements More...
 
FXHorizontalFrame * myHeaderLeftFrame
 fame for left header elements More...
 
FXHorizontalFrame * myHeaderRightFrame
 fame for right header elements More...
 
GNEViewNet * myViewNet
 the window to inform when the tls is modfied 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)
 builds internal lanes for the given tlDef More...
 
void cleanup ()
 cleans up previous lanes More...
 
const std::vector< NBTrafficLightLogic::PhaseDefinition > & getPhases ()
 the phase of the current traffic light More...
 
void initPhaseTable (int index=0)
 initialies the phase table More...
 
void updateCycleDuration ()
 recomputes cycle duration and updates label More...
 
void updateDescription () const
 update descrition More...
 

Static Private Member Functions

static std::string varDurString (SUMOTime dur)
 convert duration (potentially undefined) to string More...
 

Private Attributes

GNEJunction * myCurrentJunction
 the junction of the tls is being modified More...
 
FXLabel * myCycleDuration
 label with the cycle duration More...
 
FXButton * myDeleteSelectedPhaseButton
 delete phase button More...
 
FXButton * myDeleteTLProgram
 button for delete traffic light program More...
 
FXButton * myDiscardModificationsButtons
 button for cancel modifications More...
 
NBLoadedSUMOTLDef * myEditedDef
 the traffic light definition being edited More...
 
FXGroupBox * myGroupBoxJunction
 groupbox for current junction More...
 
FXGroupBox * myGroupBoxModifications
 groupbox for buttons modifications More...
 
FXGroupBox * myGroupBoxPhases
 groupbox for phases More...
 
FXGroupBox * myGroupBoxTLSDef
 groupbox for TLS Definition buttons More...
 
bool myHaveModifications
 whether the current tls was modified More...
 
FXButton * myInsertDuplicateButton
 insert new phase button More...
 
TLIndexMap myInternalLanes
 
FXLabel * myLabelJunctionID
 label for junction ID More...
 
FXLabel * myLabelJunctionStatus
 label for junction status More...
 
FXButton * myNewTLProgram
 button for create new Traffic light program More...
 
int myPhaseIndex
 index of the phase being shown More...
 
FXTable * myPhaseTable
 table for selecting and rearranging phases and for changing duration More...
 
FXButton * mySaveModificationsButtons
 button for save modifications More...
 
FXFont * myTableFont
 font for the phase table More...
 
FXScrollWindow * myTableScroll
 window for oversized phase tables More...
 
FXTextField * myTextFieldJunctionID
 text field for junction ID More...
 
FXTextField * myTextFieldJunctionStatus
 text field for junction status More...
 
TLSAttributes * myTLSAttributes
 TLS attributes. More...
 

Detailed Description

The Widget for modifying selections of network-elements

Definition at line 51 of file GNETLSEditorFrame.h.

Member Typedef Documentation

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

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

Definition at line 291 of file GNETLSEditorFrame.h.

Constructor & Destructor Documentation

GNETLSEditorFrame::GNETLSEditorFrame ( FXHorizontalFrame *  horizontalFrameParent,
GNEViewNet *  viewNet 
)
GNETLSEditorFrame::~GNETLSEditorFrame ( )

Destructor.

Definition at line 165 of file GNETLSEditorFrame.cpp.

References cleanup(), and myTableFont.

GNETLSEditorFrame::GNETLSEditorFrame ( )
inlineprotected

FOX needs this.

Definition at line 221 of file GNETLSEditorFrame.h.

References getSUMOTime().

Member Function Documentation

bool GNETLSEditorFrame::controlsEdge ( GNEEdge &  edge) const

whether the given edge is controlled by the currently edited tlDef

Definition at line 649 of file GNETLSEditorFrame.cpp.

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

Referenced by GNELane::getPopUpMenu().

void GNETLSEditorFrame::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 172 of file GNETLSEditorFrame.cpp.

References GNEViewNet::getUndoList(), GNETLSEditorFrame::TLSAttributes::initTLSAttributes(), myCurrentJunction, myHaveModifications, myTLSAttributes, GNEFrame::myViewNet, onCmdCancel(), GNEUndoList::p_begin(), GNEJunction::selectTLS(), GNEViewNet::setStatusBarText(), and updateDescription().

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

void GNEFrame::focusUpperElement ( )
inherited
FXFont * GNEFrame::getFrameHeaderFont ( ) const
inherited

get font of the header's frame

Definition at line 135 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderFont.

FXLabel * GNEFrame::getFrameHeaderLabel ( ) const
inherited

get the label for the frame's header

Definition at line 129 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderLabel.

Referenced by GNEInspectorFrame::inspectMultisection().

const std::vector< NBTrafficLightLogic::PhaseDefinition > & GNETLSEditorFrame::getPhases ( )
private
SUMOTime GNETLSEditorFrame::getSUMOTime ( const FXString &  string)
staticprotected

converts to SUMOTime

Definition at line 663 of file GNETLSEditorFrame.cpp.

References text(), and TIME2STEPS.

Referenced by GNETLSEditorFrame::TLSAttributes::getOffset(), GNETLSEditorFrame(), onCmdPhaseCreate(), and onCmdPhaseEdit().

void GNETLSEditorFrame::handleMultiChange ( GNELane *  lane,
FXObject *  obj,
FXSelector  sel,
void *  data 
)
void GNETLSEditorFrame::initPhaseTable ( int  index = 0)
private
long GNETLSEditorFrame::onCmdCancel ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Cancel-button.

Note
discards any modifications

Definition at line 187 of file GNETLSEditorFrame.cpp.

References cleanup(), GNEViewNet::getUndoList(), myCurrentJunction, GNEFrame::myViewNet, and GNEUndoList::p_abort().

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

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

Called when the user adds a OFF.

Definition at line 341 of file GNETLSEditorFrame.cpp.

long GNETLSEditorFrame::onCmdDefCreate ( FXObject *  ,
FXSelector  ,
void *   
)
long GNETLSEditorFrame::onCmdDefOffset ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user changes the offset of a TLS.

Definition at line 321 of file GNETLSEditorFrame.cpp.

References GNETLSEditorFrame::TLSAttributes::getOffset(), myEditedDef, myHaveModifications, myTLSAttributes, and NBLoadedSUMOTLDef::setOffset().

long GNETLSEditorFrame::onCmdDefRename ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user renames a TLS.

Definition at line 329 of file GNETLSEditorFrame.cpp.

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

Called when the user sub-renames a TLS.

Definition at line 335 of file GNETLSEditorFrame.cpp.

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

Called when the user presses the button Guess.

Definition at line 347 of file GNETLSEditorFrame.cpp.

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

Called when the user makes RILSA.

long GNETLSEditorFrame::onCmdPhaseCreate ( FXObject *  ,
FXSelector  ,
void *   
)
long GNETLSEditorFrame::onCmdPhaseDelete ( FXObject *  ,
FXSelector  ,
void *   
)
long GNETLSEditorFrame::onCmdPhaseSwitch ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user switchs a Phase.

Definition at line 353 of file GNETLSEditorFrame.cpp.

References getPhases(), myInternalLanes, myPhaseTable, GNEFrame::myViewNet, and NBTrafficLightLogic::PhaseDefinition::state.

Referenced by onCmdPhaseEdit().

long GNETLSEditorFrame::onCmdToggle ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the button Toogle.

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

Called when occurs an update of create definition.

Definition at line 304 of file GNETLSEditorFrame.cpp.

References myCurrentJunction, and myHaveModifications.

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

Called when occurs an update of switch definition.

Definition at line 279 of file GNETLSEditorFrame.cpp.

References GNETLSEditorFrame::TLSAttributes::getNumberOfTLSDefinitions(), myHaveModifications, and myTLSAttributes.

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

Called when occurs an update of modified.

Definition at line 312 of file GNETLSEditorFrame.cpp.

References myHaveModifications.

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

Called when occurs an update of needs definition.

Definition at line 287 of file GNETLSEditorFrame.cpp.

References GNETLSEditorFrame::TLSAttributes::getNumberOfTLSDefinitions(), and myTLSAttributes.

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

Called when occurs an update of needs definition an dphase.

Definition at line 295 of file GNETLSEditorFrame.cpp.

References GNETLSEditorFrame::TLSAttributes::getNumberOfTLSDefinitions(), myPhaseTable, and myTLSAttributes.

void GNEFrame::setFrameWidth ( int  newWidth)
inherited

set width of GNEFrame

Definition at line 116 of file GNEFrame.cpp.

References GNEFrame::myScrollWindowsContents.

void GNETLSEditorFrame::updateCycleDuration ( )
private

recomputes cycle duration and updates label

Definition at line 670 of file GNETLSEditorFrame.cpp.

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

Referenced by onCmdDefSwitch(), and onCmdPhaseEdit().

void GNETLSEditorFrame::updateDescription ( ) const
private
std::string GNETLSEditorFrame::varDurString ( SUMOTime  dur)
staticprivate

convert duration (potentially undefined) to string

Definition at line 544 of file GNETLSEditorFrame.cpp.

References STEPS2TIME, toString(), and NBTrafficLightDefinition::UNSPECIFIED_DURATION.

Referenced by initPhaseTable(), and onCmdPhaseEdit().

Field Documentation

FXVerticalFrame* GNEFrame::myContentFrame
protectedinherited

Vertical frame that holds all widgets of frame.

Definition at line 104 of file GNEFrame.h.

Referenced by GNECrossingFrame::GNECrossingFrame(), GNEFrame::GNEFrame(), and GNEInspectorFrame::inspectMultisection().

GNEJunction* GNETLSEditorFrame::myCurrentJunction
private
FXLabel* GNETLSEditorFrame::myCycleDuration
private

label with the cycle duration

Definition at line 267 of file GNETLSEditorFrame.h.

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

FXButton* GNETLSEditorFrame::myDeleteSelectedPhaseButton
private

delete phase button

Definition at line 273 of file GNETLSEditorFrame.h.

FXButton* GNETLSEditorFrame::myDeleteTLProgram
private

button for delete traffic light program

Definition at line 255 of file GNETLSEditorFrame.h.

FXButton* GNETLSEditorFrame::myDiscardModificationsButtons
private

button for cancel modifications

Definition at line 279 of file GNETLSEditorFrame.h.

NBLoadedSUMOTLDef* GNETLSEditorFrame::myEditedDef
private
FXFont* GNEFrame::myFrameHeaderFont
protectedinherited

Font for the Header.

Definition at line 98 of file GNEFrame.h.

Referenced by GNEFrame::getFrameHeaderFont(), GNEFrame::GNEFrame(), and GNEFrame::~GNEFrame().

FXLabel* GNEFrame::myFrameHeaderLabel
protectedinherited

the label for the frame's header

Definition at line 101 of file GNEFrame.h.

Referenced by GNEFrame::focusUpperElement(), GNEFrame::getFrameHeaderLabel(), and GNEFrame::GNEFrame().

FXGroupBox* GNETLSEditorFrame::myGroupBoxJunction
private

groupbox for current junction

Definition at line 231 of file GNETLSEditorFrame.h.

FXGroupBox* GNETLSEditorFrame::myGroupBoxModifications
private

groupbox for buttons modifications

Definition at line 276 of file GNETLSEditorFrame.h.

FXGroupBox* GNETLSEditorFrame::myGroupBoxPhases
private

groupbox for phases

Definition at line 258 of file GNETLSEditorFrame.h.

FXGroupBox* GNETLSEditorFrame::myGroupBoxTLSDef
private

groupbox for TLS Definition buttons

Definition at line 249 of file GNETLSEditorFrame.h.

bool GNETLSEditorFrame::myHaveModifications
private
FXHorizontalFrame* GNEFrame::myHeaderFrame
protectedinherited

fame for header elements

Definition at line 107 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

FXHorizontalFrame* GNEFrame::myHeaderLeftFrame
protectedinherited
FXHorizontalFrame* GNEFrame::myHeaderRightFrame
protectedinherited

fame for right header elements

Definition at line 113 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

FXButton* GNETLSEditorFrame::myInsertDuplicateButton
private

insert new phase button

Definition at line 270 of file GNETLSEditorFrame.h.

TLIndexMap GNETLSEditorFrame::myInternalLanes
private

Definition at line 292 of file GNETLSEditorFrame.h.

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

FXLabel* GNETLSEditorFrame::myLabelJunctionID
private

label for junction ID

Definition at line 234 of file GNETLSEditorFrame.h.

FXLabel* GNETLSEditorFrame::myLabelJunctionStatus
private

label for junction status

Definition at line 240 of file GNETLSEditorFrame.h.

FXButton* GNETLSEditorFrame::myNewTLProgram
private

button for create new Traffic light program

Definition at line 252 of file GNETLSEditorFrame.h.

int GNETLSEditorFrame::myPhaseIndex
private

index of the phase being shown

Definition at line 298 of file GNETLSEditorFrame.h.

FXTable* GNETLSEditorFrame::myPhaseTable
private

table for selecting and rearranging phases and for changing duration

Definition at line 264 of file GNETLSEditorFrame.h.

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

FXButton* GNETLSEditorFrame::mySaveModificationsButtons
private

button for save modifications

Definition at line 282 of file GNETLSEditorFrame.h.

FXFont* GNETLSEditorFrame::myTableFont
private

font for the phase table

Definition at line 228 of file GNETLSEditorFrame.h.

Referenced by ~GNETLSEditorFrame().

FXScrollWindow* GNETLSEditorFrame::myTableScroll
private

window for oversized phase tables

Definition at line 261 of file GNETLSEditorFrame.h.

Referenced by initPhaseTable().

FXTextField* GNETLSEditorFrame::myTextFieldJunctionID
private

text field for junction ID

Definition at line 237 of file GNETLSEditorFrame.h.

Referenced by updateDescription().

FXTextField* GNETLSEditorFrame::myTextFieldJunctionStatus
private

text field for junction status

Definition at line 243 of file GNETLSEditorFrame.h.

Referenced by updateDescription().

TLSAttributes* GNETLSEditorFrame::myTLSAttributes
private
GNEViewNet* GNEFrame::myViewNet
protectedinherited

the window to inform when the tls is modfied

Definition at line 95 of file GNEFrame.h.

Referenced by GNEAdditionalFrame::addAdditional(), GNEPolygonFrame::addPOI(), GNEPolygonFrame::addPolygon(), buildIinternalLanes(), GNEPolygonFrame::buildPoly(), GNEDeleteFrame::createPopUpMenu(), GNEInspectorFrame::createPopUpMenu(), editJunction(), GNEAdditionalFrame::generateID(), GNESelectorFrame::getMatches(), GNEFrame::getViewNet(), handleChange(), GNESelectorFrame::handleIDs(), GNEConnectorFrame::handleLaneClick(), handleMultiChange(), GNEFrame::hide(), GNEConnectorFrame::initTargets(), GNEConnectorFrame::onCmdCancel(), onCmdCancel(), GNEDeleteFrame::onCmdCenterChildItem(), GNEInspectorFrame::onCmdCenterItem(), GNESelectorFrame::onCmdClear(), GNEConnectorFrame::onCmdClearSelectedConnections(), GNEInspectorFrame::onCmdCopyTemplate(), GNECrossingFrame::onCmdCreateCrossing(), onCmdDefCreate(), onCmdDefDelete(), onCmdDefSwitch(), GNEInspectorFrame::onCmdDeleteItem(), GNEInspectorFrame::onCmdGoBack(), GNEDeleteFrame::onCmdInspectChildItem(), GNESelectorFrame::onCmdInvert(), GNESelectorFrame::onCmdLoad(), GNEConnectorFrame::onCmdOK(), onCmdOK(), onCmdPhaseSwitch(), GNEConnectorFrame::onCmdResetSelectedConnections(), GNESelectorFrame::onCmdScaleSelection(), GNEConnectorFrame::onCmdSelectConflicts(), GNEConnectorFrame::onCmdSelectDeadEnds(), GNEConnectorFrame::onCmdSelectDeadStarts(), GNEConnectorFrame::onCmdSelectPass(), GNEPolygonFrame::processClick(), GNEAdditionalFrame::removeAdditional(), GNEDeleteFrame::removeAttributeCarrier(), and GNEFrame::show().


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