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 @@ -4,7 +4,7 @@
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0.
*
*
* SPDX-License-Identifier: EPL-2.0
*
*/
Expand Down Expand Up @@ -37,13 +37,15 @@ import org.eclipse.set.ppmodel.extensions.container.MultiContainer_AttributeGrou
import org.eclipse.set.ppmodel.extensions.utils.Case
import org.eclipse.set.utils.math.AgateRounding
import org.eclipse.set.utils.table.TMFactory
import org.eclipse.set.utils.table.TableError
import org.osgi.service.event.EventAdmin

import static org.eclipse.set.feature.table.pt1.sszw.SszwColumns.*
import static org.eclipse.set.model.planpro.BasisTypen.ENUMLinksRechts.*
import static org.eclipse.set.model.planpro.Weichen_und_Gleissperren.ENUMWKrArt.*
import static org.eclipse.set.ppmodel.extensions.geometry.GEOKanteGeometryExtensions.*

import static extension org.eclipse.set.model.tablemodel.extensions.TableRowExtensions.*
import static extension org.eclipse.set.ppmodel.extensions.AussenelementansteuerungExtensions.*
import static extension org.eclipse.set.ppmodel.extensions.BasisAttributExtensions.*
import static extension org.eclipse.set.ppmodel.extensions.ESTW_ZentraleinheitExtensions.*
Expand Down Expand Up @@ -124,31 +126,41 @@ class SszwTransformator extends AbstractPlanPro2TableModelTransformator {
)

// D: Sszw.W_Kr.Standort.Strecke
val streckeInfos = etcsWkr.streckeInfo
fillIterable(
row,
cols.getColumn(Strecke),
etcsWkr,
[streckeInfos.map[key]],
null
)
try {

val streckeInfos = etcsWkr.streckeInfo
fillIterable(
row,
cols.getColumn(Strecke),
etcsWkr,
[streckeInfos.map[key]],
null
)

// E: Sszw.W_Kr.Standort.Km
fillIterableSingleCellWhenAllowed(
row,
cols.getColumn(km),
etcsWkr,
[isFindGeometryComplete || streckeInfos.map[value].exists[isPresent]],
[
val kmValues = streckeInfos.map[value].filter[isPresent].map [
get
].toList
return kmValues
],
null,
ITERABLE_FILLING_SEPARATOR,
tableShortcut
)
// E: Sszw.W_Kr.Standort.Km
fillIterableSingleCellWhenAllowed(
row,
cols.getColumn(km),
etcsWkr,
[
isFindGeometryComplete || streckeInfos.map[value].exists [
isPresent
]
],
[
val kmValues = streckeInfos.map[value].filter[isPresent].map [
get
].toList
return kmValues
],
null,
ITERABLE_FILLING_SEPARATOR,
tableShortcut
)
} catch (Exception e) {
handleFillingException(e, row, cols.getColumn(Strecke))
handleFillingException(e, row, cols.getColumn(km))
}

val wKomponentEW_L = refWKrAnlage.getGspKomponente(
wKrGspElement,
Expand Down Expand Up @@ -424,8 +436,9 @@ class SszwTransformator extends AbstractPlanPro2TableModelTransformator {
val distance = gspKomponente.map[new TopPoint(it)].map [ gspPoint |
topGraphService.findShortestDistance(signalTopPoint, gspPoint)
].map[orElse(null)].filterNull
return distance.nullOrEmpty ? "" : AgateRounding.roundDown(
distance.min.doubleValue).toString
return distance.nullOrEmpty
? ""
: AgateRounding.roundDown(distance.min.doubleValue).toString
}

private def String getWKrGeschwindigkeit(
Expand Down Expand Up @@ -461,7 +474,8 @@ class SszwTransformator extends AbstractPlanPro2TableModelTransformator {
val gspKomponent = gspElement.WKrGspKomponenten.firstOrNull
return allowSpeed.apply(gspKomponent)?.toString ?: ""
}
default: ""
default:
""
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ class PunktObjektTopKanteExtensions extends BasisObjektExtensions {
getProjectionCoordinateOnStrecke(coordinate, strecke)
val nearestRoutePoint = strecke.streckenPunkte.map [
it -> streckePunktTopDistance
].minBy[(projectionPointAndDistance.second - it.value).abs]
]
.filter[it.value != null]
.minBy[(projectionPointAndDistance.second - it.value).abs]

val nearestRoutePointMeter = nearestRoutePoint.key.streckeMeter.wert
val distance = nearestRoutePoint.value -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@ class StreckePunktExtensions extends BasisObjektExtensions {

static def BigDecimal getStreckePunktTopDistance(Strecke_Punkt routePoint) {
val geoKnoten = routePoint.geoKnoten
if (geoKnoten == null) {
return null
}
val geoKanten = routePoint.container.GEOKante.filter [
parentKante instanceof Strecke &&
parentKante === routePoint.IDStrecke.value
].filter[geoKnotenA === geoKnoten || geoKnotenB === geoKnoten].
firstOrNull
if (geoKanten === null) {
return null
throw new IllegalArgumentException(
"Route point isn't reference to GEO_Kante"
)
}
val metadata = Services.geometryService.getGeoKanteMetaData(geoKanten)
if (geoKanten.geoKnotenA === geoKnoten) {
Expand Down
Loading