mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
现场调试问题修改;本地服务端从qt5升级到qt6
This commit is contained in:
@@ -712,7 +712,7 @@ void Station::predict()
|
||||
/// 预测实现方案:
|
||||
// 查询前7天的历史数据(不包含今天),根据历史数据计算今日数据,每10分钟一个数据,一天共144个数据点
|
||||
string sql = "SELECT * FROM predict_day pd WHERE pd.station_id='" + std::to_string(stationId)
|
||||
+ "' AND dt>='" + dt1 + " AND dt<'" + dt2 + "';";
|
||||
+ "' AND dt>='" + dt1 + "' AND dt<='" + dt2 + "';";
|
||||
|
||||
vector<Fields> result;
|
||||
DAO::exec(NULL, sql, result);
|
||||
@@ -741,7 +741,7 @@ void Station::predict()
|
||||
for (int i = 0; i<vdptr->size() && i<vec.size(); ++i)
|
||||
{
|
||||
auto& v0 = vec[i];
|
||||
if (v0 > 0)
|
||||
//if (v0 > 0)
|
||||
{
|
||||
(*vdptr)[i] += v0;
|
||||
if (datatype == 1) { countStorageIn[i]++; }
|
||||
@@ -759,4 +759,13 @@ void Station::predict()
|
||||
if (countCharge[i] > 0) { predictCharge[i] = predictCharge[i] / countCharge[i]; }
|
||||
}
|
||||
|
||||
//for (int i = 1; i < predictStorageIn.size(); ++i)
|
||||
//{
|
||||
// int v1 = predictStorageIn[i] - predictStorageIn[i - 1];
|
||||
// int v2 = predictStorageOut[i] - predictStorageOut[i - 1];
|
||||
// int v3 = predictCharge[i] - predictCharge[i - 1];
|
||||
// predictStorageIn[i] = v1 >=0 ? v1 : 0;
|
||||
// predictStorageOut[i] = v2 >= 0 ? v2 : 0;
|
||||
// predictCharge[i] = v3 >= 0 ? v3 : 0;
|
||||
//}
|
||||
}
|
||||
Reference in New Issue
Block a user