diff --git a/acs/hd/nladmin-system/pom.xml b/acs/hd/nladmin-system/pom.xml
index a6dc1ef..c0f1364 100644
--- a/acs/hd/nladmin-system/pom.xml
+++ b/acs/hd/nladmin-system/pom.xml
@@ -63,7 +63,6 @@
2.4
jdk15
-
com.alibaba
@@ -261,6 +260,9 @@
**/*.*
+
+ **/*.java
+
${basedir}/src/main/resources
diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java
index fdb5a23..42111bf 100644
--- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java
+++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java
@@ -75,6 +75,7 @@ public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver i
int barcode = 0;
int last_barcode = 0;
int to_command =0;
+ int last_to_command =0;
Boolean isonline = true;
int hasGoods = 0;
String message = null;
@@ -158,9 +159,13 @@ public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver i
logServer.deviceItemValue(this.device_code,"container_type",String.valueOf(container_type));
logServer.deviceExecuteLog(this.device_code,"","","信号container_type:" + last_container_type + "->" + container_type);
}
+ if (to_command != last_to_command) {
+ logServer.deviceExecuteLog(this.device_code,"","","信号to_command:" + last_to_command + "->" + to_command);
+ }
} catch (Exception var17) {
- return;
+ logServer.deviceExecuteLog(this.device_code,"","","异常:"+var17.getMessage());
+
}
if (mode == 0) {
@@ -168,15 +173,16 @@ public class LnshLaminatingMachineDeviceDriver 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);
- message = "";
+ } else {
+ if(error != 0) {
+ this.setIsonline(false);
+ this.setIserror(true);
+ message = "有报警";
+ } else {
+ this.setIsonline(true);
+ this.setIserror(false);
+ message = "";
+ }
Instruction instruction = null;
List toInstructions;
switch (mode) {
diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java
index e82ec82..e50fe0c 100644
--- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java
+++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java
@@ -129,7 +129,8 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
int last_getX_offset = 0;
int getY_offset = 0;
int last_getY_offset = 0;
-
+ int to_command =0;
+ int last_to_command =0;
//垛型参数
int product_code = 0;
int AlongSide = 0;
@@ -662,9 +663,12 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
logServer.deviceItemValue(this.device_code,"getY_offset" ,String.valueOf(getY_offset));
logServer.deviceExecuteLog(this.device_code,"","","信号getY_offset:" + last_getY_offset + "->" + getY_offset);
}
-
+ if (to_command != last_to_command) {
+ logServer.deviceExecuteLog(this.device_code,"","","信号to_command:" + last_to_command + "->" + to_command);
+ }
} catch (Exception var17) {
- return;
+ logServer.deviceExecuteLog(this.device_code,"","","异常:"+var17.getMessage());
+
}
if (mode == 0) {
@@ -672,15 +676,16 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
this.setIserror(true);
message = "未联机";
//有报警
- } else if (error != 0) {
- this.setIsonline(false);
- this.setIserror(true);
- message = "有报警";
- //无报警
} else {
- this.setIsonline(true);
- this.setIserror(false);
- message = "";
+ if(error != 0) {
+ this.setIsonline(false);
+ this.setIserror(true);
+ message = "有报警";
+ } else {
+ this.setIsonline(true);
+ this.setIserror(false);
+ message = "";
+ }
Instruction instruction = null;
List toInstructions;
switch (mode) {
@@ -764,6 +769,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
}
}
+ last_to_command = to_command;
last_mode = mode;
last_status = status;
last_error = error;
diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_palletizing_manipulator_site/LnshPackagePalletizingManipulatorSiteDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_palletizing_manipulator_site/LnshPackagePalletizingManipulatorSiteDeviceDriver.java
index fae5bbf..709f310 100644
--- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_palletizing_manipulator_site/LnshPackagePalletizingManipulatorSiteDeviceDriver.java
+++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_palletizing_manipulator_site/LnshPackagePalletizingManipulatorSiteDeviceDriver.java
@@ -115,7 +115,7 @@ public class LnshPackagePalletizingManipulatorSiteDeviceDriver extends AbstractO
int getY_offset = 0;
int last_getY_offset = 0;
int to_command =0;
-
+ int last_to_command =0;
//垛型参数
int product_code = 0;
int AlongSide = 0;
@@ -718,36 +718,28 @@ public class LnshPackagePalletizingManipulatorSiteDeviceDriver extends AbstractO
logServer.deviceItemValue(this.device_code,"getY_offset" ,String.valueOf(getY_offset));
logServer.deviceExecuteLog(this.device_code,"","","信号getY_offset:" + last_getY_offset + "->" + getY_offset);
}
-
-
-
+ if (to_command != last_to_command) {
+ logServer.deviceExecuteLog(this.device_code,"","","信号to_command:" + last_to_command + "->" + to_command);
+ }
} catch (Exception var17) {
- return;
+ logServer.deviceExecuteLog(this.device_code,"","","异常:"+var17.getMessage());
}
- //急停
- if (this.isStop()) {
-
- //未在线无心跳
- } else if (!this.itemProtocol.getIsonline()) {
- this.setIsonline(false);
- this.setIserror(true);
- message = "信号量同步异常";
- //未联机
- } else if (mode == 0) {
+ 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);
- message = "";
+ if(error != 0) {
+ this.setIsonline(false);
+ this.setIserror(true);
+ message = "有报警";
+ } else {
+ this.setIsonline(true);
+ this.setIserror(false);
+ message = "";
+ }
Instruction instruction = null;
List toInstructions;
switch (mode) {
@@ -836,7 +828,8 @@ public class LnshPackagePalletizingManipulatorSiteDeviceDriver extends AbstractO
// return;
}
}
-
+ last_product_code = product_code;
+ last_to_command = to_command;
last_mode = mode;
last_error = error;
last_move = move;
diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java
index 031759a..44c9325 100644
--- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java
+++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java
@@ -131,7 +131,8 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
int last_encoder_qty = 0;
int order_qty = 0;
int last_order_qty = 0;
-
+ int command = 0;
+ int last_to_command = 0;
String order_No = "";
String last_order_No = "";
@@ -252,27 +253,26 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
}
} catch (Exception var17) {
- return;
+ logServer.deviceExecuteLog(this.device_code,"","","异常:"+var17.getMessage());
+
}
//急停
- if (this.isStop()) {
-
- //未在线无心跳
- } else if (mode == 0) {
+ 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);
- message = "";
+ if(error != 0) {
+ this.setIsonline(false);
+ this.setIserror(true);
+ message = "有报警";
+ } else {
+ this.setIsonline(true);
+ this.setIserror(false);
+ message = "";
+ }
Instruction instruction = null;
List toInstructions;
switch (mode) {
@@ -351,7 +351,7 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri
// return;
}
}
-
+ last_to_command = to_command;
last_mode = mode;
last_error = error;
last_move = move;
diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java
index 4068638..f3069b5 100644
--- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java
+++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java
@@ -249,32 +249,25 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
}
} catch (Exception var17) {
- return;
+ logServer.deviceExecuteLog(this.device_code,"","","异常:"+var17.getMessage());
+
}
- //急停
- if (this.isStop()) {
-
- //未在线无心跳
- } else if (!this.itemProtocol.getIsonline()) {
- this.setIsonline(false);
- this.setIserror(true);
- message = "信号量同步异常";
- //未联机
- } else if (mode == 0) {
+ 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);
- message = "";
+ if(error != 0) {
+ this.setIsonline(false);
+ this.setIserror(true);
+ message = "有报警";
+ } else {
+ this.setIsonline(true);
+ this.setIserror(false);
+ message = "";
+ }
Instruction instruction = null;
List toInstructions;
switch (mode) {
diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/ItemProtocol.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/ItemProtocol.java
index d08d182..b81b174 100644
--- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/ItemProtocol.java
+++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/ItemProtocol.java
@@ -453,6 +453,10 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_tool_coordinate);
}
+ public int getTo_command() {
+ return this.getOpcIntegerValue(item_to_feedback);
+ }
+
public int getOrder_qty() {
return this.getOpcIntegerValue(item_order_qty);
}
diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java
index a91b6b3..2fe6c57 100644
--- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java
+++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java
@@ -180,7 +180,8 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
int one_qty = 0;
int two_qty = 0;
int tool_coordinate = 0;
-
+ int to_command =0;
+ int last_to_command =0;
int last_product_code = 0;
int last_AlongSide = 0;
int last_BshortSide = 0;
@@ -326,7 +327,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
one_qty = this.itemProtocol.getOne_qty();
two_qty = this.itemProtocol.getTwo_qty();
tool_coordinate = this.itemProtocol.getTool_coordinate();
-
+ to_command = this.itemProtocol.getTo_command();
if (mode != last_mode) {
this.setRequireSucess(false);
logServer.deviceItemValue(this.device_code,"mode" ,String.valueOf(mode));
@@ -624,30 +625,29 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
logServer.deviceItemValue(this.device_code,"tool_coordinate" ,String.valueOf(tool_coordinate));
logServer.deviceExecuteLog(this.device_code,"","","信号tool_coordinate:" + last_tool_coordinate + "->" + tool_coordinate);
}
+ if (to_command != last_to_command) {
+ logServer.deviceExecuteLog(this.device_code,"","","信号to_command:" + last_to_command + "->" + to_command);
+ }
} catch (Exception var17) {
- return;
+ logServer.deviceExecuteLog(this.device_code,"","","异常:"+var17.getMessage());
}
- if (!this.itemProtocol.getIsonline()) {
- this.setIsonline(false);
- this.setIserror(true);
- message = "信号量同步异常";
- //未联机
- } else if (mode == 0) {
+ 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);
- message = "";
+ if(error != 0) {
+ this.setIsonline(false);
+ this.setIserror(true);
+ message = "有报警";
+ } else {
+ this.setIsonline(true);
+ this.setIserror(false);
+ message = "";
+ }
Instruction instruction = null;
List toInstructions;
switch (mode) {
diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java
index 83d7d59..14ce74f 100644
--- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java
+++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java
@@ -114,7 +114,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
int batch = 0;
int last_batch = 0;
int to_command =0;
-
+ int last_to_command =0;
@Override
public Device getDevice() {
return this.device;
@@ -150,6 +150,9 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
logServer.deviceExecuteLog(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
}
if (move != last_move) {
+ if(move ==0){
+ this.writing(0);
+ }
logServer.deviceItemValue(this.device_code,"move" ,String.valueOf(move));
logServer.deviceExecuteLog(this.device_code,"","","信号move:" + last_move + "->" + move);
}
@@ -189,43 +192,30 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
logServer.deviceItemValue(this.device_code,"specifications", specifications);
logServer.deviceExecuteLog(this.device_code,"","","信号specifications:" + last_specifications + "->" + specifications);
}
-
-// if (mode == 2 && move != 0 && task > 0) {
-// //inst_message
-// inst = instructionService.findByCodeFromCache(String.valueOf(task));
-// if (inst != null) {
-// if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
-// finish_instruction();
-// }
-// if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
-// inst.setInstruction_status("1");
-// instructionService.update(inst);
-// }
-// }
-// }
+ if (to_command != last_to_command) {
+ logServer.deviceExecuteLog(this.device_code,"","","信号to_command:" + last_to_command + "->" + to_command);
+ }
} catch (Exception var17) {
- return;
+ logServer.deviceExecuteLog(this.device_code,"","","异常:"+var17.getMessage());
}
- //急停
- if (this.isStop()) {
-
- //未在线无心跳
- } else if (mode == 0) {
+ 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);
- message = "";
+ if(error != 0) {
+ this.setIsonline(false);
+ this.setIserror(true);
+ message = "有报警";
+ } else {
+ this.setIsonline(true);
+ this.setIserror(false);
+ message = "";
+ }
+
Instruction instruction = null;
List toInstructions;
switch (mode) {
@@ -297,6 +287,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
last_barcode = barcode;
last_specifications = specifications;
last_batch = batch;
+ last_to_command = to_command;
}
diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/rljn_package_palletSplit_manipulator/RljnPackagePalletSplitManipulatorDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/rljn_package_palletSplit_manipulator/RljnPackagePalletSplitManipulatorDeviceDriver.java
index c356804..ab7d533 100644
--- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/rljn_package_palletSplit_manipulator/RljnPackagePalletSplitManipulatorDeviceDriver.java
+++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/rljn_package_palletSplit_manipulator/RljnPackagePalletSplitManipulatorDeviceDriver.java
@@ -681,28 +681,25 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
}
} catch (Exception var17) {
- return;
+ logServer.deviceExecuteLog(this.device_code,"","","异常:"+var17.getMessage());
}
- if (!this.itemProtocol.getIsonline()) {
- this.setIsonline(false);
- this.setIserror(true);
- message = "信号量同步异常";
- //未联机
- } else if (mode == 0) {
+ 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);
- message = "";
+
+ if(error != 0) {
+ this.setIsonline(false);
+ this.setIserror(true);
+ message = "有报警";
+ } else {
+ this.setIsonline(true);
+ this.setIserror(false);
+ message = "";
+ }
Instruction instruction = null;
List toInstructions;
switch (mode) {
diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java b/acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java
index 7a0b6df..6269334 100644
--- a/acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java
+++ b/acs/hd/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java
@@ -2,10 +2,6 @@ package org.nl.start.auto.run;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
-import cn.hutool.http.HttpResponse;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.agv.server.NDCAgvService;
import org.nl.acs.agv.server.dto.AgvDto;
@@ -18,11 +14,8 @@ import org.nl.acs.device_driver.lnsh.lnsh_palletizing_manipulator.LnshPalletizin
import org.nl.acs.device_driver.lnsh.lnsh_palletizing_manipulator_site.LnshPalletizingManipulatorSiteDeviceDriver;
import org.nl.acs.device_driver.lnsh.lnsh_station.LnshStationDeviceDriver;
import org.nl.acs.device_driver.standard_autodoor.StandardAutodoorDeviceDriver;
-import org.nl.acs.device_driver.standard_conveyor_control.StandardCoveyorControlDeviceDriver;
-import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver;
import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
-import org.nl.acs.device_driver.standard_storage.StandardStorageDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.instruction.service.InstructionService;
@@ -32,10 +25,6 @@ import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
-import org.nl.acs.opc.DeviceAppServiceImpl;
-import org.nl.acs.task.service.TaskService;
-import org.nl.acs.task.service.dto.TaskDto;
-import org.nl.acs.task.service.impl.TaskServiceImpl;
import org.nl.utils.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -51,7 +40,7 @@ import java.util.Map;
@Component
public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
- Socket s;
+ Socket socket;
String ip = "127.0.0.1";
int port = 1234;
static DataOutputStream dos;
@@ -97,9 +86,9 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
ip = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL);
port = Integer.parseInt(acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT));
byte[] b = new byte[1028];
- s = new Socket(ip, port);
- dos = new DataOutputStream(s.getOutputStream());
- dis = new DataInputStream(s.getInputStream());
+ socket = new Socket(ip, port);
+ dos = new DataOutputStream(socket.getOutputStream());
+ dis = new DataInputStream(socket.getInputStream());
while (bConnected) {
int count = dis.read(b);
@@ -860,15 +849,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
write(data);
}
} catch (Exception e) {
-
- System.out.println("Agv链接异常");
- log.info("Agv链接异常");
- log.error("agv连接出现异常:{}", e);
- if(ObjectUtil.isNotEmpty(s)){
- s.close();
- }
- System.out.println(e.getMessage());
- e.printStackTrace();
+ log.error("AGV交互出错", e);
}
} else {
System.out.println("agv上报不是0073类型动作,不处理");
@@ -876,10 +857,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
}
} catch (Exception e) {
-
-
- } finally {
-
+ log.error("[NDC在线连接] 执行错误,请重新启动线程!", e);
}
@@ -890,7 +868,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
public void stop() {
super.after();
try {
- s.close();
+ socket.close();
} catch (Exception e) {
e.printStackTrace();
}