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
853 B
C++
35 lines
853 B
C++
#include "StdAfx.h"
|
|
#include "WorkCmdMotorToMachineOrigin.h"
|
|
#include "MotionCard_PCI1245.h"
|
|
|
|
CWorkCmdMotorToMachineOrigin::CWorkCmdMotorToMachineOrigin(CMotor &m)
|
|
:m_Motor(m)
|
|
{
|
|
m_bSaveOffsetDis = false;//是否记录偏移距离
|
|
}
|
|
CWorkCmdMotorToMachineOrigin::~CWorkCmdMotorToMachineOrigin(void)
|
|
{
|
|
}
|
|
bool CWorkCmdMotorToMachineOrigin::Excute()
|
|
{
|
|
if(gLogMgr->IsDebuging())//调试状态只延时
|
|
{
|
|
Sleep(gLogMgr->GetDebugCmdDelay());
|
|
return true;
|
|
}
|
|
bool ret;
|
|
if(gMotionCard_PCI1245->IsbUsed())
|
|
{
|
|
ret = gMotionCard_PCI1245->FindOrigin(m_Motor);
|
|
}
|
|
return ret;
|
|
}
|
|
void CWorkCmdMotorToMachineOrigin::WirteLog()
|
|
{
|
|
CString str1 = "[WorkCmd][马达"+m_Motor.Name()+"][返回机械原点]";
|
|
gLogMgr->WriteDebugLog(str1);
|
|
}
|
|
void CWorkCmdMotorToMachineOrigin::SetPar(bool b)
|
|
{
|
|
m_bSaveOffsetDis = b;
|
|
} |