|
@ -44,6 +44,11 @@ public class QueryXZAgvDeviceStatus { |
|
|
JSONObject body = JSONObject.parseObject(response.body()); |
|
|
JSONObject body = JSONObject.parseObject(response.body()); |
|
|
JSONArray ja = body.getJSONArray("report"); |
|
|
JSONArray ja = body.getJSONArray("report"); |
|
|
for (int i = 0; i < ja.size(); i++) { |
|
|
for (int i = 0; i < ja.size(); i++) { |
|
|
|
|
|
System.out.println(ja.getJSONObject(1)); |
|
|
|
|
|
if (i == 1){ |
|
|
|
|
|
System.out.println(i); |
|
|
|
|
|
} |
|
|
|
|
|
System.out.println("此刻i=" + i); |
|
|
JSONObject jo = ja.getJSONObject(i); |
|
|
JSONObject jo = ja.getJSONObject(i); |
|
|
//机器人编码
|
|
|
//机器人编码
|
|
|
String agv_code = jo.getString("uuid"); |
|
|
String agv_code = jo.getString("uuid"); |
|
@ -76,6 +81,7 @@ public class QueryXZAgvDeviceStatus { |
|
|
String status = "0"; |
|
|
String status = "0"; |
|
|
if (connectionStatus == 0) { |
|
|
if (connectionStatus == 0) { |
|
|
status = "5"; |
|
|
status = "5"; |
|
|
|
|
|
task_type = "0"; |
|
|
} else { |
|
|
} else { |
|
|
if (procBusiness) { |
|
|
if (procBusiness) { |
|
|
//工作中
|
|
|
//工作中
|
|
@ -84,13 +90,16 @@ public class QueryXZAgvDeviceStatus { |
|
|
if (charging) { |
|
|
if (charging) { |
|
|
//充电中
|
|
|
//充电中
|
|
|
status = "2"; |
|
|
status = "2"; |
|
|
|
|
|
task_type = "0"; |
|
|
} else { |
|
|
} else { |
|
|
if (is_error) { |
|
|
if (is_error) { |
|
|
//故障
|
|
|
//故障
|
|
|
status = "3"; |
|
|
status = "3"; |
|
|
|
|
|
task_type = "0"; |
|
|
} else { |
|
|
} else { |
|
|
//休息中
|
|
|
//休息中
|
|
|
status = "4"; |
|
|
status = "4"; |
|
|
|
|
|
task_type = "0"; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -102,10 +111,10 @@ public class QueryXZAgvDeviceStatus { |
|
|
String kepStatus = String.valueOf(maGangAgvDeviceDriver.getStatus()); |
|
|
String kepStatus = String.valueOf(maGangAgvDeviceDriver.getStatus()); |
|
|
String kepType = String.valueOf(maGangAgvDeviceDriver.getType()); |
|
|
String kepType = String.valueOf(maGangAgvDeviceDriver.getType()); |
|
|
if (!StrUtil.equals(kepStatus, status)) { |
|
|
if (!StrUtil.equals(kepStatus, status)) { |
|
|
maGangAgvDeviceDriver.writing("status", Integer.parseInt(status)); |
|
|
maGangAgvDeviceDriver.writing1("status", status); |
|
|
} |
|
|
} |
|
|
if (!StrUtil.equals(kepType, task_type)) { |
|
|
if (!StrUtil.equals(kepType, task_type)) { |
|
|
maGangAgvDeviceDriver.writing("type", Integer.parseInt(task_type)); |
|
|
maGangAgvDeviceDriver.writing1("type", task_type); |
|
|
} |
|
|
} |
|
|
maGangAgvDeviceDriver.writing("x_coordinate", hisFormat.format(x)); |
|
|
maGangAgvDeviceDriver.writing("x_coordinate", hisFormat.format(x)); |
|
|
maGangAgvDeviceDriver.writing("y_coordinate", hisFormat.format(y)); |
|
|
maGangAgvDeviceDriver.writing("y_coordinate", hisFormat.format(y)); |
|
@ -114,7 +123,8 @@ public class QueryXZAgvDeviceStatus { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
|
|
|
System.out.println("出现异常"); |
|
|
|
|
|
e.printStackTrace(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|