更新
This commit is contained in:
@@ -140,7 +140,7 @@ public class ItemProtocol {
|
|||||||
setIsonline(true);
|
setIsonline(true);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0L;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,6 +183,10 @@ public class ItemProtocol {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,5 +118,9 @@ public class ItemProtocol {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,6 +152,10 @@ public class ItemProtocol {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
int task = 0;
|
int task = 0;
|
||||||
int last_task = 0;
|
int last_task = 0;
|
||||||
int agvphase = 0;
|
int agvphase = 0;
|
||||||
|
String task_code = null;
|
||||||
|
|
||||||
int phase = 0;
|
int phase = 0;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
@@ -119,6 +120,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
|
|
||||||
int branchProtocol = 0;
|
int branchProtocol = 0;
|
||||||
String inst_message;
|
String inst_message;
|
||||||
|
String last_inst_message;
|
||||||
|
|
||||||
//当前指令
|
//当前指令
|
||||||
|
|
||||||
@@ -165,6 +167,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
if(move == 0 && last_move == 1 ){
|
if(move == 0 && last_move == 1 ){
|
||||||
last_vehicle_code = vehicle_code;
|
last_vehicle_code = vehicle_code;
|
||||||
|
last_inst_message = inst_message;
|
||||||
}
|
}
|
||||||
if (move == 0 && last_move == 1 && "06".equals(this.device.getRegion())) {
|
if (move == 0 && last_move == 1 && "06".equals(this.device.getRegion())) {
|
||||||
this.requiresShipDeviceUpdate = false;
|
this.requiresShipDeviceUpdate = false;
|
||||||
@@ -192,6 +195,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
if (inst != null) {
|
if (inst != null) {
|
||||||
inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
|
inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
|
||||||
vehicle_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())) {
|
if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
|
||||||
inst.setInstruction_status("1");
|
inst.setInstruction_status("1");
|
||||||
inst.setExecute_device_code(this.device_code);
|
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("carrier_direction", carrier_direction);
|
||||||
jo.put("task", task);
|
jo.put("task", task);
|
||||||
jo.put("last_task", last_task);
|
jo.put("last_task", last_task);
|
||||||
|
jo.put("task_code", task_code);
|
||||||
|
|
||||||
// jo.put("barcode", barcode);
|
// jo.put("barcode", barcode);
|
||||||
// jo.put("last_task", last_task);
|
// jo.put("last_task", last_task);
|
||||||
jo.put("inst_message", this.inst_message);
|
jo.put("inst_message", this.inst_message);
|
||||||
|
jo.put("last_inst_message", this.last_inst_message);
|
||||||
jo.put("isOnline", this.getIsonline());
|
jo.put("isOnline", this.getIsonline());
|
||||||
jo.put("error", this.getError());
|
jo.put("error", this.getError());
|
||||||
jo.put("isError", this.getIserror());
|
jo.put("isError", this.getIserror());
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.acs.device_driver.driver;
|
package org.nl.acs.device_driver.driver;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import org.nl.acs.device_driver.DeviceDriver;
|
import org.nl.acs.device_driver.DeviceDriver;
|
||||||
@@ -62,7 +63,13 @@ public interface OpcDeviceDriver extends DeviceDriver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
default Float getDoubleValue(String protocol) {
|
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) {
|
default int[] getIntegeregerArrayValue(String protocol) {
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public class DeviceOpcProtocolRunable implements Runnable {
|
|||||||
|
|
||||||
label97:
|
label97:
|
||||||
while (true) {
|
while (true) {
|
||||||
System.out.println("label97");
|
// System.out.println("label97");
|
||||||
long begin = System.currentTimeMillis();
|
long begin = System.currentTimeMillis();
|
||||||
Map<Item, ItemState> itemStatus =
|
Map<Item, ItemState> itemStatus =
|
||||||
group.read(true, (Item[]) itemsMap.values().toArray(new Item[0]));
|
group.read(true, (Item[]) itemsMap.values().toArray(new Item[0]));
|
||||||
@@ -139,7 +139,7 @@ public class DeviceOpcProtocolRunable implements Runnable {
|
|||||||
Iterator var18 = items.iterator();
|
Iterator var18 = items.iterator();
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
System.out.println("label98");
|
// System.out.println("label98");
|
||||||
Item item;
|
Item item;
|
||||||
// 当前值
|
// 当前值
|
||||||
Object value;
|
Object value;
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ https://juejin.cn/post/6844903775631572999
|
|||||||
</root>
|
</root>
|
||||||
<!--logmanage -->
|
<!--logmanage -->
|
||||||
<logger name="org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl" level="info" additivity="false">
|
<logger name="org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl" level="info" additivity="false">
|
||||||
|
<appender-ref ref="CONSOLE"/>
|
||||||
<appender-ref ref="lokiAppender" />
|
<appender-ref ref="lokiAppender" />
|
||||||
</logger>
|
</logger>
|
||||||
<logger name="jdbc.resultsettable" level="ERROR" additivity="false">
|
<logger name="jdbc.resultsettable" level="ERROR" additivity="false">
|
||||||
|
|||||||
@@ -375,6 +375,9 @@ export default {
|
|||||||
const obj = { name: '备注信息', value: data[val] }
|
const obj = { name: '备注信息', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
} else if (val === 'inst_message') {
|
} 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] }
|
const obj = { name: '上次指令信息', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
} else if (val === 'barcode') {
|
} else if (val === 'barcode') {
|
||||||
@@ -389,6 +392,9 @@ export default {
|
|||||||
} else if (val === 'instruction_code') {
|
} else if (val === 'instruction_code') {
|
||||||
const obj = { name: '指令号', value: data[val] }
|
const obj = { name: '指令号', value: data[val] }
|
||||||
this.arr.push(obj)
|
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') {
|
} else if (val === 'last_instruction_code') {
|
||||||
const obj = { name: '上次指令号', value: data[val] }
|
const obj = { name: '上次指令号', value: data[val] }
|
||||||
this.arr.push(obj)
|
this.arr.push(obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user