mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-28 03:09:24 +08:00
搭建PVB架构,实现前端的基础布局、菜单、表格、图示等功能
This commit is contained in:
48
src/app/AppData.h
Normal file
48
src/app/AppData.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
|
||||
class Station;
|
||||
class Device;
|
||||
|
||||
class AppData
|
||||
{
|
||||
public:
|
||||
std::shared_ptr<Station> getStation(int stationId);
|
||||
|
||||
std::shared_ptr<Station> getStationByName(std::string name);
|
||||
|
||||
void getStationNames(std::vector<std::string>& vecNames);
|
||||
|
||||
std::shared_ptr<Device> getDevice(int stationId, int deviceId);
|
||||
|
||||
// 读取统计数据: 今日统计数据,累计统计数据
|
||||
void loadStatData();
|
||||
|
||||
|
||||
public:
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// === 系统 ===
|
||||
int64_t sysActivationTime {};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// === 数据库 ===
|
||||
struct {
|
||||
std::string host;
|
||||
int port;
|
||||
std::string user;
|
||||
std::string passwd;
|
||||
} db;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// === 场站信息 ===
|
||||
std::unordered_map<int, std::shared_ptr<Station>> mapStation;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// === 角色定义 ===
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user