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.

38 lines
1.2 KiB
C++

#pragma once
#include "GlobalDefine.h"
#include "LogMgr.h"
//每个区域代表平台移动的点,并存储了实际的工作数据
//command 模式
class CWorkCmd
{
public:
CWorkCmd(void);
virtual ~CWorkCmd(void);//BUG 2015-12-21
virtual bool Excute()=0;
virtual void WirteLog(){};
virtual CString GetWorkCmdInfoStr(){return "";};
public:
void CanNotCancel(){m_bCancel = false;};//不能被取消
bool Work(bool Cancel);
void SetFrontDelay(int t){m_FrontDelay = t;};
void SetAfterDelay(int t){m_AfterDelay = t;};
bool IsbShowLog(){return m_bShowLog;};
void NotShowLog(){m_bShowLog = false;};
void UseSleepDelay(){m_bUseSleepDelay = true;};
bool IsbExcuted(){return m_bExcuted;};
void SetbExcuting(bool b){m_bExcuting = b;};
bool IsbExcuting(){return m_bExcuting;};
protected:
int m_FrontDelay;//指令执行之前的延时(单位: 毫秒)
int m_AfterDelay;//指令执行之后的延时(单位: 毫秒)
bool m_bCancel;//指令是否可以取消(在中途停止指令的执行后,有的指令还是需要执行)
bool m_bShowLog;//是否输出日志
bool m_bUseSleepDelay;//使用sleep 进行延时
bool m_bExcuted;//是否已经被执行
bool m_bExcuting;//正在被执行
};