Browse Source

1、北师大压变;

prod_20251209
25604 2 weeks ago
parent
commit
ada1d2ec2f
  1. 7
      user-service/src/main/java/com/mh/user/strategy/PressureTransStrategy.java

7
user-service/src/main/java/com/mh/user/strategy/PressureTransStrategy.java

@ -55,7 +55,7 @@ public class PressureTransStrategy implements DeviceStrategy {
} else if (Constant.BRAND_RU_YI.equals(brand)) { } else if (Constant.BRAND_RU_YI.equals(brand)) {
str = str + "0300040001"; str = str + "0300040001";
} else if (Constant.BRAND_MEI_YI.equals(brand)) { } else if (Constant.BRAND_MEI_YI.equals(brand)) {
str = str + "0304040002"; // 压力输出值 str = str + "0300040001"; // 压力输出值
} else { } else {
str = str + "0300000002"; // 压力变送器(新的协议) str = str + "0300000002"; // 压力变送器(新的协议)
} }
@ -88,8 +88,9 @@ public class PressureTransStrategy implements DeviceStrategy {
data = ExchangeStringUtil.hexToDec(checkStr.substring(6, 10));//十六进制转整形 data = ExchangeStringUtil.hexToDec(checkStr.substring(6, 10));//十六进制转整形
wtHeight = Double.parseDouble(data) / 100 * 0.102; //通过压力求水高 wtHeight = Double.parseDouble(data) / 100 * 0.102; //通过压力求水高
} else if (Constant.BRAND_MEI_YI.equals(brand)) { } else if (Constant.BRAND_MEI_YI.equals(brand)) {
data = ExchangeStringUtil.hexToDec(checkStr.substring(6, 14));//十六进制转整形 // 14030206D637B9
wtHeight = Double.parseDouble(data); data = ExchangeStringUtil.hexToDec(checkStr.substring(6, 10));//十六进制转整形
wtHeight = Double.parseDouble(data) / 100 * 0.102; //通过压力求水高
} }
Double tankHeight; Double tankHeight;
// 默认是高区域 // 默认是高区域

Loading…
Cancel
Save