#include "StdAfx.h" #include "CreaterPlatformMove.h" #include "WorkCmdPciPortCheck.h" #include "GlobalFunction.h" #include "WorkCmdMovePlatformXY.h" //移动到原点 #define TO_ORIGIN _T("TO_ORIGIN") //移动到取料点 #define TO_WORK_PT _T("TO_WORK_PT") CCreaterPlatformMove::CCreaterPlatformMove(const CString &str) :CCreaterWorkCmd(str) { } CCreaterPlatformMove::~CCreaterPlatformMove(void) { } void CCreaterPlatformMove::Creat() { //参数1 表示端口控制的内容 CString MoveMode = GetPar(1); if(MoveMode == TO_ORIGIN)//返回工作原点 { CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY(); Dbxy MovePt; Dbxy TargetPt; #ifdef __PROGRAM_SHILAN_TUIHUO__ pCmd->SetMoveOrder(2);//Y 轴先动 #endif pCmd->MoveToTargetPt(MovePt,TargetPt); AddCmd(pCmd); } else if(MoveMode == TO_WORK_PT)//取料点 { CWorkCmdMovePlatformXY *pCmd = new CWorkCmdMovePlatformXY(); Dbxy MovePt; Dbxy TargetPt(gPlatformXY->GetProductPoint()); #ifdef __LPS_IS3000__ pCmd->SetMoveOrder(2);//X 轴先动 #endif pCmd->MoveToTargetPt(MovePt,TargetPt); AddCmd(pCmd); } }