#pragma once

#include "robbase.h"
#include "Axes.h"
#include "Pos.h" 

//移动类型
#define QT_HOME      0 
#define	QT_MOVE      1
#define QT_ANY_XY    2  //插补
#define	QT_ARC_XY    3  //插补
#define	QT_ANY_XYZ   4  //插补



 

 

typedef struct __queue_item_
{
	int   type;	
	BOOL  bPassed;  //是否已经执行完毕,保留
	WORD  chiefAxis; //首要轴
	CAxes axes;
	CPos  pos; 
}Q_ITEM;

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

	void Clear();
	int  GetCount();
	Q_ITEM* GetItemAt(int index);
	void   RemoveAt(int index);
	void   RemoveHead( );


	//所有的位置为绝对位置
	//整数参数转换成浮点
	//顺序按照函数参数顺序进行
	int AddMoveTo(WORD axis ,   double n   );
	int AddMoveTo(WORD axisX, WORD axisY, double x, double y );
	int AddMoveTo(WORD axisX, WORD axisY,WORD axisZ, double x, double y, double z );
	int AddLineTo(WORD axisX, WORD axisY, double x, double y );
	int AddLineTo(WORD axisX, WORD axisY,WORD axisZ, double x, double y, double z  );

	int AddArcTo(WORD axisX, WORD axisY, double cx, double cy, double ex, double ey, int dir );

	int AddLineTo(  double x, double y );
	int AddLineTo(  double x, double y, double z  );

	void SetAllChiefAxes(WORD axis);
	void SetChiefAxisAt(int index, WORD axis);

	void SetAxisAt(int index, WORD axisX, WORD axisY);
 	void SetAxisAt(int index, WORD axisX, WORD axisY, WORD axisZ);
	void SetAllAxes(WORD axisX, WORD axisY);
	void SetAllAxes(WORD axisX, WORD axisY, WORD axisZ);

public :
	DWORD m_slaveId;    //站点id
	DWORD m_bufferId;   //缓冲区id，也可以看作队列id
private:
	RvSequence m_seq;
};

