Skip to content

Commit

Permalink
feat: added acd as a supported cdc type (#1371)
Browse files Browse the repository at this point in the history
Signed-off-by: Stef3st <steffen.van.den.driest@alliander.com>
  • Loading branch information
Stef3st authored Nov 27, 2023
1 parent dff67ba commit 5ee353c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 5 deletions.
30 changes: 29 additions & 1 deletion packages/open-scd/src/editors/protocol104/foundation/cdc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { get } from 'lit-translate';
* List of supported Common Data Classes in the 104 protocol.
*/
export const supportedCdcTypes = [
'ACD',
'ACT',
'APC',
'ASG',
Expand All @@ -49,7 +50,7 @@ export const supportedCdcTypes = [
'SPG',
'SPS',
] as const;
export type SupportedCdcType = typeof supportedCdcTypes[number];
export type SupportedCdcType = (typeof supportedCdcTypes)[number];

export type CreateFunction = (
lnElement: Element,
Expand Down Expand Up @@ -96,6 +97,33 @@ export const cdcProcessings: Record<
control: Record<string, TiInformation>;
}
> = {
ACD: {
monitor: {
'30': {
daPaths: [
{ path: ['general'] },
{ path: ['phsA'] },
{ path: ['phsB'] },
{ path: ['phsC'] },
{ path: ['neut'] },
],
create: createAddressAction,
inverted: true,
},
'40': {
daPaths: [
{ path: ['general'] },
{ path: ['phsA'] },
{ path: ['phsB'] },
{ path: ['phsC'] },
{ path: ['neut'] },
],
create: createAddressAction,
inverted: false,
},
},
control: {},
},
ACT: {
monitor: {
'30': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ snapshots["Wizards for 104 DOI Element show 104 DOI Basic Info with ctlModel (Kn
`;
/* end snapshot Wizards for 104 DOI Element show 104 DOI Basic Info with ctlModel (Known CDC Monitor and Control) looks like the latest snapshot */

snapshots["Wizards for 104 DOI Element show 104 DOI Basic Info (Unknown CDC) looks like the latest snapshot"] =
snapshots["Wizards for 104 DOI Element show 104 DOI Basic Info for CDC=ACD looks like the latest snapshot"] =
`<mwc-dialog
defaultaction="next"
heading="[protocol104.wizard.title.doiInfo]"
Expand Down Expand Up @@ -243,7 +243,13 @@ snapshots["Wizards for 104 DOI Element show 104 DOI Basic Info (Unknown CDC) loo
</wizard-textfield>
<wizard-textfield
disabled=""
label="Other TIs"
label="Available Monitor TIs"
readonly=""
>
</wizard-textfield>
<wizard-textfield
disabled=""
label="Found Monitor TIs"
readonly=""
>
</wizard-textfield>
Expand All @@ -257,5 +263,5 @@ snapshots["Wizards for 104 DOI Element show 104 DOI Basic Info (Unknown CDC) loo
</mwc-button>
</mwc-dialog>
`;
/* end snapshot Wizards for 104 DOI Element show 104 DOI Basic Info (Unknown CDC) looks like the latest snapshot */
/* end snapshot Wizards for 104 DOI Element show 104 DOI Basic Info for CDC=ACD looks like the latest snapshot */

Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,21 @@ describe('Wizards for 104 DOI Element', () => {
});
});

describe('show 104 DOI Basic Info (Unknown CDC)', () => {
describe('show 104 DOI Basic Info for CDC=ACD', () => {
beforeEach(async () => {
doiElement = doc.querySelector(
'IED[name="B1"] LN[lnType="SE_GAPC_SET_V001"] DOI[name="Str"]'
)!;

const doElement = doc
.querySelector('LNodeType[id="SE_GAPC_SET_V001"] > DO[name="Str"]')
?.getAttribute('type')!;

expect(doElement).to.be.equal('SE_ACD_V001');

const doType = doc.querySelector(`DOType[id="${doElement}"]`)!;
expect(doType.getAttribute('cdc')).to.be.equal('ACD');

const wizard = showDOIInfoWizard(doiElement);
element.workflow.push(() => wizard);
await element.requestUpdate();
Expand Down

0 comments on commit 5ee353c

Please sign in to comment.