| | |
| | | |
| | | export const ANIMATE_DURING_TIME = 300; |
| | | |
| | | export const MAP_DEFAULT_ROTATION = 180; |
| | | |
| | | export const AGV_ANGLE_OFFSET_VAL = 0; |
| | | |
| | | export const ANIMATE_DURING_TIME = 300; |
| | | |
| | | export const MAP_MODE = Object.freeze({ |
| | | OBSERVER_MODE: "1", |
| | | MOVABLE_MODE: "2", |
| | |
| | | DEVICE_SELECTED_EFFECT_COLOR, |
| | | POINT_ROUTE_DIRECTION, |
| | | ANIMATE_DURING_TIME, |
| | | AGV_ANGLE_OFFSET_VAL, |
| | | } from './constants'; |
| | | import { getRouteList } from './http'; |
| | | import PointRoute from "./PointRoute"; |
| | |
| | | } |
| | | } |
| | | |
| | | const agvRotationOffsetDegrees = 90; |
| | | const agvRotationOffset = rotationParseNum(agvRotationOffsetDegrees); |
| | | const agvRotationOffset = rotationParseNum(AGV_ANGLE_OFFSET_VAL); |
| | | |
| | | const showAgvSprite = (curZone, agvVo, setCurSprite) => { |
| | | const { agvNo, code, direction, battery, jobType, backpack: backpackCount, slots, error } = agvVo; |
| | |
| | | import com.zy.acs.manager.core.service.*; |
| | | import com.zy.acs.manager.core.service.astart.MapDataDispatcher; |
| | | import com.zy.acs.manager.core.utils.RouteGenerator; |
| | | import com.zy.acs.manager.manager.entity.Agv; |
| | | import com.zy.acs.manager.manager.entity.AgvDetail; |
| | | import com.zy.acs.manager.manager.entity.Code; |
| | | import com.zy.acs.manager.manager.entity.FuncSta; |
| | | import com.zy.acs.manager.manager.entity.*; |
| | | import com.zy.acs.manager.manager.enums.FuncStaType; |
| | | import com.zy.acs.manager.manager.enums.StatusType; |
| | | import com.zy.acs.manager.manager.service.*; |
| | |
| | | private RouteGenerator routeGenerator; |
| | | @Autowired |
| | | private FuncStaService funcStaService; |
| | | @Autowired |
| | | private AgvModelService agvModelService; |
| | | |
| | | @RequestMapping(value = "/system/info", method = {RequestMethod.GET, RequestMethod.POST}) |
| | | public R systemInfo() { |
| | |
| | | |
| | | Agv agv = agvList.get(i); |
| | | AgvDetail agvDetail = agvDetailService.selectByAgvId(agv.getId()); |
| | | AgvModel agvModel = agvModelService.getByAgvId(agv.getId()); |
| | | Double workDirection = agvModel.getWorkDirection(); |
| | | |
| | | agvDetail.setPos(1); |
| | | agvDetail.setCode(code.getId()); |
| | | agvDetail.setStatus(AgvStatusType.IDLE.val); |
| | | agvDetail.setAgvAngle(90D); |
| | | agvDetail.setAgvAngle(workDirection); |
| | | agvDetail.setVol(5000); |
| | | |
| | | agvDetailService.updateById(agvDetail); |
| | |
| | | Code nextCode = codeService.getCacheByData(next); |
| | | Double nextDirection = mapService.calculateDirection(lastCode, nextCode, angleOffsetVal); |
| | | |
| | | // 如果去下个节点的方向与当前方向差180度,则不需要旋转,改为反方向行走,nextDirection继续赋值是为了避免 ‘第一个动作一定是 turn’ 的判断 |
| | | // 第一步:如果下一个方向正好是作业方向的相反方向,则重置下一个方向为作业方向,标记reverse |
| | | boolean reverse = false; |
| | | if (nextDirection.equals((workDirection + 180) % 360)) { |
| | | nextDirection = workDirection; |
| | | reverse = true; |
| | | } |
| | | |
| | | // 第二步:判断当前节点是否可以旋转 |
| | | if (!lastCode.getCornerBool()) { |
| | | // 如果是作业方向,但是小车在巷道内方向错误,则停止 |
| | | if (reverse && !lastDirection.equals(nextDirection)) { |
| | | throw new CoolException(agvNo + "号小车方向错误,请推至转弯点手动调整"); |
| | | } |
| | | // 如果不是作业方向,判断是否相反方向,如果反方向则倒退行走 |
| | | if (nextDirection.equals((lastDirection + 180) % 360)) { |
| | | nextDirection = lastDirection; |
| | | reverse = true; |
| | | } |
| | | } else { |
| | | if (!lastDirection.equals(nextDirection)) { |
| | | if (lastDirection.equals((nextDirection + 180) % 360)) { |
| | | if (nextDirection.equals((lastDirection + 180) % 360)) { |
| | | nextDirection = lastDirection; |
| | | reverse = true; |
| | | } else { |
| | | // turn |
| | | actionList.add(new Action( |
| | | null, // 编号 |
| | | null, // 编号s |
| | | task.getBusId(), // 总线 |
| | | task.getId(), // 任务 |
| | | null, // 动作号 |