diff --git a/src/main/java/club/joylink/rtss/vo/ws/TrainPosition.java b/src/main/java/club/joylink/rtss/vo/ws/TrainPosition.java new file mode 100644 index 000000000..a9d5e8c5a --- /dev/null +++ b/src/main/java/club/joylink/rtss/vo/ws/TrainPosition.java @@ -0,0 +1,27 @@ +package club.joylink.rtss.vo.ws; + +import club.joylink.rtss.simulation.cbtc.data.map.Section; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +public class TrainPosition { + private String trainTripNum; + /** + * 方向1=上行(向右),0=下行(向左) + */ + private int direction; + private float location; + + public Section.SectionRoadType getRoadType(){ + Section.SectionRoadType type = Section.SectionRoadType.LEFT; + if(this.direction == 1){ + return Section.SectionRoadType.RIGHT; + } + return type; + } + public boolean isRight(){ + return this.direction == 1; + } +}