AnimatLab  2
Test
AnimatSim::Charting::DataChart Class Reference

Data chart base class. More...

#include <DataChart.h>

+ Inheritance diagram for AnimatSim::Charting::DataChart:
+ Collaboration diagram for AnimatSim::Charting::DataChart:

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 DataColumnFindColumn (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 NeuralModuleGetNeuralModule ()
 Gets the neural module. More...
 
virtual NodeGetNode ()
 Gets the node. More...
 
virtual SimulatorGetSimulator ()
 Gets the simulator pointer. More...
 
virtual StructureGetStructure ()
 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 DataChartCastToDerived (AnimatBase *lpBase)
 
- Static Public Member Functions inherited from AnimatSim::ActivatedItem
static ActivatedItemCastToDerived (AnimatBase *lpBase)
 

Protected Member Functions

virtual long CalculateChartColumnCount ()
 Calculates the chart column count. More...
 
virtual DataColumnFindColumn (std::string strID, int &iIndex, bool bThrowError)
 Searches for a column that matches the specified ID. More...
 
DataColumnLoadDataColumn (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< DataColumnm_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::NeuralModulem_lpModule
 The pointer to this items parentNeuralModule. If this is not relevant for this object then this is NULL.
 
Nodem_lpNode
 The pointer to this items parent Node. If this is not relevant for this object then this is NULL.
 
Simulatorm_lpSim
 The pointer to a Simulation.
 
AnimatSim::Environment::Structurem_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..
 

Detailed Description

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.

Author
dcofer
Date
3/18/2011

Definition at line 31 of file DataChart.h.

Constructor & Destructor Documentation

AnimatSim::Charting::DataChart::DataChart ( )
AnimatSim::Charting::DataChart::~DataChart ( )
virtual

Destructor.

Author
dcofer
Date
3/18/2011

Definition at line 74 of file DataChart.cpp.

References m_aryDataBuffer, m_aryDataColumns, m_aryTimeBuffer, and StdUtils::Std_TraceMsg().

+ Here is the call graph for this function:

Member Function Documentation

void AnimatSim::Charting::DataChart::Activate ( )
virtual

Activates this item.

Author
dcofer
Date
3/1/2011

Reimplemented from AnimatSim::ActivatedItem.

Definition at line 685 of file DataChart.cpp.

References AnimatSim::ActivatedItem::Activate(), and m_aryDataColumns.

+ Here is the call graph for this function:

void AnimatSim::Charting::DataChart::AddColumn ( DataColumn lpColumn)
virtual

Adds a column.

Author
dcofer
Date
3/18/2011
Parameters
[in,out]lpColumnPointer 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Charting::DataChart::AddColumn ( std::string  strXml,
bool  bDoNotInit 
)
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.

Author
dcofer
Date
3/18/2011
Parameters
strXmlThe 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().

+ Here is the call graph for this function:

void AnimatSim::Charting::DataChart::AddData ( int  iColumn,
int  iRow,
float  fltVal 
)
virtual

Adds a data element to the data buffer.

Author
dcofer
Date
3/18/2011
Parameters
iColumnThe column in the data buffer where we need to add the value.
iRowThe row in the data buffer where we need to add the value.
fltValThe new value to add.

Definition at line 826 of file DataChart.cpp.

References m_lCurrentCol, and SetData().

Referenced by AnimatSim::Charting::DataColumn::StepSimulation().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool AnimatSim::Charting::DataChart::AddItem ( const std::string &  strItemType,
const std::string &  strXml,
bool  bThrowError = true,
bool  bDoNotInit = false 
)
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.

Author
dcofer
Date
2/22/2011
Parameters
strItemTypeString descriptor of the type of item that is being created.
strXmlXML packet that is used to create and load the new item.
bThrowErrorIf true then throw an error if there is a problem, otherwise return false.
Returns
true if it succeeds, false if it fails.

Reimplemented from AnimatSim::AnimatBase.

Definition at line 760 of file DataChart.cpp.

References AddColumn(), and StdUtils::Std_CheckString().

+ Here is the call graph for this function:

long AnimatSim::Charting::DataChart::BufferByteSize ( )
virtual

Gets the buffer byte size.

Author
dcofer
Date
3/18/2011
Returns
Buffer byte size.

Definition at line 181 of file DataChart.cpp.

References BufferSize().

+ Here is the call graph for this function:

long AnimatSim::Charting::DataChart::BufferSize ( )
virtual

Gets the buffer size.

Author
dcofer
Date
3/18/2011
Returns
The length of the data buffer.

Definition at line 161 of file DataChart.cpp.

References m_lColumnCount, and m_lRowCount.

Referenced by BufferByteSize().

+ Here is the caller graph for this function:

long AnimatSim::Charting::DataChart::CalculateChartColumnCount ( )
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.

Author
dcofer
Date
3/18/2011
Returns
The calculated chart column count.

Definition at line 555 of file DataChart.cpp.

References ColumnCount(), and m_aryDataColumns.

Referenced by Initialize(), and ReInitialize().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float AnimatSim::Charting::DataChart::ChartTimeBase ( )
virtual

Gets the Time base used by this data chart.

Author
dcofer
Date
10/13/2014
Returns
Time base for this chart

Definition at line 279 of file DataChart.cpp.

References m_iCollectInterval, and AnimatSim::AnimatBase::m_lpSim.

int AnimatSim::Charting::DataChart::CollectInterval ( )
virtual

Gets the collect interval.

The collect data interval tells how many time slices should occur in-between collecting data.

Author
dcofer
Date
3/18/2011
Returns
The collect interval.

Definition at line 224 of file DataChart.cpp.

References m_iCollectInterval.

Referenced by ReInitialize(), and SetData().

+ Here is the caller graph for this function:

void AnimatSim::Charting::DataChart::CollectInterval ( int  iVal,
bool  bReInit = true 
)
virtual

Sets the Collect interval using the time slice.

Author
dcofer
Date
3/18/2011
Parameters
iValThe new interval.

Definition at line 234 of file DataChart.cpp.

References m_fltCollectInterval, m_iCollectInterval, AnimatSim::AnimatBase::m_lpSim, ReInitialize(), and AnimatSim::Simulator::TimeStep().

+ Here is the call graph for this function:

void AnimatSim::Charting::DataChart::CollectInterval ( float  fltVal,
bool  bReInit = true 
)
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.

Author
dcofer
Date
3/18/2011
Parameters
fltValThe 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().

+ Here is the call graph for this function:

long AnimatSim::Charting::DataChart::CollectTimeWindow ( )
virtual

Gets the collect time window time slices.

Author
dcofer
Date
3/18/2011
Returns
Number of time slices that data is collected.

Definition at line 299 of file DataChart.cpp.

References m_lCollectTimeWindow.

Referenced by SetData().

+ Here is the caller graph for this function:

void AnimatSim::Charting::DataChart::CollectTimeWindow ( long  lVal,
bool  bReInit = true 
)
virtual

Sets the Collect time window using time slices.

Author
dcofer
Date
3/18/2011
Parameters
lValThe new value in time slices.

Definition at line 309 of file DataChart.cpp.

References m_lCollectTimeWindow, and ReInitialize().

+ Here is the call graph for this function:

void AnimatSim::Charting::DataChart::CollectTimeWindow ( float  fltVal,
bool  bReInit = true 
)
virtual

Sets the collect time window in time value.

Author
dcofer
Date
3/18/2011
Parameters
fltValThe 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().

+ Here is the call graph for this function:

long AnimatSim::Charting::DataChart::ColumnCount ( )
virtual

Gets the column count.

Author
dcofer
Date
3/18/2011
Returns
number of DataColumn objects.

Definition at line 366 of file DataChart.cpp.

References m_lColumnCount.

Referenced by CalculateChartColumnCount().

+ Here is the caller graph for this function:

long AnimatSim::Charting::DataChart::CurrentRow ( )
virtual

Gets the current row.

Author
dcofer
Date
3/18/2011
Returns
The currently selected row in the data buffer.

Definition at line 386 of file DataChart.cpp.

References m_lCurrentRow.

void AnimatSim::Charting::DataChart::CurrentRow ( long  iVal)
virtual

Sets the Current row.

Author
dcofer
Date
3/18/2011
Parameters
iValThe new current row value.

Reimplemented in AnimatSim::Charting::ArrayChart.

Definition at line 396 of file DataChart.cpp.

References m_lCurrentRow.

float * AnimatSim::Charting::DataChart::DataBuffer ( )
virtual

Gets the data buffer.

Author
dcofer
Date
3/18/2011
Returns
Pointer to the data buffer.

Definition at line 211 of file DataChart.cpp.

References m_aryDataBuffer.

void AnimatSim::Charting::DataChart::Deactivate ( )
virtual

Deactivates this item.

Author
dcofer
Date
3/1/2011

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DataColumn * AnimatSim::Charting::DataChart::FindColumn ( std::string  strID,
int &  iIndex,
bool  bThrowError 
)
protectedvirtual

Searches for a column that matches the specified ID.

Author
dcofer
Date
3/18/2011
Parameters
strIDGUID ID of the column to find.
[in,out]iIndexZero-based index of the found column in the array.
bThrowErrorIf true and the ID is not found then it throws an error, otherwise it does nothing.
Returns
null if it the column is not found and bThrowError is false, else a pointer to the found column.

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DataColumn * AnimatSim::Charting::DataChart::FindColumn ( std::string  strID,
bool  bThrowError = true 
)
virtual

Searches for a column that matches the specified ID.

Author
dcofer
Date
3/18/2011
Parameters
strIDGUID ID of the column to find.
bThrowErrorIf true and the ID is not found then it throws an error, otherwise it does nothing.
Returns
null if it the column is not found and bThrowError is false, else a pointer to the found column.

Definition at line 640 of file DataChart.cpp.

References m_aryColumnsMap, and StdUtils::Std_CheckString().

+ Here is the call graph for this function:

void AnimatSim::Charting::DataChart::Initialize ( )
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.

Author
dcofer
Date
3/1/2011

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void AnimatSim::Charting::DataChart::Load ( std::string  strProjectPath,
std::string  strConfigFile 
)
virtual

Loads a data chart from a file.

Author
dcofer
Date
3/18/2011
Parameters
strProjectPathFull pathname of the string project file.
strConfigFileThe 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DataColumn * AnimatSim::Charting::DataChart::LoadDataColumn ( CStdXml oXml)
protected

Loads a data column.

Author
dcofer
Date
3/18/2011
Parameters
[in,out]oXmlThe xml to use when loading the data column.
Returns
Pointer to the new DataColumn.
Exceptions
Throwsan 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool AnimatSim::Charting::DataChart::Lock ( )
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.

Author
dcofer
Date
3/18/2011
Returns
true if it locks the buffer, false if it is already locked.

Reimplemented in AnimatSim::Charting::MemoryChart.

Definition at line 409 of file DataChart.cpp.

bool AnimatSim::Charting::DataChart::operator< ( ActivatedItem lpItem)
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.

Returns
true if this items start slice is less than the one passed in, false if not.

Implements AnimatSim::ActivatedItem.

Definition at line 94 of file DataChart.cpp.

References AnimatSim::ActivatedItem::m_lEndSlice, and AnimatSim::ActivatedItem::m_lStartSlice.

std::string AnimatSim::Charting::DataChart::ProjectPath ( )
virtual

Gets the project path.

Author
dcofer
Date
3/18/2011
Returns
project path.

Definition at line 346 of file DataChart.cpp.

References m_strProjectPath.

Referenced by AnimatSim::Charting::DataChartMgr::LoadDataChart().

+ Here is the caller graph for this function:

void AnimatSim::Charting::DataChart::ProjectPath ( std::string  strVal)
virtual

Sets the Project path.

Author
dcofer
Date
3/18/2011
Parameters
strValThe new value.

Definition at line 356 of file DataChart.cpp.

References m_strProjectPath.

void AnimatSim::Charting::DataChart::QueryProperties ( CStdPtrArray< TypeProperty > &  aryProperties)
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.

Author
dcofer
Date
2/22/2011
Parameters
aryNamesArray list of the property names.
strTypesArray list of the type that is associated with the cooresponding name in the list.
Returns
Nothing.

Reimplemented from AnimatSim::AnimatBase.

Definition at line 749 of file DataChart.cpp.

References AnimatSim::AnimatBase::QueryProperties().

+ Here is the call graph for this function:

void AnimatSim::Charting::DataChart::ReInitialize ( )
virtual
void AnimatSim::Charting::DataChart::RemoveColumn ( std::string  strID,
bool  bThrowError = true 
)
virtual

Removes the column with the specified ID.

Author
dcofer
Date
3/18/2011
Parameters
strIDGUID ID of the DataColumn to remove.
bThrowErrorIf 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool AnimatSim::Charting::DataChart::RemoveItem ( const std::string &  strItemType,
const std::string &  strID,
bool  bThrowError = true 
)
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.

Author
dcofer
Date
2/22/2011
Parameters
strItemTypeString descriptor of the type of item that is being created.
strIDUnique ID of the item that will be removed.
bThrowErrorIf true then throw an error if there is a problem, otherwise return false.
Returns
true if it succeeds, false if it fails.

Reimplemented from AnimatSim::AnimatBase.

Definition at line 777 of file DataChart.cpp.

References RemoveColumn(), and StdUtils::Std_CheckString().

+ Here is the call graph for this function:

void AnimatSim::Charting::DataChart::ResetSimulation ( )
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.

Author
dcofer
Date
3/1/2011

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

long AnimatSim::Charting::DataChart::RowCount ( )
virtual

Gets the row count.

Author
dcofer
Date
3/18/2011
Returns
number of rows in this array of data.

Definition at line 376 of file DataChart.cpp.

References m_lRowCount.

void AnimatSim::Charting::DataChart::SetData ( int  iColumn,
int  iRow,
float  fltVal 
)
virtual

Sets a data element to the data buffer.

Author
dcofer
Date
3/18/2011
Parameters
iColumnThe column in the data buffer where we need to add the value.
iRowThe row in the data buffer where we need to add the value.
fltValThe 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().

+ Here is the caller graph for this function:

bool AnimatSim::Charting::DataChart::SetData ( const std::string &  strDataType,
const std::string &  strValue,
bool  bThrowError = true 
)
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.

Author
dcofer
Date
2/22/2011
Parameters
strDataTypestring name of the data type to set.
strValueThe 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.
bThrowErrortrue to throw error if there is a problem. If false then it will not return an error, just return false.
Returns
true if it succeeds, false if it fails.

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().

+ Here is the call graph for this function:

bool AnimatSim::Charting::DataChart::SetStartEndTime ( )
virtual

Gets whether a start/end time is set for this chart.

Author
dcofer
Date
3/18/2011
Returns
true if it start/end time is specified, false otherwise.

Definition at line 136 of file DataChart.cpp.

References m_bSetStartEndTime.

Referenced by SetData().

+ Here is the caller graph for this function:

void AnimatSim::Charting::DataChart::SetStartEndTime ( bool  bVal)
virtual

Sets whether a start/end time is specified for this chart.

Author
dcofer
Date
3/18/2011
Parameters
bValtrue to use the start/end time.

Definition at line 146 of file DataChart.cpp.

References AnimatSim::ActivatedItem::AlwaysActive(), m_bSetStartEndTime, and ReInitialize().

+ Here is the call graph for this function:

void AnimatSim::Charting::DataChart::StepSimulation ( )
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.

Author
dcofer
Date
3/1/2011

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

float * AnimatSim::Charting::DataChart::TimeBuffer ( )
virtual

Gets the time buffer.

Author
dcofer
Date
3/18/2011
Returns
Pointer to the time buffer.

Definition at line 201 of file DataChart.cpp.

References m_aryTimeBuffer.

std::string AnimatSim::Charting::DataChart::Type ( )
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.

Author
dcofer
Date
2/22/2011
Returns
string of assigned class type.

Reimplemented from AnimatSim::AnimatBase.

Reimplemented in AnimatSim::Charting::FileChart, AnimatSim::Charting::MemoryChart, and AnimatSim::Charting::ArrayChart.

Definition at line 110 of file DataChart.cpp.

void AnimatSim::Charting::DataChart::Unlock ( )
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.

Author
dcofer
Date
3/18/2011

Reimplemented in AnimatSim::Charting::MemoryChart.

Definition at line 420 of file DataChart.cpp.

long AnimatSim::Charting::DataChart::UsedBufferByteSize ( )
virtual

Gets the used buffer byte size.

Author
dcofer
Date
3/18/2011
Returns
Used buffer byte size.

Definition at line 191 of file DataChart.cpp.

References UsedBufferSize().

+ Here is the call graph for this function:

long AnimatSim::Charting::DataChart::UsedBufferSize ( )
virtual

Gets the size of buffer that is currently used.

Author
dcofer
Date
3/18/2011
Returns
used buffer size.

Definition at line 171 of file DataChart.cpp.

References m_lCurrentCol, and m_lCurrentRow.

Referenced by UsedBufferByteSize().

+ Here is the caller graph for this function:


The documentation for this class was generated from the following files: