| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.framework.common.SpringUtils; |
| | | import com.zy.asrs.wcs.core.entity.ShuttleStandby; |
| | | import com.zy.asrs.wcs.core.model.MapNode; |
| | | import com.zy.asrs.wcs.core.model.NavigateNode; |
| | | import com.zy.asrs.wcs.core.model.PythonSimilarityResult; |
| | | import com.zy.asrs.wcs.core.model.enums.MapNodeType; |
| | | import com.zy.asrs.wcs.core.model.enums.NavigationMapType; |
| | | import com.zy.asrs.wcs.core.service.ShuttleStandbyService; |
| | | import com.zy.asrs.wcs.rcs.News; |
| | | import com.zy.asrs.wcs.rcs.entity.Device; |
| | | import com.zy.asrs.wcs.rcs.thread.LiftThread; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | |
| | | @Value("${pythonCalcPath}") |
| | | private String pythonCalcPath; |
| | | |
| | | @Value("${pythonCalcSimilarity}") |
| | | private String pythonCalcSimilarity; |
| | | @Autowired |
| | | private LiftDispatcher liftDispatcher; |
| | | @Autowired |
| | | private ShuttleStandbyService shuttleStandbyService; |
| | | |
| | | public List<NavigateNode> calcWhiteList(String startPoint, String endPoint, Integer mapType, List<int[]> shuttlePoints) { |
| | | //通过开始编号和结束编号获取对应的xy轴坐标 |
| | |
| | | return 0D; |
| | | } |
| | | |
| | | //检测库位路径是否可用(用于库位是否可移动检测) |
| | | public boolean checkLocPathIsAvailable(String startLocNo, Long hostId) { |
| | | //获取距离目标位置最近的可换层提升机(可能不空闲) |
| | | LiftThread liftThread = liftDispatcher.searchLift(startLocNo, hostId, true); |
| | | if (liftThread == null) { |
| | | return false; |
| | | } |
| | | Device transferLiftDevice = liftThread.getDevice(); |
| | | |
| | | ShuttleStandby shuttleStandbyTo = shuttleStandbyService.getOne(new LambdaQueryWrapper<ShuttleStandby>() |
| | | .eq(ShuttleStandby::getDeviceId, transferLiftDevice.getId()) |
| | | .eq(ShuttleStandby::getDeviceLev, Utils.getLev(startLocNo)) |
| | | .eq(ShuttleStandby::getStatus, 1)); |
| | | |
| | | //提升机库位号 |
| | | String liftLocNo = shuttleStandbyTo.getDeviceLoc(); |
| | | |
| | | //计算库位到提升机库位,路径是否可用 |
| | | List<NavigateNode> nodeList = this.calc(startLocNo, liftLocNo, NavigationMapType.DFX.id, null); |
| | | if (nodeList == null) { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | // //计算路径 |
| | | // List<NavigateNode> calc = calc("1000901", "1800201", NavigationMapType.NONE.id, null); |