mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
42 lines
606 B
C++
42 lines
606 B
C++
#pragma once
|
|
|
|
#include <thread>
|
|
|
|
#include "Operator.h"
|
|
#include "app/AppData.h"
|
|
|
|
class MqttClient;
|
|
|
|
class Application
|
|
{
|
|
public:
|
|
static Application& instance()
|
|
{
|
|
static Application app;
|
|
return app;
|
|
}
|
|
|
|
static AppData& data()
|
|
{
|
|
return Application::instance().appdata;
|
|
}
|
|
|
|
void init();
|
|
|
|
Operator& getOperator() { return op; }
|
|
|
|
void runThreadMain();
|
|
|
|
void runThreadDevice();
|
|
|
|
public:
|
|
bool isQuit = false;
|
|
|
|
// 登录的管理员信息
|
|
Operator op;
|
|
|
|
// 应用数据
|
|
AppData appdata;
|
|
|
|
std::shared_ptr<MqttClient> mqttCli;
|
|
}; |