|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // The window that holds the table of an object's parameter 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 GUIParameterTableWindow_h 00020 #define GUIParameterTableWindow_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 <string> 00034 #include <fx.h> 00035 #include <utils/foxtools/MFXMutex.h> 00036 #include <utils/common/ValueSource.h> 00037 #include <utils/common/SUMOTime.h> 00038 00039 00040 // =========================================================================== 00041 // class declarations 00042 // =========================================================================== 00043 class GUIGlObject; 00044 class GUIMainWindow; 00045 class GUIParameterTableItemInterface; 00046 00047 00048 // =========================================================================== 00049 // class definitions 00050 // =========================================================================== 00064 class GUIParameterTableWindow : public FXMainWindow { 00065 FXDECLARE(GUIParameterTableWindow) 00066 public: 00073 GUIParameterTableWindow(GUIMainWindow& app, 00074 GUIGlObject& o, size_t noRows) throw(); 00075 00076 00078 ~GUIParameterTableWindow() throw(); 00079 00080 00089 void closeBuilding() throw(); 00090 00091 00092 00096 void removeObject(GUIGlObject* const o) throw(); 00097 00098 00099 00102 00109 void mkItem(const char* name, bool dynamic, ValueSource<unsigned> *src) throw(); 00110 00111 00118 void mkItem(const char* name, bool dynamic, ValueSource<SUMOReal> *src) throw(); 00119 00120 00121 #ifndef HAVE_SUBSECOND_TIMESTEPS 00122 00128 void mkItem(const char* name, bool dynamic, ValueSource<SUMOTime> *src) throw(); 00129 #endif 00130 00138 void mkItem(const char* name, bool dynamic, std::string value) throw(); 00139 00140 00148 void mkItem(const char* name, bool dynamic, unsigned value) throw(); 00149 00150 00158 void mkItem(const char* name, bool dynamic, SUMOReal value) throw(); 00159 00160 00161 #ifndef HAVE_SUBSECOND_TIMESTEPS 00162 00169 void mkItem(const char* name, bool dynamic, SUMOTime value) throw(); 00170 #endif 00171 00172 00173 00174 00177 00179 long onSimStep(FXObject*,FXSelector,void*); 00180 00184 long onTableSelected(FXObject*,FXSelector,void*); 00185 00189 long onTableDeselected(FXObject*,FXSelector,void*); 00190 00200 long onRightButtonPress(FXObject*,FXSelector,void*); 00202 00203 00204 protected: 00211 void updateTable() throw(); 00212 00213 00214 private: 00216 GUIGlObject* myObject; 00217 00219 FXTable* myTable; 00220 00222 GUIMainWindow* myApplication; 00223 00225 std::vector<GUIParameterTableItemInterface*> myItems; 00226 00228 unsigned myCurrentPos; 00229 00231 mutable MFXMutex myLock; 00232 00233 protected: 00235 GUIParameterTableWindow() { } 00236 00237 }; 00238 00239 00240 #endif 00241 00242 /****************************************************************************/ 00243