|
|
@ -2,6 +2,7 @@ package com.qyft.ms.system.service.device; |
|
|
|
|
|
|
|
import cn.hutool.json.JSONObject; |
|
|
|
import com.qyft.ms.app.common.constant.WebSocketMessageType; |
|
|
|
import com.qyft.ms.app.device.status.DeviceStatus; |
|
|
|
import com.qyft.ms.system.common.constant.CommandStatus; |
|
|
|
import com.qyft.ms.system.common.device.command.CommandFuture; |
|
|
|
import com.qyft.ms.system.core.client.DeviceTcpClient; |
|
|
@ -27,7 +28,7 @@ public class DeviceCommandService { |
|
|
|
|
|
|
|
private final DeviceTcpClient deviceTcpClient; |
|
|
|
private final FrontCommandService frontCommandService; |
|
|
|
private final WebSocketService webSocketService; |
|
|
|
private final DeviceStatus deviceStatus; |
|
|
|
|
|
|
|
|
|
|
|
public CommandFuture executeCommand(DeviceCommand cmdToDevice) { |
|
|
@ -92,10 +93,9 @@ public class DeviceCommandService { |
|
|
|
} else if ("event".equals(tag)) { |
|
|
|
String eventType = deviceResult.getStr("event_type"); |
|
|
|
if("system_e_stop_pressed".equals(eventType)) {//系统急停按钮被按下 |
|
|
|
webSocketService.pushMsg(WebSocketMessageType.SYSTEM_E_STOP_PRESSED, "系统急停按钮被按下"); |
|
|
|
deviceStatus.setStopPressed(true); |
|
|
|
}else if("system_e_stop_released".equals(eventType)) {//系统急停按钮被释放 |
|
|
|
webSocketService.pushMsg(WebSocketMessageType.SYSTEM_E_STOP_RELEASED, "系统急停按钮被释放"); |
|
|
|
} |
|
|
|
} deviceStatus.setStopPressed(false); |
|
|
|
} else if ("status".equals(tag)) { |
|
|
|
|
|
|
|
} |
|
|
|