diff --git a/java/bundles/org.eclipse.set.feature.siteplan/src/org/eclipse/set/feature/siteplan/transform/SignalTransformator.xtend b/java/bundles/org.eclipse.set.feature.siteplan/src/org/eclipse/set/feature/siteplan/transform/SignalTransformator.xtend index d3c61f85e2..f4a97148d7 100644 --- a/java/bundles/org.eclipse.set.feature.siteplan/src/org/eclipse/set/feature/siteplan/transform/SignalTransformator.xtend +++ b/java/bundles/org.eclipse.set.feature.siteplan/src/org/eclipse/set/feature/siteplan/transform/SignalTransformator.xtend @@ -69,7 +69,7 @@ class SignalTransformator extends BaseTransformator { val mountsWithParents = si.mounts.map [ mount | mount?.signalBefestigungen].flatten si.mounts = newHashSet(mountsWithParents); - + signalinfo.add(si) } @@ -81,7 +81,7 @@ class SignalTransformator extends BaseTransformator { signalinfo.forEach [ si | try { val baseMount = si.getBaseMount() - + val mergeWith = mergedSignalInfo.findFirst [ msi | msi.mounts.contains(baseMount) ] @@ -190,6 +190,20 @@ class SignalTransformator extends BaseTransformator { } } + /** + * Original Definition: + * - if there are only Sonderkonstruktionen as mounts, return SONDERKONSTRUKTION + * - if there is one mount != Sonderkonstruktion, return that mounts BefestigungsArt. + * - if there is more then one mount != Sonderkonstruktion, take the mount with the lowest GUID: + * - then: if mount is mast and there are more then 1 signals attached to this assembly, return MehrereMasten + * - if there are no mounts: + * - take the signal with the lowest guid, and take the befestigungsArt from the signalReal + * - if signal/signalReal/signalReal.signalBefestigungsart null: return null + * + * New Definition: + * (ASSUMPTION: no Arbeitsbuehne without a Bridge / Ausleger (see changes in mapToSiteplanMountType)) + * - if any specific mount is an SignalAuslegerLinks, return SignalAuslegerLinks. + */ def SignalMountType getMountType(SignalInfo info) { var mounts = info.mounts.sortBy[identitaet.wert].map [ signalBefestigungAllg.befestigungArt.wert @@ -201,7 +215,27 @@ class SignalTransformator extends BaseTransformator { it != SignalMountType.SONDERKONSTRUKTION ] - if (specificMounts.length != 0) { + if (specificMounts.length == 1) { + return specificMounts.head; + } + + if (specificMounts.length > 1) { + // there might be many different combinations, obviously. + // I attempt to keep behaviour as before (even if not correct) and only change behaviour for SignalAusleger + // SignalAusleger -> ... anything => should be SignalAusleger + // Fundament -> SignalAusleger => should be SignalAusleger + // Fundament -> Mast + // new logic for any assembly containing a SignalAusleger. Same for all other cases + if (specificMounts.exists [ + it === SignalMountType.SIGNALAUSLEGER + ]) { + return SignalMountType.SIGNALAUSLEGER; + } + if (specificMounts. + exists[it === SignalMountType.SIGNALBRUECKE]) { + return SignalMountType.SIGNALBRUECKE; + } + var mount = specificMounts.head // If multiple signals are attached to a MAST, convert into MEHRERE_MASTEN if (mount === SignalMountType.MAST && info.signals.length > 1) { @@ -226,6 +260,7 @@ class SignalTransformator extends BaseTransformator { case ENUM_BEFESTIGUNG_ART_ANDERE_SONDERKONSTRUKTION, case ENUM_BEFESTIGUNG_ART_BAHNSTEIG, case ENUM_BEFESTIGUNG_ART_FUNDAMENT, + case ENUM_BEFESTIGUNG_ART_ARBEITSBUEHNE, case ENUM_BEFESTIGUNG_ART_KONSTRUKTIONSTEIL: return SignalMountType.SONDERKONSTRUKTION case ENUM_BEFESTIGUNG_ART_PRELLBOCK: @@ -240,7 +275,6 @@ class SignalTransformator extends BaseTransformator { case ENUM_BEFESTIGUNG_ART_PFOSTEN_NIEDRIG: return SignalMountType.PFOSTEN case ENUM_BEFESTIGUNG_ART_SONSTIGE, - case ENUM_BEFESTIGUNG_ART_ARBEITSBUEHNE, case ENUM_BEFESTIGUNG_ART_PFAHL, case ENUM_BEFESTIGUNG_ART_OL_KETTENWERK, case ENUM_BEFESTIGUNG_ART_OL_MAST, @@ -253,7 +287,7 @@ class SignalTransformator extends BaseTransformator { case ENUM_BEFESTIGUNG_ART_SONDERANORDNUNG_MAST_NIEDRIG: return SignalMountType.MAST case ENUM_BEFESTIGUNG_ART_SIGNALAUSLEGER: - return SignalMountType.SIGNALAUSLEGER_LINKS + return SignalMountType.SIGNALAUSLEGER case ENUM_BEFESTIGUNG_ART_SIGNALBRUECKE: return SignalMountType.SIGNALBRUECKE } @@ -269,7 +303,7 @@ class SignalTransformator extends BaseTransformator { case ENUM_SIGNAL_BEFESTIGUNGSART_MAST: return SignalMountType.MAST case ENUM_SIGNAL_BEFESTIGUNGSART_SIGNALAUSLEGER: - return SignalMountType.SIGNALAUSLEGER_LINKS + return SignalMountType.SIGNALAUSLEGER case ENUM_SIGNAL_BEFESTIGUNGSART_SIGNALBRUECKE: return SignalMountType.SIGNALBRUECKE } diff --git a/java/bundles/org.eclipse.set.model.siteplan/src/org/eclipse/set/model/siteplan/SignalMountType.java b/java/bundles/org.eclipse.set.model.siteplan/src/org/eclipse/set/model/siteplan/SignalMountType.java index 711aba5220..d545754ced 100644 --- a/java/bundles/org.eclipse.set.model.siteplan/src/org/eclipse/set/model/siteplan/SignalMountType.java +++ b/java/bundles/org.eclipse.set.model.siteplan/src/org/eclipse/set/model/siteplan/SignalMountType.java @@ -122,17 +122,7 @@ public enum SignalMountType implements Enumerator { * @generated * @ordered */ - SIGNALAUSLEGER_LINKS(9, "SignalauslegerLinks", "SignalauslegerLinks"), - - /** - * The 'Signalausleger Mitte' literal object. - * - * @see #SIGNALAUSLEGER_MITTE_VALUE - * @generated - * @ordered - */ - SIGNALAUSLEGER_MITTE(10, "SignalauslegerMitte", "SignalauslegerMitte"), + SIGNALAUSLEGER(9, "Signalausleger", "Signalausleger"), /** * The 'Signalbruecke' literal object. - * - * @see #SIGNALAUSLEGER_MITTE - * @model name="SignalauslegerMitte" - * @generated - * @ordered - */ - public static final int SIGNALAUSLEGER_MITTE_VALUE = 10; + public static final int SIGNALAUSLEGER_VALUE = 9; /** * The 'Signalbruecke' literal value.