Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,36 +70,31 @@ public void setFopService(final FopService fopService) {
@Override
public List<String> getPageBreakRowsIndex(final Table table) {
final List<String> result = new ArrayList<>();
List.of(SsksColumns.Fiktives_Signal, SsksColumns.Reales_Signal)
.forEach(columnPosition -> {
final ColumnDescriptor col = TableExtensions
.getColumns(table)
.stream()
.filter(column -> column.getColumnPosition()
.equals(columnPosition))
.findFirst()
.orElse(null);
final Optional<Integer> lastRowIndex = getLastRowIndex(
table, col);
if (lastRowIndex.isPresent()) {
result.add(lastRowIndex.get().toString());
}
});
List.of(SsksColumns.Fiktives_Signal).forEach(columnPosition -> {
final ColumnDescriptor col = TableExtensions.getColumns(table)
.stream()
.filter(column -> column.getColumnPosition()
.equals(columnPosition))
.findFirst()
.orElse(null);
final Optional<Integer> firstRowIndex = getFirstRowIndex(table,
col);
if (firstRowIndex.isPresent()) {
result.add(firstRowIndex.get().toString());
}
});
return result;
}

private static Optional<Integer> getLastRowIndex(final Table table,
private static Optional<Integer> getFirstRowIndex(final Table table,
final ColumnDescriptor column) {
final List<Entry<Integer, TableRow>> signalEntries = getSignalEntries(
table, column);
final Optional<Entry<Integer, TableRow>> collect = signalEntries
.stream()
final Optional<Integer> collect = signalEntries.stream()
.map(Map.Entry::getKey)
.collect(Collectors
.maxBy(Comparator.comparingInt(Map.Entry::getKey)));
if (collect.isPresent()) {
return Optional.of(collect.get().getKey());
}
return Optional.empty();
.minBy(Comparator.comparingInt((i) -> i.intValue())));
return collect;
}

private static List<Entry<Integer, TableRow>> getSignalEntries(
Expand All @@ -110,7 +105,7 @@ private static List<Entry<Integer, TableRow>> getSignalEntries(
final List<TableRow> tableRows = TableExtensions.getTableRows(table);
return tableRows.stream()
.collect(Collectors.toMap(
e -> Integer.valueOf(tableRows.indexOf(e) + 1),
e -> Integer.valueOf(tableRows.indexOf(e)),
Function.identity()))
.entrySet()
.parallelStream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.eclipse.set.feature.table.pt1.ssks;

import static org.eclipse.nebula.widgets.nattable.sort.SortDirectionEnum.ASC;
import static org.eclipse.nebula.widgets.nattable.sort.SortDirectionEnum.DESC;
import static org.eclipse.set.feature.table.pt1.ssks.SsksColumns.*;
import static org.eclipse.set.utils.table.sorting.ComparatorBuilder.CellComparatorType.EMPTY_LAST;
import static org.eclipse.set.utils.table.sorting.ComparatorBuilder.CellComparatorType.LEXICOGRAPHICAL;
Expand Down Expand Up @@ -116,8 +117,7 @@ public void handleEvent(final Event event) {
public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
return TableRowGroupComparator.builder(tableType)
.sort(Reales_Signal, EMPTY_LAST, ASC)
.sort(Fiktives_Signal, EMPTY_LAST, ASC)
.sort(Fiktives_Signal, EMPTY_LAST, DESC)
// It can be directly compare by Column E/F but for consistent
// with another table the CompareRouteAndKm will be used.
.sortByRouteAndKm(obj -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class SsksTransformator extends AbstractSignalTableTransform {

static val SIGNALBEGRIFF_COMPARATOR = new MixedStringComparator(
"(?<letters1>[A-Za-z]*)(?<number>[0-9]*)(?<letters2>[A-Za-z]*)")
static val inRelevantFiktivFunktion = #[
static val irrelevantFiktivFunktion = #[
ENUM_FIKTIVES_SIGNAL_FUNKTION_ZUG_START_ZIEL_BK_MIT_ZS_1,
ENUM_FIKTIVES_SIGNAL_FUNKTION_ZUG_START_ZIEL_BK_MIT_ZS_7,
ENUM_FIKTIVES_SIGNAL_FUNKTION_ZUG_START_ZIEL_NE_14_MIT_ZS_1,
Expand Down Expand Up @@ -643,7 +643,7 @@ class SsksTransformator extends AbstractSignalTableTransform {
private static def boolean isSsksSignal(Signal signal) {
if (signal?.signalFiktiv !== null &&
!signal?.signalFiktiv?.fiktivesSignalFunktion.exists [
inRelevantFiktivFunktion.contains(it)
irrelevantFiktivFunktion.contains(it)
]) {
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@
*/
package org.eclipse.set.feature.table.pt1.sskx;

import static org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt.*;
import static org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt.ENUM_BEFESTIGUNG_ART_ARBEITSBUEHNE;
import static org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt.ENUM_BEFESTIGUNG_ART_DACH_DECKE;
import static org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt.ENUM_BEFESTIGUNG_ART_OL_MAST;
import static org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt.ENUM_BEFESTIGUNG_ART_PFOSTEN_HOCH;
import static org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt.ENUM_BEFESTIGUNG_ART_PFOSTEN_NIEDRIG;
import static org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt.ENUM_BEFESTIGUNG_ART_REGELANORDNUNG_MAST_HOCH;
import static org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt.ENUM_BEFESTIGUNG_ART_REGELANORDNUNG_MAST_NIEDRIG;
import static org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt.ENUM_BEFESTIGUNG_ART_REGELANORDNUNG_SONSTIGE_HOCH;
import static org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt.ENUM_BEFESTIGUNG_ART_REGELANORDNUNG_SONSTIGE_NIEDRIG;
import static org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt.ENUM_BEFESTIGUNG_ART_SCHIENENFUSS;
import static org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt.ENUM_BEFESTIGUNG_ART_SONDERANORDNUNG_MAST_HOCH;
import static org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt.ENUM_BEFESTIGUNG_ART_SONDERANORDNUNG_MAST_NIEDRIG;
import static org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt.ENUM_BEFESTIGUNG_ART_WAND;

import java.util.LinkedList;
import java.util.List;
Expand Down Expand Up @@ -40,6 +52,7 @@
import org.eclipse.set.model.planpro.Signale.ENUMBefestigungArt;
import org.eclipse.set.model.planpro.Signale.ENUMBeleuchtet;
import org.eclipse.set.model.planpro.Signale.ENUMGeltungsbereich;
import org.eclipse.set.model.planpro.Signale.ENUMSignalFunktion;
import org.eclipse.set.model.planpro.Signale.Signal;
import org.eclipse.set.model.planpro.Signale.Signal_Rahmen;
import org.eclipse.set.model.planpro.Signale.Signal_Signalbegriff;
Expand Down Expand Up @@ -103,6 +116,13 @@ private static Predicate<Signal> generalCondition() {
return false;
}

if (signal.getSignalReal().getSignalFunktion() != null && signal
.getSignalReal()
.getSignalFunktion()
.getWert() == ENUMSignalFunktion.ENUM_SIGNAL_FUNKTION_ALLEINSTEHENDES_ZUSATZSIGNAL) {
return false;
}

final Set<Signal_Signalbegriff> signalbegriffe = SignalExtensions
.getSignalbegriffe(signal);
return signalbegriffe.stream()
Expand Down
Loading