Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Shorten VLAN naming and tidy nomenclature, closes #24 #31

Merged
merged 1 commit into from
Aug 28, 2024
Merged
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
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
23 changes: 11 additions & 12 deletions oscd-tp-multicast-naming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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'
) {
Expand Down Expand Up @@ -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 =
Expand Down
Loading