#pragma once
|
|
#include <vector>
|
|
class CMotionInfo_Axis
|
{
|
public:
|
CMotionInfo_Axis(int nIndex=0);
|
~CMotionInfo_Axis();
|
int GetIndex() const;
|
void SetIndex(int nIndex);
|
|
// move
|
int GetEmergencyStop() const;
|
int GetMoveDirection() const;
|
double GetMoveVelocity() const;
|
double GetMoveAccelTime() const;
|
double GetMoveDecelTime() const;
|
double GetMoveStartPos() const;
|
double GetMoveEndPos() const;
|
|
void SetEmergencyStop(int nValue);
|
void SetMoveVelocity(double dVelocity);
|
void SetMoveAccelTime(double dAccelTime);
|
void SetMoveDecelTime(double dDecelTime);
|
void SetMoveStartPos(double dStartPos);
|
void SetMoveEndPos(double dEndPos);
|
void SetMoveData(double dVelocity, double dAccelTime, double dDecelTime, double dStartPos, double dEndPos);
|
|
// jog
|
double GetJogVelocity() const;
|
double GetJogAccelTime() const;
|
double GetJogDecelTime() const;
|
double GetJogStartPos() const;
|
void SetJogVelocity(double dVelocity);
|
void SetJogAccelTime(double dAccelTime);
|
void SetJogDecelTime(double dDecelTime);
|
void SetJogStartPos(double dStartPos);
|
void SetJogData(double dVelocity, double dAccelTime, double dDecelTime, double dStartPos);
|
|
// current
|
UINT GetCurStatus() const;
|
double GetCurPosition() const;
|
double GetCurVelocity() const;
|
double GetCurAccelTime() const;
|
double GetCurDecelTime() const;
|
double GetCurFixTime() const;
|
double GetCurTotalTime() const;
|
double GetCurAccelDist() const;
|
double GetCurDecelDist() const;
|
double GetCurFixDist() const;
|
double GetCurTotalDist() const;
|
|
void SetCurStatus(int nStatus) { m_nCurStatus = nStatus; }
|
|
// calculate
|
int CalculateMoveMotion(double dTime, double& dPos, double& dVelocity, UINT& nStatus);
|
int CalculateJogMotion(double dTime, int nJogDir, double& dPos, double& dVelocity, UINT& nStatus);
|
|
protected:
|
int CalculateMoveValue();
|
int CalculateJogValue();
|
|
protected:
|
int m_nEmergencyStop; //
|
int m_nMoveDirection; // 0 is not calculated
|
|
double m_dCurPosition; // cur position
|
UINT m_nCurStatus; // cur status
|
|
double m_dCurVelocity; // mm/sec
|
double m_dCurAccelTime; // sec
|
double m_dCurDecelTime; // sec
|
double m_dCurFixTime; // sec
|
double m_dCurTotalTime; // sec
|
|
double m_dCurAccelDist; // mm
|
double m_dCurDecelDist; // mm
|
double m_dCurFixDist; // mm
|
double m_dCurTotalDist; // mm
|
|
int m_nIndex;
|
double m_dMoveVelocity; // mm/sec
|
double m_dMoveAccelTime; // sec
|
double m_dMoveDecelTime; // sec
|
double m_dMoveStartPos; // mm
|
double m_dMoveEndPos; // mm
|
|
double m_dJogVelocity; // mm/sec
|
double m_dJogAccelTime; // sec
|
double m_dJogDecelTime; // sec
|
double m_dJogStartPos; // mm
|
};
|
typedef std::vector<CMotionInfo_Axis> VectorMotionInfo_Axis;
|
typedef std::vector<CMotionInfo_Axis>::iterator VectorMotionInfo_AxisIt;
|
typedef std::vector<CMotionInfo_Axis>::const_iterator constVectorMotionInfo_AxisIt;
|