| | |
| | | import com.zy.core.enums.RgvModeType; |
| | | import com.zy.core.enums.RgvTaskModeType; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.core.model.DevpSlave; |
| | | import com.zy.core.model.RgvSlave; |
| | | import com.zy.core.model.Task; |
| | | import com.zy.core.model.command.RgvCommand; |
| | | import com.zy.core.model.protocol.RgvProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.RgvThread; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | // @ManagerAuth(memo = "轨道PLC状态信息") |
| | | public R wnergyGatheringRingParamTrack(){ |
| | | List<EnergyGatheringRingParam> result = new ArrayList<>(); |
| | | EnergyGatheringRingParam energyGatheringRingParam = new EnergyGatheringRingParam(); |
| | | energyGatheringRingParam.setTrackColor("rgba(0, 230, 118, 0.5)"); |
| | | energyGatheringRingParam.setRadiationColor("rgba(0, 230, 118, 0.5)"); |
| | | result.add(energyGatheringRingParam); |
| | | try{ |
| | | for (DevpSlave devp : slaveProperties.getDevp()) { |
| | | SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | if (devpThread.isResult()){ |
| | | if (true){ |
| | | EnergyGatheringRingParam energyGatheringRingParam = new EnergyGatheringRingParam(); |
| | | energyGatheringRingParam.setTrackColor("rgba(0, 230, 118, 0.5)"); |
| | | energyGatheringRingParam.setRadiationColor("rgba(0, 230, 118, 0.5)"); |
| | | result.add(energyGatheringRingParam); |
| | | } else { |
| | | EnergyGatheringRingParam energyGatheringRingParam = new EnergyGatheringRingParam(); |
| | | energyGatheringRingParam.setTrackColor("rgba(0, 230, 118, 0.5)"); |
| | | energyGatheringRingParam.setRadiationColor("rgba(0, 230, 118, 0.5)"); |
| | | result.add(energyGatheringRingParam); |
| | | } |
| | | } |
| | | } |
| | | if (result.isEmpty()){ |
| | | EnergyGatheringRingParam energyGatheringRingParam = new EnergyGatheringRingParam(); |
| | | energyGatheringRingParam.setTrackColor("rgba(0, 0, 0, 81)"); |
| | | energyGatheringRingParam.setRadiationColor("rgba(0, 0, 0, 81)"); |
| | | result.add(energyGatheringRingParam); |
| | | } |
| | | } catch (Exception e){ |
| | | EnergyGatheringRingParam energyGatheringRingParam = new EnergyGatheringRingParam(); |
| | | energyGatheringRingParam.setTrackColor("rgba(0, 0, 0, 81)"); |
| | | energyGatheringRingParam.setRadiationColor("rgba(0, 0, 0, 81)"); |
| | | result.add(energyGatheringRingParam); |
| | | } |
| | | return R.ok().add(result); |
| | | } |
| | | |