mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
修改MQTT通讯数据解析问题
This commit is contained in:
@@ -2,21 +2,57 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
enum class EAlertType
|
||||
{
|
||||
SYS = 1, // 系统告警
|
||||
USER = 2, // 用户告警
|
||||
DEVICE = 3, // 设备告警
|
||||
};
|
||||
|
||||
enum class EDeviceType
|
||||
{
|
||||
//1 变压器 0
|
||||
//2 配电柜 0
|
||||
//3 电表 1
|
||||
//4 门禁 0
|
||||
//5 空调 0
|
||||
//6 照明 0
|
||||
//7 消防 0
|
||||
//8 光照监测设备 0
|
||||
//9 风速监测设备 0
|
||||
//10 温湿度监测设备 0
|
||||
//11 烟感监测设备 0
|
||||
//12 水浸传感器 0
|
||||
//13 视频监控 4
|
||||
//14 冷机 0
|
||||
//15 网关 0
|
||||
//100 储能预制舱 1
|
||||
EMS = 101,//101 EMS 1
|
||||
PCS = 102, //102 PCS 1
|
||||
PCU = 103, //103 PCU 1
|
||||
BMS = 104, //104 BMS 1
|
||||
BCU = 105, //105 BCU 1
|
||||
//106 充电桩 2
|
||||
//107 充电枪 2
|
||||
//108 集中器 2
|
||||
//109 光伏板 3
|
||||
//110 风力发电机 3
|
||||
};
|
||||
|
||||
|
||||
struct RegAddrUnit
|
||||
{
|
||||
std::string key;
|
||||
std::string datatype;
|
||||
int bytes {0};
|
||||
std::string name;
|
||||
std::string remark;
|
||||
int ratio {1};
|
||||
int alert {0};
|
||||
|
||||
RegAddrUnit() {}
|
||||
RegAddrUnit(std::string key, std::string datatype, std::string remark)
|
||||
: key(key), datatype(datatype), remark(remark)
|
||||
RegAddrUnit(std::string key, std::string datatype, int alert, std::string name, std::string remark)
|
||||
: key(key), datatype(datatype), alert(alert), name(name), remark(remark)
|
||||
{
|
||||
if (datatype == "uint16" || datatype == "int16") { bytes = 1; }
|
||||
else if (datatype == "uint32" || datatype == "int32") { bytes = 2; }
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user