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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // A window which displays the time line of one (or more) value(s)
18 /****************************************************************************/
19 #ifndef GUIParameterTracker_h
20 #define GUIParameterTracker_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <vector>
29 #include <fx.h>
30 // fx3d includes windows.h so we need to guard against macro pollution
31 #ifdef WIN32
32 #define NOMINMAX
33 #endif
34 #include <fx3d.h>
35 #ifdef WIN32
36 #undef NOMINMAX
37 #endif
40 #include "TrackerValueDesc.h"
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
49 class GUIParameterTracker : public FXMainWindow {
50  FXDECLARE(GUIParameterTracker)
51 public:
53  enum {
55  MID_AGGREGATIONINTERVAL = FXMainWindow::ID_LAST,
60  };
61 
62 
67  GUIParameterTracker(GUIMainWindow& app, const std::string& name);
68 
69 
72 
73 
75  void create();
76 
77 
84  TrackerValueDesc* newTracked);
85 
86 
89 
91  long onConfigure(FXObject*, FXSelector, void*);
92 
94  long onPaint(FXObject*, FXSelector, void*);
95 
97  long onSimStep(FXObject*, FXSelector, void*);
98 
100  long onCmdChangeAggregation(FXObject*, FXSelector, void*);
101 
103  long onCmdSave(FXObject*, FXSelector, void*);
105 
106 
107 public:
114  class GUIParameterTrackerPanel : public FXGLCanvas {
115  FXDECLARE(GUIParameterTrackerPanel)
116  public:
122  GUIParameterTrackerPanel(FXComposite* c, GUIMainWindow& app,
123  GUIParameterTracker& parent);
124 
127 
129  friend class GUIParameterTracker;
130 
131 
134 
136  long onConfigure(FXObject*, FXSelector, void*);
137 
139  long onPaint(FXObject*, FXSelector, void*);
140 
142  long onSimStep(FXObject* sender, FXSelector, void*);
144 
145 
146  private:
149  void drawValues();
150 
155  void drawValue(TrackerValueDesc& desc, double namePos);
156 
157 
158  private:
161 
164 
167 
168  protected:
171  };
172 
173 public:
176 
177 private:
179  void buildToolBar();
180 
181 
182 protected:
185 
187  std::vector<TrackerValueDesc*> myTracked;
188 
191 
193  std::vector<GLObjectValuePassConnector<double>*> myValuePassers;
194 
196  FXToolBarShell* myToolBarDrag;
197 
200 
203 
205  FXToolBar* myToolBar;
206 
207 protected:
210 
211 };
212 
213 
214 #endif
215 
216 /****************************************************************************/
217 
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)
Save the current values.
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.