|
|
@ -74,6 +74,28 @@ public class ChannelCtrlService { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 停止加液 |
|
|
|
*/ |
|
|
|
public void solutionAddStop() { |
|
|
|
List<ChannelState> channelCodeList = deviceState.filterChannelStatesByState(ChannelStateCode.ADD); |
|
|
|
deviceState.setSolutionAddStop(true); |
|
|
|
try { |
|
|
|
List<CommandFuture> commandFutureList = new ArrayList<>(); |
|
|
|
for (ChannelState channelState : channelCodeList) { |
|
|
|
DeviceCommand deviceCommand = getPumpStopCommandByChannel(channelState.getChannelCode()); |
|
|
|
commandFutureList.add(deviceCommandService.sendCommand(deviceCommand)); |
|
|
|
} |
|
|
|
CommandUtil.wait(commandFutureList); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} finally { |
|
|
|
for (ChannelState channelCode : channelCodeList) { |
|
|
|
channelCode.setStateCode(ChannelStateCode.IDLE); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 开始预充 |
|
|
|
*/ |
|
|
|
public void solutionPreFillStart() { |
|
|
@ -96,6 +118,31 @@ public class ChannelCtrlService { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 结束预充 |
|
|
|
*/ |
|
|
|
public void solutionPreFillStop() { |
|
|
|
CompletableFuture.runAsync(() -> { |
|
|
|
List<ChannelState> channelCodeList = deviceState.filterChannelStatesByState(ChannelStateCode.PRE); |
|
|
|
deviceState.setSolutionAddStop(true); |
|
|
|
try { |
|
|
|
List<CommandFuture> commandFutureList = new ArrayList<>(); |
|
|
|
for (ChannelState channelState : channelCodeList) { |
|
|
|
DeviceCommand deviceCommand = getPumpStopCommandByChannel(channelState.getChannelCode()); |
|
|
|
commandFutureList.add(deviceCommandService.sendCommand(deviceCommand)); |
|
|
|
} |
|
|
|
CommandUtil.wait(commandFutureList); |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} finally { |
|
|
|
for (ChannelState channelCode : channelCodeList) { |
|
|
|
channelCode.setPre(true); |
|
|
|
channelCode.setStateCode(ChannelStateCode.IDLE); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据通道code获取泵相对移动指令 |
|
|
|
*/ |
|
|
|
public DeviceCommand getPumpMoveByCommandByChannel(ChannelCode channelCode, Double position) { |
|
|
@ -143,23 +190,5 @@ public class ChannelCtrlService { |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 加液 |
|
|
|
* |
|
|
|
* @param channelCode 通道code |
|
|
|
* @param volume 加液量 |
|
|
|
*/ |
|
|
|
public void solutionAddStart(ChannelCode channelCode, Double volume) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 停止加液 |
|
|
|
* |
|
|
|
* @param channelCode 通道code |
|
|
|
*/ |
|
|
|
public void solutionAddStop(ChannelCode channelCode) { |
|
|
|
deviceState.getChannelStateMap().get(channelCode).setStateCode(ChannelStateCode.IDLE); |
|
|
|
|
|
|
|
} |
|
|
|
} |