@@ -662,27 +662,27 @@ class SskwTransformator extends AbstractPlanPro2TableModelTransformator {
662
662
val elektrischerAntriebAnzahl = element. WKrGspKomponenten . map [
663
663
kreuzung? . elektrischerAntriebAnzahl? . wert
664
664
]. filterNull. map[intValue]
665
- if (herzstueckAntriebe. exists[it > 0 ]) {
666
- fill(
667
- row,
668
- cols. getColumn(Herzstueck_Antriebe ),
669
- element,
670
- [herzstueckAntriebe. fold(0 , [s, a|s + a]). toString]
671
- )
672
- } else if (elektrischerAntriebAnzahl. exists[it > 0 ]) {
665
+ val fillFunc = [ (W_Kr_Gsp_Komponente )= > BigInteger actuatorCount, (W_Kr_Gsp_Komponente )= > ENUMElektrischerAntriebLage actuatorPosition |
673
666
fillMultiColorIterable(
674
667
row,
675
668
cols. getColumn(Herzstueck_Antriebe ),
676
669
element,
677
670
[
678
671
transformMultiColorContent(
679
672
WKrGspKomponenten ,
680
- [kreuzung ? . elektrischerAntriebAnzahl ? . wert] ,
681
- [kreuzung ? . elektrischerAntriebLage ? . wert]
673
+ actuatorCount ,
674
+ actuatorPosition
682
675
)
683
676
],
684
677
" +"
685
678
)
679
+ ]
680
+ if (herzstueckAntriebe. exists[it > 0 ]) {
681
+ fillFunc. apply([zungenpaar? . herzstueckAntriebe? . wert], [null ])
682
+ } else if (elektrischerAntriebAnzahl. exists[it > 0 ]) {
683
+ fillFunc. apply([kreuzung? . elektrischerAntriebAnzahl? . wert], [
684
+ kreuzung? . elektrischerAntriebLage? . wert
685
+ ])
686
686
} else {
687
687
fill(
688
688
row,
@@ -792,14 +792,13 @@ class SskwTransformator extends AbstractPlanPro2TableModelTransformator {
792
792
createMultiColorContent
793
793
val actuator = actuatorNumberSelector. apply(it )
794
794
val noOfActuators = actuator !== null ? actuator. intValue : 0
795
- val position = it . getPosition(actuatorNumberSelector,
796
- actuatorPositionSelector)
795
+ val position = it . getPosition(actuator, actuatorPositionSelector)
797
796
if (austauschAntriebe? . wert == = true ) {
798
797
multiColorContent. multiColorValue = noOfActuators. toString
799
- multiColorContent. stringFormat = ' ' ' %s«IF noOfActuators >0 » («position»)«ENDIF»' ' '
798
+ multiColorContent. stringFormat = ' ' ' %s«IF noOfActuators > 0 && position !== null » («position»)«ENDIF»' ' '
800
799
} else {
801
800
multiColorContent. multiColorValue = null
802
- multiColorContent. stringFormat = ' ' ' «noOfActuators»«IF noOfActuators > 0» («position»)«ENDIF»' ' '
801
+ multiColorContent. stringFormat = ' ' ' «noOfActuators»«IF noOfActuators > 0 && position !== null » («position»)«ENDIF»' ' '
803
802
}
804
803
805
804
return multiColorContent
@@ -808,10 +807,10 @@ class SskwTransformator extends AbstractPlanPro2TableModelTransformator {
808
807
809
808
private def String getPosition (
810
809
W_Kr_Gsp_Komponente component ,
811
- ( W_Kr_Gsp_Komponente )=> BigInteger actuatorNumberSelector ,
810
+ BigInteger actuator ,
812
811
(W_Kr_Gsp_Komponente )=>ENUMElektrischerAntriebLage actuatorPositionSelector
813
812
) {
814
- if (actuatorNumberSelector . apply(component) != BigInteger . ZERO ) {
813
+ if (actuator != BigInteger . ZERO ) {
815
814
return actuatorPositionSelector. apply(component). translate ?:
816
815
" keine Lage"
817
816
} else {
0 commit comments