Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b0290c5
original meaning of getMountType
Nov 17, 2025
89383a8
add new, more refined condition for getMountType(SignalInfo)
Nov 17, 2025
3942e35
add Flash to getFeatureName
Nov 17, 2025
f076b5d
add anchors to HV Vr1
Dec 1, 2025
8b29a88
remove debugging text
Dec 1, 2025
1d440a9
use exists instead of !filter.isEmpty
Dec 8, 2025
2f3e744
Ne2 is alleinstehend
Dec 8, 2025
07024d6
reorder imports
Jan 15, 2026
aae5f12
formatting
Jan 15, 2026
bf16bc6
rename SvgDrawBridge.draw
Jan 15, 2026
c3fba1e
make drawSVG return null, if can't draw that. make SvgDrawBridge an D…
Jan 15, 2026
71c0a58
getSignalScreen only returns screens which should actually be drawn
Jan 15, 2026
3b1e15c
edit DrawBridge
Jan 15, 2026
8d5e693
cleanup
Jan 15, 2026
eaffc6e
inline draw attached signals
Jan 15, 2026
3e673f2
continue previous
Jan 15, 2026
4cfcfe2
remove console logs
Jan 15, 2026
b313a63
fix signal bruecke in catalog
Jan 15, 2026
3d67aa5
Only SignalAusleger (no Links or Mitte)
Jan 15, 2026
30b5a33
add signed signal offset
Jan 15, 2026
26d2164
remove SvgBridgeSignal mountoffset and -direction
Jan 15, 2026
4df188e
simplify
Jan 15, 2026
77b18bf
draw arm properly
Jan 15, 2026
22a5d75
fix mountDirection
Jan 15, 2026
eff8b7c
inline mountDirection()
Jan 15, 2026
fc594c1
fix ausleger drawing
Jan 16, 2026
81b1d8b
cleanup
Jan 16, 2026
ffa8930
draw first catalg result != null
Jan 16, 2026
9c32ce8
mount offset: right = positive, left = negative
Jan 16, 2026
d296348
fix offsets
Jan 16, 2026
f3ee319
fix positioning
Jan 16, 2026
80bcd9d
fix label position with magic string
Jan 16, 2026
de914e5
unfinished
Jan 16, 2026
0893b29
move extent code into drawBridge
Jan 16, 2026
2ffdf40
old comments
Jan 16, 2026
bd91ae1
try find magic number
Jan 16, 2026
a2289f3
found something out about the magic number
Jan 16, 2026
5474ae0
clean up big case distinction
Jan 16, 2026
5ffb813
comments
Jan 16, 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 @@ -69,7 +69,7 @@ class SignalTransformator extends BaseTransformator<Signal> {
val mountsWithParents = si.mounts.map [ mount |
mount?.signalBefestigungen].flatten
si.mounts = newHashSet(mountsWithParents);

signalinfo.add(si)
}

Expand All @@ -81,7 +81,7 @@ class SignalTransformator extends BaseTransformator<Signal> {
signalinfo.forEach [ si |
try {
val baseMount = si.getBaseMount()

val mergeWith = mergedSignalInfo.findFirst [ msi |
msi.mounts.contains(baseMount)
]
Expand Down Expand Up @@ -190,6 +190,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 @@ -201,7 +215,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 @@ -226,6 +260,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 @@ -240,7 +275,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 @@ -253,7 +287,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 @@ -269,7 +303,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 @@ -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,7 +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,
SIGNALAUSLEGER, SIGNALBRUECKE,
SONDERKONSTRUKTION, };

/**
Expand Down Expand Up @@ -385,10 +364,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 @@ -3513,9 +3513,9 @@ public void initializePackageContents() {
SignalMountType.DECKENKONSTRUKTION);
addEEnumLiteral(signalMountTypeEEnum, SignalMountType.WANDKONSTRUKTION);
addEEnumLiteral(signalMountTypeEEnum,
SignalMountType.SIGNALAUSLEGER_LINKS);
SignalMountType.SIGNALAUSLEGER);
addEEnumLiteral(signalMountTypeEEnum,
SignalMountType.SIGNALAUSLEGER_MITTE);
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
14 changes: 7 additions & 7 deletions web/siteplan/src/components/SVG/Svg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,29 @@
/>
</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 SvgKatalog from './SvgKatalog.vue'
import SvgSingleSignal from './SvgSingleSignal.vue'
import SvgService from '@/service/SvgService'
import SignalBruecker from './SignalBruecke.vue'
import axios from 'axios'
import { Options, Vue } from 'vue-class-component'
import { ISvgElement } from '@/model/SvgElement'
import SignalBruecke from './SignalBruecke.vue'
import SvgKatalog from './SvgKatalog.vue'
import SvgSingleSignal from './SvgSingleSignal.vue'

@Options({
components: {
SvgKatalog,
SvgSingleSignal,
SignalBruecker
SignalBruecke
},
created () {
this.setMode()
Expand Down
4 changes: 4 additions & 0 deletions web/siteplan/src/feature/FeatureInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ export function getFeatureLayerByType (type: FeatureType): FeatureLayerType {
return FeatureLayerType.Unknown
case FeatureType.TrackDirectionArrow:
return FeatureLayerType.TrackDirection
case FeatureType.Flash:
return FeatureLayerType.Flash
Comment on lines +109 to +110
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to add the Flash feature here. By start this Layer haven't any feature

default: throw new Error('Missing layer for type: ' + type)
}
}
Expand Down Expand Up @@ -194,6 +196,8 @@ export function getFeatureName (type: FeatureType): string {
return 'Unbekannt'
case FeatureType.TrackDirectionArrow:
return 'GleisausrichtungsPfeil'
case FeatureType.Flash:
return 'Flash' // TODO
Comment on lines +199 to +200
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, the flash layer shouldn`t avaible at the select layer side panel

default:
console.error('Missing name for type: ' + type)
return 'Unbenanntes Objekt'
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 @@ -55,6 +56,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

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