SUMO - Simulation of Urban MObility
GNETLSEditorFrame Class Reference

#include <GNETLSEditorFrame.h>

Inheritance diagram for GNETLSEditorFrame:
Inheritance graph
Collaboration diagram for GNETLSEditorFrame:
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 * getFrameHeaderFont () const
 get font of the header's frame More...
 
FXLabel * getFrameHeaderLabel () const
 get the label for the frame's header More...
 
GNEViewNetgetViewNet () const
 get view net More...
 
 GNETLSEditorFrame (FXComposite *parent, GNEViewNet *viewNet)
 FOX-declaration. 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...
 
void hide ()
 hide Frame More...
 
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...
 

Protected Attributes

FXVerticalFrame * myContentFrame
 the panel to hold all member widgets 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...
 
GNEViewNetmyViewNet
 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 initDefinitions ()
 initializes the definitions and corresponding listbox 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 SUMOTime getSUMOTime (const FXString &string)
 converts to SUMOTime More...
 

Private Attributes

GNEJunctionmyCurrentJunction
 the junction of the tls is being modified More...
 
FXLabel * myCycleDuration
 label with the cycle duration More...
 
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...
 
TLIndexMap myInternalLanes
 
FXTextField * myOffset
 the control for modifying offset More...
 
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...
 

Detailed Description

The Widget for modifying selections of network-elements

Definition at line 51 of file GNETLSEditorFrame.h.

Member Typedef Documentation

§ TLIndexMap

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 170 of file GNETLSEditorFrame.h.

Constructor & Destructor Documentation

§ GNETLSEditorFrame() [1/2]

GNETLSEditorFrame::GNETLSEditorFrame ( FXComposite *  parent,
GNEViewNet viewNet 
)

FOX-declaration.

Constructor parent FXFrame in which this GNEFrame is placed viewNet viewNet that uses this GNEFrame

Definition at line 98 of file GNETLSEditorFrame.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.

§ ~GNETLSEditorFrame()

GNETLSEditorFrame::~GNETLSEditorFrame ( )

Destructor.

Definition at line 176 of file GNETLSEditorFrame.cpp.

References cleanup(), and myTableFont.

§ GNETLSEditorFrame() [2/2]

GNETLSEditorFrame::GNETLSEditorFrame ( )
inlineprotected

FOX needs this.

Definition at line 154 of file GNETLSEditorFrame.h.

Member Function Documentation

§ buildIinternalLanes()

§ cleanup()

void GNETLSEditorFrame::cleanup ( )
private

§ controlsEdge()

bool GNETLSEditorFrame::controlsEdge ( GNEEdge edge) const

whether the given edge is controlled by the currently edited tlDef

Definition at line 661 of file GNETLSEditorFrame.cpp.

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

Referenced by GNELane::getPopUpMenu().

§ editJunction()

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 200 of file GNETLSEditorFrame.cpp.

References GNEViewNet::getUndoList(), initDefinitions(), myCurrentJunction, myHaveModifications, GNEFrame::myViewNet, onCmdCancel(), GNEUndoList::p_begin(), GNEJunction::selectTLS(), and GNEViewNet::setStatusBarText().

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

§ getFrameHeaderFont()

FXFont * GNEFrame::getFrameHeaderFont ( ) const
inherited

get font of the header's frame

Definition at line 105 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderFont.

§ getFrameHeaderLabel()

FXLabel * GNEFrame::getFrameHeaderLabel ( ) const
inherited

get the label for the frame's header

Definition at line 99 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderLabel.

Referenced by GNEInspectorFrame::inspect().

§ getPhases()

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

§ getSUMOTime()

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

converts to SUMOTime

Definition at line 675 of file GNETLSEditorFrame.cpp.

References TIME2STEPS.

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

§ getViewNet()

§ handleChange()

§ handleMultiChange()

§ hide()

void GNETLSEditorFrame::hide ( )
virtual

§ initDefinitions()

void GNETLSEditorFrame::initDefinitions ( )
private

initializes the definitions and corresponding listbox

Definition at line 540 of file GNETLSEditorFrame.cpp.

References NBNode::getControllingTLS(), GNEJunction::getNBNode(), myCurrentJunction, myDefBox, myDefinitions, onCmdDefSwitch(), and updateDescription().

Referenced by editJunction().

§ initPhaseTable()

void GNETLSEditorFrame::initPhaseTable ( int  index = 0)
private

initialies the phase table

Parameters
[in]indexThe index to select

Definition at line 562 of file GNETLSEditorFrame.cpp.

References getPhases(), MIN2(), myDefinitions, myPhaseTable, STEPS2TIME, and toString().

Referenced by cleanup(), handleChange(), onCmdDefSwitch(), onCmdPhaseCreate(), and onCmdPhaseDelete().

§ onCmdCancel()

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

Called when the user presses the Cancel-button.

Note
discards any modifications

Definition at line 214 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().

§ onCmdDefAddOff()

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

Called when the user adds a OFF.

Definition at line 366 of file GNETLSEditorFrame.cpp.

§ onCmdDefCreate()

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

§ onCmdDefDelete()

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

§ onCmdDefOffset()

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

Called when the user changes the offset of a TLS.

Definition at line 346 of file GNETLSEditorFrame.cpp.

References getSUMOTime(), myEditedDef, myHaveModifications, myOffset, and NBLoadedSUMOTLDef::setOffset().

§ onCmdDefRename()

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

Called when the user renames a TLS.

Definition at line 354 of file GNETLSEditorFrame.cpp.

§ onCmdDefSubRename()

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

Called when the user sub-renames a TLS.

Definition at line 360 of file GNETLSEditorFrame.cpp.

§ onCmdDefSwitch()

§ onCmdGuess()

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

Called when the user presses the button Guess.

Definition at line 372 of file GNETLSEditorFrame.cpp.

§ onCmdMakeRILSAConforming()

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

Called when the user makes RILSA.

§ onCmdOK()

§ onCmdPhaseCreate()

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

§ onCmdPhaseDelete()

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

§ onCmdPhaseEdit()

long GNETLSEditorFrame::onCmdPhaseEdit ( FXObject *  ,
FXSelector  ,
void *  ptr 
)

§ onCmdPhaseSwitch()

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

Called when the user switchs a Phase.

Definition at line 378 of file GNETLSEditorFrame.cpp.

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

Referenced by onCmdPhaseEdit().

§ onCmdToggle()

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

Called when the user presses the button Toogle.

§ onUpdDefCreate()

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

Called when occurs an update of create definition.

Definition at line 329 of file GNETLSEditorFrame.cpp.

References myCurrentJunction, and myHaveModifications.

§ onUpdDefSwitch()

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

Called when occurs an update of switch definition.

Definition at line 304 of file GNETLSEditorFrame.cpp.

References myDefinitions, and myHaveModifications.

§ onUpdModified()

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

Called when occurs an update of modified.

Definition at line 337 of file GNETLSEditorFrame.cpp.

References myHaveModifications.

§ onUpdNeedsDef()

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

Called when occurs an update of needs definition.

Definition at line 312 of file GNETLSEditorFrame.cpp.

References myDefinitions.

§ onUpdNeedsDefAndPhase()

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

Called when occurs an update of needs definition an dphase.

Definition at line 320 of file GNETLSEditorFrame.cpp.

References myDefinitions, and myPhaseTable.

§ show()

void GNETLSEditorFrame::show ( )
virtual

§ updateCycleDuration()

void GNETLSEditorFrame::updateCycleDuration ( )
private

recomputes cycle duration and updates label

Definition at line 682 of file GNETLSEditorFrame.cpp.

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

Referenced by onCmdDefSwitch(), and onCmdPhaseEdit().

§ updateDescription()

void GNETLSEditorFrame::updateDescription ( ) const
private

Field Documentation

§ myContentFrame

FXVerticalFrame* GNEFrame::myContentFrame
protectedinherited

the panel to hold all member widgets

Definition at line 94 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

§ myCurrentJunction

GNEJunction* GNETLSEditorFrame::myCurrentJunction
private

§ myCycleDuration

FXLabel* GNETLSEditorFrame::myCycleDuration
private

label with the cycle duration

Definition at line 186 of file GNETLSEditorFrame.h.

Referenced by cleanup(), and updateCycleDuration().

§ myDefBox

FXListBox* GNETLSEditorFrame::myDefBox
private

the listbox for selecting the tl-definition to edit

Definition at line 180 of file GNETLSEditorFrame.h.

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

§ myDefinitions

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

the list of Definitions for the current junction

Definition at line 174 of file GNETLSEditorFrame.h.

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

§ myDescription

FXLabel* GNETLSEditorFrame::myDescription
private

the label that shows the current editing state

Definition at line 161 of file GNETLSEditorFrame.h.

Referenced by updateDescription().

§ myEditedDef

NBLoadedSUMOTLDef* GNETLSEditorFrame::myEditedDef
private

§ myFrameHeaderFont

FXFont* GNEFrame::myFrameHeaderFont
protectedinherited

Font for the Header.

Definition at line 88 of file GNEFrame.h.

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

§ myFrameHeaderLabel

FXLabel* GNEFrame::myFrameHeaderLabel
protectedinherited

the label for the frame's header

Definition at line 91 of file GNEFrame.h.

Referenced by GNEFrame::getFrameHeaderLabel(), GNEFrame::GNEFrame(), and GNESelectorFrame::selectionUpdated().

§ myHaveModifications

bool GNETLSEditorFrame::myHaveModifications
private

§ myHeaderFrame

FXHorizontalFrame* GNEFrame::myHeaderFrame
protectedinherited

fame for header elements

Definition at line 97 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

§ myHeaderLeftFrame

FXHorizontalFrame* GNEFrame::myHeaderLeftFrame
protectedinherited

fame for left header elements

Definition at line 100 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame(), and GNEInspectorFrame::inspect().

§ myHeaderRightFrame

FXHorizontalFrame* GNEFrame::myHeaderRightFrame
protectedinherited

fame for right header elements

Definition at line 103 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

§ myInternalLanes

TLIndexMap GNETLSEditorFrame::myInternalLanes
private

Definition at line 171 of file GNETLSEditorFrame.h.

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

§ myOffset

FXTextField* GNETLSEditorFrame::myOffset
private

the control for modifying offset

Definition at line 183 of file GNETLSEditorFrame.h.

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

§ myPhaseIndex

int GNETLSEditorFrame::myPhaseIndex
private

index of the phase being shown

Definition at line 192 of file GNETLSEditorFrame.h.

§ myPhaseTable

FXTable* GNETLSEditorFrame::myPhaseTable
private

table for selecting and rearranging phases and for changing duration

Definition at line 189 of file GNETLSEditorFrame.h.

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

§ myTableFont

FXFont* GNETLSEditorFrame::myTableFont
private

font for the phase table

Definition at line 158 of file GNETLSEditorFrame.h.

Referenced by ~GNETLSEditorFrame().

§ myViewNet


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