Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d68dac0
original meaning of getMountType
Nov 17, 2025
048ac5b
add new, more refined condition for getMountType(SignalInfo)
Nov 17, 2025
8aba073
add Flash to getFeatureName
Nov 17, 2025
26f709b
add anchors to HV Vr1
Dec 1, 2025
3e6c25f
remove debugging text
Dec 1, 2025
37ada06
use exists instead of !filter.isEmpty
Dec 8, 2025
7247318
Ne2 is alleinstehend
Dec 8, 2025
8b76ea5
reorder imports
Jan 15, 2026
146ceba
formatting
Jan 15, 2026
302508c
rename SvgDrawBridge.draw
Jan 15, 2026
c102435
make drawSVG return null, if can't draw that. make SvgDrawBridge an D…
Jan 15, 2026
8a4fb50
getSignalScreen only returns screens which should actually be drawn
Jan 15, 2026
001cc34
edit DrawBridge
Jan 15, 2026
f2263ee
cleanup
Jan 15, 2026
1aae3b0
inline draw attached signals
Jan 15, 2026
aa4db18
continue previous
Jan 15, 2026
fb3c896
remove console logs
Jan 15, 2026
233c979
fix signal bruecke in catalog
Jan 15, 2026
00c69c3
Only SignalAusleger (no Links or Mitte)
Jan 15, 2026
6d975cb
add signed signal offset
Jan 15, 2026
27799a1
remove SvgBridgeSignal mountoffset and -direction
Jan 15, 2026
92a8fb7
simplify
Jan 15, 2026
b317be5
draw arm properly
Jan 15, 2026
78ef269
fix mountDirection
Jan 15, 2026
44833e5
inline mountDirection()
Jan 15, 2026
b21f36a
fix ausleger drawing
Jan 16, 2026
7b1fab3
cleanup
Jan 16, 2026
448ef5c
draw first catalg result != null
Jan 16, 2026
584c641
mount offset: right = positive, left = negative
Jan 16, 2026
e388ebe
fix offsets
Jan 16, 2026
a2538ae
fix positioning
Jan 16, 2026
6972849
fix label position with magic string
Jan 16, 2026
2e504e1
unfinished
Jan 16, 2026
e5e1790
move extent code into drawBridge
Jan 16, 2026
e66fda9
old comments
Jan 16, 2026
e6b12ca
try find magic number
Jan 16, 2026
778893d
found something out about the magic number
Jan 16, 2026
9bd990d
clean up big case distinction
Jan 16, 2026
06008d0
comments
Jan 16, 2026
ab2e56a
Dont add layer for Flash Feature
Jan 22, 2026
913e06b
change siteplan.ecore instead of the derived .java files
Jan 26, 2026
dde8e22
simplify overhang calculation
Jan 26, 2026
faf9daa
save siteplan.genmodel
Jan 26, 2026
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 @@ -232,6 +232,20 @@ class SignalTransformator extends BaseTransformator<Signal> {
}
}

/**
* 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
Expand All @@ -243,7 +257,27 @@ class SignalTransformator extends BaseTransformator<Signal> {
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) {
Expand All @@ -268,6 +302,7 @@ class SignalTransformator extends BaseTransformator<Signal> {
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:
Expand All @@ -282,7 +317,6 @@ class SignalTransformator extends BaseTransformator<Signal> {
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,
Expand All @@ -295,7 +329,7 @@ class SignalTransformator extends BaseTransformator<Signal> {
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
}
Expand All @@ -311,7 +345,7 @@ class SignalTransformator extends BaseTransformator<Signal> {
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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@
<eLiterals name="PfostenNiedrig" value="6" literal="PfostenNiedrig"/>
<eLiterals name="Deckenkonstruktion" value="7" literal="Deckenkonstruktion"/>
<eLiterals name="Wandkonstruktion" value="8" literal="Wandkonstruktion"/>
<eLiterals name="SignalauslegerLinks" value="9" literal="SignalauslegerLinks"/>
<eLiterals name="SignalauslegerMitte" value="10" literal="SignalauslegerMitte"/>
<eLiterals name="Signalausleger" value="9" literal="Signalausleger"/>
<eLiterals name="Signalbruecke" value="11" literal="Signalbruecke"/>
<eLiterals name="Sonderkonstruktion" value="12" literal="Sonderkonstruktion"/>
</eClassifiers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
<genEnumLiterals ecoreEnumLiteral="siteplan.ecore#//SignalMountType/PfostenNiedrig"/>
<genEnumLiterals ecoreEnumLiteral="siteplan.ecore#//SignalMountType/Deckenkonstruktion"/>
<genEnumLiterals ecoreEnumLiteral="siteplan.ecore#//SignalMountType/Wandkonstruktion"/>
<genEnumLiterals ecoreEnumLiteral="siteplan.ecore#//SignalMountType/SignalauslegerLinks"/>
<genEnumLiterals ecoreEnumLiteral="siteplan.ecore#//SignalMountType/SignalauslegerMitte"/>
<genEnumLiterals ecoreEnumLiteral="siteplan.ecore#//SignalMountType/Signalausleger"/>
<genEnumLiterals ecoreEnumLiteral="siteplan.ecore#//SignalMountType/Signalbruecke"/>
<genEnumLiterals ecoreEnumLiteral="siteplan.ecore#//SignalMountType/Sonderkonstruktion"/>
</genEnums>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,7 @@ public enum SignalMountType implements Enumerator {
* @generated
* @ordered
*/
SIGNALAUSLEGER_LINKS(9, "SignalauslegerLinks", "SignalauslegerLinks"),

/**
* The '<em><b>Signalausleger Mitte</b></em>' literal object. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see #SIGNALAUSLEGER_MITTE_VALUE
* @generated
* @ordered
*/
SIGNALAUSLEGER_MITTE(10, "SignalauslegerMitte", "SignalauslegerMitte"),
SIGNALAUSLEGER(9, "Signalausleger", "Signalausleger"),

/**
* The '<em><b>Signalbruecke</b></em>' literal object. <!-- begin-user-doc
Expand Down Expand Up @@ -262,18 +252,7 @@ public enum SignalMountType implements Enumerator {
* @generated
* @ordered
*/
public static final int SIGNALAUSLEGER_LINKS_VALUE = 9;

/**
* The '<em><b>Signalausleger Mitte</b></em>' literal value. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
* @see #SIGNALAUSLEGER_MITTE
* @model name="SignalauslegerMitte"
* @generated
* @ordered
*/
public static final int SIGNALAUSLEGER_MITTE_VALUE = 10;
public static final int SIGNALAUSLEGER_VALUE = 9;

/**
* The '<em><b>Signalbruecke</b></em>' literal value. <!-- begin-user-doc
Expand Down Expand Up @@ -306,8 +285,7 @@ public enum SignalMountType implements Enumerator {
private static final SignalMountType[] VALUES_ARRAY = new SignalMountType[] {
MAST, MEHRERE_MASTEN, PFOSTEN, SCHIENENFUSS, GLEISABSCHLUSS,
MAST_NIEDRIG, PFOSTEN_NIEDRIG, DECKENKONSTRUKTION, WANDKONSTRUKTION,
SIGNALAUSLEGER_LINKS, SIGNALAUSLEGER_MITTE, SIGNALBRUECKE,
SONDERKONSTRUKTION, };
SIGNALAUSLEGER, SIGNALBRUECKE, SONDERKONSTRUKTION, };

/**
* A public read-only list of all the '<em><b>Signal Mount Type</b></em>'
Expand Down Expand Up @@ -385,10 +363,8 @@ public static SignalMountType get(int value) {
return DECKENKONSTRUKTION;
case WANDKONSTRUKTION_VALUE:
return WANDKONSTRUKTION;
case SIGNALAUSLEGER_LINKS_VALUE:
return SIGNALAUSLEGER_LINKS;
case SIGNALAUSLEGER_MITTE_VALUE:
return SIGNALAUSLEGER_MITTE;
case SIGNALAUSLEGER_VALUE:
return SIGNALAUSLEGER;
case SIGNALBRUECKE_VALUE:
return SIGNALBRUECKE;
case SONDERKONSTRUKTION_VALUE:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3512,10 +3512,7 @@ public void initializePackageContents() {
addEEnumLiteral(signalMountTypeEEnum,
SignalMountType.DECKENKONSTRUKTION);
addEEnumLiteral(signalMountTypeEEnum, SignalMountType.WANDKONSTRUKTION);
addEEnumLiteral(signalMountTypeEEnum,
SignalMountType.SIGNALAUSLEGER_LINKS);
addEEnumLiteral(signalMountTypeEEnum,
SignalMountType.SIGNALAUSLEGER_MITTE);
addEEnumLiteral(signalMountTypeEEnum, SignalMountType.SIGNALAUSLEGER);
addEEnumLiteral(signalMountTypeEEnum, SignalMountType.SIGNALBRUECKE);
addEEnumLiteral(signalMountTypeEEnum,
SignalMountType.SONDERKONSTRUKTION);
Expand Down
2 changes: 2 additions & 0 deletions web/siteplan/public/SvgKatalog/HV-System.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 5 additions & 6 deletions web/siteplan/src/components/SVG/SignalBruecke.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</option>
</select>
</div>
<span>{{ draw() }}</span>
<div v-html="draw()" />
</div>
</template>
<script lang="ts">
Expand All @@ -33,7 +33,7 @@ import {
HauptVorSignalGroup,
SignalBrueckeudAusleger
} from '@/util/SVG/SvgEnum'
import { Vue, Options } from 'vue-class-component'
import { Options, Vue } from 'vue-class-component'

@Options({
props: {
Expand All @@ -52,12 +52,11 @@ import { Vue, Options } from 'vue-class-component'
export default class SignalBruecke extends Vue {
svgService!: SvgService
listMast = [
SignalMountType.SignalauslegerLinks,
SignalMountType.SignalauslegerMitte,
SignalMountType.Signalausleger,
SignalMountType.Signalbruecke
]

selectedMast = SignalMountType.SignalauslegerLinks
selectedMast = SignalMountType.Signalausleger
private randomSelectSchirm (): ISvgElement[] {
const result = new Array<ISvgElement>()
const listschirm = this.svgService.getSvgElementInGroup(
Expand Down Expand Up @@ -88,7 +87,7 @@ export default class SignalBruecke extends Vue {
)
})
})
const result = SvgDrawBridge.draw(bridgeScreen, this.selectedMast)
const result = SvgDrawBridge.drawParts('',bridgeScreen, this.selectedMast)
return result.content.outerHTML
}
}
Expand Down
12 changes: 6 additions & 6 deletions web/siteplan/src/components/SVG/Svg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,28 @@
/>
</div>
<div v-if="mode === 'bruecke'">
<SignalBruecker :svg-service="svgService" />
<SignalBruecke :svg-service="svgService" />
</div>
</div>
</template>
<script lang="ts">
import { ISvgElement } from '@/model/SvgElement'
import SvgService from '@/service/SvgService'
import {
AndereSignalGroup,
HauptVorSignalGroup,
SVGMast
} from '@/util/SVG/SvgEnum'
import { Options, Vue } from 'vue-class-component'
import SignalBruecke from './SignalBruecke.vue'
import SvgKatalog from './SvgKatalog.vue'
import SvgSingleSignal from './SvgSingleSignal.vue'
import SvgService from '@/service/SvgService'
import SignalBruecker from './SignalBruecke.vue'
import { Options, Vue } from 'vue-class-component'
import { ISvgElement } from '@/model/SvgElement'

@Options({
components: {
SvgKatalog,
SvgSingleSignal,
SignalBruecker
SignalBruecke
},
created () {
this.setMode()
Expand Down
3 changes: 1 addition & 2 deletions web/siteplan/src/model/SignalMount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export enum SignalMountType {
PfostenNiedrig = 'PfostenNiedrig',
Deckenkonstruktion = 'Deckenkonstruktion',
Wandkonstruktion = 'Wandkonstruktion',
SignalauslegerLinks = 'SignalauslegerLinks',
SignalauslegerMitte = 'SignalauslegerMitte',
Signalausleger = 'Signalausleger',
Sonderkonstruktion = 'Sonderkonstruktion',
Signalbruecke = 'Signalbruecke',
// Internally used, not generated by Java:
Expand Down
23 changes: 12 additions & 11 deletions web/siteplan/src/model/SvgElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*/
import { MountDirection } from './Signal'
import { Label } from './Label'
import { Extent } from 'ol/extent'
import { Label } from './Label'
import { MountDirection } from './Signal'

export interface ISvgPoint {
id: string
Expand Down Expand Up @@ -80,38 +80,39 @@ export class ZusatzSignal extends SvgElement {
}
export const MAX_BRIDGE_DIRECTION_OFFSET = 15.0
export class SvgBridgeSignal extends SvgElement {
mountOffset: number
/** right = positive, left = negative */
mountSignedOffset: number
mountDirection: MountDirection
label?: Label
label: Label | null

constructor (
id: string,
element: Element,
anchor: ISvgPoint[],
nullpunkt: ISvgPoint | null,
mountOffset: number,
mountSignedOffset: number,
mountDirection: MountDirection,
signalLabel: Label | undefined,
signalLabel: Label | null,
boundingBox: Extent[]
) {
super(id, element, anchor, nullpunkt, boundingBox)
this.mountOffset = mountOffset
this.mountDirection = mountDirection
this.mountSignedOffset = mountSignedOffset
this.label = signalLabel
this.mountDirection = mountDirection
}

static fromSvgElement (
element: ISvgElement,
mountOffset: number,
signedOffset: number,
mountDirection: MountDirection,
signalLabel?: Label
signalLabel: Label | null
): SvgBridgeSignal {
return new SvgBridgeSignal(
element.id,
element.content,
element.anchor,
element.nullpunkt,
mountOffset,
signedOffset,
mountDirection,
signalLabel,
element.boundingBox
Expand Down
2 changes: 2 additions & 0 deletions web/siteplan/src/service/SvgService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { store } from '@/store'
import Configuration from '@/util/Configuration'
import { getFirstValue } from '@/util/ObjectExtension'
import SvgDraw from '@/util/SVG/Draw/SvgDraw'
import SvgDrawBridge from '@/util/SVG/Draw/SvgDrawBridge'
import SvgDrawCant from '@/util/SVG/Draw/SvgDrawCant'
import SvgDrawExternalElementControl from '@/util/SVG/Draw/SvgDrawExternalElementControl'
import SvgDrawFMAComponent from '@/util/SVG/Draw/SvgDrawFMAComponent'
Expand Down Expand Up @@ -52,6 +53,7 @@ export default class SvgService {
}

public registerDrawFeatureSvg () {
this.drawFeatureClass.push(new SvgDrawBridge(this.catalogService))
this.drawFeatureClass.push(new SvgDrawSignal(this.catalogService))
this.drawFeatureClass.push(new SvgDrawFMAComponent(this.catalogService))
this.drawFeatureClass.push(new SvgDrawPZB(this.catalogService))
Expand Down
6 changes: 4 additions & 2 deletions web/siteplan/src/util/SVG/Draw/AbstractDrawSVG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ export default abstract class AbstractDrawSVG {
}

/**
* Create a Svg for a feature
* Create a Svg for a feature. Return null, if
* this Drawer cannot draw that feature or if it is faulty.
* If all DrawSVGs return null, an error is displayed.
* @param data feature data
* @param label {@link Label}
*/
public abstract drawSVG<T extends object>(data: T, label?: Label): ISvgElement
public abstract drawSVG<T extends object>(data: T, label?: Label): ISvgElement | null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of null should it give SvgError back, when something wrong

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made SvgDrawBridge an AbstractDrawSVG. Now, there are two for Signals... (SvgDrawSignal and SvgDrawBridge). Don't you think it is sensible to model it like this? Now flow is:

  • SvgDrawBridge attempts to draw, if it is not a bridge, returns null
  • SvgService continues searching for a result != null
  • Then SvgDrawSignal returns a value != null.
  • if it, too, returns null, draw error


public getSvgFromCatalog<T extends object> (data: T): ISvgElement | null {
return this.catalogService.getObjSvg(data, this.getFeatureType())
Expand Down
Loading
Loading