Skip to content

Commit

Permalink
feat: added acd as a supported ens type (#1384)
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 Dec 12, 2023
1 parent cb80080 commit cebcd37
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
16 changes: 16 additions & 0 deletions packages/open-scd/src/editors/protocol104/foundation/cdc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const supportedCdcTypes = [
'DPC',
'DPS',
'ENG',
'ENS',
'INC',
'ING',
'INS',
Expand Down Expand Up @@ -271,6 +272,21 @@ export const cdcProcessings: Record<
},
control: {},
},
ENS: {
monitor: {
'30': {
daPaths: [{ path: ['stVal'] }],
create: createAddressAction,
inverted: true,
},
'35': {
daPaths: [{ path: ['stVal'] }],
create: createAddressAction,
inverted: true,
},
},
control: {},
},
INC: {
monitor: {
'35': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ describe('data model nodes child getter', () => {
it('returns direct children for a SCL', () => {
const parent = doc.querySelector('SCL')!;
expect(getDataChildren(parent)).to.not.be.empty;
expect(getDataChildren(parent).length).to.be.equal(1);
expect(getDataChildren(parent).length).to.be.equal(3);
expect(getDataChildren(parent)[0].tagName).to.be.equal('IED');
expect(getDataChildren(parent)[1].tagName).to.be.equal('IED');
expect(getDataChildren(parent)[2].tagName).to.be.equal('IED');
expect(getDataChildren(parent)[0]).to.have.attribute('name', 'B1');
expect(getDataChildren(parent)[1]).to.have.attribute('name', 'B2');
expect(getDataChildren(parent)[2]).to.have.attribute('name', 'B3');
});

it('returns direct children for a IED', () => {
Expand All @@ -54,7 +58,7 @@ describe('data model nodes child getter', () => {
it('returns direct children for a LDevice', () => {
const parent = doc.querySelector('IED[name="B1"] LDevice[inst="LD0"]')!;
expect(getDataChildren(parent)).to.not.be.empty;
expect(getDataChildren(parent).length).to.be.equal(7);
expect(getDataChildren(parent).length).to.be.equal(10);
expect(getDataChildren(parent)[0].tagName).to.be.equal('LN0');
expect(getDataChildren(parent)[0]).to.have.attribute('lnClass', 'LLN0');
expect(getDataChildren(parent)[1].tagName).to.be.equal('LN');
Expand All @@ -66,9 +70,13 @@ describe('data model nodes child getter', () => {
'IED[name="B1"] LDevice[inst="LD0"] > LN0[lnClass="LLN0"]'
)!;
expect(getDataChildren(parent)).to.not.be.empty;
expect(getDataChildren(parent).length).to.equal(1);
expect(getDataChildren(parent).length).to.equal(3);
expect(getDataChildren(parent)[0].tagName).to.be.equal('DO');
expect(getDataChildren(parent)[0]).to.have.attribute('name', 'MltLev');
expect(getDataChildren(parent)[0]).to.have.attribute('name', 'Beh');
expect(getDataChildren(parent)[1].tagName).to.be.equal('DO');
expect(getDataChildren(parent)[1]).to.have.attribute('name', 'Health');
expect(getDataChildren(parent)[2].tagName).to.be.equal('DO');
expect(getDataChildren(parent)[2]).to.have.attribute('name', 'MltLev');
});
});

Expand Down

0 comments on commit cebcd37

Please sign in to comment.