Skip to content
Merged
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 @@ -233,7 +233,7 @@ class TrackSwitchLeg {
}
}

if (length === null || length === BigDecimal.ZERO) {
if (length === null || length.compareTo(BigDecimal.ZERO) === 0) {
length = DEFAULT_TRACKSWITCH_LEG_LENGTH
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ class SszwTransformator extends AbstractPlanPro2TableModelTransformator {
[isSimpleTrackSwitch],
[
punktObjektTOPKante.exists [ potk |
(potk.abstand.wert === BigDecimal.ZERO &&
(potk.abstand.wert.compareTo(BigDecimal.ZERO) === 0 &&
potk.topKante.TOPAnschlussA ===
ENUMTOPAnschluss.ENUMTOP_ANSCHLUSS_LINKS) ||
(potk.abstand.wert !== BigDecimal.ZERO &&
(potk.abstand.wert.compareTo(BigDecimal.ZERO) !== 0 &&
potk.topKante.TOPAnschlussB ===
ENUMTOPAnschluss.ENUMTOP_ANSCHLUSS_LINKS)
]
Expand All @@ -179,10 +179,10 @@ class SszwTransformator extends AbstractPlanPro2TableModelTransformator {
[isSimpleTrackSwitch],
[
punktObjektTOPKante.exists [ potk |
(potk.abstand.wert === BigDecimal.ZERO &&
(potk.abstand.wert.compareTo(BigDecimal.ZERO) === 0 &&
potk.topKante.TOPAnschlussA ===
ENUMTOPAnschluss.ENUMTOP_ANSCHLUSS_RECHTS) ||
(potk.abstand.wert !== BigDecimal.ZERO &&
(potk.abstand.wert.compareTo(BigDecimal.ZERO) !== 0 &&
potk.topKante.TOPAnschlussB ===
ENUMTOPAnschluss.ENUMTOP_ANSCHLUSS_RECHTS)

Expand Down Expand Up @@ -331,9 +331,9 @@ class SszwTransformator extends AbstractPlanPro2TableModelTransformator {
IDAussenelementansteuerung?.value === outsideControl
]) {
return #[
outsideControl.oertlichkeitNamensgebend.bezeichnung?.
outsideControl?.oertlichkeitNamensgebend?.bezeichnung?.
oertlichkeitAbkuerzung?.wert ?:
outsideControl.bezeichnung?.bezeichnungAEA?.wert]
outsideControl?.bezeichnung?.bezeichnungAEA?.wert]
}
return #[stellbereich?.oertlichkeitBezeichnung].filterNull
],
Expand Down Expand Up @@ -460,6 +460,9 @@ class SszwTransformator extends AbstractPlanPro2TableModelTransformator {
val gspKomponent = gspElement?.WKrGspKomponenten?.findFirst [
zungenpaar?.kreuzungsgleis?.wert === leftRightCross
]
if (gspKomponent === null) {
return "";
}
return allowSpeedEKW_DKW?.apply(gspKomponent)?.toString ?: ""
}
case ENUMW_KR_ART_ABW,
Expand All @@ -472,6 +475,9 @@ class SszwTransformator extends AbstractPlanPro2TableModelTransformator {
case ENUMW_KR_ART_KR,
case ENUMW_KR_ART_SONSTIGE: {
val gspKomponent = gspElement?.WKrGspKomponenten?.firstOrNull
if (gspKomponent === null) {
return "";
}
return allowSpeed?.apply(gspKomponent)?.toString ?: ""
}
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,14 +563,14 @@ class BereichObjektExtensions extends BasisObjektExtensions {
// The teilbereich have same TOP_Kante with the point
if (sameTopKante) {
val clone = EcoreUtil.copy(teilbereich)
if (teilbereich.begrenzungA.wert !== BigDecimal.ZERO) {
if (teilbereich.begrenzungA.wert.compareTo(BigDecimal.ZERO) != 0) {
val tolerantLimitA = teilbereich.begrenzungA.wert -
tolerantBigDecimal
clone.begrenzungA.wert = tolerantLimitA <=
BigDecimal.ZERO ? BigDecimal.ZERO : tolerantLimitA
}

if (teilbereich.begrenzungB.wert !== teilBereichTopKante.laenge) {
if (teilbereich.begrenzungB.wert.compareTo(teilBereichTopKante.laenge) != 0) {
val tolerantLimitB = teilbereich.begrenzungB.wert +
tolerantBigDecimal
clone.begrenzungB.wert = tolerantLimitB >=
Expand All @@ -580,8 +580,8 @@ class BereichObjektExtensions extends BasisObjektExtensions {
}

val isContains = clone.contains(singlePoint)
if (clone.begrenzungA.wert === BigDecimal.ZERO &&
clone.begrenzungB.wert === teilBereichTopKante.laenge &&
if (clone.begrenzungA.wert.compareTo(BigDecimal.ZERO) === 0 &&
clone.begrenzungB.wert.compareTo(teilBereichTopKante.laenge) == 0 &&
!isContains) {
throw new IllegalArgumentException('''The TOP_Kante: «teilbereich.IDTOPKante.wert» should contain the Punkt_Objekt: «singlePoint.identitaet»''')
}
Expand Down
Loading