| | |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.RgvStatusType; |
| | | import com.zy.asrs.domain.param.EnergyGatheringRingParam; |
| | | import com.zy.asrs.domain.param.RgvOperatorParam; |
| | | import com.zy.asrs.domain.param.RgvWrkMastParam; |
| | | import com.zy.asrs.domain.param.RingThroughParam; |
| | | import com.zy.asrs.domain.param.*; |
| | | import com.zy.asrs.domain.vo.*; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.BasRgvErrMapper; |
| | | import com.zy.asrs.service.BasCircularShuttleService; |
| | | import com.zy.asrs.service.BasDevpPositionService; |
| | | import com.zy.asrs.service.BasRgvService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | private MainServiceImpl mainService; |
| | | @Autowired |
| | | private BasDevpPositionService basDevpPositionService; |
| | | @Autowired |
| | | private BasCircularShuttleService basCircularShuttleService; |
| | | |
| | | @Value("${constant-parameters.perimeter}") |
| | | private Long perimeter; |
| | | |
| | | @PostMapping("/table/rgv/state") |
| | | @ManagerAuth(memo = "RGV信息表") |
| | |
| | | |
| | | ringThroughParam.setIndex(rgv.getId()); |
| | | // ringThroughParam.setIndex(i); |
| | | // double[] doubles = Utils.RingThroughXY2(1737000.0, NumUtils.GetRandomIntInRange(183)); |
| | | double[] doubles = Utils.RingThroughXYRgv(1737000.0, 1737000.0-rgvProtocol.RgvPos.doubleValue()); |
| | | // double[] doubles = Utils.RingThroughXY2(perimeter, NumUtils.GetRandomIntInRange(183)); |
| | | double[] doubles = Utils.RingThroughXYRgv(perimeter, perimeter-rgvProtocol.RgvPos.doubleValue()); |
| | | // double[] doubles = Utils.RingThroughXY2(183.0, 100*i ); |
| | | |
| | | ringThroughParam.setValueX(doubles[0]-2.94); |
| | |
| | | for (BasDevpPosition basDevpPosition : basDevpPositions){ |
| | | RingThroughParam ringThroughParam = new RingThroughParam(); |
| | | ringThroughParam.setIndex(basDevpPosition.getDevNo()); |
| | | double[] doubles = Utils.RingThroughXYSta(1737000.0, 1737000.0-basDevpPosition.getPlcPosition()); |
| | | double[] doubles = Utils.RingThroughXYSta(perimeter, perimeter-basDevpPosition.getPlcPosition()); |
| | | ringThroughParam.setValueX(doubles[0]>50? doubles[0]+6:doubles[0]-1); |
| | | ringThroughParam.setValueY(doubles[1]>50? doubles[1]+6:doubles[1]-1); |
| | | result.add(ringThroughParam); |
| | |
| | | } |
| | | |
| | | @PostMapping("/ring/through/task/wrk/mast/position/data") |
| | | // @ManagerAuth(memo = "站点信息") |
| | | // @ManagerAuth(memo = "作业信息") |
| | | public R ringThroughTaskWrkMast(){ |
| | | List<RgvWrkMastParam> result = new ArrayList<>(); |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<>()); |
| | |
| | | return R.ok().add(result); |
| | | } |
| | | |
| | | @PostMapping("/task/rgv/circular/shuttle/mast/position/data") |
| | | // @ManagerAuth(memo = "作业信息") |
| | | public R rgvCircularShuttle(){ |
| | | List<RgvCircularShuttleParam> result = new ArrayList<>(); |
| | | List<BasCircularShuttle> basCircularShuttleList = basCircularShuttleService.selectList(new EntityWrapper<>()); |
| | | for (BasCircularShuttle basCircularShuttle : basCircularShuttleList){ |
| | | RgvCircularShuttleParam rgvCircularShuttleParam = new RgvCircularShuttleParam(basCircularShuttle); |
| | | if (!Cools.isEmpty(rgvCircularShuttleParam.getRgvNo())){ |
| | | RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgvCircularShuttleParam.getRgvNo()); |
| | | if (rgvThread != null) { |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol != null) { |
| | | rgvCircularShuttleParam.setPosition(rgvProtocol.getRgvPos()); |
| | | if (rgvCircularShuttleParam.getStatus()==0){ |
| | | rgvCircularShuttleParam.setStatus$(rgvProtocol.statusType.desc); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | result.add(rgvCircularShuttleParam); |
| | | } |
| | | return R.ok().add(result); |
| | | } |
| | | |
| | | } |