This commit is contained in:
2022-11-23 09:02:37 +08:00
parent 7c92bc6658
commit f131aef6c4
5 changed files with 75 additions and 31 deletions

View File

@@ -1123,7 +1123,14 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
"false".equalsIgnoreCase(json.getString("extra_value"))) {
extraObj.put(json.getString("extra_code"), json.getBoolean("extra_value"));
} else {
extraObj.put(json.getString("extra_code"), json.get("extra_value"));
boolean endsWith = json.getString("extra_value").endsWith("]");
boolean startsWith = json.getString("extra_value").startsWith("[");
if (endsWith && startsWith){
JSONArray extraValue = JSONArray.parseArray(json.getString("extra_value"));
extraObj.put(json.getString("extra_code"), extraValue);
} else {
extraObj.put(json.getString("extra_code"), json.get("extra_value"));
}
}
}

View File

@@ -78,8 +78,12 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
public int error1 = 0;
public int material = 0;
public int consumption = 0;
public int voltage = 0;
public int current = 0;
public int voltageA = 0;
public int voltageB = 0;
public int voltageC = 0;
public int currentA = 0;
public int currentB = 0;
public int currentC = 0;
public int last_heartbeat = 0;
public int last_mode = 0;
@@ -94,8 +98,12 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
public int last_error1 = 0;
public int last_material = 0;
public int last_consumption = 0;
public int last_voltage = 0;
public int last_current = 0;
public int last_voltageA = 0;
public int last_voltageB = 0;
public int last_voltageC = 0;
public int last_currentA = 0;
public int last_currentB = 0;
public int last_currentC = 0;
Boolean isonline = true;
@@ -132,8 +140,12 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
error1 = this.itemProtocol.getItem_error1();
material = this.itemProtocol.getItem_material();
consumption = this.itemProtocol.getItem_consumption();
voltage = this.itemProtocol.getItem_voltage();
current = this.itemProtocol.getItem_current();
voltageA = this.itemProtocol.getItem_voltageA();
voltageB = this.itemProtocol.getItem_voltageB();
voltageC = this.itemProtocol.getItem_voltageC();
currentA = this.itemProtocol.getItem_currentA();
currentB = this.itemProtocol.getItem_currentB();
currentC = this.itemProtocol.getItem_currentC();
if (mode != last_mode) {
this.setRequireSucess(false);
@@ -179,8 +191,12 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
last_error1 = error1;
last_material = material;
last_consumption = consumption;
last_voltage = voltage;
last_current = current;
last_voltageA = voltageA;
last_voltageB = voltageB;
last_voltageC = voltageC;
last_currentA = currentA;
last_currentB = currentB;
last_currentC = currentC;
}

View File

@@ -25,12 +25,17 @@ public class ItemProtocol {
public static String item_error1 = "error1";
public static String item_material = "material";
public static String item_consumption = "consumption";
public static String item_voltage = "voltage";
public static String item_current = "current";
public static String item_voltageA = "voltageA";
public static String item_voltageB = "voltageB";
public static String item_voltageC = "voltageC";
public static String item_currentA = "currentA";
public static String item_currentB = "currentB";
public static String item_currentC = "currentC";
public static String item_to_command = "to_command";
public static String item_to_door = "to_door";
public static String item_to_open_door = "to_open_door";
public static String item_to_close_door = "to_close_door";
public static String item_to_temperature = "to_temperature";
public static String item_to_material = "to_material";
public static String item_to_time = "to_time";
@@ -82,11 +87,23 @@ public class ItemProtocol {
public int getItem_consumption(){
return this.getOpcIntegerValue(item_consumption);
} ;
public int getItem_voltage(){
return this.getOpcIntegerValue(item_voltage);
public int getItem_voltageA(){
return this.getOpcIntegerValue(item_voltageA);
} ;
public int getItem_current(){
return this.getOpcIntegerValue(item_current);
public int getItem_voltageB(){
return this.getOpcIntegerValue(item_voltageB);
} ;
public int getItem_voltageC(){
return this.getOpcIntegerValue(item_voltageC);
} ;
public int getItem_currentA(){
return this.getOpcIntegerValue(item_currentA);
} ;
public int getItem_currentB(){
return this.getOpcIntegerValue(item_currentB);
} ;
public int getItem_currentC(){
return this.getOpcIntegerValue(item_currentC);
} ;
Boolean isonline;
@@ -108,27 +125,30 @@ public class ItemProtocol {
list.add(new ItemDto(item_heartbeat, "心跳", "251"));
list.add(new ItemDto(item_mode, "工作模式", "7990"));
list.add(new ItemDto(item_move, "光电信号", "550"));
list.add(new ItemDto(item_action, "取放信号", "450"));
list.add(new ItemDto(item_error, "故障", "8055"));
list.add(new ItemDto(item_error1, "故障1", "216"));
list.add(new ItemDto(item_door, "门状态", "450"));
list.add(new ItemDto(item_temperature, "工位温度", "7991"));
list.add(new ItemDto(item_countdown, "恒温倒计时", "200"));
list.add(new ItemDto(item_finish, "烘干完成", "8025"));
list.add(new ItemDto(item_consumption, "电能耗", "8092"));
list.add(new ItemDto(item_voltage, "电压", "8086"));
list.add(new ItemDto(item_current, "电流", "8080"));
list.add(new ItemDto(item_action, "取放信号", "450"));
list.add(new ItemDto(item_task, "任务号", "220"));
list.add(new ItemDto(item_error, "故障", "8055"));
list.add(new ItemDto(item_error1, "故障1", "216"));
list.add(new ItemDto(item_material, "物料", "223"));
list.add(new ItemDto(item_consumption, "电能耗", "8092"));
list.add(new ItemDto(item_voltageA, "A相电压", "8080"));
list.add(new ItemDto(item_voltageB, "B相电压", "8082"));
list.add(new ItemDto(item_voltageC, "C相电压", "8084"));
list.add(new ItemDto(item_currentA, "A相电流", "8086"));
list.add(new ItemDto(item_currentB, "B相电流", "8088"));
list.add(new ItemDto(item_currentC, "C相电流", "8090"));
return list;
}
public static List<ItemDto> getWriteableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_to_command, "下发命令", "226"));
list.add(new ItemDto(item_to_door, "", "8030"));
list.add(new ItemDto(item_to_open_door, "开门", "8030"));
list.add(new ItemDto(item_to_close_door, "关门", "8031"));
list.add(new ItemDto(item_to_temperature, "生产温度", "8100"));
list.add(new ItemDto(item_to_material, "生产物料", "229"));
list.add(new ItemDto(item_to_time, "生产时间", "210"));

View File

@@ -163,7 +163,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
}
//申请取货 判断取货位是否有货 有货就下发允许取货命令
//申请取货
if (mode == 3 && action == 1 && move == 0 && task > 0) {
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task));
if (ObjectUtil.isNotEmpty(inst2)) {
@@ -172,7 +172,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_door", "1");
hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
if (hongXiangConveyorDeviceDriver.getDoor() == 1 && hongXiangConveyorDeviceDriver.getAction() == 1 && hongXiangConveyorDeviceDriver.getError1() == 0) {
this.writing("to_command", "2");
}
@@ -190,7 +190,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_door", "1");
hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
if (hongXiangConveyorDeviceDriver.getDoor() == 1 && hongXiangConveyorDeviceDriver.getAction() == 1 && hongXiangConveyorDeviceDriver.getError1() == 0) {
this.writing("to_command", "3");
}
@@ -223,11 +223,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
if (startDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startDevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_door", "0");
hongXiangConveyorDeviceDriver.writing("to_close_door", "1");
}
if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_door", "0");
hongXiangConveyorDeviceDriver.writing("to_close_door", "1");
}
this.writing("to_command", "0");
this.writing("to_onset", "0");
@@ -358,7 +358,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
instdto.setStart_point_code(start_point_code);
instdto.setNext_point_code(next_point_code);
instdto.setPriority(priority);
instdto.setInstruction_status("1");
instdto.setInstruction_status("0");
instdto.setExecute_device_code(start_point_code);
try {

View File

@@ -102,6 +102,7 @@
v-model="form.link_device_code"
filterable
multiple
clearable
placeholder="请选择"
>
<el-option