hlp:状态机初版,统一管理回收槽状态,启动和停止打印时的状态
This commit is contained in:
+10
-6
@@ -284,18 +284,17 @@ private:
|
||||
bool gearPumpStartFlag = false;
|
||||
|
||||
|
||||
// 状态机
|
||||
// ===================状态机====================
|
||||
PrinterStateManager* m_stateManager = nullptr;
|
||||
// 测试定时器
|
||||
QTimer* m_testTimer = nullptr;
|
||||
int m_testStep = 0;
|
||||
private:
|
||||
void initStateManager();
|
||||
void initStateTimer();
|
||||
// 不同状态的处理
|
||||
// 自检
|
||||
void handleSelfCheck();
|
||||
|
||||
// 自检完成
|
||||
void handleToReady();
|
||||
|
||||
// 就绪
|
||||
void handleReady();
|
||||
|
||||
@@ -306,7 +305,12 @@ private:
|
||||
// 关机
|
||||
void handlePowerOff();
|
||||
private slots:
|
||||
void slt_stateTest();
|
||||
// 切换状态
|
||||
void slt_stateChanged(PrinterState newState, PrinterState oldState, QString reason);
|
||||
|
||||
// 使能开始打印、停止打印、开回收槽、关回收槽按钮
|
||||
void slt_enableStartPrint(bool);
|
||||
void slt_enableStopPrint(bool);
|
||||
void slt_enableOpenTank(bool);
|
||||
void slt_enableCloseTank(bool);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user