This commit is contained in:
USER-20220102CG\noblelift
2022-08-02 08:56:26 +08:00
parent 922973f09e
commit bf9e59c1fc
2 changed files with 13 additions and 16 deletions

View File

@@ -683,7 +683,6 @@ public class AgvServiceImpl implements AgvService {
HttpResponse result = HttpRequest.get(agvurl) HttpResponse result = HttpRequest.get(agvurl)
.timeout(20000)//超时,毫秒 .timeout(20000)//超时,毫秒
.execute(); .execute();
System.out.println("查询agv指令数据:" + result.body());
return result; return result;
} else { } else {

View File

@@ -100,38 +100,36 @@ public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implem
mode = this.itemProtocol.getMode(); mode = this.itemProtocol.getMode();
action = this.itemProtocol.getAction(); action = this.itemProtocol.getAction();
error = this.itemProtocol.getError(); error = this.itemProtocol.getError();
if (mode != last_mode) {
this.execute_log.log("设备:" + device_code + ",last_mode -> mode:" + last_mode + "->" + mode);
}
if (action != last_action) {
this.execute_log.log("设备:" + device_code + ",last_action -> action:" + last_action + "->" + action);
}
if (error != last_error) {
//this.execute_log.setContainer("");
this.execute_log.log("设备:" + device_code + ",last_error -> error:" + last_error + "->" + error);
}
last_action = action; last_action = action;
last_mode = mode; last_mode = mode;
last_error = error; last_error = error;
//message = StringFormatUtl.format("设备报警:{}", new Object[]{});
// String manual_create_task = this.getDevice().getExtraValue().get("manual_create_task").toString();
} }
public synchronized String getStatus() { public synchronized String getStatus() {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
if (action == 1 && mode == 2) { if (action == 1) {
jo.put("name", this.getDevice().getDevice_code()); jo.put("name", this.getDevice().getDevice_code());
jo.put("status", "OPEN"); jo.put("status", "OPEN");
} else if (action == 2 && mode == 2) { jo.put("action", action);
jo.put("mode", mode);
} else if (action == 2) {
jo.put("name", this.getDevice().getDevice_code()); jo.put("name", this.getDevice().getDevice_code());
jo.put("status", "CLOSE"); jo.put("status", "CLOSE");
jo.put("action", action);
jo.put("mode", mode);
} else { } else {
jo.put("name", this.getDevice().getDevice_code()); jo.put("name", this.getDevice().getDevice_code());
jo.put("status", "ERROR"); 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(); return jo.toString();
} }