|
|
@ -1,11 +1,13 @@ |
|
|
|
package com.qyft.ms.system.service.device; |
|
|
|
|
|
|
|
import cn.hutool.json.JSONObject; |
|
|
|
import com.qyft.ms.app.common.constant.WebSocketMessageType; |
|
|
|
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; |
|
|
|
import com.qyft.ms.system.model.bo.DeviceCommand; |
|
|
|
import com.qyft.ms.system.model.form.FrontCmdControlForm; |
|
|
|
import com.qyft.ms.system.service.WebSocketService; |
|
|
|
import com.qyft.ms.system.service.front.FrontCommandService; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -25,6 +27,7 @@ public class DeviceCommandService { |
|
|
|
|
|
|
|
private final DeviceTcpClient deviceTcpClient; |
|
|
|
private final FrontCommandService frontCommandService; |
|
|
|
private final WebSocketService webSocketService; |
|
|
|
|
|
|
|
|
|
|
|
public CommandFuture executeCommand(DeviceCommand cmdToDevice) { |
|
|
@ -87,6 +90,12 @@ public class DeviceCommandService { |
|
|
|
} else if ("response".equals(tag)) { |
|
|
|
completeCommandResponse(deviceResult); |
|
|
|
} 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, "系统急停按钮被按下"); |
|
|
|
}else if("system_e_stop_released".equals(eventType)) {//系统急停按钮被释放 |
|
|
|
webSocketService.pushMsg(WebSocketMessageType.SYSTEM_E_STOP_RELEASED, "系统急停按钮被释放"); |
|
|
|
} |
|
|
|
} else if ("status".equals(tag)) { |
|
|
|
|
|
|
|
} |
|
|
|