SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // The gui-version of a MS_E2_ZS_CollectorOverLanes. 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 GUI_E2_ZS_CollectorOverLanes_h 00023 #define GUI_E2_ZS_CollectorOverLanes_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 <microsim/output/MS_E2_ZS_CollectorOverLanes.h> 00036 #include <microsim/MSNet.h> 00037 #include <utils/geom/Position.h> 00038 #include <utils/geom/PositionVector.h> 00039 #include <utils/common/VectorHelper.h> 00040 #include <utils/common/ValueSource.h> 00041 #include "GUI_E2_ZS_Collector.h" 00042 #include "GUIDetectorWrapper.h" 00043 00044 00045 // =========================================================================== 00046 // class declarations 00047 // =========================================================================== 00048 class GUILaneWrapper; 00049 00050 00051 // =========================================================================== 00052 // class definitions 00053 // =========================================================================== 00063 class GUI_E2_ZS_CollectorOverLanes : public MS_E2_ZS_CollectorOverLanes { 00064 public: 00065 typedef std::vector<GUI_E2_ZS_Collector*> CollectorVector; 00066 00068 GUI_E2_ZS_CollectorOverLanes(std::string id, DetectorUsage usage, 00069 MSLane* lane, SUMOReal startPos, 00070 SUMOTime haltingTimeThreshold, 00071 SUMOReal haltingSpeedThreshold, 00072 SUMOReal jamDistThreshold) ; 00073 00075 ~GUI_E2_ZS_CollectorOverLanes() ; 00076 00077 // invalid in fact, as collectors do not need a lane 00078 virtual GUIDetectorWrapper* buildDetectorGUIRepresentation(); 00079 00080 00081 protected: 00082 MSE2Collector* buildCollector(size_t c, size_t r, 00083 MSLane* l, SUMOReal start, SUMOReal end) ; 00084 00085 00086 public: 00091 class MyWrapper : public GUIDetectorWrapper { 00092 public: 00094 MyWrapper(GUI_E2_ZS_CollectorOverLanes& detector, 00095 const LaneDetMap& detectors) ; 00096 00098 ~MyWrapper() ; 00099 00100 00102 00103 00111 GUIParameterTableWindow* getParameterWindow( 00112 GUIMainWindow& app, GUISUMOAbstractView& parent) ; 00113 00114 00120 Boundary getCenteringBoundary() const ; 00121 00122 00127 void drawGL(const GUIVisualizationSettings& s) const ; 00129 00130 00132 GUI_E2_ZS_CollectorOverLanes& getLoop(); 00133 00134 protected: 00136 /* 00137 void myMkExistingItem(GUIParameterTableWindow &ret, 00138 const std::string &name, E2::DetType type); 00139 */ 00140 00141 private: 00143 GUI_E2_ZS_CollectorOverLanes& myDetector; 00144 00146 Boundary myBoundary; 00147 00148 std::vector<GUIDetectorWrapper*> mySubWrappers; 00149 00155 /* 00156 class MyValueRetriever : public ValueSource<SUMOReal> 00157 { 00158 public: 00160 MyValueRetriever(GUI_E2_ZS_CollectorOverLanes &det, 00161 E2::DetType type, MSUnit::Seconds nSec) 00162 : myDetector(det), myType(type), myNSec(nSec) { } 00163 00165 ~MyValueRetriever() { } 00166 00168 SUMOReal getValue() const { 00169 return myDetector.getAggregate(myType, myNSec); 00170 } 00171 00173 ValueSource<SUMOReal> *copy() const { 00174 return new MyValueRetriever(myDetector, myType, myNSec); 00175 } 00176 00177 private: 00179 GUI_E2_ZS_CollectorOverLanes &myDetector; 00180 00182 E2::DetType myType; 00183 00185 MSUnit::Seconds myNSec; 00186 }; 00187 */ 00188 private: 00190 MyWrapper(const MyWrapper&); 00191 00193 MyWrapper& operator=(const MyWrapper&); 00194 00195 }; 00196 00197 }; 00198 00199 00200 #endif 00201 00202 /****************************************************************************/ 00203