AnimatLab  2
Test
InverseMuscleCurrent.h
1 // InverseMuscleCurrent.h: interface for the CurrentStimulus class.
2 //
4 
5 #pragma once
6 
7 namespace AnimatSim
8 {
9  namespace ExternalStimuli
10  {
11 
12  class ANIMAT_PORT InverseMuscleCurrent : public ExternalStimulus
13  {
14  protected:
15  std::string m_strTargetNodeID;
16  Node *m_lpTargetNode;
17 
18  float *m_lpExternalCurrent;
19 
20  std::string m_strMuscleID;
21  LinearHillMuscle *m_lpMuscle;
22 
23  float m_fltCurrent;
24  float m_fltPrevCurrent;
25  float m_fltOffset;
26 
27  int m_iIndex;
28  float m_fltLength;
29  float m_fltVelocity;
30 
31  float m_fltT;
32  float m_fltA;
33  float m_fltVm;
34 
35  float m_fltRestPotential;
36  float m_fltConductance;
37 
38  std::string m_strMuscleLengthData;
39  CStdArray<float> m_aryTime;
40  CStdArray<float> m_aryLength;
41  CStdArray<float> m_aryVelocity;
42 
43  void LoadMuscleData(std::string strFilename);
44 
45  public:
47  virtual ~InverseMuscleCurrent();
48 
49  static InverseMuscleCurrent *CastToDerived(AnimatBase *lpBase) {return static_cast<InverseMuscleCurrent*>(lpBase);}
50 
51  virtual void RestPotential(float fltV);
52  virtual float RestPotential();
53 
54  virtual void Conductance(float fltG);
55  virtual float Conductance();
56 
57  virtual void TargetNodeID(std::string strID);
58  virtual std::string TargetNodeID();
59  virtual Node *TargetNode();
60 
61  virtual void MuscleID(std::string strID);
62  virtual std::string MuscleID();
63  virtual LinearHillMuscle *Muscle();
64 
65  virtual void MuscleLengthData(std::string strFilename);
66  virtual std::string MuscleLengthData();
67 
68  virtual void Load(CStdXml &oXml);
69 
70  virtual float *GetDataPointer(const std::string &strDataType);
71  virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError = true);
72  virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
73 
74  //ActiveItem overrides
75  virtual std::string Type() {return "InverseMuscleCurrent";};
76  virtual void Initialize();
77  virtual void Activate();
78  virtual void ResetSimulation();
79  virtual void StepSimulation();
80  virtual void Deactivate();
81  };
82 
83  } //ExternalStimuli
84 } //AnimatSim
Root namespace for the base simulation library for AnimatLab.
Animat base class.
Definition: AnimatBase.h:36
Base class for body parts and neural network nodes.
Definition: Node.h:25
virtual std::string Type()
returns the string type name of this object.