// MotionController_ADVANTECH_ETHERCAT.h: interface for the CMotionController_ADVANTECH_ETHERCAT class. // ////////////////////////////////////////////////////////////////////// #pragma once #include #include "MotionControllerBase.h" class CMotionController_ADVANTECH_ETHERCAT; typedef struct _stThreadParam { int nId; CMotionController_ADVANTECH_ETHERCAT* pController; // ctor _stThreadParam(int _id, CMotionController_ADVANTECH_ETHERCAT* _pController) { nId = _id; pController = _pController; } } stThreadParam; class CMotionController_ADVANTECH_ETHERCAT : public CMotionControllerBase { public: CMotionController_ADVANTECH_ETHERCAT(int index); virtual ~CMotionController_ADVANTECH_ETHERCAT(); BOOL Init(int& nNoOfMtr) override; void Close() override; int GetCardId(int nIndex) { return m_cardInfo[nIndex].nId; } void SetAdvantechMotionInt(int nCardNo, int nAxisNo); bool m_bKillThread; private: typedef struct _stCardInfo { unsigned short nId; unsigned short nNumOfAxes; unsigned short nNumOfMotionSlaves; unsigned short nNumOfIoSlaves; _stCardInfo(unsigned short _Id, unsigned short _numOfAxes, unsigned short _numOfMotionSlaves, unsigned short _numOfIoSlaves) { nId = _Id; nNumOfAxes = _numOfAxes; nNumOfMotionSlaves = _numOfMotionSlaves; nNumOfIoSlaves = _numOfIoSlaves; } } stCardInfo; // methods // attributes std::vector m_cardInfo; std::map m_mapModelDeviceType; std::vector m_vecThdParam; CWinThread* m_pAdvantechIntThread[2]; };