mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-28 03:09:24 +08:00
实现系统总览页面数据接口
This commit is contained in:
@@ -722,4 +722,77 @@ QVariantList MyWebHandler::getDeviceInfo(const QVariantList& types)
|
||||
result << row;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QVariantMap MyWebHandler::getEnvironmentInfo()
|
||||
{
|
||||
QVariantMap result;
|
||||
result["illumination"] = 30.2;
|
||||
result["windspeed"] = 2.6;
|
||||
result["temperature"] = 27.8;
|
||||
result["humidity"] = 36.9;
|
||||
return result;
|
||||
}
|
||||
|
||||
QVariantMap MyWebHandler::getFireInfo()
|
||||
{
|
||||
QVariantMap result;
|
||||
|
||||
// 多个消防点位的信息
|
||||
//感烟探测器 Smoke detector
|
||||
//感温探测器 Heat detector
|
||||
//火焰探测器 Flame detector
|
||||
|
||||
QVariantList list;
|
||||
for (int i = 0; i<7; i++)
|
||||
{
|
||||
QVariantMap item;
|
||||
item["pos"] = 1;
|
||||
item["status"] = 0;
|
||||
list << item;
|
||||
}
|
||||
result["data"] = list;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 获取累计统计数据
|
||||
QVariantMap MyWebHandler::getStatisticTotal()
|
||||
{
|
||||
QVariantMap result;
|
||||
|
||||
// 查询数据库获取累计统计数据
|
||||
|
||||
result["elect_gen"] = 153.8; // 累计发电量
|
||||
result["elect_in"] = 130.2; // 累计入网电量
|
||||
result["elect_charge"] = 0.0; // 累计充电电量
|
||||
result["income_elect"] = 100.0; // 累计发电收益
|
||||
result["income_charge"] = 100.0; // 累计充电收益
|
||||
result["ccers"] = 100.0; // 累计碳减排量
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 获取按天统计数据
|
||||
QVariantList MyWebHandler::getStatisticDay(const QString& startDate, int nday)
|
||||
{
|
||||
QVariantList result;
|
||||
|
||||
// 查询数据库获取累计统计数据
|
||||
for (int i=1; i<=7; i++)
|
||||
{
|
||||
QVariantMap row;
|
||||
row["dt"] = "";
|
||||
row["elect_gen_solar"] = float(i);
|
||||
row["elect_in_solar"] = float(i);
|
||||
row["income_solar"] = float(i);
|
||||
row["elect_store"] = float(i);
|
||||
row["elect_discharge"] = float(i);
|
||||
row["elect_load"] = float(i);
|
||||
row["elect_charge"] = float(i);
|
||||
row["num_charge"] = float(i);
|
||||
row["income_charge"] = float(i);
|
||||
result << row;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user