SUMO - Simulation of Urban MObility
|
Representation of a timeline of floats with their names and moments. More...
#include <TrackerValueDesc.h>
Public Member Functions | |
void | addValue (SUMOReal value) |
Adds a new value to the list. | |
const std::vector< SUMOReal > & | getAggregatedValues () |
returns the vector of aggregated values The values will be locked - no further addition will be perfomed until the method "unlockValues" will be called | |
SUMOTime | getAggregationSpan () const |
get the aggregation amount | |
const RGBColor & | getColor () const |
Returns the color to use to display the value. | |
SUMOReal | getMax () const |
Returns the values maximum. | |
SUMOReal | getMin () const |
Returns the values minimum. | |
const std::string & | getName () const |
Returns the name of the value. | |
SUMOReal | getRange () const |
returns the maximum value range | |
SUMOTime | getRecordingBegin () const |
Returns the timestep the recording started. | |
const std::vector< SUMOReal > & | getValues () |
returns the vector of collected values The values will be locked - no further addition will be perfomed until the method "unlockValues" will be called | |
SUMOReal | getYCenter () const |
Returns the center of the value. | |
void | setAggregationSpan (SUMOTime as) |
set the aggregation amount | |
TrackerValueDesc (const std::string &name, const RGBColor &col, SUMOTime recordBegin) | |
Constructor. | |
void | unlockValues () |
Releases the locking after the values have been drawn. | |
~TrackerValueDesc () | |
Destructor. |
Private Attributes | |
RGBColor | myActiveCol |
The color to use when the value is set as "active". | |
std::vector< SUMOReal > | myAggregatedValues |
Collected values in their aggregated form. | |
int | myAggregationInterval |
The aggregation interval in simulation steps. | |
RGBColor | myInactiveCol |
The color to use when the value is set as "inactive". | |
SUMOReal | myInvalidValue |
Values like this shall not be counted on aggregation. | |
MFXMutex | myLock |
SUMOReal | myMax |
SUMOReal | myMin |
The minimum and the maximum of the value. | |
std::string | myName |
The name of the value. | |
SUMOTime | myRecordingBegin |
The time step the values are added from. | |
SUMOReal | myTmpLastAggValue |
Temporary storage for the last aggregation interval. | |
size_t | myValidNo |
Counter for valid numbers within the current aggregation interval. | |
std::vector< SUMOReal > | myValues |
Values collected. |
Representation of a timeline of floats with their names and moments.
This class contains the information needed to display a time line of float values.
Definition at line 51 of file TrackerValueDesc.h.
TrackerValueDesc::TrackerValueDesc | ( | const std::string & | name, |
const RGBColor & | col, | ||
SUMOTime | recordBegin | ||
) |
Constructor.
Definition at line 46 of file TrackerValueDesc.cpp.
TrackerValueDesc::~TrackerValueDesc | ( | ) |
Destructor.
Definition at line 55 of file TrackerValueDesc.cpp.
References MFXMutex::locked(), myLock, and MFXMutex::unlock().
|
virtual |
Adds a new value to the list.
Implements ValueRetriever< SUMOReal >.
Definition at line 64 of file TrackerValueDesc.cpp.
References MFXMutex::lock(), myAggregatedValues, myAggregationInterval, myInvalidValue, myLock, myMax, myMin, myTmpLastAggValue, myValidNo, myValues, SUMOReal, and MFXMutex::unlock().
const std::vector< SUMOReal > & TrackerValueDesc::getAggregatedValues | ( | ) |
returns the vector of aggregated values The values will be locked - no further addition will be perfomed until the method "unlockValues" will be called
Definition at line 130 of file TrackerValueDesc.cpp.
References MFXMutex::lock(), myAggregatedValues, and myLock.
Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), and GUIParameterTracker::onCmdSave().
SUMOTime TrackerValueDesc::getAggregationSpan | ( | ) | const |
get the aggregation amount
Definition at line 177 of file TrackerValueDesc.cpp.
References DELTA_T, and myAggregationInterval.
Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue().
const RGBColor & TrackerValueDesc::getColor | ( | ) | const |
Returns the color to use to display the value.
Definition at line 117 of file TrackerValueDesc.cpp.
References myActiveCol.
Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue().
SUMOReal TrackerValueDesc::getMax | ( | ) | const |
Returns the values maximum.
Definition at line 105 of file TrackerValueDesc.cpp.
References myMax.
Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue().
SUMOReal TrackerValueDesc::getMin | ( | ) | const |
Returns the values minimum.
Definition at line 99 of file TrackerValueDesc.cpp.
References myMin.
Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue().
const std::string & TrackerValueDesc::getName | ( | ) | const |
Returns the name of the value.
Definition at line 137 of file TrackerValueDesc.cpp.
References myName.
Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), and GUIParameterTracker::onCmdSave().
SUMOReal TrackerValueDesc::getRange | ( | ) | const |
returns the maximum value range
Definition at line 93 of file TrackerValueDesc.cpp.
Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue().
SUMOTime TrackerValueDesc::getRecordingBegin | ( | ) | const |
Returns the timestep the recording started.
Definition at line 183 of file TrackerValueDesc.cpp.
References myRecordingBegin.
Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue().
const std::vector< SUMOReal > & TrackerValueDesc::getValues | ( | ) |
returns the vector of collected values The values will be locked - no further addition will be perfomed until the method "unlockValues" will be called
Definition at line 123 of file TrackerValueDesc.cpp.
References MFXMutex::lock(), myLock, and myValues.
SUMOReal TrackerValueDesc::getYCenter | ( | ) | const |
Returns the center of the value.
Definition at line 111 of file TrackerValueDesc.cpp.
Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue().
void TrackerValueDesc::setAggregationSpan | ( | SUMOTime | as | ) |
set the aggregation amount
Definition at line 148 of file TrackerValueDesc.cpp.
References DELTA_T, MFXMutex::lock(), myAggregatedValues, myAggregationInterval, myInvalidValue, myLock, myTmpLastAggValue, myValidNo, myValues, and MFXMutex::unlock().
void TrackerValueDesc::unlockValues | ( | ) |
Releases the locking after the values have been drawn.
Definition at line 142 of file TrackerValueDesc.cpp.
References myLock, and MFXMutex::unlock().
Referenced by GUIParameterTracker::GUIParameterTrackerPanel::drawValue(), and GUIParameterTracker::onCmdSave().
|
private |
The color to use when the value is set as "active".
Definition at line 109 of file TrackerValueDesc.h.
Referenced by getColor().
|
private |
Collected values in their aggregated form.
Definition at line 118 of file TrackerValueDesc.h.
Referenced by addValue(), getAggregatedValues(), and setAggregationSpan().
|
private |
The aggregation interval in simulation steps.
Definition at line 127 of file TrackerValueDesc.h.
Referenced by addValue(), getAggregationSpan(), and setAggregationSpan().
|
private |
The color to use when the value is set as "inactive".
Definition at line 112 of file TrackerValueDesc.h.
|
private |
Values like this shall not be counted on aggregation.
Definition at line 130 of file TrackerValueDesc.h.
Referenced by addValue(), and setAggregationSpan().
|
private |
Definition at line 124 of file TrackerValueDesc.h.
Referenced by addValue(), getAggregatedValues(), getValues(), setAggregationSpan(), unlockValues(), and ~TrackerValueDesc().
|
private |
Definition at line 121 of file TrackerValueDesc.h.
Referenced by addValue(), getMax(), getRange(), and getYCenter().
|
private |
The minimum and the maximum of the value.
Definition at line 121 of file TrackerValueDesc.h.
Referenced by addValue(), getMin(), getRange(), and getYCenter().
|
private |
|
private |
The time step the values are added from.
Definition at line 136 of file TrackerValueDesc.h.
Referenced by getRecordingBegin().
|
private |
Temporary storage for the last aggregation interval.
Definition at line 139 of file TrackerValueDesc.h.
Referenced by addValue(), and setAggregationSpan().
|
private |
Counter for valid numbers within the current aggregation interval.
Definition at line 133 of file TrackerValueDesc.h.
Referenced by addValue(), and setAggregationSpan().
|
private |
Values collected.
Definition at line 115 of file TrackerValueDesc.h.
Referenced by addValue(), getValues(), and setAggregationSpan().