列车图例显示位置调整
This commit is contained in:
parent
af74502f37
commit
5a33c35c15
@ -29,9 +29,7 @@ public class InOutBoundService implements CalculateDiagram{
|
||||
Station nextStation = train.getNextStation();
|
||||
SectionPosition headPos = train.getHeadPosition();
|
||||
SectionPosition tailPos = train.getTailPosition();
|
||||
|
||||
Station startStation = diagramStation.findFirstNotDepotStation(train.isRight());
|
||||
// Station lastStation = diagramStation.findLastNotDepotStation(train.getTerminalStation(),train.isRight());
|
||||
if(Objects.nonNull(headPos.getSection()) && Objects.nonNull(headPos.getSection().getStation()) && headPos.getSection().getStation().isDepot()){
|
||||
StationDiagram sd = new StationDiagram(train);
|
||||
sd.setShowTrainDiagram(false);
|
||||
|
@ -9,6 +9,7 @@ import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
@ -21,7 +22,8 @@ public class PackingService implements CalculateDiagram{
|
||||
@Override
|
||||
public Optional<StationDiagram> calculate(Simulation simulation, TrainInfo trainInfo, VirtualRealityTrain train, SortDiagramStation diagramStation){
|
||||
Section trainSection = train.getHeadPosition().getSection();
|
||||
|
||||
Long mapId = simulation.getBuildParams().getMap().getId();
|
||||
LocalDateTime simulationDateTime = simulation.getCorrectSystemTime();
|
||||
if(train.isParkingAt()){
|
||||
Station startStation = diagramStation.findFirstNotDepotStation(train.isRight());
|
||||
Station lastStation = diagramStation.findLastNotDepotStation(train.isRight());
|
||||
@ -32,7 +34,7 @@ public class PackingService implements CalculateDiagram{
|
||||
Station nextStation = diagramStation.findNext(trainSection.getStation(),train.isRight());
|
||||
sd.setEndStation(nextStation);
|
||||
sd.setShowTrainDiagram(true);
|
||||
log.debug("列车[{}] 方向[{}] 停靠车站[{}] 查找前方车站[{}]",train.getGroupNumber(),train.isRight(),trainSection.getStation().getCode(),nextStation.getCode());
|
||||
log.debug("仿真id[{}] 仿真时间[{}] 列车[{}] 方向[{}] 停靠车站[{}] 查找前方车站[{}]",mapId,simulationDateTime,train.getGroupNumber(),train.isRight(),trainSection.getStation().getCode(),nextStation.getCode());
|
||||
return Optional.of(sd);
|
||||
}else if(trainSection.isStandTrack() || (trainSection.isStandTrack() && Objects.equals(trainSection.getStation().getCode(),lastStation.getCode()))){
|
||||
//列车停靠车站或到终点站
|
||||
@ -41,7 +43,7 @@ public class PackingService implements CalculateDiagram{
|
||||
Station preStation = diagramStation.findPre(trainSection.getStation(),train.isRight());
|
||||
sd.setStartStation(preStation);
|
||||
sd.setEndStation(trainSection.getStation());
|
||||
log.debug("列车[{}] 方向[{}] 停靠车站[{}] 查找前方车站[{}]",train.getGroupNumber(),train.isRight(),trainSection.getStation().getCode(),preStation.getCode());
|
||||
log.debug("仿真id[{}] 仿真时间[{}] 列车[{}] 方向[{}] 停靠车站[{}] 查找前方车站[{}]",mapId,simulationDateTime,train.getGroupNumber(),train.isRight(),trainSection.getStation().getCode(),preStation.getCode());
|
||||
return Optional.of(sd);
|
||||
}
|
||||
//中途停靠站不处理
|
||||
|
Loading…
Reference in New Issue
Block a user