|
@ -36,41 +36,74 @@ public class ToAgvDevice { |
|
|
for (AgvDto agvDto : agv_map.values()) { |
|
|
for (AgvDto agvDto : agv_map.values()) { |
|
|
row.put("device_code", agvDto.getName()); |
|
|
row.put("device_code", agvDto.getName()); |
|
|
row.put("energyLevel", agvDto.getEnergyLevel()); |
|
|
row.put("energyLevel", agvDto.getEnergyLevel()); |
|
|
if (agvDto.getState().equals("UNKNOWN")) { |
|
|
// 车状态:
|
|
|
|
|
|
// 1:关机
|
|
|
|
|
|
// 2:运行中
|
|
|
|
|
|
// 3:交通管制
|
|
|
|
|
|
// 4:任务等待
|
|
|
|
|
|
// 5:充电中
|
|
|
|
|
|
// 6:故障中
|
|
|
|
|
|
// 7:低电量
|
|
|
|
|
|
if (agvDto.getState().equals("1")) { |
|
|
|
|
|
row.put("device_status", "UNKNOWN"); |
|
|
|
|
|
row.put("status_name", "关机"); |
|
|
|
|
|
} else if (agvDto.getState().equals("2")) { |
|
|
|
|
|
row.put("device_status", "EXECUTING"); |
|
|
row.put("status_name", "有任务"); |
|
|
row.put("status_name", "有任务"); |
|
|
row.put("flag", "1"); |
|
|
} else if (agvDto.getState().equals("3")) { |
|
|
} |
|
|
// row.put("device_status", "EXECUTING");
|
|
|
if (agvDto.getState().equals("UNAVAILABLE")) { |
|
|
// row.put("status_name", "交通管制");
|
|
|
row.put("status_name", "网络异常"); |
|
|
} else if (agvDto.getState().equals("4")) { |
|
|
row.put("flag", "1"); |
|
|
row.put("device_status", "IDLE"); |
|
|
} |
|
|
|
|
|
if (agvDto.getState().equals("ERROR")) { |
|
|
|
|
|
row.put("status_name", "机器错误"); |
|
|
|
|
|
row.put("flag", "1"); |
|
|
|
|
|
} |
|
|
|
|
|
if (agvDto.getState().equals("IDLE")) { |
|
|
|
|
|
row.put("status_name", "空闲"); |
|
|
row.put("status_name", "空闲"); |
|
|
row.put("flag", "0"); |
|
|
} else if (agvDto.getState().equals("5")) { |
|
|
} |
|
|
row.put("device_status", "CHARGING"); |
|
|
if (agvDto.getState().equals("EXECUTING")) { |
|
|
row.put("status_name", "充电"); |
|
|
row.put("status_name", "运行中"); |
|
|
} else if (agvDto.getState().equals("6")) { |
|
|
row.put("flag", "0"); |
|
|
row.put("device_status", "ERROR"); |
|
|
} |
|
|
row.put("status_name", "故障"); |
|
|
if (agvDto.getState().equals("CHARGING")) { |
|
|
} else if (agvDto.getState().equals("7")) { |
|
|
row.put("status_name", "充电中"); |
|
|
// row.put("device_status", "ERROR");
|
|
|
row.put("flag", "0"); |
|
|
// row.put("status_name", "低电量");
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (agvDto.getState().equals("UNKNOWN")) {
|
|
|
|
|
|
// row.put("status_name", "有任务");
|
|
|
|
|
|
// row.put("status_name", "有任务");
|
|
|
|
|
|
// row.put("flag", "1");
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (agvDto.getState().equals("UNAVAILABLE")) {
|
|
|
|
|
|
// row.put("status_name", "网络异常");
|
|
|
|
|
|
// row.put("flag", "1");
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (agvDto.getState().equals("ERROR")) {
|
|
|
|
|
|
// row.put("status_name", "机器错误");
|
|
|
|
|
|
// row.put("flag", "1");
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (agvDto.getState().equals("IDLE")) {
|
|
|
|
|
|
// row.put("status_name", "空闲");
|
|
|
|
|
|
// row.put("flag", "0");
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (agvDto.getState().equals("EXECUTING")) {
|
|
|
|
|
|
// row.put("status_name", "运行中");
|
|
|
|
|
|
// row.put("flag", "0");
|
|
|
|
|
|
// }
|
|
|
|
|
|
// if (agvDto.getState().equals("CHARGING")) {
|
|
|
|
|
|
// row.put("status_name", "充电中");
|
|
|
|
|
|
// row.put("flag", "0");
|
|
|
|
|
|
// }
|
|
|
row.put("transportOrder", agvDto.getTransportOrder()); |
|
|
row.put("transportOrder", agvDto.getTransportOrder()); |
|
|
row.put("positionX", agvDto.getPositionX()); |
|
|
row.put("positionX", agvDto.getPositionX()); |
|
|
row.put("positionY", agvDto.getPositionY()); |
|
|
row.put("positionY", agvDto.getPositionY()); |
|
|
row.put("positionAngle", agvDto.getPositionAngle()); |
|
|
row.put("positionAngle", agvDto.getPositionAngle()); |
|
|
agv_rows.add(row); |
|
|
agv_rows.add(row); |
|
|
} |
|
|
} |
|
|
json.put("agv_rows", agv_rows); |
|
|
// json.put("agv_rows", agv_rows);
|
|
|
SocketMsg deviceInfo = new SocketMsg(json, MsgType.INFO); |
|
|
// SocketMsg deviceInfo = new SocketMsg(json, MsgType.INFO);
|
|
|
WebSocketServer.sendInfo(deviceInfo, "toAgvDevice_data"); |
|
|
// WebSocketServer.sendInfo(deviceInfo, "toAgvDevice_data");
|
|
|
|
|
|
|
|
|
// acsToWmsService.feedbackAgv(row);
|
|
|
acsToWmsService.feedbackAgv(agv_rows); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|