| | |
| | | |
| | | import HslCommunication.Core.Types.OperateResult; |
| | | import HslCommunication.Core.Types.OperateResultExOne; |
| | | import HslCommunication.Profinet.Siemens.SiemensPLCS; |
| | | import HslCommunication.Profinet.Siemens.SiemensS7Net; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | |
| | | public boolean connect() { |
| | | boolean result = false; |
| | | LfdZyForkLiftMasterThread masterThread = (LfdZyForkLiftMasterThread) SlaveConnection.get(SlaveType.ForkLiftMaster, masterId); |
| | | if(masterThread != null) { |
| | | if (masterThread != null) { |
| | | result = true; |
| | | this.masterThread = masterThread; |
| | | } |
| | |
| | | InnerForkLiftExtend forkLiftExtend = (InnerForkLiftExtend) forkLiftProtocol.getExtend(); |
| | | forkLiftProtocol.setExtend(forkLiftExtend); |
| | | |
| | | }else { |
| | | } else { |
| | | OutputQueue.FORKLIFT.offer(MessageFormat.format("【{0}】{1}读取货叉提升机状态信息失败", DateUtils.convert(new Date()), slave.getId())); |
| | | } |
| | | |
| | |
| | | //设备状态 |
| | | basLift.setDeviceStatus(JSON.toJSONString(forkLiftProtocol)); |
| | | if (basLiftService.updateById(basLift)) { |
| | | OutputQueue.FORKLIFT.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), forkLiftProtocol.getLiftNo())); |
| | | OutputQueue.FORKLIFT.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功", DateUtils.convert(new Date()), forkLiftProtocol.getLiftNo())); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | |
| | | if (this.forkLiftProtocol.getTaskNo() == null |
| | | || this.forkLiftProtocol.getProtocolStatus() == null |
| | | || this.forkLiftProtocol.getModel() == null |
| | | || this.forkLiftProtocol.getErrorCode() == null |
| | | ) { |
| | | return false; |
| | | } |
| | |
| | | boolean res = this.forkLiftProtocol.getProtocolStatus() == ForkLiftProtocolStatusType.IDLE.id |
| | | && this.forkLiftProtocol.getWrkNo() == 0 |
| | | && this.forkLiftProtocol.getTaskNo() == 0 |
| | | && this.forkLiftProtocol.getModel() == 2; |
| | | && this.forkLiftProtocol.getModel() == 2 |
| | | && this.forkLiftProtocol.getErrorCode() == 0; |
| | | return res; |
| | | } |
| | | |
| | |
| | | if (this.forkLiftProtocol.getTaskNo() == null |
| | | || this.forkLiftProtocol.getProtocolStatus() == null |
| | | || this.forkLiftProtocol.getModel() == null |
| | | || this.forkLiftProtocol.getErrorCode() == null |
| | | ) { |
| | | return false; |
| | | } |
| | | |
| | | boolean res = this.forkLiftProtocol.getProtocolStatus() == ForkLiftProtocolStatusType.IDLE.id |
| | | && this.forkLiftProtocol.getWrkNo() == 0 |
| | | && this.forkLiftProtocol.getModel() == 2; |
| | | && this.forkLiftProtocol.getModel() == 2 |
| | | && this.forkLiftProtocol.getErrorCode() == 0; |
| | | return res; |
| | | } |
| | | |