|
@ -87,7 +87,7 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De |
|
|
private Date instruction_require_time = new Date(); |
|
|
private Date instruction_require_time = new Date(); |
|
|
private Date instruction_finished_time = new Date(); |
|
|
private Date instruction_finished_time = new Date(); |
|
|
|
|
|
|
|
|
private int instruction_require_time_out; |
|
|
private int instruction_require_time_out = 3000; |
|
|
boolean requireSucess = false; |
|
|
boolean requireSucess = false; |
|
|
|
|
|
|
|
|
private int instruction_finished_time_out; |
|
|
private int instruction_finished_time_out; |
|
@ -477,26 +477,7 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public JSONObject getDeviceStatusName() throws Exception { |
|
|
public JSONObject getDeviceStatusName() throws Exception { |
|
|
String mode; |
|
|
|
|
|
String status; |
|
|
String status; |
|
|
|
|
|
|
|
|
switch (this.mode) { |
|
|
|
|
|
case 0: |
|
|
|
|
|
mode = "脱机"; |
|
|
|
|
|
break; |
|
|
|
|
|
case 2: |
|
|
|
|
|
mode = "待机"; |
|
|
|
|
|
break; |
|
|
|
|
|
case 3: |
|
|
|
|
|
mode = "排产确认"; |
|
|
|
|
|
break; |
|
|
|
|
|
case 4: |
|
|
|
|
|
mode = "工单完成"; |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
mode = String.valueOf(this.mode); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
switch (this.status) { |
|
|
switch (this.status) { |
|
|
case 1: |
|
|
case 1: |
|
|
status = "待机"; |
|
|
status = "待机"; |
|
@ -535,6 +516,12 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De |
|
|
JSONObject jo = new JSONObject(); |
|
|
JSONObject jo = new JSONObject(); |
|
|
jo.put("device_name", this.getDevice().getDevice_name()); |
|
|
jo.put("device_name", this.getDevice().getDevice_name()); |
|
|
jo.put("mode", mode); |
|
|
jo.put("mode", mode); |
|
|
|
|
|
Object requestNo = this.getExtraValue().get(String.valueOf(this.mode)); |
|
|
|
|
|
if(ObjectUtil.isNotEmpty(requestNo)){ |
|
|
|
|
|
jo.put("modeName", this.getModeName(String.valueOf(requestNo))); |
|
|
|
|
|
} else { |
|
|
|
|
|
jo.put("modeName", "无效的请求,驱动中未配置"); |
|
|
|
|
|
} |
|
|
jo.put("status", status); |
|
|
jo.put("status", status); |
|
|
jo.put("error", error); |
|
|
jo.put("error", error); |
|
|
jo.put("open_time", open_time); |
|
|
jo.put("open_time", open_time); |
|
|