|
@@ -26,6 +26,8 @@ public class DataPieceLiquidBox {
|
|
|
|
|
|
private Integer casingPress; // 当前套压 kpa
|
|
|
|
|
|
+ private Integer batteryVol; //电池电压 mV
|
|
|
+
|
|
|
|
|
|
private List<Short> pieceSerial=new ArrayList<>(10000); //接箍序列(高字节),动液面序列(低字节) 分别对应奇数位,偶数位
|
|
|
|
|
@@ -40,6 +42,31 @@ public class DataPieceLiquidBox {
|
|
|
}
|
|
|
|
|
|
public void putOther(Map<String,Integer> gatherOther) {
|
|
|
+
|
|
|
+ if(gatherOther.containsKey("battery")) {
|
|
|
+ bindBatteryVal(gatherOther);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ bindVal(gatherOther);
|
|
|
+ }
|
|
|
+ //表明是新的采集,先清除旧数据
|
|
|
+ pieceSerial.clear();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 绑定采集数据:电池电压
|
|
|
+ * @param gatherOther
|
|
|
+ */
|
|
|
+ private void bindBatteryVal(Map<String,Integer> gatherOther) {
|
|
|
+ this.batteryVol=gatherOther.get("battery");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 绑定采集数据:采样时间、音速、测量深度、套压
|
|
|
+ * @param gatherOther
|
|
|
+ */
|
|
|
+ private void bindVal(Map<String,Integer> gatherOther) {
|
|
|
this.testTime="20"+String.format("%02d", gatherOther.get("test_time_yy"))+
|
|
|
"-"+String.format("%02d", gatherOther.get("test_time_mm"))+
|
|
|
"-"+String.format("%02d", gatherOther.get("test_time_dd"))+
|
|
@@ -50,9 +77,6 @@ public class DataPieceLiquidBox {
|
|
|
this.soundSpeed=gatherOther.get("sound_speed");
|
|
|
this.testDepth=gatherOther.get("test_depth");
|
|
|
this.casingPress=gatherOther.get("casing_pre");
|
|
|
-
|
|
|
- //表明是新的采集,先清除旧数据
|
|
|
- pieceSerial.clear();
|
|
|
}
|
|
|
|
|
|
//组装liquid,并进行数据转换
|
|
@@ -67,6 +91,7 @@ public class DataPieceLiquidBox {
|
|
|
po.setLiquidDepthDev(testDepth!=null?(testDepth/10.0):null);
|
|
|
po.setCasingPressDev(casingPress!=null?(casingPress/1000.0):null);
|
|
|
po.setTestTime(testTime);
|
|
|
+ po.setBatteryVoltage(batteryVol!=null?(batteryVol/1000.0):null);
|
|
|
|
|
|
po.setDatas(pieceSerial);
|
|
|
|
|
@@ -145,6 +170,14 @@ public class DataPieceLiquidBox {
|
|
|
this.pieceSerial = pieceSerial;
|
|
|
}
|
|
|
|
|
|
+ public Integer getBatteryVo() {
|
|
|
+ return batteryVol;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setBatteryVo(Integer batteryVol) {
|
|
|
+ this.batteryVol = batteryVol;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|