Files
energy_storage/src/app/Application.h

42 lines
606 B
C
Raw Normal View History

2025-05-19 09:54:33 +08:00
#pragma once
#include <thread>
#include "Operator.h"
#include "app/AppData.h"
class MqttClient;
2025-05-19 09:54:33 +08:00
class Application
{
public:
static Application& instance()
{
static Application app;
return app;
}
static AppData& data()
{
return Application::instance().appdata;
}
2025-05-19 09:54:33 +08:00
void init();
Operator& getOperator() { return op; }
2025-05-19 09:54:33 +08:00
void runThreadMain();
void runThreadDevice();
public:
bool isQuit = false;
2025-05-19 09:54:33 +08:00
// 登录的管理员信息
Operator op;
// 应用数据
AppData appdata;
std::shared_ptr<MqttClient> mqttCli;
2025-05-19 09:54:33 +08:00
};