#pragma once
|
#include <vector>
|
|
#include "CHThreadPools/WorkThreadPools.h"
|
|
#define MAX_MOTION_DATA_COUNT 100
|
|
typedef std::vector<double> VectorDouble;
|
typedef std::vector<double>::iterator VectorDoubleIt;
|
|
enum MotorThreadData { ThreadDataType_AxisMotionEnd=0, ThreadDataType_GantryMotionEnd, ThreadDataType_ThetaMotionEnd ,
|
ThreadDataType_AxisManualGo, ThreadDataType_JogGo, ThreadDataType_GantryGo, ThreadDataType_AutoGo,ThreadDataType_WsiAutoGo };
|
|
union UThreadData
|
{
|
int nValue;
|
DWORD dwValue;
|
double dValue;
|
};
|
|
class CMotionData
|
{
|
public:
|
CMotionData()
|
{
|
nType = -1;
|
nIndex = -1;
|
memset(uData, 0, sizeof(uData));
|
|
vecDoubleX.clear();
|
vecDoubleY.clear();
|
}
|
|
int nType;
|
int nIndex;
|
VectorDouble vecDoubleX;
|
VectorDouble vecDoubleY;
|
UThreadData uData[MAX_MOTION_DATA_COUNT];
|
};
|
|
class CMotionThreadData : public CWorkThreadData
|
{
|
public:
|
CMotionThreadData(PVOID pPtr) : CWorkThreadData(pPtr)
|
{
|
|
}
|
virtual ~CMotionThreadData()
|
{
|
|
}
|
|
CMotionData motionData;
|
};
|
|
interface IMotionThread2Parent
|
{
|
virtual void IMT2P_RunThreadProcess(const CMotionData& motionData) = 0;
|
};
|
|
class CMotionThread : public CWorkThreadPools
|
{
|
public:
|
CMotionThread(IMotionThread2Parent* pMT2P, int nThreadCount=1);
|
virtual ~CMotionThread(void);
|
BOOL AddThreadData(const CMotionData& data);
|
|
protected:
|
virtual void WorkThreadProcess(PVOID pParameter);
|
|
protected:
|
IMotionThread2Parent* m_pMT2P;
|
};
|