|
|
@ -4,20 +4,15 @@ import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.nl.acs.agv.server.AgvService; |
|
|
|
import org.nl.acs.agv.server.dto.AgvDto; |
|
|
|
import org.nl.acs.device_driver.basedriver.agv.ndcone.AgvNdcOneDeviceDriver; |
|
|
|
import org.nl.acs.ext.wms.service.AcsToWmsService; |
|
|
|
import org.nl.acs.opc.Device; |
|
|
|
import org.nl.acs.opc.DeviceAppService; |
|
|
|
import org.nl.acs.opc.DeviceType; |
|
|
|
import org.nl.modules.mnt.websocket.MsgType; |
|
|
|
import org.nl.modules.mnt.websocket.SocketMsg; |
|
|
|
import org.nl.modules.mnt.websocket.WebSocketServer; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询AGV设备状态 |
|
|
@ -42,8 +37,8 @@ public class ToAgvDevice { |
|
|
|
for(Device device:deviceList) { |
|
|
|
if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) { |
|
|
|
agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver(); |
|
|
|
row.put("device_code", agvNdcOneDeviceDriver.getDevice_code()); |
|
|
|
row.put("energyLevel", agvNdcOneDeviceDriver.getElectric_qty()); |
|
|
|
row.put("device_code", String.valueOf(device.getDevice_code())); |
|
|
|
row.put("energyLevel", String.valueOf(agvNdcOneDeviceDriver.getElectric_qty())); |
|
|
|
// 车状态:
|
|
|
|
// 1:关机
|
|
|
|
// 2:运行中
|
|
|
@ -75,10 +70,10 @@ public class ToAgvDevice { |
|
|
|
// row.put("status_name", "低电量");
|
|
|
|
} |
|
|
|
|
|
|
|
row.put("transportOrder", agvNdcOneDeviceDriver.getOrder()); |
|
|
|
row.put("positionX", agvNdcOneDeviceDriver.getX()); |
|
|
|
row.put("positionY", agvNdcOneDeviceDriver.getY()); |
|
|
|
row.put("positionAngle", agvNdcOneDeviceDriver.getAngle()); |
|
|
|
row.put("transportOrder", String.valueOf(agvNdcOneDeviceDriver.getOrder())); |
|
|
|
row.put("positionX", String.valueOf(agvNdcOneDeviceDriver.getX())); |
|
|
|
row.put("positionY", String.valueOf(agvNdcOneDeviceDriver.getY())); |
|
|
|
row.put("positionAngle", String.valueOf(agvNdcOneDeviceDriver.getAngle())); |
|
|
|
agv_rows.add(row); |
|
|
|
|
|
|
|
} |
|
|
@ -87,9 +82,6 @@ public class ToAgvDevice { |
|
|
|
}catch (Exception e){ |
|
|
|
System.out.println(e.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
System.out.println(agv_rows.toString()); |
|
|
|
|
|
|
|
acsToWmsService.feedbackAgv(agv_rows); |
|
|
|
} |
|
|
|
|
|
|
|