SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIParameterTableWindow.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // The window that holds the table of an object's parameter
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12 // Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef GUIParameterTableWindow_h
23 #define GUIParameterTableWindow_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <vector>
36 #include <string>
37 #include <fx.h>
40 #include <utils/common/SUMOTime.h>
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class GUIGlObject;
47 class GUIMainWindow;
49 
50 
51 // ===========================================================================
52 // class definitions
53 // ===========================================================================
68  FXDECLARE(GUIParameterTableWindow)
69 public:
77  GUIGlObject& o, size_t noRows);
78 
79 
82 
83 
92  void closeBuilding();
93 
94 
95 
99  void removeObject(GUIGlObject* const o);
100 
101 
102 
105 
112  void mkItem(const char* name, bool dynamic, ValueSource<unsigned>* src);
113 
120  void mkItem(const char* name, bool dynamic, ValueSource<int>* src);
121 
122 
129  void mkItem(const char* name, bool dynamic, ValueSource<SUMOReal>* src);
130 
131 
139  void mkItem(const char* name, bool dynamic, std::string value);
140 
141 
149  void mkItem(const char* name, bool dynamic, unsigned value);
150 
151 
159  void mkItem(const char* name, bool dynamic, int value);
160 
161 
169  void mkItem(const char* name, bool dynamic, SUMOReal value);
170 
171 
173 
174 
175 
178 
180  long onSimStep(FXObject*, FXSelector, void*);
181 
185  long onTableSelected(FXObject*, FXSelector, void*);
186 
190  long onTableDeselected(FXObject*, FXSelector, void*);
191 
201  long onRightButtonPress(FXObject*, FXSelector, void*);
203 
204 
205 protected:
212  void updateTable();
213 
214 
215 private:
218 
221 
224 
226  std::vector<GUIParameterTableItemInterface*> myItems;
227 
229  unsigned myCurrentPos;
230 
232  mutable MFXMutex myLock;
233 
234 protected:
237 
238 };
239 
240 
241 #endif
242 
243 /****************************************************************************/
244 
void removeObject(GUIGlObject *const o)
Lets this window know the object shown is being deleted.
unsigned myCurrentPos
The index of the next row to add - used while building.
FXTable * myTable
The table to display the information in.
GUIMainWindow * myApplication
The main application window.
void updateTable()
Updates the table.
Interface to a single line in a parameter window.
long onRightButtonPress(FXObject *, FXSelector, void *)
Shows a popup.
long onSimStep(FXObject *, FXSelector, void *)
Updates the table due to a simulation step.
long onTableDeselected(FXObject *, FXSelector, void *)
Does nothing.
GUIParameterTableWindow()
FOX needs this.
MFXMutex myLock
A lock assuring save updates in cse of object deletion.
GUIGlObject * myObject
The object to get the information from.
#define SUMOReal
Definition: config.h:215
long onTableSelected(FXObject *, FXSelector, void *)
Does nothing.
std::vector< GUIParameterTableItemInterface * > myItems
The list of table rows.
void mkItem(const char *name, bool dynamic, ValueSource< unsigned > *src)
Adds a row which obtains its value from an unsigned-ValueSource.
void closeBuilding()
Closes the building of the table.
A window containing a gl-object's parameter.