|
|
#include "StdAfx.h"
|
|
|
#include "WorkCmdFactory.h"
|
|
|
#include <memory>
|
|
|
#include "CreaterMotorToMachineOrigin.h"
|
|
|
#include "CreaterMotorToOffsetPos.h"
|
|
|
#include "CreaterMotorCheckLimit.h"
|
|
|
#include "CreaterPciPortCheck.h"
|
|
|
#include "CreaterPciPortSwitch.h"
|
|
|
#include "CreaterDeviceParReset.h"
|
|
|
#include "CreaterCutFlow.h"
|
|
|
#include "CreaterPlatformMove.h"
|
|
|
#include "CreaterMarkFlow.h"
|
|
|
#include "CreaterCatchMarkFlow.h"
|
|
|
#include "CreaterCatchMark.h"
|
|
|
#include "CreaterMsg.h"
|
|
|
#include "CreaterWorkEnd.h"
|
|
|
#include "CreaterWorkStart.h"
|
|
|
|
|
|
|
|
|
//电机移动到机械原点(PAR1 (X/Y/Z))
|
|
|
#define CMD_MOTOR_TO_MACHINE_ORIGIN _T("CMD_MOTOR_TO_MACHINE_ORIGIN")
|
|
|
//电机移动到指定偏移点(PAR1 (X/Y/Z))
|
|
|
#define CMD_MOTOR_TO_OFFSET_POS _T("CMD_MOTOR_TO_OFFSET_POS")
|
|
|
//设备参数复位
|
|
|
#define CMD_DEVICE_PAR_RESET _T("CMD_DEVICE_PAR_RESET")
|
|
|
//检查电机限位
|
|
|
#define CMD_MOTOR_CHECK_LIMIT _T("CMD_MOTOR_CHECK_LIMIT")
|
|
|
//检查PCI 卡端口状态(PAR1 (端口控制内容)) (PAR2 (要求开还是关TRUE/FALSE))(PAR3 (最大检测时间(ms)))
|
|
|
#define CMD_PCI_PORT_CHECK _T("CMD_PCI_PORT_CHECK")
|
|
|
//切换PCI 卡端口状态(PAR1 (端口控制内容)) (PAR2 (要求开还是关TRUE/FALSE))
|
|
|
#define CMD_PCI_PORT_SWITCH _T("CMD_PCI_PORT_SWITCH")
|
|
|
//平台移动(PAR1 (移动的方式))
|
|
|
#define CMD_PLATFORM_MOVE _T("CMD_PLATFORM_MOVE")
|
|
|
//创建切割流程(激光不动,平台移动的工作方式)
|
|
|
#define CMD_CUT_FLOW _T("CMD_CUT_FLOW")
|
|
|
//创建标刻流程
|
|
|
#define CMD_MARK_FLOW _T("CMD_MARK_FLOW")
|
|
|
//创建自动抓取定位点的流程
|
|
|
#define CMD_AUTO_CATCH_MARK_FLOW _T("CMD_AUTO_CATCH_MARK_FLOW")
|
|
|
//抓取定位点
|
|
|
#define CMD_CATCH_MARK _T("CMD_CATCH_MARK")
|
|
|
//提示消息 PAR1 (提示内容)
|
|
|
#define CMD_MSG _T("CMD_MSG")
|
|
|
//加工完成后的一些工作
|
|
|
#define CMD_WORK_END _T("CMD_WORK_END")
|
|
|
//加工开始前的一些工作
|
|
|
#define CMD_WORK_START _T("CMD_WORK_START")
|
|
|
//调整Z 轴焦距
|
|
|
#define CMD_ADJUST_FOCUS _T("CMD_ADJUST_FOCUS")
|
|
|
|
|
|
CWorkCmdFactory::CWorkCmdFactory(void)
|
|
|
{
|
|
|
}
|
|
|
CWorkCmdFactory::~CWorkCmdFactory(void)
|
|
|
{
|
|
|
}
|
|
|
//str 是命令行,指令结果保存到WorkCmdVec
|
|
|
void CWorkCmdFactory::Creat(const CString &str)
|
|
|
{
|
|
|
if(str.Find(_T("//")) != -1)//注释掉的指令
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
else if(str.Find(CMD_MOTOR_TO_MACHINE_ORIGIN) != -1)
|
|
|
{
|
|
|
auto_ptr<CCreaterWorkCmd> pCreater(new CCreaterMotorToMachineOrigin(str));
|
|
|
pCreater->Creat();
|
|
|
}
|
|
|
else if(str.Find(CMD_MOTOR_TO_OFFSET_POS) != -1)
|
|
|
{
|
|
|
auto_ptr<CCreaterWorkCmd> pCreater(new CCreaterMotorToOffsetPos(str));
|
|
|
pCreater->Creat();
|
|
|
}
|
|
|
else if(str.Find(CMD_MOTOR_CHECK_LIMIT) != -1)
|
|
|
{
|
|
|
auto_ptr<CCreaterWorkCmd> pCreater(new CCreaterMotorCheckLimit(str));
|
|
|
pCreater->Creat();
|
|
|
}
|
|
|
else if(str.Find(CMD_PCI_PORT_CHECK) != -1)
|
|
|
{
|
|
|
auto_ptr<CCreaterWorkCmd> pCreater(new CCreaterPciPortCheck(str));
|
|
|
pCreater->Creat();
|
|
|
}
|
|
|
else if(str.Find(CMD_PCI_PORT_SWITCH) != -1)
|
|
|
{
|
|
|
auto_ptr<CCreaterWorkCmd> pCreater(new CCreaterPciPortSwitch(str));
|
|
|
pCreater->Creat();
|
|
|
}
|
|
|
else if(str.Find(CMD_DEVICE_PAR_RESET) != -1)
|
|
|
{
|
|
|
auto_ptr<CCreaterWorkCmd> pCreater(new CCreaterDeviceParReset(str));
|
|
|
pCreater->Creat();
|
|
|
}
|
|
|
else if(str.Find(CMD_PLATFORM_MOVE) != -1)
|
|
|
{
|
|
|
auto_ptr<CCreaterWorkCmd> pCreater(new CCreaterPlatformMove(str));
|
|
|
pCreater->Creat();
|
|
|
}
|
|
|
else if(str.Find(CMD_CUT_FLOW) != -1)
|
|
|
{
|
|
|
auto_ptr<CCreaterWorkCmd> pCreater(new CCreaterCutFlow(str));
|
|
|
pCreater->Creat();
|
|
|
}
|
|
|
else if(str.Find(CMD_MARK_FLOW) != -1)
|
|
|
{
|
|
|
auto_ptr<CCreaterMarkFlow> pCreater(new CCreaterMarkFlow(str));
|
|
|
pCreater->Creat();
|
|
|
}
|
|
|
else if(str.Find(CMD_AUTO_CATCH_MARK_FLOW) != -1)
|
|
|
{
|
|
|
auto_ptr<CCreaterCatchMarkFlow> pCreater(new CCreaterCatchMarkFlow(str));
|
|
|
pCreater->Creat();
|
|
|
}
|
|
|
else if(str.Find(CMD_CATCH_MARK) != -1)
|
|
|
{
|
|
|
auto_ptr<CCreaterCatchMark> pCreater(new CCreaterCatchMark(str));
|
|
|
pCreater->Creat();
|
|
|
}
|
|
|
else if(str.Find(CMD_MSG) != -1)
|
|
|
{
|
|
|
auto_ptr<CCreaterMsg> pCreater(new CCreaterMsg(str));
|
|
|
pCreater->Creat();
|
|
|
}
|
|
|
else if(str.Find(CMD_WORK_END) != -1)
|
|
|
{
|
|
|
auto_ptr<CCreaterWorkEnd> pCreater(new CCreaterWorkEnd(str));
|
|
|
pCreater->Creat();
|
|
|
}
|
|
|
else if(str.Find(CMD_WORK_START) != -1)
|
|
|
{
|
|
|
auto_ptr<CCreaterWorkStart> pCreater(new CCreaterWorkStart(str));
|
|
|
pCreater->Creat();
|
|
|
}
|
|
|
}
|