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.
|
|
|
|
#include "StdAfx.h"
|
|
|
|
|
#include "WorkCmdSetMotorSpeed.h"
|
|
|
|
|
#include "GlobalFunction.h"
|
|
|
|
|
#include "Motor.h"
|
|
|
|
|
|
|
|
|
|
CWorkCmdSetMotorSpeed::CWorkCmdSetMotorSpeed()
|
|
|
|
|
{
|
|
|
|
|
m_bSetMotorX = false;//
|
|
|
|
|
m_bSetMotorX2 = false;//
|
|
|
|
|
m_bSetMotorY = false;//
|
|
|
|
|
m_bSetMotorZ = false;//
|
|
|
|
|
}
|
|
|
|
|
CWorkCmdSetMotorSpeed::~CWorkCmdSetMotorSpeed(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
bool CWorkCmdSetMotorSpeed::Excute()
|
|
|
|
|
{
|
|
|
|
|
if(gLogMgr->IsDebuging())//<2F><><EFBFBD><EFBFBD>״ֻ̬<CCAC><D6BB>ʱ
|
|
|
|
|
{
|
|
|
|
|
Sleep(gLogMgr->GetDebugCmdDelay());
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(m_bSetMotorX)
|
|
|
|
|
{
|
|
|
|
|
CMotor &Motor = *(CMotor::GetMotor(MOTOR_X));
|
|
|
|
|
gMotionCard_PCI1245->SetMotorSpeed(Motor,m_SpeedType);
|
|
|
|
|
}
|
|
|
|
|
if(m_bSetMotorX2)
|
|
|
|
|
{
|
|
|
|
|
CMotor &Motor = *(CMotor::GetMotor(MOTOR_X2));
|
|
|
|
|
gMotionCard_PCI1245->SetMotorSpeed(Motor,m_SpeedType);
|
|
|
|
|
}
|
|
|
|
|
if(m_bSetMotorY)
|
|
|
|
|
{
|
|
|
|
|
CMotor &Motor = *(CMotor::GetMotor(MOTOR_Y));
|
|
|
|
|
gMotionCard_PCI1245->SetMotorSpeed(Motor,m_SpeedType);
|
|
|
|
|
}
|
|
|
|
|
if(m_bSetMotorZ)
|
|
|
|
|
{
|
|
|
|
|
CMotor &Motor = *(CMotor::GetMotor(MOTOR_Z));
|
|
|
|
|
gMotionCard_PCI1245->SetMotorSpeed(Motor,m_SpeedType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CWorkCmdSetMotorSpeed::WirteLog()
|
|
|
|
|
{
|
|
|
|
|
CString str1 = "[WorkCmd][MotorSpeed]";
|
|
|
|
|
gLogMgr->WriteDebugLog(str1);
|
|
|
|
|
}
|