From 5f529cd1c797a1862c1cc8eeba2a37d59772383b Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Fri, 1 Dec 2023 15:46:28 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E5=A0=86=E5=9E=9B=E6=9C=BA=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/device_driver/DriverTypeEnum.java | 2 +- .../DoubleStationStackerDefination.java | 4 +- .../DoubleStationStackerDeviceDriver.java | 519 ++++++++++-------- .../double_station_stacker/ItemProtocol.java | 74 ++- .../views/acs/device/customPolicy/index.vue | 7 +- 5 files changed, 375 insertions(+), 231 deletions(-) diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java index eb1f189..0b87c2a 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/device_driver/DriverTypeEnum.java @@ -39,7 +39,7 @@ public enum DriverTypeEnum { LED_SCREEN(15, "led_screen", "LED点阵屏", "screen"), - DOUBLE_STATION_STACKER(16, "double_station_stacker", "双工位堆垛机", "double_station_stacker"); + DOUBLE_STATION_STACKER(16, "double_station_stacker", "标准版-双工位堆垛机", "double_station_stacker"); diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/double_station_stacker/DoubleStationStackerDefination.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/double_station_stacker/DoubleStationStackerDefination.java index 008e155..afb2cb1 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/double_station_stacker/DoubleStationStackerDefination.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/double_station_stacker/DoubleStationStackerDefination.java @@ -19,12 +19,12 @@ public class DoubleStationStackerDefination implements OpcDeviceDriverDefination @Override public String getDriverName() { - return "双工位堆垛机"; + return "标准版-双工位堆垛机"; } @Override public String getDriverDescription() { - return "双工位堆垛机"; + return "标准版-双工位堆垛机"; } @Override diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/double_station_stacker/DoubleStationStackerDeviceDriver.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/double_station_stacker/DoubleStationStackerDeviceDriver.java index bb2e851..1a0d0b7 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/double_station_stacker/DoubleStationStackerDeviceDriver.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/double_station_stacker/DoubleStationStackerDeviceDriver.java @@ -20,6 +20,7 @@ import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDevic import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.instruction.domain.Instruction; +import org.nl.acs.instruction.enums.InstructionStatusEnum; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.monitor.DeviceStageMonitor; @@ -65,64 +66,93 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im //工作模式 Integer mode = 0; Integer last_mode = 0; - //作业状态 - Integer command = 0; - Integer last_command = 0; - //任务号 - Integer task = 0; - Integer last_task = 0; - //y轴报警(载货台) - Integer error = 0; - Integer last_error = 0; - //行走排号 - Integer z = 0; - Integer last_z = 0; - //行走列号 - Integer x = null; - Integer last_x = null; - //行走层号 - Integer y = 0; - Integer last_y = 0; + //行走开关信号 Float move = 0F; Float last_move = 0F; - //载货台开关信号 - Float cargoMove = 0F; - Float last_cargoMove = 0F; //行走动作信号 Float action = 0F; Float last_action = 0F; + //前叉作业状态 + Integer front_command = 0; + Integer last_front_command = 0; + //前叉任务号 + Integer front_task = 0; + Integer last_front_task = 0; + //行走激光数值 Integer distancex = 0; Integer last_distancex = 0; - //起升激光数值 - Integer distancey = 0; - Integer last_distancey = 0; - //载货台超限信号 - Float cargoError = 0F; - Float last_cargoError = 0F; - //货叉探货信号 - Float forkCargo = 0F; - Float last_forkCargo = 0F; - //货叉位置信号 - Float forkLocation = 0F; - Float last_forkLocation = 0F; - //货叉动作信号 - Float forkAction = 0F; - Float last_forkAction = 0F; + //特殊开关量1 Float special1 = 0F; Float last_special1 = 0F; //特殊开关量2 Float special2 = 0F; Float last_special2 = 0F; - //托盘条码 - int[] trayCode; - int[] last_trayCode; + //水箱和消防缓存位有无货 Float storage_cache = 0F; Float last_storage_cache = 0F; + + //后叉作业状态 + Integer back_command = 0; + Integer last_back_command = 0; + //后叉任务号 + Integer back_task = 0; + Integer last_back_task = 0; + + //前叉Z轴报警(货叉) + Integer front_ZError = 0; + Integer last_front_ZError = 0; + //后叉Z轴报警(货叉) + Integer back_ZError = 0; + Integer last_back_ZError = 0; + + //前叉行走排号 + Integer front_z = 0; + Integer last_front_z = 0; + //前行走列号 + Integer front_x = 0; + Integer last_front_x = 0; + //前行走层号 + Integer front_y = 0; + Integer last_front_y = 0; + //后叉行走排号 + Integer back_z = 0; + Integer last_back_z = 0; + //后行走列号 + Integer back_x = 0; + Integer last_back_x = 0; + //后行走层号 + Integer back_y = 0; + Integer last_back_y = 0; + + //前货叉探货信号 + Float front_forkCargo = 0F; + Float last_front_forkCargo = 0F; + + //后货叉探货信号 + Float back_forkCargo = 0F; + Float last_back_forkCargo = 0F; + + + //前货叉位置信号 + Float front_forkLocation = 0F; + Float last_front_forkLocation = 0F; + //后货叉位置信号 + Float back_forkLocation = 0F; + Float last_back_forkLocation = 0F; + + //前货叉动作信号 + Float front_forkAction = 0F; + Float last_front_forkAction = 0F; + //后货叉动作信号 + Float back_forkAction = 0F; + Float last_back_forkAction = 0F; + + String message = null; String device_code = null; @@ -139,9 +169,6 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im //请求成功标记 Boolean requireSucess = false; - //当前指令 - Instruction inst = null; - @Override public Device getDevice() { @@ -151,128 +178,14 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im @Override public void execute() throws Exception { try { - device_code = this.getDeviceCode(); - heartbeat = this.itemProtocol.getItem_heartbeat(); - item_deviceCode = this.itemProtocol.getItem_deviceCode(); - mode = this.itemProtocol.getItem_mode(); + //设置参数 + setData(); - move = this.itemProtocol.getItem_move(); - special1 = this.itemProtocol.getItem_special1(); - special2 = this.itemProtocol.getItem_special2(); - storage_cache = this.itemProtocol.getItem_storage_cache(); + //记录日志 + setLog(); - - if (!item_deviceCode.equals(last_item_deviceCode)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(item_deviceCode)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_item_deviceCode + "->" + item_deviceCode); - } - if (!mode.equals(last_mode)) { - requireSucess = false; - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); - } - if (!command.equals(last_command)) { - requireSucess = false; - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(command)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_command + "->" + command); - } - if (!task.equals(last_task)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_task + "->" + task); - } - if (!error.equals(last_error)) { - if (0 != error) { - } - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(error)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_error + "->" + error); - } - if (!z.equals(last_z)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(z)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_z + "->" + z); - } - if (!x.equals(last_x)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(x)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_x + "->" + x); - } - if (!y.equals(last_y)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(y)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_y + "->" + y); - } - if (!move.equals(last_move)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(move)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_move + "->" + move); - } - if (!cargoMove.equals(last_cargoMove)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(cargoMove)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_cargoMove + "->" + cargoMove); - } - if (!action.equals(last_action)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(action)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_action + "->" + action); - } - if (!distancex.equals(last_distancex)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(distancex)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_distancex + "->" + distancex); - } - if (!distancey.equals(last_distancey)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(distancey)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_distancey + "->" + distancey); - } - if (!cargoError.equals(last_cargoError)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(cargoError)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_cargoError + "->" + cargoError); - } - if (!forkCargo.equals(last_forkCargo)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(forkCargo)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_forkCargo + "->" + forkCargo); - } - if (!forkLocation.equals(last_forkLocation)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(forkLocation)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_forkLocation + "->" + forkLocation); - } - if (!forkAction.equals(last_forkAction)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(forkAction)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_forkAction + "->" + forkAction); - } - if (!special1.equals(last_special1)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(special1)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_special1 + "->" + special1); - } - if (!special2.equals(last_special2)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(special2)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_special2 + "->" + special2); - } - if (!Arrays.equals(trayCode, last_trayCode)) { - logServer.deviceItemValue(this.device_code, "mode", Arrays.toString(trayCode)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + Arrays.toString(last_trayCode) + "->" + Arrays.toString(trayCode)); - } - if (!storage_cache.equals(last_storage_cache)) { - logServer.deviceItemValue(this.device_code, "mode", String.valueOf(storage_cache)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_storage_cache + "->" + storage_cache); - } - - - // 更新指令状态 - if (mode == 3 && task > 0) { - Date date = new Date(); - if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { - log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); - - } else { - this.instruction_update_time = date; - //更改指令状态 - if (task > 0) { - Instruction inst = checkInst(); - if (inst != null) { - if (StrUtil.equals(inst.getInstruction_status(), "0")) { - inst.setInstruction_status("1"); - inst.setExecute_device_code(this.device_code); - instructionService.update(inst); - } - } - } - } - } + //更新指令状态 + updateAllstatues(); } catch (Exception var17) { var17.printStackTrace(); @@ -282,30 +195,16 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im if (mode != 3) { message = "未联机"; - - } else if (error != 0) { + } else if (front_ZError != 0 || back_ZError != 0) { message = "有报警"; - //指定库位满入 - if (error == 5) { - - } - //空出 - if (error == 6) { - - } - //浅货位有货 - if (error == 16) { - //放货 - if (cargoMove == 1) { - - } else if (cargoMove == 0) { - //取货 - } - - - } } else { HashMap map = new HashMap(); + if ( front_command == 0 || back_command ==0 ){ + applyTask(); + requireSucess = true; + } + + switch (command) { case 0: applyTask(); @@ -408,39 +307,80 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im last_heartbeat = heartbeat; last_item_deviceCode = item_deviceCode; last_mode = mode; - last_command = command; - last_task = task; - last_error = error; - last_z = z; - last_x = x; - last_y = y; + last_front_command = front_command; + last_back_command = back_command; + last_front_task = front_task; + last_back_task = back_task; last_move = move; - last_cargoMove = cargoMove; + last_front_ZError = front_ZError; + last_back_ZError = back_ZError; + last_front_z = front_z; + last_back_z = back_z; + last_front_x = front_x; + last_back_x = back_x; + last_front_y = front_y; + last_back_y = back_y; last_action = action; last_distancex = distancex; - last_distancey = distancey; - last_cargoError = cargoError; - last_forkCargo = forkCargo; - last_forkLocation = forkLocation; - last_forkAction = forkAction; + last_front_forkCargo = front_forkCargo; + last_back_forkCargo = back_forkCargo; + last_front_forkLocation = front_forkLocation; + last_back_forkLocation = back_forkLocation; + last_front_forkAction = front_forkAction; + last_back_forkAction = back_forkAction; last_special1 = special1; last_special2 = special2; - last_trayCode = trayCode; last_storage_cache = storage_cache; - /*last_stacker_rpm = stacker_rpm; - last_stacker_electricCurrent = stacker_electricCurrent; - last_stacker_runing_time = stacker_runing_time; - last_stacker_workingHours = stacker_workingHours; - last_cargo_rpm = cargo_rpm; - last_cargo_electric_Current = cargo_electric_Current; - last_cargo_workingHour = cargo_workingHour; - last_cargo_runingTimes = cargo_runingTimes; - last_fork_rpm = fork_rpm; - last_fork_electric_Current = fork_electric_Current; - last_fork_workingHours = fork_workingHours; - last_fork_runingTimes = fork_runingTimes;*/ + } + private void updateAllstatues() { + if (mode == 3 && front_task > 0) { + Date date = new Date(); + if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); + + } else { + this.instruction_update_time = date; + updateInstructionStatus(front_task); + } + } + if (mode == 3 && back_task > 0) { + Date date = new Date(); + if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); + + } else { + this.instruction_update_time = date; + //更改指令状态 + updateInstructionStatus(back_task); + } + } + if (mode == 3 && back_task > 0 && front_task > 0) { + Date date = new Date(); + if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); + + } else { + this.instruction_update_time = date; + //更改指令状态 + updateInstructionStatus(front_task); + } + } + } + + private void updateInstructionStatus(Integer task) { + if (task > 0) { + Instruction inst = instructionService.findByCodeFromCache(String.valueOf(task)); + if (inst != null) { + if (StrUtil.equals(inst.getInstruction_status(), InstructionStatusEnum.READY.getIndex())) { + inst.setInstruction_status(InstructionStatusEnum.BUSY.getIndex()); + inst.setExecute_device_code(this.device_code); + instructionService.update(inst); + } + } + } + } /** * 申请任务 @@ -491,6 +431,12 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im return false; } instructionList = this.sortInst(instructionList); + + //筛选符合条件的指令 + for (Instruction instruction : instructionList) { + + } + inst = instructionList.get(0); //指令未执行 if (StrUtil.equals(inst.getInstruction_status(), "0")) { @@ -710,21 +656,148 @@ public class DoubleStationStackerDeviceDriver extends AbstractOpcDeviceDriver im return devicesList; } - public Instruction checkInst() { - if (ObjectUtil.isNotEmpty(this.inst)) { - if (this.task > 0) { - if (this.inst.getInstruction_code().equals(String.valueOf(this.task))) { - return this.inst; - } else { - inst = instructionService.findByCodeFromCache(String.valueOf(task)); - return inst; - } - } - } else { - inst = instructionService.findByCodeFromCache(String.valueOf(task)); - return inst; - } - return null; + private void setData() { + device_code = this.getDeviceCode(); + heartbeat = this.itemProtocol.getItem_heartbeat(); + item_deviceCode = this.itemProtocol.getItem_deviceCode(); + mode = this.itemProtocol.getItem_mode(); + move = this.itemProtocol.getItem_move(); + front_command = this.itemProtocol.getItem_front_command(); + back_command = this.itemProtocol.getItem_back_command(); + front_task = this.itemProtocol.getItem_front_task(); + front_ZError = this.itemProtocol.getItem_front_ZError(); + back_ZError = this.itemProtocol.getItem_back_ZError(); + front_z = this.itemProtocol.getItem_front_z(); + front_x = this.itemProtocol.getItem_front_x(); + front_y = this.itemProtocol.getItem_front_y(); + back_z = this.itemProtocol.getItem_back_z(); + back_x = this.itemProtocol.getItem_back_x(); + back_y = this.itemProtocol.getItem_back_y(); + front_forkCargo = this.itemProtocol.getItem_front_forkCargo(); + back_forkCargo = this.itemProtocol.getItem_back_forkCargo(); + front_forkLocation = this.itemProtocol.getItem_front_forkLocation(); + back_forkLocation = this.itemProtocol.getItem_back_forkLocation(); + back_forkAction = this.itemProtocol.getItem_back_forkAction(); + front_forkAction = this.itemProtocol.getItem_front_forkAction(); + special1 = this.itemProtocol.getItem_special1(); + special2 = this.itemProtocol.getItem_special2(); + storage_cache = this.itemProtocol.getItem_storage_cache(); } + private void setLog() { + if (!item_deviceCode.equals(last_item_deviceCode)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(item_deviceCode)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号item_deviceCode:" + last_item_deviceCode + "->" + item_deviceCode); + } + if (!mode.equals(last_mode)) { + requireSucess = false; + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); + } + if (!front_command.equals(last_front_command)) { + requireSucess = false; + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(front_command)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号front_command:" + last_front_command + "->" + front_command); + } + if (!back_command.equals(last_back_command)) { + requireSucess = false; + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(back_command)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号back_command:" + last_back_command + "->" + back_command); + } + if (!front_task.equals(last_front_task)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(front_task)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号front_task:" + last_front_task + "->" + front_task); + } + if (!back_task.equals(last_back_task)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(back_task)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号back_task:" + last_back_task + "->" + back_task); + } + if (!front_ZError.equals(last_front_ZError)) { + if (0 != front_ZError) { + } + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(front_ZError)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号front_ZError:" + last_front_ZError + "->" + front_ZError); + } + if (!back_ZError.equals(last_back_ZError)) { + if (0 != back_ZError) { + } + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(back_ZError)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号back_ZError:" + last_back_ZError + "->" + back_ZError); + } + if (!back_z.equals(last_back_z)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(back_z)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号back_z:" + last_back_z + "->" + back_z); + } + if (!back_x.equals(last_back_x)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(back_x)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号back_x:" + last_back_x + "->" + back_x); + } + if (!back_y.equals(last_back_y)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(back_y)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号back_y:" + last_back_y + "->" + back_y); + } + if (!front_z.equals(last_front_z)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(front_z)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号front_z:" + last_front_z + "->" + front_z); + } + if (!front_x.equals(last_front_x)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(front_x)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号front_x:" + last_front_x + "->" + front_x); + } + if (!front_y.equals(last_front_y)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(front_y)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号front_y:" + last_front_y + "->" + front_y); + } + if (!move.equals(last_move)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(move)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + "->" + move); + } + if (!action.equals(last_action)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(action)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + "->" + action); + } + if (!distancex.equals(last_distancex)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(distancex)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号distancex:" + last_distancex + "->" + distancex); + } + + if (!front_forkCargo.equals(last_front_forkCargo)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(front_forkCargo)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号front_forkCargo:" + last_front_forkCargo + "->" + front_forkCargo); + } + if (!front_forkLocation.equals(last_front_forkLocation)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(front_forkLocation)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号front_forkLocation:" + last_front_forkLocation + "->" + front_forkLocation); + } + if (!front_forkAction.equals(last_front_forkAction)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(front_forkAction)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号front_forkAction:" + last_front_forkAction + "->" + front_forkAction); + } + if (!back_forkCargo.equals(last_back_forkCargo)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(back_forkCargo)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号back_forkCargo:" + last_back_forkCargo + "->" + back_forkCargo); + } + if (!back_forkLocation.equals(last_back_forkLocation)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(back_forkLocation)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号back_forkLocation:" + last_back_forkLocation + "->" + back_forkLocation); + } + if (!back_forkAction.equals(last_back_forkAction)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(back_forkAction)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号back_forkAction:" + last_back_forkAction + "->" + back_forkAction); + } + if (!special1.equals(last_special1)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(special1)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号special1:" + last_special1 + "->" + special1); + } + if (!special2.equals(last_special2)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(special2)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号special2:" + last_special2 + "->" + special2); + } + if (!storage_cache.equals(last_storage_cache)) { + logServer.deviceItemValue(this.device_code, "mode", String.valueOf(storage_cache)); + logServer.deviceExecuteLog(this.device_code, "", "", "信号storage_cache:" + last_storage_cache + "->" + storage_cache); + } + } + + } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/double_station_stacker/ItemProtocol.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/double_station_stacker/ItemProtocol.java index fb442db..6b1fe15 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/double_station_stacker/ItemProtocol.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/double_station_stacker/ItemProtocol.java @@ -217,12 +217,82 @@ public class ItemProtocol { public float getItem_move(){ return this.getOpcFloatValue(item_move); } - public Integer getItem_distancex(){ - return this.getOpcIntegerValue(item_distancex); + + + public Integer getItem_front_command(){ + return this.getOpcIntegerValue(item_front_command); + } + + public Integer getItem_back_command(){ + return this.getOpcIntegerValue(item_back_command); + } + + public Integer getItem_front_task(){ + return this.getOpcIntegerValue(item_front_task); + } + + public Integer getItem_front_ZError(){ + return this.getOpcIntegerValue(item_front_ZError); + } + + + public Integer getItem_back_ZError(){ + return this.getOpcIntegerValue(item_back_ZError); + } + + + + public Integer getItem_front_z(){ + return this.getOpcIntegerValue(item_front_z); + } + + + public Integer getItem_front_x(){ + return this.getOpcIntegerValue(item_front_x); + } + + public Integer getItem_front_y(){ + return this.getOpcIntegerValue(item_front_y); + } + + public Integer getItem_back_z(){ + return this.getOpcIntegerValue(item_front_z); + } + + + public Integer getItem_back_x(){ + return this.getOpcIntegerValue(item_front_x); + } + + public Integer getItem_back_y(){ + return this.getOpcIntegerValue(item_front_y); } public float getItem_special1(){ return this.getOpcFloatValue(item_special1); } + + public float getItem_front_forkCargo(){ + return this.getOpcFloatValue(item_front_forkCargo); + } + public float getItem_back_forkCargo(){ + return this.getOpcFloatValue(item_back_forkCargo); + } + + public float getItem_front_forkLocation(){ + return this.getOpcFloatValue(item_front_forkLocation); + } + + public float getItem_back_forkLocation(){ + return this.getOpcFloatValue(item_back_forkLocation); + } + public float getItem_front_forkAction(){ + return this.getOpcFloatValue(item_front_forkAction); + } + + public float getItem_back_forkAction(){ + return this.getOpcFloatValue(item_back_forkAction); + } + public float getItem_special2(){ return this.getOpcFloatValue(item_special2); } diff --git a/acs/nladmin-ui/src/views/acs/device/customPolicy/index.vue b/acs/nladmin-ui/src/views/acs/device/customPolicy/index.vue index cade2d3..b084a51 100644 --- a/acs/nladmin-ui/src/views/acs/device/customPolicy/index.vue +++ b/acs/nladmin-ui/src/views/acs/device/customPolicy/index.vue @@ -53,7 +53,7 @@ /> - + @@ -81,6 +81,7 @@ import crudOperation from '@crud/CRUD.operation' import udOperation from '@crud/UD.operation' import pagination from '@crud/Pagination' import deviceCrud from '@/api/acs/device/device' +import i18n from '@/i18n' const defaultForm = { id: null, create_time: null, update_time: null, key_code: null, unit_code: ' deviceCustomerDequeStrategy' } export default { @@ -89,7 +90,7 @@ export default { components: { pagination, crudOperation, rrOperation, udOperation }, mixins: [presenter(), header(), form(defaultForm), crud()], cruds() { - return CRUD({ title: '自定义策略', url: 'api/customPolicy', idField: 'id', sort: 'id,desc', crudMethod: { ...crudCustomPolicy }}) + return CRUD({ title: i18n.t('customPolicy.title'), url: 'api/customPolicy', idField: 'id', sort: 'id,desc', crudMethod: { ...crudCustomPolicy }}) }, data() { return {