mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
添加Openssl,Gmssl加密库
This commit is contained in:
@@ -241,16 +241,16 @@ bool Device::cache(int npos)
|
||||
if (iter != s_mapDeviceAddrCurve.end())
|
||||
{
|
||||
auto& vecAddr = iter->second;
|
||||
auto size = addrV.size();
|
||||
auto size = vecAddr.size();
|
||||
if (size >= 1) { addrV = vecAddr[0]; }
|
||||
else if (size >= 2) { addrI = vecAddr[1]; }
|
||||
else if (size >= 3) { addrP = vecAddr[2]; }
|
||||
if (size >= 2) { addrI = vecAddr[1]; }
|
||||
if (size >= 3) { addrP = vecAddr[2]; }
|
||||
}
|
||||
|
||||
// 根据设备类型从参数(寄存器地址)中读取实时数据进行保存
|
||||
int U = Utils::toInt(this->getParam(addrV, "0"));
|
||||
int I = Utils::toInt(this->getParam(addrI, "0"));
|
||||
int P = addrP.empty() ? U*I : Utils::toInt(this->getParam(addrP, "0"));
|
||||
int P = addrP.empty() ? U*I*0.001 : Utils::toInt(this->getParam(addrP, "0"));
|
||||
mapCacheVoltage[npos] = U;
|
||||
mapCacheCurrent[npos] = I;
|
||||
mapCachePower[npos] = P;
|
||||
@@ -299,33 +299,33 @@ void Device::setParam(std::string k, int v)
|
||||
{
|
||||
running = 1;
|
||||
}
|
||||
else if (type == 101) // EMS
|
||||
else if (type == int(EDeviceType::EMS)) // 101 EMS
|
||||
{
|
||||
running = 1;
|
||||
}
|
||||
else if (type == 102) // PCS
|
||||
else if (type == int(EDeviceType::PCS)) // 102 PCS
|
||||
{
|
||||
if (k == "0x1003") err = v; // 故障状态 R uint16 1故障,0正常 0 0x1003
|
||||
else if (k == "0x1005") online = v; // 设备在线 R uint16 1在线,0无效 1 0x1005
|
||||
else if (k == "0x1009") running = (v==1 || v==2); //充放状态 R uint16 0:待机, 1:充电, 2:放电, 3:搁置 0 0x1009
|
||||
}
|
||||
else if (type == 103) // PCU
|
||||
else if (type == int(EDeviceType::PCU)) // 103 PCU
|
||||
{
|
||||
if (k == "0x1002") err = v; //故障状态 R uint16 1故障,0正常 0 0x1002
|
||||
else if (k == "0x1004") online = v; //设备在线 R uint16 1在线,0无效 1 0x1004
|
||||
else if (k == "0x1006") running = v; //启停状态 R uint16 1开机,0关机 1 0x1006
|
||||
}
|
||||
else if (type == 104) // BMS
|
||||
else if (type == int(EDeviceType::BMS)) // 104 BMS
|
||||
{
|
||||
if (k == "0x004A") { err = (v==1); } //运行状态 R uint16 0 运行状态 0-正常 1-告警 2-保护 0x004A
|
||||
else if (k == "0x004B") running = (v==1 || v==2); //充放电状态 R uint16 0 0-待机 1-充电 2-放电 0x004B
|
||||
if (k == "0x0049") { err = (v==1); } //运行状态 R uint16 0 运行状态 0-正常 1-告警 2-保护 0x0049
|
||||
else if (k == "0x004A") { running = (v==1 || v==2); } //充放电状态 R uint16 0 0-待机 1-充电 2-放电 0x004A
|
||||
}
|
||||
else if (type == int(EDeviceType::BCU)) // BCU
|
||||
{
|
||||
if (k == "0xA003") { running = (v==0x33 || v==0x44); } //蓄电池充放电状态 R uint16 "0x11开路,0x22待机,0x33充电,0x44放电" 34 0xA003
|
||||
else if (k == "0xA004") { err = (v==0x55); } //电池组运行状态 R uint16 "0x11跳机,0x22待机,0x33放空,0x44充满,0x55预警,0x66正常" 102 0xA004
|
||||
}
|
||||
else if (type == 106) // 充电桩
|
||||
else if (type == int(EDeviceType::CHARGER)) // 106 充电桩
|
||||
{
|
||||
if (k == "21") {
|
||||
running = (mapParams["11"] == "充电" || mapParams["21"] == "充电"); // 充电状态: 0:空闲,1:充电
|
||||
|
||||
Reference in New Issue
Block a user