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.
50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#include "StdAfx.h"
|
|
#include "CreaterWorkCmd.h"
|
|
#include "MarkAreaMgr.h"
|
|
#include "ExceptionMsg.h"
|
|
#include "CStringFuc.h"
|
|
|
|
CCreaterWorkCmd::CCreaterWorkCmd(const CString &str)
|
|
:m_CreatStr(str)
|
|
{
|
|
}
|
|
CCreaterWorkCmd::~CCreaterWorkCmd(void)
|
|
{
|
|
}
|
|
//提取指令的参数(idx 表示第几个参数)
|
|
CString CCreaterWorkCmd::GetPar(int idx)
|
|
{
|
|
CString Ret;//结果
|
|
CString StrPar;
|
|
StrPar.Format(_T("Par%d"),idx);
|
|
|
|
//先找到ParX 的位置
|
|
int StrParPos = m_CreatStr.Find(StrPar);
|
|
if(StrParPos != -1)
|
|
{
|
|
int Start = m_CreatStr.Find(_T("["),StrParPos);//左括号的位置
|
|
int End = m_CreatStr.Find(_T("]"),StrParPos);//右括号的位置
|
|
if(Start != -1 && End != -1 && Start<End)
|
|
{
|
|
Ret = m_CreatStr.Mid((Start+1),(End-Start-1));
|
|
}
|
|
}
|
|
return Ret;
|
|
}
|
|
//添加指令
|
|
void CCreaterWorkCmd::AddCmd(CWorkCmd *p)
|
|
{
|
|
CString DelayStr = GetPar(0);//延时
|
|
if(DelayStr != "")
|
|
{
|
|
int delay = CStringToInt(DelayStr);
|
|
p->SetAfterDelay(delay);
|
|
}
|
|
CWorkCmdContainer &CmdContainer = CWorkCmdContainer::GetInstance();
|
|
CmdContainer.AddCmd(p);
|
|
}
|
|
//搜集工作数据
|
|
void CCreaterWorkCmd::CollectWorkData(bool bNeedSel)
|
|
{
|
|
|
|
} |