Eclipse SUMO - Simulation of Urban MObility
GUIDialog_Breakpoints.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2022 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
19 // Editor for simulation breakpoints
20 /****************************************************************************/
21 #pragma once
22 #include <config.h>
23 
24 #include <string>
25 #include <vector>
27 
28 
29 // ===========================================================================
30 // class definition
31 // ===========================================================================
40 class GUIDialog_Breakpoints : public FXMainWindow {
41  // FOX-declarations
42  FXDECLARE(GUIDialog_Breakpoints)
43 
44 public:
48  GUIDialog_Breakpoints(GUIMainWindow* parent, std::vector<SUMOTime>& breakpoints, FXMutex& breakpointLock);
49 
52 
54  void show();
55 
58 
60  long onCmdLoad(FXObject*, FXSelector, void*);
61 
63  long onCmdSave(FXObject*, FXSelector, void*);
64 
66  long onCmdClear(FXObject*, FXSelector, void*);
67 
69  long onCmdClose(FXObject*, FXSelector, void*);
70 
72  long onCmdEditTable(FXObject*, FXSelector, void*);
74 
75  virtual void layout();
76 
77 protected:
78  FOX_CONSTRUCTOR(GUIDialog_Breakpoints)
79 
80 private:
82  void rebuildList();
83 
87  std::string encode2TXT();
88 
90  FXTable* myTable;
91 
94 
96  std::vector<SUMOTime>* myBreakpoints;
97 
99  FXMutex* myBreakpointLock;
100 };
Editor for simulation breakpoints.
long onCmdClose(FXObject *, FXSelector, void *)
Called when the user presses the Close-button.
FXMutex * myBreakpointLock
Lock for modifying the list of breakpoints.
FXTable * myTable
The list that holds the ids.
GUIDialog_Breakpoints(GUIMainWindow *parent, std::vector< SUMOTime > &breakpoints, FXMutex &breakpointLock)
Constructor.
long onCmdLoad(FXObject *, FXSelector, void *)
Called when the user presses the Load-button.
GUIMainWindow * myParent
The parent window.
std::vector< SUMOTime > * myBreakpoints
List of breakpoints.
long onCmdClear(FXObject *, FXSelector, void *)
Called when the user presses the Clear-button.
void show()
sets the focus after the window is created
long onCmdEditTable(FXObject *, FXSelector, void *)
Called when the table was changed.
long onCmdSave(FXObject *, FXSelector, void *)
Called when the user presses the Save-button.
void rebuildList()
Rebuilds the entire list.
std::string encode2TXT()
Builds a text representation of the items in the list.