1、优化告警处理
This commit is contained in:
parent
a4bc54eb08
commit
8558852774
@ -1,6 +1,7 @@
|
|||||||
package com.imdroid.sideslope.service;
|
package com.imdroid.sideslope.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.imdroid.common.util.NumberUtils;
|
||||||
import com.imdroid.secapi.dto.*;
|
import com.imdroid.secapi.dto.*;
|
||||||
import com.imdroid.sideslope.sal.Device;
|
import com.imdroid.sideslope.sal.Device;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -57,7 +58,8 @@ public class WarningServiceImpl implements WarningService {
|
|||||||
// b562少
|
// b562少
|
||||||
if(check(status, WarningCfg.TYPE_LESS_B562,
|
if(check(status, WarningCfg.TYPE_LESS_B562,
|
||||||
WarningCfg.TYPE_NAME_LESS_B562,true,
|
WarningCfg.TYPE_NAME_LESS_B562,true,
|
||||||
numB562Stat[0],null)) isUpdated=true;
|
numB562Stat[0],null,
|
||||||
|
"固定解:"+numB562Stat[0]+",浮点解:"+numB562Stat[1]+",全零:"+numB562Stat[2])) isUpdated=true;
|
||||||
|
|
||||||
//连续无b562
|
//连续无b562
|
||||||
if(0 == numB562Stat[0]){
|
if(0 == numB562Stat[0]){
|
||||||
@ -66,7 +68,7 @@ public class WarningServiceImpl implements WarningService {
|
|||||||
status.setNoreslutcount(count);
|
status.setNoreslutcount(count);
|
||||||
if(check(status, WarningCfg.TYPE_NO_FIXED_RESULT,
|
if(check(status, WarningCfg.TYPE_NO_FIXED_RESULT,
|
||||||
WarningCfg.TYPE_NAME_NO_FIXED_RESULT, false,
|
WarningCfg.TYPE_NAME_NO_FIXED_RESULT, false,
|
||||||
count, null)) isUpdated=true;
|
count, null,null)) isUpdated=true;
|
||||||
}
|
}
|
||||||
else if(isUpdated){ //b562有告警标志
|
else if(isUpdated){ //b562有告警标志
|
||||||
status.setNoreslutcount(0);
|
status.setNoreslutcount(0);
|
||||||
@ -97,20 +99,22 @@ public class WarningServiceImpl implements WarningService {
|
|||||||
if(statusMsg.getVoltage()!=null) {
|
if(statusMsg.getVoltage()!=null) {
|
||||||
if(check(curStatus, WarningCfg.TYPE_LOW_VOLTAGE,
|
if(check(curStatus, WarningCfg.TYPE_LOW_VOLTAGE,
|
||||||
WarningCfg.TYPE_NAME_LOW_VOLTAGE,true,
|
WarningCfg.TYPE_NAME_LOW_VOLTAGE,true,
|
||||||
statusMsg.getVoltage(), null)) isUpdated=true;
|
statusMsg.getVoltage(), null,null)) isUpdated=true;
|
||||||
}
|
}
|
||||||
//低RSSI
|
//低RSSI
|
||||||
if(statusMsg.getRssi()!=null) {
|
if(statusMsg.getRssi()!=null) {
|
||||||
if(check(curStatus, WarningCfg.TYPE_LOW_RSSI,
|
if(check(curStatus, WarningCfg.TYPE_LOW_RSSI,
|
||||||
WarningCfg.TYPE_NAME_LOW_RSSI,true,
|
WarningCfg.TYPE_NAME_LOW_RSSI,true,
|
||||||
statusMsg.getRssi().intValue(), null)) isUpdated=true;
|
statusMsg.getRssi().intValue(), null,null)) isUpdated=true;
|
||||||
}
|
}
|
||||||
//倾角异常告警
|
//倾角异常告警
|
||||||
if(statusMsg.getPitch()!=null) {
|
if(statusMsg.getPitch()!=null) {
|
||||||
if(check(curStatus, WarningCfg.TYPE_INCLINE,
|
if(check(curStatus, WarningCfg.TYPE_INCLINE,
|
||||||
WarningCfg.TYPE_NAME_INCLINE,false,
|
WarningCfg.TYPE_NAME_INCLINE,false,
|
||||||
Math.abs(statusMsg.getPitch().intValue()),
|
Math.abs(statusMsg.getPitch().intValue()),
|
||||||
Math.abs(statusMsg.getRoll().intValue()))) isUpdated=true;
|
Math.abs(statusMsg.getRoll().intValue()),
|
||||||
|
"pitch:"+ NumberUtils.scaleTwo(statusMsg.getPitch().doubleValue())
|
||||||
|
+",roll:"+NumberUtils.scaleTwo(statusMsg.getRoll().doubleValue()))) isUpdated=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据告警码确定告警级别
|
// 根据告警码确定告警级别
|
||||||
@ -120,7 +124,8 @@ public class WarningServiceImpl implements WarningService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean check(GnssStatus curStatus, int warningType, String warningName, boolean isLessCmp, Integer value1, Integer value2){
|
boolean check(GnssStatus curStatus, int warningType, String warningName,
|
||||||
|
boolean isLessCmp, Integer value1, Integer value2, String auxInfo){
|
||||||
boolean isUpdated=false;
|
boolean isUpdated=false;
|
||||||
int newWarningCode = 0;
|
int newWarningCode = 0;
|
||||||
int[] warningValues = cfgMap.get(warningType);
|
int[] warningValues = cfgMap.get(warningType);
|
||||||
@ -157,9 +162,11 @@ public class WarningServiceImpl implements WarningService {
|
|||||||
warningMsg.setDevicetype(WarningCfg.TYPE_GNSS);
|
warningMsg.setDevicetype(WarningCfg.TYPE_GNSS);
|
||||||
warningMsg.setCode(warningType);
|
warningMsg.setCode(warningType);
|
||||||
warningMsg.setLevel((short) warningValues[0]);
|
warningMsg.setLevel((short) warningValues[0]);
|
||||||
String info = warningName + ":" + value1;
|
if(auxInfo ==null) {
|
||||||
if(value2!=null) info = info +","+value2;
|
auxInfo = warningName + ":" + value1;
|
||||||
warningMsg.setInfo(info);
|
if (value2 != null) auxInfo = auxInfo + "," + value2;
|
||||||
|
}
|
||||||
|
warningMsg.setInfo(auxInfo);
|
||||||
warningMsgMapper.insert(warningMsg);
|
warningMsgMapper.insert(warningMsg);
|
||||||
//告警级别
|
//告警级别
|
||||||
curStatus.setWarningcode(curStatus.getWarningcode() | warningType);
|
curStatus.setWarningcode(curStatus.getWarningcode() | warningType);
|
||||||
@ -198,7 +205,7 @@ public class WarningServiceImpl implements WarningService {
|
|||||||
// 检查d331告警
|
// 检查d331告警
|
||||||
if(check(status, WarningCfg.TYPE_LESS_D3XX,
|
if(check(status, WarningCfg.TYPE_LESS_D3XX,
|
||||||
WarningCfg.TYPE_NAME_LESS_D3XX,true,
|
WarningCfg.TYPE_NAME_LESS_D3XX,true,
|
||||||
device.getD3xxCount(), null)) isUpdated=true;
|
device.getD3xxCount(), null,null)) isUpdated=true;
|
||||||
|
|
||||||
if(isUpdated) {
|
if(isUpdated) {
|
||||||
status.setWarning(getWarningLevel(status.getWarningcode()));
|
status.setWarning(getWarningLevel(status.getWarningcode()));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user