Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -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_LINKS]) {
return SignalMountType.SIGNALAUSLEGER_LINKS;
}
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 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.
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
Loading