diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/TrackViewVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/TrackViewVO.java index 7fb7efa4c..a7231a2be 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/TrackViewVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/vo/TrackViewVO.java @@ -38,6 +38,12 @@ public class TrackViewVO { public TrackViewVO() {} + public void addSectionOccupied(String sectionCode, Boolean occupied) { + if (sectionOccupiedMap == null) + sectionOccupiedMap = new HashMap<>(); + sectionOccupiedMap.put(sectionCode, occupied); + } + public void addLine(String trackCode, LineVO vo) { if (trackLineMap == null) trackLineMap = new HashMap<>(); @@ -62,7 +68,7 @@ public class TrackViewVO { if (!Objects.equals(sectionOccupiedMap.get(section.getCode()), occupied)) { change = true; sectionOccupiedMap.put(section.getCode(), occupied); - viewVO.getSectionOccupiedMap().put(section.getCode(), occupied); + viewVO.addSectionOccupied(section.getCode(), occupied); } } //分行数据