| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.DeviceConfig; |
| | | import com.zy.asrs.service.BasMapService; |
| | | import com.zy.common.model.NavigateNode; |
| | | import com.zy.common.utils.NavigateUtils; |
| | | import com.zy.core.enums.RgvModeType; |
| | | import com.zy.core.enums.RgvStatusType; |
| | | import com.zy.core.enums.RgvTaskModeType; |
| | | import com.zy.core.model.CommandResponse; |
| | | import com.zy.core.model.command.RgvCommand; |
| | | import com.zy.core.network.api.ZyRgvConnectApi; |
| | | import com.zy.core.network.entity.ZyRgvStatusEntity; |
| | | import com.zy.core.network.entity.ZyStationStatusEntity; |
| | | |
| | | import java.util.List; |
| | | import java.util.concurrent.ExecutorService; |
| | |
| | | |
| | | @Override |
| | | public boolean disconnect() { |
| | | try { executor.shutdownNow(); } catch (Exception ignore) {} |
| | | return true; |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | BasMapService basMapService = SpringUtils.getBean(BasMapService.class); |
| | | if (basMapService == null) { |
| | | return; |
| | | } |
| | | |
| | | List<Integer> levList = basMapService.getLevList(); |
| | | |
| | | List<NavigateNode> navigateNodes = null; |
| | | try { |
| | | navigateNodes = navigateUtils.calcByTrackSiteNo(status.getRgvPos(), sourcePos); |
| | | for (Integer lev : levList) { |
| | | navigateNodes = navigateUtils.calcByTrackSiteNo(lev, status.getRgvPos(), sourcePos); |
| | | if (navigateNodes != null) { |
| | | break; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | |
| | | List<NavigateNode> targetNavigateNodes = null; |
| | | try { |
| | | targetNavigateNodes = navigateUtils.calcByTrackSiteNo(sourcePos, targetPos); |
| | | for (Integer lev : levList) { |
| | | targetNavigateNodes = navigateUtils.calcByTrackSiteNo(lev, sourcePos, targetPos); |
| | | if (targetNavigateNodes != null) { |
| | | break; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | |
| | | status.setRgvPos(currentTrackSiteNo); |
| | | sleep(1000); |
| | | if (Thread.currentThread().isInterrupted()) { |
| | | return; |
| | | } |
| | | } |
| | | |
| | | status.setStatus(RgvStatusType.PUTTING.id); |
| | | status.setLoaded(1); |
| | | sleep(1000); |
| | | if (Thread.currentThread().isInterrupted()) { |
| | | return; |
| | | } |
| | | |
| | | for (int i = 0; i < targetNavigateNodes.size(); i++) { |
| | | NavigateNode navigateNode = targetNavigateNodes.get(i); |
| | |
| | | |
| | | status.setRgvPos(currentTrackSiteNo); |
| | | sleep(1000); |
| | | if (Thread.currentThread().isInterrupted()) { |
| | | return; |
| | | } |
| | | } |
| | | |
| | | sleep(1000); |
| | | if (Thread.currentThread().isInterrupted()) { |
| | | return; |
| | | } |
| | | status.setStatus(RgvStatusType.WAITING.id); |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | BasMapService basMapService = SpringUtils.getBean(BasMapService.class); |
| | | if (basMapService == null) { |
| | | return; |
| | | } |
| | | |
| | | List<Integer> levList = basMapService.getLevList(); |
| | | |
| | | List<NavigateNode> navigateNodes = null; |
| | | try { |
| | | navigateNodes = navigateUtils.calcByTrackSiteNo(status.getRgvPos(), targetPos); |
| | | for (Integer lev : levList) { |
| | | navigateNodes = navigateUtils.calcByTrackSiteNo(lev, status.getRgvPos(), targetPos); |
| | | if (navigateNodes != null) { |
| | | break; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | |
| | | status.setRgvPos(currentTrackSiteNo); |
| | | sleep(1000); |
| | | if (Thread.currentThread().isInterrupted()) { |
| | | return; |
| | | } |
| | | } |
| | | status.setStatus(RgvStatusType.WAITING.id); |
| | | } |
| | |
| | | try { |
| | | Thread.sleep(ms); |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | Thread.currentThread().interrupt(); |
| | | } |
| | | } |
| | | } |
| | | } |