SUMO - Simulation of Urban MObility
GUIParameterTracker.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // A window which displays the time line of one (or more) value(s)
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2017 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 GUIParameterTracker_h
23 #define GUIParameterTracker_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 <fx.h>
37 // fx3d includes windows.h so we need to guard against macro pollution
38 #ifdef WIN32
39 #define NOMINMAX
40 #endif
41 #include <fx3d.h>
42 #ifdef WIN32
43 #undef NOMINMAX
44 #endif
47 #include "TrackerValueDesc.h"
48 
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
56 class GUIParameterTracker : public FXMainWindow {
57  FXDECLARE(GUIParameterTracker)
58 public:
60  enum {
62  MID_AGGREGATIONINTERVAL = FXMainWindow::ID_LAST,
67  };
68 
69 
74  GUIParameterTracker(GUIMainWindow& app, const std::string& name);
75 
76 
79 
80 
82  void create();
83 
84 
91  TrackerValueDesc* newTracked);
92 
93 
96 
98  long onConfigure(FXObject*, FXSelector, void*);
99 
101  long onPaint(FXObject*, FXSelector, void*);
102 
104  long onSimStep(FXObject*, FXSelector, void*);
105 
107  long onCmdChangeAggregation(FXObject*, FXSelector, void*);
108 
110  long onCmdSave(FXObject*, FXSelector, void*);
112 
113 
114 public:
121  class GUIParameterTrackerPanel : public FXGLCanvas {
122  FXDECLARE(GUIParameterTrackerPanel)
123  public:
129  GUIParameterTrackerPanel(FXComposite* c, GUIMainWindow& app,
130  GUIParameterTracker& parent);
131 
134 
136  friend class GUIParameterTracker;
137 
138 
141 
143  long onConfigure(FXObject*, FXSelector, void*);
144 
146  long onPaint(FXObject*, FXSelector, void*);
147 
149  long onSimStep(FXObject* sender, FXSelector, void*);
151 
152 
153  private:
156  void drawValues();
157 
162  void drawValue(TrackerValueDesc& desc, double namePos);
163 
164 
165  private:
168 
171 
174 
175  protected:
178  };
179 
180 public:
183 
184 private:
186  void buildToolBar();
187 
188 
189 protected:
192 
194  std::vector<TrackerValueDesc*> myTracked;
195 
198 
200  std::vector<GLObjectValuePassConnector<double>*> myValuePassers;
201 
203  FXToolBarShell* myToolBarDrag;
204 
207 
210 
212  FXToolBar* myToolBar;
213 
214 protected:
217 
218 };
219 
220 
221 #endif
222 
223 /****************************************************************************/
224 
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.
Save the current values.
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.