|
|
@ -4964,15 +4964,15 @@ public class QcServiceImpl implements QcService { |
|
|
timeParts.add(timeValue == null ? 0 : (timeValue & 0xFFFF)); |
|
|
timeParts.add(timeValue == null ? 0 : (timeValue & 0xFFFF)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 异常数据地址按32位float读取(高字在前):406/408/410/412/414 ... |
|
|
|
|
|
|
|
|
// 异常 float:406/408…;按高/低字在前各解一次,取合理值(原 (high<<16)|low 仅适用于高字在前) |
|
|
List<Float> abnormalValues = new ArrayList<>(); |
|
|
List<Float> abnormalValues = new ArrayList<>(); |
|
|
for (int i = 0; i < 5; i++) { |
|
|
for (int i = 0; i < 5; i++) { |
|
|
int highRef = abnormalStartAddr + (i * 2); |
|
|
|
|
|
int lowRef = highRef + 1; |
|
|
|
|
|
Integer high = raw.get(highRef); |
|
|
|
|
|
Integer low = raw.get(lowRef); |
|
|
|
|
|
if (high != null && low != null) { |
|
|
|
|
|
abnormalValues.add(ModbusUtils.holdingRegistersToFloatBigEndian(high, low)); |
|
|
|
|
|
|
|
|
int regRef = abnormalStartAddr + (i * 2); |
|
|
|
|
|
int regRefNext = regRef + 1; |
|
|
|
|
|
Integer reg0 = raw.get(regRef); |
|
|
|
|
|
Integer reg1 = raw.get(regRefNext); |
|
|
|
|
|
if (reg0 != null && reg1 != null) { |
|
|
|
|
|
abnormalValues.add(ModbusUtils.parseAbnormalCollectorFloat(reg0, reg1)); |
|
|
} else { |
|
|
} else { |
|
|
abnormalValues.add(0F); |
|
|
abnormalValues.add(0F); |
|
|
} |
|
|
} |
|
|
@ -4997,7 +4997,7 @@ public class QcServiceImpl implements QcService { |
|
|
detailValues.setIsSubmit("N"); |
|
|
detailValues.setIsSubmit("N"); |
|
|
detailValues.setSite(data.getSite()); |
|
|
detailValues.setSite(data.getSite()); |
|
|
detailValues.setNum(1); |
|
|
detailValues.setNum(1); |
|
|
detailValues.setSubDetailValue(String.valueOf(abnormalValues.get(i))); |
|
|
|
|
|
|
|
|
detailValues.setSubDetailValue(ModbusUtils.formatFloatPlain(abnormalValues.get(i))); |
|
|
detailValues.setSubDetailValueB(collectedTime); |
|
|
detailValues.setSubDetailValueB(collectedTime); |
|
|
detailValues.setSamplingLocationB(collectedTime); |
|
|
detailValues.setSamplingLocationB(collectedTime); |
|
|
subDetailValues.add(detailValues); |
|
|
subDetailValues.add(detailValues); |
|
|
@ -5100,7 +5100,7 @@ public class QcServiceImpl implements QcService { |
|
|
Integer high = raw.get(highRef); |
|
|
Integer high = raw.get(highRef); |
|
|
Integer low = raw.get(lowRef); |
|
|
Integer low = raw.get(lowRef); |
|
|
if (low != null && high != null) { |
|
|
if (low != null && high != null) { |
|
|
resultMap.put(String.valueOf(addr), ModbusUtils.holdingRegistersToFloatBigEndian(high, low)); |
|
|
|
|
|
|
|
|
resultMap.put(String.valueOf(addr), ModbusUtils.registersToFloatHighWordFirst(high, low)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -5189,7 +5189,7 @@ public class QcServiceImpl implements QcService { |
|
|
Integer low = raw.get(lowRef); |
|
|
Integer low = raw.get(lowRef); |
|
|
Integer high = raw.get(highRef); |
|
|
Integer high = raw.get(highRef); |
|
|
if (low != null && high != null) { |
|
|
if (low != null && high != null) { |
|
|
resultMap.put(String.valueOf(addr), ModbusUtils.holdingRegistersToFloatBigEndian(high, low)); |
|
|
|
|
|
|
|
|
resultMap.put(String.valueOf(addr), ModbusUtils.registersToFloatLowWordFirst(low, high)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -5199,7 +5199,7 @@ public class QcServiceImpl implements QcService { |
|
|
Integer lowAvg = raw.get(lowRefAvg); |
|
|
Integer lowAvg = raw.get(lowRefAvg); |
|
|
Integer highAvg = raw.get(highRefAvg); |
|
|
Integer highAvg = raw.get(highRefAvg); |
|
|
if (lowAvg != null && highAvg != null) { |
|
|
if (lowAvg != null && highAvg != null) { |
|
|
resultMap.put(String.valueOf(avgAddr), ModbusUtils.holdingRegistersToFloatBigEndian(highAvg, lowAvg)); |
|
|
|
|
|
|
|
|
resultMap.put(String.valueOf(avgAddr), ModbusUtils.registersToFloatLowWordFirst(lowAvg, highAvg)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return resultMap; |
|
|
return resultMap; |
|
|
|