| | |
| | | #include "CCLinkIEControl.h" |
| | | #include "CAttributeVector.h" |
| | | #include "ToolUnits.h" |
| | | #include <map> |
| | | |
| | | |
| | | namespace SERVO { |
| | | #define STEP_EVENT_READDATA 0x01 |
| | | #define STEP_EVENT_COMPLETE 0x02 |
| | | |
| | | typedef std::function<void(void* pStep, int code, void* pData)> ONSTEPEVENT; |
| | | typedef struct _StepListener |
| | | { |
| | | ONSTEPEVENT onEvent; |
| | | } StepListener; |
| | | |
| | | class CEquipment; |
| | | class CStep |
| | |
| | | virtual ~CStep(); |
| | | |
| | | public: |
| | | void setListener(StepListener listener); |
| | | void setCcLink(CCCLinkIEControl* pCcLink); |
| | | void setEquipment(CEquipment* pEquipment); |
| | | CEquipment* getEquipment(); |
| | | void setID(int id); |
| | | int getID(); |
| | | void setName(const char* pszName); |
| | | std::string& getName(); |
| | | CAttributeVector& attributeVector(); |
| | | virtual void getAttributeVector(CAttributeVector& attrubutes); |
| | | virtual void init(); |
| | | virtual void term(); |
| | | |
| | | void setProp(const char* pszKey, void* pValue); |
| | | void* getProp(const char* pszKey); |
| | | void addAttribute(CAttribute* pAttribute); |
| | | void addAttributeVector(CAttributeVector& attributeVector); |
| | | |
| | | protected: |
| | | inline void Lock() { EnterCriticalSection(&m_criticalSection); } |
| | |
| | | void convertString(const char* pszBuffer, int size, std::string& strOut); |
| | | |
| | | protected: |
| | | StepListener m_listener; |
| | | int m_nID; |
| | | StationIdentifier m_station; |
| | | std::string m_strName; |
| | | CEquipment* m_pEquipment; |
| | | CCCLinkIEControl* m_pCclink; |
| | | CRITICAL_SECTION m_criticalSection; |
| | | std::map<std::string, void*> m_mapProp; |
| | | CAttributeVector m_attributeVector; |
| | | }; |
| | | } |
| | | |