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

View File

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

View File

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