|
|
@ -29,7 +29,6 @@ import java.util.concurrent.CompletableFuture; |
|
|
|
@RequiredArgsConstructor |
|
|
|
public class ChannelCtrlService { |
|
|
|
private final FormulationService formulationService; |
|
|
|
private final ChannelCtrlService channelCtrlService; |
|
|
|
private final DeviceCommandService deviceCommandService; |
|
|
|
private final DeviceState deviceState; |
|
|
|
|
|
|
@ -48,7 +47,7 @@ public class ChannelCtrlService { |
|
|
|
List<CommandFuture> commandFutureList = new ArrayList<>(); |
|
|
|
for (ChannelState channelState : channelStateList) { |
|
|
|
Formulation formulation = formulationService.getOne(new LambdaQueryWrapper<Formulation>().eq(Formulation::getSolutionId, channelState.getSolutionId())); |
|
|
|
DeviceCommand deviceCommand = channelCtrlService.getPumpMoveByCommandByChannel(channelState.getChannelCode(), formulation.getRevolutions()); |
|
|
|
DeviceCommand deviceCommand = getPumpMoveByCommandByChannel(channelState.getChannelCode(), formulation.getRevolutions()); |
|
|
|
commandFutureList.add(deviceCommandService.sendCommand(deviceCommand)); |
|
|
|
} |
|
|
|
CommandUtil.wait(commandFutureList); |
|
|
@ -58,7 +57,7 @@ public class ChannelCtrlService { |
|
|
|
List<CommandFuture> commandFutureList = new ArrayList<>(); |
|
|
|
for (ChannelState channelState : channelStateList) { |
|
|
|
Formulation formulation = formulationService.getOne(new LambdaQueryWrapper<Formulation>().eq(Formulation::getSolutionId, channelState.getSolutionId())); |
|
|
|
DeviceCommand deviceCommand = channelCtrlService.getPumpMoveByCommandByChannel(channelState.getChannelCode(), formulation.getRevolutions()); |
|
|
|
DeviceCommand deviceCommand = getPumpMoveByCommandByChannel(channelState.getChannelCode(), formulation.getRevolutions()); |
|
|
|
commandFutureList.add(deviceCommandService.sendCommand(deviceCommand)); |
|
|
|
} |
|
|
|
CommandUtil.wait(commandFutureList); |
|
|
@ -86,7 +85,7 @@ public class ChannelCtrlService { |
|
|
|
} |
|
|
|
List<CommandFuture> commandFutureList = new ArrayList<>(); |
|
|
|
for (ChannelState channelState : channelStateList) { |
|
|
|
DeviceCommand deviceCommand = channelCtrlService.getPumpForwardRotateCommandByChannel(channelState.getChannelCode()); |
|
|
|
DeviceCommand deviceCommand = getPumpForwardRotateCommandByChannel(channelState.getChannelCode()); |
|
|
|
commandFutureList.add(deviceCommandService.sendCommand(deviceCommand)); |
|
|
|
} |
|
|
|
CommandUtil.wait(commandFutureList); |
|
|
|