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

Editor for simulation breakpoints. More...

#include <GUIDialog_Breakpoints.h>

Inheritance diagram for GUIDialog_Breakpoints:
Inheritance graph
Collaboration diagram for GUIDialog_Breakpoints:
Collaboration graph

Public Member Functions

 GUIDialog_Breakpoints (GUIMainWindow *parent, std::vector< SUMOTime > &breakpoints, FXMutex &breakpointLock)
 Constructor. More...
 
void show ()
 sets the focus after the window is created More...
 
 ~GUIDialog_Breakpoints ()
 Destructor. More...
 
FOX-callbacks
long onCmdLoad (FXObject *, FXSelector, void *)
 Called when the user presses the Load-button. More...
 
long onCmdSave (FXObject *, FXSelector, void *)
 Called when the user presses the Save-button. More...
 
long onCmdClear (FXObject *, FXSelector, void *)
 Called when the user presses the Clear-button. More...
 
long onCmdClose (FXObject *, FXSelector, void *)
 Called when the user presses the Close-button. More...
 
long onCmdEditTable (FXObject *, FXSelector, void *)
 Called when the table was changed. More...
 

Protected Member Functions

 GUIDialog_Breakpoints ()
 FOX needs this. More...
 

Private Member Functions

std::string encode2TXT ()
 Builds a text representation of the items in the list. More...
 
void rebuildList ()
 Rebuilds the entire list. More...
 

Private Attributes

FXMutex * myBreakpointLock
 Lock for modifying the list of breakpoints. More...
 
std::vector< SUMOTime > * myBreakpoints
 List of breakpoints. More...
 
GUIMainWindowmyParent
 The parent window. More...
 
FXTable * myTable
 The list that holds the ids. More...
 

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 50 of file GUIDialog_Breakpoints.h.

Constructor & Destructor Documentation

GUIDialog_Breakpoints::GUIDialog_Breakpoints ( GUIMainWindow parent,
std::vector< SUMOTime > &  breakpoints,
FXMutex &  breakpointLock 
)

Constructor.

Parameters
[in]parentThe parent window

Definition at line 78 of file GUIDialog_Breakpoints.cpp.

References GUIIconSubSys::getIcon(), ICON_APP_BREAKPOINTS, MID_CANCEL, MID_CHOOSEN_CLEAR, MID_CHOOSEN_LOAD, MID_CHOOSEN_SAVE, and MID_TABLE.

GUIDialog_Breakpoints::~GUIDialog_Breakpoints ( )

Destructor.

Definition at line 114 of file GUIDialog_Breakpoints.cpp.

References myParent, and GUIMainWindow::removeChild().

GUIDialog_Breakpoints::GUIDialog_Breakpoints ( )
inlineprotected

FOX needs this.

Definition at line 115 of file GUIDialog_Breakpoints.h.

Member Function Documentation

std::string GUIDialog_Breakpoints::encode2TXT ( )
private

Builds a text representation of the items in the list.

Returns
Breakpoints encoded as a string

Definition at line 185 of file GUIDialog_Breakpoints.cpp.

References myBreakpointLock, myBreakpoints, and time2string().

Referenced by onCmdSave().

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

Called when the user presses the Clear-button.

Definition at line 197 of file GUIDialog_Breakpoints.cpp.

References myBreakpointLock, myBreakpoints, and rebuildList().

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

Called when the user presses the Close-button.

Definition at line 207 of file GUIDialog_Breakpoints.cpp.

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

Called when the table was changed.

Definition at line 214 of file GUIDialog_Breakpoints.cpp.

References myBreakpointLock, myBreakpoints, myTable, rebuildList(), and string2time().

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

Called when the user presses the Load-button.

Definition at line 146 of file GUIDialog_Breakpoints.cpp.

References gCurrentFolder, GUIIconSubSys::getIcon(), ICON_EMPTY, GUISettingsHandler::loadBreakpoints(), myBreakpointLock, myBreakpoints, and rebuildList().

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

Rebuilds the entire list.

Definition at line 127 of file GUIDialog_Breakpoints.cpp.

References myBreakpoints, myTable, and time2string().

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

void GUIDialog_Breakpoints::show ( )

sets the focus after the window is created

Definition at line 120 of file GUIDialog_Breakpoints.cpp.

References myBreakpoints, and myTable.

Referenced by GUIApplicationWindow::onCmdEditBreakpoints().

Field Documentation

FXMutex* GUIDialog_Breakpoints::myBreakpointLock
private

Lock for modifying the list of breakpoints.

Definition at line 110 of file GUIDialog_Breakpoints.h.

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

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

List of breakpoints.

Definition at line 107 of file GUIDialog_Breakpoints.h.

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

GUIMainWindow* GUIDialog_Breakpoints::myParent
private

The parent window.

Definition at line 104 of file GUIDialog_Breakpoints.h.

Referenced by ~GUIDialog_Breakpoints().

FXTable* GUIDialog_Breakpoints::myTable
private

The list that holds the ids.

Definition at line 101 of file GUIDialog_Breakpoints.h.

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


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