diff --git a/acs2/nladmin-system/nlsso-server/.gitignore b/acs2/nladmin-system/nlsso-server/.gitignore new file mode 100644 index 000000000..a9a5d8960 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/.gitignore @@ -0,0 +1,9 @@ +### IDEA ### +*/*.log +.idea/* +*.iml +*/target/* +*/*.iml +/.gradle/ +/target/* +/logPath_IS_UNDEFINED/ diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java index 3357bf14c..665b4b708 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java @@ -168,7 +168,19 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl String message = null; private Date instruction_require_time = new Date(); + private Date bushingSucess_time = new Date(); + private Date apply_casing_time = new Date(); + private Date applyPullShaft_time = new Date(); + private Date pullShaftSucess_time = new Date(); + private Date applyTask_time = new Date(); + private Date applyQzz_time = new Date(); private int instruction_require_time_out = 3000; + private int apply_casing_time_out = 3000; + private int bushingSucess_time_out = 3000; + private int applyPullShaft_time_out = 3000; + private int pullShaftSucess_time_out = 3000; + private int applyTask_time_out = 3000; + private int applyQzz_time_out = 3000; @Override public Device getDevice() { @@ -325,10 +337,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl */ private synchronized void apply_casing(int mode) throws Exception { Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + if (date.getTime() - this.apply_casing_time.getTime() < (long) this.apply_casing_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", apply_casing_time_out); return; } else { + this.apply_casing_time = date; logServer.deviceExecuteLog(this.device_code, "", "", "申请套管"); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; @@ -452,10 +465,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl */ private synchronized void bushingSucess(int mode) throws Exception { Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + if (date.getTime() - this.bushingSucess_time.getTime() < (long) this.bushingSucess_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.bushingSucess_time_out); return; } else { + this.bushingSucess_time = date; ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; applyPlugPullSiteRequest.setDevice_code(device_code); @@ -514,10 +528,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl */ private synchronized void pullShaftSucess(int mode) throws Exception { Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + if (date.getTime() - this.pullShaftSucess_time.getTime() < (long) this.pullShaftSucess_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.pullShaftSucess_time_out); return; } else { + this.pullShaftSucess_time = date; logServer.deviceExecuteLog(this.device_code, "", "", "拔轴完成"); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; @@ -572,10 +587,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl */ private synchronized void applyPullShaft(int mode) throws Exception { Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + if (date.getTime() - this.applyPullShaft_time.getTime() < (long) this.applyPullShaft_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.applyPullShaft_time_out); return; } else { + this.applyPullShaft_time = date; logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴"); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; @@ -668,10 +684,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl */ private synchronized void applyTask(int mode) throws Exception { Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + if (date.getTime() - this.applyTask_time.getTime() < (long) this.applyTask_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.applyTask_time_out); return; } else { + this.applyTask_time = date; logServer.deviceExecuteLog(this.device_code, "", "", "缓存线已满,生成行架任务"); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); ApplyPlugPullSitResponse applyPlugPullSitResponse; @@ -726,10 +743,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl */ private boolean applyQzz(int mode) throws Exception { Date date = new Date(); - if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + if (date.getTime() - this.applyQzz_time.getTime() < (long) this.applyQzz_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.applyQzz_time_out); return false; } else { + this.applyQzz_time = date; JSONObject jo = new JSONObject(); jo.put("device_code", this.getDevice_code()); jo.put("size", this.getSize());