135 lines
2.5 KiB
C++
135 lines
2.5 KiB
C++
#pragma once
|
|
#include <string>
|
|
#include <vector>
|
|
#include <windows.h>
|
|
//#include "../Job/JobController.h"
|
|
#include "../Communication/BaseData.h"
|
|
using namespace std;
|
|
|
|
|
|
enum FUNCNAME {
|
|
BEGINWORK = 0,
|
|
PAUSEWORK,
|
|
PAUSEAUTO,
|
|
STOPWORK,
|
|
STOPREDTEST,
|
|
TESTLAYER,
|
|
REMOVESCANNER,
|
|
STARTHEATINGMOTION,
|
|
STOPHEATINGMOTION,
|
|
};
|
|
|
|
struct BaseCtrlState{
|
|
bool IsStart;
|
|
bool IsPause;
|
|
bool IsStop;
|
|
bool IsStandBy;
|
|
bool IsFinish;
|
|
bool IsPrePrint;
|
|
bool IsPauseStanBy;
|
|
bool IsHeatingScanner;
|
|
int State;
|
|
int PreState;
|
|
int PauseState;
|
|
};
|
|
|
|
|
|
class BaseCtrl
|
|
{
|
|
public:
|
|
enum PrintState
|
|
{
|
|
STANDBY = 0, //就绪
|
|
STANDBY_PAUSE, //暂停后就绪
|
|
STANDBY_STOP, //停止后就绪
|
|
PREPRINT, //打印前准备
|
|
PRINTING, //打印中
|
|
FINISH, //打印完成
|
|
PAUSE, //暂停
|
|
STOP //停止
|
|
};
|
|
|
|
enum PreRunState {
|
|
NonePre = 0,
|
|
CheckIO,
|
|
Purifying,
|
|
Dedusting,
|
|
WaitConfirm,
|
|
CancelConfirm,
|
|
SummitConfirm,
|
|
AutoHeatingScanner,
|
|
PreFinished,
|
|
};
|
|
|
|
enum PauseState {
|
|
NoPause = 0,
|
|
ManualPause,
|
|
PrintRestPause,
|
|
AlarmPause,
|
|
AlarmAutoPause
|
|
};
|
|
|
|
BaseCtrl() {}
|
|
virtual ~BaseCtrl() {}
|
|
|
|
public:
|
|
static void SInit();
|
|
static void SUninit();
|
|
|
|
virtual bool Init() = 0;
|
|
|
|
virtual bool BeginWork() = 0;
|
|
virtual bool PauseWork()=0;
|
|
virtual bool StopWork()=0;
|
|
virtual void ModelScan(int partId, string scanType, float power, float speed) {}
|
|
|
|
//static PrintState GetState();
|
|
//static PreRunState GetPreState();
|
|
//static PauseState GetPauseState();
|
|
|
|
//static void SetPauseState(PauseState ps);
|
|
//static void SetState(PrintState ps);
|
|
//static void SetPreState(PreRunState rs);
|
|
//static void SetStandBy();
|
|
//static void SetFinish();
|
|
|
|
//static bool IsStart();
|
|
//static bool IsPause();
|
|
//static bool IsStop();
|
|
//static bool IsStandBy();
|
|
//static bool IsFinish();
|
|
//static bool IsPrePrint();
|
|
//static bool IsPauseStanBy();
|
|
//static bool IsHeatingScanner();
|
|
|
|
|
|
static bool m_IsStart;
|
|
static bool m_IsPause;
|
|
static bool m_IsStop;
|
|
static bool m_IsStandBy;
|
|
static bool m_IsFinish;
|
|
static bool m_IsPrePrint;
|
|
static bool m_IsPauseStanBy;
|
|
static bool m_IsHeatingScanner;
|
|
static int m_State;
|
|
static int m_PreState;
|
|
static int m_PauseState;
|
|
|
|
|
|
//void SetJobController(JobController* job_controller);
|
|
|
|
static BaseCtrlState GetState();
|
|
static void UpdateState(const ReadData& rd);
|
|
|
|
protected:
|
|
//JobController* m_job_controller;
|
|
static vector<string> m_InitErrorInfos;
|
|
|
|
|
|
private:
|
|
//static PrintState m_print_state;
|
|
//static PreRunState m_PreRunState;
|
|
//static PauseState m_PauseState;
|
|
static CRITICAL_SECTION m_CS;
|
|
};
|