|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // A window which displays the time line of one (or more) value(s) 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors 00011 /****************************************************************************/ 00012 // 00013 // This program is free software; you can redistribute it and/or modify 00014 // it under the terms of the GNU General Public License as published by 00015 // the Free Software Foundation; either version 2 of the License, or 00016 // (at your option) any later version. 00017 // 00018 /****************************************************************************/ 00019 #ifndef GUIParameterTracker_h 00020 #define GUIParameterTracker_h 00021 00022 00023 // =========================================================================== 00024 // included modules 00025 // =========================================================================== 00026 #ifdef _MSC_VER 00027 #include <windows_config.h> 00028 #else 00029 #include <config.h> 00030 #endif 00031 00032 #include <vector> 00033 #include <fx.h> 00034 #include <fx3d.h> 00035 #include <utils/gui/globjects/GUIGlObject.h> 00036 #include <utils/gui/div/GLObjectValuePassConnector.h> 00037 #include "TrackerValueDesc.h" 00038 00039 00040 // =========================================================================== 00041 // class definitions 00042 // =========================================================================== 00046 class GUIParameterTracker : public FXMainWindow { 00047 FXDECLARE(GUIParameterTracker) 00048 public: 00050 enum { 00052 MID_AGGREGATIONINTERVAL = FXMainWindow::ID_LAST, 00054 MID_SAVE, 00056 ID_LAST 00057 }; 00058 00059 00064 GUIParameterTracker(GUIMainWindow& app, const std::string& name) throw(); 00065 00066 00068 ~GUIParameterTracker() throw(); 00069 00070 00072 void create(); 00073 00074 00080 void addTracked(GUIGlObject& o, ValueSource<SUMOReal> *src, 00081 TrackerValueDesc* newTracked) throw(); 00082 00083 00086 00088 long onConfigure(FXObject*,FXSelector,void*); 00089 00091 long onPaint(FXObject*,FXSelector,void*); 00092 00094 long onSimStep(FXObject*,FXSelector,void*); 00095 00097 long onCmdChangeAggregation(FXObject*,FXSelector,void*); 00098 00100 long onCmdSave(FXObject*,FXSelector,void*); 00102 00103 00104 public: 00111 class GUIParameterTrackerPanel : public FXGLCanvas { 00112 FXDECLARE(GUIParameterTrackerPanel) 00113 public: 00119 GUIParameterTrackerPanel(FXComposite* c, GUIMainWindow& app, 00120 GUIParameterTracker& parent) throw(); 00121 00123 ~GUIParameterTrackerPanel() throw(); 00124 00126 friend class GUIParameterTracker; 00127 00128 00131 00133 long onConfigure(FXObject*,FXSelector,void*); 00134 00136 long onPaint(FXObject*,FXSelector,void*); 00137 00139 long onSimStep(FXObject* sender,FXSelector,void*); 00141 00142 00143 private: 00146 void drawValues() throw(); 00147 00152 void drawValue(TrackerValueDesc& desc, SUMOReal namePos) throw(); 00153 00154 00155 private: 00157 GUIParameterTracker* myParent; 00158 00160 int myWidthInPixels, myHeightInPixels; 00161 00163 GUIMainWindow* myApplication; 00164 00165 protected: 00167 GUIParameterTrackerPanel() { } 00168 }; 00169 00170 public: 00172 friend class GUIParameterTrackerPanel; 00173 00174 private: 00176 void buildToolBar() throw(); 00177 00178 00179 protected: 00181 GUIMainWindow* myApplication; 00182 00184 std::vector<TrackerValueDesc*> myTracked; 00185 00187 GUIParameterTrackerPanel* myPanel; 00188 00190 std::vector<GLObjectValuePassConnector<SUMOReal>*> myValuePassers; 00191 00193 FXToolBarShell* myToolBarDrag; 00194 00196 FXComboBox* myAggregationInterval; 00197 00199 FXdouble myAggregationDelay; 00200 00202 FXToolBar* myToolBar; 00203 00204 protected: 00206 GUIParameterTracker() { } 00207 00208 }; 00209 00210 00211 #endif 00212 00213 /****************************************************************************/ 00214