#pragma once
|
|
#include "MotionInfo_Axis.h"
|
|
enum MotionInfo_AxisType { AxisType_X=0, AxisType_Y, AxisType_Count };
|
|
typedef std::vector<double> VectorDouble;
|
typedef std::vector<double>::iterator VectorDoubleIt;
|
typedef std::vector<double>::const_iterator constVectorDoubleIt;
|
|
typedef std::vector<BOOL> VectorBOOL;
|
typedef std::vector<BOOL>::iterator VectorBOOLIt;
|
typedef std::vector<BOOL>::const_iterator constVectorBOOLIt;
|
|
class AFX_EXT_CLASS CMotionInfo_Gantry
|
{
|
public:
|
CMotionInfo_Gantry(int nIndex=0);
|
virtual ~CMotionInfo_Gantry(void);
|
|
// getter
|
int GetIndex() const;
|
double GetVelocity(int nAxisType) const;
|
double GetAccelTime(int nAxisType) const;
|
double GetDecelTime(int nAxisType) const;
|
double GetStartPos(int nAxisType) const;
|
double GetEndPos(int nAxisType) const;
|
|
// current
|
double GetCurVelocity(int& nAxisType) const;
|
double GetCurAccelTime(int& nAxisType) const;
|
double GetCurDecelTime(int& nAxisType) const;
|
double GetCurFixTime(int& nAxisType) const;
|
double GetCurTotalTime(int& nAxisType) const;
|
double GetCurAccelDist(int& nAxisType) const;
|
double GetCurDecelDist(int& nAxisType) const;
|
double GetCurFixDist(int& nAxisType) const;
|
double GetCurTotalDist(int& nAxisType) const;
|
|
// current min
|
double GetCurVelocity_Min(int& nAxisType) const;
|
double GetCurAccelTime_Min(int& nAxisType) const;
|
double GetCurDecelTime_Min(int& nAxisType) const;
|
double GetCurFixTime_Min(int& nAxisType) const;
|
double GetCurTotalTime_Min(int& nAxisType) const;
|
double GetCurAccelDist_Min(int& nAxisType) const;
|
double GetCurDecelDist_Min(int& nAxisType) const;
|
double GetCurFixDist_Min(int& nAxisType) const;
|
double GetCurTotalDist_Min(int& nAxisType) const;
|
|
// current max
|
double GetCurVelocity_Max(int& nAxisType) const;
|
double GetCurAccelTime_Max(int& nAxisType) const;
|
double GetCurDecelTime_Max(int& nAxisType) const;
|
double GetCurFixTime_Max(int& nAxisType) const;
|
double GetCurTotalTime_Max(int& nAxisType) const;
|
double GetCurAccelDist_Max(int& nAxisType) const;
|
double GetCurDecelDist_Max(int& nAxisType) const;
|
double GetCurFixDist_Max(int& nAxisType) const;
|
double GetCurTotalDist_Max(int& nAxisType) const;
|
|
const CMotionInfo_Axis* GetMotionInfo_Axis(int nAxisType) const;
|
CMotionInfo_Axis* GetMotionInfo_Axis(int nAxisType);
|
int GetMotionInfo_AxisCount() const;
|
|
// setter
|
void SetVelocity(int nAxisType, double dVelocity);
|
void SetAccelTime(int nAxisType, double dAccelTime);
|
void SetDecelTime(int nAxisType, double dDecelTime);
|
void SetStartPos(int nAxisType, double dStartPos);
|
void SetEndPos(int nAxisType, double dEndPos);
|
void SetData(int nAxisType, double dVelocity, double dAccelTime, double dDecelTime, double dStartPos, double dEndPos);
|
|
// calculate
|
int CalculateMotion(int nAxisType, double dTime, double& dPos, double& dVelocity, BOOL& bEnd);
|
int CalculateMotion(double dTime, VectorDouble& vecPos, VectorDouble& vecVelocity, VectorBOOL& vecEnd);
|
|
protected:
|
int m_nIndex;
|
double m_dCurVelocity;
|
double m_dCurAccelTime;
|
double m_dCurDecelTime;
|
double m_dCurTotalTime;
|
double m_dCurFixTime;
|
double m_dCurAccelDist;
|
double m_dCurDecelDist;
|
double m_dCurFixDist;
|
double m_dCurTotalDist;
|
|
VectorMotionInfo_Axis m_vecMotionInfo;
|
};
|
typedef std::vector<CMotionInfo_Gantry> VectorMotionInfo_Gantry;
|
typedef std::vector<CMotionInfo_Gantry>::iterator VectorMotionInfo_GantryIt;
|
typedef std::vector<CMotionInfo_Gantry>::const_iterator constVectorMotionInfo_GantryIt;
|