Files
newspark110/device/control/acs/buffercode/rmcposswitchcode.cpp
Chenwenxuan edac2715f0 init
2024-03-06 14:54:30 +08:00

60 lines
1.5 KiB
C++

#include "rmcposswitchcode.h"
RMCPosSwitchCode::RMCPosSwitchCode()
{
}
QString RMCPosSwitchCode::getCode()
{
QString code("\n");
code +=
QString("VEL(ZA) = %1\n").arg(ZAAxisToSafePosVel)+
QString("ACC(ZA) = %1\n").arg(ZAAxisToSafePosVel*10)+
QString("DEC(ZA) = %1\n").arg(ZAAxisToSafePosVel*10)+
QString("JERK(ZA) = %1\n").arg(ZAAxisToSafePosVel*100)+
QString("KDEC(ZA) = %1\n").arg(ZAAxisToSafePosVel*100)+
"ENABLE ZA\n"+
QString("PTP/e ZA,%1\n").arg(ZAAxisSafePos)+
QString("VEL(X) = %1\n").arg(XAxisVel)+
QString("ACC(X) = %1\n").arg(XAxisVel*10)+
QString("DEC(X) = %1\n").arg(XAxisVel*10)+
QString("JERK(X) = %1\n").arg(XAxisVel*100)+
QString("KDEC(X) = %1\n").arg(XAxisVel*100)+
QString("VEL(Y) = %1\n").arg(YAxisVel)+
QString("ACC(Y) = %1\n").arg(YAxisVel*10)+
QString("DEC(Y) = %1\n").arg(YAxisVel*10)+
QString("JERK(Y) = %1\n").arg(YAxisVel*100)+
QString("KDEC(Y) = %1\n").arg(YAxisVel*100)+
"ENABLE (X,Y)\n"+
QString("PTP/er (X,Y),%1,%2\n").arg(XAxisTgPos).arg(YAxisTgPos)+
"runF = 1\n"
"STOP";
return code;
}
void RMCPosSwitchCode::setTargetPos(double XPos,double YPos)
{
XAxisTgPos=XPos;
YAxisTgPos=YPos;
}
void RMCPosSwitchCode::setZAAxisSafePos(double value)
{
ZAAxisSafePos = value;
}
void RMCPosSwitchCode::setZAAxisToSafePosVel(double value)
{
ZAAxisToSafePosVel = value;
}
void RMCPosSwitchCode::setXYAxisVel(double XVel,double YVel)
{
XAxisVel = XVel;
YAxisVel = YVel;
}