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
 
class  TLSDefinition
 
class  TLSFile
 
class  TLSJunction
 FOX-declaration. More...
 
class  TLSModifications
 
class  TLSPhases
 

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...
 
bool isTLSSaved ()
 check if modifications in TLS was saved More...
 
bool parseTLSPrograms (const std::string &file)
 parse TLS Programs from a file 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 onCmdCleanup (FXObject *, FXSelector, void *)
 Called when the user cleans up states. More...
 
long onCmdAddUnused (FXObject *, FXSelector, void *)
 Called when the user cleans up states. 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...
 
void openHelpAttributesDialog (SumoXMLTag tag) const
 Open help attributes dialog. 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...
 
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
 View Net for changes. 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...
 

Static Private Member Functions

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

Private Attributes

NBLoadedSUMOTLDef * myEditedDef
 the traffic light definition being edited More...
 
TLIndexMap myInternalLanes
 
int myPhaseIndex
 index of the phase being shown More...
 
GNETLSEditorFrame::TLSAttributes * myTLSAttributes
 modul for TLS attributes More...
 
GNETLSEditorFrame::TLSDefinition * myTLSDefinition
 modul for TLS Definition More...
 
GNETLSEditorFrame::TLSFile * myTLSFile
 modul for load/Save TLS Programs More...
 
GNETLSEditorFrame::TLSJunction * myTLSJunction
 modul for TLS Junction More...
 
GNETLSEditorFrame::TLSModifications * myTLSModifications
 modul for load/Save TLS Modifications More...
 
GNETLSEditorFrame::TLSPhases * myTLSPhases
 modul for TLS Phases More...
 

Detailed Description

The Widget for modifying Traffic Lights (TLS)

Definition at line 45 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 465 of file GNETLSEditorFrame.h.

Constructor & Destructor Documentation

◆ GNETLSEditorFrame() [1/2]

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

Constructor.

parent FXHorizontalFrame in which this GNEFrame is placed viewNet viewNet that uses this GNEFrame

Definition at line 100 of file GNETLSEditorFrame.cpp.

◆ ~GNETLSEditorFrame()

GNETLSEditorFrame::~GNETLSEditorFrame ( )

Destructor.

Definition at line 130 of file GNETLSEditorFrame.cpp.

References cleanup().

◆ GNETLSEditorFrame() [2/2]

GNETLSEditorFrame::GNETLSEditorFrame ( )
inlineprotected

FOX needs this.

Definition at line 440 of file GNETLSEditorFrame.h.

References getSUMOTime().

Member Function Documentation

◆ buildIinternalLanes()

◆ cleanup()

◆ controlsEdge()

bool GNETLSEditorFrame::controlsEdge ( GNEEdge &  edge) const

whether the given edge is controlled by the currently edited tlDef

Definition at line 707 of file GNETLSEditorFrame.cpp.

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

Referenced by GNELane::getPopUpMenu().

◆ editJunction()

◆ focusUpperElement()

void GNEFrame::focusUpperElement ( )
inherited

◆ getFrameHeaderFont()

FXFont * GNEFrame::getFrameHeaderFont ( ) const
inherited

get font of the header's frame

Definition at line 778 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderFont.

◆ getFrameHeaderLabel()

FXLabel * GNEFrame::getFrameHeaderLabel ( ) const
inherited

get the label for the frame's header

Definition at line 772 of file GNEFrame.cpp.

References GNEFrame::myFrameHeaderLabel.

Referenced by GNEProhibitionFrame::GNEProhibitionFrame(), and GNEInspectorFrame::inspectMultisection().

◆ getPhases()

◆ getSUMOTime()

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

converts to SUMOTime

Definition at line 721 of file GNETLSEditorFrame.cpp.

References TIME2STEPS.

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

◆ getViewNet()

GNEViewNet * GNEFrame::getViewNet ( ) const
inherited

get view net

Definition at line 766 of file GNEFrame.cpp.

References GNEFrame::myViewNet.

Referenced by GNEPolygonFrame::DrawingMode::abortDrawing(), GNETLSEditorFrame::TLSFile::checkTLSValids(), GNEFrame::ACHierarchy::createPopUpMenu(), GNECrossingFrame::edgesSelector::enableEdgeSelector(), GNETLSEditorFrame::TLSFile::myStartElement(), GNEFrame::ACHierarchy::onCmdCenterItem(), GNEInspectorFrame::TemplateEditor::onCmdCopyTemplate(), GNEFrame::ACHierarchy::onCmdDeleteItem(), GNEFrame::GenericParametersEditor::onCmdEditGenericParameter(), GNEFrame::ACHierarchy::onCmdInspectItem(), GNESelectorFrame::SelectionOperation::onCmdInvert(), GNESelectorFrame::SelectionOperation::onCmdLoad(), GNEInspectorFrame::AttributesEditor::AttributeInput::onCmdOpenAttributeDialog(), GNESelectorFrame::VisualScaling::onCmdScaleSelection(), GNEInspectorFrame::AttributesEditor::AttributeInput::onCmdSetAttribute(), GNECrossingFrame::crossingParameters::onCmdSetAttribute(), GNEFrame::GenericParametersEditor::onCmdSetGenericParameter(), GNEInspectorFrame::GEOAttributesEditor::onCmdSetGEOAttribute(), GNEInspectorFrame::NeteditAttributesEditor::onCmdSetNeteditAttribute(), GNEAdditionalFrame::SelectorParentAdditional::refreshListOfAdditionalParents(), GNEDeleteFrame::removeAttributeCarrier(), GNECrossingFrame::edgesSelector::restoreEdgeColors(), GNEFrame::ACHierarchy::showAttributeCarrierChilds(), GNEFrame::ACHierarchy::showAttributeCarrierParents(), GNEAdditionalFrame::SelectorParentEdges::showList(), GNEAdditionalFrame::SelectorParentLanes::showList(), GNEInspectorFrame::NeteditAttributesEditor::showNeteditAttributesEditor(), GNEAdditionalFrame::AdditionalAttributes::showWarningMessage(), GNEPolygonFrame::ShapeAttributes::showWarningMessage(), GNEPolygonFrame::DrawingMode::stopDrawing(), GNESelectorFrame::LockGLObjectTypes::updateLockGLObjectTypes(), GNEAdditionalFrame::SelectorParentEdges::updateUseSelectedEdges(), and GNEAdditionalFrame::SelectorParentLanes::updateUseSelectedLanes().

◆ handleChange()

◆ handleMultiChange()

◆ hide()

◆ isTLSSaved()

bool GNETLSEditorFrame::isTLSSaved ( )

check if modifications in TLS was saved

Definition at line 151 of file GNETLSEditorFrame.cpp.

References GNETLSEditorFrame::TLSModifications::checkHaveModifications(), myTLSModifications, onCmdCancel(), onCmdOK(), and WRITE_DEBUG.

Referenced by GNEViewNet::setEditMode().

◆ onCmdAddUnused()

◆ onCmdCancel()

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

◆ onCmdCleanup()

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

◆ onCmdDefAddOff()

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

Called when the user adds a OFF.

Definition at line 369 of file GNETLSEditorFrame.cpp.

◆ onCmdDefCreate()

◆ onCmdDefDelete()

◆ onCmdDefOffset()

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

◆ onCmdDefRename()

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

Called when the user renames a TLS.

Definition at line 357 of file GNETLSEditorFrame.cpp.

◆ onCmdDefSubRename()

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

Called when the user sub-renames a TLS.

Definition at line 363 of file GNETLSEditorFrame.cpp.

◆ onCmdDefSwitch()

◆ onCmdGuess()

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

Called when the user presses the button Guess.

Definition at line 375 of file GNETLSEditorFrame.cpp.

◆ onCmdMakeRILSAConforming()

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

Called when the user makes RILSA.

◆ onCmdOK()

◆ onCmdPhaseCreate()

◆ onCmdPhaseDelete()

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

◆ onCmdPhaseEdit()

◆ onCmdPhaseSwitch()

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

◆ onCmdToggle()

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

Called when the user presses the button Toogle.

◆ onUpdDefCreate()

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

◆ onUpdDefSwitch()

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

◆ onUpdModified()

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

Called when occurs an update of modified.

Definition at line 340 of file GNETLSEditorFrame.cpp.

References GNETLSEditorFrame::TLSModifications::checkHaveModifications(), and myTLSModifications.

◆ onUpdNeedsDef()

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

Called when occurs an update of needs definition.

Definition at line 315 of file GNETLSEditorFrame.cpp.

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

◆ onUpdNeedsDefAndPhase()

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

Called when occurs an update of needs definition an dphase.

Definition at line 323 of file GNETLSEditorFrame.cpp.

References GNETLSEditorFrame::TLSAttributes::getNumberOfTLSDefinitions(), GNETLSEditorFrame::TLSPhases::getPhaseTable(), myTLSAttributes, and myTLSPhases.

◆ openHelpAttributesDialog()

◆ parseTLSPrograms()

◆ setFrameWidth()

void GNEFrame::setFrameWidth ( int  newWidth)
inherited

set width of GNEFrame

Definition at line 759 of file GNEFrame.cpp.

References GNEFrame::myScrollWindowsContents.

◆ show()

◆ varDurString()

std::string GNETLSEditorFrame::varDurString ( SUMOTime  dur)
staticprivate

convert duration (potentially undefined) to string

Definition at line 634 of file GNETLSEditorFrame.cpp.

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

Referenced by GNETLSEditorFrame::TLSPhases::initPhaseTable(), and onCmdPhaseEdit().

Field Documentation

◆ myContentFrame

FXVerticalFrame* GNEFrame::myContentFrame
protectedinherited

◆ myEditedDef

◆ myHeaderFrame

FXHorizontalFrame* GNEFrame::myHeaderFrame
protectedinherited

fame for header elements

Definition at line 238 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

◆ myHeaderLeftFrame

FXHorizontalFrame* GNEFrame::myHeaderLeftFrame
protectedinherited

◆ myHeaderRightFrame

FXHorizontalFrame* GNEFrame::myHeaderRightFrame
protectedinherited

fame for right header elements

Definition at line 244 of file GNEFrame.h.

Referenced by GNEFrame::GNEFrame().

◆ myInternalLanes

TLIndexMap GNETLSEditorFrame::myInternalLanes
private

Definition at line 466 of file GNETLSEditorFrame.h.

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

◆ myPhaseIndex

int GNETLSEditorFrame::myPhaseIndex
private

index of the phase being shown

Definition at line 472 of file GNETLSEditorFrame.h.

◆ myTLSAttributes

◆ myTLSDefinition

GNETLSEditorFrame::TLSDefinition* GNETLSEditorFrame::myTLSDefinition
private

modul for TLS Definition

Definition at line 450 of file GNETLSEditorFrame.h.

◆ myTLSFile

GNETLSEditorFrame::TLSFile* GNETLSEditorFrame::myTLSFile
private

modul for load/Save TLS Programs

Definition at line 462 of file GNETLSEditorFrame.h.

Referenced by GNETLSEditorFrame::TLSAttributes::initTLSAttributes(), onCmdCancel(), and parseTLSPrograms().

◆ myTLSJunction

◆ myTLSModifications

◆ myTLSPhases

◆ myViewNet

GNEViewNet* GNEFrame::myViewNet
protectedinherited

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