更新
This commit is contained in:
@@ -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 "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -118,5 +118,9 @@ public class ItemProtocol {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -152,6 +152,10 @@ public class ItemProtocol {
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user