Browse Source

我也不知道改了什么

tags/1.0
白凤吉 5 months ago
parent
commit
ff106bc2ec
  1. 2
      src/main/java/com/qyft/ms/app/controller/SprayTaskController.java
  2. 2
      src/main/java/com/qyft/ms/app/device/spray/SensorCollector.java
  3. 70
      src/main/java/com/qyft/ms/app/device/spray/SprayTaskExecutor.java
  4. 2
      src/main/java/com/qyft/ms/app/front/cmd/business/DehumidifierStart.java
  5. 2
      src/main/java/com/qyft/ms/app/front/cmd/business/DeviceSelfTest.java
  6. 6
      src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayChangeParam.java
  7. 82
      src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayStart.java
  8. 10
      src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelinePreFill.java
  9. 5
      src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelinePreFillStop.java
  10. 5
      src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelineWash.java
  11. 19
      src/main/java/com/qyft/ms/app/front/cmd/business/SyringePipelineWash.java
  12. 10
      src/main/java/com/qyft/ms/app/front/cmd/business/SyringePipelineWashStop.java
  13. 9
      src/main/java/com/qyft/ms/app/model/vo/SprayTaskStatusVO.java

2
src/main/java/com/qyft/ms/app/controller/SprayTaskController.java

@ -23,6 +23,8 @@ public class SprayTaskController {
public Result<SprayTaskStatusVO> getStatus() {
SprayTask sprayTask = SprayTask.getInstance();
SprayTaskStatusVO sprayTaskStatusVO = new SprayTaskStatusVO();
sprayTaskStatusVO.setCmdId(sprayTask.getCmdId());
sprayTaskStatusVO.setCmdCode(sprayTask.getCmdCode());
sprayTaskStatusVO.setSprayTaskSprayedList(sprayTask.getSprayTaskSprayedList());
sprayTaskStatusVO.setSprayParams(sprayTask.getCacheParams());
return Result.success(sprayTaskStatusVO);

2
src/main/java/com/qyft/ms/app/device/spray/SensorCollector.java

@ -33,7 +33,7 @@ public class SensorCollector {
CommandFuture humidityGetCmdFuture = deviceCommandService.sendCommandNoFront(humidityGetCmd);
commandWait(humidityGetCmdFuture);
JSONObject humidityGetCmdFutureResult = humidityGetCmdFuture.getResponseResult();
Double deviceHumidity = humidityGetCmdFutureResult.getDouble("humidity");
Double deviceHumidity = humidityGetCmdFutureResult.getJSONObject("data").getDouble("humidity");
Map<String, Object> map = new HashMap<>();
map.put("humidity", deviceHumidity);
webSocketService.pushMsgNoLog(WebSocketMessageType.SENSOR, map);

70
src/main/java/com/qyft/ms/app/device/spray/SprayTaskExecutor.java

@ -81,13 +81,13 @@ public class SprayTaskExecutor {
CommandFuture motorYPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYPositionSetCommand);
CommandFuture motorZPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZPositionSetCommand);
commandWait(motorXPositionSetCommandFuture, motorYPositionSetCommandFuture, motorZPositionSetCommandFuture);
SysSettings slideHeightSysSettings = sysSettingsService.getOne(new LambdaQueryWrapper<SysSettings>().eq(SysSettings::getCode, "slide_height"));
Double slideHeight = Double.parseDouble(slideHeightSysSettings.getValue());
Double height = slideHeight - sprayTask.getSprayParams().getMotorZHeight();
DeviceCommand motorZPositionSetAboveSlideCommand = DeviceCommandGenerator.motorZPositionSet(height);
CommandFuture motorZPositionSetAboveSlideCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZPositionSetAboveSlideCommand);
commandWait(motorZPositionSetAboveSlideCommandFuture);
//
// SysSettings slideHeightSysSettings = sysSettingsService.getOne(new LambdaQueryWrapper<SysSettings>().eq(SysSettings::getCode, "slide_height"));
// Double slideHeight = Double.parseDouble(slideHeightSysSettings.getValue());
// Double height = slideHeight - sprayTask.getSprayParams().getMotorZHeight();//下降z轴高度
// DeviceCommand motorZPositionSetAboveSlideCommand = DeviceCommandGenerator.motorZPositionSet(height);
// CommandFuture motorZPositionSetAboveSlideCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZPositionSetAboveSlideCommand);
// commandWait(motorZPositionSetAboveSlideCommandFuture);
DeviceCommand threeWayValveOpenSyringePipelineCommand = DeviceCommandGenerator.threeWayValveOpenSyringePipeline();//打开三通阀喷嘴管路
CommandFuture threeWayValveOpenSyringePipelineCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), threeWayValveOpenSyringePipelineCommand);
@ -100,15 +100,45 @@ public class SprayTaskExecutor {
}
sprayTask.setSprayPreStepsCompleted(true);
}
DeviceCommand nozzleValveOpenCommand = DeviceCommandGenerator.nozzleValveOpen();//开启喷嘴阀
CommandFuture nozzleValveOpenCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), nozzleValveOpenCommand);
commandWait(nozzleValveOpenCommandFuture);
int reCurrentStep = sprayTask.getCurrentStep();
int currentStep = 0; //当前喷涂步骤
int sprayNum = 1;
for (SprayTaskStep sprayTaskStep : sprayTask.getSprayTaskStepList()) {//循环进行多次喷涂
//加快速度
// DeviceCommand motorXSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorXSpeedSet(20.0);//x轴电机速度设置
// DeviceCommand motorYSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorYSpeedSet(20.0);//y轴电机速度设置
// DeviceCommand motorZSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorZSpeedSet(20.0);//z轴电机速度设置
// CommandFuture motorXSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXSpeedSetCmdToDeviceCommand);
// CommandFuture motorYSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYSpeedSetCmdToDeviceCommand);
// CommandFuture motorZSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZSpeedSetCmdToDeviceCommand);
// commandWait(motorXSpeedSetCmdToDeviceCommandFuture, motorYSpeedSetCmdToDeviceCommandFuture, motorZSpeedSetCmdToDeviceCommandFuture);
//先移动到玻片位置
DeviceCommand motorXPositionSetCommand = DeviceCommandGenerator.motorXPositionSet(slideArr[sprayTaskStep.getIndex()][0],20.0);
DeviceCommand motorYPositionSetCommand = DeviceCommandGenerator.motorYPositionSet(slideArr[sprayTaskStep.getIndex()][1],20.0);
CommandFuture motorXPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXPositionSetCommand);
CommandFuture motorYPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYPositionSetCommand);
SysSettings slideHeightSysSettings = sysSettingsService.getOne(new LambdaQueryWrapper<SysSettings>().eq(SysSettings::getCode, "slide_height"));
Double slideHeight = Double.parseDouble(slideHeightSysSettings.getValue());
Double height = slideHeight - sprayTask.getSprayParams().getMotorZHeight();//下降z轴高度
DeviceCommand motorZPositionSetAboveSlideCommand = DeviceCommandGenerator.motorZPositionSet(height,15.0);
CommandFuture motorZPositionSetAboveSlideCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZPositionSetAboveSlideCommand);
commandWait(motorXPositionSetCommandFuture, motorYPositionSetCommandFuture, motorZPositionSetAboveSlideCommandFuture);
//还原速度
// motorXSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorXSpeedSet(sprayTask.getSprayParams().getMovingSpeed());//x轴电机速度设置
// motorYSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorYSpeedSet(sprayTask.getSprayParams().getMovingSpeed());//y轴电机速度设置
// motorZSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorZSpeedSet(sprayTask.getSprayParams().getMovingSpeed());//y轴电机速度设置
// motorXSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXSpeedSetCmdToDeviceCommand);
// motorYSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYSpeedSetCmdToDeviceCommand);
// motorZSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZSpeedSetCmdToDeviceCommand);
// commandWait(motorXSpeedSetCmdToDeviceCommandFuture, motorYSpeedSetCmdToDeviceCommandFuture, motorZSpeedSetCmdToDeviceCommandFuture);
DeviceCommand syringePumpForwardCommand = DeviceCommandGenerator.syringePumpForward(sprayTask.getSprayParams().getVolume());//推动移动注射泵
CommandFuture syringePumpForwardCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), syringePumpForwardCommand);
commandWait(syringePumpForwardCommandFuture);
@ -170,15 +200,33 @@ public class SprayTaskExecutor {
CommandFuture nozzleValveCloseCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), nozzleValveCloseCommand);
commandWait(nozzleValveCloseCommandFuture);
//加快速度
// DeviceCommand motorXSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorXSpeedSet(20.0);//x轴电机速度设置
// DeviceCommand motorYSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorYSpeedSet(20.0);//y轴电机速度设置
// DeviceCommand motorZSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorZSpeedSet(20.0);//y轴电机速度设置
// CommandFuture motorXSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXSpeedSetCmdToDeviceCommand);
// CommandFuture motorYSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYSpeedSetCmdToDeviceCommand);
// CommandFuture motorZSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZSpeedSetCmdToDeviceCommand);
// commandWait(motorXSpeedSetCmdToDeviceCommandFuture, motorYSpeedSetCmdToDeviceCommandFuture, motorZSpeedSetCmdToDeviceCommandFuture);
//XYZ回原点
DeviceCommand motorXPositionSetCommand = DeviceCommandGenerator.motorXPositionSet(0.0);
DeviceCommand motorYPositionSetCommand = DeviceCommandGenerator.motorYPositionSet(0.0);
DeviceCommand motorZPositionSetCommand = DeviceCommandGenerator.motorZPositionSet(0.0);
DeviceCommand motorXPositionSetCommand = DeviceCommandGenerator.motorXPositionSet(0.0,20.0);
DeviceCommand motorYPositionSetCommand = DeviceCommandGenerator.motorYPositionSet(0.0,20.0);
DeviceCommand motorZPositionSetCommand = DeviceCommandGenerator.motorZPositionSet(0.0,15.0);
CommandFuture motorXPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXPositionSetCommand);
CommandFuture motorYPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYPositionSetCommand);
CommandFuture motorZPositionSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZPositionSetCommand);
commandWait(motorXPositionSetCommandFuture, motorYPositionSetCommandFuture, motorZPositionSetCommandFuture);
//还原速度
// motorXSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorXSpeedSet(sprayTask.getSprayParams().getMovingSpeed());//x轴电机速度设置
// motorYSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorYSpeedSet(sprayTask.getSprayParams().getMovingSpeed());//y轴电机速度设置
// motorZSpeedSetCmdToDeviceCommand = DeviceCommandGenerator.motorZSpeedSet(sprayTask.getSprayParams().getMovingSpeed());//y轴电机速度设置
// motorXSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXSpeedSetCmdToDeviceCommand);
// motorYSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYSpeedSetCmdToDeviceCommand);
// motorZSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZSpeedSetCmdToDeviceCommand);
// commandWait(motorXSpeedSetCmdToDeviceCommandFuture, motorYSpeedSetCmdToDeviceCommandFuture, motorZSpeedSetCmdToDeviceCommandFuture);
SprayTask.getInstance().clear();
deviceStatus.setSpraying(false);
deviceStatus.setSuspendable(false);

2
src/main/java/com/qyft/ms/app/front/cmd/business/DehumidifierStart.java

@ -49,7 +49,7 @@ public class DehumidifierStart extends BaseCommandHandler {
commandWait(humidityGetCmdFuture);
JSONObject humidityGetCmdFutureResult = humidityGetCmdFuture.getResponseResult();
Double deviceHumidity = humidityGetCmdFutureResult.getDouble("humidity");
Double deviceHumidity = humidityGetCmdFutureResult.getJSONObject("data").getDouble("humidity");
// 判断是否需要除湿若前端设定湿度大于当前湿度则无需开启除湿阀
if (humidity > deviceHumidity) {

2
src/main/java/com/qyft/ms/app/front/cmd/business/DeviceSelfTest.java

@ -41,7 +41,7 @@ public class DeviceSelfTest extends BaseCommandHandler {
commandWait(motorXOriginCommandFuture, motorYOriginCommandFuture, motorZOriginCommandFuture);
try {
if (motorXOriginCommandFuture.getResponseResult().getBool("status")) {
selfTestService.getSelfTestStatus().setXAxisAtOrigin(false);
selfTestService.getSelfTestStatus().setXAxisAtOrigin(true);
}
if (motorYOriginCommandFuture.getResponseResult().getBool("status")) {
selfTestService.getSelfTestStatus().setYAxisAtOrigin(true);

6
src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayChangeParam.java

@ -57,9 +57,9 @@ public class MatrixSprayChangeParam extends BaseCommandHandler {
CommandFuture motorZSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), motorZSpeedSetCmdToDeviceCommand);
commandWait(motorXSpeedSetCmdToDeviceCommandFuture, motorYSpeedSetCmdToDeviceCommandFuture, motorZSpeedSetCmdToDeviceCommandFuture);
//2.流速
DeviceCommand syringePumpVolumeSetCommand = DeviceCommandGenerator.syringePumpVolumeSet(volume);//注射泵流速设置
CommandFuture syringePumpVolumeSetCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), syringePumpVolumeSetCommand);
commandWait(syringePumpVolumeSetCommandFuture);
// DeviceCommand syringePumpVolumeSetCommand = DeviceCommandGenerator.syringePumpVolumeSet(volume);//注射泵流速设置
// CommandFuture syringePumpVolumeSetCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), syringePumpVolumeSetCommand);
// commandWait(syringePumpVolumeSetCommandFuture);
//3.z轴高度
SysSettings slideHeightSysSettings = sysSettingsService.getOne(new LambdaQueryWrapper<SysSettings>().eq(SysSettings::getCode, "slide_height"));
Double slideHeight = Double.parseDouble(slideHeightSysSettings.getValue());

82
src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayStart.java

@ -54,15 +54,15 @@ public class MatrixSprayStart extends BaseCommandHandler {
private final DeviceCommandService deviceCommandService;
private void nonNullCheck(String cmdId, String cmdCode,
String matrixPathType,
Double motorZHeight,
Double gasPressure,
Double volume,
Boolean highVoltage,
Double spacing,
Double movingSpeed,
Double times,
Object position) {
String matrixPathType,
Double motorZHeight,
Double gasPressure,
Double volume,
Boolean highVoltage,
Double spacing,
Double movingSpeed,
Double times,
Object position) {
Map<String, Object> paramMap = new LinkedHashMap<>();
paramMap.put("matrix_path_type", matrixPathType);
@ -159,9 +159,9 @@ public class MatrixSprayStart extends BaseCommandHandler {
CommandFuture motorZSpeedSetCmdToDeviceCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZSpeedSetCmdToDeviceCommand);
commandWait(motorXSpeedSetCmdToDeviceCommandFuture, motorYSpeedSetCmdToDeviceCommandFuture, motorZSpeedSetCmdToDeviceCommandFuture);
//2.流速
DeviceCommand syringePumpVolumeSetCommand = DeviceCommandGenerator.syringePumpVolumeSet(sprayTask.getSprayParams().getVolume());//注射泵流速设置
CommandFuture syringePumpVolumeSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), syringePumpVolumeSetCommand);
commandWait(syringePumpVolumeSetCommandFuture);
// DeviceCommand syringePumpVolumeSetCommand = DeviceCommandGenerator.syringePumpVolumeSet(sprayTask.getSprayParams().getVolume());//注射泵流速设置
// CommandFuture syringePumpVolumeSetCommandFuture = deviceCommandService.sendCommand(sprayTask.getCmdId(), sprayTask.getCmdCode(), syringePumpVolumeSetCommand);
// commandWait(syringePumpVolumeSetCommandFuture);
// 7.循环喷涂区域
Position slidePosition1 = positionService.getOne(new LambdaQueryWrapper<Position>().eq(Position::getPointCode, "slide_position1"));
@ -181,8 +181,8 @@ public class MatrixSprayStart extends BaseCommandHandler {
Double[] slide = slideArr[index];//获取玻片的坐标
//规划路线坐标
DecimalFormat df = new DecimalFormat("#.##");
double left = Double.parseDouble(df.format( slide[0] + upperLeft[0]));
double right = Double.parseDouble(df.format( slide[0] + lowerRight[0]));
double left = Double.parseDouble(df.format(slide[0] + upperLeft[0]));
double right = Double.parseDouble(df.format(slide[0] + lowerRight[0]));
double top = Double.parseDouble(df.format(slide[1] + upperLeft[1]));
double bottom = Double.parseDouble(df.format(slide[1] + lowerRight[1]));
if ("horizontal".equals(matrixPathType)) {//喷涂路径类型 horizontal 横向 | vertical 纵向 | grid 网格先横向后纵向
@ -204,12 +204,21 @@ public class MatrixSprayStart extends BaseCommandHandler {
PathGenerator.MoveMode.HORIZONTAL_ZIGZAG_TOP_DOWN
);
List<List<DeviceCommand>> deviceCommandList = new ArrayList<>();
for (PathGenerator.Points p : pathList) {//喷针移动目标位置
for (int j = 0; j < pathList.size(); j++) {
PathGenerator.Points p = pathList.get(j);
List<DeviceCommand> deviceCommands = new ArrayList<>();
deviceCommands.add(DeviceCommandGenerator.motorXPositionSet(p.getX()));//移动x轴
deviceCommands.add(DeviceCommandGenerator.motorYPositionSet(75.5 - p.getY()));//移动y轴
if (j == 0) {
deviceCommands.add(DeviceCommandGenerator.motorXPositionSet(p.getX(), movingSpeed));//移动x轴
deviceCommands.add(DeviceCommandGenerator.motorYPositionSet(75.5 - p.getY(), movingSpeed));//移动y轴
}
if (j == pathList.size() - 1) {
deviceCommands.add(DeviceCommandGenerator.motorXPositionSet(p.getX(), 20.0));//移动x轴
deviceCommands.add(DeviceCommandGenerator.motorYPositionSet(75.5 - p.getY(), 20.0));//移动y轴
}
deviceCommandList.add(deviceCommands);
}
SprayTaskStep sprayTaskStep = new SprayTaskStep();
sprayTaskStep.setIndex(index);
sprayTaskStep.setSpraySteps(deviceCommandList);
@ -234,10 +243,17 @@ public class MatrixSprayStart extends BaseCommandHandler {
PathGenerator.MoveMode.VERTICAL_ZIGZAG_LEFT_RIGHT
);
List<List<DeviceCommand>> deviceCommandList = new ArrayList<>();
for (PathGenerator.Points p : pathList) {//喷针移动目标位置
for (int j = 0; j < pathList.size(); j++) {
PathGenerator.Points p = pathList.get(j);
List<DeviceCommand> deviceCommands = new ArrayList<>();
deviceCommands.add(DeviceCommandGenerator.motorXPositionSet(p.getX()));//移动x轴
deviceCommands.add(DeviceCommandGenerator.motorYPositionSet(75.5 - p.getY()));//移动y轴
if (j == 0) {
deviceCommands.add(DeviceCommandGenerator.motorXPositionSet(p.getX(), movingSpeed));//移动x轴
deviceCommands.add(DeviceCommandGenerator.motorYPositionSet(75.5 - p.getY(), movingSpeed));//移动y轴
}
if (j == pathList.size() - 1) {
deviceCommands.add(DeviceCommandGenerator.motorXPositionSet(p.getX(), 20.0));//移动x轴
deviceCommands.add(DeviceCommandGenerator.motorYPositionSet(75.5 - p.getY(), 20.0));//移动y轴
}
deviceCommandList.add(deviceCommands);
}
SprayTaskStep sprayTaskStep = new SprayTaskStep();
@ -264,10 +280,17 @@ public class MatrixSprayStart extends BaseCommandHandler {
PathGenerator.MoveMode.HORIZONTAL_ZIGZAG_TOP_DOWN
);
List<List<DeviceCommand>> deviceCommandList = new ArrayList<>();
for (PathGenerator.Points p : pathList) {//喷针移动目标位置
for (int j = 0; j < pathList.size(); j++) {
PathGenerator.Points p = pathList.get(j);
List<DeviceCommand> deviceCommands = new ArrayList<>();
deviceCommands.add(DeviceCommandGenerator.motorXPositionSet(p.getX()));//移动x轴
deviceCommands.add(DeviceCommandGenerator.motorYPositionSet(75.5 - p.getY()));//移动y轴
if (j == 0) {
deviceCommands.add(DeviceCommandGenerator.motorXPositionSet(p.getX(), movingSpeed));//移动x轴
deviceCommands.add(DeviceCommandGenerator.motorYPositionSet(75.5 - p.getY(), movingSpeed));//移动y轴
}
if (j == pathList.size() - 1) {
deviceCommands.add(DeviceCommandGenerator.motorXPositionSet(p.getX(), 20.0));//移动x轴
deviceCommands.add(DeviceCommandGenerator.motorYPositionSet(75.5 - p.getY(), 20.0));//移动y轴
}
deviceCommandList.add(deviceCommands);
}
SprayTaskStep sprayTaskStep = new SprayTaskStep();
@ -281,10 +304,17 @@ public class MatrixSprayStart extends BaseCommandHandler {
PathGenerator.MoveMode.VERTICAL_ZIGZAG_LEFT_RIGHT
);
deviceCommandList = new ArrayList<>();
for (PathGenerator.Points p : pathList) {//喷针移动目标位置
for (int j = 0; j < pathList.size(); j++) {
PathGenerator.Points p = pathList.get(j);
List<DeviceCommand> deviceCommands = new ArrayList<>();
deviceCommands.add(DeviceCommandGenerator.motorXPositionSet(p.getX()));//移动x轴
deviceCommands.add(DeviceCommandGenerator.motorYPositionSet(75.5 - p.getY()));//移动y轴
if (j == 0) {
deviceCommands.add(DeviceCommandGenerator.motorXPositionSet(p.getX(), movingSpeed));//移动x轴
deviceCommands.add(DeviceCommandGenerator.motorYPositionSet(75.5 - p.getY(), movingSpeed));//移动y轴
}
if (j == pathList.size() - 1) {
deviceCommands.add(DeviceCommandGenerator.motorXPositionSet(p.getX(), 20.0));//移动x轴
deviceCommands.add(DeviceCommandGenerator.motorYPositionSet(75.5 - p.getY(), 20.0));//移动y轴
}
deviceCommandList.add(deviceCommands);
}
SprayTaskStep sprayTaskStep2 = new SprayTaskStep();

10
src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelinePreFill.java

@ -48,6 +48,10 @@ public class NozzlePipelinePreFill extends BaseCommandHandler {
webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.ERROR, "参数 speed 必填"));
throw new RuntimeException("参数 speed 必填");
}
if (speed > 100) {
webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.ERROR, "预充速度不能大于100"));
throw new RuntimeException("预充速度不能大于100");
}
deviceStatus.setPrefilling(true);
return runAsync(() -> {
//2.判断z轴是否在安全距离如果不在安全距离可以不抬升z轴
@ -76,6 +80,12 @@ public class NozzlePipelinePreFill extends BaseCommandHandler {
DeviceCommand motorZPositionSetCommand = DeviceCommandGenerator.motorZPositionSet(wasteLiquor.getZ(), speed);
CommandFuture motorZPositionSetCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), motorZPositionSetCommand);
commandWait(motorZPositionSetCommandFuture);
//7.开启喷嘴阀
DeviceCommand nozzleValveOpenCommand = DeviceCommandGenerator.nozzleValveOpen(); // 开启喷嘴阀
CommandFuture nozzleValveOpenCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), nozzleValveOpenCommand);
commandWait(nozzleValveOpenCommandFuture);
//5.打开三通阀注射器管路
DeviceCommand threeWayValveOpenNozzlePipelineCommand = DeviceCommandGenerator.threeWayValveOpenNozzlePipeline();
CommandFuture threeWayValveOpenNozzlePipelineCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), threeWayValveOpenNozzlePipelineCommand);

5
src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelinePreFillStop.java

@ -38,6 +38,11 @@ public class NozzlePipelinePreFillStop extends BaseCommandHandler {
CommandFuture threeWayValveCloseAllCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), threeWayValveCloseAllCommand);
commandWait(syringePumpStopCommandFuture, threeWayValveCloseAllCommandFuture);
//7.关闭喷嘴阀
DeviceCommand nozzleValveCloseCommand = DeviceCommandGenerator.nozzleValveClose(); // 关闭喷嘴阀
CommandFuture nozzleValveCloseCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), nozzleValveCloseCommand);
commandWait(nozzleValveCloseCommandFuture);
deviceStatus.setPrefilling(false);
});

5
src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelineWash.java

@ -77,6 +77,11 @@ public class NozzlePipelineWash extends BaseCommandHandler {
CommandFuture threeWayValveOpenSyringePipelineCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), threeWayValveOpenSyringePipelineCommand);
commandWait(threeWayValveOpenSyringePipelineCommandFuture);
//6.打开清洗阀
DeviceCommand washValveOpenCommand = DeviceCommandGenerator.washValveOpen(); // 生成打开清洗阀指令
CommandFuture washValveOpenCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), washValveOpenCommand);
commandWait(washValveOpenCommandFuture);
} catch (Exception e) {
deviceStatus.setCleaningNozzlePipeline(false);
throw new RuntimeException(e);

19
src/main/java/com/qyft/ms/app/front/cmd/business/SyringePipelineWash.java

@ -48,6 +48,10 @@ public class SyringePipelineWash extends BaseCommandHandler {
webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.ERROR, "参数 speed 必填"));
throw new RuntimeException("参数 speed 必填");
}
if (speed > 100) {
webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.ERROR, "清洗速度不能大于100"));
throw new RuntimeException("预充速度不能大于100");
}
deviceStatus.setCleaningSyringePipeline(true);
return runAsync(() -> {
try {
@ -77,11 +81,24 @@ public class SyringePipelineWash extends BaseCommandHandler {
DeviceCommand motorZPositionSetCommand = DeviceCommandGenerator.motorZPositionSet(wasteLiquor.getZ(), speed);
CommandFuture motorZPositionSetCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), motorZPositionSetCommand);
commandWait(motorZPositionSetCommandFuture);
//5.打开三通阀注射器管路
DeviceCommand threeWayValveOpenNozzlePipelineCommand = DeviceCommandGenerator.threeWayValveOpenNozzlePipeline();
CommandFuture threeWayValveOpenNozzlePipelineCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), threeWayValveOpenNozzlePipelineCommand);
commandWait(threeWayValveOpenNozzlePipelineCommandFuture);
//6.设置注射泵速度推注射泵
//6.打开清洗阀
DeviceCommand washValveOpenCommand = DeviceCommandGenerator.washValveOpen(); // 生成打开清洗阀指令
CommandFuture washValveOpenCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), washValveOpenCommand);
commandWait(washValveOpenCommandFuture);
//7.开启喷嘴阀
DeviceCommand nozzleValveOpenCommand = DeviceCommandGenerator.nozzleValveOpen(); // 开启喷嘴阀
CommandFuture nozzleValveOpenCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), nozzleValveOpenCommand);
commandWait(nozzleValveOpenCommandFuture);
//7.设置注射泵速度推注射泵
DeviceCommand syringePumpStartCommand = DeviceCommandGenerator.syringePumpForward(speed); // 生成移动注射泵指令
CommandFuture syringePumpStartCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), syringePumpStartCommand);
commandWait(syringePumpStartCommandFuture);

10
src/main/java/com/qyft/ms/app/front/cmd/business/SyringePipelineWashStop.java

@ -37,6 +37,16 @@ public class SyringePipelineWashStop extends BaseCommandHandler {
CommandFuture threeWayValveCloseAllCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), threeWayValveCloseAllCommand);
commandWait(syringePumpStopCommandFuture, threeWayValveCloseAllCommandFuture);
//6.关闭清洗阀
DeviceCommand washValveCloseCommand = DeviceCommandGenerator.washValveClose(); // 关闭清洗阀
CommandFuture washValveCloseCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), washValveCloseCommand);
commandWait(washValveCloseCommandFuture);
//7.关闭喷嘴阀
DeviceCommand nozzleValveCloseCommand = DeviceCommandGenerator.nozzleValveClose(); // 关闭喷嘴阀
CommandFuture nozzleValveCloseCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), nozzleValveCloseCommand);
commandWait(nozzleValveCloseCommandFuture);
deviceStatus.setCleaningSyringePipeline(false);
deviceStatus.setCleaningNozzlePipeline(false);
});

9
src/main/java/com/qyft/ms/app/model/vo/SprayTaskStatusVO.java

@ -13,7 +13,14 @@ import java.util.Map;
*/
@Data
public class SprayTaskStatusVO {
/**
* 前端指令id
*/
private String cmdId;
/**
* 前端指令code
*/
private String cmdCode;
/**
* 已喷涂点位
*/

Loading…
Cancel
Save