Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GUIDialog_Breakpoints Class Reference

Editor for simulation breakpoints. More...

#include <GUIDialog_Breakpoints.h>

Inheritance diagram for GUIDialog_Breakpoints:
[legend]
Collaboration diagram for GUIDialog_Breakpoints:
[legend]

Public Member Functions

 GUIDialog_Breakpoints (GUIApplicationWindow *parent, std::vector< SUMOTime > &breakpoints, FXMutex &breakpointLock, const SUMOTime simBegin)
 Constructor.
 
virtual void layout ()
 
void rebuildList ()
 Rebuilds the entire list.
 
void show ()
 sets the focus after the window is created
 
 ~GUIDialog_Breakpoints ()
 Destructor.
 
FOX-callbacks
long onCmdLoad (FXObject *, FXSelector, void *)
 Called when the user presses the Load-button.
 
long onCmdSave (FXObject *, FXSelector, void *)
 Called when the user presses the Save-button.
 
long onCmdClear (FXObject *, FXSelector, void *)
 Called when the user presses the Clear-button.
 
long onCmdUpdateBreakpoints (FXObject *, FXSelector, void *)
 Called when the user clicks a time link in the message window.
 
long onCmdClose (FXObject *, FXSelector, void *)
 Called when the user presses the Close-button.
 
long onCmdEditTable (FXObject *, FXSelector, void *)
 Called when the table was changed.
 

Private Member Functions

std::string encode2TXT ()
 FOX need this.
 

Private Attributes

FXMutex * myBreakpointLock
 Lock for modifying the list of breakpoints.
 
std::vector< SUMOTime > * myBreakpoints
 List of breakpoints.
 
GUIApplicationWindowmyParent
 The parent window.
 
std::unique_ptr< GUIPersistentWindowPosmyPersistentPos
 persisting the position on close
 
SUMOTime mySimBegin
 simulation begin
 
FXTable * myTable
 The list that holds the ids.
 

Detailed Description

Editor for simulation breakpoints.

This dialog shows and lets the user edit the list of breakpoints - simulation time steps where the simulation halts.

Todo:
Use a LineReader instead of >> while reading

Definition at line 42 of file GUIDialog_Breakpoints.h.

Constructor & Destructor Documentation

◆ GUIDialog_Breakpoints()

GUIDialog_Breakpoints::GUIDialog_Breakpoints ( GUIApplicationWindow parent,
std::vector< SUMOTime > &  breakpoints,
FXMutex &  breakpointLock,
const SUMOTime  simBegin 
)

◆ ~GUIDialog_Breakpoints()

GUIDialog_Breakpoints::~GUIDialog_Breakpoints ( )

Member Function Documentation

◆ encode2TXT()

std::string GUIDialog_Breakpoints::encode2TXT ( )
private

FOX need this.

Builds a text representation of the items in the list

Returns
Breakpoints encoded as a string

Definition at line 184 of file GUIDialog_Breakpoints.cpp.

References myBreakpointLock, myBreakpoints, and time2string().

Referenced by onCmdSave().

Here is the caller graph for this function:

◆ layout()

void GUIDialog_Breakpoints::layout ( )
virtual

Definition at line 257 of file GUIDialog_Breakpoints.cpp.

References myTable.

◆ onCmdClear()

long GUIDialog_Breakpoints::onCmdClear ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Clear-button.

Definition at line 196 of file GUIDialog_Breakpoints.cpp.

References myBreakpointLock, myBreakpoints, and rebuildList().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdClose()

long GUIDialog_Breakpoints::onCmdClose ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Close-button.

Definition at line 213 of file GUIDialog_Breakpoints.cpp.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdEditTable()

long GUIDialog_Breakpoints::onCmdEditTable ( FXObject *  ,
FXSelector  ,
void *  ptr 
)

Called when the table was changed.

Definition at line 220 of file GUIDialog_Breakpoints.cpp.

References DELTA_T, myBreakpointLock, myBreakpoints, mySimBegin, myTable, StringUtils::prune(), rebuildList(), string2time(), and TL.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdLoad()

long GUIDialog_Breakpoints::onCmdLoad ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Load-button.

Definition at line 143 of file GUIDialog_Breakpoints.cpp.

References EMPTY, gCurrentFolder, GUIIconSubSys::getIcon(), GUISettingsHandler::loadBreakpoints(), myBreakpointLock, myBreakpoints, rebuildList(), TL, and SUMOXMLDefinitions::TXTFileExtensions.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdSave()

long GUIDialog_Breakpoints::onCmdSave ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user presses the Save-button.

Definition at line 164 of file GUIDialog_Breakpoints.cpp.

References OutputDevice::close(), EMPTY, encode2TXT(), gCurrentFolder, OutputDevice::getDevice(), MFXUtils::getFilename2Write(), GUIIconSubSys::getIcon(), TL, and SUMOXMLDefinitions::TXTFileExtensions.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdUpdateBreakpoints()

long GUIDialog_Breakpoints::onCmdUpdateBreakpoints ( FXObject *  ,
FXSelector  ,
void *   
)

Called when the user clicks a time link in the message window.

Definition at line 205 of file GUIDialog_Breakpoints.cpp.

References myBreakpointLock, and rebuildList().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ rebuildList()

void GUIDialog_Breakpoints::rebuildList ( )

Rebuilds the entire list.

Definition at line 124 of file GUIDialog_Breakpoints.cpp.

References GUIDesignHeight, myBreakpoints, myTable, time2string(), and TL.

Referenced by onCmdClear(), onCmdEditTable(), onCmdLoad(), and onCmdUpdateBreakpoints().

Here is the caller graph for this function:

◆ show()

void GUIDialog_Breakpoints::show ( )

sets the focus after the window is created

Definition at line 117 of file GUIDialog_Breakpoints.cpp.

References myBreakpoints, and myTable.

Field Documentation

◆ myBreakpointLock

FXMutex* GUIDialog_Breakpoints::myBreakpointLock
private

Lock for modifying the list of breakpoints.

Definition at line 107 of file GUIDialog_Breakpoints.h.

Referenced by encode2TXT(), onCmdClear(), onCmdEditTable(), onCmdLoad(), and onCmdUpdateBreakpoints().

◆ myBreakpoints

std::vector<SUMOTime>* GUIDialog_Breakpoints::myBreakpoints
private

List of breakpoints.

Definition at line 104 of file GUIDialog_Breakpoints.h.

Referenced by encode2TXT(), onCmdClear(), onCmdEditTable(), onCmdLoad(), rebuildList(), and show().

◆ myParent

GUIApplicationWindow* GUIDialog_Breakpoints::myParent
private

The parent window.

Definition at line 101 of file GUIDialog_Breakpoints.h.

Referenced by ~GUIDialog_Breakpoints().

◆ myPersistentPos

std::unique_ptr<GUIPersistentWindowPos> GUIDialog_Breakpoints::myPersistentPos
private

persisting the position on close

Definition at line 113 of file GUIDialog_Breakpoints.h.

◆ mySimBegin

SUMOTime GUIDialog_Breakpoints::mySimBegin
private

simulation begin

Definition at line 110 of file GUIDialog_Breakpoints.h.

Referenced by onCmdEditTable().

◆ myTable

FXTable* GUIDialog_Breakpoints::myTable
private

The list that holds the ids.

Definition at line 98 of file GUIDialog_Breakpoints.h.

Referenced by layout(), onCmdEditTable(), rebuildList(), and show().


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