rev 联调问题修改
This commit is contained in:
@@ -16,11 +16,11 @@ import java.util.Arrays;
|
||||
public enum StatusEnum {
|
||||
|
||||
//指令状态
|
||||
DEVICE_STATUS_CLOSE("01", "设备关机", ""),
|
||||
DEVICE_STATUS_OPEN("02", "设备开机", ""),
|
||||
DEVICE_STATUS_PRODUCING("03", "设备生产中", ""),
|
||||
DEVICE_STATUS_WAIT_PRODUCE("04", "设备待生产", ""),
|
||||
DEVICE_STATUS_ERROR("05", "设备异常", ""),
|
||||
DEVICE_STATUS_CLOSE("1", "设备关机", ""),
|
||||
DEVICE_STATUS_OPEN("2", "设备开机", ""),
|
||||
DEVICE_STATUS_PRODUCING("3", "设备生产中", ""),
|
||||
DEVICE_STATUS_WAIT_PRODUCE("4", "设备待生产", ""),
|
||||
DEVICE_STATUS_ERROR("5", "设备异常", ""),
|
||||
|
||||
//AGV是否需要搬运
|
||||
NO_NEED_MOVE("0", "不需要搬运", ""),
|
||||
@@ -46,6 +46,8 @@ public enum StatusEnum {
|
||||
KZ_EMPTY_REQ("4", "叫空框请求(刻字)", ""),
|
||||
BZ_FULL_REQ("5", "叫满框请求(包装)", ""),
|
||||
BZ_EMPTY_REQ("6", "送空框请求(包装)", ""),
|
||||
QX_LACK_REQ("7", "清洗机缺料请求", ""),
|
||||
QX_FULL_REQ("8", "清洗机满料请求", ""),
|
||||
|
||||
//指令状态
|
||||
INST_READY("0", "就绪", ""),
|
||||
|
||||
@@ -338,8 +338,8 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
message = "未联机";
|
||||
//有报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
// this.setIsonline(true);
|
||||
// this.setIserror(false);
|
||||
message = "";
|
||||
/**
|
||||
*
|
||||
@@ -885,7 +885,7 @@ public class HailiangAutoCacheLineDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
jo.put("task", task);
|
||||
jo.put("prepare_barcode", prepare_barcode);
|
||||
jo.put("docking_barcode", docking_barcode);
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("isOnline", this.itemProtocol.getIsonline());
|
||||
jo.put("error", ErrorUtil.getDictDetail("cache_line_error_type", String.valueOf(this.getError())));
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("message", this.getMessage());
|
||||
|
||||
@@ -167,20 +167,17 @@ public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver i
|
||||
//this.setIserror(true);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
//this.setIsonline(false);
|
||||
//this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
|
||||
//申请清洗上料
|
||||
if (mode == 1 && in_ready == 1 && allowed_in == 1 && !requireSucess) {
|
||||
applyForLoading();
|
||||
message = "申请清洗上料成功";
|
||||
boolean flag = applyForLoading();
|
||||
this.noApplyTaskMessage = null;
|
||||
if (flag) {
|
||||
message = "申请清洗上料成功";
|
||||
}
|
||||
} else {
|
||||
if (allowed_in == 1) {
|
||||
String noApplyMessage = "未申请清洗上料原因:";
|
||||
@@ -198,10 +195,12 @@ public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
|
||||
//反馈mes清洗上料完成
|
||||
if (mode == 1 && task_finish == 1 && requireSucess) {
|
||||
feedMesTaskClear();
|
||||
message = "反馈清洗上料完成成功";
|
||||
if (mode == 1 && task_finish == 1 && !requireSucess) {
|
||||
boolean flag = feedMesTaskClear();
|
||||
this.noFeedMessage = null;
|
||||
if (flag) {
|
||||
this.message = "反馈清洗上料完成成功";
|
||||
}
|
||||
} else {
|
||||
if (task_finish == 1) {
|
||||
String notFeedMessage = "未反馈mes清洗上料完成原因:";
|
||||
@@ -228,10 +227,11 @@ public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver i
|
||||
/**
|
||||
* 上料完成以后反馈mes 上料设备号
|
||||
*/
|
||||
private void feedMesTaskClear() {
|
||||
private boolean feedMesTaskClear() {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return false;
|
||||
} else {
|
||||
this.writing("to_confirm_finished", "1");
|
||||
ProduceshiftorderDto dto = produceshiftorderService.findOrderByDeviceCode(this.getDevice_code());
|
||||
@@ -251,31 +251,37 @@ public class HailiangCleaningFeedingLineDriver extends AbstractOpcDeviceDriver i
|
||||
// TODO 反馈接口未确定
|
||||
JSONObject reqParam = new JSONObject();
|
||||
reqParam.put("device_code", this.getDevice_code());
|
||||
reqParam.put("type", StatusEnum.QX_FULL_REQ.getCode());
|
||||
reqParam.put("in_devices", dto.getIn_devices());
|
||||
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
requireSucess = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请清洗上料
|
||||
*/
|
||||
private synchronized void applyForLoading() {
|
||||
private synchronized boolean applyForLoading() {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return false;
|
||||
} else {
|
||||
JSONObject reqParam = new JSONObject();
|
||||
reqParam.put("device_code", this.getDevice_code());
|
||||
reqParam.put("type", StatusEnum.FULL_REQ.getCode());
|
||||
reqParam.put("type", StatusEnum.QX_LACK_REQ.getCode());
|
||||
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
this.writing("to_in_confirm_req", "1");
|
||||
requireSucess = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -155,11 +155,6 @@ public class HailiangCleaningMachineDeviceDriver extends AbstractOpcDeviceDriver
|
||||
//this.setIserror(true);
|
||||
message = "信号量同步异常";
|
||||
//未联机
|
||||
} else if (error != 0) {
|
||||
//this.setIsonline(false);
|
||||
//this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
|
||||
@@ -47,6 +47,7 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
|
||||
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
|
||||
|
||||
int mode = 0;
|
||||
//储料仓运行中
|
||||
int running = 0;
|
||||
//储料仓开关
|
||||
@@ -60,6 +61,7 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
|
||||
//储料仓物物料号
|
||||
int silo_material_no = 0;
|
||||
|
||||
int last_mode = 0;
|
||||
int last_running = 0;
|
||||
int last_is_open = 0;
|
||||
int last_error = 0;
|
||||
@@ -148,11 +150,6 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
|
||||
//this.setIserror(true);
|
||||
message = "信号量同步异常";
|
||||
//未联机
|
||||
// } else if (error != 0) {
|
||||
//this.setIsonline(false);
|
||||
//this.setIserror(true);
|
||||
// message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.util.List;
|
||||
public class ItemProtocol {
|
||||
|
||||
public static String item_heartbeat = "heartbeat";
|
||||
public static String item_mode = "mode"; //工作模式
|
||||
public static String item_running = "running"; //是否运行
|
||||
public static String item_is_open = "is_open"; //储料仓开关
|
||||
public static String item_error = "error"; //报警信号
|
||||
@@ -58,7 +59,9 @@ public class ItemProtocol {
|
||||
public int getItem_silo_material_no() {
|
||||
return this.getOpcIntegerValue(item_silo_material_no);
|
||||
}
|
||||
|
||||
public int getItem_mode() {
|
||||
return this.getOpcIntegerValue(item_mode);
|
||||
}
|
||||
|
||||
Boolean isonline;
|
||||
|
||||
@@ -71,12 +74,12 @@ public class ItemProtocol {
|
||||
return value;
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB1.B0.0"));
|
||||
list.add(new ItemDto(item_running, "储料仓运行中", "DB1.B2.0"));
|
||||
list.add(new ItemDto(item_is_open, "储料仓开关", "DB1.B36.0"));
|
||||
list.add(new ItemDto(item_error, "储料仓故障", "DB1.W38"));
|
||||
|
||||
@@ -375,20 +375,17 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
//this.setIserror(true);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
//this.setIsonline(false);
|
||||
//this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
//有货、联机、满料请求申请AGV搬运任务
|
||||
if (move == 1 && mode == 1 && full_req == 1 && !requireSucess) {
|
||||
apply_task();
|
||||
boolean flag = apply_task();
|
||||
this.noApplyTaskMessage = null;
|
||||
this.message = "申请满料任务成功";
|
||||
if (flag) {
|
||||
this.message = "申请满料任务成功";
|
||||
}
|
||||
} else {
|
||||
if (full_req == 1) {
|
||||
String notApplyTaskMessage = "";
|
||||
@@ -407,9 +404,11 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
|
||||
//无货、联机、空箱请求申请AGV搬运任务
|
||||
if (move == 0 && mode == 1 && empty_req == 1 && !requireSucess) {
|
||||
apply_empty_task();
|
||||
boolean flag = apply_empty_task();
|
||||
this.noApplyTaskMessage = null;
|
||||
this.message = "申请空箱任务成功";
|
||||
if (flag) {
|
||||
this.message = "申请空箱任务成功";
|
||||
}
|
||||
} else {
|
||||
if (empty_req == 1) {
|
||||
String notApplyTaskMessage = "";
|
||||
@@ -564,10 +563,11 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
requireSucess = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -592,10 +592,11 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
requireSucess = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
if (error == 1 || error == 51) {
|
||||
if (error == 1 || error == 51 || error == 0) {
|
||||
feedDeviceStatusFlag = false;
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
@@ -249,16 +249,10 @@ public class HailiangOldSpecialDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
//this.setIserror(true);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
//this.setIsonline(false);
|
||||
// this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
|
||||
}
|
||||
|
||||
last_mode = mode;
|
||||
|
||||
@@ -144,11 +144,6 @@ public class HailiangOldSpecialEmptyStationDeviceDriver extends AbstractOpcDevic
|
||||
// this.setIserror(true);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
// this.setIsonline(false);
|
||||
// this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
@@ -227,7 +222,7 @@ public class HailiangOldSpecialEmptyStationDeviceDriver extends AbstractOpcDevic
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode == 1 ? "联机" : "单机");
|
||||
jo.put("move", move == 1 ? "有货" : "无货");
|
||||
jo.put("move", move == 1 ? "无货" : "有货");
|
||||
jo.put("order", order);
|
||||
jo.put("error", ErrorUtil.getDictDetail("empty_error_type", String.valueOf(this.getError())));
|
||||
jo.put("task", task);
|
||||
|
||||
@@ -165,11 +165,6 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
|
||||
// this.setIserror(true);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
//this.setIsonline(false);
|
||||
//this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
@@ -177,9 +172,11 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
|
||||
|
||||
//满料位满足联机,有货,有工单时向MES申请任务
|
||||
if (mode == 1 && move == 1 && order > 0 && !requireSucess) {
|
||||
apply_task();
|
||||
boolean flag = apply_task();
|
||||
this.noApplyTaskMessage = null;
|
||||
this.message = "申请满料请求任务成功";
|
||||
if (flag) {
|
||||
this.message = "申请满料请求任务成功";
|
||||
}
|
||||
} else {
|
||||
if (move == 1) {
|
||||
String notApplyTaskMessage = "";
|
||||
@@ -286,10 +283,11 @@ public class HailiangOldSpecialFullStationDeviceDriver extends AbstractOpcDevice
|
||||
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
requireSucess = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -130,8 +130,8 @@ public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDevice
|
||||
}
|
||||
|
||||
if (storage_stock_num != last_storage_stock_num) {
|
||||
if (this.itemProtocol.getIsonline()) {
|
||||
MonitoringLargeScreenData.deviceNumData.put(this.getDevice_code(), this.getStorage_stock_num());
|
||||
if (order > 0 && this.itemProtocol.getIsonline() && ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("link_device_code"))) {
|
||||
MonitoringLargeScreenData.deviceNumData.put(this.getDevice().getExtraValue().get("link_device_code").toString(), this.getStorage_stock_num());
|
||||
}
|
||||
if (storage_stock_num == Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num")))) {
|
||||
requireSucess = false;
|
||||
@@ -155,19 +155,16 @@ public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDevice
|
||||
// this.setIserror(true);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
// this.setIsonline(false);
|
||||
//this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
|
||||
if (mode == 1 && !requireSucess && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= this.storage_stock_num) {
|
||||
applyOutCacheLineTask();
|
||||
boolean flag = applyOutCacheLineTask();
|
||||
this.noApplyTaskMessage = null;
|
||||
this.message = "申请缓存线任务成功";
|
||||
if (flag) {
|
||||
this.message = "申请缓存线任务成功";
|
||||
}
|
||||
} else {
|
||||
if (Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= storage_stock_num) {
|
||||
String notApplyTaskMessage = "";
|
||||
@@ -256,10 +253,11 @@ public class HailiangOldSpecialPourStationDeviceDriver extends AbstractOpcDevice
|
||||
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
|
||||
if (httpResponse != null && httpResponse.getStatus() == 200) {
|
||||
requireSucess = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -198,9 +198,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
dto.setError_info(ErrorUtil.getDictDetail("packer_error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
if (error == 1 || error == 51) {
|
||||
feedDeviceStatusFlag = false;
|
||||
}
|
||||
feedDeviceStatusFlag = false;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
}
|
||||
if (order_now != last_order_now) {
|
||||
@@ -306,19 +304,16 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
// this.setIserror(true);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
//this.setIsonline(false);
|
||||
//.setIserror(true);
|
||||
message = "有报警";
|
||||
// //无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
if (mode == 1 && lack_req == 1 && !requireSucess) {
|
||||
apply_task();
|
||||
boolean flag = apply_task();
|
||||
this.noApplyTaskMessage = null;
|
||||
this.message = "申请缺料请求任务成功";
|
||||
if (flag) {
|
||||
this.message = "申请缺料请求任务成功";
|
||||
}
|
||||
} else {
|
||||
if (lack_req == 1) {
|
||||
String notApplyTaskMessage = "";
|
||||
@@ -333,9 +328,11 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
|
||||
if (mode == 1 && req_task_empty == 1 && !requireSucess) {
|
||||
apply_take_empty_task();
|
||||
boolean flag = apply_take_empty_task();
|
||||
this.noApplyTaskMessage = null;
|
||||
this.message = "申请取空框任务成功";
|
||||
if (flag) {
|
||||
this.message = "申请取空框任务成功";
|
||||
}
|
||||
} else {
|
||||
if (req_task_empty == 1) {
|
||||
String notApplyTaskMessage = "";
|
||||
@@ -470,10 +467,11 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
requireSucess = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -497,10 +495,11 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
requireSucess = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
dto.setError_info(ErrorUtil.getDictDetail("error_type", String.valueOf(error)));
|
||||
deviceErrorLogService.create(dto);
|
||||
}
|
||||
if (error == 1 || error == 51) {
|
||||
if (error == 1 || error == 51 || error == 0) {
|
||||
feedDeviceStatusFlag = false;
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
@@ -248,12 +248,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
// this.setIserror(true);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
} /*else if (error != 0) {
|
||||
//this.setIsonline(false);
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} */else {
|
||||
} else {
|
||||
//this.setIsonline(true);
|
||||
// this.setIserror(false);
|
||||
message = "";
|
||||
|
||||
@@ -145,12 +145,7 @@ public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDr
|
||||
//this.setIserror(true);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
}/* else if (error != 0) {
|
||||
//this.setIsonline(false);
|
||||
//this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
}*/ else {
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
@@ -228,7 +223,7 @@ public class HailiangSpecialEmptyStationDeviceDriver extends AbstractOpcDeviceDr
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode == 1 ? "联机" : "单机");
|
||||
jo.put("move", move == 1 ? "有货" : "无货");
|
||||
jo.put("move", move == 1 ? "无货" : "有货");
|
||||
jo.put("order", order);
|
||||
jo.put("error", ErrorUtil.getDictDetail("empty_error_type", String.valueOf(this.getError())));
|
||||
jo.put("task", task);
|
||||
|
||||
@@ -159,20 +159,15 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
}
|
||||
|
||||
if (!this.itemProtocol.getIsonline()) {
|
||||
// this.setIsonline(false);
|
||||
// this.setIserror(true);
|
||||
// this.setIsonline(false);
|
||||
// this.setIserror(true);
|
||||
message = "信号量同步异常";
|
||||
//未联机
|
||||
/* } else if (mode == 0) {
|
||||
// this.setIsonline(false);
|
||||
// this.setIserror(true);
|
||||
} else if (mode == 0) {
|
||||
// this.setIsonline(false);
|
||||
// this.setIserror(true);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
//this.setIsonline(false);
|
||||
//this.setIserror(true);
|
||||
message = "有报警";*/
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
@@ -180,9 +175,11 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
|
||||
//工作模式联机、满料位有货、工单号大于0 就申请agv任务
|
||||
if (mode == 1 && move == 1 && order > 0 && !requireSucess) {
|
||||
apply_task();
|
||||
boolean flag = apply_task();
|
||||
this.noApplyTaskMessage = null;
|
||||
this.message = "申请满料请求任务成功";
|
||||
if (flag) {
|
||||
this.message = "申请满料请求任务成功";
|
||||
}
|
||||
} else {
|
||||
if (move == 1) {
|
||||
String notApplyTaskMessage = "";
|
||||
@@ -232,7 +229,7 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
|
||||
//agv取货完成
|
||||
if (agvphase == 0x05 || agvphase == 0x09) {
|
||||
if (mode == 1 /*&& move == 0 */&& ObjectUtil.isNotEmpty(inst)) {
|
||||
if (mode == 1 /*&& move == 0 */ && ObjectUtil.isNotEmpty(inst)) {
|
||||
this.writing("to_agv_finish", "1");
|
||||
inst.setExecute_status(InstActionEnum.EXECUTE_GET_FINISH.getCode());
|
||||
instructionService.update(inst);
|
||||
@@ -290,10 +287,11 @@ public class HailiangSpecialFullStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
|
||||
if (ObjectUtil.isNotEmpty(httpResponse) && httpResponse.getStatus() == 200) {
|
||||
requireSucess = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -132,8 +132,8 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
|
||||
}
|
||||
if (storage_stock_num != last_storage_stock_num) {
|
||||
if (this.itemProtocol.getIsonline()) {
|
||||
MonitoringLargeScreenData.deviceNumData.put(this.getDevice_code(), this.getStorage_stock_num());
|
||||
if (order > 0 && this.itemProtocol.getIsonline() && ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("link_device_code"))) {
|
||||
MonitoringLargeScreenData.deviceNumData.put(this.getDevice().getExtraValue().get("link_device_code").toString(), this.getStorage_stock_num());
|
||||
}
|
||||
if (storage_stock_num == Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num")))) {
|
||||
requireSucess = false;
|
||||
@@ -156,11 +156,6 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
//this.setIserror(true);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
} else if (error != 0) {
|
||||
//this.setIsonline(false);
|
||||
//this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
@@ -168,9 +163,11 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
|
||||
//倒料位满足联机,剩余数量小于最小数量申请缓存线出库任务
|
||||
if (mode == 1 && !requireSucess && Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= storage_stock_num) {
|
||||
applyOutCacheLineTask();
|
||||
boolean flag = applyOutCacheLineTask();
|
||||
this.noApplyTaskMessage = null;
|
||||
this.message = "申请缓存线任务成功";
|
||||
if (flag) {
|
||||
this.message = "申请缓存线任务成功";
|
||||
}
|
||||
} else {
|
||||
if (Integer.parseInt(String.valueOf(this.getDevice().getExtraValue().get("min_num"))) >= storage_stock_num) {
|
||||
String notApplyTaskMessage = "";
|
||||
@@ -260,10 +257,11 @@ public class HailiangSpecialPourStationDeviceDriver extends AbstractOpcDeviceDri
|
||||
HttpResponse httpResponse = acsToWmsService.applyTaskToWms(reqParam);
|
||||
if (httpResponse != null && httpResponse.getStatus() == 200) {
|
||||
requireSucess = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -320,11 +320,6 @@ public class HailiangStackingStationDriver extends AbstractOpcDeviceDriver imple
|
||||
//this.setIserror(true);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
} else if (lane_error != 0 || line_error != 0) {
|
||||
//this.setIsonline(false);
|
||||
//this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
|
||||
@@ -140,8 +140,8 @@ public class DeviceOpcProtocolRunable implements Runnable {
|
||||
}
|
||||
|
||||
if(ObjectUtil.isEmpty(itemStatus)) {
|
||||
System.out.println( tag + " :itemStatus is null");
|
||||
log.warn(" {} 读取异常 : {} itemStatus is null", tag);
|
||||
//System.out.println( tag + " :itemStatus is null");
|
||||
//log.warn(" {} 读取异常 : {} itemStatus is null", tag);
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ public class DeviceOpcProtocolRunable implements Runnable {
|
||||
Thread.sleep((long) (OpcConfig.synchronized_exception_wait_second * 1000));
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
log.warn("OPC 读取线程读取异常{} :", e);
|
||||
//log.warn("OPC 读取线程读取异常{} :", e);
|
||||
// Thread.currentThread().interrupt();不会真正停止线程
|
||||
}
|
||||
++this.error_num;
|
||||
|
||||
@@ -49,9 +49,9 @@ public class OpcServerServiceImpl implements OpcServerService, ApplicationAutoIn
|
||||
|
||||
try {
|
||||
OpcServerServiceImpl.this.getServer(dto.getOpc_code());
|
||||
OpcServerServiceImpl.log.info("加载opc server {}", dto.getOpc_code());
|
||||
//OpcServerServiceImpl.log.info("加载opc server {}", dto.getOpc_code());
|
||||
} catch (Exception var4) {
|
||||
OpcServerServiceImpl.log.warn("启动无法载入servers", var4);
|
||||
//OpcServerServiceImpl.log.warn("启动无法载入servers", var4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user