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 7717e573fd..2cf4d4f254 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 @@ -232,6 +232,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 @@ -243,7 +257,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) { @@ -268,6 +302,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: @@ -282,7 +317,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, @@ -295,7 +329,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 } @@ -311,7 +345,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/model/siteplan.ecore b/java/bundles/org.eclipse.set.model.siteplan/model/siteplan.ecore index e049617c29..b22f6252bc 100644 --- a/java/bundles/org.eclipse.set.model.siteplan/model/siteplan.ecore +++ b/java/bundles/org.eclipse.set.model.siteplan/model/siteplan.ecore @@ -115,8 +115,7 @@ - - + diff --git a/java/bundles/org.eclipse.set.model.siteplan/model/siteplan.genmodel b/java/bundles/org.eclipse.set.model.siteplan/model/siteplan.genmodel index f67ca40af6..2dcee90994 100644 --- a/java/bundles/org.eclipse.set.model.siteplan/model/siteplan.genmodel +++ b/java/bundles/org.eclipse.set.model.siteplan/model/siteplan.genmodel @@ -22,8 +22,7 @@ - - + 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..c3a6cdcaad 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.