| | |
| | | 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); |
| | |
| | | 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); |
| | | } |
| | | } |
| | | |