[WEB]1.修改首页场站图标显示颜色不正确的问题,2.修改运行监控页面储能系统的运行模式和预制舱参数在页面切换时数据不显示问题

This commit is contained in:
lixiaoyuan
2025-10-09 18:37:18 +08:00
parent 272154c06a
commit 0975ea52d4
25 changed files with 2377 additions and 135 deletions

View File

@@ -453,8 +453,14 @@ static void JSONReadArrayItem(njson& json, int i, int& v)
}
}
void Station::readGatewayMode(int mode, string p1, string p2, string p3)
void Station::readGatewayMode(int deviceNo, int mode, string p1, string p2, string p3)
{
auto device = this->getDeviceByType(int(EDeviceType::GATEWAY), Utils::toStr(deviceNo));
if (device)
{
device->online = true;
device->ts = Utils::time();
}
this->gatewayParam.mode = mode;
this->gatewayParam.param1 = p1;
this->gatewayParam.param2 = p2;
@@ -464,7 +470,6 @@ void Station::readGatewayMode(int mode, string p1, string p2, string p3)
//this->setGarewayWorkMode();
}
njson json;
if (JSON::parse(gatewayParam.param3, json))
{
@@ -481,8 +486,15 @@ void Station::readGatewayMode(int mode, string p1, string p2, string p3)
}
}
void Station::readGatewayStatus(int cdzStatus, int emuStatus)
void Station::readGatewayStatus(int deviceNo, int cdzStatus, int emuStatus)
{
auto device = this->getDeviceByType(int(EDeviceType::GATEWAY), Utils::toStr(deviceNo));
if (device)
{
device->online = true;
device->ts = Utils::time();
}
//充电桩 1在线0离线
if (cdzStatus >= 0)
{
@@ -567,6 +579,7 @@ void Station::writeStatistic()
int64_t tDate = Utils::date();
int64_t tDelta = tTime - tDate;
int npos = (tTime-tDate) / 600;
int tOffset = tDelta % 600;
for (auto iter = mapDevice.begin(); iter!=mapDevice.end(); ++iter)
{
@@ -655,7 +668,14 @@ void Station::writeStatistic()
}
}
{
int pos = npos;
if (tOffset > 20) { pos += 1; }
mapCacheElectIn[pos] = statData.dayElectIn;
mapCacheElectOut[pos] = statData.dayElectOut;
mapCacheElectCharger[pos] = 0;
// 预测数据源记录
dao->setTableName("predict_day");
@@ -663,15 +683,15 @@ void Station::writeStatistic()
fields.set("dt", dt);
fields.set("station_id", stationId);
fields.set("datatype", 1); // 1储能充电2储能放电3充电桩充电4发电
fields.set("value", MapValueToJson(npos, mapCacheElectIn));
fields.set("value", MapValueToJson(pos, mapCacheElectIn));
dao->duplicateUpdate(fields, {"value"});
fields.set("datatype", 2); // 1储能充电2储能放电3充电桩充电4发电
fields.set("value", MapValueToJson(npos, mapCacheElectOut));
fields.set("value", MapValueToJson(pos, mapCacheElectOut));
dao->duplicateUpdate(fields, {"value"});
fields.set("datatype", 3); // 1储能充电2储能放电3充电桩充电4发电
fields.set("value", MapValueToJson(npos, mapCacheElectCharger));
fields.set("value", MapValueToJson(pos, mapCacheElectCharger));
dao->duplicateUpdate(fields, {"value"});
}
}