You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
714 B
C++
35 lines
714 B
C++
#include "StdAfx.h"
|
|
#include "WorkCmdMoveMotor.h"
|
|
#include "MotionCard_PCI1245.h"
|
|
|
|
|
|
CWorkCmdMoveMotor::CWorkCmdMoveMotor(CMotor &Motor,double val)
|
|
:m_Motor(Motor),m_Val(val)
|
|
{
|
|
m_bMoveByDis = true;//默认按距离移动
|
|
}
|
|
CWorkCmdMoveMotor::~CWorkCmdMoveMotor(void)
|
|
{
|
|
}
|
|
bool CWorkCmdMoveMotor::Excute()
|
|
{
|
|
if(gLogMgr->IsDebuging())//调试状态只延时
|
|
{
|
|
Sleep(gLogMgr->GetDebugCmdDelay());
|
|
return true;
|
|
}
|
|
|
|
if(m_bMoveByDis)//按距离移动
|
|
{
|
|
double Coord = gMotionCard_PCI1245->GetMotorCoord(m_Motor);
|
|
m_Motor.MoveToCoord(Coord+m_Val);
|
|
}
|
|
else//移动到某个坐标值
|
|
m_Motor.MoveToCoord(m_Val);
|
|
|
|
return true;
|
|
}
|
|
void CWorkCmdMoveMotor::WirteLog()
|
|
{
|
|
|
|
} |