Skip to content

Commit

Permalink
Ssld free reporting section (eclipse-set#1184)
Browse files Browse the repository at this point in the history
* Ssld: modify free reporting section

* Remove test code

* Remove unused attribute
  • Loading branch information
TruongQuangSB authored Dec 17, 2024
1 parent 9a96561 commit 47d38b2
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,26 @@ class SsldTransformator extends AbstractPlanPro2TableModelTransformator {
].filter[present].map[get].min
}

def String getFreigemeldetLaenge(Fstr_DWeg dweg, TopGraph topGraph,
BigDecimal maxLength) {
def String getFreigemeldetLaenge(Fstr_DWeg dweg, TopGraph topGraph) {
val startSignal = dweg?.fstrFahrweg?.start
val fmas = dweg?.FMAs.toList.filter [
var fmas = dweg?.FMAs.toList.filter [
topGraph.isInWirkrichtungOfSignal(startSignal, it)
]
].toList
// When not exists relevant FMA_Komponent/Gleis_Abschluss on the Fstr_Fahrweg of this DWeg,
// then take the FMA_Komponent/Gleis_Abschluss of this FMA_Anlage_Freimeldung,
// which in direction of the start Signal
if (fmas.empty) {
return ""
fmas = dweg?.fmaAnlageFreimeldung?.map[fmaGrenzen]?.flatten.toSet.
filter[topGraph.isInWirkrichtungOfSignal(startSignal, it)].
toList
}

val relevantDistances = fmas?.map [
getShortestPathLength(dweg?.fstrFahrweg?.start, it)
].filter [
maxLength.compareTo(it) >= 0 &&
dweg?.fstrDWegAllg?.laengeSoll?.wert.compareTo(it) <= 0
]
if (relevantDistances.nullOrEmpty) {
return AgateRounding.roundDown(maxLength.doubleValue).toString
if (relevantDistances.isEmpty) {
return ""
}

val roundedDistance = AgateRounding.roundDown(
relevantDistances.max.doubleValue)
if (roundedDistance == 0.0)
Expand Down Expand Up @@ -196,7 +196,7 @@ class SsldTransformator extends AbstractPlanPro2TableModelTransformator {
instance,
cols.getColumn(Freigemeldet),
dweg,
[getFreigemeldetLaenge(topGraph, fstrFahrWegLength)]
[getFreigemeldetLaenge(topGraph)]
)

// J: Ssld.Eigenschaften.massgebende_Neigung
Expand Down

0 comments on commit 47d38b2

Please sign in to comment.