SUMO - Simulation of Urban MObility
GUIParameterTracker.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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // A window which displays the time line of one (or more) value(s)
20 /****************************************************************************/
21 #ifndef GUIParameterTracker_h
22 #define GUIParameterTracker_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 <fx.h>
36 // fx3d includes windows.h so we need to guard against macro pollution
37 #ifdef WIN32
38 #define NOMINMAX
39 #endif
40 #include <fx3d.h>
41 #ifdef WIN32
42 #undef NOMINMAX
43 #endif
46 #include "TrackerValueDesc.h"
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
55 class GUIParameterTracker : public FXMainWindow {
56  FXDECLARE(GUIParameterTracker)
57 public:
59  enum {
61  MID_AGGREGATIONINTERVAL = FXMainWindow::ID_LAST,
66  };
67 
68 
73  GUIParameterTracker(GUIMainWindow& app, const std::string& name);
74 
75 
78 
79 
81  void create();
82 
83 
90  TrackerValueDesc* newTracked);
91 
92 
95 
97  long onConfigure(FXObject*, FXSelector, void*);
98 
100  long onPaint(FXObject*, FXSelector, void*);
101 
103  long onSimStep(FXObject*, FXSelector, void*);
104 
106  long onCmdChangeAggregation(FXObject*, FXSelector, void*);
107 
109  long onCmdSave(FXObject*, FXSelector, void*);
111 
112 
113 public:
120  class GUIParameterTrackerPanel : public FXGLCanvas {
121  FXDECLARE(GUIParameterTrackerPanel)
122  public:
128  GUIParameterTrackerPanel(FXComposite* c, GUIMainWindow& app,
129  GUIParameterTracker& parent);
130 
133 
135  friend class GUIParameterTracker;
136 
137 
140 
142  long onConfigure(FXObject*, FXSelector, void*);
143 
145  long onPaint(FXObject*, FXSelector, void*);
146 
148  long onSimStep(FXObject* sender, FXSelector, void*);
150 
151 
152  private:
155  void drawValues();
156 
161  void drawValue(TrackerValueDesc& desc, double namePos);
162 
163 
164  private:
167 
170 
173 
174  protected:
177  };
178 
179 public:
182 
183 private:
185  void buildToolBar();
186 
187 
188 protected:
191 
193  std::vector<TrackerValueDesc*> myTracked;
194 
197 
199  std::vector<GLObjectValuePassConnector<double>*> myValuePassers;
200 
202  FXToolBarShell* myToolBarDrag;
203 
206 
209 
211  FXToolBar* myToolBar;
212 
213 protected:
216 
217 };
218 
219 
220 #endif
221 
222 /****************************************************************************/
223 
Save the current values.
void drawValue(TrackerValueDesc &desc, double namePos)
Draws a single value.
GUIParameterTracker()
Fox needs this.
Representation of a timeline of floats with their names and moments.
long onSimStep(FXObject *sender, FXSelector, void *)
Called on a simulation step.
long onCmdSave(FXObject *, FXSelector, void *)
Called when the data shall be saved.
GUIMainWindow * myApplication
The main application.
FXdouble myAggregationDelay
The simulation delay.
long onPaint(FXObject *, FXSelector, void *)
Called if the window shall be repainted.
FXToolBar * myToolBar
The tracker tool bar.
A window which displays the time line of one (or more) value(s)
FXToolBarShell * myToolBarDrag
for some menu detaching fun
void addTracked(GUIGlObject &o, ValueSource< double > *src, TrackerValueDesc *newTracked)
Adds a further time line to display.
FXComboBox * myAggregationInterval
A combo box to select an aggregation interval.
void buildToolBar()
Builds the tool bar.
long onPaint(FXObject *, FXSelector, void *)
Called if the window shall be repainted.
long onSimStep(FXObject *, FXSelector, void *)
Called on a simulation step.
void create()
Creates the window.
~GUIParameterTracker()
Destructor.
long onCmdChangeAggregation(FXObject *, FXSelector, void *)
Called when the aggregation interval (combo) has been changed.
std::vector< TrackerValueDesc * > myTracked
The list of tracked values.
GUIParameterTrackerPanel * myPanel
The panel to display the values in.
GUIParameterTracker * myParent
The parent window.
std::vector< GLObjectValuePassConnector< double > * > myValuePassers
The value sources.
GUIMainWindow * myApplication
The main application.
long onConfigure(FXObject *, FXSelector, void *)
Called on window resizing.
long onConfigure(FXObject *, FXSelector, void *)
Called on window resizing.