|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // The gui-version of a MS_E2_ZS_CollectorOverLanes. 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 GUI_E2_ZS_CollectorOverLanes_h 00020 #define GUI_E2_ZS_CollectorOverLanes_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 <microsim/output/MS_E2_ZS_CollectorOverLanes.h> 00033 #include <microsim/MSNet.h> 00034 #include <utils/geom/Position.h> 00035 #include <utils/geom/PositionVector.h> 00036 #include <utils/common/VectorHelper.h> 00037 #include <utils/common/ValueSource.h> 00038 #include "GUI_E2_ZS_Collector.h" 00039 #include "GUIDetectorWrapper.h" 00040 00041 00042 // =========================================================================== 00043 // class declarations 00044 // =========================================================================== 00045 class GUILaneWrapper; 00046 00047 00048 // =========================================================================== 00049 // class definitions 00050 // =========================================================================== 00060 class GUI_E2_ZS_CollectorOverLanes : public MS_E2_ZS_CollectorOverLanes { 00061 public: 00062 typedef std::vector<GUI_E2_ZS_Collector*> CollectorVector; 00063 00065 GUI_E2_ZS_CollectorOverLanes(std::string id, DetectorUsage usage, 00066 MSLane* lane, SUMOReal startPos, 00067 SUMOTime haltingTimeThreshold, 00068 SUMOReal haltingSpeedThreshold, 00069 SUMOReal jamDistThreshold) throw(); 00070 00072 ~GUI_E2_ZS_CollectorOverLanes() throw(); 00073 00074 // invalid in fact, as collectors do not need a lane 00075 virtual GUIDetectorWrapper* buildDetectorGUIRepresentation(); 00076 00077 00078 protected: 00079 MSE2Collector* buildCollector(size_t c, size_t r, 00080 MSLane* l, SUMOReal start, SUMOReal end) throw(); 00081 00082 00083 public: 00088 class MyWrapper : public GUIDetectorWrapper { 00089 public: 00091 MyWrapper(GUI_E2_ZS_CollectorOverLanes& detector, 00092 const LaneDetMap& detectors) throw(); 00093 00095 ~MyWrapper() throw(); 00096 00097 00099 00100 00108 GUIParameterTableWindow* getParameterWindow( 00109 GUIMainWindow& app, GUISUMOAbstractView& parent) throw(); 00110 00111 00117 Boundary getCenteringBoundary() const throw(); 00118 00119 00124 void drawGL(const GUIVisualizationSettings& s) const throw(); 00126 00127 00129 GUI_E2_ZS_CollectorOverLanes& getLoop(); 00130 00131 protected: 00133 /* 00134 void myMkExistingItem(GUIParameterTableWindow &ret, 00135 const std::string &name, E2::DetType type); 00136 */ 00137 00138 private: 00140 GUI_E2_ZS_CollectorOverLanes& myDetector; 00141 00143 Boundary myBoundary; 00144 00145 std::vector<GUIDetectorWrapper*> mySubWrappers; 00146 00152 /* 00153 class MyValueRetriever : public ValueSource<SUMOReal> 00154 { 00155 public: 00157 MyValueRetriever(GUI_E2_ZS_CollectorOverLanes &det, 00158 E2::DetType type, MSUnit::Seconds nSec) 00159 : myDetector(det), myType(type), myNSec(nSec) { } 00160 00162 ~MyValueRetriever() { } 00163 00165 SUMOReal getValue() const { 00166 return myDetector.getAggregate(myType, myNSec); 00167 } 00168 00170 ValueSource<SUMOReal> *copy() const { 00171 return new MyValueRetriever(myDetector, myType, myNSec); 00172 } 00173 00174 private: 00176 GUI_E2_ZS_CollectorOverLanes &myDetector; 00177 00179 E2::DetType myType; 00180 00182 MSUnit::Seconds myNSec; 00183 }; 00184 */ 00185 private: 00187 MyWrapper(const MyWrapper&); 00188 00190 MyWrapper& operator=(const MyWrapper&); 00191 00192 }; 00193 00194 }; 00195 00196 00197 #endif 00198 00199 /****************************************************************************/ 00200