use of net.parostroj.timetable.model.TrainsCycleItem in project grafikon by jub77.
the class PositionsExtractor method getEndPositions.
/**
* Does not support starting time.
*/
public List<Position> getEndPositions(Collection<TrainsCycle> cycles, Integer startingTime) {
List<Position> result = new LinkedList<>();
for (TrainsCycle cycle : this.sortTrainsCycleList(cycles)) {
if (!cycle.isEmpty()) {
TrainsCycleItem end = cycle.getItems().get(cycle.getItems().size() - 1);
String endName = end.getToInterval().getOwnerAsNode().getName();
String endTrack = end.getToInterval().getTrack().getNumber();
String endTime = diagram.getTimeConverter().convertIntToXml(end.getEndTime());
result.add(new Position(cycle.getName(), cycle.getDisplayDescription(), endName, endTrack, endTime, end.getTrain().getName(), ae.extract(cycle.getAttributes())));
}
}
return result;
}
use of net.parostroj.timetable.model.TrainsCycleItem in project grafikon by jub77.
the class PositionsExtractor method getStartPositions.
public List<Position> getStartPositions(Collection<TrainsCycle> cycles, Integer startingTime) {
List<Position> result = new LinkedList<>();
for (Pair<TrainsCycleItem, TimeInterval> cycleItem : this.getItemStarts(cycles, startingTime)) {
TrainsCycleItem start = cycleItem.first;
TrainsCycle cycle = start.getCycle();
TimeInterval interval = cycleItem.second;
String startName = interval.getOwnerAsNode().getName();
String startTrack = interval.getTrack().getNumber();
String startTime = diagram.getTimeConverter().convertIntToXml(interval.getEnd());
result.add(new Position(cycle.getName(), cycle.getDisplayDescription(), startName, startTrack, startTime, start.getTrain().getName(), ae.extract(cycle.getAttributes())));
}
return result;
}
Aggregations