|
|
|
@ -4821,9 +4821,12 @@ public class QcServiceImpl implements QcService { |
|
|
|
String ip = location.getIp(); |
|
|
|
int unitId = location.getRegisterAddress(); |
|
|
|
Integer isexceptionAdress = location.getRegisterNumInspection(); |
|
|
|
final int baseAddr = Integer.parseInt(location.getCuttingSymbol()); |
|
|
|
final int groups = location.getRegisterNum(); |
|
|
|
|
|
|
|
// 无工单检验:先看302异常信号,1则读取异常数据并复位,0则直接返回空数据 |
|
|
|
/*if ("Y".equalsIgnoreCase(data.getSpecialTaskFlag())) { |
|
|
|
logger.info("orderNo:{}",data.getOrderNo()); |
|
|
|
if ("000#1".equals(data.getOrderNo())) { |
|
|
|
Integer abnormalSignal = ModbusUtils.readSingleRegister(ip, port, unitId, isexceptionAdress); |
|
|
|
if (abnormalSignal == null || abnormalSignal == 0) { |
|
|
|
return new ArrayList<>(); |
|
|
|
@ -4831,14 +4834,24 @@ public class QcServiceImpl implements QcService { |
|
|
|
ArrayList<SubDetailValues> abnormalRows = getAbnormalCollectorData(ip, port, unitId, data); |
|
|
|
resetCollectorAbnormalRegisters(ip, port, unitId); |
|
|
|
return abnormalRows; |
|
|
|
}*/ |
|
|
|
}else{ |
|
|
|
logger.info(port+","+ip+","+unitId+","+baseAddr+","+groups+","); |
|
|
|
ArrayList<SubDetailValues> collectorDataByModbus = getCollectorDataByModbus(port, ip, unitId, baseAddr, groups, data); |
|
|
|
return collectorDataByModbus; |
|
|
|
} |
|
|
|
/*Integer abnormalSignal = ModbusUtils.readSingleRegister(ip, port, unitId, isexceptionAdress); |
|
|
|
if (abnormalSignal == null || abnormalSignal == 0) { |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
ArrayList<SubDetailValues> abnormalRows = getAbnormalCollectorData(ip, port, unitId, data); |
|
|
|
resetCollectorAbnormalRegisters(ip, port, unitId); |
|
|
|
return abnormalRows;*/ |
|
|
|
|
|
|
|
// 10 组数据起始地址和平均值地址 |
|
|
|
final int baseAddr = Integer.parseInt(location.getCuttingSymbol()); |
|
|
|
final int groups = location.getRegisterNum(); |
|
|
|
logger.info(port+","+ip+","+unitId+","+baseAddr+","+groups+","); |
|
|
|
|
|
|
|
/*logger.info(port+","+ip+","+unitId+","+baseAddr+","+groups+","); |
|
|
|
ArrayList<SubDetailValues> collectorDataByModbus = getCollectorDataByModbus(port, ip, unitId, baseAddr, groups, data); |
|
|
|
return collectorDataByModbus; |
|
|
|
return collectorDataByModbus;*/ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ -4917,6 +4930,7 @@ public class QcServiceImpl implements QcService { |
|
|
|
)); |
|
|
|
subDetailValues.add(detailValues); |
|
|
|
} |
|
|
|
logger.info("解析后获取到的数据:{}",subDetailValues.toString()); |
|
|
|
return subDetailValues; |
|
|
|
} |
|
|
|
|
|
|
|
@ -4934,7 +4948,9 @@ public class QcServiceImpl implements QcService { |
|
|
|
566, 568, 570, 572, 574, |
|
|
|
586, 588, 590, 592, 594 |
|
|
|
)); |
|
|
|
logger.info("开始复位"); |
|
|
|
ModbusUtils.resetRegisters(ip, port, unitId, resetAddrs); |
|
|
|
logger.info("复位结束"); |
|
|
|
} |
|
|
|
|
|
|
|
public ArrayList<SubDetailValues> getCollectorDataByModbus(int port,String ip,int unitId,int baseAddr,int groups,QcFAIRecordData data) throws Exception { |
|
|
|
|