| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Arith; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.RgvStatusType; |
| | | import com.zy.asrs.domain.param.RgvOperatorParam; |
| | | import com.zy.asrs.domain.param.RingThroughParam; |
| | | import com.zy.asrs.domain.vo.*; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.BasRgvErrMapper; |
| | | import com.zy.asrs.service.BasRgvService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.service.impl.MainServiceImpl; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.core.Slave; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | |
| | | import com.zy.core.model.protocol.RgvProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.RgvThread; |
| | | import com.zy.core.thread.ScaleThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.rmi.CORBA.Util; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | private BasRgvService basRgvService; |
| | | @Autowired |
| | | private MainServiceImpl mainService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @PostMapping("/table/rgv/state") |
| | | @ManagerAuth(memo = "RGV信息表") |
| | |
| | | } |
| | | return R.ok().add(result); |
| | | } |
| | | @PostMapping("/ring/through/rgv/position/data") |
| | | // @ManagerAuth(memo = "环穿位置信息") |
| | | public R ringThroughRgv(){ |
| | | List<RingThroughParam> result = new ArrayList<>(); |
| | | // for (RgvSlave rgv : slaveProperties.getRgv()) { |
| | | for (int i = 1;i<10;i++) { |
| | | // // 获取RGV信息 |
| | | // RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgv.getId()); |
| | | // if (rgvThread == null) { |
| | | // continue; |
| | | // } |
| | | // RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | // if (rgvProtocol == null) { |
| | | // continue; |
| | | // } |
| | | RingThroughParam ringThroughParam = new RingThroughParam(); |
| | | |
| | | // ringThroughParam.setIndex(rgv.getId()); |
| | | ringThroughParam.setIndex(i); |
| | | double[] doubles = Utils.RingThroughXY2(183.0, 100.0*i); |
| | | ringThroughParam.setValueX(doubles[0]); |
| | | ringThroughParam.setValueY(doubles[1]); |
| | | result.add(ringThroughParam); |
| | | } |
| | | return R.ok().add(result); |
| | | } |
| | | |
| | | @PostMapping("/ring/through/dev/position/data") |
| | | // @ManagerAuth(memo = "环穿位置信息") |
| | | public R ringThroughDev(){ |
| | | List<RingThroughParam> result = new ArrayList<>(); |
| | | // for (RgvSlave rgv : slaveProperties.getRgv()) { |
| | | for (int i = 1;i<10;i++) { |
| | | // // 获取RGV信息 |
| | | // RgvThread rgvThread = (RgvThread) SlaveConnection.get(SlaveType.Rgv, rgv.getId()); |
| | | // if (rgvThread == null) { |
| | | // continue; |
| | | // } |
| | | // RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | // if (rgvProtocol == null) { |
| | | // continue; |
| | | // } |
| | | RingThroughParam ringThroughParam = new RingThroughParam(); |
| | | |
| | | // ringThroughParam.setIndex(rgv.getId()); |
| | | ringThroughParam.setIndex(i); |
| | | double[] doubles = Utils.RingThroughXY2(183.0, 100.0*i); |
| | | ringThroughParam.setValueX(doubles[0]); |
| | | ringThroughParam.setValueY(doubles[1]); |
| | | result.add(ringThroughParam); |
| | | } |
| | | return R.ok().add(result); |
| | | } |
| | | |
| | | } |