diff --git a/src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayChangeParam.java b/src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayChangeParam.java index 6c1a0a5..a8d42f3 100644 --- a/src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayChangeParam.java +++ b/src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayChangeParam.java @@ -48,7 +48,7 @@ public class MatrixSprayChangeParam extends BaseCommandHandler { Double highVoltageValue = form.getDoubleParam("highVoltageValue"); Double movingSpeed = form.getDoubleParam("movingSpeed"); - if (highVoltageValue > 6000) { + if (highVoltageValue!= null && highVoltageValue > 6000) { webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.DEVICE_ERROR, "电压不能大于6000V")); throw new RuntimeException("电压不能大于6000V"); } diff --git a/src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayStart.java b/src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayStart.java index da55354..c2078f3 100644 --- a/src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayStart.java +++ b/src/main/java/com/qyft/ms/app/front/cmd/business/MatrixSprayStart.java @@ -134,7 +134,7 @@ public class MatrixSprayStart extends BaseCommandHandler { List> positionList = (List>) form.getParams().get("position"); nonNullCheck(matrixPathType, form.getCmdId(), form.getCmdCode(), motorZHeight, gasPressure, volume, highVoltage, spacing, movingSpeed, times, positionList); - if (highVoltageValue > 6000) { + if (highVoltageValue != null && highVoltageValue > 6000) { webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.DEVICE_ERROR, "电压不能大于6000V")); throw new RuntimeException("电压不能大于6000V"); } @@ -341,7 +341,7 @@ public class MatrixSprayStart extends BaseCommandHandler { CommandFuture[] commandFutureArray = futureList.toArray(new CommandFuture[0]); commandWait(commandFutureArray); - DeviceCommand threeWayValveOpenSyringePipelineCommand = DeviceCommandGenerator.threeWayValveOpenSyringePipeline();//打开三通阀喷嘴管路 + DeviceCommand threeWayValveOpenSyringePipelineCommand = DeviceCommandGenerator.threeWayValveOpenNozzlePipeline();//打开三通阀注射器管路 CommandFuture threeWayValveOpenSyringePipelineCommandFuture = deviceCommandService.sendCommand(form.getCmdId(), form.getCmdCode(), threeWayValveOpenSyringePipelineCommand); commandWait(threeWayValveOpenSyringePipelineCommandFuture); diff --git a/src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelinePreFill.java b/src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelinePreFill.java index 53f511f..5357673 100644 --- a/src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelinePreFill.java +++ b/src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelinePreFill.java @@ -64,6 +64,7 @@ public class NozzlePipelinePreFill extends BaseCommandHandler { webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.DEVICE_ERROR, "获得电机XYZ相对原点坐标失败")); throw new RuntimeException("获得电机XYZ相对原点坐标失败"); } + zAxisPosition = Math.abs(zAxisPosition); SysSettings safeZHeightSysSettings = sysSettingsService.getOne(new LambdaQueryWrapper().eq(SysSettings::getCode, "safe_z_height")); double safeZHeight = Double.parseDouble(safeZHeightSysSettings.getValue()); if (zAxisPosition > safeZHeight) { //z轴超出安全距离,抬升z轴 diff --git a/src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelineWash.java b/src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelineWash.java index 07e9b1d..53edf39 100644 --- a/src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelineWash.java +++ b/src/main/java/com/qyft/ms/app/front/cmd/business/NozzlePipelineWash.java @@ -56,6 +56,7 @@ public class NozzlePipelineWash extends BaseCommandHandler { webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.DEVICE_ERROR, "获得电机XYZ相对原点坐标失败", motorXyzPositionGetCommandDeviceResult)); throw new RuntimeException("获得电机XYZ相对原点坐标失败"); } + zAxisPosition = Math.abs(zAxisPosition); SysSettings safeZHeightSysSettings = sysSettingsService.getOne(new LambdaQueryWrapper().eq(SysSettings::getCode, "safe_z_height")); double safeZHeight = Double.parseDouble(safeZHeightSysSettings.getValue()); if (zAxisPosition > safeZHeight) { //z轴超出安全距离,抬升z轴 diff --git a/src/main/java/com/qyft/ms/app/front/cmd/business/SyringePipelineWash.java b/src/main/java/com/qyft/ms/app/front/cmd/business/SyringePipelineWash.java index 7bd0eff..60b93ac 100644 --- a/src/main/java/com/qyft/ms/app/front/cmd/business/SyringePipelineWash.java +++ b/src/main/java/com/qyft/ms/app/front/cmd/business/SyringePipelineWash.java @@ -65,6 +65,7 @@ public class SyringePipelineWash extends BaseCommandHandler { webSocketService.pushCMDResponseMsg(FrontResponseGenerator.generateJson(form.getCmdId(), form.getCmdCode(), CommandStatus.DEVICE_ERROR, "获得电机XYZ相对原点坐标失败", motorXyzPositionGetCommandDeviceResult)); throw new RuntimeException("获得电机XYZ相对原点坐标失败"); } + zAxisPosition = Math.abs(zAxisPosition); SysSettings safeZHeightSysSettings = sysSettingsService.getOne(new LambdaQueryWrapper().eq(SysSettings::getCode, "safe_z_height")); double safeZHeight = Double.parseDouble(safeZHeightSysSettings.getValue()); if (zAxisPosition > safeZHeight) { //z轴超出安全距离,抬升z轴 diff --git a/src/main/java/com/qyft/ms/app/front/cmd/debug/MotorXMove.java b/src/main/java/com/qyft/ms/app/front/cmd/debug/MotorXMove.java index a7303ac..56d4e62 100644 --- a/src/main/java/com/qyft/ms/app/front/cmd/debug/MotorXMove.java +++ b/src/main/java/com/qyft/ms/app/front/cmd/debug/MotorXMove.java @@ -38,7 +38,7 @@ public class MotorXMove extends BaseCommandHandler { JSONObject motorXyzPositionGetCommandResult = motorXyzPositionGetCommandFuture.getResponseResult(); Double xAxisPosition = motorXyzPositionGetCommandResult.getJSONObject("data").getDouble("xAxisPosition"); - + xAxisPosition = Math.abs(xAxisPosition); // 计算目标位置 double finalPosition = 0.0; if ("forward".equals(direction)) { diff --git a/src/main/java/com/qyft/ms/app/front/cmd/debug/MotorYMove.java b/src/main/java/com/qyft/ms/app/front/cmd/debug/MotorYMove.java index 946aac3..2e8e293 100644 --- a/src/main/java/com/qyft/ms/app/front/cmd/debug/MotorYMove.java +++ b/src/main/java/com/qyft/ms/app/front/cmd/debug/MotorYMove.java @@ -37,7 +37,7 @@ public class MotorYMove extends BaseCommandHandler { commandWait(motorXyzPositionGetCommandFuture); JSONObject motorXyzPositionGetCommandDeviceResult = motorXyzPositionGetCommandFuture.getResponseResult(); Double yAxisPosition = motorXyzPositionGetCommandDeviceResult.getJSONObject("data").getDouble("yAxisPosition"); - + yAxisPosition = Math.abs(yAxisPosition); // 计算目标位置 double finalPosition = 0.0; if ("forward".equals(direction)) { diff --git a/src/main/java/com/qyft/ms/app/front/cmd/debug/MotorZMove.java b/src/main/java/com/qyft/ms/app/front/cmd/debug/MotorZMove.java index fcf5a9b..c6d336e 100644 --- a/src/main/java/com/qyft/ms/app/front/cmd/debug/MotorZMove.java +++ b/src/main/java/com/qyft/ms/app/front/cmd/debug/MotorZMove.java @@ -38,7 +38,7 @@ public class MotorZMove extends BaseCommandHandler { commandWait(motorXyzPositionGetCommandFuture); JSONObject motorXyzPositionGetCommandDeviceResult = motorXyzPositionGetCommandFuture.getResponseResult(); Double zAxisPosition = motorXyzPositionGetCommandDeviceResult.getJSONObject("data").getDouble("zAxisPosition"); - + zAxisPosition = Math.abs(zAxisPosition); // 根据方向计算最终位置 double finalPosition = 0.0; if ("forward".equals(direction)) { diff --git a/src/main/java/com/qyft/ms/system/core/listener/DeviceTcpMessageEventListener.java b/src/main/java/com/qyft/ms/system/core/listener/DeviceTcpMessageEventListener.java index 71ed152..0c47bd3 100644 --- a/src/main/java/com/qyft/ms/system/core/listener/DeviceTcpMessageEventListener.java +++ b/src/main/java/com/qyft/ms/system/core/listener/DeviceTcpMessageEventListener.java @@ -40,6 +40,7 @@ public class DeviceTcpMessageEventListener { deviceStatus.setPaused(false); deviceStatus.setSuspendable(false); deviceStatus.setStopPressed(true); + deviceStatus.setSelfTestCompleted(false); deviceCommandService.releaseAllCommandFutures(); } else if ("system_e_stop_released".equals(eventType)) {//系统急停按钮被释放 deviceStatus.setStopPressed(false); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index c8363ab..b19e302 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -40,9 +40,9 @@ jwt: tcp: enable: true # 是否开启 TCP 连接 server-enable: true # 是否开启 TCP 连接 - # host: 127.0.0.1 + host: 127.0.0.1 # host: 192.168.1.106 - host: 192.168.1.140 +# host: 192.168.1.140 # host: 192.168.100.168 port: 9080 reconnect: 5000 # 断线重连间隔(单位:毫秒)