| | |
| | | namespace SERVO { |
| | | #define BLOCK_BUFFER_MAX 1024 |
| | | #define ALIVE_TIMEOUT 15 |
| | | #define VCR_MAX 1 |
| | | |
| | | typedef std::function<void(void* pEiuipment, BOOL bAlive)> ONALIVE; |
| | | typedef struct _EquipmentListener |
| | |
| | | virtual void onTimer(UINT nTimerid); |
| | | virtual void serialize(CArchive& ar); |
| | | virtual void onReceiveLBData(const char* pszData, size_t size); |
| | | |
| | | |
| | | // 以下为从CC-Link读取到的Bit标志位检测函数 |
| | | public: |
| | | BOOL isAlive(); |
| | | |
| | | BOOL isCimOn(); |
| | | BOOL isUpstreamInline(); |
| | | BOOL isDownstreamInline(); |
| | | BOOL isLocalAlarm(); |
| | | BOOL isAutoRecipeChange(); |
| | | BOOL isVCREnable(unsigned int index); |
| | | |
| | | |
| | | private: |
| | | BOOL isBitOn(const char* pszData, size_t size, int index); |
| | | inline BOOL equalBool(BOOL b1, BOOL b2); |
| | | |
| | | protected: |
| | | inline void Lock() { EnterCriticalSection(&m_criticalSection); } |
| | |
| | | MemoryBlock m_blockReadBit; |
| | | MemoryBlock m_blockWriteBit; |
| | | |
| | | // 以下为从CC-Link读取到的Bit标志位 |
| | | private: |
| | | ALIVE m_alive; |
| | | BOOL m_bCimState; // ON/OFF |
| | | BOOL m_bUpstreamInline; |
| | | BOOL m_bDownstreamInline; |
| | | BOOL m_bLocalAlarm; |
| | | BOOL m_bAutoRecipeChange; |
| | | BOOL m_bVCREnable[VCR_MAX]; |
| | | }; |
| | | } |
| | | |