|
@@ -20,37 +20,42 @@ public class DataController {
|
|
|
Boolean flag=true;
|
|
|
Map<String,Integer> map=new HashMap<>();
|
|
|
|
|
|
- //ModbusReader.getData(jsonObject);
|
|
|
+ ModbusReader.getData(jsonObject);
|
|
|
+ ModbusReader1.getData(jsonObject);
|
|
|
|
|
|
- jsonObject.put("1600",0);
|
|
|
- jsonObject.put("1601",0);
|
|
|
- jsonObject.put("1602",0);
|
|
|
- jsonObject.put("1603",0);
|
|
|
- jsonObject.put("1604",0);
|
|
|
- jsonObject.put("1605",0);
|
|
|
- jsonObject.put("1606",0);
|
|
|
- jsonObject.put("1607",0);
|
|
|
+ /*jsonObject.put("3000",0);
|
|
|
+ jsonObject.put("3001",0);
|
|
|
+ jsonObject.put("3002",0);
|
|
|
+ jsonObject.put("3003",0);
|
|
|
+ jsonObject.put("3004",0);
|
|
|
+ jsonObject.put("3005",0);
|
|
|
+ jsonObject.put("3006",0);
|
|
|
+ jsonObject.put("3007",0);*/
|
|
|
|
|
|
|
|
|
//ph值到浊度值
|
|
|
- jsonObject.put("ph",jsonObject.get("1600"));
|
|
|
- jsonObject.put("rjy",jsonObject.get("1601"));
|
|
|
- jsonObject.put("ddl",jsonObject.get("1602"));
|
|
|
- jsonObject.put("dzl",jsonObject.get("1603"));
|
|
|
- jsonObject.put("wdz",jsonObject.get("1604"));
|
|
|
- jsonObject.put("tds",jsonObject.get("1605"));
|
|
|
- jsonObject.put("ryz",jsonObject.get("1606"));
|
|
|
- jsonObject.put("zdz",jsonObject.get("1607"));
|
|
|
+ jsonObject.put("ph",jsonObject.get("3000"));
|
|
|
+ jsonObject.put("rjy",jsonObject.get("3001"));
|
|
|
+ jsonObject.put("ddl",jsonObject.get("3002"));
|
|
|
+ jsonObject.put("dzl",jsonObject.get("3003"));
|
|
|
+ jsonObject.put("wdz",jsonObject.get("3004"));
|
|
|
+ jsonObject.put("tds",jsonObject.get("3005"));
|
|
|
+ jsonObject.put("ryz",jsonObject.get("3006"));
|
|
|
+ jsonObject.put("zdz",jsonObject.get("3007"));
|
|
|
|
|
|
|
|
|
|
|
|
- jsonObject.put("1612",1);
|
|
|
+ /*jsonObject.put("1612",1);
|
|
|
jsonObject.put("1613",0);
|
|
|
- jsonObject.put("1614",0);
|
|
|
+ jsonObject.put("1614",0);*/
|
|
|
+ float iff = Float.parseFloat(jsonObject.get("1612").toString());
|
|
|
+ float yff = Float.parseFloat(jsonObject.get("1613").toString());
|
|
|
+ float zff = Float.parseFloat(jsonObject.get("1614").toString());
|
|
|
+
|
|
|
//设备情况
|
|
|
- int i = Integer.parseInt(jsonObject.get("1612").toString());
|
|
|
- int y = Integer.parseInt(jsonObject.get("1613").toString());
|
|
|
- int z = Integer.parseInt(jsonObject.get("1614").toString());
|
|
|
+ int i = (int)iff;
|
|
|
+ int y = (int)yff;
|
|
|
+ int z = (int)zff;
|
|
|
jsonObject.put("slqk",jsonObject.get("1612"));
|
|
|
jsonObject.put("pyqk",jsonObject.get("1613"));
|
|
|
jsonObject.put("xyqk",jsonObject.get("1614"));
|
|
@@ -61,13 +66,13 @@ public class DataController {
|
|
|
|
|
|
//出液温度 排液温度
|
|
|
|
|
|
- jsonObject.put("1600",0);
|
|
|
+ /*jsonObject.put("1600",0);
|
|
|
jsonObject.put("1601",0);
|
|
|
jsonObject.put("1602",0);
|
|
|
jsonObject.put("1603",0);
|
|
|
jsonObject.put("1604",0);
|
|
|
jsonObject.put("1605",0);
|
|
|
-
|
|
|
+*/
|
|
|
jsonObject.put("cywd",jsonObject.get("1600"));
|
|
|
jsonObject.put("pywd",jsonObject.get("1601"));
|
|
|
jsonObject.put("pgwd",jsonObject.get("1602"));
|
|
@@ -77,20 +82,20 @@ public class DataController {
|
|
|
jsonObject.put("1000",2);
|
|
|
jsonObject.put("1001",45);
|
|
|
jsonObject.put("1002",2);
|
|
|
- jsonObject.put("1003",45);
|
|
|
- jsonObject.put("1004",2);
|
|
|
- jsonObject.put("1005",45);
|
|
|
- jsonObject.put("1006",2);
|
|
|
- jsonObject.put("1007",45);
|
|
|
- jsonObject.put("1008",2);
|
|
|
+ jsonObject.put("1003",55);
|
|
|
+ jsonObject.put("1004",0);
|
|
|
+ jsonObject.put("1005",90);
|
|
|
+ jsonObject.put("1006",0);
|
|
|
+ jsonObject.put("1007",90);
|
|
|
+ jsonObject.put("1008",4);
|
|
|
jsonObject.put("1009",45);
|
|
|
jsonObject.put("1010",2);
|
|
|
- jsonObject.put("1011",45);
|
|
|
+ jsonObject.put("1011",50);
|
|
|
|
|
|
|
|
|
- int wd1600 = Integer.parseInt(jsonObject.get("1600").toString());
|
|
|
- int wd1000 = Integer.parseInt(jsonObject.get("1000").toString());
|
|
|
- int wd1001 = Integer.parseInt(jsonObject.get("1001").toString());
|
|
|
+ float wd1600 = Float.parseFloat(jsonObject.get("1600").toString());
|
|
|
+ float wd1000 = Float.parseFloat(jsonObject.get("1000").toString());
|
|
|
+ float wd1001 = Float.parseFloat(jsonObject.get("1001").toString());
|
|
|
if(wd1000 <= wd1600 && wd1600 <= wd1001){
|
|
|
jsonObject.put("cywdc",0);
|
|
|
}else{
|
|
@@ -98,9 +103,9 @@ public class DataController {
|
|
|
flag=false;
|
|
|
}
|
|
|
|
|
|
- int wd1601 = Integer.parseInt(jsonObject.get("1601").toString());
|
|
|
- int wd1002 = Integer.parseInt(jsonObject.get("1002").toString());
|
|
|
- int wd1003 = Integer.parseInt(jsonObject.get("1003").toString());
|
|
|
+ float wd1601 = Float.parseFloat(jsonObject.get("1601").toString());
|
|
|
+ float wd1002 = Float.parseFloat(jsonObject.get("1002").toString());
|
|
|
+ float wd1003 = Float.parseFloat(jsonObject.get("1003").toString());
|
|
|
if(wd1002 <= wd1601 && wd1601 <= wd1003){
|
|
|
jsonObject.put("pywdc",0);
|
|
|
}else{
|
|
@@ -108,9 +113,9 @@ public class DataController {
|
|
|
flag=false;
|
|
|
}
|
|
|
|
|
|
- int wd1602 = Integer.parseInt(jsonObject.get("1602").toString());
|
|
|
- int wd1004 = Integer.parseInt(jsonObject.get("1004").toString());
|
|
|
- int wd1005 = Integer.parseInt(jsonObject.get("1005").toString());
|
|
|
+ float wd1602 = Float.parseFloat(jsonObject.get("1602").toString());
|
|
|
+ float wd1004 = Float.parseFloat(jsonObject.get("1004").toString());
|
|
|
+ float wd1005 = Float.parseFloat(jsonObject.get("1005").toString());
|
|
|
if(wd1004 <= wd1602 && wd1602 <= wd1005){
|
|
|
jsonObject.put("pgwdc",0);
|
|
|
}else{
|
|
@@ -118,9 +123,9 @@ public class DataController {
|
|
|
flag=false;
|
|
|
}
|
|
|
|
|
|
- int wd1603 = Integer.parseInt(jsonObject.get("1603").toString());
|
|
|
- int wd1006 = Integer.parseInt(jsonObject.get("1006").toString());
|
|
|
- int wd1007 = Integer.parseInt(jsonObject.get("1007").toString());
|
|
|
+ float wd1603 = Float.parseFloat(jsonObject.get("1603").toString());
|
|
|
+ float wd1006 = Float.parseFloat(jsonObject.get("1006").toString());
|
|
|
+ float wd1007 = Float.parseFloat(jsonObject.get("1007").toString());
|
|
|
if(wd1006 <= wd1603 && wd1603 <= wd1007){
|
|
|
jsonObject.put("hjwdc",0);
|
|
|
}else{
|
|
@@ -130,11 +135,11 @@ public class DataController {
|
|
|
|
|
|
|
|
|
//制冷模式 水箱温度
|
|
|
- jsonObject.put("1610",0);
|
|
|
- jsonObject.put("1605",20);
|
|
|
-
|
|
|
-
|
|
|
- jsonObject.put("zlms",jsonObject.get("1610"));
|
|
|
+ /*jsonObject.put("1610",0);
|
|
|
+ jsonObject.put("1605",20);*/
|
|
|
+
|
|
|
+ float zlmsf = Float.parseFloat(jsonObject.get("1610").toString())*10;
|
|
|
+ jsonObject.put("zlms",(int)zlmsf);
|
|
|
jsonObject.put("sxwd",jsonObject.get("1605"));
|
|
|
|
|
|
jsonObject.put("status",flag);
|