mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
完成系统管理web端功能,实现系统管理服务端接口,实现登录功能
This commit is contained in:
@@ -1,7 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
#include <common/DataFields.h>
|
||||
|
||||
class CommEntity;
|
||||
|
||||
class DeviceEntity
|
||||
{
|
||||
public:
|
||||
int deviceId = -1;
|
||||
int type = -1;
|
||||
std::string name;
|
||||
std::string code;
|
||||
bool isOpen = false;
|
||||
std::string attrsJson = "";
|
||||
|
||||
|
||||
int err = 0;
|
||||
int online = 0;
|
||||
int status = 0;
|
||||
|
||||
|
||||
//std::map<std::string, std::string> mapAttrs;
|
||||
DataFields attrs;
|
||||
|
||||
// 通讯entity
|
||||
std::shared_ptr<CommEntity> commEntity;
|
||||
|
||||
//int getAttrInt(std::string key);
|
||||
//float getAttrFloat(std::string key);
|
||||
//double getAttrDouble(std::string key);
|
||||
//std::string getAttrStr(std::string key);
|
||||
|
||||
// 启动通讯
|
||||
int startComm();
|
||||
};
|
||||
|
||||
|
||||
class Device
|
||||
{
|
||||
public:
|
||||
static bool init();
|
||||
};
|
||||
static void add(DataFields& fields);
|
||||
|
||||
static std::vector<std::shared_ptr<DeviceEntity>> getDeviceByType(int type);
|
||||
|
||||
public:
|
||||
static std::map<int, std::shared_ptr<DeviceEntity>> mapDevices;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user