|
|
@@ -473,11 +473,11 @@ int DealGetMitieLock(const httplib::Request& req, const string token, char** jso
|
|
|
yyjson_mut_obj_add_int(doc, root, "warn_low_limit", pInfo->warn_low_limit);
|
|
|
else
|
|
|
yyjson_mut_obj_add_null(doc, root, "warn_low_limit");
|
|
|
- if (pInfo->alarm_high_limit < INT_MAX)
|
|
|
+ if (pInfo->alarm_high_limit > INT_MIN)
|
|
|
yyjson_mut_obj_add_int(doc, root, "alarm_high_limit", pInfo->alarm_high_limit);
|
|
|
else
|
|
|
yyjson_mut_obj_add_null(doc, root, "alarm_high_limit");
|
|
|
- if (pInfo->warn_high_limit < INT_MAX)
|
|
|
+ if (pInfo->warn_high_limit > INT_MIN)
|
|
|
yyjson_mut_obj_add_int(doc, root, "warn_high_limit", pInfo->warn_high_limit);
|
|
|
else
|
|
|
yyjson_mut_obj_add_null(doc, root, "warn_high_limit");
|
|
|
@@ -536,24 +536,32 @@ int DealPostMitieLock(const char* body_ptr, const size_t body_len, const string
|
|
|
auto val = yyjson_obj_get(conf, "alarm_low_limit");
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->alarm_low_limit = yyjson_get_int(val);
|
|
|
+ else
|
|
|
+ pInfo->alarm_low_limit = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "alarm_low_limit", pInfo->alarm_low_limit);
|
|
|
}
|
|
|
{
|
|
|
auto val = yyjson_obj_get(conf, "warn_low_limit");
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->warn_low_limit = yyjson_get_int(val);
|
|
|
+ else
|
|
|
+ pInfo->warn_low_limit = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "warn_low_limit", pInfo->warn_low_limit);
|
|
|
}
|
|
|
{
|
|
|
auto val = yyjson_obj_get(conf, "alarm_high_limit");
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->alarm_high_limit = yyjson_get_int(val);
|
|
|
+ else
|
|
|
+ pInfo->alarm_high_limit = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "alarm_high_limit", pInfo->alarm_high_limit);
|
|
|
}
|
|
|
{
|
|
|
auto val = yyjson_obj_get(conf, "warn_high_limit");
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->warn_high_limit = yyjson_get_int(val);
|
|
|
+ else
|
|
|
+ pInfo->warn_high_limit = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "warn_high_limit", pInfo->warn_high_limit);
|
|
|
}
|
|
|
|
|
|
@@ -591,7 +599,7 @@ int DealPostMitieLock(const char* body_ptr, const size_t body_len, const string
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->alarm_high_limit = yyjson_get_int(val);
|
|
|
else
|
|
|
- pInfo->alarm_high_limit = INT_MAX;
|
|
|
+ pInfo->alarm_high_limit = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "alarm_high_limit", pInfo->alarm_high_limit);
|
|
|
}
|
|
|
{
|
|
|
@@ -599,7 +607,7 @@ int DealPostMitieLock(const char* body_ptr, const size_t body_len, const string
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->warn_high_limit = yyjson_get_int(val);
|
|
|
else
|
|
|
- pInfo->warn_high_limit = INT_MAX;
|
|
|
+ pInfo->warn_high_limit = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "warn_high_limit", pInfo->warn_high_limit);
|
|
|
}
|
|
|
|
|
|
@@ -647,15 +655,18 @@ int DealGetConvertResist(const httplib::Request& req, const string token, char**
|
|
|
yyjson_mut_obj_add_int(doc, root, "dw_alarm_low_limit", pInfo->dw_alarm_low_limit);
|
|
|
else
|
|
|
yyjson_mut_obj_add_null(doc, root, "dw_alarm_low_limit");
|
|
|
+
|
|
|
if (pInfo->dw_warn_low_limit > INT_MIN)
|
|
|
yyjson_mut_obj_add_int(doc, root, "dw_warn_low_limit", pInfo->dw_warn_low_limit);
|
|
|
else
|
|
|
yyjson_mut_obj_add_null(doc, root, "dw_warn_low_limit");
|
|
|
- if (pInfo->up_alarm_high_limit < INT_MAX)
|
|
|
+
|
|
|
+ if (pInfo->up_alarm_high_limit > INT_MIN)
|
|
|
yyjson_mut_obj_add_int(doc, root, "up_alarm_high_limit", pInfo->up_alarm_high_limit);
|
|
|
else
|
|
|
yyjson_mut_obj_add_null(doc, root, "up_alarm_high_limit");
|
|
|
- if (pInfo->up_warn_high_limit < INT_MAX)
|
|
|
+
|
|
|
+ if (pInfo->up_warn_high_limit > INT_MIN)
|
|
|
yyjson_mut_obj_add_int(doc, root, "up_warn_high_limit", pInfo->up_warn_high_limit);
|
|
|
else
|
|
|
yyjson_mut_obj_add_null(doc, root, "up_warn_high_limit");
|
|
|
@@ -754,24 +765,32 @@ int DealPostConvertResist(const char* body_ptr, const size_t body_len, const str
|
|
|
auto val = yyjson_obj_get(conf, "dw_alarm_low_limit");
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->dw_alarm_low_limit = yyjson_get_int(val);
|
|
|
+ else
|
|
|
+ pInfo->dw_alarm_low_limit = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "dw_alarm_low_limit", pInfo->dw_alarm_low_limit);
|
|
|
}
|
|
|
{
|
|
|
auto val = yyjson_obj_get(conf, "dw_warn_low_limit");
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->dw_warn_low_limit = yyjson_get_int(val);
|
|
|
+ else
|
|
|
+ pInfo->dw_warn_low_limit = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "dw_warn_low_limit", pInfo->dw_warn_low_limit);
|
|
|
}
|
|
|
{
|
|
|
auto val = yyjson_obj_get(conf, "up_alarm_high_limit");
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->up_alarm_high_limit = yyjson_get_int(val);
|
|
|
+ else
|
|
|
+ pInfo->up_alarm_high_limit = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "up_alarm_high_limit", pInfo->up_alarm_high_limit);
|
|
|
}
|
|
|
{
|
|
|
auto val = yyjson_obj_get(conf, "up_warn_high_limit");
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->up_warn_high_limit = yyjson_get_int(val);
|
|
|
+ else
|
|
|
+ pInfo->up_warn_high_limit = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "up_warn_high_limit", pInfo->up_warn_high_limit);
|
|
|
}
|
|
|
|
|
|
@@ -807,7 +826,7 @@ int DealPostConvertResist(const char* body_ptr, const size_t body_len, const str
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->up_alarm_high_limit = yyjson_get_int(val);
|
|
|
else
|
|
|
- pInfo->up_alarm_high_limit = INT_MAX;
|
|
|
+ pInfo->up_alarm_high_limit = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "up_alarm_high_limit", pInfo->up_alarm_high_limit);
|
|
|
}
|
|
|
{
|
|
|
@@ -815,7 +834,7 @@ int DealPostConvertResist(const char* body_ptr, const size_t body_len, const str
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->up_warn_high_limit = yyjson_get_int(val);
|
|
|
else
|
|
|
- pInfo->up_warn_high_limit = INT_MAX;
|
|
|
+ pInfo->up_warn_high_limit = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "up_warn_high_limit", pInfo->up_warn_high_limit);
|
|
|
}
|
|
|
|
|
|
@@ -883,7 +902,7 @@ int DealPosttRetesionForce(const char* body_ptr, const size_t body_len, const st
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->dw_alarm_low_drop = yyjson_get_int(val);
|
|
|
else
|
|
|
- pInfo->dw_alarm_low_drop = 3000;
|
|
|
+ pInfo->dw_alarm_low_drop = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "dw_alarm_low_drop", pInfo->dw_alarm_low_drop);
|
|
|
}
|
|
|
{
|
|
|
@@ -903,6 +922,11 @@ int DealPosttRetesionForce(const char* body_ptr, const size_t body_len, const st
|
|
|
yyjson_mut_obj_add_int(doc, root, "alarm_low_percent", pInfo->alarm_low_percent);
|
|
|
}
|
|
|
|
|
|
+ if(((pInfo->alarm_low_percent <= 95 && pInfo->alarm_low_percent >= 5)
|
|
|
+ || (pInfo->alarm_high_percent <= 95 && pInfo->alarm_high_percent >= 5))) {
|
|
|
+ pInfo->is_page_dyna = true;
|
|
|
+ }
|
|
|
+
|
|
|
str_conf = yyjson_mut_write(doc, 0, &len);
|
|
|
yyjson_mut_doc_free(doc);
|
|
|
CResistAlarmMng::Instance()->Insert(mo, mp, posi, (uint8_t)eZL_ALARMTYPE::RETENSION_FORCE, pInfo);
|
|
|
@@ -916,7 +940,7 @@ int DealPosttRetesionForce(const char* body_ptr, const size_t body_len, const st
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->dw_alarm_low_drop = yyjson_get_int(val);
|
|
|
else
|
|
|
- pInfo->dw_alarm_low_drop = 3000;
|
|
|
+ pInfo->dw_alarm_low_drop = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "dw_alarm_low_drop", pInfo->dw_alarm_low_drop);
|
|
|
}
|
|
|
{
|
|
|
@@ -936,6 +960,10 @@ int DealPosttRetesionForce(const char* body_ptr, const size_t body_len, const st
|
|
|
yyjson_mut_obj_add_int(doc, root, "alarm_low_percent", pInfo->alarm_low_percent);
|
|
|
}
|
|
|
|
|
|
+ if (((pInfo->alarm_low_percent <= 95 && pInfo->alarm_low_percent >= 5)
|
|
|
+ || (pInfo->alarm_high_percent <= 95 && pInfo->alarm_high_percent >= 5))) {
|
|
|
+ pInfo->is_page_dyna = true;
|
|
|
+ }
|
|
|
str_conf = yyjson_mut_write(doc, 0, &len);
|
|
|
yyjson_mut_doc_free(doc);
|
|
|
|
|
|
@@ -1473,10 +1501,6 @@ string convertWhere(string mo, string mp, string starttime, string endtime, stri
|
|
|
wh += " AND [sunroof]=1";
|
|
|
}
|
|
|
|
|
|
- if (!handle_result.empty()) {
|
|
|
- wh += fmt::format(" AND handle_result = {}", handle_result);
|
|
|
- }
|
|
|
-
|
|
|
if (!recovery.empty()) {
|
|
|
if (recovery.compare("0") == 0)
|
|
|
wh += " AND [recovery_time] < '1901'";
|
|
|
@@ -1484,7 +1508,7 @@ string convertWhere(string mo, string mp, string starttime, string endtime, stri
|
|
|
wh += " AND [recovery_time] > '1901'";
|
|
|
}
|
|
|
|
|
|
- wh += " AND rel_id = ''";
|
|
|
+ wh += " AND type not in (32,33) GROUP BY mo,mp,no,type) a";
|
|
|
|
|
|
int nPos = wh.find("AND");
|
|
|
if (nPos != -1)
|
|
|
@@ -1531,7 +1555,7 @@ int deal_get_alarm_list(const httplib::Request& req, const string token, char**
|
|
|
|
|
|
do
|
|
|
{
|
|
|
- CString sql = ("select count(*) from rm_alarm as a " + wh).c_str();
|
|
|
+ CString sql = ("SELECT count(*) from (SELECT mo,mp,no,type from rm_alarm " + wh).c_str();
|
|
|
|
|
|
COdbcStatement stmt;
|
|
|
if (!CDBConnectPool::Instance()->DBQuery(stmt, sql))
|
|
|
@@ -1554,10 +1578,10 @@ int deal_get_alarm_list(const httplib::Request& req, const string token, char**
|
|
|
if (total == -1)
|
|
|
break;
|
|
|
|
|
|
- CString sql = fmt::format("select a.[id],[mo],[mp],[no],a.[type] ,[occur_time],[level],[desc],[suggest],[val],[referval],"\
|
|
|
- " [ack_result],ISNULL([ack_name], ''),ISNULL([ack_time], 0),[handle_result],ISNULL([handle_name],''),ISNULL([handle_time], 0),ISNULL([handle_info], '') ,b.name,c.id,c.name,"\
|
|
|
- " recovery_time,sunroof,[event_id] from [rm_alarm] as a left join rm_mo as b on b.id = a.mo left join rm_mo as c on b.up = c.id {} {}",
|
|
|
- wh, or ).c_str();
|
|
|
+ CString sql = fmt::format("SELECT b.id,b.mo,b.mp,b.no,b.type,b.occur_time,b.level,b.[desc],b.suggest,b.val,b.referval, b.ack_result,ISNULL(b.ack_name, '') ack_name,ISNULL(b.ack_time, 0) ack_time,b.handle_result,"\
|
|
|
+ " ISNULL(b.handle_name,'') handle_name,ISNULL(b.handle_time, 0) handle_time,ISNULL(b.handle_info, '') handle_info,c.name,d.id,d.name, b.recovery_time,b.sunroof,b.event_id from "\
|
|
|
+ " rm_alarm b right JOIN (SELECT mo,mp,no,type,max(id) as id from rm_alarm as a {} on a. mo = b.mo and a.mp = b.mp and a.no= b.no and a.type = b.type and a.id = b.id"\
|
|
|
+ " left join rm_mo c on c.id = b.mo left join rm_mo d on c.up = d.id {}",wh, or ).c_str();
|
|
|
|
|
|
COdbcStatement stmt;
|
|
|
if (!CDBConnectPool::Instance()->DBQuery(stmt, sql))
|
|
|
@@ -1623,7 +1647,10 @@ int deal_get_alarm_list(const httplib::Request& req, const string token, char**
|
|
|
yyjson_mut_arr_add_val(rows, obj);
|
|
|
auto child = yyjson_mut_arr(doc);
|
|
|
yyjson_mut_obj_add_val(doc, obj, "child", child);
|
|
|
- mapList[event_id] = child; //临时记录后面统一添加
|
|
|
+
|
|
|
+ string mapKey = smo;
|
|
|
+ mapKey.append(smp).append(to_string(no)).append(to_string(utype)).append(".").append(to_string(id));
|
|
|
+ mapList[mapKey] = child; //临时记录后面统一添加
|
|
|
|
|
|
if (ack_name[0])
|
|
|
yyjson_mut_obj_add_strcpy(doc, obj, "ack_name", ANSItoUTF8(ack_name).c_str());
|
|
|
@@ -1649,7 +1676,7 @@ int deal_get_alarm_list(const httplib::Request& req, const string token, char**
|
|
|
yyjson_mut_obj_add_int(doc, obj, "id", id);
|
|
|
yyjson_mut_obj_add_int(doc, obj, "level", level);
|
|
|
yyjson_mut_obj_add_strcpy(doc, obj, "mo", smo);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "mo_name", mo_name);
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "mo_name", ANSItoUTF8(mo_name).c_str());
|
|
|
yyjson_mut_obj_add_strcpy(doc, obj, "mp", smp);
|
|
|
yyjson_mut_obj_add_int(doc, obj, "no", no);
|
|
|
|
|
|
@@ -1689,152 +1716,158 @@ int deal_get_alarm_list(const httplib::Request& req, const string token, char**
|
|
|
{
|
|
|
if (mapList.size() == 0)
|
|
|
break;
|
|
|
-
|
|
|
- stringstream ss;
|
|
|
- ss << " where rel_id in (";
|
|
|
- int index = 0;
|
|
|
- for (const auto& it : mapList)
|
|
|
- {
|
|
|
- if (index == 0)
|
|
|
- ss << '\'' << it.first << '\'';
|
|
|
- else
|
|
|
- ss << ",'" << it.first << '\'';
|
|
|
- index++;
|
|
|
- }
|
|
|
- ss << ')';
|
|
|
-
|
|
|
- CString sql = fmt::format("select a.[id],[mo],[mp],[no],a.[type] ,[occur_time],[level],[desc],[suggest],[val],[referval],"\
|
|
|
- " [ack_result],ISNULL([ack_name], ''),ISNULL([ack_time], 0),[handle_result],ISNULL([handle_name],''),ISNULL([handle_time], 0),ISNULL([handle_info], '') ,b.name,c.id,c.name,"\
|
|
|
- " recovery_time,sunroof,[event_id],[rel_id] from [rm_alarm] as a left join rm_mo as b on b.id = a.mo left join rm_mo as c on b.up = c.id {}",
|
|
|
- ss.str()).c_str();
|
|
|
-
|
|
|
- COdbcStatement stmt;
|
|
|
- if (!CDBConnectPool::Instance()->DBQuery(stmt, sql))
|
|
|
- {
|
|
|
- msg = fmt::format("语句执行错误:{}", sql);
|
|
|
- code = 500;
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- int id, val, refer;
|
|
|
- char smo[20];
|
|
|
- char smp[10];
|
|
|
- char desc[200];
|
|
|
- char suggest[200];
|
|
|
- char ack_name[50];
|
|
|
- char handle_name[50];
|
|
|
- char hanele_info[50];
|
|
|
-
|
|
|
- char mo_name[20];
|
|
|
- char station_name[50];
|
|
|
- char station_id[50];
|
|
|
-
|
|
|
- char event_id[37] = { 0 };
|
|
|
- char rel_id[37] = { 0 };
|
|
|
-
|
|
|
- uint8_t no, utype, level, ack_result, h_result, skylight;
|
|
|
- TIMESTAMP_STRUCT tsOcccur, tsHandle, tsAck, tsRecovery;
|
|
|
-
|
|
|
- int nCol = 1;
|
|
|
-
|
|
|
- stmt.BindIntCol(nCol++, &id);
|
|
|
- stmt.BindCharCol(nCol++, smo, sizeof(smo));
|
|
|
- stmt.BindCharCol(nCol++, smp, sizeof(smp));
|
|
|
- stmt.BindTinyIntCol(nCol++, &no);
|
|
|
- stmt.BindTinyIntCol(nCol++, &utype);
|
|
|
- stmt.BindTimeStampCol(nCol++, &tsOcccur);
|
|
|
- stmt.BindTinyIntCol(nCol++, &level);
|
|
|
- stmt.BindCharCol(nCol++, desc, sizeof(desc));
|
|
|
- stmt.BindCharCol(nCol++, suggest, sizeof(suggest));
|
|
|
- stmt.BindIntCol(nCol++, &val);
|
|
|
- stmt.BindIntCol(nCol++, &refer);
|
|
|
- stmt.BindTinyIntCol(nCol++, &ack_result);
|
|
|
- stmt.BindCharCol(nCol++, ack_name, sizeof(ack_name));
|
|
|
- stmt.BindTimeStampCol(nCol++, &tsAck);
|
|
|
- stmt.BindTinyIntCol(nCol++, &h_result);
|
|
|
- stmt.BindCharCol(nCol++, handle_name, sizeof(handle_name));
|
|
|
- stmt.BindTimeStampCol(nCol++, &tsHandle);
|
|
|
- stmt.BindCharCol(nCol++, hanele_info, sizeof(hanele_info));
|
|
|
-
|
|
|
- stmt.BindCharCol(nCol++, mo_name, sizeof(mo_name));
|
|
|
- stmt.BindCharCol(nCol++, station_id, sizeof(station_id));
|
|
|
- stmt.BindCharCol(nCol++, station_name, sizeof(station_name));
|
|
|
- stmt.BindTimeStampCol(nCol++, &tsRecovery);
|
|
|
- stmt.BindTinyIntCol(nCol++, &skylight);
|
|
|
- stmt.BindCharCol(nCol++, event_id, sizeof(event_id));
|
|
|
- stmt.BindCharCol(nCol++, rel_id, sizeof(rel_id));
|
|
|
-
|
|
|
- while (true)
|
|
|
- {
|
|
|
- if (stmt.FetchNext() != 0)
|
|
|
- break;
|
|
|
-
|
|
|
- auto arr = mapList[rel_id];
|
|
|
+
|
|
|
+ for ( auto it = (&mapList)->cbegin();it != (&mapList)->cend();it++) {
|
|
|
+ string keyMap = it->first;
|
|
|
+ vector <string> result;
|
|
|
+ istringstream resultStream(keyMap);
|
|
|
+ string temp;
|
|
|
+ string mompnotype;
|
|
|
+ string idStr;
|
|
|
+ auto arr = mapList[keyMap];
|
|
|
if (arr == nullptr)
|
|
|
{
|
|
|
ASSERT(0);
|
|
|
continue;
|
|
|
}
|
|
|
- auto obj = yyjson_mut_obj(doc);
|
|
|
- yyjson_mut_arr_add_val(arr, obj);//添加到原有的child里
|
|
|
+ while (std::getline(resultStream,temp,'.')) {
|
|
|
+ result.push_back(temp);
|
|
|
+ }
|
|
|
+ if (result.size() == 2) {
|
|
|
+ mompnotype = result[0];
|
|
|
+ idStr = result[1];
|
|
|
|
|
|
- if (ack_name[0])
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "ack_name", ANSItoUTF8(ack_name).c_str());
|
|
|
- else
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "ack_name", "");
|
|
|
- if (tsAck.year != 1900)
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "ack_time", fmt::format("{}-{:0>2}-{:0>2} {:0>2}:{:0>2}:{:0>2}",
|
|
|
- tsAck.year, tsAck.month, tsAck.day, tsAck.hour, tsAck.minute, tsAck.second).c_str());
|
|
|
- else
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "ack_time", "");
|
|
|
|
|
|
- yyjson_mut_obj_add_int(doc, obj, "ack_result", ack_result);
|
|
|
- if (handle_name[0])
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "handle_name", ANSItoUTF8(handle_name).c_str());
|
|
|
- else
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "handle_name", "");
|
|
|
- if (tsHandle.year != 1900)
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "handle_time", fmt::format("{}-{:0>2}-{:0>2} {:0>2}:{:0>2}:{:0>2}",
|
|
|
- tsHandle.year, tsHandle.month, tsHandle.day, tsHandle.hour, tsHandle.minute, tsHandle.second).c_str());
|
|
|
- else
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "handle_time", "");
|
|
|
- yyjson_mut_obj_add_int(doc, obj, "handle_result", h_result);
|
|
|
- yyjson_mut_obj_add_int(doc, obj, "id", id);
|
|
|
- yyjson_mut_obj_add_int(doc, obj, "level", level);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "mo", smo);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "mo_name", mo_name);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "mp", smp);
|
|
|
- yyjson_mut_obj_add_int(doc, obj, "no", no);
|
|
|
+ CString sql = fmt::format("select a.id,a.mo,a.mp,a.no,a.type ,a.occur_time,a.level,a.[desc],a.suggest,a.val,a.referval,"\
|
|
|
+ "a.ack_result, ISNULL(a.ack_name, ''), ISNULL(a.ack_time, 0), a.handle_result, ISNULL(a.handle_name, ''), ISNULL(a.handle_time, 0), ISNULL(a.handle_info, ''), b.name, c.id, c.name,"\
|
|
|
+ "a.recovery_time, a.sunroof, a.event_id, a.rel_id from rm_alarm a left join rm_mo as b on b.id = a.mo left join rm_mo as c on b.up = c.id where concat(a.mo, a.mp, a.no, a.type) = '{}' and a.id < {}",
|
|
|
+ mompnotype,idStr).c_str();
|
|
|
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "type_name", ANSItoUTF8(GetAlarmName((eZL_ALARMTYPE)utype)).c_str());
|
|
|
+ COdbcStatement stmt;
|
|
|
+ if (!CDBConnectPool::Instance()->DBQuery(stmt, sql))
|
|
|
+ {
|
|
|
+ msg = fmt::format("语句执行错误:{}", sql);
|
|
|
+ code = 500;
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "occur_time", fmt::format("{}-{:0>2}-{:0>2} {:0>2}:{:0>2}:{:0>2}",
|
|
|
- tsOcccur.year, tsOcccur.month, tsOcccur.day, tsOcccur.hour, tsOcccur.minute, tsOcccur.second).c_str());
|
|
|
+ int id, val, refer;
|
|
|
+ char smo[20];
|
|
|
+ char smp[10];
|
|
|
+ char desc[200];
|
|
|
+ char suggest[200];
|
|
|
+ char ack_name[50];
|
|
|
+ char handle_name[50];
|
|
|
+ char hanele_info[50];
|
|
|
+
|
|
|
+ char mo_name[20];
|
|
|
+ char station_name[50];
|
|
|
+ char station_id[50];
|
|
|
+
|
|
|
+ char event_id[37] = { 0 };
|
|
|
+ char rel_id[37] = { 0 };
|
|
|
+
|
|
|
+ uint8_t no, utype, level, ack_result, h_result, skylight;
|
|
|
+ TIMESTAMP_STRUCT tsOcccur, tsHandle, tsAck, tsRecovery;
|
|
|
+
|
|
|
+ int nCol = 1;
|
|
|
+
|
|
|
+ stmt.BindIntCol(nCol++, &id);
|
|
|
+ stmt.BindCharCol(nCol++, smo, sizeof(smo));
|
|
|
+ stmt.BindCharCol(nCol++, smp, sizeof(smp));
|
|
|
+ stmt.BindTinyIntCol(nCol++, &no);
|
|
|
+ stmt.BindTinyIntCol(nCol++, &utype);
|
|
|
+ stmt.BindTimeStampCol(nCol++, &tsOcccur);
|
|
|
+ stmt.BindTinyIntCol(nCol++, &level);
|
|
|
+ stmt.BindCharCol(nCol++, desc, sizeof(desc));
|
|
|
+ stmt.BindCharCol(nCol++, suggest, sizeof(suggest));
|
|
|
+ stmt.BindIntCol(nCol++, &val);
|
|
|
+ stmt.BindIntCol(nCol++, &refer);
|
|
|
+ stmt.BindTinyIntCol(nCol++, &ack_result);
|
|
|
+ stmt.BindCharCol(nCol++, ack_name, sizeof(ack_name));
|
|
|
+ stmt.BindTimeStampCol(nCol++, &tsAck);
|
|
|
+ stmt.BindTinyIntCol(nCol++, &h_result);
|
|
|
+ stmt.BindCharCol(nCol++, handle_name, sizeof(handle_name));
|
|
|
+ stmt.BindTimeStampCol(nCol++, &tsHandle);
|
|
|
+ stmt.BindCharCol(nCol++, hanele_info, sizeof(hanele_info));
|
|
|
+
|
|
|
+ stmt.BindCharCol(nCol++, mo_name, sizeof(mo_name));
|
|
|
+ stmt.BindCharCol(nCol++, station_id, sizeof(station_id));
|
|
|
+ stmt.BindCharCol(nCol++, station_name, sizeof(station_name));
|
|
|
+ stmt.BindTimeStampCol(nCol++, &tsRecovery);
|
|
|
+ stmt.BindTinyIntCol(nCol++, &skylight);
|
|
|
+ stmt.BindCharCol(nCol++, event_id, sizeof(event_id));
|
|
|
+ stmt.BindCharCol(nCol++, rel_id, sizeof(rel_id));
|
|
|
+
|
|
|
+ while (true)
|
|
|
+ {
|
|
|
+ if (stmt.FetchNext() != 0)
|
|
|
+ break;
|
|
|
|
|
|
- if (tsRecovery.year != 1900)
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "recovery_time", fmt::format("{}-{:0>2}-{:0>2} {:0>2}:{:0>2}:{:0>2}",
|
|
|
- tsRecovery.year, tsRecovery.month, tsRecovery.day, tsRecovery.hour, tsRecovery.minute, tsRecovery.second).c_str());
|
|
|
- else
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "recovery_time", "");
|
|
|
+ auto obj = yyjson_mut_obj(doc);
|
|
|
+ yyjson_mut_arr_add_val(arr, obj);//添加到原有的child里
|
|
|
|
|
|
- if (suggest[0])
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "suggest", ANSItoUTF8(suggest).c_str());
|
|
|
- else
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "suggest", "");
|
|
|
- if (desc[0])
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "desc", ANSItoUTF8(desc).c_str());
|
|
|
- else
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "desc", "");
|
|
|
- yyjson_mut_obj_add_int(doc, obj, "sunroof", skylight);
|
|
|
- yyjson_mut_obj_add_int(doc, obj, "type", utype);
|
|
|
- //yyjson_mut_obj_add_strcpy(doc, obj, "type_name", )
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "up", ANSItoUTF8(station_id).c_str());
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "up_name", ANSItoUTF8(station_name).c_str());
|
|
|
- yyjson_mut_obj_add_int(doc, obj, "val", val);
|
|
|
- yyjson_mut_obj_add_int(doc, obj, "referval", refer);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "event_id", event_id);
|
|
|
- }
|
|
|
+ if (ack_name[0])
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "ack_name", ANSItoUTF8(ack_name).c_str());
|
|
|
+ else
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "ack_name", "");
|
|
|
+ if (tsAck.year != 1900)
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "ack_time", fmt::format("{}-{:0>2}-{:0>2} {:0>2}:{:0>2}:{:0>2}",
|
|
|
+ tsAck.year, tsAck.month, tsAck.day, tsAck.hour, tsAck.minute, tsAck.second).c_str());
|
|
|
+ else
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "ack_time", "");
|
|
|
+
|
|
|
+ yyjson_mut_obj_add_int(doc, obj, "ack_result", ack_result);
|
|
|
+ if (handle_name[0])
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "handle_name", ANSItoUTF8(handle_name).c_str());
|
|
|
+ else
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "handle_name", "");
|
|
|
+ if (tsHandle.year != 1900)
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "handle_time", fmt::format("{}-{:0>2}-{:0>2} {:0>2}:{:0>2}:{:0>2}",
|
|
|
+ tsHandle.year, tsHandle.month, tsHandle.day, tsHandle.hour, tsHandle.minute, tsHandle.second).c_str());
|
|
|
+ else
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "handle_time", "");
|
|
|
+ yyjson_mut_obj_add_int(doc, obj, "handle_result", h_result);
|
|
|
+ yyjson_mut_obj_add_int(doc, obj, "id", id);
|
|
|
+ yyjson_mut_obj_add_int(doc, obj, "level", level);
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "mo", smo);
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "mo_name", mo_name);
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "mp", smp);
|
|
|
+ yyjson_mut_obj_add_int(doc, obj, "no", no);
|
|
|
+
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "type_name", ANSItoUTF8(GetAlarmName((eZL_ALARMTYPE)utype)).c_str());
|
|
|
+
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "occur_time", fmt::format("{}-{:0>2}-{:0>2} {:0>2}:{:0>2}:{:0>2}",
|
|
|
+ tsOcccur.year, tsOcccur.month, tsOcccur.day, tsOcccur.hour, tsOcccur.minute, tsOcccur.second).c_str());
|
|
|
+
|
|
|
+ if (tsRecovery.year != 1900)
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "recovery_time", fmt::format("{}-{:0>2}-{:0>2} {:0>2}:{:0>2}:{:0>2}",
|
|
|
+ tsRecovery.year, tsRecovery.month, tsRecovery.day, tsRecovery.hour, tsRecovery.minute, tsRecovery.second).c_str());
|
|
|
+ else
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "recovery_time", "");
|
|
|
|
|
|
+ if (suggest[0])
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "suggest", ANSItoUTF8(suggest).c_str());
|
|
|
+ else
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "suggest", "");
|
|
|
+ if (desc[0])
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "desc", ANSItoUTF8(desc).c_str());
|
|
|
+ else
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "desc", "");
|
|
|
+ yyjson_mut_obj_add_int(doc, obj, "sunroof", skylight);
|
|
|
+ yyjson_mut_obj_add_int(doc, obj, "type", utype);
|
|
|
+ //yyjson_mut_obj_add_strcpy(doc, obj, "type_name", )
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "up", ANSItoUTF8(station_id).c_str());
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "up_name", ANSItoUTF8(station_name).c_str());
|
|
|
+ yyjson_mut_obj_add_int(doc, obj, "val", val);
|
|
|
+ yyjson_mut_obj_add_int(doc, obj, "referval", refer);
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "event_id", event_id);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
} while (false);
|
|
|
|
|
|
@@ -2106,6 +2139,7 @@ int DealGetResistData(const httplib::Request& req, const string token, char** js
|
|
|
auto pConvertLimit = (CONVERT_RESIST_OVER_LIMIT*)CResistAlarmMng::Instance()->Find(mo, mp, 2, eZL_ALARMTYPE::CONVERT_LIMIT);
|
|
|
auto pFixSuobi = (SUOBI_OVER_LIMIT_INFO*)CResistAlarmMng::Instance()->Find(mo, mp, (uint8_t)eSuoBiPosi::SB_FIX, eZL_ALARMTYPE::SUOBI_LOCK_LIMIT);
|
|
|
auto pInvertSuobi = (SUOBI_OVER_LIMIT_INFO*)CResistAlarmMng::Instance()->Find(mo, mp, (uint8_t)eSuoBiPosi::SB_INVERT, eZL_ALARMTYPE::SUOBI_LOCK_LIMIT);
|
|
|
+ auto pFriction = (FRICTION_OVER_LIMIT_INFO*)CResistAlarmMng::Instance()->Find(mo, mp, 2, eZL_ALARMTYPE::FRICTION_OVER_LIMIT);
|
|
|
|
|
|
{
|
|
|
int num = 0;
|
|
|
@@ -2324,8 +2358,17 @@ int DealGetResistData(const httplib::Request& req, const string token, char** js
|
|
|
yyjson_mut_obj_add_str(doc, obj, "position", "bottom");
|
|
|
}
|
|
|
yyjson_mut_obj_add_int(doc, obj, "val", show_val);
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "color", "#802A2A");
|
|
|
- //TODO 颜色
|
|
|
+ if (pFriction && pFriction->enable)
|
|
|
+ {
|
|
|
+ if (show_val > pFriction->up_alarm_low_limit || show_val < pFriction->dw_alarm_high_limit)
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
|
+ else if (show_val > pFriction->up_warn_low_limit || show_val < pFriction->dw_warn_high_limit)
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
|
+ else
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "color", "#8A2BE2");//紫罗兰
|
|
|
+ }
|
|
|
+ else
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "color", "#8A2BE2");//紫罗兰
|
|
|
yyjson_mut_obj_add_strcpy(doc, obj, "label", ANSItoUTF8(fmt::format("稳态值:{}", show_val)).c_str());
|
|
|
}
|
|
|
else
|
|
|
@@ -3408,21 +3451,23 @@ int DealGetResistCurve(const httplib::Request& req, const string token, char** j
|
|
|
{
|
|
|
//转换阻力报警线
|
|
|
CONVERT_RESIST_OVER_LIMIT* pInfo = (CONVERT_RESIST_OVER_LIMIT*)CResistAlarmMng::Instance()->Find(mo, mp, 2, eZL_ALARMTYPE::CONVERT_LIMIT);
|
|
|
+ string direct1, direct2;
|
|
|
+ CMonitorObjectMng::Instance()->GetDirectByMoMp(mo+"."+mp, direct1, direct2);
|
|
|
if (pInfo && pInfo->enable)
|
|
|
{
|
|
|
if (pInfo->dw_warn_low_limit > INT_MIN)
|
|
|
{
|
|
|
auto obj = yyjson_mut_obj(doc);
|
|
|
yyjson_mut_arr_add_val(convert_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("预警线").c_str());
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8(direct1+"预警线").c_str());
|
|
|
yyjson_mut_obj_add_int(doc, obj, "value", pInfo->dw_warn_low_limit);
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
|
}
|
|
|
- if (pInfo->up_warn_high_limit < INT_MAX)
|
|
|
+ if (pInfo->up_warn_high_limit > INT_MIN)
|
|
|
{
|
|
|
auto obj = yyjson_mut_obj(doc);
|
|
|
yyjson_mut_arr_add_val(convert_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("预警线").c_str());
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8(direct2+"预警线").c_str());
|
|
|
yyjson_mut_obj_add_int(doc, obj, "value", pInfo->up_warn_high_limit);
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
|
}
|
|
|
@@ -3430,60 +3475,21 @@ int DealGetResistCurve(const httplib::Request& req, const string token, char** j
|
|
|
{
|
|
|
auto obj = yyjson_mut_obj(doc);
|
|
|
yyjson_mut_arr_add_val(convert_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("告警线").c_str());
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8(direct1+"告警线").c_str());
|
|
|
yyjson_mut_obj_add_int(doc, obj, "value", pInfo->dw_alarm_low_limit);
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
|
}
|
|
|
- if (pInfo->up_alarm_high_limit < INT_MAX)
|
|
|
+ if (pInfo->up_alarm_high_limit > INT_MIN)
|
|
|
{
|
|
|
auto obj = yyjson_mut_obj(doc);
|
|
|
yyjson_mut_arr_add_val(convert_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("告警线").c_str());
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8(direct2+"告警线").c_str());
|
|
|
yyjson_mut_obj_add_int(doc, obj, "value", pInfo->up_alarm_high_limit);
|
|
|
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- {
|
|
|
- //锁闭力报警线
|
|
|
- SUOBI_OVER_LIMIT_INFO* pInfo = (SUOBI_OVER_LIMIT_INFO*)CResistAlarmMng::Instance()->Find(mo, mp, -1, eZL_ALARMTYPE::SUOBI_LOCK_LIMIT);
|
|
|
- if (pInfo && pInfo->enable)
|
|
|
- {
|
|
|
- if (pInfo->warn_low_limit > INT_MIN)
|
|
|
- {
|
|
|
- auto obj = yyjson_mut_obj(doc);
|
|
|
- yyjson_mut_arr_add_val(suobi_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("预警线").c_str());
|
|
|
- yyjson_mut_obj_add_int(doc, obj, "value", pInfo->warn_low_limit);
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
|
- }
|
|
|
- if (pInfo->warn_high_limit < INT_MAX)
|
|
|
- {
|
|
|
- auto obj = yyjson_mut_obj(doc);
|
|
|
- yyjson_mut_arr_add_val(suobi_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("预警线").c_str());
|
|
|
- yyjson_mut_obj_add_int(doc, obj, "value", pInfo->warn_high_limit);
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
|
- }
|
|
|
- if (pInfo->alarm_low_limit > INT_MIN)
|
|
|
- {
|
|
|
- auto obj = yyjson_mut_obj(doc);
|
|
|
- yyjson_mut_arr_add_val(suobi_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("告警线").c_str());
|
|
|
- yyjson_mut_obj_add_int(doc, obj, "value", pInfo->alarm_low_limit);
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
|
- }
|
|
|
- if (pInfo->alarm_high_limit < INT_MAX)
|
|
|
- {
|
|
|
- auto obj = yyjson_mut_obj(doc);
|
|
|
- yyjson_mut_arr_add_val(suobi_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("告警线").c_str());
|
|
|
- yyjson_mut_obj_add_int(doc, obj, "value", pInfo->alarm_high_limit);
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
{
|
|
|
//定位锁闭力报警线
|
|
|
SUOBI_OVER_LIMIT_INFO* pInfo = (SUOBI_OVER_LIMIT_INFO*)CResistAlarmMng::Instance()->Find(mo, mp, (uint8_t)eSuoBiPosi::SB_FIX, eZL_ALARMTYPE::SUOBI_LOCK_LIMIT);
|
|
|
@@ -3493,15 +3499,15 @@ int DealGetResistCurve(const httplib::Request& req, const string token, char** j
|
|
|
{
|
|
|
auto obj = yyjson_mut_obj(doc);
|
|
|
yyjson_mut_arr_add_val(suobi_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("定位预警线").c_str());
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("定位最小预警线").c_str());
|
|
|
yyjson_mut_obj_add_int(doc, obj, "value", pInfo->warn_low_limit);
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
|
}
|
|
|
- if (pInfo->warn_high_limit < INT_MAX)
|
|
|
+ if (pInfo->warn_high_limit > INT_MIN)
|
|
|
{
|
|
|
auto obj = yyjson_mut_obj(doc);
|
|
|
yyjson_mut_arr_add_val(suobi_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("定位预警线").c_str());
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("定位最大预警线").c_str());
|
|
|
yyjson_mut_obj_add_int(doc, obj, "value", pInfo->warn_high_limit);
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
|
}
|
|
|
@@ -3509,15 +3515,15 @@ int DealGetResistCurve(const httplib::Request& req, const string token, char** j
|
|
|
{
|
|
|
auto obj = yyjson_mut_obj(doc);
|
|
|
yyjson_mut_arr_add_val(suobi_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("定位告警线").c_str());
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("定位最小告警线").c_str());
|
|
|
yyjson_mut_obj_add_int(doc, obj, "value", pInfo->alarm_low_limit);
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
|
}
|
|
|
- if (pInfo->alarm_high_limit < INT_MAX)
|
|
|
+ if (pInfo->alarm_high_limit > INT_MIN)
|
|
|
{
|
|
|
auto obj = yyjson_mut_obj(doc);
|
|
|
yyjson_mut_arr_add_val(suobi_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("定位告警线").c_str());
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("定位最大告警线").c_str());
|
|
|
yyjson_mut_obj_add_int(doc, obj, "value", pInfo->alarm_high_limit);
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
|
}
|
|
|
@@ -3532,15 +3538,15 @@ int DealGetResistCurve(const httplib::Request& req, const string token, char** j
|
|
|
{
|
|
|
auto obj = yyjson_mut_obj(doc);
|
|
|
yyjson_mut_arr_add_val(suobi_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("反位预警线").c_str());
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("反位最小预警线").c_str());
|
|
|
yyjson_mut_obj_add_int(doc, obj, "value", pInfo->warn_low_limit);
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
|
}
|
|
|
- if (pInfo->warn_high_limit < INT_MAX)
|
|
|
+ if (pInfo->warn_high_limit > INT_MIN)
|
|
|
{
|
|
|
auto obj = yyjson_mut_obj(doc);
|
|
|
yyjson_mut_arr_add_val(suobi_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("反位预警线").c_str());
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("反位最大预警线").c_str());
|
|
|
yyjson_mut_obj_add_int(doc, obj, "value", pInfo->warn_high_limit);
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
|
}
|
|
|
@@ -3548,15 +3554,15 @@ int DealGetResistCurve(const httplib::Request& req, const string token, char** j
|
|
|
{
|
|
|
auto obj = yyjson_mut_obj(doc);
|
|
|
yyjson_mut_arr_add_val(suobi_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("反位告警线").c_str());
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("反位最小告警线").c_str());
|
|
|
yyjson_mut_obj_add_int(doc, obj, "value", pInfo->alarm_low_limit);
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
|
}
|
|
|
- if (pInfo->alarm_high_limit < INT_MAX)
|
|
|
+ if (pInfo->alarm_high_limit > INT_MIN)
|
|
|
{
|
|
|
auto obj = yyjson_mut_obj(doc);
|
|
|
yyjson_mut_arr_add_val(suobi_line, obj);
|
|
|
- yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("反位告警线").c_str());
|
|
|
+ yyjson_mut_obj_add_strcpy(doc, obj, "name", ANSItoUTF8("反位最大告警线").c_str());
|
|
|
yyjson_mut_obj_add_int(doc, obj, "value", pInfo->alarm_high_limit);
|
|
|
yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
|
}
|
|
|
@@ -4806,6 +4812,7 @@ int DealResistMove(const httplib::Request& req, const string token, char** json,
|
|
|
auto pConvertLimit = (CONVERT_RESIST_OVER_LIMIT*)CResistAlarmMng::Instance()->Find(mo, mp, 2, eZL_ALARMTYPE::CONVERT_LIMIT);
|
|
|
auto pFixSuobi = (SUOBI_OVER_LIMIT_INFO*)CResistAlarmMng::Instance()->Find(mo, mp, (uint8_t)eSuoBiPosi::SB_FIX, eZL_ALARMTYPE::SUOBI_LOCK_LIMIT);
|
|
|
auto pInvertSuobi = (SUOBI_OVER_LIMIT_INFO*)CResistAlarmMng::Instance()->Find(mo, mp, (uint8_t)eSuoBiPosi::SB_INVERT, eZL_ALARMTYPE::SUOBI_LOCK_LIMIT);
|
|
|
+ auto pFriction = (FRICTION_OVER_LIMIT_INFO*)CResistAlarmMng::Instance()->Find(mo, mp, 2, eZL_ALARMTYPE::FRICTION_OVER_LIMIT);
|
|
|
|
|
|
std::map<time_t, int64_t>* pmaxlockfix = nullptr, * pmaxlockinvert = nullptr;
|
|
|
if (pInfo->name1.find("定位") != -1)
|
|
|
@@ -4898,10 +4905,20 @@ int DealResistMove(const httplib::Request& req, const string token, char** json,
|
|
|
yyjson_mut_arr_add_int(doc, coord, show_time);
|
|
|
yyjson_mut_arr_add_int(doc, coord, curr_val);
|
|
|
yyjson_mut_obj_add_strcpy(doc, obj, "time", fmt::format("{}.{:0>3}", CTime(show_time/1000).Format("%Y-%m-%d %H:%M:%S"), show_time % 1000).c_str());
|
|
|
- yyjson_mut_obj_add_str(doc, obj, "color", "#802A2A");
|
|
|
if (show_val < 0)
|
|
|
show_val = -show_val;
|
|
|
yyjson_mut_obj_add_int(doc, obj, "val", show_val);
|
|
|
+ if (pFriction && pFriction->enable)
|
|
|
+ {
|
|
|
+ if (show_val > pFriction->up_alarm_low_limit || show_val < pFriction->dw_alarm_high_limit)
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "color", "Red");
|
|
|
+ else if (show_val > pFriction->up_warn_low_limit || show_val < pFriction->dw_warn_high_limit)
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "color", "Orange");
|
|
|
+ else
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "color", "#8A2BE2");//紫罗兰
|
|
|
+ }
|
|
|
+ else
|
|
|
+ yyjson_mut_obj_add_str(doc, obj, "color", "#8A2BE2");//紫罗兰
|
|
|
yyjson_mut_obj_add_strcpy(doc, obj, "label", ANSItoUTF8(fmt::format("稳态值:{}", show_val)).c_str());
|
|
|
if (it.bUpOrDown == eUpOrDownInfo::UOD_DOWN)
|
|
|
yyjson_mut_obj_add_str(doc, obj, "position", "bottom");
|