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