|
|
|
@ -11,14 +11,15 @@ class CMtrProfile;
|
|
|
|
class IODLLCLASS CAbstractMotionControllerFactory
|
|
|
|
class IODLLCLASS CAbstractMotionControllerFactory
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
int m_cardType;
|
|
|
|
int m_cardType{ -1 };
|
|
|
|
char *m_cardName;
|
|
|
|
std::string m_cardName;
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
CAbstractMotionControllerFactory(int cardType, char* m_cardName);
|
|
|
|
CAbstractMotionControllerFactory(int cardType, const std::string& m_cardName);
|
|
|
|
virtual ~CAbstractMotionControllerFactory();
|
|
|
|
virtual ~CAbstractMotionControllerFactory();
|
|
|
|
virtual CMotionControllerBase *CreateMotionController(int index) = 0;
|
|
|
|
virtual CMotionControllerBase* CreateMotionController(int index) = 0;
|
|
|
|
int GetCardType();
|
|
|
|
int GetCardType() const;
|
|
|
|
char * GetCardName();
|
|
|
|
const std::string& GetCardName() const;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -32,14 +33,15 @@ class IODLLCLASS CMotionControllerFactory
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
CMotionControllerFactory(void);
|
|
|
|
CMotionControllerFactory(void);
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
virtual ~CMotionControllerFactory(void);
|
|
|
|
virtual ~CMotionControllerFactory(void);
|
|
|
|
static CMotionControllerFactory &Instance();
|
|
|
|
static CMotionControllerFactory& Instance();
|
|
|
|
void AddFactory(CAbstractMotionControllerFactory *pFactory);
|
|
|
|
void AddFactory(CAbstractMotionControllerFactory* pFactory);
|
|
|
|
void RemoveFactory(CAbstractMotionControllerFactory *pFactory);
|
|
|
|
void RemoveFactory(CAbstractMotionControllerFactory* pFactory);
|
|
|
|
CMotionControllerBase *CreateMotionController(int index, const char* cardName);
|
|
|
|
CMotionControllerBase* CreateMotionController(int index, const std::string& cardName);
|
|
|
|
CMotionControllerBase *CreateMotionController(int index, int cardType);
|
|
|
|
CMotionControllerBase* CreateMotionController(int index, int cardType);
|
|
|
|
int GetCardType(const char* cardName);
|
|
|
|
int GetCardType(const std::string& cardName);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@ -61,16 +63,16 @@ public:
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#define REGISTER_MOTIONCONTROLLER_FACTORY(mType, name, MotionController_class) \
|
|
|
|
#define REGISTER_MOTIONCONTROLLER_FACTORY(mType, name, MotionController_class) \
|
|
|
|
class Factory ## MotionController_class : public CAbstractMotionControllerFactory \
|
|
|
|
class Factory##MotionController_class : public CAbstractMotionControllerFactory \
|
|
|
|
{ \
|
|
|
|
{ \
|
|
|
|
public: \
|
|
|
|
public: \
|
|
|
|
Factory ## MotionController_class() : CAbstractMotionControllerFactory(mType, name){} \
|
|
|
|
Factory##MotionController_class() : CAbstractMotionControllerFactory(mType, name) {} \
|
|
|
|
CMotionControllerBase *CreateMotionController(int index) \
|
|
|
|
CMotionControllerBase* CreateMotionController(int index) \
|
|
|
|
{ \
|
|
|
|
{ \
|
|
|
|
CMotionControllerBase *ptr = new MotionController_class(index); \
|
|
|
|
CMotionControllerBase* ptr = new MotionController_class(index); \
|
|
|
|
ptr->SetCardInfo(mType, name); \
|
|
|
|
ptr->SetCardInfo(mType, name); \
|
|
|
|
return ptr; \
|
|
|
|
return ptr; \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
}; \
|
|
|
|
}; \
|
|
|
|
static Factory ## MotionController_class StaticFactory ## MotionController_class; \
|
|
|
|
static Factory##MotionController_class StaticFactory##MotionController_class; \
|
|
|
|
CAbstractMotionControllerFactory* GetFactory ## MotionController_class() { return &StaticFactory ## MotionController_class; }
|
|
|
|
CAbstractMotionControllerFactory* GetFactory##MotionController_class() { return &StaticFactory##MotionController_class; }
|
|
|
|
|