SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // A window which displays the time line of one (or more) value(s) 00010 /****************************************************************************/ 00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00013 /****************************************************************************/ 00014 // 00015 // This file is part of SUMO. 00016 // SUMO is free software: you can redistribute it and/or modify 00017 // it under the terms of the GNU General Public License as published by 00018 // the Free Software Foundation, either version 3 of the License, or 00019 // (at your option) any later version. 00020 // 00021 /****************************************************************************/ 00022 #ifndef GUIParameterTracker_h 00023 #define GUIParameterTracker_h 00024 00025 00026 // =========================================================================== 00027 // included modules 00028 // =========================================================================== 00029 #ifdef _MSC_VER 00030 #include <windows_config.h> 00031 #else 00032 #include <config.h> 00033 #endif 00034 00035 #include <vector> 00036 #include <fx.h> 00037 #include <fx3d.h> 00038 #include <utils/gui/globjects/GUIGlObject.h> 00039 #include <utils/gui/div/GLObjectValuePassConnector.h> 00040 #include "TrackerValueDesc.h" 00041 00042 00043 // =========================================================================== 00044 // class definitions 00045 // =========================================================================== 00049 class GUIParameterTracker : public FXMainWindow { 00050 FXDECLARE(GUIParameterTracker) 00051 public: 00053 enum { 00055 MID_AGGREGATIONINTERVAL = FXMainWindow::ID_LAST, 00057 MID_SAVE, 00059 ID_LAST 00060 }; 00061 00062 00067 GUIParameterTracker(GUIMainWindow& app, const std::string& name) ; 00068 00069 00071 ~GUIParameterTracker() ; 00072 00073 00075 void create(); 00076 00077 00083 void addTracked(GUIGlObject& o, ValueSource<SUMOReal> *src, 00084 TrackerValueDesc* newTracked) ; 00085 00086 00089 00091 long onConfigure(FXObject*, FXSelector, void*); 00092 00094 long onPaint(FXObject*, FXSelector, void*); 00095 00097 long onSimStep(FXObject*, FXSelector, void*); 00098 00100 long onCmdChangeAggregation(FXObject*, FXSelector, void*); 00101 00103 long onCmdSave(FXObject*, FXSelector, void*); 00105 00106 00107 public: 00114 class GUIParameterTrackerPanel : public FXGLCanvas { 00115 FXDECLARE(GUIParameterTrackerPanel) 00116 public: 00122 GUIParameterTrackerPanel(FXComposite* c, GUIMainWindow& app, 00123 GUIParameterTracker& parent) ; 00124 00126 ~GUIParameterTrackerPanel() ; 00127 00129 friend class GUIParameterTracker; 00130 00131 00134 00136 long onConfigure(FXObject*, FXSelector, void*); 00137 00139 long onPaint(FXObject*, FXSelector, void*); 00140 00142 long onSimStep(FXObject* sender, FXSelector, void*); 00144 00145 00146 private: 00149 void drawValues() ; 00150 00155 void drawValue(TrackerValueDesc& desc, SUMOReal namePos) ; 00156 00157 00158 private: 00160 GUIParameterTracker* myParent; 00161 00163 int myWidthInPixels, myHeightInPixels; 00164 00166 GUIMainWindow* myApplication; 00167 00168 protected: 00170 GUIParameterTrackerPanel() { } 00171 }; 00172 00173 public: 00175 friend class GUIParameterTrackerPanel; 00176 00177 private: 00179 void buildToolBar() ; 00180 00181 00182 protected: 00184 GUIMainWindow* myApplication; 00185 00187 std::vector<TrackerValueDesc*> myTracked; 00188 00190 GUIParameterTrackerPanel* myPanel; 00191 00193 std::vector<GLObjectValuePassConnector<SUMOReal>*> myValuePassers; 00194 00196 FXToolBarShell* myToolBarDrag; 00197 00199 FXComboBox* myAggregationInterval; 00200 00202 FXdouble myAggregationDelay; 00203 00205 FXToolBar* myToolBar; 00206 00207 protected: 00209 GUIParameterTracker() { } 00210 00211 }; 00212 00213 00214 #endif 00215 00216 /****************************************************************************/ 00217