Skip to content

Commit

Permalink
fix(tDataSet): update confRev acc to IEC 61850-6
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobVogelsang committed Jul 23, 2024
1 parent ca32a34 commit d12fa50
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions tDataSet/dataset.testfiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ export const withSubscriptionSupervision = `
daName="VolSv.instMag.i"
fc="MX" />
</DataSet>
<GSEControl name="someGse" datSet="gseDatSet"/>
<GSEControl name="someGse2" datSet="gseDatSet"/>
<GSEControl name="someGse3" datSet="gseDatSet"/>
<GSEControl name="someGse" datSet="gseDatSet" confRev="340" />
<GSEControl name="someGse2" datSet="gseDatSet" confRev="342" />
<GSEControl name="someGse3" datSet="gseDatSet" confRev="344" />
<SampledValueControl name="someSmv" datSet="smvDataSet"/>
</LN0>
</LDevice>
Expand Down
8 changes: 4 additions & 4 deletions tDataSet/removeDataSet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe("Utility function to remove DataSet element", () => {
it("including the DataSet itself", () =>
expect((edits[0] as Remove).node).to.equal(dataSet));

it("including the external references itself", () => {
it("including the external references", () => {
expect((edits[1] as Remove).node).to.equal(extRefs[0]);
expect((edits[2] as Remove).node).to.equal(extRefs[1]);
expect((edits[3] as Remove).node).to.equal(extRefs[3]);
Expand All @@ -49,15 +49,15 @@ describe("Utility function to remove DataSet element", () => {
it("including control Block updates", () => {
expect((edits[7] as Update).attributes).to.deep.equal({
datSet: null,
confRev: "0",
confRev: "10340",
});
expect((edits[8] as Update).attributes).to.deep.equal({
datSet: null,
confRev: "0",
confRev: "10342",
});
expect((edits[9] as Update).attributes).to.deep.equal({
datSet: null,
confRev: "0",
confRev: "10344",
});
});
});
3 changes: 2 additions & 1 deletion tDataSet/removeDataSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Remove, Update } from "../foundation/utils.js";
import { controlBlocks } from "../tControl/controlBlocks.js";
import { fCDAsSubscription } from "../tFCDA/removeFCDA.js";
import { unsubscribe } from "../tExtRef/unsubscribe.js";
import { updatedConfRev } from "../tControl/updateConfRev.js";

/**
* Utility function to remove the element `DataSet`.
Expand All @@ -26,7 +27,7 @@ export function removeDataSet(remove: Remove): (Remove | Update)[] {
const ctrlBlockUpdates: (Remove | Update)[] = controlBlocks(dataSet).map(
(ctrlBlock) => ({
element: ctrlBlock,
attributes: { datSet: null, confRev: "0" },
attributes: { datSet: null, confRev: updatedConfRev(ctrlBlock) },
}),
);

Expand Down

0 comments on commit d12fa50

Please sign in to comment.