叠盘机测高已可用,改为自动同步

This commit is contained in:
psh
2024-04-18 09:44:23 +08:00
parent 7b20aca842
commit 8a40def0bb
7 changed files with 104 additions and 39 deletions

View File

@@ -112,6 +112,11 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
if (number != last_number) {
int max_emptypalletnum = Integer.parseInt(this.getDevice().getExtraValue().get("max_emptypalletnum").toString());
JSONObject json = new JSONObject();
json.put("number", number);
json.put("device_code",device_code);
json.put("type",1);
acsToWmsService.notify(json);
if (number == max_emptypalletnum) {
this.requireSucess = false;
}

View File

@@ -95,7 +95,7 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
private Date instruction_require_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 resultSucess = false;
@@ -173,51 +173,85 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
if (error != last_error) {
}
if (move != last_move) {
if (move != last_move && "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("point_qty", move);
json.put("point_qty", move==0?"无货":"有货");
json.put("type",2);
acsToWmsService.notify(json);
}
if (!Objects.equals(mother_tray, last_mother_tray)) {
if (!Objects.equals(mother_tray, last_mother_tray)&& "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("mother_tray", mother_tray);
json.put("type",2);
acsToWmsService.notify(json);
}
if (!Objects.equals(sub_tray, last_sub_tray)) {
if (!Objects.equals(sub_tray, last_sub_tray)&& "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("sub_tray", sub_tray);
json.put("type",2);
acsToWmsService.notify(json);
}
if (device_type != last_device_type) {
if (device_type != last_device_type && "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("device_type", device_type);
json.put("device_type", device_type==0?"正常":"异常");
json.put("type",2);
acsToWmsService.notify(json);
}
if (frame_type != last_frame_type) {
if (frame_type != last_frame_type && "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("frame_type", frame_type);
json.put("frame_type", frame_type==0?"正常":"异常");
json.put("type",2);
acsToWmsService.notify(json);
}
if (mother_type != last_mother_type) {
if (mother_type != last_mother_type && "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("sub_type", sub_type);
json.put("sub_type", sub_type==0?"正常":"异常");
json.put("type",2);
acsToWmsService.notify(json);
}
if (sub_type != last_sub_type) {
if (sub_type != last_sub_type && "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("sub_type", sub_type);
json.put("sub_type", sub_type==0?"正常":"异常");
json.put("type",2);
acsToWmsService.notify(json);
}
if (error_code != last_error_code) {
if (error_code != last_error_code && "SSX04".equals(this.devicecode)) {
JSONObject json = new JSONObject();
json.put("error", error_code);
String errorCode="";
switch (error_code){
case 0:
errorCode="无报警";
break;
case 1:
errorCode="超高";
break;
case 10:
errorCode="左超宽";
break;
case 100:
errorCode="右超宽";
break;
case 1000:
errorCode="前超长";
break;
case 10000:
errorCode="后超长";
break;
case 100000:
errorCode="超重";
break;
default:
break;
}
json.put("error", errorCode);
json.put("type",2);
acsToWmsService.notify(json);
}