AnimatLab  2
Test
PulsedLinkage.h
1 #pragma once
2 
3 namespace AnimatSim
4 {
5  namespace Robotics
6  {
7  class RemoteControl;
8 
9  class ANIMAT_PORT PulsedLinkage : public RemoteControlLinkage
10  {
11  protected:
12 #ifndef STD_DO_NOT_ADD_BOOST
13  boost::interprocess::interprocess_mutex m_AccessMatchesMutex;
15 #endif
16 
19 
22 
25 
28 
30  unsigned int m_iPrevValue;
31 
34 
37 
42  CStdArray<float> m_aryPulses;
43 
44  virtual float CalculateAppliedValue(float fltData);
45  void CullPulses();
46  void IncrementMatches();
47 
48  public:
49  PulsedLinkage(void);
50  virtual ~PulsedLinkage(void);
51 
52  static PulsedLinkage *CastToDerived(AnimatBase *lpBase) {return static_cast<PulsedLinkage*>(lpBase);}
53 
54  virtual void MatchValue(int iVal);
55  virtual int MatchValue();
56 
57  virtual void MatchOnChange(bool bVal);
58  virtual bool MatchOnChange();
59 
60  virtual void PulseDuration(float fltVal);
61  virtual float PulseDuration();
62 
63  virtual void PulseCurrent(float fltVal);
64  virtual float PulseCurrent();
65 
66  virtual float *GetDataPointer(const std::string &strDataType);
67  virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError = true);
68  virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
69 
70  virtual void StepIO();
71 
72  virtual void ResetSimulation();
73  virtual void StepSimulation();
74  virtual void Load(CStdXml &oXml);
75  };
76 
77  }
78 }
float m_fltMatchesReport
Used to report up the number of matches.
Definition: PulsedLinkage.h:21
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.
Definition: PulsedLinkage.h:18
bool m_bMatchOnChange
If true then it will only performa a match check when the value has changed.
Definition: PulsedLinkage.h:27
unsigned int m_iPrevValue
Keeps track of the previous source value for the change check.
Definition: PulsedLinkage.h:30
float m_fltPulseCurrent
The amount of current to apply for a single pulse.
Definition: PulsedLinkage.h:36
float m_fltPulseDuration
The duration for which a single pulse should be applied.
Definition: PulsedLinkage.h:33
Animat base class.
Definition: AnimatBase.h:36
int m_iMatchValue
The value we are trying to match in order to apply a pulse.
Definition: PulsedLinkage.h:24