#pragma once

#include "robbase.h"

#include "Axes.h"
#include "Queue.h"

#include "Options.h"

//Axis Pause State
//轴暂停状态，暂停前的状态
#define ROB_PPS_IDLE            0
#define ROB_PPS_HOME_PAUSE      (1)
#define ROB_PPS_MOVE_PAUSE      (2)
#define ROB_PPS_MOVING          (3)
#define ROB_PPS_IN_ALARM        (4)
 


#define ROB_PPS_UNKNOWN         (-1)
 
//轴专用,  ID,配置函数使用
#define ROB_SIO_HOME            (1<<1)   
#define ROB_SIO_HARD_NEGLMT     (1<<2)
#define ROB_SIO_HARD_POSLMT     (1<<3)
#define ROB_SIO_SOFT_NEGLMT     (1<<4)
#define ROB_SIO_SOFT_POSLMT     (1<<5)
#define ROB_SIO_ENABLE_SERVO    (1<<6)  //伺服使能
#define ROB_SIO_ALARM_IN        (1<<7)  //伺服报警
#define ROB_SIO_CLEAR_ALARM     (1<<8)  //清除伺服报警
#define ROB_SIO_SERVO_READY_IN  (1<<9)  //驱动器已使能
#define ROB_SIO_BROKE           (1<<10)  //刹车
#define ROB_SIO_SPEED_DOWN      (1<<11)  //减速比
#define ROB_SIO_ENCODER         (1<<12) //编码器
#define ROB_SIO_RASTOR_RESO     (1<<13) //光栅精度 

#define ROB_SIO_HOME_LIMIT      (1<<14) //回零限制 
#define ROB_SIO_HOME_INDEX      (1 )    //回零索引 
 
 

////轴参数标记, 软限位， 等增强配置
//#define ROB_FLAG_ENABLE_SERVO    (1) 
//#define ROB_FLAG_SERVO_READY     (1<<1)   //支持伺服就绪输入（来自驱动器）
//#define ROB_FLAG_HARD_NEGLMT     (1<<2)
//#define ROB_FLAG_HARD_POSLMT     (1<<3) 
//#define ROB_FLAG_SOFT_NEGLMT     (1<<4)  //负限位，软 
//#define ROB_FLAG_SOFT_POSLMT     (1<<5)  //正限位,软 
//#define ROB_FLAG_HAS_REDUCER     (1<<6)  //减速比
//#define ROB_FLAG_HAS_ENCODER     (1<<7)  //编码器 
//#define ROB_FLAG_HAS_RASTOR      (1<<8)  //编码器 
//#define ROB_FLAG_HAS_BROKE       (1<<9)  //刹车 
  
//电平转置标记
#define ROB_FLAG_INV_HOME            (1)     //原点信号电平 
#define ROB_FLAG_INV_NEGLMT          (1<<1)  //硬限位电平
#define ROB_FLAG_INV_POSLMT          (1<<2)  //硬限位电平
#define ROB_FLAG_INV_ALARM_IN        (1<<3)  //报警
#define ROB_FLAG_INV_ENABLE_SERVO    (1<<4)  //伺服使能
#define ROB_FLAG_INV_CLEAR_ALARM     (1<<5) 
#define ROB_FLAG_INV_SERVO_READY_IN  (1<<6)  //驱动器已使能 
#define ROB_FLAG_INV_BROKE           (1<<7)  //刹车电平 
#define ROB_FLAG_INV_ENCODER_LOGIC   (1<<8)  //编码器电平逻辑（影响正负）

//下面标记对部分卡有效
#define ROB_FLAG_INV_HOME_LOGIC      (1<<9)   //回零逻辑(影响方向)
#define ROB_FLAG_INV_LIMIT_LOGIC    (1<<10)  //硬负限位逻辑
#define ROB_FLAG_INV_INDEX_LOGIC    (1<<11)  //硬正限位逻辑
 

 

//typedef struct __rob_axis_extend1_{
//  //  int    brokeBit ;               //刹车位
//  //	BOOL   bReverseBrokeBit;        //是否转置电平
//	float  speedDownRatio ;         //减速比	
//	float  poslmtPos;               // 默认正限位位置
//	float  neglmtPos;               // 默认负限位位置
//}ROB_AXIS_EXT1;
//
//typedef struct __rob_axis_extend2_
//{
//	double rasterReso;              //光栅尺精度
//	//编码器
//	int    encoderInitLevel;  //编码器初始电平，控制编码器计数正方方向。	 
//	float  encoderScalar;     //编码器当量变换值 
//}ROB_AXIS_EXT2;

typedef struct __rob_axis_desc_
{
	int  type;       //运动类型， 直线，旋转，
	int  driverType; //驱动器类型
	UINT slaveId;           //卡号
	int  posCounter;        // 位置计数器: 规划位置，编码器 ,光栅尺

 	//马达相关
	double distPerRound; //unit: mm
	int    motorReso;   // motor resolution: 3200
	float  pulseEquival;  //脉冲当量
	int    homeType;   //回零方式,不同厂家的卡支持的回零方式不一样
	                   //甚至同一卡支持不同的轴有不同的回零方式
	int   nCurState;   //保留
	//BOOL bEnableServo;      //是否为伺服

	//电平置反, 软限位等
	int   capaFlags; //功能标记
	int   revFlags ; //电平翻转标记

	//特殊io编号，从1开始
	short  servoBit;  //伺服使能位
	short  alarmInBit;      //伺服报警
	short  resetAlarmBit;   //清除报警
	short  axisReadyBit;    //伺服驱动是否就位
	short  originBit;       //原点
	short  poslmtBit;       //正限位，硬
	short  neglmtBit;       //负限位,硬
	short  brokeBit;        //刹车 
	short  _stateBeforePause;          //保留
	short  _posBeforePause;            //保留
	
	//其它参数
	float  speedDownRatio ;         //减速比	
	float  poslmtPos;               // 默认正限位位置
	float  neglmtPos;               // 默认负限位位置

	float rasterReso;              //光栅尺精度
	//编码器
	//int    encoderInitLevel;  //编码器初始电平，控制编码器计数正方方向。	 
	float  encoderScalar;     //编码器当量变换值 

	//void* pExt1;   //正负限位, 转速比。
	//void* pExt2;   // 光栅尺，编码器参数等。
	//void* pMutex;
}ROB_AXIS_DESC;


//#define ROB_INVERT_ENABLE_SERVO    1        //output
//#define ROB_INVERT_SERVO_READY     (1<<1)   //input
//#define ROB_INVERT_ALARM_IN        (1<<2)   
//#define ROB_INVERT_CLEAR_ALARM     (1<<3)   //output
//#define ROB_INVERT_ORIGIN_IN       (1<<4)
//#define ROB_INVERT_POSLMT_IN       (1<<5)
//#define ROB_INVERT_NEGLMT_IN       (1<<6)

//#define ROB_INVERT_EMERG_IN        (1<<7)
 
//正负限位
//#define ROB_ENABLE_SOFTLMT_POS        (1<<8)
//#define ROB_ENABLE_SOFTLMT_NEG        (1<<9) 
//#define ROB_ENABLE_HARDLMT_POS        (1<<10)
//#define ROB_ENABLE_HARDLMT_NEG        (1<<11) 
//#define ROB_HAS_EMERG_BIT             (1<<12) 

//Functional IO
typedef struct __rob_fio_desc_
{
	UINT slaveId;     //卡号 
	int   type;       
	int   bit;        // 专用IO
	BOOL  initLevel;  //初始电平
}ROB_FIO_DESC;

//	系统功能FIO INPUT 
#define ROB_FI_ESTOP        1001  //不再使用，仅保留。
#define ROB_FI_RESET        1002
#define ROB_FI_START        1003
#define ROB_FI_STOP         1004
#define ROB_FI_PAUSE        1005
//系统功能FIO OUTPUT
#define ROB_FO_LAMP_GREEN   (-101)
#define ROB_FO_LAMP_YELLOW  (-102)
#define ROB_FO_LAMP_RED     (-103)
#define ROB_FO_BEEP         (-104)
#define ROB_FO_TOOL         (-105)

 

class ROBBASE_API CMotion
{
public:
	CMotion(void);
	virtual ~CMotion(void);

	virtual BOOL  Init(int  axisCount, const char* strArgs, int extra1, int extra2,  int* pErrCode) ;
	virtual void  Release()  ;

	//设置SIO是否可用
	void SetSioValid(WORD axis, int ids);
	BOOL IsSioValid(WORD axis, int id);

	//分配轴相关专用io 
	//type: IO bit
	virtual BOOL  SetSioBit(WORD axis, int id, int bit, BOOL bReverse, int* pErrCode);
	virtual BOOL  GetSioBit(WORD axis, int id, int* bit, int* pErrCode) ;
	virtual BOOL  IsSioReversed(WORD axis, int id, BOOL* bReverse, int* pErrCode) ;
	
	//设置硬件逻辑,如原点，限位停止逻辑 level = ROB_LOW or ROB_HI
	virtual BOOL  SetSioLogic(WORD axis, int id,  int level, int* pErrCode);
	virtual BOOL  GetSioLogic(WORD axis, int id,  int* level, int* pErrCode);
	

	//轴专用IO输出
	virtual BOOL  SetSioLevel(WORD axis, int id, int level, int* pErrCode) ;
	//轴获取专用IO状态
	virtual BOOL  GetSioLevel(WORD axis, int id, int* pLevel, int* pErrCode);
	 
	//减速比，光栅分辨率,软正负限位等
	virtual BOOL  SetSioValue(WORD axis, int id,   double value,   int* pErrCode) ;
	virtual BOOL  GetSioValue(WORD axis, int id, double* value, int* pErrCode);

	//使能SIO,如软限位
	virtual BOOL  EnableSio(WORD axis, int id, BOOL flag,   int* pErrCode) ;
	virtual BOOL  IsSioEnabled(WORD axis, int id, BOOL* flag, int* pErrCode);
		 
	 			
	//回零方式
	virtual BOOL   SetHomeType(WORD axis, int type, int* pErrCode) ;
	virtual BOOL   GetHomeType(WORD axis, int* type,  int* pErrCode) ;	
	 
	//设置脉冲模式: 
	//如： mode = 256*100 + 0 表示100微妙的保护时间，模式为0
	//返回0, 表示成功 
	virtual BOOL  SetPulseMode(WORD axis, int mode,  int* pErrCode){  if (pErrCode) *pErrCode =-1;  return FALSE;};
	virtual BOOL  GetPulseMode(WORD axis, int* mode,  int* pErrCode){  if (pErrCode) *pErrCode =-1;  return FALSE;};
	 
	virtual BOOL  SetAxisDriverType(WORD axis, int type,  int* pErrCode){  if (pErrCode) *pErrCode =-1;  return FALSE;};
	virtual BOOL  GetAxisDriverType(WORD axis, int* type,  int* pErrCode){  if (pErrCode) *pErrCode =-1;  return FALSE;};

	//脉冲当量: 每毫米多少脉冲 
	virtual  BOOL   SetAxisUnits(WORD axis, float units, int* pErrCode) ;
	virtual  BOOL   GetAxisUnits(WORD axis, float* units,  int* pErrCode) ;
	  
	//进入紧急状态,将axisready为false
	virtual BOOL   EnterEmergState(COptions* options, int *pErrCode);
	virtual BOOL   ClearEmergState(int *pErrCode){ if (pErrCode) *pErrCode =-1;  return FALSE; };
	
	//virtual BOOL   PauseMove(WORD axis,  int mode,  int* pErrCode){ if (pErrCode) *pErrCode =-1;  return FALSE; };
	//virtual BOOL   ResumeMove(WORD axis,  int* pErrCode) { if (pErrCode) *pErrCode =-1;  return FALSE; };

	//停止所有轴移动
	virtual BOOL   StopAll(COptions* options,  int* pErrCode) { if (pErrCode) *pErrCode =-1;  return FALSE; };

	virtual BOOL  GetCurSpeed(WORD axis, double* speed, int* pErrCode) { return FALSE; };

	//机械属性，直线运动，圆轴运动，自由运动
	int  GetAxisMachType(WORD axis  );
	void SetAxisMachType(WORD axis, int type );

public:
	int    GetAxisCount() { return m_nAxisCount; };
	BOOL   IsAxisReady(WORD axis);   //判断轴是否可用，即一个有效的轴,在空闲状态
	int    GetAxisCurState(WORD axis); //获得轴当前状态,与具体轴没有关系。

	//判断轴配置项是否有效
	//BOOL    IsAxisSioValid(WORD axis, int flag);

	int    GetVendorId() { return m_nVendorId; };
	 
	//可以输入主要参数，输入小于或等于0，表示使用默认参数
	virtual COptions* CreateOptions(double speed, double acc, double dec)=0;
	virtual void DestroyOptions(COptions* pOptions){ if (pOptions){ delete pOptions; } };
	COptions*  GetDefaultOptions();

	//pOptions不能为NULL, 如成功，返回旧参数指针
	COptions* SetDefaultOptions(COptions* pOptions);

	//每次轴复位以后也可以设置为ready
    virtual BOOL   SetAxisReady(WORD axis, BOOL flag, int *pErrCode);
	 
	//轴每旋转一周，移动的距离
	void   SetDPR(WORD axis, double val);
	double GetDPR(WORD axis);
	//马达细分，即马达旋转一周需要的脉冲数量
	void   SetMotorReso(WORD axis, int val);
	int    GetMotorReso(WORD axis);

	//带减速器的马达分辨率
    // = reso X spr
	double    GetSpeedDownReso(WORD axis);
		  
	//void   SetSpeedDownRatio(WORD axis,double ratio);
	//double GetSpeedDownRatio(WORD axis );



	BOOL     GetAxisCurPos(WORD axis,   double *curpos,int * pErrCode  ) { 
		return GetAxisCurPos(axis, ROB_PC_DEFAULT, curpos, pErrCode);
	}; 

	UINT  GetCurSlaveId(){
		return m_nCurSlave;
	}
	UINT  SetCurSlaveId(int id)
	{
		UINT old = m_nCurSlave;
		m_nCurSlave = id;
		return old;
	}

	//获得轴或回收使用权（用于加锁和解锁）, 暂时没有用
	//BOOL  PrivilegeAxis(WORD axis, BOOL bGiveup);
	 

//公用接口
public:
	virtual BOOL   ClearAxisPos(WORD axis,  int type,  int* pErrCode) =0;

	//当前位置 ,编码器位置, 光栅尺位置 
	virtual BOOL   GetAxisEncoderPos(WORD axis,  double *curpos, int * pErrCode)  =0;
    virtual BOOL   GetAxisRasterPos(WORD axis, double *curpos, int * pErrCode)  =0 ;
	virtual BOOL   GetAxisCurPos(WORD axis, int type, double *curpos,int * pErrCode  )   =0 ;
	virtual BOOL   GetAxisRawPos(WORD axis, int type, double *curpos,int * pErrCode  )  { return FALSE ; } ;


	//state: 0-运动中; -1-停止
	virtual BOOL   GetMoveState(WORD axis, int* state, int* pErrCode)  =0 ;
	virtual BOOL   GetHomeState(WORD axis, int* state, int* pErrCode)  { return GetMoveState(axis, state, pErrCode);} ;
	virtual BOOL   ClearAxisState(WORD axis,  int* pErrCode){  if (pErrCode) *pErrCode =-1;  return FALSE;};
	//关闭或使能伺服，电平一般为HI, -1表示关闭
	//virtual BOOL   EnableAxisServo(WORD axis,  BOOL flag, int* pErrCode) =0;
	//BOOL   IsAxisServoEnabled(WORD axis, BOOL* state, int* pErrCode)  ;

	//virtual BOOL   ClearAxisServoAlarm(WORD axis, int duration, int* pErrCode)  =0 ;
	//virtual BOOL   IsAxisServoAlarmOn(WORD axis,BOOL* flag, int* pErrCode)  =0 ;


	 
	virtual BOOL   Delay(int duration, int* pErrCode) =0;
	 
	//@512  回零位 
	virtual BOOL  Home(WORD axis, COptions* options, int* pErrCode)  =0 ;
	 
	////任意多轴回零,使用轴标识
	BOOL  HomeMany(CAxes& axes, COptions* options, int* pErrCode) ;
	 
	virtual BOOL  StopHome(WORD axis, COptions* options, int* pErrCode)  {return StopAxis(axis,options, pErrCode); } 
	//停止任意2轴回零。
 	BOOL  StopHomeMany(CAxes& axes, COptions* options, int* pErrCode) ;
	  
	//@528 连续运动 
	virtual BOOL Jog(WORD axis,  COptions* options,  int dir, int* pErrCode)  =0;

	//连续运动停止
	virtual BOOL StopJog(WORD axis,  COptions* options,  int* pErrCode)   {return StopAxis(axis,options, pErrCode); } ;
	//end of @528

	//@527 点动
	virtual BOOL  Move(WORD axis, double step, COptions* options, BOOL bAbsolute, int* pErrCode)  =0 ;	
	virtual BOOL  StopAxis(WORD axis, COptions* options,  int* pErrCode)  =0;
	   
	//@529 插补运动 	  
	 BOOL  MoveAny2( DWORD csid, WORD axisX, WORD axisY, double x, double y,  COptions* options, BOOL bAbsolute,  int* pErrCode )   ;
	 BOOL  MoveAny3( DWORD csid, WORD axisX, WORD axisY,  WORD axisZ,  double x, double y, double z, COptions* options, BOOL bAbsolute, int* pErrCode)  ;
	 BOOL  MoveAny4( DWORD csid, WORD axisX, WORD axisY,  WORD axisZ, WORD axisR, double x, double y, double z, double r, COptions* options, BOOL bAbsolute, int* pErrCode) ;
	virtual BOOL  MoveAny ( DWORD csid, CAxes& axes, double* posArray, int count, COptions* options, BOOL bAbsolute, int* pErrCode){return FALSE;};

	//几何体函数：放到robot里面
	////几何体
	//virtual BOOL MoveLine ( DWORD csid, CAxes& axes, double  x0, double  y0, double x1, double y1, COptions* options, int* pErrCode){ return FALSE; } ;
	//virtual BOOL MoveArc ( DWORD csid, CAxes& axes,  double  startX, double  startY, double endX, double endY, double radius, BOOL bBigArc, int direct, COptions* options, int* pErrCode) { return FALSE; } ;
	//virtual BOOL MoveCircle ( DWORD csid, CAxes& axes, double centerX, double centerY, double radius, int direct, COptions* options, int* pErrCode){ return FALSE; } ;
	////下面函数也可以画圆弧
	//virtual BOOL MoveCircle ( DWORD csid, CAxes& axes, double startX, double startY, double midX, double midY, double endX, double endY, COptions* options, int* pErrCode){ return FALSE; } ;
	
	//当局当前点位置移动
	virtual BOOL MoveArcTo( DWORD csid,  WORD axisX, WORD axisY, double cx, double cy, double ex, double ey, int direct, COptions* options, int* pErrCode)=0;
	//移动到绝对位置
	BOOL MoveLineTo( DWORD csid,  WORD axisX, WORD axisY, double ex, double ey, COptions* options, int* pErrCode) ;

	//插补停止
	//virtual BOOL StopAxisAny2( DWORD csid, CAxes&  axes,  COptions* options, int* pErrCode) =0;
	//virtual BOOL StopAxisAny3( DWORD csid, CAxes&  axes,  COptions* options, int* pErrCode) =0;
	//virtual BOOL StopAxisAny4( DWORD csid, CAxes&  axes,  COptions* options, int* pErrCode) { return FALSE;};
	virtual BOOL StopAny( DWORD csid, CAxes&  axes, COptions* options,  int* pErrCode) =0;

	//缓冲区运动
	virtual BOOL ExecuteQueue( CQueue* pQueue, int startIndex, int count, COptions* options,   int* pErrCode )   {return FALSE;};
	virtual BOOL GetQueueState(CQueue* pQueue, int* state, int* linenum, int* pErrCode)  {return FALSE;};
	virtual BOOL StopQueue(CQueue* pQueue,  COptions* options,   int* pErrCode)   {return FALSE; } ; 
	virtual BOOL PauseQueue(CQueue* pQueue, BOOL bResume, COptions* options, int* pErrCode)   {return FALSE; } ; 
	   

	//单从站输入输出
	virtual BOOL SetOutputLevel(int bit, int level, int* pErrCode){ return FALSE ;};
	virtual BOOL GetOutputLevel(int bit, int* level, int* pErrCode) {return FALSE ;};
	virtual BOOL GetInputLevel(int bit, int* level, int* pErrCode) {return FALSE ;} ; 

 	virtual BOOL SetBatchOutputLevel(int levels,   int* pErrCode)  {return FALSE;} ;
    virtual BOOL GetBatchOutoutLevel(int* pLevels, int* pErrCode)  {return FALSE;} ;
	virtual BOOL GetBatchInputLevel(int* pLevels,   int* pErrCode) {return FALSE;};

	//多从站情况@230121
	virtual BOOL SetOutputLevel(UINT slave, int offset, int bit, int level, int* pErrCode){ return FALSE ;};
	virtual BOOL GetOutputLevel(UINT slave, int offset, int bit, int* level, int* pErrCode) {return FALSE ;};
	virtual BOOL GetInputLevel(UINT slave,  int offset, int bit, int* level, int* pErrCode) {return FALSE ;} ;  

	//多从站，无offset情况@241217
	virtual BOOL SetOutputLevel(UINT slave,  int bit, int level, int* pErrCode){ return FALSE ;};
	virtual BOOL GetOutputLevel(UINT slave,  int bit, int* level, int* pErrCode) {return FALSE ;};
	virtual BOOL GetInputLevel(UINT slave,   int bit, int* level, int* pErrCode) {return FALSE ;} ; 

 	virtual BOOL SetBatchOutputLevel(UINT slave, int offset, int levels,   int* pErrCode)  {return FALSE;} ;
    virtual BOOL GetBatchOutoutLevel(UINT slave, int offset, int* pLevels, int* pErrCode)  {return FALSE;} ;
	virtual BOOL GetBatchInputLevel(UINT slave, int offset,  int* pLevels,   int* pErrCode) {return FALSE;};

	virtual BOOL SetBatchOutputLevel(UINT slave,   int levels,   int* pErrCode)  {return FALSE;} ;
    virtual BOOL GetBatchOutoutLevel(UINT slave,   int* pLevels, int* pErrCode)  {return FALSE;} ;
	virtual BOOL GetBatchInputLevel(UINT slave,    int* pLevels,   int* pErrCode) {return FALSE;};

	//@ end of @0121
	
	//辅助状态
	virtual BOOL GetAuxState(WORD axis,/* int item,*/ int* state, int* pErrCode){return FALSE; } ;
	//virtual BOOL SetAuxState(WORD axis,int items, int state, int* pErrCode) {return FALSE; } ;
	  
	// timeout小于等于0,则立即退出
	virtual BOOL WaitHomeAxis(WORD axis,  int timeout,  int* pErrCode);
	//timeout小于等于0,则立即退出
	virtual BOOL WaitMoveAxis(WORD axis,  int timeout,  int* pErrCode);
	//等待插补完成
	virtual BOOL WaitAny(DWORD csid, CAxes&  axes,  int timeout,  int* pErrCode) ;
	//等待队列完成
	virtual BOOL WaitQueue(CQueue* pQueue, int timeout, int* pErrCode)  ;

public:

	virtual const char* GetVersion()  { return "";};
	virtual const char* GetVendorDesc() { return "";};
    virtual const char* GetErrorDesc(int errCode) ;

	virtual const char* GetSerialNum() { return "";};
	virtual BOOL  IsDeviceReady()      { return m_bInit;};

	virtual UINT GetDefaultSlaveId(){ return 0; };

	int   GetSlaveCount(){
	    return m_nSlaveCount;
	}
	BOOL  IsMultiSlaves(){
	     return  (m_nSlaveCount>0);
	}

	 
	//功能io
	virtual BOOL  AddFio(int id,  int bit, int  initLevel, int* pErrCode);
	//功能io
	virtual BOOL  GetFioLevel(int id,  int* level, int* pErrCode);
	virtual BOOL  SetFioLevel(int id,  int  level, int* pErrCode);
	virtual void  RemoveFio(int id );

	void  RemoveAllFios();
	int   GetFioCount();
	int   GetFioBit(int id);
	int   GetFioId(int bit);
	ROB_FIO_DESC* GetFioDesc(int index);
	
	BOOL  IsFioInputAt(int index);
	BOOL  IsFioOutputAt(int index);
	int   GetFioIdAt(int index); 
	static BOOL  IsFioInput(int id);
	static BOOL  IsFioOutput(int id);
private:

	void SetAllToDefault(int axisCount,  BOOL bRelease);

protected:
    int    m_nSlaveCount;  //多卡状态
	void*  m_pHandler;     
  	UINT   m_nCurSlave;    //临时用，不支持多线程   
 	
protected:
	BOOL   m_bInit; 
	int    m_nVendorId;
	COptions* m_pDefOpts;  //子类或应用程序产生和删除 

	BOOL  m_bInQueue;
	int   m_nQueueId;
    int   m_nAxisCount;
	ROB_AXIS_DESC    m_arrAxisDesc[ROB_MAX_AXIS_COUNT];
	//功能IO
	int   m_nFioCount;
	ROB_FIO_DESC     m_arrFioDesc[ROB_MAX_SIO_COUNT];
	
};

