From 2316deb8d3cd926465fd1692a1e7a9e92daddfba Mon Sep 17 00:00:00 2001 From: joylink_zhangsai Date: Mon, 4 Dec 2023 17:51:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=BB=99=E5=89=8D=E7=AB=AF=E7=9A=84?= =?UTF-8?q?=E5=88=97=E8=BD=A6=E7=8A=B6=E6=80=81=E5=A2=9E=E5=8A=A0=E5=81=9C?= =?UTF-8?q?=E7=AB=99=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/simulation/cbtc/data/status/TrainStatus.java | 8 ++++++++ .../rtss/simulation/cbtc/data/vo/TrainStatusVO.java | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/TrainStatus.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/TrainStatus.java index 29711e6f5..a30452756 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/TrainStatus.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/TrainStatus.java @@ -141,6 +141,8 @@ public class TrainStatus extends DeviceStatus { private int runningTime; + private boolean parking; + private int parkingRemainTime; private String turnBackStrategy; @@ -185,6 +187,7 @@ public class TrainStatus extends DeviceStatus { this.startStation = train.getStartStation(); this.endStation = train.getEndStation(); this.runningTime = train.getRunningTimeInSeconds(); + this.parking = train.isParking(); this.parkingRemainTime = train.getParkingRemainTimeInSeconds(); this.turnBackStrategy = train.getTurnBackStrategy(); this.turnBackStatus = train.getTurnBackStatus(); @@ -330,6 +333,11 @@ public class TrainStatus extends DeviceStatus { status.setRunningTime(this.runningTime); change = true; } + if (!Objects.equals(this.parking, train.isParking())) { + this.parking = train.isParking(); + status.setParking(this.parking); + change = true; + } if (!Objects.equals(this.parkingRemainTime, train.getParkingRemainTimeInSeconds())) { this.parkingRemainTime = train.getParkingRemainTimeInSeconds(); status.setParkingRemainTime(this.parkingRemainTime); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/TrainStatusVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/TrainStatusVO.java index 4840d3721..4c4c55742 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/TrainStatusVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/TrainStatusVO.java @@ -141,6 +141,8 @@ public class TrainStatusVO extends DeviceStatusVO { private Integer runningTime; + private Boolean parking; + private Integer parkingRemainTime; private String turnBackStrategy; @@ -183,6 +185,7 @@ public class TrainStatusVO extends DeviceStatusVO { this.startStation = train.getStartStation(); this.endStation = train.getEndStation(); this.runningTime = train.getRunningTime(); + this.parking = train.isParking(); this.parkingRemainTime = train.getParkingRemainTime(); this.turnBackStrategy = train.getTurnBackStrategy(); this.turnBackStatus = train.getTurnBackStatus();