|
@@ -62,8 +62,11 @@ public class ModbusReciveJob {
|
|
public void timingTunnel() {
|
|
public void timingTunnel() {
|
|
List<TunnelInfo> tunnelInfoList = tunnelInfoService.list();
|
|
List<TunnelInfo> tunnelInfoList = tunnelInfoService.list();
|
|
for (TunnelInfo tunnelInfo : tunnelInfoList) {
|
|
for (TunnelInfo tunnelInfo : tunnelInfoList) {
|
|
- ModbusTcpMasterBuilder master = start(tunnelInfo);
|
|
|
|
- masterMap.put(tunnelInfo.getStationId(), master);
|
|
|
|
|
|
+ //过滤不可用通道
|
|
|
|
+ if(null != tunnelInfo.getIsAble() && tunnelInfo.getIsAble().equals("0")) {
|
|
|
|
+ ModbusTcpMasterBuilder master = start(tunnelInfo);
|
|
|
|
+ masterMap.put(tunnelInfo.getStationId(), master);
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -173,7 +176,7 @@ public class ModbusReciveJob {
|
|
for (Map.Entry<Integer, IModbusDataType> typeEntry : registerData.entrySet()) {
|
|
for (Map.Entry<Integer, IModbusDataType> typeEntry : registerData.entrySet()) {
|
|
for (Map.Entry<String, Integer> entry : stringStringBuilderMap.entrySet()) {
|
|
for (Map.Entry<String, Integer> entry : stringStringBuilderMap.entrySet()) {
|
|
if (typeEntry.getKey().equals(entry.getValue())) {
|
|
if (typeEntry.getKey().equals(entry.getValue())) {
|
|
- log.info("点位:{}-----数值:{}", typeEntry.getKey(), ((NumericModbusData) typeEntry.getValue()).getValue());
|
|
|
|
|
|
+ log.info("塔:{} 点位:{}-----数值:{}",tunnelInfo.getEquipmentNo(), typeEntry.getKey(), ((NumericModbusData) typeEntry.getValue()).getValue());
|
|
//点位一致 置换value
|
|
//点位一致 置换value
|
|
pointMap.put(entry.getKey(), ((NumericModbusData) typeEntry.getValue()).getValue());
|
|
pointMap.put(entry.getKey(), ((NumericModbusData) typeEntry.getValue()).getValue());
|
|
}
|
|
}
|
|
@@ -188,9 +191,6 @@ public class ModbusReciveJob {
|
|
}
|
|
}
|
|
wsHeightSet.addAll(wdHeightSet);
|
|
wsHeightSet.addAll(wdHeightSet);
|
|
|
|
|
|
- //List<Map<String, Object>> mapList = new CheckDataRecode().checkValue((List<Map<String, Object>>) pointMap, "station");
|
|
|
|
-
|
|
|
|
- //log.info("校验前数据:{} ;;; 校验后数据:{}",JSONUtil.parse(pointMap),JSONUtil.parse(mapList));
|
|
|
|
windTowerDataParentTableService.saveDataForTunnel(pointMap, wsHeightSet, tunnelInfo.getEquipmentNo(), time);
|
|
windTowerDataParentTableService.saveDataForTunnel(pointMap, wsHeightSet, tunnelInfo.getEquipmentNo(), time);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
log.error("modbus 接入测风塔:{} 的数据错误:{}",masterBuilderEntry.getKey() ,e);
|
|
log.error("modbus 接入测风塔:{} 的数据错误:{}",masterBuilderEntry.getKey() ,e);
|