|
|
@ -3,6 +3,9 @@ package com.iflytop.handacid.app.core.listener; |
|
|
|
import com.iflytop.handacid.app.core.state.DeviceState; |
|
|
|
import com.iflytop.handacid.app.scheduled.BleGamepadStateScheduledTask; |
|
|
|
import com.iflytop.handacid.app.service.ChannelCtrlService; |
|
|
|
import com.iflytop.handacid.app.websocket.server.AlertLevel; |
|
|
|
import com.iflytop.handacid.app.websocket.server.WebSocketSender; |
|
|
|
import com.iflytop.handacid.common.result.ResultCode; |
|
|
|
import com.iflytop.handacid.hardware.service.AppEventBusService; |
|
|
|
import com.iflytop.handacid.hardware.type.A8kPacket; |
|
|
|
import com.iflytop.handacid.hardware.type.CmdId; |
|
|
@ -25,6 +28,7 @@ public class BleGamepadEventListener { |
|
|
|
private final ChannelCtrlService channelCtrlService; |
|
|
|
private final DeviceState deviceState; |
|
|
|
private final BleGamepadStateScheduledTask bleGamepadStateScheduledTask; |
|
|
|
private final WebSocketSender webSocketSender; |
|
|
|
|
|
|
|
@PostConstruct |
|
|
|
synchronized public void init() { |
|
|
@ -44,7 +48,7 @@ public class BleGamepadEventListener { |
|
|
|
//判断当前的设备状态 |
|
|
|
log.info("蓝牙手柄 加酸按钮 按下"); |
|
|
|
if (deviceState.isSolutionPreFillStart()) {//正在预充 忽略加液按钮事件 |
|
|
|
log.info("正在与预充中..."); |
|
|
|
webSocketSender.pushToast(AlertLevel.error, ResultCode.PRE_CHARGING);//正在预充中 |
|
|
|
return; |
|
|
|
} |
|
|
|
if (deviceState.isSolutionAdding()) { |
|
|
@ -55,7 +59,7 @@ public class BleGamepadEventListener { |
|
|
|
} else if (CmdId.event_ble_gamepad_liquid_acid_prefilling.equals(cmdId)) { |
|
|
|
log.info("蓝牙手柄 预充按钮 按下"); |
|
|
|
if (deviceState.isSolutionAdding()) {//正在加液 忽略预充按钮事件 |
|
|
|
log.info("正在加液中..."); |
|
|
|
webSocketSender.pushToast(AlertLevel.error, ResultCode.SOLUTION_ADDING);//正在加液中 |
|
|
|
return; |
|
|
|
} |
|
|
|
if (deviceState.isSolutionPreFillStart()) { |
|
|
|