opt: 一期设备断连优化
This commit is contained in:
@@ -226,6 +226,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
//纸管库申请任务
|
||||
switch (mode) {
|
||||
case 1:
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.route.service.RouteLineService;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
||||
import org.nl.modules.system.service.ParamService;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
@@ -39,6 +40,7 @@ import org.openscada.opc.lib.da.Server;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/**
|
||||
* 烘箱工位
|
||||
@@ -143,7 +145,6 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
device_code = this.getDeviceCode();
|
||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||
mode = this.itemProtocol.getItem_mode();
|
||||
@@ -198,7 +199,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
}
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
message = "有报警";
|
||||
message = "未联机";
|
||||
//无报警
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
@@ -207,6 +208,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
if (move == 0 && last_move == 1) {
|
||||
//requireSucess = false;
|
||||
}
|
||||
|
||||
@@ -189,7 +189,6 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
|
||||
@@ -158,7 +158,6 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
|
||||
@@ -115,6 +115,7 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
message = "未联机";
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
message = "";
|
||||
}
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
@@ -215,6 +216,9 @@ public class PaperTubeConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
} else if (this.getMode() == 4) {
|
||||
mode = "出库中";
|
||||
}
|
||||
if(this.mode > 0){
|
||||
message = "";
|
||||
}
|
||||
if(error == 0 && iserror){
|
||||
message = "信号连接超时!";
|
||||
}
|
||||
|
||||
@@ -98,7 +98,6 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
|
||||
@@ -357,57 +357,59 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
if(mode > 0) {
|
||||
message = "";
|
||||
switch (mode) {
|
||||
case 1:
|
||||
log.debug("设备运转模式:等待工作");
|
||||
break;
|
||||
case 2:
|
||||
//申请任务
|
||||
if (move > 0 && !requireSucess) {
|
||||
instruction_require();
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
//申请捆扎
|
||||
if (move > 0 && !requireSucess) {
|
||||
applyLaStrangulation(String.valueOf(mode));
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
//申请贴标
|
||||
if (move > 0 && !requireSucess) {
|
||||
//applyLabeling();
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
//空托盘满垛入库申请
|
||||
if (move > 0 && !requireEmptyInSuccess) {
|
||||
emptyIn();
|
||||
}
|
||||
if (move > 0 && !requireSucess) {
|
||||
instruction_require();
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
//空盘出库申请
|
||||
if (move == 0 && !requireSucess) {
|
||||
emptyOut();
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
//申请AGV任务
|
||||
if (move == 1 && !requireSucess) {
|
||||
applyAgvTask();
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
//申请捆扎
|
||||
if (move > 0 && !requireSucess) {
|
||||
applyLaStrangulation(String.valueOf(mode));
|
||||
}
|
||||
break;
|
||||
|
||||
switch (mode) {
|
||||
case 1:
|
||||
log.debug("设备运转模式:等待工作");
|
||||
break;
|
||||
case 2:
|
||||
//申请任务
|
||||
if (move > 0 && !requireSucess) {
|
||||
instruction_require();
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
//申请捆扎
|
||||
if (move > 0 && !requireSucess) {
|
||||
applyLaStrangulation(String.valueOf(mode));
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
//申请贴标
|
||||
if (move > 0 && !requireSucess) {
|
||||
//applyLabeling();
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
//空托盘满垛入库申请
|
||||
if (move > 0 && !requireEmptyInSuccess) {
|
||||
emptyIn();
|
||||
}
|
||||
if (move > 0 && !requireSucess) {
|
||||
instruction_require();
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
//空盘出库申请
|
||||
if (move == 0 && !requireSucess) {
|
||||
emptyOut();
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
//申请AGV任务
|
||||
if (move == 1 && !requireSucess) {
|
||||
applyAgvTask();
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
//申请捆扎
|
||||
if (move > 0 && !requireSucess) {
|
||||
applyLaStrangulation(String.valueOf(mode));
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
last_mode = mode;
|
||||
|
||||
@@ -188,7 +188,6 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
|
||||
@Override
|
||||
public synchronized void execute() {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
@@ -353,6 +352,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
switch (mode) {
|
||||
case 1:
|
||||
log.debug("设备运转模式:等待工作");
|
||||
|
||||
@@ -142,7 +142,6 @@ public class StandardCoveyorControlDeviceDriver extends AbstractOpcDeviceDriver
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
String message = null;
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
|
||||
@@ -198,10 +198,10 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
|
||||
if (true) {
|
||||
this.logItemChanged(itemId, accessor_value, value, itemDto);
|
||||
}
|
||||
if(ObjectUtil.isEmpty(value)){
|
||||
if(ObjectUtil.isEmpty(value) && !"".equals(value)){
|
||||
accessor_value.removeValue(itemId);
|
||||
}
|
||||
if(!ObjectUtil.isEmpty(value)){
|
||||
if(!ObjectUtil.isEmpty(value) || "".equals(value)){
|
||||
accessor_value.setValue(itemId, value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user