2 #include "IMovableItemCallback.h"
3 #include "ISimGUICallback.h"
4 #include "IMotorizedJoint.h"
9 #include "IPhysicsMovableItem.h"
10 #include "IPhysicsBody.h"
13 #include "MovableItem.h"
38 #include "RemoteControlLinkage.h"
39 #include "PulsedLinkage.h"
40 #include "RemoteControl.h"
47 PulsedLinkage::PulsedLinkage(
void)
59 PulsedLinkage::~PulsedLinkage(
void)
66 {
Std_TraceMsg(0,
"Caught Error in desctructor of PulsedLinkage\r\n",
"", -1,
false,
true);}
69 void PulsedLinkage::MatchValue(
int iVal) {
m_iMatchValue = iVal;}
77 void PulsedLinkage::PulseDuration(
float fltVal)
85 void PulsedLinkage::PulseCurrent(
float fltVal)
97 if(strType ==
"MATCHES")
110 if(strType ==
"MATCHVALUE")
112 MatchValue(atoi(strValue.c_str()));
115 else if(strType ==
"PULSEDURATION")
117 PulseDuration(atof(strValue.c_str()));
120 else if(strType ==
"PULSECURRENT")
122 PulseCurrent(atof(strValue.c_str()));
125 else if(strType ==
"MATCHONCHANGE")
133 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
141 aryProperties.Add(
new TypeProperty(
"MatchValue", AnimatPropertyType::Integer, AnimatPropertyDirection::Set));
142 aryProperties.Add(
new TypeProperty(
"PulseDuration", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
143 aryProperties.Add(
new TypeProperty(
"PulseCurrent", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
144 aryProperties.Add(
new TypeProperty(
"MatchOnChange", AnimatPropertyType::Boolean, AnimatPropertyDirection::Set));
146 aryProperties.Add(
new TypeProperty(
"Matches", AnimatPropertyType::Integer, AnimatPropertyDirection::Get));
158 float PulsedLinkage::CalculateAppliedValue(
float fltData)
162 for(
int iIdx=0; iIdx<iCount; iIdx++)
171 void PulsedLinkage::CullPulses()
178 for(
int iIdx=0; iIdx<iCount && iDeleteID == -1; iIdx++)
195 void PulsedLinkage::IncrementMatches()
241 for(
int iIdx=0; iIdx<iMatches; iIdx++)
259 void PulsedLinkage::Load(
CStdXml &oXml)
261 RemoteControlLinkage::Load(oXml);
virtual void QueryProperties(CStdPtrArray< TypeProperty > &aryProperties)
Queries this object for a list of properties that can be changed using SetData.
CStdArray< float > m_aryPulses
Base class file for all Animat simulation objects.
Declares the nervous system class.
virtual void PhysicsTimeStep(float fltVal)
Sets the integration time step for the physics engine.
Declares the simulation recorder class.
Declares the Robot IO control interface base class.
float m_fltMatchesReport
Used to report up the number of matches.
Root namespace for the base simulation library for AnimatLab.
int m_iMatches
Counts the number of matches found in StepIO to let the sim know.
Declares the body part class.
bool m_bMatchOnChange
If true then it will only performa a match check when the value has changed.
Simulator * m_lpSim
The pointer to a Simulation.
float * m_lpTargetData
Pointer to the external value of the linked target.
virtual bool Paused()
Gets whether the Simulation is paused.
virtual bool IntoElem()
Goes into the next element where the cursor is located.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
Class that stores information about types for QueryProperty information.
Declares the link base class.
Declares the key frame class.
unsigned int m_iPrevValue
Keeps track of the previous source value for the change check.
int Std_Sign(float fltVal)
Determines the sign of a number.
virtual void ResetSimulation()
Resets the simulation back to time 0.
Declares the joint class.
Declares the organism class.
virtual int GetChildInt(std::string strElementName)
Gets an integer value from the element with the specified name.
bool Std_IsAboveMin(int iMinVal, int iVal, bool bThrowError, std::string strParamName, bool bInclusiveLimit)
Tests if a number is above a minimum value.
Declares the activated item class.
boost::interprocess::interprocess_mutex m_AccessMatchesMutex
mutex used to try and access matches variable.
Declares a light manager object.
AnimatBase * m_lpTarget
Target object we are inserting into.
Declares the bounding box class.
Declares the gain base class.
virtual void StepIO()
This method is called from within the IO thread. It calls StepIO for each part.
float m_fltPulseCurrent
The amount of current to apply for a single pulse.
float m_fltPulseDuration
The duration for which a single pulse should be applied.
A standard xml manipulation class.
bool Std_ToBool(int iVal)
Converts a value toa bool.
virtual void QueryProperties(CStdPtrArray< TypeProperty > &aryProperties)
Queries this object for a list of properties that can be changed using SetData.
void Std_TraceMsg(const int iLevel, std::string strMessage, std::string strSourceFile, int iSourceLine, bool bLogToFile, bool bPrintHeader)
Traces a message to the debugger window.
virtual float * GetDataPointer(const std::string &strDataType)
Returns a float pointer to a data item of interest in this object.
bool m_bEnabled
Tells if this item is enabled or not. If it is not enabled then it is not run.
virtual bool OutOfElem()
Goes out of the element where the cursor is located.
float * m_lpSourceData
Pointer to the source data variable.
Declares the data chart manager class.
Declares the rigid body class.
std::string Std_CheckString(std::string strVal)
Converts a string to upper case and trims it.
virtual float * GetDataPointer(const std::string &strDataType)
Returns a float pointer to a data item of interest in this object.
Declares the structure class.
Declares the odor type class.
virtual void StepSimulation()
Step the simulation for this object.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
Declares the robotics inerface for animatlab.
int m_iMatchValue
The value we are trying to match in order to apply a pulse.
Declares the simulator class.
Declares the neural module class.
Declares the activated item manager class.
Declares the external stimuli manager class.
virtual void ResetSimulation()
Resets the simulation back to time 0.
Declares the receptive field class.
virtual float GetChildFloat(std::string strElementName)
Gets a float value from the element with the specified name.