Skip to content

Commit

Permalink
Tidy up naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
danyill committed Aug 24, 2023
1 parent 0da1e4a commit df1c7de
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 44 deletions.
23 changes: 13 additions & 10 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,22 @@ For SMV Traffic:
* Otherwise, the `smvID` is generated with the IED name, a forward slash and the value of `smvID`.

VLAN Priority::
* All GOOSE traffic is Priority 4
* All SMV traffic is Priority 5
* All GOOSE tripping messages (as defined by control block names beginning `Ctl` or `Trip`) have Priority 6.
* All other GOOSE traffic is Priority 5
* All SMV traffic is Priority 6

GSE `MinTime` and `MaxTime`::
* All tripping messages (as defined by control block names beginning `Ctl` or `Trip`) have a `MinTime` of 4 ms and a `MaxTime` of 1000 ms.
* All other messages have a `MinTime` of 100 ms and a `MaxTime` of 1000 ms.

VLAN ID::

* VLANs are allocated on the basis of the control block name for GSE and the `smvID` for SMV (after the trailing `/`)
* They are allocated as pairs for Prot1 and Prot2 at the same time. Prot1 and Prot2 are identified by the IED name ending in an even and odd number respectively.
* A VLAN is either substation wide or on a per primary system bus basis.
* For a Substation:
* Allocation as follows
+
--
.For a Substation
[cols="1*<.^,1*<.^,2*^.^,1*<.^",options="header,unbreakable"]
|===
|Service Type
Expand All @@ -91,12 +93,12 @@ VLAN ID::
|Comment

|P1 to P2 GOOSE
|?
|Nothing as yet.
2+|1050-1099
<.^|Nothing as yet...
<.^|Nothing as yet.

|GOOSE
|`EveTrig`, `ILock`, `CBFailInit`, `SPSBus`
|`ILock`, `CBFailInit`, `SPSBus`
|1000-1049
|2000-2049
|e.g. Interlocking, SPS schemes across a bus, event triggering, bus protection CB Fail initiate
Expand All @@ -108,8 +110,7 @@ VLAN ID::
|e.g. VT Selection, Synch Check and Deadline Charge, Remote Synch
|===

* For a Bus:
+
.For a Bus
[cols="1*<.^,1*<.^,2*^.^,1*<.^",options="header,unbreakable"]
|===
|Service Type
Expand All @@ -130,12 +131,14 @@ VLAN ID::
|Bus protection, SPS schemes within a bus

|(Bus and Bay Level) SV
|Just the IED name, `VTSelBus`
|Just the IED name,
`TEMPLATE`, `Phase`, `NCT_UB_ET`
|150-199
|250-299
|Bay protections

|===
--

* Buses are determine by a Function named `BusPhysConnection` under a Bay in the `Substation` section with a `name` which begins `Bus` followed by an underscore and the bus name.
** The bus `name` attribute is the definition of "bus" in the above.
Expand Down
70 changes: 36 additions & 34 deletions oscd-tp-multicast-naming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,10 @@ export default class TPMulticastNaming extends LitElement {

let smvIDFunction: string | undefined;
if (addr)
smvIDFunction = control.getAttribute('smvID')?.split('/')[1];
smvIDFunction = control
.getAttribute('smvID')
?.replace(`${iedName}`, '')
.replace('/', '');

const controlName = control.getAttribute('name')!;

Expand All @@ -1057,44 +1060,39 @@ export default class TPMulticastNaming extends LitElement {
if (
controlName.startsWith('Ctl') ||
controlName.startsWith('Ind') ||
controlName.startsWith('Test')
controlName.startsWith('Test') ||
controlName.startsWith('SPSBus')
) {
serviceName = 'Ctl/Ind/Test';
serviceName = 'Ctl/Ind/Test/SPS';
useCase = 'Bus';
} else if (controlName.startsWith('ARecl')) {
serviceName = 'ARecl';
serviceType = 'InterProt';
useCase = 'Bus';
} else if (controlName.startsWith('SwgrPos')) {
serviceName = 'SwgrPos';
} else if (
controlName.startsWith('ARecl') ||
controlName.startsWith('SwgrPos')
) {
serviceName = 'ARecl/SwgrPos';
serviceType = 'InterProt';
useCase = 'Bus';
} else if (controlName.startsWith('ILock')) {
serviceName = 'ILock';
useCase = 'Station';
} else if (controlName.startsWith('EveTrig')) {
serviceName = 'EveTrig';
useCase = 'Station';
} else if (controlName.startsWith('SPSBus')) {
serviceName = 'SPSBus';
useCase = 'Bus';
} else if (controlName.startsWith('SPSStn')) {
serviceName = 'SPSStn';
useCase = 'Station';
} else if (controlName.startsWith('CBFailInit')) {
serviceName = 'CBFailInit';
} else if (
controlName.startsWith('ILock') ||
controlName.startsWith('CBFailInit') ||
controlName.startsWith('SPSStn')
) {
serviceName = 'ILock/SPS/CBFailInit';
useCase = 'Station';
} else if (serviceType === 'SMV' && !smvIDFunction) {
serviceName = 'BusSV';
useCase = 'Bus';
} else if (serviceType === 'SMV' && smvIDFunction === 'VTSelBus') {
serviceName = 'VTSelBus';
} else if (
serviceType === 'SMV' &&
(smvIDFunction === '' ||
smvIDFunction === 'Phase' ||
smvIDFunction === 'NCT_UB_ET')
) {
serviceName = 'Bus: TEMPLATE, Phase, NCT_UB_ET';
useCase = 'Bus';
} else if (serviceType === 'SMV' && smvIDFunction === 'VTSelStn') {
serviceName = 'VTSelStn';
useCase = 'Station';
}

// Allocate if adequate definition is available
if (
serviceName &&
serviceType &&
Expand Down Expand Up @@ -1181,11 +1179,6 @@ export default class TPMulticastNaming extends LitElement {
edits = [];
}

// selectedCommElements.forEach(commElement => {

// console.log('hi');
// });

selectedCommElements.forEach(element => {
const protNum = getProtectionNumber(
element.closest('ConnectedAP')!.getAttribute('iedName')!
Expand Down Expand Up @@ -1242,7 +1235,16 @@ export default class TPMulticastNaming extends LitElement {
);

// PRIORITY
const priority = element.tagName === 'GSE' ? '4' : '5';
let priority: string = '5';
if (
element.tagName === 'SMV' ||
(element.tagName === 'GSE' &&
(element.getAttribute('cbName')?.toUpperCase().startsWith('CTL') ||
element.getAttribute('cbName')?.toUpperCase().startsWith('TRIP')))
) {
priority = '6';
}

edits.push(
...updateTextContent(
element.querySelector('Address > P[type="VLAN-PRIORITY"]'),
Expand Down

0 comments on commit df1c7de

Please sign in to comment.