添加行车计划新增后生成对应进路序列和股道视图的接口
This commit is contained in:
parent
00976c99d2
commit
69401d16c0
@ -169,6 +169,10 @@ public class RouteSequence {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 进路数据中的行数据
|
||||
* tips:行数据有可能没有进路(没有进路的不会发给前端)
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public static class Line {
|
||||
|
@ -19,6 +19,28 @@ public class CTCService {
|
||||
@Autowired
|
||||
private CiApiService ciApiService;
|
||||
|
||||
/**
|
||||
* 创建了新的运行计划item
|
||||
*/
|
||||
public void runPlanItemCreate(Simulation simulation, Station station, CtcStationRunPlanLog.RunPlanItem item, boolean departure) {
|
||||
CtcRepository ctcRepository = simulation.getCtcRepository();
|
||||
//进路序列
|
||||
RouteSequence routeSequence = ctcRepository.getRouteSequence(station.getCode());
|
||||
AtomicInteger idGenerator = ctcRepository.getRouteSequenceIdGenerator();
|
||||
RouteSequence.Line line = RouteSequence.buildLine(item, departure, idGenerator);
|
||||
routeSequence.addLine(line);
|
||||
//股道视图
|
||||
TrackView trackView = ctcRepository.getTrackView(station.getCode());
|
||||
if (departure) {
|
||||
trackView.addDepartureLine(line);
|
||||
} else {
|
||||
trackView.addReceivingLine(line);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 运行计划item更新了
|
||||
*/
|
||||
public void runPlanItemUpdate(Simulation simulation, Station station, CtcStationRunPlanLog.RunPlanItem item, boolean departure) {
|
||||
CtcRepository ctcRepository = simulation.getCtcRepository();
|
||||
RouteSequence.Line routeSequenceLine = ctcRepository.getRouteSequenceLine(station.getCode(), item.getTripNumber(), departure);
|
||||
|
Loading…
Reference in New Issue
Block a user