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 /****************************************************************************/
8 // The window that holds the table of an object's parameter
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef GUIParameterTableWindow_h
22 #define GUIParameterTableWindow_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <vector>
35 #include <string>
36 #include <fx.h>
39 #include <utils/common/SUMOTime.h>
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class GUIGlObject;
46 class GUIMainWindow;
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
67  FXDECLARE(GUIParameterTableWindow)
68 public:
76  GUIGlObject& o, size_t noRows);
77 
78 
81 
82 
91  void closeBuilding();
92 
93 
94 
98  void removeObject(GUIGlObject* const o);
99 
100 
101 
104 
111  void mkItem(const char* name, bool dynamic, ValueSource<unsigned>* src);
112 
119  void mkItem(const char* name, bool dynamic, ValueSource<int>* src);
120 
121 
128  void mkItem(const char* name, bool dynamic, ValueSource<SUMOReal>* src);
129 
130 
138  void mkItem(const char* name, bool dynamic, std::string value);
139 
140 
148  void mkItem(const char* name, bool dynamic, unsigned value);
149 
150 
158  void mkItem(const char* name, bool dynamic, int value);
159 
160 
168  void mkItem(const char* name, bool dynamic, SUMOReal value);
169 
170 
172 
173 
174 
177 
179  long onSimStep(FXObject*, FXSelector, void*);
180 
184  long onTableSelected(FXObject*, FXSelector, void*);
185 
189  long onTableDeselected(FXObject*, FXSelector, void*);
190 
200  long onRightButtonPress(FXObject*, FXSelector, void*);
202 
203 
204 protected:
211  void updateTable();
212 
213 
214 private:
217 
220 
223 
225  std::vector<GUIParameterTableItemInterface*> myItems;
226 
228  unsigned myCurrentPos;
229 
231  mutable MFXMutex myLock;
232 
233 protected:
236 
237 };
238 
239 
240 #endif
241 
242 /****************************************************************************/
243 
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&#39;s parameter.