|
@ -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() { |
|
|
public synchronized String getStatus() { |
|
|
JSONObject jo = new JSONObject(); |
|
|
JSONObject jo = new JSONObject(); |
|
|
|
|
|
|
|
|
if (action == 1) { |
|
|
if (action == 1 && mode == 2) { |
|
|
jo.put("name", this.getDevice().getDevice_code()); |
|
|
jo.put("name", this.getDevice().getDevice_code()); |
|
|
jo.put("status", "OPEN"); |
|
|
jo.put("status", "OPEN"); |
|
|
jo.put("action", action); |
|
|
} else if (action == 2 && mode == 2) { |
|
|
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(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|