This commit is contained in:
USER-20220102CG\noblelift
2023-02-03 13:50:56 +08:00
parent 9f5def7738
commit 657e8e4958
8 changed files with 37 additions and 4 deletions

View File

@@ -140,7 +140,7 @@ public class ItemProtocol {
setIsonline(true);
return value;
}
return 0;
return 0L;
}
@@ -183,6 +183,10 @@ public class ItemProtocol {
return list;
}
@Override
public String toString() {
return "";
}
}

View File

@@ -118,5 +118,9 @@ public class ItemProtocol {
return list;
}
@Override
public String toString() {
return "";
}
}

View File

@@ -152,6 +152,10 @@ public class ItemProtocol {
return list;
}
@Override
public String toString() {
return "";
}
}

View File

@@ -92,6 +92,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
int task = 0;
int last_task = 0;
int agvphase = 0;
String task_code = null;
int phase = 0;
int index = 0;
@@ -119,6 +120,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
int branchProtocol = 0;
String inst_message;
String last_inst_message;
//当前指令
@@ -165,6 +167,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
}
if(move == 0 && last_move == 1 ){
last_vehicle_code = vehicle_code;
last_inst_message = inst_message;
}
if (move == 0 && last_move == 1 && "06".equals(this.device.getRegion())) {
this.requiresShipDeviceUpdate = false;
@@ -192,6 +195,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
if (inst != null) {
inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
vehicle_code = inst.getVehicle_code();
task_code = inst.getTask_code();
if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
inst.setInstruction_status("1");
inst.setExecute_device_code(this.device_code);
@@ -474,9 +478,12 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
jo.put("carrier_direction", carrier_direction);
jo.put("task", task);
jo.put("last_task", last_task);
jo.put("task_code", task_code);
// jo.put("barcode", barcode);
// jo.put("last_task", last_task);
jo.put("inst_message", this.inst_message);
jo.put("last_inst_message", this.last_inst_message);
jo.put("isOnline", this.getIsonline());
jo.put("error", this.getError());
jo.put("isError", this.getIserror());

View File

@@ -1,6 +1,7 @@
package org.nl.acs.device_driver.driver;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.nl.acs.device_driver.DeviceDriver;
@@ -62,7 +63,13 @@ public interface OpcDeviceDriver extends DeviceDriver {
}
default Float getDoubleValue(String protocol) {
return (Float) this.getValue(protocol);
if(ObjectUtil.isEmpty(this.getValue(protocol))){
return null;
} else {
return Float.valueOf(this.getValue(protocol).toString());
}
// return Float.valueOf(this.getValue(protocol).toString());
// return (Float) this.getValue(protocol);
}
default int[] getIntegeregerArrayValue(String protocol) {

View File

@@ -117,7 +117,7 @@ public class DeviceOpcProtocolRunable implements Runnable {
label97:
while (true) {
System.out.println("label97");
// System.out.println("label97");
long begin = System.currentTimeMillis();
Map<Item, ItemState> itemStatus =
group.read(true, (Item[]) itemsMap.values().toArray(new Item[0]));
@@ -139,7 +139,7 @@ public class DeviceOpcProtocolRunable implements Runnable {
Iterator var18 = items.iterator();
while (true) {
System.out.println("label98");
// System.out.println("label98");
Item item;
// 当前值
Object value;

View File

@@ -102,6 +102,7 @@ https://juejin.cn/post/6844903775631572999
</root>
<!--logmanage -->
<logger name="org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl" level="info" additivity="false">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="lokiAppender" />
</logger>
<logger name="jdbc.resultsettable" level="ERROR" additivity="false">

View File

@@ -375,6 +375,9 @@ export default {
const obj = { name: '备注信息', value: data[val] }
this.arr.push(obj)
} else if (val === 'inst_message') {
const obj = { name: '当前指令信息', value: data[val] }
this.arr.push(obj)
} else if (val === 'last_inst_message') {
const obj = { name: '上次指令信息', value: data[val] }
this.arr.push(obj)
} else if (val === 'barcode') {
@@ -389,6 +392,9 @@ export default {
} else if (val === 'instruction_code') {
const obj = { name: '指令号', value: data[val] }
this.arr.push(obj)
} else if (val === 'task_code') {
const obj = { name: '任务号', value: data[val] }
this.arr.push(obj)
} else if (val === 'last_instruction_code') {
const obj = { name: '上次指令号', value: data[val] }
this.arr.push(obj)