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),
52 myShow(showDetector) {}
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),
63 myShow(showDetector) {}
79 myDetector(detector) {
82 const std::vector<MSLane*> lanes = detector.
getLanes();
83 for (std::vector<MSLane*>::const_iterator li = lanes.begin(); li != lanes.end(); ++li) {
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());
94 for (
int i = 0; i < e; ++i) {
129 ret->
mkItem(
TL(
"name"),
false, myDetector.getName());
130 ret->
mkItem(
TL(
"length [m]"),
false, myDetector.getLength());
131 ret->
mkItem(
TL(
"position [m]"),
false, myDetector.getStartPos());
132 ret->
mkItem(
TL(
"lane"),
false, myDetector.getLane()->getID());
133 if (myDetector.isTyped()) {
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,
183 if (!myDetector.myShow) {
190 const double exaggeration = getExaggeration(s);
191 if (exaggeration > 0) {
192 if (haveOverride()) {
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) {
206 int e = (int) myFullGeometry.size() - 1;
207 for (
int i = 0; i < e; ++i) {
213 drawName(getCenteringBoundary().getCenter(), s.
scale, s.
addName);
231 if (haveOverride()) {
232 myDetector.overrideVehicleNumber(-1);
234 myDetector.overrideVehicleNumber(1);
@ 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.
Boundary & grow(double by)
extends the boundary by the given amount
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
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
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.
The gui-version of the MSE2Collector.
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.
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)
An areal detector corresponding to a sequence of consecutive lanes.
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 getStartPos() const
Returns the begin position of the detector.
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
double getOverrideVehNumber() 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.
double getEndPos() const
Returns the end position of the detector.
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.
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 length() const
Returns the length.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
PositionVector getSubpart(double beginOffset, double endOffset) const
get subpart of a position vector
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values