|
|
@ -153,8 +153,14 @@ public class ChannelCtrlService { |
|
|
|
.eq(PreFill::getSolutionId, channelState.getSolutionId()) |
|
|
|
.eq(PreFill::getConcentration, channelState.getConcentration()) |
|
|
|
.one(); |
|
|
|
DeviceCommand deviceCommand = getPumpMoveByCommandByChannel(channelState.getChannelCode(), preFill.getRevolutions()); |
|
|
|
commandFutureList.add(deviceCommandService.sendCommand(deviceCommand)); |
|
|
|
if(preFill == null){ |
|
|
|
DeviceCommand deviceCommand = getPumpForwardRotateCommandByChannel(channelState.getChannelCode()); |
|
|
|
commandFutureList.add(deviceCommandService.sendCommand(deviceCommand)); |
|
|
|
}else{ |
|
|
|
DeviceCommand deviceCommand = getPumpMoveByCommandByChannel(channelState.getChannelCode(), preFill.getRevolutions()); |
|
|
|
commandFutureList.add(deviceCommandService.sendCommand(deviceCommand)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
CommandUtil.wait(commandFutureList); |
|
|
@ -236,18 +242,6 @@ public class ChannelCtrlService { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据通道code获取泵正转指令 |
|
|
|
*/ |
|
|
|
public DeviceCommand getPumpForwardRotateCommandByChannel(ChannelCode channelCode) { |
|
|
|
return switch (channelCode) { |
|
|
|
case CHANNEL_1 -> DeviceCommandGenerator.pump1ForwardRotate(); |
|
|
|
case CHANNEL_2 -> DeviceCommandGenerator.pump2ForwardRotate(); |
|
|
|
case CHANNEL_3 -> DeviceCommandGenerator.pump3ForwardRotate(); |
|
|
|
case CHANNEL_4 -> DeviceCommandGenerator.pump4ForwardRotate(); |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据通道code获取泵移动指令 |
|
|
|
*/ |
|
|
|
public DeviceCommand getPumpMoveCommandByChannel(ChannelCode channelCode, Double position) { |
|
|
@ -273,6 +267,18 @@ public class ChannelCtrlService { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据通道code获取泵正转指令 |
|
|
|
*/ |
|
|
|
public DeviceCommand getPumpForwardRotateCommandByChannel(ChannelCode channelCode) { |
|
|
|
return switch (channelCode) { |
|
|
|
case CHANNEL_1 -> DeviceCommandGenerator.pump1ForwardRotate(); |
|
|
|
case CHANNEL_2 -> DeviceCommandGenerator.pump2ForwardRotate(); |
|
|
|
case CHANNEL_3 -> DeviceCommandGenerator.pump3ForwardRotate(); |
|
|
|
case CHANNEL_4 -> DeviceCommandGenerator.pump4ForwardRotate(); |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据通道code获取泵反转指令 |
|
|
|
*/ |
|
|
|
public DeviceCommand getPumpBackwardRotateCommandByChannel(ChannelCode channelCode) { |
|
|
|