8 #include "IMovableItemCallback.h"
9 #include "ISimGUICallback.h"
50 {
Std_TraceMsg(0,
"Caught Error in desctructor of LengthTensionGain\r\n",
"", -1,
false,
true);}
56 void LengthTensionGain::RestingLength(
float fltVal)
64 float LengthTensionGain::TLwidth() {
return m_fltTLwidth;}
66 void LengthTensionGain::TLwidth(
float fltVal)
73 float LengthTensionGain::TLc() {
return m_fltTLc;}
78 float fltTl = (-(pow(fltLceNorm, 2)/
m_fltTLc) + 1);
79 if(fltTl<0) fltTl = 0;
160 Gain::Copy(lpSource);
185 if(strDataType ==
"RESTINGLENGTH")
187 RestingLength((
float) atof(strValue.c_str()));
191 if(strDataType ==
"LWIDTH")
193 TLwidth((
float) atof(strValue.c_str()));
197 if(strDataType ==
"PELENGTHPERCENTAGE")
203 if(strDataType ==
"MINPELENGTHPERCENTAGE")
211 THROW_PARAM_ERROR(Al_Err_lInvalidDataType, Al_Err_strInvalidDataType,
"Data Type", strDataType);
220 aryProperties.Add(
new TypeProperty(
"RestingLength", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
221 aryProperties.Add(
new TypeProperty(
"Lwidth", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
222 aryProperties.Add(
new TypeProperty(
"PeLengthPercentage", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
223 aryProperties.Add(
new TypeProperty(
"MinPeLengthPercentage", AnimatPropertyType::Float, AnimatPropertyDirection::Set));
226 void LengthTensionGain::Load(CStdXml &oXml)
232 RestingLength(oXml.GetChildFloat(
"RestingLength"));
233 TLwidth(oXml.GetChildFloat(
"Lwidth"));
float m_fltRestingLength
The resting length of the muscle.
Base class file for all Animat simulation objects.
virtual float MinPeLength()
Gets the minimum pe length.
Root namespace for the base simulation library for AnimatLab.
Length-Tension muscle gain.
float m_fltPeLengthPercentage
The percentage of the muscle length that is the Pe portion.
float m_fltTLc
precalculated value used in the determination of the length-tension curve.
virtual float MinPeLengthPercentage()
Gets the minimum pe length percentage.
Class that stores information about types for QueryProperty information.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
bool Std_InValidRange(int iMinVal, int iMaxVal, int iVal, bool bThrowError, std::string strParamName)
Tests whether a number is within a valid range.
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 gain base class.
LengthTensionGain()
Default constructor.
virtual float SeRestLength()
Gets the se rest length.
virtual float CalculateGain(float fltInput)
Calculates the gain.
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.
Declares an inverted quadratic gain class used to calculate length-tension relationship for muscle...
float m_fltTLwidth
The width parameter of the curve.
virtual void QueryProperties(CStdPtrArray< TypeProperty > &aryProperties)
Queries this object for a list of properties that can be changed using SetData.
virtual float PeLengthPercentage()
Gets the pe length percentage.
float m_fltSeRestLength
Resting length of the se portion of the muscle. Used to calculate SE and PE lengths.
virtual void QueryProperties(CStdPtrArray< TypeProperty > &aryProperties)
Queries this object for a list of properties that can be changed using SetData.
virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError=true)
Set a variable based on a string data type name.
virtual ~LengthTensionGain()
Destructor.
float m_fltMinPeLengthPercentage