|
|
@ -65,34 +65,43 @@ public class LiquidAddCommand extends BaseCommandHandler { |
|
|
|
double volume = jsonObject.getDouble("volume");//量 |
|
|
|
Solutions solutions = solutionsService.getById(solutionId);//获取溶液 |
|
|
|
ValveStateCode valveStateCode = ValveStateCode.valueOf(solutions.getName());//根据溶液获取电磁阀code |
|
|
|
ValveState valveState=deviceStateService.getDeviceState().getSolutionModule().getValveState();//获取当前电磁阀的值 |
|
|
|
if(!valveState.getState().equals(valveStateCode)) {//判断是否与当前加酸的通道一致 |
|
|
|
switch (valveStateCode) { |
|
|
|
ValveStateCode oldValveState = deviceStateService.getDeviceState().getSolutionModule().getValveState().getState();//获取当前电磁阀的值 |
|
|
|
double preFillDistance = 0; |
|
|
|
if (!oldValveState.equals(valveStateCode)) {//判断是否与当前加酸的通道一致 不一致排空 |
|
|
|
switch (oldValveState) { |
|
|
|
case ValveStateCode.thin -> { |
|
|
|
solutionModuleService.liquidValveSwitch(cmdDTO.getCommandId(), cmdDTO.getCommand(), ValveStateCode.waste);//废液通道打开 |
|
|
|
double distance=devicePositionService.getPosition(DevicePositionCode.thinPreFillDistance).getDistance();//稀硝酸预充距离 |
|
|
|
double distance = devicePositionService.getPosition(DevicePositionCode.thinPreFillDistance).getDistance();//稀硝酸预充距离 |
|
|
|
solutionModuleService.liquidPumpMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), -distance);//排空 |
|
|
|
solutionModuleService.liquidValveSwitch(cmdDTO.getCommandId(), cmdDTO.getCommand(), ValveStateCode.thin);//废液通道打开 |
|
|
|
solutionModuleService.liquidPumpMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), distance);//预充 |
|
|
|
} |
|
|
|
case ValveStateCode.thick -> { |
|
|
|
solutionModuleService.liquidValveSwitch(cmdDTO.getCommandId(), cmdDTO.getCommand(), valveStateCode);//电磁阀对应通道打开 |
|
|
|
double distance=devicePositionService.getPosition(DevicePositionCode.thickPreFillDistance).getDistance();//浓硝酸预充距离 |
|
|
|
solutionModuleService.liquidPumpMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), distance);//预充 |
|
|
|
solutionModuleService.liquidValveSwitch(cmdDTO.getCommandId(), cmdDTO.getCommand(), ValveStateCode.waste);//废液通道打开 |
|
|
|
double distance = devicePositionService.getPosition(DevicePositionCode.thickPreFillDistance).getDistance();//浓硝酸预充距离 |
|
|
|
solutionModuleService.liquidPumpMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), -distance);//排空 |
|
|
|
} |
|
|
|
case ValveStateCode.water -> { |
|
|
|
solutionModuleService.liquidValveSwitch(cmdDTO.getCommandId(), cmdDTO.getCommand(), valveStateCode);//电磁阀对应通道打开 |
|
|
|
double distance=devicePositionService.getPosition(DevicePositionCode.thickPreFillDistance).getDistance();//水预充距离 |
|
|
|
solutionModuleService.liquidPumpMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), distance);//预充 |
|
|
|
solutionModuleService.liquidValveSwitch(cmdDTO.getCommandId(), cmdDTO.getCommand(), ValveStateCode.waste);//废液通道打开 |
|
|
|
double distance = devicePositionService.getPosition(DevicePositionCode.waterPreFillDistance).getDistance();//蒸馏水预充距离 |
|
|
|
solutionModuleService.liquidPumpMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), -distance);//排空 |
|
|
|
} |
|
|
|
} |
|
|
|
switch (valveStateCode) { |
|
|
|
case ValveStateCode.thin -> { |
|
|
|
double distance = devicePositionService.getPosition(DevicePositionCode.thinPreFillDistance).getDistance();//稀硝酸预充距离 |
|
|
|
preFillDistance += distance; |
|
|
|
} |
|
|
|
case ValveStateCode.thick -> { |
|
|
|
double distance = devicePositionService.getPosition(DevicePositionCode.thickPreFillDistance).getDistance();//浓硝酸预充距离 |
|
|
|
preFillDistance += distance; |
|
|
|
} |
|
|
|
case ValveStateCode.water -> { |
|
|
|
double distance = devicePositionService.getPosition(DevicePositionCode.waterPreFillDistance).getDistance();//蒸馏水预充距离 |
|
|
|
preFillDistance += distance; |
|
|
|
} |
|
|
|
case ValveStateCode.waste -> { |
|
|
|
solutionModuleService.liquidValveSwitch(cmdDTO.getCommandId(), cmdDTO.getCommand(), valveStateCode);//电磁阀对应通道打开 |
|
|
|
|
|
|
|
}//已经排空 |
|
|
|
} |
|
|
|
} |
|
|
|
double scale = Double.parseDouble(systemConfigService.getSystemConfigValueByCode(valveStateCode.getSystemConfigCode()));//根据溶液获取转换比 |
|
|
|
double position = volume * scale * 8;//加液泵的转数 |
|
|
|
double position = volume * scale * 8 + preFillDistance;//加液泵的转数 |
|
|
|
solutionModuleService.liquidValveSwitch(cmdDTO.getCommandId(), cmdDTO.getCommand(), valveStateCode);//电磁阀对应通道打开 |
|
|
|
double distance = (column - 1) * trayTubeHorizontalSpacingDistance;//机械臂左移距离 |
|
|
|
transferModuleService.transferXMoveBy(cmdDTO.getCommandId(), cmdDTO.getCommand(), -distance);//机械臂左移 |
|
|
@ -100,9 +109,6 @@ public class LiquidAddCommand extends BaseCommandHandler { |
|
|
|
solutionModuleService.liquidPumpMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), position);//加液 |
|
|
|
solutionModuleService.solutionMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//加液机械臂上升 |
|
|
|
transferModuleService.transferMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint);//移动至加液位置 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
solutionModuleService.solutionMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//加液机械臂上升 |
|
|
|
transferModuleService.transferMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint);//移动至加液位置 |
|
|
|