diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index 37c8920af..70aaa7f98 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -23,7 +23,9 @@ import org.nl.acs.device.service.dto.*; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.DeviceDriverDefination; import org.nl.acs.device_driver.ScannerDeviceDriver; +import org.nl.acs.device_driver.basedriver.indoor_manipulator.IndoorManipulatorDeviceDriver; import org.nl.acs.device_driver.basedriver.oven_manipulator.OvenGantryManipulatorDeviceDriver; +import org.nl.acs.device_driver.basedriver.paper_tube_device2.PaperTubeConveyor2DeviceDriver; import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver; import org.nl.acs.device_driver.basedriver.siemens_conveyor_ckk.SiemensConveyorCkkDeviceDriver; import org.nl.acs.device_driver.basedriver.siemens_conveyor_labeling.SiemensConveyorLabelingDeviceDriver; @@ -759,6 +761,14 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver = (StandardCoveyorControlWithScannerDeviceDriver) device.getDeviceDriver(); standardCoveyorControlWithScannerDeviceDriver.setDeviceStatus(form); + }else if (device.getDeviceDriver() instanceof IndoorManipulatorDeviceDriver){ + IndoorManipulatorDeviceDriver indoorManipulatorDeviceDriver + = (IndoorManipulatorDeviceDriver) device.getDeviceDriver(); + indoorManipulatorDeviceDriver.setDeviceStatus(form); + }else if (device.getDeviceDriver() instanceof PaperTubeConveyor2DeviceDriver){ + PaperTubeConveyor2DeviceDriver paperTubeConveyor2DeviceDriver + = (PaperTubeConveyor2DeviceDriver) device.getDeviceDriver(); + paperTubeConveyor2DeviceDriver.setDeviceStatus(form); } } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java index 5fb630bc8..c0ae8f29f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java @@ -411,7 +411,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i } else if (this.getMode() == 1) { mode = "单机"; } else if (this.getMode() == 2) { - mode = "联机"; + mode = "联机"; } else if (this.getMode() == 3) { mode = "运行中"; } else if (this.getMode() == 4) { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java index 0ac1e0fac..17bf6f452 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java @@ -501,6 +501,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple String to_new_getpoint = device.getExtraValue().get("address").toString(); Map map = new LinkedHashMap<>(); map.put("to_command", 4); + map.put("inflatableShaftVersion", applyManipulatorActionResponse.getVersion()); + map.put("to_new_getpoint", Integer.parseInt(to_new_getpoint)); this.writing(map); feedbackSucess = true; @@ -737,6 +739,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple jo.put("x", x_position); jo.put("y", y_position); jo.put("inflatable_shaft_size", this.inflatable_shaft_size); + jo.put("driver_type", "station"); return jo; } @@ -750,95 +753,6 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } } - public void checkcontrol(Map itemValues) throws JIException, AddFailedException { - Group group = opcServerService.getServer(this.getOpcServer()); - Map write = new HashMap(); - Map readitems = new LinkedHashMap(); - List itemsString = new ArrayList(); - itemsString = new ArrayList<> (itemValues.keySet()); - Iterator is = itemsString.iterator(); - - while (is.hasNext()) { - String string = (String) is.next(); - try { - readitems.put(string, group.addItem(string)); - } catch (Exception e) { - e.printStackTrace(); - } - } - int i = 0; - while(true) { - //下发信号 - try{ - if(i == 0){ - control( itemValues); - } else { - controlByNewConn( itemValues); - } - - } catch (Exception e){ - e.printStackTrace(); - } - Map read = new HashMap(); - Map itemStatus = null; - boolean check = true; - try{ - if(i>0){ - group = opcServerService.getServer(this.getOpcServer()); - itemsString = new ArrayList<> (itemValues.keySet()); - Iterator nis = itemsString.iterator(); - - while (nis.hasNext()) { - String string = (String) nis.next(); - try { - readitems.put(string, group.addItem(string)); - } catch (Exception e) { - e.printStackTrace(); - } - } - itemStatus = group.read(true, (Item[])readitems.values().toArray(new Item[0])); - - } else { - itemStatus = group.read(true, (Item[])readitems.values().toArray(new Item[0])); - } - Set items = itemStatus.keySet(); - Iterator var15 = items.iterator(); - while(var15.hasNext()) { - Item item = (Item)var15.next(); - ItemState itemState = (ItemState)itemStatus.get(item); - Object value = OpcUtl.getValue(item, itemState); - read.put(item.getId(), value); - } - - Iterator var24 = itemsString.iterator(); - - while(var24.hasNext()) { - String itemString = (String)var24.next(); - if (!ObjectUtl.isEquals(itemValues.get(itemString), JsonUtl.parse(read.get(itemString)))) { - check = false; - } - } - } catch (Exception e){ - e.printStackTrace(); - check = false; - } - - if (check) { - return; - } - - if (i > 0) { - ThreadUtl.sleep(300L); - } - - if (i > 3) { - log.info("写入次数超过3次而失败"); - throw new WDKException("写入次数超过3次而失败"); - } - ++i; - } - } - public void writing(String param, String value) { String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() @@ -1020,6 +934,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple map.put("to_onset", Integer.parseInt(start_addr)); map.put("to_task", Integer.parseInt(instdto.getInstruction_code())); map.put("to_target", Integer.parseInt(next_addr)); + if(!StrUtil.isEmpty(task.getVersion())){map.put("inflatableShaftVersion", task.getVersion());} this.writing(map); this.setRequireSucess(true); notCreateInstMessage = ""; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java index 7308c0302..09e314790 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/paper_tube_device2/PaperTubeConveyor2DeviceDriver.java @@ -701,10 +701,8 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl @Override public JSONObject getDeviceStatusName() { - //JSONObject jo = new JSONObject(); String mode = ""; String move = ""; - if (this.getMode() == 0) { mode = "未联机"; } else if (this.getMode() == 1) { @@ -721,40 +719,9 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl }else if(this.getMove() == 1){ move = "有托盘"; } - /*jo.put("device_name", this.getDevice().getDevice_name()); - jo.put("mode", mode); - jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); - jo.put("inventory_qty", item_qty1); - jo.put("move", move); - jo.put("out_finish", out_finish); - jo.put("isOnline", this.getIsonline()); - jo.put("material1", this.getItem_material1()); - jo.put("z_qty1", this.getItem_qty1()); - jo.put("material2", this.getItem_material2()); - jo.put("z_qty2", this.getItem_qty2()); - jo.put("material3", this.getItem_material3()); - jo.put("z_qty3", this.getItem_qty3()); - jo.put("material4", this.getItem_material4()); - jo.put("z_qty4", this.getItem_qty4()); - jo.put("material5", this.getItem_material5()); - jo.put("z_qty5", this.getItem_qty5()); - jo.put("material6", this.getItem_material6()); - jo.put("z_qty6", this.getItem_qty6()); - jo.put("material7", this.getItem_material7()); - jo.put("z_qty7", this.getItem_qty7()); - jo.put("material8", this.getItem_material8()); - jo.put("z_qty8", this.getItem_qty8()); - jo.put("material9", this.getItem_material9()); - jo.put("z_qty9", this.getItem_qty9()); - jo.put("material10", this.getItem_material10()); - jo.put("z_qty10", this.getItem_qty10()); - jo.put("material11", this.getItem_material11()); - jo.put("z_qty11", this.getItem_qty11()); - jo.put("material12", this.getItem_material12()); - jo.put("z_qty12", this.getItem_qty12());*/ - Map map = new LinkedHashMap<>(); map.put("device_name", this.getDevice().getDevice_name()); + map.put("is_click", true); map.put("mode", mode); map.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError()))); map.put("move", move); @@ -785,8 +752,12 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl map.put("z_qty11", this.getItem_qty11()); map.put("material12", this.getItem_material12()); map.put("z_qty12", this.getItem_qty12()); - - + String requireSucess = "0"; + if (this.requireSucess) { + requireSucess = "1"; + } + map.put("requireSucess", requireSucess); + map.put("driver_type", "conveyor"); JSONObject jo = new JSONObject(map); return jo; } @@ -976,7 +947,12 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl @Override public void setDeviceStatus(JSONObject data) { - + String requestSucess = data.getString("requireSucess"); + if (StrUtil.equals(requestSucess, "0")) { + this.requireSucess = false; + } else if (StrUtil.equals(requestSucess, "1")) { + this.requireSucess = true; + } } public static boolean arrayEquals(int[] a, int[] b) { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java index eeabca48c..a1ea21fb0 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java @@ -325,7 +325,7 @@ public class TaskDto implements Serializable { /** * 气胀轴代数 */ - private String version; + private String version = "0"; /** * 是否套管 diff --git a/acs/nladmin-ui/public/config.js b/acs/nladmin-ui/public/config.js index 2defb1d4f..6a4112c8c 100644 --- a/acs/nladmin-ui/public/config.js +++ b/acs/nladmin-ui/public/config.js @@ -1,6 +1,6 @@ window.g = { dev: { - VUE_APP_BASE_API: 'http://127.0.0.1:8012' + VUE_APP_BASE_API: 'http://127.0.0.1:8015' }, prod: { VUE_APP_BASE_API: 'http://127.0.0.1:8012' diff --git a/acs/nladmin-ui/src/views/acs/task/index.vue b/acs/nladmin-ui/src/views/acs/task/index.vue index cec5ae54b..91259cf24 100644 --- a/acs/nladmin-ui/src/views/acs/task/index.vue +++ b/acs/nladmin-ui/src/views/acs/task/index.vue @@ -319,10 +319,10 @@ - + 添加新行 - + 确 定 + + + + + + + + + + + + + + + @@ -231,6 +249,7 @@ export default { dialogFormVisible6: false, dialogFormVisible7: false, dialogFormVisible8: false, + dialogFormVisible10: false, form: { device_code: '', hasGoodStatus: null, @@ -365,6 +384,7 @@ export default { this.dialogFormVisible1 = true } else { console.log(clickObj.data.driver_type) + if (clickObj.data.driver_type === 'standard_ordinary_site') { this.dialogFormVisible3 = true } else if (clickObj.data.driver_type === 'hailiang_packer_station') { @@ -386,6 +406,8 @@ export default { this.dialogFormVisible8 = true } else if (clickObj.data.driver_type === 'standard_conveyor_control_with_scanner') { this.dialogFormVisible6 = true + } else if (clickObj.data.driver_type === 'station' || clickObj.data.driver_type === 'conveyor') { + this.dialogFormVisible10 = true } else { this.dialogFormVisible8 = true } @@ -777,6 +799,8 @@ export default { this.dialogFormVisible6 = false this.dialogFormVisible7 = false this.dialogFormVisible8 = false + this.dialogFormVisible10 = false + this.dialogFormVisible11 = false this.initStageData() }).catch(err => { this.dialogFormVisible = false @@ -785,6 +809,8 @@ export default { this.dialogFormVisible5 = false this.dialogFormVisible7 = false this.dialogFormVisible8 = false + this.dialogFormVisible10 = false + this.dialogFormVisible11 = false console.log(err.response.data.message) }) },