AnimatLab
2
Test
|
Data chart base class. More...
#include <DataChart.h>
Public Member Functions | |
DataChart () | |
Default constructor. More... | |
virtual | ~DataChart () |
Destructor. More... | |
virtual void | Activate () |
Activates this item. More... | |
virtual void | AddColumn (DataColumn *lpColumn) |
Adds a column. More... | |
virtual void | AddColumn (std::string strXml, bool bDoNotInit) |
Creates and adds a DataColumn from XML. More... | |
virtual void | AddData (int iColumn, int iRow, float fltVal) |
Adds a data element to the data buffer. More... | |
virtual bool | AddItem (const std::string &strItemType, const std::string &strXml, bool bThrowError=true, bool bDoNotInit=false) |
Adds a new object to this parent. More... | |
virtual long | BufferByteSize () |
Gets the buffer byte size. More... | |
virtual long | BufferSize () |
Gets the buffer size. More... | |
virtual float | ChartTimeBase () |
Gets the Time base used by this data chart. More... | |
virtual int | CollectInterval () |
Gets the collect interval. More... | |
virtual void | CollectInterval (int iVal, bool bReInit=true) |
Sets the Collect interval using the time slice. More... | |
virtual void | CollectInterval (float fltVal, bool bReInit=true) |
Sets the Collect interval using the time. More... | |
virtual long | CollectTimeWindow () |
Gets the collect time window time slices. More... | |
virtual void | CollectTimeWindow (long lVal, bool bReInit=true) |
Sets the Collect time window using time slices. More... | |
virtual void | CollectTimeWindow (float fltVal, bool bReInit=true) |
Sets the collect time window in time value. More... | |
virtual long | ColumnCount () |
Gets the column count. More... | |
virtual long | CurrentRow () |
Gets the current row. More... | |
virtual void | CurrentRow (long iVal) |
Sets the Current row. More... | |
virtual float * | DataBuffer () |
Gets the data buffer. More... | |
virtual void | Deactivate () |
Deactivates this item. More... | |
virtual void | EndTime (float fltVal, bool bReInit=true) |
virtual DataColumn * | FindColumn (std::string strID, bool bThrowError=true) |
Searches for a column that matches the specified ID. More... | |
virtual void | Initialize () |
Initializes this object. More... | |
virtual void | Load (std::string strProjectPath, std::string strConfigFile) |
Loads a data chart from a file. More... | |
virtual void | Load (CStdXml &oXml) |
virtual bool | Lock () |
Locks this data chart buffer from being written by any other process. More... | |
virtual bool | operator< (ActivatedItem *lpItem) |
Compares the Start slice time of two data charts to tell if one is less than the other. More... | |
virtual std::string | ProjectPath () |
Gets the project path. More... | |
virtual void | ProjectPath (std::string strVal) |
Sets the Project path. More... | |
virtual void | QueryProperties (CStdPtrArray< TypeProperty > &aryProperties) |
Queries this object for a list of properties that can be changed using SetData. More... | |
virtual void | ReInitialize () |
Re-initialize this object. More... | |
virtual void | RemoveColumn (std::string strID, bool bThrowError=true) |
Removes the column with the specified ID. More... | |
virtual bool | RemoveItem (const std::string &strItemType, const std::string &strID, bool bThrowError=true) |
Removes a child item from this parent. More... | |
virtual void | ResetSimulation () |
Resets the simulation back to time 0. More... | |
virtual long | RowCount () |
Gets the row count. More... | |
virtual void | SetData (int iColumn, int iRow, float fltVal) |
Sets a data element to the data buffer. More... | |
virtual bool | SetData (const std::string &strDataType, const std::string &strValue, bool bThrowError=true) |
Set a variable based on a string data type name. More... | |
virtual bool | SetStartEndTime () |
Gets whether a start/end time is set for this chart. More... | |
virtual void | SetStartEndTime (bool bVal) |
Sets whether a start/end time is specified for this chart. More... | |
virtual void | StartTime (float fltVal, bool bReInit=true) |
virtual void | StepSimulation () |
Step the simulation for this object. More... | |
virtual float * | TimeBuffer () |
Gets the time buffer. More... | |
virtual std::string | Type () |
returns the string type name of this object. More... | |
virtual void | Unlock () |
Unlocks this data chart buffer from being written by any other process. More... | |
virtual long | UsedBufferByteSize () |
Gets the used buffer byte size. More... | |
virtual long | UsedBufferSize () |
Gets the size of buffer that is currently used. More... | |
Public Member Functions inherited from AnimatSim::ActivatedItem | |
ActivatedItem () | |
Default constructor. More... | |
virtual | ~ActivatedItem () |
Destructor. More... | |
virtual bool | AlwaysActive () |
Gets whether this item is always active. More... | |
virtual void | AlwaysActive (bool bVal) |
Sets whether this item is always active. More... | |
virtual bool | Enabled () |
Gets whether the item is enabled or not. More... | |
virtual void | Enabled (bool bVal) |
Enables the item. More... | |
virtual long | EndSlice () |
Gets the end time slice for deactivation. More... | |
virtual void | EndSlice (long lVal, bool bReInit=true) |
virtual float | EndTime () |
Gets the end simulation time for deactivation. More... | |
bool | IsActivated () |
Query if this object is activated. More... | |
bool | IsInitialized () |
Query if this object is initialized. More... | |
virtual bool | LoadedTime () |
Gets whether time was loaded or time slices. More... | |
virtual void | LoadedTime (bool bVal) |
Sets whether time was loaded. More... | |
bool | NeedToActivate () |
Determines if this item needs to be activated. More... | |
bool | NeedToDeactivate () |
Determines if this item needs to be deactivated. More... | |
virtual bool | NeedToStep () |
Tells if this item needs to call StepSimulation or not. More... | |
virtual bool | Overlaps (ActivatedItem *lpItem) |
Query if this object overlaps the time period for another ActivatedItem. More... | |
virtual long | StartSlice () |
Returns the starts slice for activation. More... | |
virtual void | StartSlice (long lVal, bool bReInit=true) |
virtual float | StartTime () |
Gets the simulation start time for activation. More... | |
virtual int | StepInterval () |
Gets the step interval. More... | |
virtual void | StepInterval (int iVal) |
Sets the step interval. More... | |
virtual int | StepIntervalCount () |
Gets the step interval count. More... | |
virtual void | StepIntervalCount (int iVal) |
Step interval count. More... | |
virtual void | TimeStepModified () |
Notification method that the time step modified has been modified. Objects should recalculate any slice times as needed. More... | |
Public Member Functions inherited from AnimatSim::AnimatBase | |
AnimatBase () | |
Constructs an AnimatBase object. More... | |
virtual | ~AnimatBase () |
Destroys the AnimatBase object.. More... | |
virtual void | AfterResetSimulation () |
Called after a simulation reset for some objects. More... | |
virtual long | CalculateSnapshotByteSize () |
Calculates the snapshot byte size. More... | |
virtual void | Copy (CStdSerialize *lpSource) |
virtual float * | GetDataPointer (const std::string &strDataType) |
Returns a float pointer to a data item of interest in this object. More... | |
virtual NeuralModule * | GetNeuralModule () |
Gets the neural module. More... | |
virtual Node * | GetNode () |
Gets the node. More... | |
virtual Simulator * | GetSimulator () |
Gets the simulator pointer. More... | |
virtual Structure * | GetStructure () |
Gets the structure for this node. More... | |
virtual bool | HasProperty (const std::string &strName) |
Queries this object if it has a property with the given name. More... | |
virtual std::string | ID () |
Gets the unique GUID ID of this object. More... | |
virtual void | ID (std::string strValue) |
Sets the unique GUID ID of the object. More... | |
virtual void | Kill (bool bState=true) |
Kills. More... | |
virtual void | Load (StdUtils::CStdXml &oXml) |
Loads the item using an XML data packet. More... | |
virtual void | LoadKeyFrameSnapshot (byte *aryBytes, long &lIndex) |
Loads a key frame snapshot. More... | |
virtual std::string | Name () |
Gets the name of this object. More... | |
virtual void | Name (std::string strValue) |
Sets the name of the object. Blank is acceptable. More... | |
virtual AnimatPropertyType | PropertyType (const std::string &strName) |
virtual void | Reset () |
Resets this object. More... | |
virtual void | RigidBodyAdded (std::string strID) |
virtual void | RigidBodyRemoved (std::string strID) |
virtual void | SaveKeyFrameSnapshot (byte *aryBytes, long &lIndex) |
Saves a key frame snapshot. More... | |
virtual bool | Selected () |
Tells if this items is selected or not. More... | |
virtual void | Selected (bool bValue, bool bSelectMultiple) |
Selects this object. More... | |
virtual bool | SetData (const std::string &strDataType, const float fltValue, bool bThrowError=true) |
Set a variable based on a string data type name. More... | |
virtual bool | SetData (const std::string &strDataType, const long lValue, bool bThrowError=true) |
Set a variable based on a string data type name. More... | |
virtual void | SetSystemPointers (Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify) |
Sets the system pointers. More... | |
virtual void | SimPausing () |
Called just before the simulation pauses. More... | |
virtual void | SimStarting () |
Called just before the simulation starts. More... | |
virtual void | SimStopping () |
Called just before the simulation stops. More... | |
virtual void | Type (std::string strValue) |
Sets the class type for this object. More... | |
virtual void | VerifySystemPointers () |
Verify that system pointers have been set correctly. More... | |
virtual void | VisualSelectionModeChanged (int iNewMode) |
Visual selection mode changed. More... | |
Static Public Member Functions | |
static DataChart * | CastToDerived (AnimatBase *lpBase) |
Static Public Member Functions inherited from AnimatSim::ActivatedItem | |
static ActivatedItem * | CastToDerived (AnimatBase *lpBase) |
Protected Member Functions | |
virtual long | CalculateChartColumnCount () |
Calculates the chart column count. More... | |
virtual DataColumn * | FindColumn (std::string strID, int &iIndex, bool bThrowError) |
Searches for a column that matches the specified ID. More... | |
DataColumn * | LoadDataColumn (CStdXml &oXml) |
Loads a data column. More... | |
Protected Member Functions inherited from AnimatSim::ActivatedItem | |
virtual void | SetSliceData () |
Protected Attributes | |
CStdMap< std::string, DataColumn * > | m_aryColumnsMap |
The array of datacolumns columns. This is a sorted map that is used to get columns based on their ID. | |
float * | m_aryDataBuffer |
Buffer for data variable points. | |
CStdPtrArray< DataColumn > | m_aryDataColumns |
The primary array of data columns. This array deletes the columns when destructed. | |
float * | m_aryTimeBuffer |
Buffer for time data points. | |
bool | m_bSetStartEndTime |
true to set the start and end time. If false then the chart collects continuously. | |
float | m_fltCollectInterval |
Tells what the time slice step interval to use when collecting data. This is. | |
float | m_fltCollectTimeWindow |
The time duration where we will collect data. | |
short | m_iCollectInterval |
Tells what the time slice step interval to use when collecting data. This is. | |
long | m_lCollectTimeWindow |
The number of time slices where we will collect data. | |
long | m_lColumnCount |
Number of data columns. | |
int | m_lCurrentCol |
The currently selected column. | |
int | m_lCurrentRow |
The currently selected row. | |
long | m_lRowCount |
Number of rows in the buffer. | |
std::string | m_strConfigFilename |
Filename of the configuration file. | |
std::string | m_strProjectPath |
Full pathname of the project file. | |
Protected Attributes inherited from AnimatSim::ActivatedItem | |
bool | m_bAlwaysActive |
Determines whether this item is always active during simulation. | |
bool | m_bInitialized |
true if item has been initialized | |
bool | m_bIsActivated |
true if item has been activated | |
bool | m_bLoadedTime |
float | m_fltEndTime |
float | m_fltStartTime |
int | m_iStepInterval |
int | m_iStepIntervalCount |
Keeps track of how many time steps have occured since it was zeroed again. | |
long | m_lEndSlice |
The time slice where this item is deactived. | |
long | m_lStartSlice |
The time slice where this item becomes active. | |
Protected Attributes inherited from AnimatSim::AnimatBase | |
bool | m_bEnabled |
Tells if this item is enabled or not. If it is not enabled then it is not run. | |
bool | m_bSelected |
Tells whether the object is selected or not. | |
AnimatSim::Behavior::NeuralModule * | m_lpModule |
The pointer to this items parentNeuralModule. If this is not relevant for this object then this is NULL. | |
Node * | m_lpNode |
The pointer to this items parent Node. If this is not relevant for this object then this is NULL. | |
Simulator * | m_lpSim |
The pointer to a Simulation. | |
AnimatSim::Environment::Structure * | m_lpStructure |
The pointer to this items parent Structure. If this is not relevant for this object then this is NULL. | |
std::string | m_strID |
The unique Id for this object. | |
std::string | m_strName |
The name for this object. | |
std::string | m_strType |
The type for this object. Examples are Box, Plane, Neuron, etc.. | |
Data chart base class.
This is the base class for all charting activity. It is derived from an ActivatedItem, so it has a start/end time where it is activated and then deactivated. The user specifies a series of DataColumn objects for the chart. Each DataColumn is responsible for collecting data for a single variable from somewhere in the system. You can control how often the data is collected. The data is stored in memory buffers. There are several derived types of Data charts. The FileChart saves the stored data points into a file upon deactivation, while the MemoryChart stores the data in-memory in a continuing basis.
Definition at line 31 of file DataChart.h.
AnimatSim::Charting::DataChart::DataChart | ( | ) |
Default constructor.
Definition at line 54 of file DataChart.cpp.
References m_aryDataBuffer, m_aryTimeBuffer, m_fltCollectInterval, m_fltCollectTimeWindow, m_iCollectInterval, m_lCollectTimeWindow, m_lColumnCount, m_lCurrentCol, m_lCurrentRow, and m_lRowCount.
|
virtual |
Destructor.
Definition at line 74 of file DataChart.cpp.
References m_aryDataBuffer, m_aryDataColumns, m_aryTimeBuffer, and StdUtils::Std_TraceMsg().
|
virtual |
Activates this item.
Reimplemented from AnimatSim::ActivatedItem.
Definition at line 685 of file DataChart.cpp.
References AnimatSim::ActivatedItem::Activate(), and m_aryDataColumns.
|
virtual |
Adds a column.
[in,out] | lpColumn | Pointer to a DataColumn to add to the chart. |
Definition at line 594 of file DataChart.cpp.
References AnimatSim::AnimatBase::ID(), m_aryColumnsMap, m_aryDataColumns, StdUtils::CStdErrorInfo::m_lError, StdUtils::CStdErrorInfo::m_strError, and StdUtils::Std_CheckString().
Referenced by AnimatSim::Charting::DataChartMgr::AddDataColumn(), AddItem(), and LoadDataColumn().
|
virtual |
Creates and adds a DataColumn from XML.
This method is primarily used by the GUI to create a new data column when an xml packet is provided.
strXml | The xml packet to load for the data column. |
Definition at line 575 of file DataChart.cpp.
References StdUtils::CStdXml::Deserialize(), StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), LoadDataColumn(), and ReInitialize().
|
virtual |
Adds a data element to the data buffer.
iColumn | The column in the data buffer where we need to add the value. |
iRow | The row in the data buffer where we need to add the value. |
fltVal | The new value to add. |
Definition at line 826 of file DataChart.cpp.
References m_lCurrentCol, and SetData().
Referenced by AnimatSim::Charting::DataColumn::StepSimulation().
|
virtual |
Adds a new object to this parent.
Generic method to add a new child item to this parent by specifying a string item type descriptor and an xml packet that can be used to load in the new object. The GUI uses this method to create new items that were added with the user interface. The item type lets the method determine what type of item is being created, like synapse, neuron, body part, etc.. It then gets the modulename, classname, and type from the xml and calls CreateObject to create the appropriate type of object. Then it passes in the xml packet to the new objects load method and does any needed initialization and adds it to the parent.
strItemType | String descriptor of the type of item that is being created. |
strXml | XML packet that is used to create and load the new item. |
bThrowError | If true then throw an error if there is a problem, otherwise return false. |
Reimplemented from AnimatSim::AnimatBase.
Definition at line 760 of file DataChart.cpp.
References AddColumn(), and StdUtils::Std_CheckString().
|
virtual |
Gets the buffer byte size.
Definition at line 181 of file DataChart.cpp.
References BufferSize().
|
virtual |
Gets the buffer size.
Definition at line 161 of file DataChart.cpp.
References m_lColumnCount, and m_lRowCount.
Referenced by BufferByteSize().
|
protectedvirtual |
Calculates the chart column count.
Some data columns can have more than on column in the data buffer. We call the ColumnCount property of each column to find the total number for the chart.
Definition at line 555 of file DataChart.cpp.
References ColumnCount(), and m_aryDataColumns.
Referenced by Initialize(), and ReInitialize().
|
virtual |
Gets the Time base used by this data chart.
Definition at line 279 of file DataChart.cpp.
References m_iCollectInterval, and AnimatSim::AnimatBase::m_lpSim.
|
virtual |
Gets the collect interval.
The collect data interval tells how many time slices should occur in-between collecting data.
Definition at line 224 of file DataChart.cpp.
References m_iCollectInterval.
Referenced by ReInitialize(), and SetData().
|
virtual |
Sets the Collect interval using the time slice.
iVal | The new interval. |
Definition at line 234 of file DataChart.cpp.
References m_fltCollectInterval, m_iCollectInterval, AnimatSim::AnimatBase::m_lpSim, ReInitialize(), and AnimatSim::Simulator::TimeStep().
|
virtual |
Sets the Collect interval using the time.
This lets the user specify the collect interval using a time value. It then calculates the number of time slices for the collect interval.
fltVal | The new time value. |
Definition at line 254 of file DataChart.cpp.
References m_fltCollectInterval, m_iCollectInterval, AnimatSim::AnimatBase::m_lpSim, ReInitialize(), StdUtils::Std_IsAboveMin(), and AnimatSim::Simulator::TimeStep().
|
virtual |
Gets the collect time window time slices.
Definition at line 299 of file DataChart.cpp.
References m_lCollectTimeWindow.
Referenced by SetData().
|
virtual |
Sets the Collect time window using time slices.
lVal | The new value in time slices. |
Definition at line 309 of file DataChart.cpp.
References m_lCollectTimeWindow, and ReInitialize().
|
virtual |
Sets the collect time window in time value.
fltVal | The new time value. |
Definition at line 325 of file DataChart.cpp.
References m_fltCollectTimeWindow, m_lCollectTimeWindow, AnimatSim::ActivatedItem::m_lEndSlice, AnimatSim::AnimatBase::m_lpSim, AnimatSim::ActivatedItem::m_lStartSlice, ReInitialize(), and AnimatSim::Simulator::TimeStep().
|
virtual |
Gets the column count.
Definition at line 366 of file DataChart.cpp.
References m_lColumnCount.
Referenced by CalculateChartColumnCount().
|
virtual |
Gets the current row.
Definition at line 386 of file DataChart.cpp.
References m_lCurrentRow.
|
virtual |
Sets the Current row.
iVal | The new current row value. |
Reimplemented in AnimatSim::Charting::ArrayChart.
Definition at line 396 of file DataChart.cpp.
References m_lCurrentRow.
|
virtual |
Gets the data buffer.
Definition at line 211 of file DataChart.cpp.
References m_aryDataBuffer.
|
virtual |
Deactivates this item.
Reimplemented from AnimatSim::ActivatedItem.
Reimplemented in AnimatSim::Charting::FileChart.
Definition at line 694 of file DataChart.cpp.
References AnimatSim::ActivatedItem::Deactivate(), and m_aryDataColumns.
Referenced by AnimatSim::Charting::FileChart::Deactivate().
|
protectedvirtual |
Searches for a column that matches the specified ID.
strID | GUID ID of the column to find. | |
[in,out] | iIndex | Zero-based index of the found column in the array. |
bThrowError | If true and the ID is not found then it throws an error, otherwise it does nothing. |
Definition at line 666 of file DataChart.cpp.
References AnimatSim::AnimatBase::ID(), m_aryDataColumns, and StdUtils::Std_CheckString().
Referenced by AnimatSim::Charting::DataChartMgr::FindDataColumn(), and RemoveColumn().
|
virtual |
Searches for a column that matches the specified ID.
strID | GUID ID of the column to find. |
bThrowError | If true and the ID is not found then it throws an error, otherwise it does nothing. |
Definition at line 640 of file DataChart.cpp.
References m_aryColumnsMap, and StdUtils::Std_CheckString().
|
virtual |
Initializes this object.
After an object is loaded in it must be initialized before it can be used. This allows the object to retrieve any pointers or setup memory that it will need during execution. Each object is responsible for initializing any of its child objects, so you simply need to call this method on the containing class to init all child objects. It also calls VerifySystemPointers to make sure that the system pointers have been setup correctly.
Reimplemented from AnimatSim::ActivatedItem.
Reimplemented in AnimatSim::Charting::FileChart, AnimatSim::Charting::MemoryChart, and AnimatSim::Charting::ArrayChart.
Definition at line 422 of file DataChart.cpp.
References CalculateChartColumnCount(), AnimatSim::ActivatedItem::Initialize(), AnimatSim::Charting::LessThanDataColumnCompare(), m_aryDataBuffer, m_aryDataColumns, m_aryTimeBuffer, m_fltCollectTimeWindow, m_iCollectInterval, m_lCollectTimeWindow, m_lColumnCount, AnimatSim::ActivatedItem::m_lEndSlice, AnimatSim::AnimatBase::m_lpSim, m_lRowCount, AnimatSim::ActivatedItem::m_lStartSlice, and AnimatSim::Simulator::TimeStep().
Referenced by AnimatSim::Charting::MemoryChart::Initialize(), AnimatSim::Charting::FileChart::Initialize(), and ReInitialize().
|
virtual |
Loads a data chart from a file.
strProjectPath | Full pathname of the string project file. |
strConfigFile | The string configuration file. |
Definition at line 867 of file DataChart.cpp.
References StdUtils::CStdXml::FindChildElement(), StdUtils::CStdXml::FindElement(), StdUtils::CStdXml::Load(), m_strConfigFilename, m_strProjectPath, and StdUtils::Std_IsBlank().
Referenced by AnimatSim::Charting::DataChartMgr::LoadDataChart().
|
protected |
Loads a data column.
[in,out] | oXml | The xml to use when loading the data column. |
Throws | an exception if there is an error creating or loading the DataColumn. |
Definition at line 941 of file DataChart.cpp.
References AddColumn(), AnimatSim::Simulator::CreateObject(), StdUtils::CStdXml::GetChildString(), StdUtils::CStdXml::IntoElem(), AnimatSim::AnimatBase::m_lpSim, StdUtils::CStdXml::OutOfElem(), and AnimatSim::Charting::DataColumn::SetSystemPointers().
Referenced by AddColumn().
|
virtual |
Locks this data chart buffer from being written by any other process.
This is for multi-threaded environments. It is called just before data is added to the buffer to prevent any other process from modifying the buffer while we are doing so.
Reimplemented in AnimatSim::Charting::MemoryChart.
Definition at line 409 of file DataChart.cpp.
|
virtual |
Compares the Start slice time of two data charts to tell if one is less than the other.
This is used within an operation that sorts the data charts.
Implements AnimatSim::ActivatedItem.
Definition at line 94 of file DataChart.cpp.
References AnimatSim::ActivatedItem::m_lEndSlice, and AnimatSim::ActivatedItem::m_lStartSlice.
|
virtual |
Gets the project path.
Definition at line 346 of file DataChart.cpp.
References m_strProjectPath.
Referenced by AnimatSim::Charting::DataChartMgr::LoadDataChart().
|
virtual |
Sets the Project path.
strVal | The new value. |
Definition at line 356 of file DataChart.cpp.
References m_strProjectPath.
|
virtual |
Queries this object for a list of properties that can be changed using SetData.
The method provides a list of the properties that can be set using the SetData method. It gives the property name and the type of data that should be passed to it. Valid date types are Boolean, Float, Integer, and Xml.
aryNames | Array list of the property names. |
strTypes | Array list of the type that is associated with the cooresponding name in the list. |
Reimplemented from AnimatSim::AnimatBase.
Definition at line 749 of file DataChart.cpp.
References AnimatSim::AnimatBase::QueryProperties().
|
virtual |
Re-initialize this object.
Some objects like data charts need to be re-initialized some times. An example of when that would be needed is when the simulation is re-started.
Reimplemented from AnimatSim::ActivatedItem.
Reimplemented in AnimatSim::Charting::ArrayChart.
Definition at line 463 of file DataChart.cpp.
References CalculateChartColumnCount(), CollectInterval(), AnimatSim::ActivatedItem::EndTime(), Initialize(), AnimatSim::Charting::LessThanDataColumnCompare(), m_aryDataBuffer, m_aryDataColumns, m_aryTimeBuffer, AnimatSim::ActivatedItem::m_bInitialized, m_fltCollectInterval, m_fltCollectTimeWindow, AnimatSim::ActivatedItem::m_fltEndTime, AnimatSim::ActivatedItem::m_fltStartTime, m_iCollectInterval, m_lCollectTimeWindow, m_lColumnCount, m_lCurrentRow, AnimatSim::ActivatedItem::m_lEndSlice, AnimatSim::AnimatBase::m_lpSim, m_lRowCount, AnimatSim::ActivatedItem::m_lStartSlice, AnimatSim::ActivatedItem::StartTime(), and AnimatSim::Simulator::TimeStep().
Referenced by AddColumn(), CollectInterval(), CollectTimeWindow(), ResetSimulation(), and SetStartEndTime().
|
virtual |
Removes the column with the specified ID.
strID | GUID ID of the DataColumn to remove. |
bThrowError | If true and the ID is not found then it throws an error, otherwise it does nothing. |
Definition at line 619 of file DataChart.cpp.
References FindColumn(), m_aryColumnsMap, m_aryDataColumns, and StdUtils::Std_CheckString().
Referenced by AnimatSim::Charting::DataChartMgr::RemoveDataColumn(), and RemoveItem().
|
virtual |
Removes a child item from this parent.
This is a generic method that is used to delete a child object from this parent. The GUI uses this method to remove objects from the simulation that have been deleted in the UI. The item type lets the method determine what type of item is being deleted, like synapse, neuron, body part, etc.. The ID is then used to delete that specific item.
strItemType | String descriptor of the type of item that is being created. |
strID | Unique ID of the item that will be removed. |
bThrowError | If true then throw an error if there is a problem, otherwise return false. |
Reimplemented from AnimatSim::AnimatBase.
Definition at line 777 of file DataChart.cpp.
References RemoveColumn(), and StdUtils::Std_CheckString().
|
virtual |
Resets the simulation back to time 0.
This method calls the ResetSimulation method on all subitems in order to reset the simulation back to the beginning.
Reimplemented from AnimatSim::ActivatedItem.
Reimplemented in AnimatSim::Charting::FileChart.
Definition at line 537 of file DataChart.cpp.
References m_lCurrentCol, m_lCurrentRow, ReInitialize(), and AnimatSim::ActivatedItem::ResetSimulation().
Referenced by AnimatSim::Charting::FileChart::ResetSimulation().
|
virtual |
Gets the row count.
Definition at line 376 of file DataChart.cpp.
References m_lRowCount.
|
virtual |
Sets a data element to the data buffer.
iColumn | The column in the data buffer where we need to add the value. |
iRow | The row in the data buffer where we need to add the value. |
fltVal | The new value to add. |
Definition at line 842 of file DataChart.cpp.
References m_aryDataBuffer, m_lColumnCount, m_lCurrentCol, m_lCurrentRow, and m_lRowCount.
Referenced by AddData().
|
virtual |
Set a variable based on a string data type name.
This is a generic method that can be used to set any variable in an AnimatBase object by specifying the name of the variable and a string representation of that data. The GUI uses this method to set data into variables in the simulation when the user changes them in the UI. The value string can be as simple as a float or int, or as complex as an xml packet. It is the developers responsibilty to know what type of data is needed and to process it accordingly.
strDataType | string name of the data type to set. |
strValue | The string value of the data. It is up to the developer to determine what this should be. For example, in most cases it is simply a float and you just have to convert it to a float and make the appropriate mutator method call. However, it can be any type of string, including an entire xml packet. It is the developers responsibility to know how to set and process the data as required. |
bThrowError | true to throw error if there is a problem. If false then it will not return an error, just return false. |
Reimplemented from AnimatSim::ActivatedItem.
Definition at line 705 of file DataChart.cpp.
References CollectInterval(), CollectTimeWindow(), AnimatSim::ActivatedItem::EndTime(), AnimatSim::ActivatedItem::SetData(), SetStartEndTime(), AnimatSim::ActivatedItem::StartTime(), StdUtils::Std_CheckString(), and StdUtils::Std_ToBool().
|
virtual |
Gets whether a start/end time is set for this chart.
Definition at line 136 of file DataChart.cpp.
References m_bSetStartEndTime.
Referenced by SetData().
|
virtual |
Sets whether a start/end time is specified for this chart.
bVal | true to use the start/end time. |
Definition at line 146 of file DataChart.cpp.
References AnimatSim::ActivatedItem::AlwaysActive(), m_bSetStartEndTime, and ReInitialize().
|
virtual |
Step the simulation for this object.
This is called on an object each time it is stepped in the simulation. this is where its simulation code is processed. However, StepSimulation is not necessarily called every single time that the simulation as a whole is stepped. A good example of this is that neural modules can have different integration time steps. So a firing rate module may have a DT of 0.5 ms, while an integrate and fire model may have one of 0.1 ms. So the firing rate module would only get its StepSimulation method called every 5th time that the other module was called. This is all handed in the StepSimulation method of the Simulator and NervousSystem.
Reimplemented from AnimatSim::AnimatBase.
Reimplemented in AnimatSim::Charting::MemoryChart, and AnimatSim::Charting::ArrayChart.
Definition at line 796 of file DataChart.cpp.
References m_aryDataColumns, m_aryTimeBuffer, m_iCollectInterval, m_lCurrentCol, m_lCurrentRow, AnimatSim::AnimatBase::m_lpSim, AnimatSim::Simulator::Time(), and AnimatSim::Simulator::TimeSlice().
Referenced by AnimatSim::Charting::MemoryChart::StepSimulation().
|
virtual |
Gets the time buffer.
Definition at line 201 of file DataChart.cpp.
References m_aryTimeBuffer.
|
virtual |
returns the string type name of this object.
Gets the string type description of this object. This is basically just another type of tag that can be applied by the developer of a class to differentiate it. An example of where this is used is in the synaptic types class. I use it to specify the synapse type as gated, modulatory, etc.. They still have different classes, but this gives a string description of that type. It is not mandatory and can be used how the class developer requires.
Reimplemented from AnimatSim::AnimatBase.
Reimplemented in AnimatSim::Charting::FileChart, AnimatSim::Charting::MemoryChart, and AnimatSim::Charting::ArrayChart.
Definition at line 110 of file DataChart.cpp.
|
virtual |
Unlocks this data chart buffer from being written by any other process.
This is for multi-threaded environments. It is called just after data is added to the buffer to remove the lock so that other process can modify the buffer.
Reimplemented in AnimatSim::Charting::MemoryChart.
Definition at line 420 of file DataChart.cpp.
|
virtual |
Gets the used buffer byte size.
Definition at line 191 of file DataChart.cpp.
References UsedBufferSize().
|
virtual |
Gets the size of buffer that is currently used.
Definition at line 171 of file DataChart.cpp.
References m_lCurrentCol, and m_lCurrentRow.
Referenced by UsedBufferByteSize().