【增加站台定位】

This commit is contained in:
weizhihong 2022-12-07 18:06:53 +08:00
parent 90ad197305
commit 1286130d5a

View File

@ -13,6 +13,7 @@ import club.joylink.rtss.util.JsonUtils;
import club.joylink.rtss.vo.map.MapGraphDataNewVO; import club.joylink.rtss.vo.map.MapGraphDataNewVO;
import club.joylink.rtss.vo.map.graph.MapSignalNewVO; import club.joylink.rtss.vo.map.graph.MapSignalNewVO;
import club.joylink.rtss.vo.map.graph.MapStationNewVO; import club.joylink.rtss.vo.map.graph.MapStationNewVO;
import club.joylink.rtss.vo.map.graph.MapStationStandNewVO;
import club.joylink.rtss.vo.map.graph.Point; import club.joylink.rtss.vo.map.graph.Point;
import lombok.Getter; import lombok.Getter;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -53,6 +54,17 @@ public enum MapLocationRule {
return currentSignal.getPosition(); return currentSignal.getPosition();
}); });
} }
},
STAND_MAP_LOCATION("使用站台定位") {
@Override
public String doHandle(Simulation simulation, MapElement mapElement) {
return calcMapLocation(simulation, () -> {
MapGraphDataNewVO mapGraphDataNewVO = simulation.getBuildParams().getMap().getGraphDataNew();
MapStationStandNewVO stationStandNewVO = mapGraphDataNewVO.getStationStandList().stream()
.filter(s -> s.getCode().equals(mapElement.getCode())).findFirst().get();
return stationStandNewVO.getPosition();
});
}
} }
; ;