|
AGX Dynamics 2.42.3.1
|
Class that encapsulates data to be plotted, including methods for accessing the data, either via lambdas, Listeners or Uuid:s found in a simulation. More...
#include <DataSeries.h>
Inheritance diagram for agxPlot::DataSeries:Public Types | |
| enum | Settings { DATASERIES_SETTINGS_NONE = 0 , DATASERIES_SETTINGS_ISTIME = 1 } |
Public Member Functions | |
| DataSeries (agxPlot::DataGenerator *dataGenerator, const agx::String &name) | |
| Create a DataSeries that calls getValue on the given DataGenerator to generate data. | |
| DataSeries (agxPlot::DataListener *listener, const agx::String &name) | |
| Create a DataSeries that calls the getValue operator of the DataListener to generate data. | |
| DataSeries (agxPlot::DataSeries *source) | |
| Create a DataSeries that gets fed by the source specified. | |
| DataSeries (agxPlot::DataSeries *sourceA, agxPlot::DataSeries *sourceB) | |
| Create a DataSeries that gets fed by two sources and adding their data. | |
| DataSeries (const agx::String &dataPath, agxSDK::Simulation *simulation, const agx::String &name) | |
| Create a DataSeries that calls the getValue operator of the DataListener to generate data. | |
| DataSeries (const agx::String &name="") | |
| Create a DataSeries that can only get values by manually pushing them. | |
| DataSeries (const agx::Uuid &entityId, const agx::String &dataPath, agxSDK::Simulation *simulation, const agx::String &name) | |
| Create a DataSeries that takes fields from the object specified by the entity ID. | |
| DataSeries (std::function< double()> lambdaFunction, const agx::String &name) | |
| Create a DataSeries that calls the specified function to generate data. | |
| void | clearData () |
| Remove all values in stored. | |
| void | generateCurrentValue () |
| Fetches the current value from the specified way of generation and append it to the series. | |
| const agx::RealVector & | getAllValues () const |
| Get all values that have been generated so far. | |
| const agx::String & | getDataPath () const |
| void | getDescription (agxJson::Value &root) const |
| Get the description of the following format. | |
| agx::Uuid | getEntityId () const |
| agx::UInt | getID () const |
| bool | getLogarithmic () const |
| const agx::String & | getName () const |
| Get the name of the data series. | |
| size_t | getNewValueMarker () const |
| Get the index of the oldest new value. | |
| const agxUtil::Statistic * | getStatistic () const |
| Return the statistic, if any, through which data from generator is passed before being added to the data series. | |
| const agx::String & | getUnit () const |
| Get the unit of the data series. | |
| bool | hasDataPath () const |
| bool | hasImportedJournalData () const |
| void | importedJournal () |
| bool | isTime () const |
| Time works different, thus the time data series have this flag. | |
| void | push (agx::Real value) |
| Manually add a value at the end of the DataSeries. | |
| void | resetDirty () |
| All current values are now observed and dirty flags can be cleaned up. | |
| void | setFromDescription (const agxJson::Value &root) |
| Set from a description of the format from getDescription. | |
| void | setLogarithmic (bool isLogarithmic) |
| Should the axis be logarithmic if displayed. | |
| void | setName (const agx::String &name) |
| Set the name of the data series. | |
| void | setSettings (agx::UInt16 settings) |
| Set special settings for the data series. | |
| void | setStatistic (agxUtil::Statistic *statistic) |
| Pass data read from the data generator through the given statistic before adding it to the data series. | |
| void | setStatistic (agxUtil::StatisticHandleRef statistic) |
| Pass data read from the data generator through the given statistic before adding it to the data series. | |
| void | setUnit (const agx::String &unit) |
| Set a string representing the unit of the data series. | |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. | |
| Referenced (const Referenced &) | |
| template<typename T > | |
| T * | as () |
| Subclass casting. | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. | |
| template<typename T > | |
| const T * | asSafe () const |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
Public Attributes | |
| agx::Event | representationChanged |
Protected Member Functions | |
| virtual | ~DataSeries () |
| void | init (DataGeneratorRef generator, const agx::String &name) |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Additional Inherited Members | |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Static Protected Member Functions inherited from agx::Referenced | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Class that encapsulates data to be plotted, including methods for accessing the data, either via lambdas, Listeners or Uuid:s found in a simulation.
Definition at line 44 of file DataSeries.h.
| Enumerator | |
|---|---|
| DATASERIES_SETTINGS_NONE | |
| DATASERIES_SETTINGS_ISTIME | |
Definition at line 47 of file DataSeries.h.
| agxPlot::DataSeries::DataSeries | ( | const agx::Uuid & | entityId, |
| const agx::String & | dataPath, | ||
| agxSDK::Simulation * | simulation, | ||
| const agx::String & | name | ||
| ) |
Create a DataSeries that takes fields from the object specified by the entity ID.
A good way to directly access fields in the Journal.
| agxPlot::DataSeries::DataSeries | ( | std::function< double()> | lambdaFunction, |
| const agx::String & | name | ||
| ) |
Create a DataSeries that calls the specified function to generate data.
| agxPlot::DataSeries::DataSeries | ( | agxPlot::DataListener * | listener, |
| const agx::String & | name | ||
| ) |
Create a DataSeries that calls the getValue operator of the DataListener to generate data.
| agxPlot::DataSeries::DataSeries | ( | agxPlot::DataGenerator * | dataGenerator, |
| const agx::String & | name | ||
| ) |
Create a DataSeries that calls getValue on the given DataGenerator to generate data.
| agxPlot::DataSeries::DataSeries | ( | const agx::String & | dataPath, |
| agxSDK::Simulation * | simulation, | ||
| const agx::String & | name | ||
| ) |
Create a DataSeries that calls the getValue operator of the DataListener to generate data.
| agxPlot::DataSeries::DataSeries | ( | agxPlot::DataSeries * | source | ) |
Create a DataSeries that gets fed by the source specified.
A good way to connect simulations.
| agxPlot::DataSeries::DataSeries | ( | agxPlot::DataSeries * | sourceA, |
| agxPlot::DataSeries * | sourceB | ||
| ) |
Create a DataSeries that gets fed by two sources and adding their data.
Used for contacts where we want a statistic on one of them but not the other.
Sets name and unit from sourceA
| agxPlot::DataSeries::DataSeries | ( | const agx::String & | name = "" | ) |
Create a DataSeries that can only get values by manually pushing them.
|
protectedvirtual |
| void agxPlot::DataSeries::clearData | ( | ) |
Remove all values in stored.
| void agxPlot::DataSeries::generateCurrentValue | ( | ) |
Fetches the current value from the specified way of generation and append it to the series.
| const agx::RealVector & agxPlot::DataSeries::getAllValues | ( | ) | const |
Get all values that have been generated so far.
| const agx::String & agxPlot::DataSeries::getDataPath | ( | ) | const |
| void agxPlot::DataSeries::getDescription | ( | agxJson::Value & | root | ) | const |
Get the description of the following format.
["name"] = the name of the data series (axis) ["unit"] = the unit of the data series ["isLogarithmic"] = should the data series be viewed as logarithmic ["isTime"] = the data series represents time ["id"] = the id of the data series
| agx::Uuid agxPlot::DataSeries::getEntityId | ( | ) | const |
| agx::UInt agxPlot::DataSeries::getID | ( | ) | const |
| bool agxPlot::DataSeries::getLogarithmic | ( | ) | const |
| const agx::String & agxPlot::DataSeries::getName | ( | ) | const |
Get the name of the data series.
| size_t agxPlot::DataSeries::getNewValueMarker | ( | ) | const |
Get the index of the oldest new value.
All values after this are 'dirty'.
| const agxUtil::Statistic * agxPlot::DataSeries::getStatistic | ( | ) | const |
Return the statistic, if any, through which data from generator is passed before being added to the data series.
May be nullptr.
| const agx::String & agxPlot::DataSeries::getUnit | ( | ) | const |
Get the unit of the data series.
| bool agxPlot::DataSeries::hasDataPath | ( | ) | const |
| bool agxPlot::DataSeries::hasImportedJournalData | ( | ) | const |
| void agxPlot::DataSeries::importedJournal | ( | ) |
|
protected |
| bool agxPlot::DataSeries::isTime | ( | ) | const |
Time works different, thus the time data series have this flag.
| void agxPlot::DataSeries::push | ( | agx::Real | value | ) |
Manually add a value at the end of the DataSeries.
| value | the new value to append |
| void agxPlot::DataSeries::resetDirty | ( | ) |
All current values are now observed and dirty flags can be cleaned up.
| void agxPlot::DataSeries::setFromDescription | ( | const agxJson::Value & | root | ) |
Set from a description of the format from getDescription.
| void agxPlot::DataSeries::setLogarithmic | ( | bool | isLogarithmic | ) |
Should the axis be logarithmic if displayed.
| void agxPlot::DataSeries::setName | ( | const agx::String & | name | ) |
Set the name of the data series.
| void agxPlot::DataSeries::setSettings | ( | agx::UInt16 | settings | ) |
Set special settings for the data series.
| void agxPlot::DataSeries::setStatistic | ( | agxUtil::Statistic * | statistic | ) |
Pass data read from the data generator through the given statistic before adding it to the data series.
This DataSeries will take ownership of the given statistic object and will call delete on it when destroyed.
| void agxPlot::DataSeries::setStatistic | ( | agxUtil::StatisticHandleRef | statistic | ) |
Pass data read from the data generator through the given statistic before adding it to the data series.
This DataSeries will take ownership of the statitic in the given statistic handle and will call delete on it when destroyed. The given statistic handle will be empty and cannot be reused when setStatistic returns.
| void agxPlot::DataSeries::setUnit | ( | const agx::String & | unit | ) |
Set a string representing the unit of the data series.
| agx::Event agxPlot::DataSeries::representationChanged |
Definition at line 214 of file DataSeries.h.