2025-05-19 09:54:33 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include <thread>
|
|
|
|
|
|
|
2025-08-20 19:00:22 +08:00
|
|
|
|
#include "common/Logger.h"
|
2025-05-19 09:54:33 +08:00
|
|
|
|
#include "Operator.h"
|
2025-08-20 19:00:22 +08:00
|
|
|
|
#include "app/AppData.h"
|
2025-07-31 17:56:08 +08:00
|
|
|
|
|
2025-05-19 09:54:33 +08:00
|
|
|
|
class Application
|
|
|
|
|
|
{
|
|
|
|
|
|
public:
|
|
|
|
|
|
static Application& instance()
|
|
|
|
|
|
{
|
|
|
|
|
|
static Application app;
|
|
|
|
|
|
return app;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void init();
|
2025-07-18 09:08:09 +08:00
|
|
|
|
|
2025-08-20 19:00:22 +08:00
|
|
|
|
AppData& getAppData();
|
|
|
|
|
|
|
2025-05-19 09:54:33 +08:00
|
|
|
|
bool isQuit() { return isQuit_; }
|
|
|
|
|
|
Operator& getOperator() { return op_; }
|
|
|
|
|
|
|
|
|
|
|
|
void runThreadMain();
|
|
|
|
|
|
|
2025-07-18 09:08:09 +08:00
|
|
|
|
void runThreadDevice();
|
|
|
|
|
|
|
2025-08-20 19:00:22 +08:00
|
|
|
|
public:
|
2025-05-19 09:54:33 +08:00
|
|
|
|
bool isQuit_ = false;
|
|
|
|
|
|
|
|
|
|
|
|
// 登录的管理员信息
|
|
|
|
|
|
Operator op_;
|
2025-08-20 19:00:22 +08:00
|
|
|
|
|
|
|
|
|
|
// 应用数据
|
|
|
|
|
|
AppData appdata_;
|
2025-05-19 09:54:33 +08:00
|
|
|
|
};
|