#
Junjie
2025-04-23 0b7a31fdf4990b28ccad5453a9190727ecf02f14
src/main/java/com/zy/core/thread/impl/LfdZyForkLiftSlaveThread.java
@@ -87,7 +87,7 @@
                }
                read();
                Thread.sleep(1000);
                Thread.sleep(300);
                execute();
            } catch (Exception e) {
                e.printStackTrace();
@@ -168,7 +168,7 @@
                OutputQueue.FORKLIFT.offer(MessageFormat.format("【{0}】{1}读取货叉提升机状态信息失败", DateUtils.convert(new Date()), slave.getId()));
            }
            OperateResultExOne<byte[]> result2 = this.masterThread.read(this.slave.getId(), "staStatus");
            OperateResultExOne<byte[]> result2 = this.masterThread.read(this.slave.getId(), "staStatusTray");
            if (result2.IsSuccess) {
                for (int i = 0; i < this.slave.getSta().size(); i++) {
                    ForkLiftSlave.Sta sta = this.slave.getSta().get(i);
@@ -176,10 +176,23 @@
                        continue;
                    }
                    short val = siemensS7Net.getByteTransform().TransInt16(result2.Content, i * 2);
                    ForkLiftStaProtocol forkLiftStaProtocol = forkLiftStaProtocols.get(i);
                    boolean[] status1 = siemensS7Net.getByteTransform().TransBool(result2.Content, i * 2, 2);
                    forkLiftStaProtocol.setHasTray(status1[0]);
                    forkLiftStaProtocol.setHasCar(status1[1]);
                    forkLiftStaProtocol.setHasTray(val == 1);
                }
            }
            OperateResultExOne<byte[]> result3 = this.masterThread.read(this.slave.getId(), "staStatusCar");
            if (result3.IsSuccess) {
                for (int i = 0; i < this.slave.getSta().size(); i++) {
                    ForkLiftSlave.Sta sta = this.slave.getSta().get(i);
                    if (forkLiftStaProtocols.isEmpty()) {
                        continue;
                    }
                    short val = siemensS7Net.getByteTransform().TransInt16(result3.Content, i * 2);
                    ForkLiftStaProtocol forkLiftStaProtocol = forkLiftStaProtocols.get(i);
                    forkLiftStaProtocol.setHasCar(val == 1);
                }
            }