44 MSLane* lane,
double startPos,
double endPos,
double detLength,
45 SUMOTime haltingTimeThreshold,
double haltingSpeedThreshold,
46 double jamDistThreshold,
47 const std::string name,
const std::string& vTypes,
48 const std::string& nextEdges,
49 int detectPersons,
bool showDetector)
50 :
MSE2Collector(id, usage, lane, startPos, endPos, detLength, haltingTimeThreshold,
51 haltingSpeedThreshold, jamDistThreshold, name, vTypes, nextEdges, detectPersons),
55 std::vector<MSLane*> lanes,
double startPos,
double endPos,
56 SUMOTime haltingTimeThreshold,
double haltingSpeedThreshold,
57 double jamDistThreshold,
58 const std::string name,
const std::string& vTypes,
59 const std::string& nextEdges,
60 int detectPersons,
bool showDetector)
61 :
MSE2Collector(id, usage, lanes, startPos, endPos, haltingTimeThreshold,
62 haltingSpeedThreshold, jamDistThreshold, name, vTypes, nextEdges, detectPersons),
82 const std::vector<MSLane*> lanes = detector.
getLanes();
83 for (std::vector<MSLane*>::const_iterator li = lanes.begin(); li != lanes.end(); ++li) {
84 PositionVector shape = (*li)->getShape();
85 double start = (li == lanes.begin() ? lanes.front()->interpolateLanePosToGeometryPos(detector.getStartPos()) : 0);
86 double end = (li + 1 == lanes.end() ? lanes.back()->interpolateLanePosToGeometryPos(detector.getEndPos()) : shape.length());
87 shape = shape.getSubpart(start, end);
88 myFullGeometry.insert(myFullGeometry.end(), shape.begin(), shape.end());
94 for (
int i = 0; i < e; ++i) {
137 ret->
mkItem(
TL(
"vehicles [#]"),
true,
139 ret->
mkItem(
TL(
"occupancy [%]"),
true,
141 ret->
mkItem(
TL(
"mean speed [m/s]"),
true,
143 ret->
mkItem(
TL(
"mean vehicle length [m]"),
true,
145 ret->
mkItem(
TL(
"jam number [#]"),
true,
147 ret->
mkItem(
TL(
"max jam length [veh]"),
true,
149 ret->
mkItem(
TL(
"max jam length [m]"),
true,
151 ret->
mkItem(
TL(
"jam length sum [veh]"),
true,
153 ret->
mkItem(
TL(
"jam length sum [m]"),
true,
155 ret->
mkItem(
TL(
"started halts [#]"),
true,
157 ret->
mkItem(
TL(
"interval seen vehicles [#]"),
true,
159 ret->
mkItem(
TL(
"interval speed [m/s]"),
true,
161 ret->
mkItem(
TL(
"interval occupancy [%]"),
true,
163 ret->
mkItem(
TL(
"interval max jam length [m]"),
true,
165 ret->
mkItem(
TL(
"last interval seen vehicles [#]"),
true,
167 ret->
mkItem(
TL(
"last interval speed [m/s]"),
true,
169 ret->
mkItem(
TL(
"last interval occupancy [%]"),
true,
171 ret->
mkItem(
TL(
"last interval max jam length [m]"),
true,
191 if (exaggeration > 0) {
195 glColor3d(0, (
double) .6, (
double) .8);
197 glColor3d(0, (
double) .8, (
double) .8);
200 dwidth = (double) 0.3;
202 double width = (double) 2.0 * s.
scale;
203 if (width * exaggeration > 1.0) {
207 for (
int i = 0; i < e; ++i) {
225 return myDetector.getOverrideVehNumber() >= 0;
@ GLO_E2DETECTOR
a E2 detector
GUIIcon
An enumeration of icons used by the gui applications.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
static void pushName(unsigned int name)
push Name
static void popMatrix()
pop matrix
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
static void popName()
pop Name
static void pushMatrix()
push matrix
GUIDetectorWrapper(GUIGlObjectType type, const std::string &id, FXIcon *icon)
Constructor.
bool mySupportsOverride
whether this detector supports virtual detector calls
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
Boundary myBoundary
The detector's boundary.
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
void toggleOverride() const override
toggle virtual detector call
bool haveOverride() const override
whether this detector has an active virtual detector call
GUIE2Collector & myDetector
The wrapped detector.
std::vector< double > myShapeLengths
A sequence of lengths in full-geometry mode.
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
MyWrapper(GUIE2Collector &detector)
Constructor.
GUIE2Collector & getDetector()
Returns the detector itself.
PositionVector myFullGeometry
A sequence of positions in full-geometry mode.
std::vector< double > myShapeRotations
A sequence of rotations in full-geometry mode.
bool myShow
Whether the detector shall be drawn in the gui.
virtual GUIDetectorWrapper * buildDetectorGUIRepresentation()
Returns the wrapper for this detector.
GUIE2Collector(const std::string &id, DetectorUsage usage, MSLane *lane, double startPos, double endPos, double detLength, SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, const std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, bool showDetector)
Constructor with given end position and detector length.
~GUIE2Collector()
Destructor.
virtual Position getCenter() const
GUIGlID getGlID() const
Returns the numerical id of the object.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0, bool forceShow=false) const
draw name of item
A window containing a gl-object's parameter.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
Stores the information about how to visualize structures.
GUIVisualizationTextSettings addName
GUIVisualizationSizeSettings addSize
double scale
information about a lane's width (temporary, used for a single view)
std::vector< MSLane * > getLanes()
Returns a vector containing pointers to the lanes covered by the detector ordered from its first to i...
double getCurrentMaxJamLengthInMeters() const
Returns the length in meters of the currently largest jam.
double getIntervalMaxJamLengthInMeters() const
double getLastIntervalOccupancy() const
double getCurrentMeanLength() const
Returns the mean vehicle length of vehicles currently on the detector.
double getIntervalMeanSpeed() const
int getCurrentMaxJamLengthInVehicles() const
Returns the length in vehicles of the currently largest jam.
double getLastIntervalMeanSpeed() const
int getCurrentVehicleNumber() const
Returns the number of vehicles currently on the detector.
int getCurrentJamLengthInVehicles() const
Returns the length of all jams in vehicles.
int getCurrentStartedHalts() const
Returns the length of all jams in meters.
MSE2Collector(const std::string &id, DetectorUsage usage, MSLane *lane, double startPos, double endPos, double length, SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, const std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons)
Constructor with given end position and detector length.
int getIntervalVehicleNumber() const
double getCurrentMeanSpeed() const
Returns the mean vehicle speed of vehicles currently on the detector.
double getCurrentJamLengthInMeters() const
Returns the length of all jams in meters.
double getIntervalOccupancy() const
double getLastIntervalMaxJamLengthInMeters() const
int getCurrentJamNumber() const
Returns the current number of jams.
double getCurrentOccupancy() const
Returns the current detector occupancy.
int getLastIntervalVehicleNumber() const
Representation of a lane in the micro simulation.
const std::string & getID() const
Returns the id.
A point in 2D or 3D with translation and scaling methods.
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimensions
double x() const
Returns the x-position.
double y() const
Returns the y-position.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values