fix 工位模板驱动

This commit is contained in:
张江玮
2023-07-23 11:57:11 +08:00
parent 3032914511
commit 9db429b775
5 changed files with 15 additions and 9 deletions

View File

@@ -237,6 +237,7 @@ public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver i
last_task = task; last_task = task;
last_container_type = container_type; last_container_type = container_type;
last_to_command= to_command; last_to_command= to_command;
last_barcode = barcode;
} }

View File

@@ -265,6 +265,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
if (!requireSucess && this.move != 0) { if (!requireSucess && this.move != 0) {
putStorage("3"); putStorage("3");
} }
break;
case 11: case 11:
//半托缓存强制去包装 //半托缓存强制去包装
if (!requireSucess && this.move != 0) { if (!requireSucess && this.move != 0) {
@@ -516,7 +517,11 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
if (ObjectUtil.isNotEmpty(result)) { if (ObjectUtil.isNotEmpty(result)) {
JSONObject jsonObject = JSONObject.parseObject(result.body()); JSONObject jsonObject = JSONObject.parseObject(result.body());
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) { if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
this.writing(1); if (this.mode == 6) {
this.writing(1);
} else {
this.writing(this.mode);
}
this.setRequireSucess(true); this.setRequireSucess(true);
} }
} }
@@ -559,7 +564,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
if (instruction != null) { if (instruction != null) {
instruction_num = Integer.parseInt(instruction.getInstruction_code()); instruction_num = Integer.parseInt(instruction.getInstruction_code());
} }
Map<String, Object> itemMap = new HashMap<String, Object>(); Map<String, Object> itemMap = new HashMap<String, Object>();
itemMap.put(to_command, 1); itemMap.put(to_command, 1);
itemMap.put(to_task, instruction_num); itemMap.put(to_task, instruction_num);
@@ -578,7 +583,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
+ "." + ItemProtocol.item_to_target; + "." + ItemProtocol.item_to_target;
String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + ItemProtocol.item_to_task; + "." + ItemProtocol.item_to_task;
Map<String, Object> itemMap = new HashMap<String, Object>(); Map<String, Object> itemMap = new HashMap<String, Object>();
if (type == 1) { if (type == 1) {
itemMap.put(to_command, command); itemMap.put(to_command, command);
@@ -597,7 +602,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
public void writing(int command) { public void writing(int command) {
String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + ItemProtocol.item_to_command; + "." + ItemProtocol.item_to_command;
Map<String, Object> itemMap = new HashMap<String, Object>(); Map<String, Object> itemMap = new HashMap<String, Object>();
itemMap.put(to_command, command); itemMap.put(to_command, command);
try{ try{

View File

@@ -194,10 +194,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)){
// accessor_value.setValue(itemId, value);
// }
accessor_value.setValue(itemId, value); accessor_value.setValue(itemId, value);
}
//accessor_value.setValue(itemId, value);
} }
} }

View File

@@ -2,7 +2,7 @@ spring:
freemarker: freemarker:
check-template-location: false check-template-location: false
profiles: profiles:
active: dev active: prod
jackson: jackson:
time-zone: GMT+8 time-zone: GMT+8
data: data:

View File

@@ -2,7 +2,7 @@ ENV = 'production'
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置 # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇Nginx 配置
# 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http # 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http
VUE_APP_BASE_API = 'http://127.0.0.1:8010' VUE_APP_BASE_API = 'http://192.168.1.200:8010'
#VUE_APP_BASE_API = 'http://127.0.0.1:8010' #VUE_APP_BASE_API = 'http://127.0.0.1:8010'
# 如果接口是 http 形式, wss 需要改为 ws # 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'ws://127.0.0.1:8010' VUE_APP_WS_API = 'ws://127.0.0.1:8010'