|
@@ -2315,20 +2315,10 @@ int DealGetResistData(const httplib::Request& req, const string token, char** js
|
|
|
yyjson_mut_obj_add_int(doc, obj, "val", show_val);
|
|
yyjson_mut_obj_add_int(doc, obj, "val", show_val);
|
|
|
if (pConvertLimit && pConvertLimit->enable && !sunroof)
|
|
if (pConvertLimit && pConvertLimit->enable && !sunroof)
|
|
|
{
|
|
{
|
|
|
- if (pInfo->out_name.find("¶¨°â·´") != -1)
|
|
|
|
|
- {
|
|
|
|
|
if (pConvertLimit->dw_alarm_low_limit < show_val)
|
|
if (pConvertLimit->dw_alarm_low_limit < show_val)
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
|
else if (pConvertLimit->dw_warn_low_limit < show_val)
|
|
else if (pConvertLimit->dw_warn_low_limit < show_val)
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- if (pConvertLimit->up_alarm_high_limit < show_val)
|
|
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
|
|
|
- else if (pConvertLimit->up_warn_high_limit < show_val)
|
|
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
if (curr_val < 0)
|
|
if (curr_val < 0)
|
|
|
yyjson_mut_obj_add_str(doc, obj, "position", "bottom");
|
|
yyjson_mut_obj_add_str(doc, obj, "position", "bottom");
|
|
@@ -2350,20 +2340,10 @@ int DealGetResistData(const httplib::Request& req, const string token, char** js
|
|
|
yyjson_mut_obj_add_int(doc, obj, "val", show_val);
|
|
yyjson_mut_obj_add_int(doc, obj, "val", show_val);
|
|
|
if (pConvertLimit && pConvertLimit->enable && !sunroof)
|
|
if (pConvertLimit && pConvertLimit->enable && !sunroof)
|
|
|
{
|
|
{
|
|
|
- if (pInfo->out_name.find("·´°â¶¨") != -1)
|
|
|
|
|
- {
|
|
|
|
|
- if (pConvertLimit->dw_alarm_low_limit < show_val)
|
|
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
|
|
|
- else if (pConvertLimit->dw_warn_low_limit < show_val)
|
|
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
if (pConvertLimit->up_alarm_high_limit < show_val)
|
|
if (pConvertLimit->up_alarm_high_limit < show_val)
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
|
else if (pConvertLimit->up_warn_high_limit < show_val)
|
|
else if (pConvertLimit->up_warn_high_limit < show_val)
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
if (curr_val < 0)
|
|
if (curr_val < 0)
|
|
|
yyjson_mut_obj_add_str(doc, obj, "position", "bottom");
|
|
yyjson_mut_obj_add_str(doc, obj, "position", "bottom");
|
|
@@ -3937,7 +3917,7 @@ int DealGetResistReport(const httplib::Request& req, const string token, char**
|
|
|
{
|
|
{
|
|
|
string strStation = UTF8toANSI(station);
|
|
string strStation = UTF8toANSI(station);
|
|
|
string table_name = fmt::format("rm_move_{:0>4}{:0>2}", odt.GetYear(), odt.GetMonth());
|
|
string table_name = fmt::format("rm_move_{:0>4}{:0>2}", odt.GetYear(), odt.GetMonth());
|
|
|
- CString sql = fmt::format("SELECT A.*,B.name FROM (SELECT mo, mp, posi, count(*) as num, max(show_val) as l, min(show_val) as s, sum(show_val) as sum, CASE WHEN posi = 3 OR posi = 4 THEN 3 WHEN [type] = 0 THEN 1 ELSE [type] END AS [newtype] FROM {} WHERE mo in (SELECT id FROM rm_mo WHERE up = '{}') AND show_time >= '{}' AND show_time <= '{}' GROUP BY mo, mp, posi, \
|
|
|
|
|
|
|
+ CString sql = fmt::format("SELECT A.*,B.name FROM (SELECT mo, mp,show_time,posi, count(*) as num, max(show_val) as l, min(show_val) as s, sum(show_val) as sum, CASE WHEN posi = 3 OR posi = 4 THEN 3 WHEN [type] = 0 THEN 1 ELSE [type] END AS [newtype] FROM {} WHERE mo in (SELECT id FROM rm_mo WHERE up = '{}') AND show_time >= '{}' AND show_time <= '{}' GROUP BY mo, mp,show_time, posi, \
|
|
|
CASE WHEN posi = 3 OR posi = 4 THEN 3 WHEN [type] = 0 THEN 1 ELSE [type] END ) AS A \
|
|
CASE WHEN posi = 3 OR posi = 4 THEN 3 WHEN [type] = 0 THEN 1 ELSE [type] END ) AS A \
|
|
|
LEFT JOIN rm_mo AS B ON A.mo = B.id order by TRY_CONVERT(INT, B.name)",
|
|
LEFT JOIN rm_mo AS B ON A.mo = B.id order by TRY_CONVERT(INT, B.name)",
|
|
|
table_name, strStation, odt.Format("%Y-%m-%d 00:00:00"), odt.Format("%Y-%m-%d 23:59:59.999")).c_str();
|
|
table_name, strStation, odt.Format("%Y-%m-%d 00:00:00"), odt.Format("%Y-%m-%d 23:59:59.999")).c_str();
|
|
@@ -4002,11 +3982,14 @@ int DealGetResistReport(const httplib::Request& req, const string token, char**
|
|
|
int num;
|
|
int num;
|
|
|
int max;
|
|
int max;
|
|
|
int min;
|
|
int min;
|
|
|
|
|
+ TIMESTAMP_STRUCT ts;
|
|
|
int64_t sum;
|
|
int64_t sum;
|
|
|
eDaoChaPosi posi;
|
|
eDaoChaPosi posi;
|
|
|
ePowerName pn;
|
|
ePowerName pn;
|
|
|
stmt.BindCharCol(nCol++, mo, sizeof(mo));
|
|
stmt.BindCharCol(nCol++, mo, sizeof(mo));
|
|
|
stmt.BindCharCol(nCol++, mp, sizeof(mp));
|
|
stmt.BindCharCol(nCol++, mp, sizeof(mp));
|
|
|
|
|
+ stmt.BindTimeStampCol(nCol++, &ts);
|
|
|
|
|
+
|
|
|
stmt.BindTinyIntCol(nCol++, (BYTE*)&posi);
|
|
stmt.BindTinyIntCol(nCol++, (BYTE*)&posi);
|
|
|
stmt.BindIntCol(nCol++, &num);
|
|
stmt.BindIntCol(nCol++, &num);
|
|
|
stmt.BindIntCol(nCol++, &max);
|
|
stmt.BindIntCol(nCol++, &max);
|
|
@@ -4027,6 +4010,8 @@ int DealGetResistReport(const httplib::Request& req, const string token, char**
|
|
|
it.mo_name = mo_name;
|
|
it.mo_name = mo_name;
|
|
|
it.mo = mo;
|
|
it.mo = mo;
|
|
|
it.mp = mp;
|
|
it.mp = mp;
|
|
|
|
|
+
|
|
|
|
|
+ boolean bSkylight = (ts.hour<4 || ts.hour>=23)?true:false;
|
|
|
eSuoBiPosi idx;
|
|
eSuoBiPosi idx;
|
|
|
switch (posi)
|
|
switch (posi)
|
|
|
{
|
|
{
|
|
@@ -4047,7 +4032,7 @@ int DealGetResistReport(const httplib::Request& req, const string token, char**
|
|
|
|
|
|
|
|
idx = eSuoBiPosi::SB_FIX;
|
|
idx = eSuoBiPosi::SB_FIX;
|
|
|
pInfo = (SUOBI_OVER_LIMIT_INFO*)CResistAlarmMng::Instance()->Find(mo, mp, (uint8_t)idx, eZL_ALARMTYPE::SUOBI_LOCK_LIMIT);
|
|
pInfo = (SUOBI_OVER_LIMIT_INFO*)CResistAlarmMng::Instance()->Find(mo, mp, (uint8_t)idx, eZL_ALARMTYPE::SUOBI_LOCK_LIMIT);
|
|
|
- if (pInfo && pInfo->enable)
|
|
|
|
|
|
|
+ if (pInfo && pInfo->enable && !bSkylight)
|
|
|
{
|
|
{
|
|
|
if (max > pInfo->alarm_high_limit)
|
|
if (max > pInfo->alarm_high_limit)
|
|
|
it.d_suobi_lock_max_color = UINT8_ALARM;
|
|
it.d_suobi_lock_max_color = UINT8_ALARM;
|
|
@@ -4059,7 +4044,7 @@ int DealGetResistReport(const httplib::Request& req, const string token, char**
|
|
|
else if (min < pInfo->warn_low_limit)
|
|
else if (min < pInfo->warn_low_limit)
|
|
|
it.d_suobi_lock_min_color = UINT8_WARN;
|
|
it.d_suobi_lock_min_color = UINT8_WARN;
|
|
|
|
|
|
|
|
- if (num && (it.d_suobi_lock_avg > pInfo->alarm_high_limit || it.d_suobi_lock_avg < pInfo->alarm_low_limit))
|
|
|
|
|
|
|
+ if (num && (it.d_suobi_lock_avg > pInfo->alarm_high_limit || it.d_suobi_lock_avg < pInfo->alarm_low_limit) )
|
|
|
it.d_suobi_lock_avg_color = UINT8_ALARM;
|
|
it.d_suobi_lock_avg_color = UINT8_ALARM;
|
|
|
else if (num && (it.d_suobi_lock_avg > pInfo->warn_high_limit || it.d_suobi_lock_avg < pInfo->warn_low_limit))
|
|
else if (num && (it.d_suobi_lock_avg > pInfo->warn_high_limit || it.d_suobi_lock_avg < pInfo->warn_low_limit))
|
|
|
it.d_suobi_lock_avg_color = UINT8_WARN;
|
|
it.d_suobi_lock_avg_color = UINT8_WARN;
|
|
@@ -4084,7 +4069,7 @@ int DealGetResistReport(const httplib::Request& req, const string token, char**
|
|
|
|
|
|
|
|
idx = eSuoBiPosi::SB_INVERT;
|
|
idx = eSuoBiPosi::SB_INVERT;
|
|
|
pInfo = (SUOBI_OVER_LIMIT_INFO*)CResistAlarmMng::Instance()->Find(mo, mp, (uint8_t)idx, eZL_ALARMTYPE::SUOBI_LOCK_LIMIT);
|
|
pInfo = (SUOBI_OVER_LIMIT_INFO*)CResistAlarmMng::Instance()->Find(mo, mp, (uint8_t)idx, eZL_ALARMTYPE::SUOBI_LOCK_LIMIT);
|
|
|
- if (pInfo && pInfo->enable)
|
|
|
|
|
|
|
+ if (pInfo && pInfo->enable && !bSkylight)
|
|
|
{
|
|
{
|
|
|
if (max > pInfo->alarm_high_limit)
|
|
if (max > pInfo->alarm_high_limit)
|
|
|
it.f_suobi_lock_max_color = UINT8_ALARM;
|
|
it.f_suobi_lock_max_color = UINT8_ALARM;
|
|
@@ -4096,9 +4081,9 @@ int DealGetResistReport(const httplib::Request& req, const string token, char**
|
|
|
else if (min < pInfo->warn_low_limit)
|
|
else if (min < pInfo->warn_low_limit)
|
|
|
it.f_suobi_lock_min_color = UINT8_WARN;
|
|
it.f_suobi_lock_min_color = UINT8_WARN;
|
|
|
|
|
|
|
|
- if (num && (it.f_suobi_lock_avg > pInfo->alarm_high_limit || it.f_suobi_lock_avg < pInfo->alarm_low_limit))
|
|
|
|
|
|
|
+ if (num && (it.f_suobi_lock_avg > pInfo->alarm_high_limit || it.f_suobi_lock_avg < pInfo->alarm_low_limit) && !bSkylight)
|
|
|
it.f_suobi_lock_avg_color = UINT8_ALARM;
|
|
it.f_suobi_lock_avg_color = UINT8_ALARM;
|
|
|
- else if (num && (it.f_suobi_lock_avg > pInfo->warn_high_limit || it.f_suobi_lock_avg < pInfo->warn_low_limit))
|
|
|
|
|
|
|
+ else if (num && (it.f_suobi_lock_avg > pInfo->warn_high_limit || it.f_suobi_lock_avg < pInfo->warn_low_limit) && !bSkylight)
|
|
|
it.f_suobi_lock_avg_color = UINT8_WARN;
|
|
it.f_suobi_lock_avg_color = UINT8_WARN;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -4110,7 +4095,7 @@ int DealGetResistReport(const httplib::Request& req, const string token, char**
|
|
|
if (num) it.d_convert_resist_avg = sum / num;
|
|
if (num) it.d_convert_resist_avg = sum / num;
|
|
|
|
|
|
|
|
pInfo2 = (CONVERT_RESIST_OVER_LIMIT*)CResistAlarmMng::Instance()->Find(mo, mp, 2, eZL_ALARMTYPE::CONVERT_LIMIT);
|
|
pInfo2 = (CONVERT_RESIST_OVER_LIMIT*)CResistAlarmMng::Instance()->Find(mo, mp, 2, eZL_ALARMTYPE::CONVERT_LIMIT);
|
|
|
- if (pInfo2 && pInfo2->enable)
|
|
|
|
|
|
|
+ if (pInfo2 && pInfo2->enable && !bSkylight)
|
|
|
{
|
|
{
|
|
|
if (max > pInfo2->dw_alarm_low_limit)
|
|
if (max > pInfo2->dw_alarm_low_limit)
|
|
|
it.d_convert_resist_max_color = UINT8_ALARM;
|
|
it.d_convert_resist_max_color = UINT8_ALARM;
|
|
@@ -4122,9 +4107,9 @@ int DealGetResistReport(const httplib::Request& req, const string token, char**
|
|
|
else if (min > pInfo2->dw_warn_low_limit)
|
|
else if (min > pInfo2->dw_warn_low_limit)
|
|
|
it.d_convert_resist_min_color = UINT8_WARN;
|
|
it.d_convert_resist_min_color = UINT8_WARN;
|
|
|
|
|
|
|
|
- if (num && it.d_convert_resist_avg > pInfo2->dw_alarm_low_limit)
|
|
|
|
|
|
|
+ if (num && it.d_convert_resist_avg > pInfo2->dw_alarm_low_limit && !bSkylight)
|
|
|
it.d_convert_resist_avg_color = UINT8_ALARM;
|
|
it.d_convert_resist_avg_color = UINT8_ALARM;
|
|
|
- else if (num && it.d_convert_resist_avg > pInfo2->dw_warn_low_limit)
|
|
|
|
|
|
|
+ else if (num && it.d_convert_resist_avg > pInfo2->dw_warn_low_limit && !bSkylight)
|
|
|
it.d_convert_resist_avg_color = UINT8_WARN;
|
|
it.d_convert_resist_avg_color = UINT8_WARN;
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
@@ -4136,7 +4121,7 @@ int DealGetResistReport(const httplib::Request& req, const string token, char**
|
|
|
|
|
|
|
|
|
|
|
|
|
pInfo2 = (CONVERT_RESIST_OVER_LIMIT*)CResistAlarmMng::Instance()->Find(mo, mp, 2, eZL_ALARMTYPE::CONVERT_LIMIT);
|
|
pInfo2 = (CONVERT_RESIST_OVER_LIMIT*)CResistAlarmMng::Instance()->Find(mo, mp, 2, eZL_ALARMTYPE::CONVERT_LIMIT);
|
|
|
- if (pInfo2 && pInfo2->enable)
|
|
|
|
|
|
|
+ if (pInfo2 && pInfo2->enable && !bSkylight)
|
|
|
{
|
|
{
|
|
|
if (max > pInfo2->up_alarm_high_limit)
|
|
if (max > pInfo2->up_alarm_high_limit)
|
|
|
it.f_convert_resist_max_color = UINT8_ALARM;
|
|
it.f_convert_resist_max_color = UINT8_ALARM;
|
|
@@ -4148,9 +4133,9 @@ int DealGetResistReport(const httplib::Request& req, const string token, char**
|
|
|
else if (min > pInfo2->up_warn_high_limit)
|
|
else if (min > pInfo2->up_warn_high_limit)
|
|
|
it.f_convert_resist_min_color = UINT8_WARN;
|
|
it.f_convert_resist_min_color = UINT8_WARN;
|
|
|
|
|
|
|
|
- if (num && it.f_convert_resist_avg > pInfo2->up_alarm_high_limit)
|
|
|
|
|
|
|
+ if (num && it.f_convert_resist_avg > pInfo2->up_alarm_high_limit && !bSkylight)
|
|
|
it.f_convert_resist_avg_color = UINT8_ALARM;
|
|
it.f_convert_resist_avg_color = UINT8_ALARM;
|
|
|
- else if (num && it.f_convert_resist_avg > pInfo2->up_warn_high_limit)
|
|
|
|
|
|
|
+ else if (num && it.f_convert_resist_avg > pInfo2->up_warn_high_limit && !bSkylight)
|
|
|
it.f_convert_resist_avg_color = UINT8_WARN;
|
|
it.f_convert_resist_avg_color = UINT8_WARN;
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|