From 2479076f04dd15b4d55b0c54a41c84dad1aa5b11 Mon Sep 17 00:00:00 2001 From: Daniel Mulholland Date: Wed, 28 Aug 2024 07:54:37 +1200 Subject: [PATCH] feat: Shorten VLAN naming and tidy nomenclature, closes #24 --- README.adoc | 4 ++-- oscd-tp-multicast-naming.ts | 23 +++++++++++------------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/README.adoc b/README.adoc index 37b32ad..ae5eee1 100644 --- a/README.adoc +++ b/README.adoc @@ -87,7 +87,7 @@ VLAN ID:: [cols="1*<.^,1*<.^,2*^.^,1*<.^",options="header,unbreakable"] |=== |Service Type -|Service Names +|Services |Prot1 VLAN Range |Prot2 VLAN Range |Comment @@ -119,7 +119,7 @@ VLAN ID:: [cols="1*<.^,1*<.^,2*^.^,1*<.^",options="header,unbreakable"] |=== |Service Type -|Service Name +|Services |Prot1 VLAN Range |Prot2 VLAN Range |Comment diff --git a/oscd-tp-multicast-naming.ts b/oscd-tp-multicast-naming.ts index 7226597..d1ad3cd 100644 --- a/oscd-tp-multicast-naming.ts +++ b/oscd-tp-multicast-naming.ts @@ -1106,16 +1106,16 @@ export default class TPMulticastNaming extends LitElement { controlName.startsWith('SPSBus') || controlName.startsWith('TCh') ) { - serviceName = 'Bus/Bay GOOSE Slow'; + serviceName = 'Slow'; useCase = 'Bus'; } else if (controlName.startsWith('Ctl')) { - serviceName = 'Bus/Bay GOOSE Fast'; + serviceName = 'Fast'; useCase = 'Bus'; } else if ( controlName.startsWith('ARecl') || controlName.startsWith('SwgrPos') ) { - serviceName = 'P1 to P2 ARecl/SwgrPos'; + serviceName = ''; serviceType = 'InterProt'; useCase = 'Bus'; } else if ( @@ -1124,14 +1124,13 @@ export default class TPMulticastNaming extends LitElement { smvIDFunction === 'Phase' || smvIDFunction === 'NCT_UB_ET') ) { - serviceName = 'Bus/Bay SV'; + serviceName = ''; useCase = 'Bus'; } // Allocate if adequate definition is not available if ( - serviceName && - serviceType && + serviceName !== undefined && useCase === 'Bus' && busName !== 'NOBUSES' ) { @@ -1218,20 +1217,20 @@ export default class TPMulticastNaming extends LitElement { controlName.startsWith('AdjBusCouplerInd') || controlName.startsWith('VReg') ) { - serviceName = 'Station GOOSE'; + serviceName = ''; useCase = 'Station'; } else if (serviceType === 'SMV' && smvIDFunction === 'VTSelStn') { - serviceName = 'Station SV'; + serviceName = ''; useCase = 'Station'; } // Allocate if adequate definition is not available - if (serviceName && serviceType && useCase === 'Station') { + if (serviceName !== undefined && useCase === 'Station') { const { stationVlans } = getAllocatedVlans(this.doc); - const existingVlans = stationVlans; - const existingVlan = existingVlans?.find( - vlan => vlan.serviceName === serviceName + const existingVlan = stationVlans?.find( + vlan => + vlan.serviceName === serviceName && vlan.serviceType === serviceType ); const vlanId =