AnimatLab  2
Test
RemoteControl.h
1 #pragma once
2 
3 namespace AnimatSim
4 {
5  namespace Robotics
6  {
7 
8 
9  class ANIMAT_PORT RemoteControl : public RobotIOControl
10  {
11  protected:
14  CStdPtrArray<RemoteControlLinkage> m_aryLinks;
15 
17  CStdArray<RemoteControlLinkage *> m_aryInLinks;
18 
20  CStdArray<RemoteControlLinkage *> m_aryOutLinks;
21 
23  CStdMap<std::string, int> m_aryDataIDMap;
24 
27 
32 
33  virtual RemoteControlLinkage *LoadRemoteControlLinkage(CStdXml &oXml);
34  virtual RemoteControlLinkage *AddRemoteControlLinkage(std::string strXml);
35  virtual void RemoveRemoteControlLinkage(std::string strID, bool bThrowError = true);
36  virtual int FindLinkageChildListPos(std::string strID, bool bThrowError = true);
37  virtual int FindLinkageChildListPos(CStdArray<RemoteControlLinkage *> &aryLinks, std::string strID, bool bThrowError = true);
38  virtual bool FindDataToWrite(CStdArray<RemoteControlLinkage *> &aryWrites);
39 
40  virtual void SetDataValue(int iButtonID, float fltVal);
41  virtual void ResetData();
42  virtual void CheckStartedStopped();
43  virtual void ClearStartStops();
44 
45  virtual void CreateDataIDMap();
46 
47  public:
48  RemoteControl(void);
49  virtual ~RemoteControl(void);
50 
51  static RemoteControl *CastToDerived(AnimatBase *lpBase) {return static_cast<RemoteControl*>(lpBase);}
52 
53  virtual CStdPtrArray<RemoteControlLinkage>* Links();
54  virtual CStdArray<RemoteControlLinkage *>* InLinks();
55  virtual CStdArray<RemoteControlLinkage *>* OutLinks();
56  virtual CStdMap<std::string, int>* DataIDMap();
57 
58  virtual void ChangeSimStepCount(int iRate);
59  virtual int ChangeSimStepCount();
60 
61  virtual bool UseRemoteDataTypes();
62 
63  virtual RemoteControlLinkage *FindLinkageWithPropertyName(std::string strName, bool bThrowError = true);
64 
65  virtual bool AddItem(const std::string &strItemType, const std::string &strXml, bool bThrowError = true, bool bDoNotInit = false);
66  virtual bool RemoveItem(const std::string &strItemType, const std::string &strID, bool bThrowError = true);
67 
68  virtual void SetupIO();
69  virtual void StepIO();
70  virtual void ShutdownIO();
71 
72  virtual float *GetDataPointer(const std::string &strDataType);
73  virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError = true);
74  virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
75 
76  virtual void Initialize();
77  virtual void StepSimulation();
78  virtual void ResetSimulation();
79  virtual void AfterResetSimulation();
80  virtual void Load(CStdXml &oXml);
81  };
82 
83  }
84 }
CStdPtrArray< RemoteControlLinkage > m_aryLinks
Definition: RemoteControl.h:14
Root namespace for the base simulation library for AnimatLab.
CStdArray< RemoteControlLinkage * > m_aryOutLinks
Only the linkages that are outlinks.
Definition: RemoteControl.h:20
A Robot IO controller base class.
Animat base class.
Definition: AnimatBase.h:36
CStdMap< std::string, int > m_aryDataIDMap
Used to map property names to IDs when UseRemoteDataTypes is true.
Definition: RemoteControl.h:23
int m_iChangeSimStepCount
The number of simulation time slices to keep a start/stop signal active.
Definition: RemoteControl.h:26
CStdArray< RemoteControlLinkage * > m_aryInLinks
Only the linkages that are inlinks.
Definition: RemoteControl.h:17