From 4df36e6ccfa058b14def882c5d0fad9cd8855d1d Mon Sep 17 00:00:00 2001 From: tiger_zhou <123456> Date: Wed, 7 Sep 2022 17:17:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A6=E6=B1=898=E5=8F=B7=E7=BA=BF=E5=88=97?= =?UTF-8?q?=E8=BD=A6=E4=BD=8D=E7=BD=AE=E6=98=BE=E7=A4=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../joylink/rtss/vo/ws/TrainPosition.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/main/java/club/joylink/rtss/vo/ws/TrainPosition.java 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; + } +}