This commit is contained in:
2023-02-04 04:00:48 +08:00
parent 6c54ba967c
commit 28f05f933e
8 changed files with 72 additions and 18 deletions

View File

@@ -953,6 +953,10 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
} else if (device.getDeviceDriver() instanceof SiemensConveyorCkkDeviceDriver) {
SiemensConveyorCkkDeviceDriver siemensConveyorCkkDeviceDriver = (SiemensConveyorCkkDeviceDriver) device.getDeviceDriver();
siemensConveyorCkkDeviceDriver.setDeviceStatus(form);
} else if (device.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver){
StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver
= (StandardCoveyorControlWithScannerDeviceDriver) device.getDeviceDriver();
standardCoveyorControlWithScannerDeviceDriver.setDeviceStatus(form);
}
}

View File

@@ -297,7 +297,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
break;
case 6:
//空托盘满垛入库申请
if (move > 0 && !requireEmptyInSuccess) {
if (move > 0 && !requireSucess) {
emptyIn();
}
if (move > 0 && !requireSucess) {
@@ -867,13 +867,13 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
JSONObject jo = JSON.parseObject(str);
if (ObjectUtil.isEmpty(jo)) {
message = "申请空盘入库接口不通";
requireEmptyInSuccess = true;
requireSucess = true;
} else {
if (jo.getInteger("status") == 200) {
message = "申请空盘入库成功";
requireEmptyInSuccess = true;
requireSucess = true;
} else {
requireEmptyInSuccess = true;
requireSucess = true;
message = "申请空盘入库失败," + jo.get("message").toString();
}
}

View File

@@ -1470,6 +1470,12 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
is_disable = "禁用";
}
String requireSucess = "0";
if (this.requireSucess) {
requireSucess = "1";
}
jo.put("requireSucess", requireSucess);
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("status", status);
@@ -1540,5 +1546,11 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
if (StrUtil.isNotEmpty(is_disable)) {
this.setIs_disable(Integer.parseInt(is_disable));
}
String requestSucess = data.getString("requireSucess");
if (StrUtil.equals(requestSucess, "0")) {
this.requireSucess = false;
} else if (StrUtil.equals(requestSucess, "1")) {
this.requireSucess = true;
}
}
}

View File

@@ -853,7 +853,19 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
@Override
public void setDeviceStatus(JSONObject data) {
String requestSucess = data.getString("requireSucess");
System.out.println(requestSucess);
if (StrUtil.equals(requestSucess, "0")) {
this.requireSucess = false;
} else if (StrUtil.equals(requestSucess, "1")) {
this.requireSucess = true;
}
String applySucess = data.getString("applySucess");
if (StrUtil.equals(applySucess, "0")) {
this.applySucess = false;
} else if (StrUtil.equals(applySucess, "1")) {
this.applySucess = true;
}
}
}

View File

@@ -5,16 +5,16 @@ import org.nl.acs.device_driver.DeviceDriver;
public interface ExecutableDeviceDriver extends DeviceDriver {
default void executeAuto() {
try {
this.execute();
} catch (Throwable var6) {
String message = "线程调用异常:" + var6.getMessage();
Log.error(message);
} finally {
}
// try {
// this.execute();
// } catch (Throwable var6) {
// String message = "线程调用异常:" + var6.getMessage();
// Log.error(message);
// } finally {
// }
this.execute();
}
void execute() throws Exception;
void execute();
}