|
|
@@ -696,8 +696,14 @@ int DealGetRetesionForce(const httplib::Request& req, const string token, char**
|
|
|
yyjson_mut_obj_add_int(doc, root, "dw_alarm_low_drop", pInfo->dw_alarm_low_drop);
|
|
|
else
|
|
|
yyjson_mut_obj_add_null(doc, root, "dw_alarm_low_drop");
|
|
|
- yyjson_mut_obj_add_int(doc, root, "alarm_low_percent", pInfo->alarm_low_percent);
|
|
|
- yyjson_mut_obj_add_int(doc, root, "alarm_high_percent", pInfo->alarm_high_percent);
|
|
|
+ if (pInfo->alarm_low_percent > INT_MIN)
|
|
|
+ yyjson_mut_obj_add_int(doc, root, "alarm_low_percent", pInfo->alarm_low_percent);
|
|
|
+ else
|
|
|
+ yyjson_mut_obj_add_null(doc, root, "alarm_low_percent");
|
|
|
+ if (pInfo->alarm_high_percent > INT_MIN)
|
|
|
+ yyjson_mut_obj_add_int(doc, root, "alarm_high_percent", pInfo->alarm_high_percent);
|
|
|
+ else
|
|
|
+ yyjson_mut_obj_add_null(doc, root, "alarm_high_percent");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -864,7 +870,7 @@ int DealPosttRetesionForce(const char* body_ptr, const size_t body_len, const st
|
|
|
//¸üÐÂÄÚ´æÀï
|
|
|
RETENSION_FORCE_DROP* pInfo = (RETENSION_FORCE_DROP*)CResistAlarmMng::Instance()->Find(mo, mp, posi, eZL_ALARMTYPE::RETENSION_FORCE);
|
|
|
CString sql;
|
|
|
- if (pInfo == nullptr && pInfo->dw_alarm_low_drop == INT_MIN)
|
|
|
+ if (pInfo == nullptr/* && pInfo->dw_alarm_low_drop == INT_MIN*/)
|
|
|
{
|
|
|
RETENSION_FORCE_DROP* pInfo = new RETENSION_FORCE_DROP;
|
|
|
pInfo->type = eZL_ALARMTYPE::RETENSION_FORCE;
|
|
|
@@ -877,18 +883,24 @@ int DealPosttRetesionForce(const char* body_ptr, const size_t body_len, const st
|
|
|
auto val = yyjson_obj_get(conf, "dw_alarm_low_drop");
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->dw_alarm_low_drop = yyjson_get_int(val);
|
|
|
+ else
|
|
|
+ pInfo->dw_alarm_low_drop = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "dw_alarm_low_drop", pInfo->dw_alarm_low_drop);
|
|
|
}
|
|
|
{
|
|
|
auto val = yyjson_obj_get(conf, "alarm_high_percent");
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->alarm_high_percent = yyjson_get_int(val);
|
|
|
+ else
|
|
|
+ pInfo->alarm_high_percent = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "alarm_high_percent", pInfo->alarm_high_percent);
|
|
|
}
|
|
|
{
|
|
|
auto val = yyjson_obj_get(conf, "alarm_low_percent");
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->alarm_low_percent = yyjson_get_int(val);
|
|
|
+ else
|
|
|
+ pInfo->alarm_low_percent = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "alarm_low_percent", pInfo->alarm_low_percent);
|
|
|
}
|
|
|
|
|
|
@@ -917,16 +929,16 @@ int DealPosttRetesionForce(const char* body_ptr, const size_t body_len, const st
|
|
|
auto val = yyjson_obj_get(conf, "alarm_high_percent");
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->alarm_high_percent = yyjson_get_int(val);
|
|
|
- //else
|
|
|
- // pInfo->alarm_high_percent = INT_MIN;
|
|
|
+ else
|
|
|
+ pInfo->alarm_high_percent = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "alarm_high_percent", pInfo->alarm_high_percent);
|
|
|
}
|
|
|
{
|
|
|
auto val = yyjson_obj_get(conf, "alarm_low_percent");
|
|
|
if (val && yyjson_is_int(val))
|
|
|
pInfo->alarm_low_percent = yyjson_get_int(val);
|
|
|
- //else
|
|
|
- // pInfo->alarm_low_percent = INT_MIN;
|
|
|
+ else
|
|
|
+ pInfo->alarm_low_percent = INT_MIN;
|
|
|
yyjson_mut_obj_add_int(doc, root, "alarm_low_percent", pInfo->alarm_low_percent);
|
|
|
}
|
|
|
|