mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
[WEB]1.修改首页场站图标显示颜色不正确的问题,2.修改运行监控页面储能系统的运行模式和预制舱参数在页面切换时数据不显示问题
This commit is contained in:
@@ -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"});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user