修改d331告警清除
This commit is contained in:
parent
05e79800c7
commit
877c107625
@ -42,10 +42,23 @@ public class WarningServiceImpl implements WarningService {
|
|||||||
@Override
|
@Override
|
||||||
public void checkB562Num(String deviceId, Integer tenantId,
|
public void checkB562Num(String deviceId, Integer tenantId,
|
||||||
int[] numB562Stat){
|
int[] numB562Stat){
|
||||||
|
GnssStatus status = gnssStatusMapper.getByDeviceId(deviceId);
|
||||||
|
if(status == null) return;
|
||||||
|
|
||||||
if(cfgMap.size() == 0) refreshCfg();
|
if(cfgMap.size() == 0) refreshCfg();
|
||||||
|
boolean isUpdated = false;
|
||||||
|
if ((status.getWarningcode() & (WarningCfg.TYPE_NO_FIXED_RESULT
|
||||||
|
| WarningCfg.TYPE_LESS_B562
|
||||||
|
| WarningCfg.TYPE_LESS_D3XX)) != 0) {
|
||||||
|
status.setWarningcode(status.getWarningcode() & ~WarningCfg.TYPE_NO_FIXED_RESULT);
|
||||||
|
status.setWarningcode(status.getWarningcode() & ~WarningCfg.TYPE_LESS_B562);
|
||||||
|
status.setWarningcode(status.getWarningcode() & ~WarningCfg.TYPE_LESS_D3XX);
|
||||||
|
isUpdated = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// b562少
|
||||||
int[] threshold = cfgMap.get(WarningCfg.TYPE_LESS_B562);
|
int[] threshold = cfgMap.get(WarningCfg.TYPE_LESS_B562);
|
||||||
if(threshold != null && (numB562Stat[0] < threshold[1])) {
|
if(threshold != null && (numB562Stat[0] < threshold[1])) {
|
||||||
// 检测电压和RSSI
|
|
||||||
WarningMsg warningMsg = new WarningMsg();
|
WarningMsg warningMsg = new WarningMsg();
|
||||||
warningMsg.setDeviceid(deviceId);
|
warningMsg.setDeviceid(deviceId);
|
||||||
warningMsg.setTenantid(tenantId);
|
warningMsg.setTenantid(tenantId);
|
||||||
@ -55,15 +68,13 @@ public class WarningServiceImpl implements WarningService {
|
|||||||
warningMsg.setLevel((short) threshold[0]);
|
warningMsg.setLevel((short) threshold[0]);
|
||||||
warningMsg.setInfo(WarningCfg.TYPE_NAME_LESS_B562+",固定解:" + numB562Stat[0] + ",非固定解:"+numB562Stat[1]+",无B562:"+numB562Stat[2]);
|
warningMsg.setInfo(WarningCfg.TYPE_NAME_LESS_B562+",固定解:" + numB562Stat[0] + ",非固定解:"+numB562Stat[1]+",无B562:"+numB562Stat[2]);
|
||||||
warningMsgMapper.insert(warningMsg);
|
warningMsgMapper.insert(warningMsg);
|
||||||
|
status.setWarningcode(status.getWarningcode()|WarningCfg.TYPE_LESS_B562);
|
||||||
|
isUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
GnssStatus status = gnssStatusMapper.getByDeviceId(deviceId);
|
//连续无b562
|
||||||
// 清除d331告警
|
|
||||||
status.setWarningcode(status.getWarningcode() & ~WarningCfg.TYPE_LESS_D3XX);
|
|
||||||
|
|
||||||
if(0 == numB562Stat[0]){
|
if(0 == numB562Stat[0]){
|
||||||
// 记录连续无固定解的轮数
|
// 记录连续无固定解的轮数
|
||||||
if(status != null){
|
|
||||||
int count = status.getNoreslutcount()+1;
|
int count = status.getNoreslutcount()+1;
|
||||||
status.setNoreslutcount(count);
|
status.setNoreslutcount(count);
|
||||||
int[] threshold2 = cfgMap.get(WarningCfg.TYPE_NO_FIXED_RESULT);
|
int[] threshold2 = cfgMap.get(WarningCfg.TYPE_NO_FIXED_RESULT);
|
||||||
@ -79,21 +90,20 @@ public class WarningServiceImpl implements WarningService {
|
|||||||
warningMsg.setInfo("连续" + count+"周期无固定解");
|
warningMsg.setInfo("连续" + count+"周期无固定解");
|
||||||
warningMsgMapper.insert(warningMsg);
|
warningMsgMapper.insert(warningMsg);
|
||||||
status.setWarningcode(status.getWarningcode()|WarningCfg.TYPE_NO_FIXED_RESULT);
|
status.setWarningcode(status.getWarningcode()|WarningCfg.TYPE_NO_FIXED_RESULT);
|
||||||
|
}
|
||||||
|
isUpdated = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(isUpdated){ //b562有告警标志
|
||||||
|
status.setNoreslutcount(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isUpdated){
|
||||||
// 根据告警码确定告警级别
|
// 根据告警码确定告警级别
|
||||||
status.setWarning(getWarningLevel(status.getWarningcode()));
|
status.setWarning(getWarningLevel(status.getWarningcode()));
|
||||||
}
|
|
||||||
gnssStatusMapper.updateById(status);
|
gnssStatusMapper.updateById(status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
if((status.getWarningcode()&WarningCfg.TYPE_NO_FIXED_RESULT) != 0){
|
|
||||||
status.setWarningcode(status.getWarningcode() & ~WarningCfg.TYPE_NO_FIXED_RESULT);
|
|
||||||
status.setWarning(getWarningLevel(status.getWarningcode()));
|
|
||||||
status.setNoreslutcount(0);
|
|
||||||
gnssStatusMapper.updateById(status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/***
|
/***
|
||||||
* 检查电压、RSSI等
|
* 检查电压、RSSI等
|
||||||
* @param statusMsg
|
* @param statusMsg
|
||||||
@ -165,13 +175,18 @@ public class WarningServiceImpl implements WarningService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkD3xxNum(Device device){
|
public void checkD3xxNum(Device device){
|
||||||
if(device.getD3xxCount() > 0) {
|
|
||||||
GnssStatus status = gnssStatusMapper.getByDeviceId(device.getDeviceId());
|
GnssStatus status = gnssStatusMapper.getByDeviceId(device.getDeviceId());
|
||||||
if(status != null) {
|
if(status != null) {
|
||||||
|
boolean isUpdated = false;
|
||||||
// 清除b562告警
|
// 清除b562告警
|
||||||
|
if((status.getWarningcode() & (WarningCfg.TYPE_NO_FIXED_RESULT
|
||||||
|
|WarningCfg.TYPE_LESS_B562
|
||||||
|
|WarningCfg.TYPE_LESS_D3XX)) !=0 ) {
|
||||||
status.setWarningcode(status.getWarningcode() & ~WarningCfg.TYPE_NO_FIXED_RESULT);
|
status.setWarningcode(status.getWarningcode() & ~WarningCfg.TYPE_NO_FIXED_RESULT);
|
||||||
status.setWarningcode(status.getWarningcode() & ~WarningCfg.TYPE_LESS_B562);
|
status.setWarningcode(status.getWarningcode() & ~WarningCfg.TYPE_LESS_B562);
|
||||||
|
status.setWarningcode(status.getWarningcode() & ~WarningCfg.TYPE_LESS_D3XX);
|
||||||
|
isUpdated = true;
|
||||||
|
}
|
||||||
// 检查d331告警
|
// 检查d331告警
|
||||||
if(cfgMap.size() == 0) refreshCfg();
|
if(cfgMap.size() == 0) refreshCfg();
|
||||||
int[] threshold = cfgMap.get(WarningCfg.TYPE_LESS_D3XX);
|
int[] threshold = cfgMap.get(WarningCfg.TYPE_LESS_D3XX);
|
||||||
@ -186,7 +201,10 @@ public class WarningServiceImpl implements WarningService {
|
|||||||
warningMsg.setInfo(WarningCfg.TYPE_NAME_LESS_D3XX+"," + device.getD3xxCount());
|
warningMsg.setInfo(WarningCfg.TYPE_NAME_LESS_D3XX+"," + device.getD3xxCount());
|
||||||
warningMsgMapper.insert(warningMsg);
|
warningMsgMapper.insert(warningMsg);
|
||||||
status.setWarningcode(status.getWarningcode()|WarningCfg.TYPE_LESS_D3XX);
|
status.setWarningcode(status.getWarningcode()|WarningCfg.TYPE_LESS_D3XX);
|
||||||
|
isUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isUpdated) {
|
||||||
status.setWarning(getWarningLevel(status.getWarningcode()));
|
status.setWarning(getWarningLevel(status.getWarningcode()));
|
||||||
gnssStatusMapper.updateById(status);
|
gnssStatusMapper.updateById(status);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user