fix: 修复烘箱行架不给2的问题

This commit is contained in:
yanps
2024-01-24 13:38:13 +08:00
parent db57ef0d0f
commit f2fb475e2e
5 changed files with 76 additions and 16 deletions

View File

@@ -340,6 +340,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
jo.put("finish", finish);
jo.put("isOnline", this.getIsonline());
jo.put("error", ErrorUtil.getDictDetail("hx_error_type", String.valueOf(this.getError())));
jo.put("error1", ErrorUtil.getDictDetail("hx_error_type", String.valueOf(this.getError1())));
jo.put("isError", this.getIserror());
jo.put("countdown_house", countdown_house);
jo.put("countdown_min", countdown_min);
@@ -348,9 +349,6 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
jo.put("mode", mode);
jo.put("move", move);
jo.put("action", action);
// jo.put("isOnline", this.getIsonline());
// jo.put("error", this.getError());
// jo.put("isError", this.getIserror());
jo.put("task", this.getTask());
return jo;
}
@@ -402,4 +400,29 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
}
}
public void writing(List list) {
Map<String, Object> itemMap = new HashMap<String, Object>();
for (int i = 0; i < list.size(); i++) {
Object ob = list.get(i);
JSONObject json = (JSONObject) JSONObject.toJSON(ob);
if (!StrUtil.isEmpty(json.getString("value"))) {
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + json.getString("code");
itemMap.put(to_param, json.getString("value"));
}
}
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
try {
this.checkcontrol(itemMap);
} catch (Exception e) {
e.printStackTrace();
try {
this.checkcontrol(itemMap);
} catch (Exception e1) {
e1.printStackTrace();
}
}
}
}

View File

@@ -457,11 +457,29 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
this.writing("to_command", "1");
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
List list = new ArrayList();
Map map = new HashMap();
map.put("code", "to_open_door");
map.put("value", "1");
list.add(map);
try {
hongXiangConveyorDeviceDriver.writing(list);
} catch (Exception e) {
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "起点设备:" + start_device_code + "未打开烘箱门,导致now_steps_type不等于: 2 ;now_steps_type:" + now_steps_type);
}
}
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
List list = new ArrayList();
Map map = new HashMap();
map.put("code", "to_open_door");
map.put("value", "1");
list.add(map);
try {
hongXiangConveyorDeviceDriver.writing(list);
} catch (Exception e) {
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "终点设备:" + next_device_code + "未打开烘箱门,导致now_steps_type不等于: 2;now_steps_type:" + now_steps_type);
}
}
this.setNow_steps_type(2);
this.setRequireSucess(true);
@@ -605,13 +623,29 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
//HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
List list = new ArrayList();
Map map = new HashMap();
map.put("code", "to_open_door");
map.put("value", "1");
list.add(map);
try {
hongXiangConveyorDeviceDriver.writing(list);
} catch (Exception e) {
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "终点设备:" + next_device_code + "未打开烘箱门,导致now_steps_type不等于: 2;now_steps_type:" + now_steps_type);
}
}
if (startDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startDevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
List list = new ArrayList();
Map map = new HashMap();
map.put("code", "to_open_door");
map.put("value", "1");
list.add(map);
try {
hongXiangConveyorDeviceDriver.writing(list);
} catch (Exception e) {
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "起点设备:" + start_device_code + "未打开烘箱门,导致now_steps_type不等于: 2;now_steps_type:" + now_steps_type);
}
}
this.setNow_steps_type(2);
this.setRequireSucess(true);
@@ -800,11 +834,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
steps_type = "更新指令状态";
} else if (now_steps_type == 2) {
steps_type = "下发电气信号";
}else if(now_steps_type == 3){
} else if (now_steps_type == 3) {
steps_type = "允许取货";
}else if (now_steps_type ==4 ){
} else if (now_steps_type == 4) {
steps_type += "允许放货";
}else if (now_steps_type == 5){
} else if (now_steps_type == 5) {
steps_type += "放货完成";
}

View File

@@ -476,7 +476,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
break;
} else {
message = "task变化请求LMS失败: " + response.getMessage();
Thread.sleep(5000);
Thread.sleep(15000);
}
}
} catch (Exception e) {

View File

@@ -470,6 +470,9 @@ export default {
} else if (val === 'error') {
const obj = { name: '报警', value: data[val] }
this.arr.push(obj)
} else if (val === 'error1') {
const obj = { name: '报警2', value: data[val] }
this.arr.push(obj)
} else if (val === 'ip') {
const obj = { name: 'IP地址', value: data[val] }
this.arr.push(obj)

View File

@@ -7,9 +7,9 @@
v-model="query.createTime"
type="datetimerange"
:picker-options="pickerOptions"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
:range-separator="$t('monitor.lucence.until')"
:start-placeholder="$t('auto.common.startDate')"
:end-placeholder="$t('auto.common.endDate')"
align="right"
/>
<rrOperation />