| | |
| | | crnProtocol.setWalkPos(0); |
| | | crnProtocol.setLoaded(0); |
| | | crnProtocol.setAlarm(0); |
| | | crnProtocol.setXSpeed(0); |
| | | crnProtocol.setYSpeed(0); |
| | | crnProtocol.setZSpeed(0); |
| | | crnProtocol.setXDistance(0); |
| | | crnProtocol.setYDistance(0); |
| | | crnProtocol.setXDuration(0); |
| | | crnProtocol.setYDuration(0); |
| | | crnProtocol.setXSpeed(0D); |
| | | crnProtocol.setYSpeed(0D); |
| | | crnProtocol.setZSpeed(0D); |
| | | crnProtocol.setXDistance(0D); |
| | | crnProtocol.setYDistance(0D); |
| | | crnProtocol.setXDuration(0D); |
| | | crnProtocol.setYDuration(0D); |
| | | |
| | | BasCrnpService basCrnpService = null; |
| | | try { |
| | | basCrnpService = SpringUtils.getBean(BasCrnpService.class); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | if (basCrnpService != null) { |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", deviceConfig.getDeviceNo())); |
| | | if(basCrnp == null) { |
| | | basCrnp = new BasCrnp(); |
| | | basCrnp.setCrnNo(deviceConfig.getDeviceNo()); |
| | | basCrnp.setStatus(1); |
| | | basCrnp.setInEnable("N"); |
| | | basCrnp.setOutEnable("N"); |
| | | basCrnp.setMaxInTask(5); |
| | | basCrnp.setMaxOutTask(5); |
| | | basCrnp.setCreateTime(new Date()); |
| | | basCrnpService.insert(basCrnp); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), deviceConfig.getDeviceNo())); |
| | | |
| | | // // 复位信号 |
| | | // if (!Cools.isEmpty(crnProtocol.getStatusType()) && crnProtocol.getStatusType().equals(CrnStatusType.WAITING)) { |
| | | // if (resetFlag) { |
| | | // if(crnProtocol.getTaskNo()==9999){ |
| | | // backHpFlag = false; |
| | | // } |
| | | // CrnCommand crnCommand = new CrnCommand(); |
| | | // crnCommand.setAckFinish((short)1); |
| | | // if (write(crnCommand)) { |
| | | // resetFlag = false; |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | if (crnProtocol.getAlarm() > 0) { |
| | | crnProtocol.setLastCommandTime(-1L); |
| | | } |
| | |
| | | redisUtil.set(RedisKeyType.DEVICE_LOG_KEY.key + System.currentTimeMillis(), deviceDataLog, 60 * 60 * 24); |
| | | //更新采集时间 |
| | | crnProtocol.setDeviceDataLog(System.currentTimeMillis()); |
| | | } |
| | | |
| | | BasCrnpService basCrnpService = null; |
| | | try { |
| | | basCrnpService = SpringUtils.getBean(BasCrnpService.class); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | if (basCrnpService != null) { |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", deviceConfig.getDeviceNo())); |
| | | if(basCrnp == null) { |
| | | basCrnp = new BasCrnp(); |
| | | basCrnp.setCrnNo(deviceConfig.getDeviceNo()); |
| | | basCrnp.setStatus(1); |
| | | basCrnp.setInEnable("N"); |
| | | basCrnp.setOutEnable("N"); |
| | | basCrnp.setMaxInTask(5); |
| | | basCrnp.setMaxOutTask(5); |
| | | basCrnp.setCreateTime(new Date()); |
| | | basCrnpService.insert(basCrnp); |
| | | } |
| | | } |
| | | } |
| | | |