| | |
| | | */ |
| | | public synchronized void initRealtimeBasMap() { |
| | | try { |
| | | for (int i = 1; i <= 10; i++) {//总共四层楼 |
| | | for (int i = 1; i <= 4; i++) {//总共四层楼 |
| | | Object data = redisUtil.get(RedisKeyType.MAP.key + i); |
| | | if (data == null) {//redis地图数据为空,从数据库中获取 |
| | | BasMap basMap = basMapService.selectLatestMap(i); |
| | |
| | | // } |
| | | } |
| | | |
| | | // /** |
| | | // * 四向穿梭车电量检测 ===>> 发起充电 |
| | | // */ |
| | | // public synchronized void loopShuttleCharge() { |
| | | // try { |
| | | // for (ShuttleSlave shuttle : slaveProperties.getShuttle()) { |
| | | // //获取四向穿梭车线程 |
| | | // NyShuttleThread shuttleThread = (NyShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId()); |
| | | // NyShuttleProtocol shuttleProtocol = shuttleThread.getShuttleProtocol(); |
| | | // if (shuttleProtocol == null) { |
| | | // continue; |
| | | // } |
| | | // |
| | | // //判断当前小车是否满足需要充电要求 |
| | | // if (!shuttleProtocol.isRequireCharge()) { |
| | | // continue; |
| | | // } |
| | | // |
| | | // WrkCharge wrkCharge = wrkChargeService.selectWorking(shuttleProtocol.getShuttleNo().intValue()); |
| | | // if (wrkCharge != null) {//已有充电任务 |
| | | // continue; |
| | | // } |
| | | // |
| | | // //小车所在楼层 |
| | | // int lev = Utils.getLev(shuttleProtocol.getCurrentLocNo()); |
| | | /** |
| | | * 四向穿梭车电量检测 ===>> 发起充电 |
| | | */ |
| | | public synchronized void loopShuttleCharge() { |
| | | try { |
| | | for (ShuttleSlave shuttle : slaveProperties.getShuttle()) { |
| | | //获取四向穿梭车线程 |
| | | ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, shuttle.getId()); |
| | | ShuttleProtocol shuttleProtocol = shuttleThread.getStatus(); |
| | | if (shuttleProtocol == null) { |
| | | continue; |
| | | } |
| | | |
| | | //判断当前小车是否满足需要充电要求 |
| | | if (!shuttleThread.isRequireCharge()) { |
| | | continue; |
| | | } |
| | | |
| | | WrkMast wrkMast = wrkMastService.selectChargeWorking(shuttleProtocol.getShuttleNo()); |
| | | if (wrkMast != null) {//已有充电任务 |
| | | continue; |
| | | } |
| | | |
| | | //小车所在楼层 |
| | | int lev = Utils.getLev(shuttleProtocol.getCurrentLocNo()); |
| | | // ShuttleChargeType shuttleCharge = null; |
| | | // |
| | | // //搜索小车所在楼层有没有充电桩 |
| | |
| | | // News.error("保存{}号四向穿梭车充电任务失败!!!", shuttle.getId()); |
| | | // continue; |
| | | // } |
| | | // |
| | | // News.info("保存{}号四向穿梭车充电任务成功!!!", shuttle.getId()); |
| | | // } |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // |
| | | |
| | | News.info("保存{}号四向穿梭车充电任务成功!!!", shuttle.getId()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | // /** |
| | | // * 执行四向穿梭车充电任务 |
| | | // */ |