1.新增服务端UI界面,显示服务基础信息。2.修改设备显示配置。3.监控页面储能系统显示储能模式,模式设置新增'手动'

This commit is contained in:
lixiaoyuan
2025-09-25 19:20:25 +08:00
parent d7888c2be4
commit 8aba56f47d
39 changed files with 2954 additions and 408 deletions

View File

@@ -195,19 +195,17 @@ bool AppData::initFromDB()
auto station = this->getStation(stationId);
if (station)
{
station->storageIn = fields.get<double>(DMStatStation::STORAGE_ELECT_IN);
station->storageOut = fields.get<double>(DMStatStation::STORAGE_ELECT_OUT);
//station->storageIn = fields.get<double>(DMStatStation::STORAGE_ELECT_IN);
//station->storageOut = fields.get<double>(DMStatStation::STORAGE_ELECT_OUT);
//station->storageNumIn = fields.getFloat(DMStatStation::STORAGE_NUM);
//station->storageNumOut = fields.getFloat(DMStatStation::STORAGE_NUM);
station->storageNumErr = fields.get<int>(DMStatStation::STORAGE_NUM_ERR);
station->solarGen = fields.get<double>(DMStatStation::SOLAR_ELECT_GEN);
station->solarGrid = fields.get<double>(DMStatStation::SOLAR_ELECT_GRID);
station->solarNumErr = fields.get<int>(DMStatStation::SOLAR_NUM_ERR);
station->chargeElect = fields.get<double>(DMStatStation::CHARGE_ELECT);
station->chargeNum = fields.get<int>(DMStatStation::CHARGE_NUM);
station->chargeNumErr = fields.get<int>(DMStatStation::CHARGE_NUM_ERR);
//station->storageNumErr = fields.get<int>(DMStatStation::STORAGE_NUM_ERR);
//station->solarGen = fields.get<double>(DMStatStation::SOLAR_ELECT_GEN);
//station->solarGrid = fields.get<double>(DMStatStation::SOLAR_ELECT_GRID);
//station->solarNumErr = fields.get<int>(DMStatStation::SOLAR_NUM_ERR);
//station->chargeElect = fields.get<double>(DMStatStation::CHARGE_ELECT);
//station->chargeNum = fields.get<int>(DMStatStation::CHARGE_NUM);
//station->chargeNumErr = fields.get<int>(DMStatStation::CHARGE_NUM_ERR);
}
else
{
@@ -216,30 +214,38 @@ bool AppData::initFromDB()
}
}
{ // 初始化场站设备的历史监测数据
{ // 初始化场站设备的历史监测数据(当天)
vector<Fields> result;
DAO::queryRuntimeData(dao, Utils::dateStr(), result);
DAO::queryRuntimeDataHistory(dao, Utils::dateStr(), result);
for (auto& item : result)
{
int stationId = item.get<int>("station_id");
int deviceId = item.get<int>("device_id");
int datatype = item.get<int>("datatype");
auto device = this->getDevice(stationId, deviceId);
if (device)
{
int datatype = item.get<int>("datatype");
std::string value = item.value("value");
njson json;
if (JSON::parse(value, json))
{
std::vector<double> vecVal(json.size());
for (int i=0; i<json.size(); ++i)
{
vecVal[i] = JSON::get<double>(json[i]);
}
device->setCache(datatype, vecVal);
}
std::vector<float> vd;
JSON::parseArray(value, vd);
device->setCache(datatype, vd);
}
}
}
{ // 初始化预测数据源的历史数据(当天)
vector<Fields> result;
DAO::queryPredictHistory(dao, Utils::dateStr(), result);
for (auto& item : result)
{
int stationId = item.get<int>("station_id");
int datatype = item.get<int>("datatype");
auto station = this->getStation(stationId);
if (station)
{
std::string value = item.value("value");
std::vector<float> vd;
JSON::parseArray(value, vd);
station->setCache(datatype, vd);
}
}
}