This commit is contained in:
loujf
2022-09-27 10:36:06 +08:00
parent 748371c629
commit d76a4422a5
2 changed files with 36 additions and 20 deletions

View File

@@ -107,29 +107,45 @@ public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implem
}
// public synchronized String getStatus() {
// JSONObject jo = new JSONObject();
//
// if (action == 1) {
// jo.put("name", this.getDevice().getDevice_code());
// jo.put("status", "OPEN");
// jo.put("action", action);
// jo.put("mode", mode);
//
// } else if (action == 2) {
// jo.put("name", this.getDevice().getDevice_code());
// jo.put("status", "CLOSE");
// jo.put("action", action);
// jo.put("mode", mode);
//
// } else {
// jo.put("name", this.getDevice().getDevice_code());
// jo.put("status", "ERROR");
// jo.put("action", action);
// jo.put("mode", mode);
// }
// System.out.println("查询自动门状态,device_code:"+this.getDevice().getDevice_code() +",action:" + action +",mode:"+mode+",param:"+jo);
//
// return jo.toString();
// }
public synchronized String getStatus() {
JSONObject jo = new JSONObject();
if (action == 1) {
if (action == 1 && mode == 2) {
jo.put("name", this.getDevice().getDevice_code());
jo.put("status", "OPEN");
jo.put("action", action);
jo.put("mode", mode);
} else if (action == 2) {
} else if (action == 2 && mode == 2) {
jo.put("name", this.getDevice().getDevice_code());
jo.put("status", "CLOSE");
jo.put("action", action);
jo.put("mode", mode);
} else {
jo.put("name", this.getDevice().getDevice_code());
jo.put("status", "ERROR");
jo.put("action", action);
jo.put("mode", mode);
}
System.out.println("查询自动门状态,device_code:"+this.getDevice().getDevice_code() +",action:" + action +",mode:"+mode+",param:"+jo);
return jo.toString();
}

View File

@@ -190,16 +190,16 @@ public class StandardManipulatorInspectSiteDeviceDriver extends AbstractOpcDevic
break;
case 3:
//申请空盘
if (!requireSucess && this.move == 0) {
applyEmpty();
}
break;
// if (!requireSucess && this.move == 0) {
// applyEmpty();
// }
// break;
case 4:
//申请搬运任务
if (!requireSucess && this.move != 0) {
autoCreateTask();
}
break;
// if (!requireSucess && this.move != 0) {
// autoCreateTask();
// }
// break;
case 5:
break;
}