|
@ -61,31 +61,31 @@ public class MatrixSprayPause extends BaseCommandHandler { |
|
|
CommandFuture motorZStopCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), motorZStopCommand); |
|
|
CommandFuture motorZStopCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), motorZStopCommand); |
|
|
commandWait(motorXStopCommandFuture, motorYStopCommandFuture, motorZStopCommandFuture); |
|
|
commandWait(motorXStopCommandFuture, motorYStopCommandFuture, motorZStopCommandFuture); |
|
|
|
|
|
|
|
|
if(sprayTask.getCurrentStep() > 0 && sprayTask.getCurrentPausedPoint() == null){//只有在喷涂过程中才需要记录,并且记录点不可被覆盖 |
|
|
|
|
|
//记录当前位置 |
|
|
|
|
|
DeviceCommand motorXyzPositionGetCommand = DeviceCommandGenerator.motorXyzPositionGet(); // 生成获得电机XYZ相对原点坐标指令 |
|
|
|
|
|
CommandFuture motorXyzPositionGetCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), motorXyzPositionGetCommand); |
|
|
|
|
|
commandWait(motorXyzPositionGetCommandFuture); |
|
|
|
|
|
JSONObject motorXyzPositionGetCommandDeviceResult = motorXyzPositionGetCommandFuture.getResponseResult(); |
|
|
|
|
|
Double xAxisPosition = motorXyzPositionGetCommandDeviceResult.getJSONObject("data").getDouble("xAxisPosition"); |
|
|
|
|
|
Double yAxisPosition = motorXyzPositionGetCommandDeviceResult.getJSONObject("data").getDouble("yAxisPosition"); |
|
|
|
|
|
Double zAxisPosition = motorXyzPositionGetCommandDeviceResult.getJSONObject("data").getDouble("zAxisPosition"); |
|
|
|
|
|
Point3D point3D = new Point3D(xAxisPosition, yAxisPosition, zAxisPosition); |
|
|
|
|
|
sprayTask.setCurrentPausedPoint(point3D); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// if(sprayTask.getCurrentStep() > 0 && sprayTask.getCurrentPausedPoint() == null){//只有在喷涂过程中才需要记录,并且记录点不可被覆盖 |
|
|
|
|
|
// //记录当前位置 |
|
|
|
|
|
// DeviceCommand motorXyzPositionGetCommand = DeviceCommandGenerator.motorXyzPositionGet(); // 生成获得电机XYZ相对原点坐标指令 |
|
|
|
|
|
// CommandFuture motorXyzPositionGetCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), motorXyzPositionGetCommand); |
|
|
|
|
|
// commandWait(motorXyzPositionGetCommandFuture); |
|
|
|
|
|
// JSONObject motorXyzPositionGetCommandDeviceResult = motorXyzPositionGetCommandFuture.getResponseResult(); |
|
|
|
|
|
// Double xAxisPosition = motorXyzPositionGetCommandDeviceResult.getJSONObject("data").getDouble("xAxisPosition"); |
|
|
|
|
|
// Double yAxisPosition = motorXyzPositionGetCommandDeviceResult.getJSONObject("data").getDouble("yAxisPosition"); |
|
|
|
|
|
// Double zAxisPosition = motorXyzPositionGetCommandDeviceResult.getJSONObject("data").getDouble("zAxisPosition"); |
|
|
|
|
|
// Point3D point3D = new Point3D(xAxisPosition, yAxisPosition, zAxisPosition); |
|
|
|
|
|
// sprayTask.setCurrentPausedPoint(point3D); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
OperationLog operationLog = operationLogService.getById(sprayTask.getOperationLogId()); |
|
|
OperationLog operationLog = operationLogService.getById(sprayTask.getOperationLogId()); |
|
|
operationLog.setStatus(2); |
|
|
operationLog.setStatus(2); |
|
|
operationLogService.updateById(operationLog); |
|
|
operationLogService.updateById(operationLog); |
|
|
|
|
|
|
|
|
//XYZ回原点 |
|
|
//XYZ回原点 |
|
|
DeviceCommand motorXOriginCommand = DeviceCommandGenerator.motorXOrigin(); |
|
|
|
|
|
DeviceCommand motorYOriginCommand = DeviceCommandGenerator.motorYOrigin(); |
|
|
|
|
|
DeviceCommand motorZOriginCommand = DeviceCommandGenerator.motorZOrigin(); |
|
|
|
|
|
CommandFuture motorXOriginCommandFuture = deviceCommandService.sendCommandSprayTask(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXOriginCommand); |
|
|
|
|
|
CommandFuture motorYOriginCommandFuture = deviceCommandService.sendCommandSprayTask(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYOriginCommand); |
|
|
|
|
|
CommandFuture motorZOriginCommandFuture = deviceCommandService.sendCommandSprayTask(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZOriginCommand); |
|
|
|
|
|
commandWait(motorXOriginCommandFuture, motorYOriginCommandFuture, motorZOriginCommandFuture); |
|
|
|
|
|
|
|
|
// DeviceCommand motorXOriginCommand = DeviceCommandGenerator.motorXOrigin(); |
|
|
|
|
|
// DeviceCommand motorYOriginCommand = DeviceCommandGenerator.motorYOrigin(); |
|
|
|
|
|
// DeviceCommand motorZOriginCommand = DeviceCommandGenerator.motorZOrigin(); |
|
|
|
|
|
// CommandFuture motorXOriginCommandFuture = deviceCommandService.sendCommandSprayTask(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorXOriginCommand); |
|
|
|
|
|
// CommandFuture motorYOriginCommandFuture = deviceCommandService.sendCommandSprayTask(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorYOriginCommand); |
|
|
|
|
|
// CommandFuture motorZOriginCommandFuture = deviceCommandService.sendCommandSprayTask(sprayTask.getCmdId(), sprayTask.getCmdCode(), motorZOriginCommand); |
|
|
|
|
|
// commandWait(motorXOriginCommandFuture, motorYOriginCommandFuture, motorZOriginCommandFuture); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
throw new RuntimeException(e); |
|
|
throw new RuntimeException(e); |
|
|
}finally { |
|
|
}finally { |
|
|