@dialecte/scl 0.2.18 → 0.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{extensions-C_XbWugj.js → extensions-DDF6FezI.js} +991 -670
- package/dist/v2019C1/extensions/data-model/public.d.ts +2 -0
- package/dist/v2019C1/extensions/data-model/public.d.ts.map +1 -0
- package/dist/v2019C1/extensions/data-model/transaction/import-types.d.ts +21 -0
- package/dist/v2019C1/extensions/data-model/transaction/import-types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/data-model/transaction/import-types.types.d.ts +32 -0
- package/dist/v2019C1/extensions/data-model/transaction/import-types.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/data-model/transaction/index.d.ts +1 -1
- package/dist/v2019C1/extensions/data-model/transaction/index.d.ts.map +1 -1
- package/dist/v2019C1/extensions/extraction/index.d.ts +12 -0
- package/dist/v2019C1/extensions/extraction/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/extraction/public.d.ts +3 -0
- package/dist/v2019C1/extensions/extraction/public.d.ts.map +1 -0
- package/dist/v2019C1/extensions/extraction/transaction/deep.d.ts +19 -0
- package/dist/v2019C1/extensions/extraction/transaction/deep.d.ts.map +1 -0
- package/dist/v2019C1/extensions/extraction/transaction/deep.types.d.ts +36 -0
- package/dist/v2019C1/extensions/extraction/transaction/deep.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/extraction/transaction/index.d.ts +6 -0
- package/dist/v2019C1/extensions/extraction/transaction/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/extraction/transaction/primitives/clone-referenced.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{template/transaction/shared/clone-utils.d.ts → extraction/transaction/primitives/clone-tree.d.ts} +6 -3
- package/dist/v2019C1/extensions/extraction/transaction/primitives/clone-tree.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{template/transaction/shared/shared.types.d.ts → extraction/transaction/primitives/clone-tree.types.d.ts} +1 -6
- package/dist/v2019C1/extensions/extraction/transaction/primitives/clone-tree.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{template/transaction/shared → extraction/transaction/recipes/asd}/clone-application.d.ts +2 -2
- package/dist/v2019C1/extensions/extraction/transaction/recipes/asd/clone-application.d.ts.map +1 -0
- package/dist/v2019C1/extensions/extraction/transaction/recipes/asd/index.d.ts +2 -0
- package/dist/v2019C1/extensions/extraction/transaction/recipes/asd/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{template/transaction/asd/extract-to-asd.d.ts → extraction/transaction/recipes/asd/to-asd.d.ts} +3 -3
- package/dist/v2019C1/extensions/extraction/transaction/recipes/asd/to-asd.d.ts.map +1 -0
- package/dist/v2019C1/extensions/extraction/transaction/recipes/fsd/index.d.ts +2 -0
- package/dist/v2019C1/extensions/extraction/transaction/recipes/fsd/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/extraction/transaction/recipes/fsd/omit.d.ts +4 -0
- package/dist/v2019C1/extensions/extraction/transaction/recipes/fsd/omit.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{template/transaction/fsd/extract-to-fsd.d.ts → extraction/transaction/recipes/fsd/to-fsd.d.ts} +3 -3
- package/dist/v2019C1/extensions/extraction/transaction/recipes/fsd/to-fsd.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{template/transaction → extraction/transaction/recipes}/shared/clone-function.d.ts +1 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/clone-function.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{template/transaction → extraction/transaction/recipes/shared}/ensure-substation-structure.d.ts +1 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/ensure-substation-structure.d.ts.map +1 -0
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/omit-filters.d.ts +4 -0
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/omit-filters.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{template/transaction → extraction/transaction/recipes}/shared/post-extraction-cleanup.d.ts +1 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/post-extraction-cleanup.d.ts.map +1 -0
- package/dist/v2019C1/extensions/{template/transaction → extraction/transaction/recipes}/shared/resolve-structure-ref.d.ts +1 -1
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/resolve-structure-ref.d.ts.map +1 -0
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/shared.types.d.ts +7 -0
- package/dist/v2019C1/extensions/extraction/transaction/recipes/shared/shared.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/index.d.ts +6 -2
- package/dist/v2019C1/extensions/index.d.ts.map +1 -1
- package/dist/v2019C1/extensions/public.d.ts +5 -0
- package/dist/v2019C1/extensions/public.d.ts.map +1 -0
- package/dist/v2019C1/extensions/reference/constants/derived.d.ts +7 -0
- package/dist/v2019C1/extensions/reference/constants/derived.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/constants/helpers.d.ts +3 -1
- package/dist/v2019C1/extensions/reference/constants/helpers.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/constants/index.d.ts +2 -1
- package/dist/v2019C1/extensions/reference/constants/index.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/constants/type-id-pairs.d.ts +63 -0
- package/dist/v2019C1/extensions/reference/constants/type-id-pairs.d.ts.map +1 -0
- package/dist/v2019C1/extensions/reference/constants/types.d.ts +44 -0
- package/dist/v2019C1/extensions/reference/constants/types.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/guards.d.ts +4 -0
- package/dist/v2019C1/extensions/reference/guards.d.ts.map +1 -0
- package/dist/v2019C1/extensions/reference/index.d.ts +3 -3
- package/dist/v2019C1/extensions/reference/index.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/public.d.ts +5 -0
- package/dist/v2019C1/extensions/reference/public.d.ts.map +1 -0
- package/dist/v2019C1/extensions/reference/query/find/find-refs-pointing-to.d.ts +7 -4
- package/dist/v2019C1/extensions/reference/query/find/find-refs-pointing-to.d.ts.map +1 -1
- package/dist/v2019C1/extensions/reference/transaction/apply-type-id-remap.d.ts +17 -0
- package/dist/v2019C1/extensions/reference/transaction/apply-type-id-remap.d.ts.map +1 -0
- package/dist/v2019C1/extensions/reference/transaction/index.d.ts +2 -0
- package/dist/v2019C1/extensions/reference/transaction/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/signature/index.d.ts +5 -0
- package/dist/v2019C1/extensions/signature/index.d.ts.map +1 -0
- package/dist/v2019C1/extensions/signature/public.d.ts +3 -0
- package/dist/v2019C1/extensions/signature/public.d.ts.map +1 -0
- package/dist/v2019C1/extensions/signature/query/element-signature.constants.d.ts +3 -0
- package/dist/v2019C1/extensions/signature/query/element-signature.constants.d.ts.map +1 -0
- package/dist/v2019C1/extensions/signature/query/element-signature.d.ts +21 -0
- package/dist/v2019C1/extensions/signature/query/element-signature.d.ts.map +1 -0
- package/dist/v2019C1/extensions/signature/query/element-signature.types.d.ts +28 -0
- package/dist/v2019C1/extensions/signature/query/element-signature.types.d.ts.map +1 -0
- package/dist/v2019C1/extensions/signature/query/index.d.ts +3 -0
- package/dist/v2019C1/extensions/signature/query/index.d.ts.map +1 -0
- package/dist/v2019C1/hooks/after-created/private-wrapper.d.ts +4 -4
- package/dist/v2019C1/hooks/after-created/private-wrapper.d.ts.map +1 -1
- package/dist/v2019C1/index.d.ts +1 -0
- package/dist/v2019C1/index.d.ts.map +1 -1
- package/dist/v2019C1/index.js +8 -8
- package/dist/v2019C1/test/hydrated-test.d.ts +12 -4
- package/dist/v2019C1/test/hydrated-test.d.ts.map +1 -1
- package/dist/v2019C1/test.js +7 -7
- package/package.json +11 -3
- package/dist/v2019C1/extensions/data-model/transaction/extract.d.ts +0 -7
- package/dist/v2019C1/extensions/data-model/transaction/extract.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/index.d.ts +0 -5
- package/dist/v2019C1/extensions/template/index.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/asd/extract-to-asd.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/asd/index.d.ts +0 -2
- package/dist/v2019C1/extensions/template/transaction/asd/index.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/ensure-substation-structure.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/fsd/extract-to-fsd.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/fsd/index.d.ts +0 -2
- package/dist/v2019C1/extensions/template/transaction/fsd/index.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/index.d.ts +0 -4
- package/dist/v2019C1/extensions/template/transaction/index.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/shared/clone-application.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/shared/clone-function.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/shared/clone-referenced.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/shared/clone-utils.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/shared/extract-data-model.d.ts +0 -13
- package/dist/v2019C1/extensions/template/transaction/shared/extract-data-model.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/shared/omit-filters.d.ts +0 -5
- package/dist/v2019C1/extensions/template/transaction/shared/omit-filters.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/shared/post-extraction-cleanup.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/shared/resolve-structure-ref.d.ts.map +0 -1
- package/dist/v2019C1/extensions/template/transaction/shared/shared.types.d.ts.map +0 -1
- /package/dist/v2019C1/extensions/{template/transaction/shared → extraction/transaction/primitives}/clone-referenced.d.ts +0 -0
|
@@ -3702,13 +3702,13 @@ var o = Object.defineProperty, s = (e, t) => {
|
|
|
3702
3702
|
"SCL",
|
|
3703
3703
|
"Substation"
|
|
3704
3704
|
]
|
|
3705
|
-
},
|
|
3705
|
+
}, p = [
|
|
3706
3706
|
"Communication",
|
|
3707
3707
|
"DataTypeTemplates",
|
|
3708
3708
|
"Header",
|
|
3709
3709
|
"History",
|
|
3710
3710
|
"SCL"
|
|
3711
|
-
],
|
|
3711
|
+
], m = {
|
|
3712
3712
|
AccessControl: {},
|
|
3713
3713
|
AccessPoint: {
|
|
3714
3714
|
clock: "",
|
|
@@ -5161,7 +5161,7 @@ var o = Object.defineProperty, s = (e, t) => {
|
|
|
5161
5161
|
templateUuid: "",
|
|
5162
5162
|
uuid: ""
|
|
5163
5163
|
}
|
|
5164
|
-
},
|
|
5164
|
+
}, h = {
|
|
5165
5165
|
AccessControl: {
|
|
5166
5166
|
tag: "AccessControl",
|
|
5167
5167
|
namespace: {
|
|
@@ -24053,7 +24053,7 @@ var o = Object.defineProperty, s = (e, t) => {
|
|
|
24053
24053
|
};
|
|
24054
24054
|
//#endregion
|
|
24055
24055
|
//#region src/v2019C1/hooks/after-created/private-wrapper.ts
|
|
24056
|
-
async function
|
|
24056
|
+
async function g(e) {
|
|
24057
24057
|
let { childRecord: t, parentRecord: n, query: r } = e;
|
|
24058
24058
|
if (t.namespace.prefix === U.namespaces.default.prefix) return [];
|
|
24059
24059
|
let i = n.tagName === "Private", a = n.namespace.prefix === U.namespaces.default.prefix;
|
|
@@ -24062,26 +24062,26 @@ async function h(e) {
|
|
|
24062
24062
|
...n,
|
|
24063
24063
|
children: n.children.filter((e) => e.id !== t.id)
|
|
24064
24064
|
};
|
|
24065
|
-
return i ?
|
|
24065
|
+
return i ? _({
|
|
24066
24066
|
parentRecord: n,
|
|
24067
24067
|
childRecord: t,
|
|
24068
24068
|
query: r
|
|
24069
|
-
}) : o ?
|
|
24069
|
+
}) : o ? v({
|
|
24070
24070
|
existingPrivateRef: o,
|
|
24071
24071
|
parentRecord: n,
|
|
24072
24072
|
updatedParentRecord: s,
|
|
24073
24073
|
childRecord: t,
|
|
24074
24074
|
query: r
|
|
24075
|
-
}) : (await r.findAncestors(n)).some((e) => e.tagName === "Private" && e.attributes.some((e) => e.name === "type" && e.value === t.namespace.prefix)) ? [] :
|
|
24075
|
+
}) : (await r.findAncestors(n)).some((e) => e.tagName === "Private" && e.attributes.some((e) => e.name === "type" && e.value === t.namespace.prefix)) ? [] : y({
|
|
24076
24076
|
parentRecord: n,
|
|
24077
24077
|
updatedParentRecord: s,
|
|
24078
24078
|
childRecord: t
|
|
24079
24079
|
});
|
|
24080
24080
|
}
|
|
24081
|
-
async function
|
|
24081
|
+
async function _(e) {
|
|
24082
24082
|
let { parentRecord: t, childRecord: n, query: r } = e, o = t;
|
|
24083
24083
|
if (n.parent?.id === o.id && n.parent?.tagName === "Private") return [];
|
|
24084
|
-
let s = await
|
|
24084
|
+
let s = await b({
|
|
24085
24085
|
privateId: o.id,
|
|
24086
24086
|
query: r
|
|
24087
24087
|
});
|
|
@@ -24089,7 +24089,7 @@ async function g(e) {
|
|
|
24089
24089
|
detail: "Latest private record not found",
|
|
24090
24090
|
key: "ELEMENT_NOT_FOUND"
|
|
24091
24091
|
});
|
|
24092
|
-
let { childRecord: c, privateRecord: l } =
|
|
24092
|
+
let { childRecord: c, privateRecord: l } = x({
|
|
24093
24093
|
privateRecord: s,
|
|
24094
24094
|
childRecord: n
|
|
24095
24095
|
});
|
|
@@ -24103,8 +24103,8 @@ async function g(e) {
|
|
|
24103
24103
|
newRecord: i(l)
|
|
24104
24104
|
}];
|
|
24105
24105
|
}
|
|
24106
|
-
async function
|
|
24107
|
-
let { existingPrivateRef: t, parentRecord: n, updatedParentRecord: r, childRecord: o, query: s } = e, c = await
|
|
24106
|
+
async function v(e) {
|
|
24107
|
+
let { existingPrivateRef: t, parentRecord: n, updatedParentRecord: r, childRecord: o, query: s } = e, c = await b({
|
|
24108
24108
|
privateId: t.id,
|
|
24109
24109
|
query: s
|
|
24110
24110
|
});
|
|
@@ -24112,7 +24112,7 @@ async function _(e) {
|
|
|
24112
24112
|
detail: "Latest private record not found",
|
|
24113
24113
|
key: "ELEMENT_NOT_FOUND"
|
|
24114
24114
|
}), !c.attributes.some((e) => e.name === "type" && e.value === o.namespace.prefix)) return [];
|
|
24115
|
-
let { childRecord: l, privateRecord: u } =
|
|
24115
|
+
let { childRecord: l, privateRecord: u } = x({
|
|
24116
24116
|
privateRecord: c,
|
|
24117
24117
|
childRecord: o
|
|
24118
24118
|
});
|
|
@@ -24134,7 +24134,7 @@ async function _(e) {
|
|
|
24134
24134
|
}
|
|
24135
24135
|
];
|
|
24136
24136
|
}
|
|
24137
|
-
function
|
|
24137
|
+
function y(e) {
|
|
24138
24138
|
let { parentRecord: t, updatedParentRecord: n, childRecord: r } = e, a = {
|
|
24139
24139
|
id: crypto.randomUUID(),
|
|
24140
24140
|
tagName: "Private",
|
|
@@ -24183,14 +24183,14 @@ function v(e) {
|
|
|
24183
24183
|
}
|
|
24184
24184
|
];
|
|
24185
24185
|
}
|
|
24186
|
-
async function
|
|
24186
|
+
async function b(e) {
|
|
24187
24187
|
let { privateId: t, query: n } = e;
|
|
24188
24188
|
return await n.getRecord({
|
|
24189
24189
|
id: t,
|
|
24190
24190
|
tagName: "Private"
|
|
24191
24191
|
});
|
|
24192
24192
|
}
|
|
24193
|
-
function
|
|
24193
|
+
function x(e) {
|
|
24194
24194
|
let { privateRecord: t, childRecord: n } = e;
|
|
24195
24195
|
return {
|
|
24196
24196
|
childRecord: {
|
|
@@ -24211,7 +24211,7 @@ function b(e) {
|
|
|
24211
24211
|
}
|
|
24212
24212
|
//#endregion
|
|
24213
24213
|
//#region src/v2019C1/extensions/reference/constants/path-extraction.ts
|
|
24214
|
-
var
|
|
24214
|
+
var S = {
|
|
24215
24215
|
AccessPoint: { type: "transparent" },
|
|
24216
24216
|
Server: { type: "transparent" },
|
|
24217
24217
|
Private: { type: "transparent" },
|
|
@@ -24291,16 +24291,16 @@ var x = {
|
|
|
24291
24291
|
PowerSystemRelation: { type: "name" },
|
|
24292
24292
|
Variable: { type: "name" },
|
|
24293
24293
|
Process: { type: "name" }
|
|
24294
|
-
},
|
|
24294
|
+
}, ee = [
|
|
24295
24295
|
"lnClass",
|
|
24296
24296
|
"prefix",
|
|
24297
24297
|
"inst",
|
|
24298
24298
|
"lnInst"
|
|
24299
|
-
],
|
|
24299
|
+
], C = new Set(Object.values(S).flatMap((e) => {
|
|
24300
24300
|
switch (e.type) {
|
|
24301
24301
|
case "transparent": return [];
|
|
24302
24302
|
case "name": return ["name"];
|
|
24303
|
-
case "lnClass": return [...
|
|
24303
|
+
case "lnClass": return [...ee];
|
|
24304
24304
|
case "attribute": return [e.attr];
|
|
24305
24305
|
case "sourceRef": return [
|
|
24306
24306
|
"input",
|
|
@@ -24312,13 +24312,13 @@ var x = {
|
|
|
24312
24312
|
}));
|
|
24313
24313
|
//#endregion
|
|
24314
24314
|
//#region src/v2019C1/extensions/reference/query/build/path-segment.ts
|
|
24315
|
-
function
|
|
24315
|
+
function te(e) {
|
|
24316
24316
|
switch (e.type) {
|
|
24317
24317
|
case "transparent": return () => null;
|
|
24318
24318
|
case "name": {
|
|
24319
24319
|
let t = e.separator ?? "/";
|
|
24320
24320
|
return (e) => {
|
|
24321
|
-
let n =
|
|
24321
|
+
let n = T(e, "name");
|
|
24322
24322
|
return n ? {
|
|
24323
24323
|
segment: n,
|
|
24324
24324
|
separator: t
|
|
@@ -24326,34 +24326,34 @@ function ne(e) {
|
|
|
24326
24326
|
};
|
|
24327
24327
|
}
|
|
24328
24328
|
case "lnClass": return (e) => {
|
|
24329
|
-
let t =
|
|
24329
|
+
let t = T(e, "lnClass");
|
|
24330
24330
|
return t ? {
|
|
24331
|
-
segment: `${
|
|
24331
|
+
segment: `${T(e, "prefix") ?? ""}${t}${T(e, "inst") ?? T(e, "lnInst") ?? ""}`,
|
|
24332
24332
|
separator: "/"
|
|
24333
24333
|
} : null;
|
|
24334
24334
|
};
|
|
24335
24335
|
case "attribute": return (t) => {
|
|
24336
|
-
let n =
|
|
24336
|
+
let n = T(t, e.attr);
|
|
24337
24337
|
return n ? {
|
|
24338
24338
|
segment: n,
|
|
24339
24339
|
separator: e.separator
|
|
24340
24340
|
} : null;
|
|
24341
24341
|
};
|
|
24342
24342
|
case "sourceRef": return (e) => {
|
|
24343
|
-
let t =
|
|
24343
|
+
let t = T(e, "input");
|
|
24344
24344
|
if (!t) return null;
|
|
24345
|
-
let n = t, r =
|
|
24345
|
+
let n = t, r = T(e, "inputInst");
|
|
24346
24346
|
r && r !== "1" && (n += `(${r})`);
|
|
24347
|
-
let i =
|
|
24347
|
+
let i = T(e, "pDA");
|
|
24348
24348
|
return i && (n += `.${i}`), {
|
|
24349
24349
|
segment: n,
|
|
24350
24350
|
separator: "."
|
|
24351
24351
|
};
|
|
24352
24352
|
};
|
|
24353
24353
|
case "controlRef": return (e) => {
|
|
24354
|
-
let t =
|
|
24354
|
+
let t = T(e, "output");
|
|
24355
24355
|
if (!t) return null;
|
|
24356
|
-
let n = t, r =
|
|
24356
|
+
let n = t, r = T(e, "outputInst");
|
|
24357
24357
|
return r && r !== "1" && (n += `(${r})`), {
|
|
24358
24358
|
segment: n,
|
|
24359
24359
|
separator: "."
|
|
@@ -24361,15 +24361,15 @@ function ne(e) {
|
|
|
24361
24361
|
};
|
|
24362
24362
|
}
|
|
24363
24363
|
}
|
|
24364
|
-
var
|
|
24365
|
-
function
|
|
24366
|
-
let t =
|
|
24364
|
+
var ne = Object.fromEntries(Object.entries(S).map(([e, t]) => [e, te(t)]));
|
|
24365
|
+
function w(e) {
|
|
24366
|
+
let t = ne[e.tagName];
|
|
24367
24367
|
return t ? t(e) : null;
|
|
24368
24368
|
}
|
|
24369
|
-
function
|
|
24369
|
+
function re(e) {
|
|
24370
24370
|
let { record: t, ancestry: n } = e, r = [];
|
|
24371
24371
|
for (let e of n) {
|
|
24372
|
-
let t =
|
|
24372
|
+
let t = w(e);
|
|
24373
24373
|
t && r.push({
|
|
24374
24374
|
...t,
|
|
24375
24375
|
ref: {
|
|
@@ -24378,7 +24378,7 @@ function ie(e) {
|
|
|
24378
24378
|
}
|
|
24379
24379
|
});
|
|
24380
24380
|
}
|
|
24381
|
-
let i =
|
|
24381
|
+
let i = w(t);
|
|
24382
24382
|
return i && r.push({
|
|
24383
24383
|
...i,
|
|
24384
24384
|
ref: {
|
|
@@ -24386,32 +24386,32 @@ function ie(e) {
|
|
|
24386
24386
|
id: t.id
|
|
24387
24387
|
}
|
|
24388
24388
|
}), r.length === 0 ? null : {
|
|
24389
|
-
path:
|
|
24389
|
+
path: ie(r),
|
|
24390
24390
|
segments: r
|
|
24391
24391
|
};
|
|
24392
24392
|
}
|
|
24393
|
-
function
|
|
24393
|
+
function T(e, t) {
|
|
24394
24394
|
return e.attributes.find((e) => e.name === t)?.value;
|
|
24395
24395
|
}
|
|
24396
|
-
function
|
|
24396
|
+
function ie(e) {
|
|
24397
24397
|
let t = e[0].segment;
|
|
24398
24398
|
for (let n = 1; n < e.length; n++) t += e[n].separator + e[n].segment;
|
|
24399
24399
|
return t;
|
|
24400
24400
|
}
|
|
24401
24401
|
//#endregion
|
|
24402
24402
|
//#region src/v2019C1/extensions/reference/query/build/build-element-path.ts
|
|
24403
|
-
async function
|
|
24403
|
+
async function ae(e, t) {
|
|
24404
24404
|
let n = await e.getRecord(t);
|
|
24405
24405
|
if (!n) return null;
|
|
24406
24406
|
let r = await e.findAncestors(t, { order: "top-down" });
|
|
24407
|
-
return
|
|
24407
|
+
return re({
|
|
24408
24408
|
record: i(n),
|
|
24409
24409
|
ancestry: r.map(i)
|
|
24410
24410
|
});
|
|
24411
24411
|
}
|
|
24412
24412
|
//#endregion
|
|
24413
24413
|
//#region src/v2019C1/extensions/reference/query/resolve/parse-path.ts
|
|
24414
|
-
function
|
|
24414
|
+
function oe(e) {
|
|
24415
24415
|
if (!e) return [];
|
|
24416
24416
|
let t = [], n = "", r = "/";
|
|
24417
24417
|
for (let i of e) i === "/" || i === "." ? (n && t.push({
|
|
@@ -24423,7 +24423,7 @@ function D(e) {
|
|
|
24423
24423
|
separator: r
|
|
24424
24424
|
}), t;
|
|
24425
24425
|
}
|
|
24426
|
-
function
|
|
24426
|
+
function E(e) {
|
|
24427
24427
|
let t = e.split("/"), n = t[t.length - 1], r = n.indexOf(".");
|
|
24428
24428
|
if (r === -1) return { path: e };
|
|
24429
24429
|
let i = n.substring(0, r), a = n.substring(r + 1);
|
|
@@ -24432,19 +24432,19 @@ function O(e) {
|
|
|
24432
24432
|
qualifier: a || void 0
|
|
24433
24433
|
};
|
|
24434
24434
|
}
|
|
24435
|
-
function
|
|
24436
|
-
return !e || e ===
|
|
24435
|
+
function se(e, t, n, r) {
|
|
24436
|
+
return !e || e === k.unsupported ? null : e === k.direct ? { lookupKey: n } : e === k.iedAddress ? le(n, r) : e === k.lnode ? ce(n) : e === k.behaviorDescription ? ue(t, n, r) : null;
|
|
24437
24437
|
}
|
|
24438
|
-
function
|
|
24439
|
-
let { path: t, qualifier: n } =
|
|
24438
|
+
function ce(e) {
|
|
24439
|
+
let { path: t, qualifier: n } = E(e);
|
|
24440
24440
|
return {
|
|
24441
24441
|
lookupKey: t,
|
|
24442
24442
|
qualifier: n
|
|
24443
24443
|
};
|
|
24444
24444
|
}
|
|
24445
|
-
function
|
|
24445
|
+
function le(e, t) {
|
|
24446
24446
|
if (t) {
|
|
24447
|
-
let n =
|
|
24447
|
+
let n = pe(t);
|
|
24448
24448
|
if (n) return {
|
|
24449
24449
|
lookupKey: e,
|
|
24450
24450
|
fallbackLookupKey: `${n}/${e}`
|
|
@@ -24452,15 +24452,15 @@ function oe(e, t) {
|
|
|
24452
24452
|
}
|
|
24453
24453
|
return { lookupKey: e };
|
|
24454
24454
|
}
|
|
24455
|
-
function
|
|
24455
|
+
function ue(e, t, n) {
|
|
24456
24456
|
if (!n) return null;
|
|
24457
|
-
let r =
|
|
24457
|
+
let r = de(n);
|
|
24458
24458
|
return r ? e === "dataName" ? {
|
|
24459
24459
|
lookupKey: r,
|
|
24460
24460
|
qualifier: t
|
|
24461
|
-
} : e === "inputName" || e === "outputName" ? { lookupKey: `${r}.${
|
|
24461
|
+
} : e === "inputName" || e === "outputName" ? { lookupKey: `${r}.${fe(t)}` } : null : null;
|
|
24462
24462
|
}
|
|
24463
|
-
function
|
|
24463
|
+
function de(e) {
|
|
24464
24464
|
let t = -1;
|
|
24465
24465
|
for (let n = e.length - 1; n >= 0; n--) if (e[n].tagName === "BehaviorDescription") {
|
|
24466
24466
|
t = n;
|
|
@@ -24469,75 +24469,75 @@ function ce(e) {
|
|
|
24469
24469
|
if (t === -1) return null;
|
|
24470
24470
|
let n = [];
|
|
24471
24471
|
for (let r = 0; r < t; r++) {
|
|
24472
|
-
let t =
|
|
24472
|
+
let t = w(e[r]);
|
|
24473
24473
|
t && n.push(t);
|
|
24474
24474
|
}
|
|
24475
|
-
return n.length === 0 ? null :
|
|
24475
|
+
return n.length === 0 ? null : ie(n);
|
|
24476
24476
|
}
|
|
24477
|
-
function
|
|
24477
|
+
function fe(e) {
|
|
24478
24478
|
let t = e.indexOf("("), n = e.indexOf(".");
|
|
24479
24479
|
return t === -1 ? n === -1 ? e : e.substring(0, n) : e.substring(0, t);
|
|
24480
24480
|
}
|
|
24481
|
-
function
|
|
24481
|
+
function pe(e) {
|
|
24482
24482
|
for (let t = e.length - 1; t >= 0; t--) if (e[t].tagName === "LNode") return e[t].attributes.find((e) => e.name === "iedName")?.value ?? null;
|
|
24483
24483
|
return null;
|
|
24484
24484
|
}
|
|
24485
24485
|
//#endregion
|
|
24486
24486
|
//#region src/v2019C1/extensions/reference/query/build/build-reference-path.ts
|
|
24487
|
-
async function
|
|
24488
|
-
let { reference: n, target: r } = t, a =
|
|
24487
|
+
async function me(e, t) {
|
|
24488
|
+
let { reference: n, target: r } = t, a = he(n.tagName, r.tagName);
|
|
24489
24489
|
if (!a) return null;
|
|
24490
24490
|
let o = a.resolution;
|
|
24491
|
-
if (o ===
|
|
24492
|
-
if (o ===
|
|
24491
|
+
if (o === k.unsupported) return null;
|
|
24492
|
+
if (o === k.behaviorDescription) {
|
|
24493
24493
|
let t = await e.getRecord(r);
|
|
24494
|
-
return t ?
|
|
24494
|
+
return t ? w(i(t))?.segment ?? null : null;
|
|
24495
24495
|
}
|
|
24496
|
-
let s = await
|
|
24496
|
+
let s = await ae(e, r);
|
|
24497
24497
|
if (!s) return null;
|
|
24498
24498
|
let c = s.path;
|
|
24499
|
-
if (o ===
|
|
24499
|
+
if (o === k.lnode) {
|
|
24500
24500
|
let t = await e.getRecord(n);
|
|
24501
24501
|
if (!t) return c;
|
|
24502
24502
|
let r = t.attributes.find((e) => e.name === a.attribute.path)?.value;
|
|
24503
24503
|
if (!r) return c;
|
|
24504
|
-
let { qualifier: i } =
|
|
24504
|
+
let { qualifier: i } = E(r);
|
|
24505
24505
|
return i ? `${c}.${i}` : c;
|
|
24506
24506
|
}
|
|
24507
24507
|
return c;
|
|
24508
24508
|
}
|
|
24509
|
-
function
|
|
24510
|
-
let n =
|
|
24509
|
+
function he(e, t) {
|
|
24510
|
+
let n = A[e];
|
|
24511
24511
|
return n ? n.find((e) => e.target.includes(t)) ?? null : null;
|
|
24512
24512
|
}
|
|
24513
24513
|
//#endregion
|
|
24514
24514
|
//#region src/v2019C1/extensions/reference/query/build/build-mapped-lnode-path.ts
|
|
24515
|
-
function
|
|
24515
|
+
function ge(e) {
|
|
24516
24516
|
let t = e.iedName;
|
|
24517
|
-
if (!t || t ===
|
|
24517
|
+
if (!t || t === _e) return null;
|
|
24518
24518
|
let n = e.ldInst, r = e.lnClass;
|
|
24519
24519
|
return !n || !r ? null : `${t}/${n}/${`${e.prefix ?? ""}${r}${e.lnInst ?? ""}`}`;
|
|
24520
24520
|
}
|
|
24521
|
-
var
|
|
24521
|
+
var _e = "None";
|
|
24522
24522
|
//#endregion
|
|
24523
24523
|
//#region src/v2019C1/extensions/reference/query/resolve/resolve-reference-path.ts
|
|
24524
|
-
async function
|
|
24525
|
-
let r =
|
|
24524
|
+
async function ve(e, t, n) {
|
|
24525
|
+
let r = ye(t.tagName, n);
|
|
24526
24526
|
if (!r) return;
|
|
24527
24527
|
let a = t.attributes.find((e) => e.name === n)?.value;
|
|
24528
24528
|
if (!a) return;
|
|
24529
|
-
let o = await
|
|
24529
|
+
let o = await be(e, t, r);
|
|
24530
24530
|
if (o) return {
|
|
24531
24531
|
record: o,
|
|
24532
|
-
qualifier:
|
|
24532
|
+
qualifier: xe(r, n, a)
|
|
24533
24533
|
};
|
|
24534
24534
|
let s;
|
|
24535
|
-
(r.resolution ===
|
|
24536
|
-
let c =
|
|
24535
|
+
(r.resolution === k.behaviorDescription || r.resolution === k.iedAddress) && (s = (await e.findAncestors(t, { order: "top-down" })).map((e) => i(e)));
|
|
24536
|
+
let c = se(r.resolution, n, a, s);
|
|
24537
24537
|
if (!c) return;
|
|
24538
|
-
let l =
|
|
24538
|
+
let l = oe(c.lookupKey);
|
|
24539
24539
|
if (l.length === 0) return;
|
|
24540
|
-
let u = l[l.length - 1], d = l.slice(0, -1), f = await
|
|
24540
|
+
let u = l[l.length - 1], d = l.slice(0, -1), f = await Te({
|
|
24541
24541
|
query: e,
|
|
24542
24542
|
targets: r.target,
|
|
24543
24543
|
segment: u,
|
|
@@ -24548,11 +24548,11 @@ async function pe(e, t, n) {
|
|
|
24548
24548
|
qualifier: c.qualifier
|
|
24549
24549
|
};
|
|
24550
24550
|
}
|
|
24551
|
-
function
|
|
24552
|
-
let n =
|
|
24551
|
+
function ye(e, t) {
|
|
24552
|
+
let n = A[e];
|
|
24553
24553
|
if (n) return n.find((e) => e.attribute.path === t);
|
|
24554
24554
|
}
|
|
24555
|
-
async function
|
|
24555
|
+
async function be(e, t, n) {
|
|
24556
24556
|
let r = n.attribute.uuid, i = t.attributes.find((e) => e.name === r)?.value;
|
|
24557
24557
|
if (i) for (let t of n.target) {
|
|
24558
24558
|
let n = await e.findByAttributes({
|
|
@@ -24562,19 +24562,19 @@ async function he(e, t, n) {
|
|
|
24562
24562
|
if (n.length > 0) return n[0];
|
|
24563
24563
|
}
|
|
24564
24564
|
}
|
|
24565
|
-
function
|
|
24566
|
-
if (e.resolution ===
|
|
24567
|
-
if (e.resolution ===
|
|
24565
|
+
function xe(e, t, n) {
|
|
24566
|
+
if (e.resolution === k.lnode) return E(n).qualifier;
|
|
24567
|
+
if (e.resolution === k.behaviorDescription && t === "dataName") return n;
|
|
24568
24568
|
}
|
|
24569
|
-
var
|
|
24569
|
+
var Se = new Set(h.LNode.attributes.details.lnClass.facets.enumeration), Ce = {
|
|
24570
24570
|
LNode: "lnInst",
|
|
24571
24571
|
LN: "inst",
|
|
24572
24572
|
LN0: "inst"
|
|
24573
24573
|
};
|
|
24574
|
-
function
|
|
24574
|
+
function we(e) {
|
|
24575
24575
|
for (let t = 0; t <= e.length - 4; t++) {
|
|
24576
24576
|
let n = e.substring(t, t + 4);
|
|
24577
|
-
if (
|
|
24577
|
+
if (Se.has(n)) return {
|
|
24578
24578
|
prefix: e.substring(0, t),
|
|
24579
24579
|
lnClass: n,
|
|
24580
24580
|
inst: e.substring(t + 4)
|
|
@@ -24582,12 +24582,12 @@ function ye(e) {
|
|
|
24582
24582
|
}
|
|
24583
24583
|
return null;
|
|
24584
24584
|
}
|
|
24585
|
-
async function
|
|
24585
|
+
async function Te(e) {
|
|
24586
24586
|
let { query: t, targets: n, segment: r, expectedAncestry: i } = e;
|
|
24587
24587
|
for (let e of n) {
|
|
24588
|
-
let n =
|
|
24588
|
+
let n = Ce[e];
|
|
24589
24589
|
if (n) {
|
|
24590
|
-
let a = await
|
|
24590
|
+
let a = await Ee({
|
|
24591
24591
|
query: t,
|
|
24592
24592
|
tagName: e,
|
|
24593
24593
|
segment: r,
|
|
@@ -24596,7 +24596,7 @@ async function be(e) {
|
|
|
24596
24596
|
});
|
|
24597
24597
|
if (a) return a;
|
|
24598
24598
|
} else {
|
|
24599
|
-
let n = await
|
|
24599
|
+
let n = await De({
|
|
24600
24600
|
query: t,
|
|
24601
24601
|
tagName: e,
|
|
24602
24602
|
segment: r,
|
|
@@ -24606,8 +24606,8 @@ async function be(e) {
|
|
|
24606
24606
|
}
|
|
24607
24607
|
}
|
|
24608
24608
|
}
|
|
24609
|
-
async function
|
|
24610
|
-
let { query: t, tagName: n, segment: r, instAttr: i, expectedAncestry: a } = e, o =
|
|
24609
|
+
async function Ee(e) {
|
|
24610
|
+
let { query: t, tagName: n, segment: r, instAttr: i, expectedAncestry: a } = e, o = we(r.segment);
|
|
24611
24611
|
if (!o) return;
|
|
24612
24612
|
let s = await t.findByAttributes({
|
|
24613
24613
|
tagName: n,
|
|
@@ -24615,37 +24615,37 @@ async function xe(e) {
|
|
|
24615
24615
|
});
|
|
24616
24616
|
for (let e of s) {
|
|
24617
24617
|
let n = e.attributes.find((e) => e.name === "prefix")?.value ?? "", r = e.attributes.find((e) => e.name === i)?.value ?? "";
|
|
24618
|
-
if (!(n !== o.prefix || r !== o.inst) && await
|
|
24618
|
+
if (!(n !== o.prefix || r !== o.inst) && await Oe(t, e, a)) return e;
|
|
24619
24619
|
}
|
|
24620
24620
|
}
|
|
24621
|
-
async function
|
|
24621
|
+
async function De(e) {
|
|
24622
24622
|
let { query: t, tagName: n, segment: r, expectedAncestry: a } = e, o = await t.getRecordsByTagName(n);
|
|
24623
24623
|
for (let e of o) {
|
|
24624
|
-
let n =
|
|
24625
|
-
if (!(!n || n.segment !== r.segment) && await
|
|
24624
|
+
let n = w(i(e));
|
|
24625
|
+
if (!(!n || n.segment !== r.segment) && await Oe(t, e, a)) return e;
|
|
24626
24626
|
}
|
|
24627
24627
|
}
|
|
24628
|
-
async function
|
|
24628
|
+
async function Oe(e, t, n) {
|
|
24629
24629
|
if (n.length === 0) return !0;
|
|
24630
24630
|
let r = await e.findAncestors(t), a = [];
|
|
24631
24631
|
for (let e = r.length - 1; e >= 0; e--) {
|
|
24632
|
-
let t =
|
|
24632
|
+
let t = w(i(r[e]));
|
|
24633
24633
|
t && a.push(t);
|
|
24634
24634
|
}
|
|
24635
24635
|
return a.length === n.length ? a.every((e, t) => e.segment === n[t].segment) : !1;
|
|
24636
24636
|
}
|
|
24637
24637
|
//#endregion
|
|
24638
24638
|
//#region src/v2019C1/extensions/reference/query/resolve/resolve-element-path.ts
|
|
24639
|
-
async function
|
|
24640
|
-
let n =
|
|
24641
|
-
if (n.length !== 0) return
|
|
24639
|
+
async function D(e, t) {
|
|
24640
|
+
let n = oe(t);
|
|
24641
|
+
if (n.length !== 0) return O({
|
|
24642
24642
|
query: e,
|
|
24643
24643
|
current: await e.getRoot(),
|
|
24644
24644
|
segments: n,
|
|
24645
24645
|
index: 0
|
|
24646
24646
|
});
|
|
24647
24647
|
}
|
|
24648
|
-
async function
|
|
24648
|
+
async function O(e) {
|
|
24649
24649
|
let { query: t, current: n, segments: r, index: a } = e;
|
|
24650
24650
|
if (a >= r.length) return n;
|
|
24651
24651
|
let o = n.children ?? [];
|
|
@@ -24653,9 +24653,9 @@ async function M(e) {
|
|
|
24653
24653
|
let s = await t.getRecords(o), c = r[a];
|
|
24654
24654
|
for (let e of s) {
|
|
24655
24655
|
if (!e) continue;
|
|
24656
|
-
let n =
|
|
24656
|
+
let n = w(i(e));
|
|
24657
24657
|
if (!n) {
|
|
24658
|
-
let n = await
|
|
24658
|
+
let n = await O({
|
|
24659
24659
|
query: t,
|
|
24660
24660
|
current: e,
|
|
24661
24661
|
segments: r,
|
|
@@ -24665,7 +24665,7 @@ async function M(e) {
|
|
|
24665
24665
|
continue;
|
|
24666
24666
|
}
|
|
24667
24667
|
if (n.segment === c.segment && n.separator === c.separator) {
|
|
24668
|
-
let n = await
|
|
24668
|
+
let n = await O({
|
|
24669
24669
|
query: t,
|
|
24670
24670
|
current: e,
|
|
24671
24671
|
segments: r,
|
|
@@ -24678,14 +24678,14 @@ async function M(e) {
|
|
|
24678
24678
|
}
|
|
24679
24679
|
//#endregion
|
|
24680
24680
|
//#region src/v2019C1/extensions/reference/query/resolve/resolve-mapped-lnode.ts
|
|
24681
|
-
var
|
|
24682
|
-
async function
|
|
24683
|
-
let n =
|
|
24681
|
+
var ke = new Set(["LN", "LN0"]);
|
|
24682
|
+
async function Ae(e, t) {
|
|
24683
|
+
let n = ge(je(t));
|
|
24684
24684
|
if (!n) return;
|
|
24685
|
-
let r = await
|
|
24686
|
-
if (!(!r || !
|
|
24685
|
+
let r = await D(e, n);
|
|
24686
|
+
if (!(!r || !ke.has(r.tagName))) return r;
|
|
24687
24687
|
}
|
|
24688
|
-
function
|
|
24688
|
+
function je(e) {
|
|
24689
24689
|
let t = (t) => e.attributes.find((e) => e.name === t)?.value;
|
|
24690
24690
|
return {
|
|
24691
24691
|
iedName: t("iedName"),
|
|
@@ -24697,13 +24697,13 @@ function De(e) {
|
|
|
24697
24697
|
}
|
|
24698
24698
|
//#endregion
|
|
24699
24699
|
//#region src/v2019C1/extensions/reference/constants/resolution-types.ts
|
|
24700
|
-
var
|
|
24700
|
+
var k = {
|
|
24701
24701
|
direct: "direct",
|
|
24702
24702
|
lnode: "lnode",
|
|
24703
24703
|
iedAddress: "ied-address",
|
|
24704
24704
|
behaviorDescription: "behavior-description",
|
|
24705
24705
|
unsupported: "unsupported"
|
|
24706
|
-
},
|
|
24706
|
+
}, A = {
|
|
24707
24707
|
AllocationRoleRef: [{
|
|
24708
24708
|
attribute: {
|
|
24709
24709
|
path: "allocationRole",
|
|
@@ -25072,10 +25072,61 @@ var N = {
|
|
|
25072
25072
|
target: ["Variable"],
|
|
25073
25073
|
companions: []
|
|
25074
25074
|
}]
|
|
25075
|
+
}, j = {
|
|
25076
|
+
LN: [{
|
|
25077
|
+
attribute: "lnType",
|
|
25078
|
+
target: "LNodeType"
|
|
25079
|
+
}],
|
|
25080
|
+
LN0: [{
|
|
25081
|
+
attribute: "lnType",
|
|
25082
|
+
target: "LNodeType"
|
|
25083
|
+
}],
|
|
25084
|
+
LNode: [{
|
|
25085
|
+
attribute: "lnType",
|
|
25086
|
+
target: "LNodeType"
|
|
25087
|
+
}],
|
|
25088
|
+
DO: [{
|
|
25089
|
+
attribute: "type",
|
|
25090
|
+
target: "DOType"
|
|
25091
|
+
}],
|
|
25092
|
+
SDO: [{
|
|
25093
|
+
attribute: "type",
|
|
25094
|
+
target: "DOType"
|
|
25095
|
+
}],
|
|
25096
|
+
DA: [{
|
|
25097
|
+
attribute: "type",
|
|
25098
|
+
target: "EnumType",
|
|
25099
|
+
when: {
|
|
25100
|
+
attribute: "bType",
|
|
25101
|
+
equals: "Enum"
|
|
25102
|
+
}
|
|
25103
|
+
}, {
|
|
25104
|
+
attribute: "type",
|
|
25105
|
+
target: "DAType",
|
|
25106
|
+
when: {
|
|
25107
|
+
attribute: "bType",
|
|
25108
|
+
equals: "Struct"
|
|
25109
|
+
}
|
|
25110
|
+
}],
|
|
25111
|
+
BDA: [{
|
|
25112
|
+
attribute: "type",
|
|
25113
|
+
target: "EnumType",
|
|
25114
|
+
when: {
|
|
25115
|
+
attribute: "bType",
|
|
25116
|
+
equals: "Enum"
|
|
25117
|
+
}
|
|
25118
|
+
}, {
|
|
25119
|
+
attribute: "type",
|
|
25120
|
+
target: "DAType",
|
|
25121
|
+
when: {
|
|
25122
|
+
attribute: "bType",
|
|
25123
|
+
equals: "Struct"
|
|
25124
|
+
}
|
|
25125
|
+
}]
|
|
25075
25126
|
};
|
|
25076
25127
|
//#endregion
|
|
25077
25128
|
//#region src/v2019C1/extensions/reference/constants/helpers.ts
|
|
25078
|
-
function
|
|
25129
|
+
function Me(e) {
|
|
25079
25130
|
let t = {};
|
|
25080
25131
|
for (let [n, r] of Object.entries(e)) for (let e of r) {
|
|
25081
25132
|
let r = t[e.resolution] ??= /* @__PURE__ */ new Map();
|
|
@@ -25090,7 +25141,7 @@ function Oe(e) {
|
|
|
25090
25141
|
}
|
|
25091
25142
|
return t;
|
|
25092
25143
|
}
|
|
25093
|
-
function
|
|
25144
|
+
function Ne(e) {
|
|
25094
25145
|
let t = /* @__PURE__ */ new Map();
|
|
25095
25146
|
for (let [n, r] of Object.entries(e)) t.set(n, r.map((e) => ({
|
|
25096
25147
|
uuidAttr: e.attribute.uuid,
|
|
@@ -25100,18 +25151,26 @@ function ke(e) {
|
|
|
25100
25151
|
})));
|
|
25101
25152
|
return t;
|
|
25102
25153
|
}
|
|
25154
|
+
function Pe(e) {
|
|
25155
|
+
let t = /* @__PURE__ */ new Map();
|
|
25156
|
+
for (let [n, r] of Object.entries(e)) for (let e of r) {
|
|
25157
|
+
let r = t.get(e.target) ?? [];
|
|
25158
|
+
r.push({
|
|
25159
|
+
refTagName: n,
|
|
25160
|
+
attribute: e.attribute,
|
|
25161
|
+
when: e.when
|
|
25162
|
+
}), t.set(e.target, r);
|
|
25163
|
+
}
|
|
25164
|
+
return t;
|
|
25165
|
+
}
|
|
25103
25166
|
//#endregion
|
|
25104
25167
|
//#region src/v2019C1/extensions/reference/constants/derived.ts
|
|
25105
|
-
var
|
|
25106
|
-
|
|
25107
|
-
|
|
25108
|
-
|
|
25109
|
-
|
|
25110
|
-
],
|
|
25111
|
-
[...new Set(Object.values(P).flatMap((e) => e.map((e) => e.attribute.uuid)))];
|
|
25112
|
-
//#endregion
|
|
25113
|
-
//#region src/v2019C1/extensions/reference/constants/orphan-rules.ts
|
|
25114
|
-
var F = new Set([
|
|
25168
|
+
var M = Me(A), N = [
|
|
25169
|
+
k.direct,
|
|
25170
|
+
k.lnode,
|
|
25171
|
+
k.iedAddress,
|
|
25172
|
+
k.behaviorDescription
|
|
25173
|
+
], P = Ne(A), Fe = [...new Set(Object.values(A).flatMap((e) => e.map((e) => e.attribute.uuid)))], F = new Map(Object.entries(j).map(([e, t]) => [e, [...new Set(t.map((e) => e.attribute))]])), I = Pe(j), Ie = new Set(I.keys()), L = new Set([
|
|
25115
25174
|
"SourceRef",
|
|
25116
25175
|
"ControlRef",
|
|
25117
25176
|
"DOS",
|
|
@@ -25120,63 +25179,119 @@ var F = new Set([
|
|
|
25120
25179
|
"InputVar",
|
|
25121
25180
|
"OutputVar",
|
|
25122
25181
|
"ProcessEcho"
|
|
25123
|
-
]),
|
|
25182
|
+
]), Le = {
|
|
25124
25183
|
FunctionCatRef: ["SubCategory", "FunctionCategory"],
|
|
25125
25184
|
PowerSystemRelation: ["PowerSystemRelations"],
|
|
25126
25185
|
Resource: ["ProcessResource", "ProcessResources"],
|
|
25127
25186
|
VariableApplyTo: ["Variable"]
|
|
25128
25187
|
};
|
|
25129
25188
|
//#endregion
|
|
25189
|
+
//#region src/v2019C1/extensions/reference/guards.ts
|
|
25190
|
+
function Re(e) {
|
|
25191
|
+
return Ie.has(e);
|
|
25192
|
+
}
|
|
25193
|
+
//#endregion
|
|
25130
25194
|
//#region src/v2019C1/extensions/reference/query/find/find-refs-pointing-to.ts
|
|
25131
|
-
async function
|
|
25132
|
-
let { target:
|
|
25133
|
-
|
|
25134
|
-
|
|
25135
|
-
|
|
25136
|
-
let
|
|
25137
|
-
if (
|
|
25138
|
-
let
|
|
25139
|
-
|
|
25195
|
+
async function ze(e, t) {
|
|
25196
|
+
let { target: n, containerTagName: r } = t, i = await e.getRecord(n);
|
|
25197
|
+
return i ? Re(i.tagName) ? Ve(e, i, r) : Be(e, i, r) : [];
|
|
25198
|
+
}
|
|
25199
|
+
async function Be(e, t, r) {
|
|
25200
|
+
let i = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
25201
|
+
if (!i) return [];
|
|
25202
|
+
let a = Ue(t.tagName);
|
|
25203
|
+
if (a.length === 0) return [];
|
|
25204
|
+
let o = [];
|
|
25205
|
+
for (let t of a) {
|
|
25140
25206
|
if (!n(t.refTagName, U)) continue;
|
|
25141
|
-
let
|
|
25207
|
+
let a = await e.findByAttributes({
|
|
25142
25208
|
tagName: t.refTagName,
|
|
25143
|
-
attributes: { [t.uuidAttr]:
|
|
25209
|
+
attributes: { [t.uuidAttr]: i }
|
|
25144
25210
|
});
|
|
25145
|
-
for (let t of
|
|
25146
|
-
let n =
|
|
25147
|
-
|
|
25211
|
+
for (let t of a) {
|
|
25212
|
+
let n = r ? await We(e, t, r) : void 0;
|
|
25213
|
+
o.push({
|
|
25148
25214
|
ref: t,
|
|
25149
25215
|
container: n
|
|
25150
25216
|
});
|
|
25151
25217
|
}
|
|
25152
25218
|
}
|
|
25153
|
-
return
|
|
25219
|
+
return o;
|
|
25220
|
+
}
|
|
25221
|
+
async function Ve(e, t, r) {
|
|
25222
|
+
let i = t.attributes.find((e) => e.name === "id")?.value;
|
|
25223
|
+
if (!i) return [];
|
|
25224
|
+
let a = I.get(t.tagName) ?? [], o = [];
|
|
25225
|
+
for (let t of a) {
|
|
25226
|
+
if (!n(t.refTagName, U)) continue;
|
|
25227
|
+
let a = await e.findByAttributes({
|
|
25228
|
+
tagName: t.refTagName,
|
|
25229
|
+
attributes: { [t.attribute]: i }
|
|
25230
|
+
});
|
|
25231
|
+
for (let n of a) {
|
|
25232
|
+
if (!He(n, t)) continue;
|
|
25233
|
+
let i = r ? await We(e, n, r) : void 0;
|
|
25234
|
+
o.push({
|
|
25235
|
+
ref: n,
|
|
25236
|
+
container: i
|
|
25237
|
+
});
|
|
25238
|
+
}
|
|
25239
|
+
}
|
|
25240
|
+
return o;
|
|
25241
|
+
}
|
|
25242
|
+
function He(e, t) {
|
|
25243
|
+
return t.when ? e.attributes.find((e) => e.name === t.when.attribute)?.value === t.when.equals : !0;
|
|
25154
25244
|
}
|
|
25155
|
-
function
|
|
25245
|
+
function Ue(e) {
|
|
25156
25246
|
let t = [];
|
|
25157
|
-
for (let n of
|
|
25158
|
-
let r =
|
|
25247
|
+
for (let n of N) {
|
|
25248
|
+
let r = M[n].get(e);
|
|
25159
25249
|
r && t.push(...r);
|
|
25160
25250
|
}
|
|
25161
25251
|
return t;
|
|
25162
25252
|
}
|
|
25163
|
-
async function
|
|
25253
|
+
async function We(e, t, n) {
|
|
25164
25254
|
return (await e.findAncestors(t, { stopAtTagName: n })).find((e) => e.tagName === n);
|
|
25165
25255
|
}
|
|
25166
25256
|
//#endregion
|
|
25257
|
+
//#region src/v2019C1/extensions/reference/query/index.ts
|
|
25258
|
+
var Ge = /* @__PURE__ */ s({
|
|
25259
|
+
buildElementPath: () => ae,
|
|
25260
|
+
buildMappedLNodePath: () => ge,
|
|
25261
|
+
buildReferencePath: () => me,
|
|
25262
|
+
findRefsPointingTo: () => ze,
|
|
25263
|
+
resolveElementPath: () => D,
|
|
25264
|
+
resolveMappedLNode: () => Ae,
|
|
25265
|
+
resolveReferencePath: () => ve
|
|
25266
|
+
});
|
|
25267
|
+
//#endregion
|
|
25268
|
+
//#region src/v2019C1/extensions/reference/transaction/apply-type-id-remap.ts
|
|
25269
|
+
async function Ke(e, t) {
|
|
25270
|
+
let { records: n, idRemap: r } = t;
|
|
25271
|
+
if (r.size !== 0) for (let t of n) {
|
|
25272
|
+
let n = F.get(t.tagName);
|
|
25273
|
+
if (!n) continue;
|
|
25274
|
+
let i = await e.getRecord(t);
|
|
25275
|
+
if (!i) continue;
|
|
25276
|
+
let a = {};
|
|
25277
|
+
for (let e of n) {
|
|
25278
|
+
let t = i.attributes.find((t) => t.name === e)?.value;
|
|
25279
|
+
if (!t) continue;
|
|
25280
|
+
let n = r.get(t);
|
|
25281
|
+
n !== void 0 && n !== t && (a[e] = n);
|
|
25282
|
+
}
|
|
25283
|
+
Object.keys(a).length > 0 && await e.update(i, { attributes: a });
|
|
25284
|
+
}
|
|
25285
|
+
}
|
|
25286
|
+
//#endregion
|
|
25167
25287
|
//#region src/v2019C1/extensions/reference/index.ts
|
|
25168
|
-
var
|
|
25169
|
-
|
|
25170
|
-
|
|
25171
|
-
|
|
25172
|
-
findRefsPointingTo: () => Pe,
|
|
25173
|
-
resolveElementPath: () => we,
|
|
25174
|
-
resolveMappedLNode: () => Ee,
|
|
25175
|
-
resolveReferencePath: () => pe
|
|
25176
|
-
}) };
|
|
25288
|
+
var R = {
|
|
25289
|
+
query: Ge,
|
|
25290
|
+
transaction: /* @__PURE__ */ s({ applyTypeIdRemap: () => Ke })
|
|
25291
|
+
};
|
|
25177
25292
|
//#endregion
|
|
25178
25293
|
//#region src/v2019C1/hooks/shared/ref-entry-ops.ts
|
|
25179
|
-
async function
|
|
25294
|
+
async function z(e) {
|
|
25180
25295
|
let { uuid: t, entry: r, target: a, query: o } = e;
|
|
25181
25296
|
if (!n(r.refTagName, U)) return [];
|
|
25182
25297
|
let s = await o.getRecordsByTagName(r.refTagName), c = [];
|
|
@@ -25185,7 +25300,7 @@ async function L(e) {
|
|
|
25185
25300
|
let n = {
|
|
25186
25301
|
tagName: e.tagName,
|
|
25187
25302
|
id: e.id
|
|
25188
|
-
}, s = await
|
|
25303
|
+
}, s = await R.query.buildReferencePath(o, {
|
|
25189
25304
|
reference: n,
|
|
25190
25305
|
target: a
|
|
25191
25306
|
});
|
|
@@ -25205,32 +25320,32 @@ async function L(e) {
|
|
|
25205
25320
|
}
|
|
25206
25321
|
return c;
|
|
25207
25322
|
}
|
|
25208
|
-
function
|
|
25323
|
+
function B(e) {
|
|
25209
25324
|
let t = [];
|
|
25210
|
-
for (let n of
|
|
25211
|
-
let r =
|
|
25325
|
+
for (let n of N) {
|
|
25326
|
+
let r = M[n].get(e);
|
|
25212
25327
|
r && t.push(...r);
|
|
25213
25328
|
}
|
|
25214
25329
|
return t;
|
|
25215
25330
|
}
|
|
25216
25331
|
//#endregion
|
|
25217
25332
|
//#region src/v2019C1/hooks/after-created/ref-paths.ts
|
|
25218
|
-
async function
|
|
25219
|
-
let { childRecord: t, query: n } = e, r = await
|
|
25333
|
+
async function qe(e) {
|
|
25334
|
+
let { childRecord: t, query: n } = e, r = await Je({
|
|
25220
25335
|
childRecord: t,
|
|
25221
25336
|
query: n
|
|
25222
|
-
}), i = await
|
|
25337
|
+
}), i = await Ze({
|
|
25223
25338
|
childRecord: t,
|
|
25224
25339
|
query: n
|
|
25225
25340
|
});
|
|
25226
25341
|
return [...r, ...i];
|
|
25227
25342
|
}
|
|
25228
|
-
async function
|
|
25229
|
-
let { childRecord: t, query: n } = e, r =
|
|
25343
|
+
async function Je(e) {
|
|
25344
|
+
let { childRecord: t, query: n } = e, r = P.get(t.tagName);
|
|
25230
25345
|
if (!r?.length) return [];
|
|
25231
25346
|
let i = [];
|
|
25232
25347
|
for (let e of r) {
|
|
25233
|
-
let r = await
|
|
25348
|
+
let r = await Ye({
|
|
25234
25349
|
childRecord: t,
|
|
25235
25350
|
pair: e,
|
|
25236
25351
|
query: n
|
|
@@ -25239,16 +25354,16 @@ async function Re(e) {
|
|
|
25239
25354
|
}
|
|
25240
25355
|
return i;
|
|
25241
25356
|
}
|
|
25242
|
-
async function
|
|
25357
|
+
async function Ye(e) {
|
|
25243
25358
|
let { childRecord: t, pair: n, query: r } = e, i = t.attributes.find((e) => e.name === n.uuidAttr)?.value;
|
|
25244
25359
|
if (!i) return null;
|
|
25245
|
-
let a = await
|
|
25360
|
+
let a = await Xe({
|
|
25246
25361
|
uuidValue: i,
|
|
25247
25362
|
targetTagNames: n.targetTagNames,
|
|
25248
25363
|
query: r
|
|
25249
25364
|
});
|
|
25250
25365
|
if (!a) return null;
|
|
25251
|
-
let o = await
|
|
25366
|
+
let o = await me(r, {
|
|
25252
25367
|
reference: {
|
|
25253
25368
|
tagName: t.tagName,
|
|
25254
25369
|
id: t.id
|
|
@@ -25272,7 +25387,7 @@ async function ze(e) {
|
|
|
25272
25387
|
}
|
|
25273
25388
|
};
|
|
25274
25389
|
}
|
|
25275
|
-
async function
|
|
25390
|
+
async function Xe(e) {
|
|
25276
25391
|
let { uuidValue: t, targetTagNames: r, query: i } = e;
|
|
25277
25392
|
for (let e of r) {
|
|
25278
25393
|
if (!n(e, U)) continue;
|
|
@@ -25284,17 +25399,17 @@ async function Be(e) {
|
|
|
25284
25399
|
}
|
|
25285
25400
|
return null;
|
|
25286
25401
|
}
|
|
25287
|
-
async function
|
|
25402
|
+
async function Ze(e) {
|
|
25288
25403
|
let { childRecord: t, query: n } = e, r = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
25289
25404
|
if (!r) return [];
|
|
25290
|
-
let i =
|
|
25405
|
+
let i = B(t.tagName);
|
|
25291
25406
|
if (i.length === 0) return [];
|
|
25292
25407
|
let a = {
|
|
25293
25408
|
tagName: t.tagName,
|
|
25294
25409
|
id: t.id
|
|
25295
25410
|
}, o = [];
|
|
25296
25411
|
for (let e of i) {
|
|
25297
|
-
let t = await
|
|
25412
|
+
let t = await z({
|
|
25298
25413
|
uuid: r,
|
|
25299
25414
|
entry: e,
|
|
25300
25415
|
target: a,
|
|
@@ -25306,12 +25421,12 @@ async function Ve(e) {
|
|
|
25306
25421
|
}
|
|
25307
25422
|
//#endregion
|
|
25308
25423
|
//#region src/v2019C1/hooks/after-created/after-created.ts
|
|
25309
|
-
async function
|
|
25310
|
-
let { childRecord: t, parentRecord: n, query: r } = e, i = await
|
|
25424
|
+
async function Qe(e) {
|
|
25425
|
+
let { childRecord: t, parentRecord: n, query: r } = e, i = await g({
|
|
25311
25426
|
childRecord: t,
|
|
25312
25427
|
parentRecord: n,
|
|
25313
25428
|
query: r
|
|
25314
|
-
}), a = await
|
|
25429
|
+
}), a = await qe({
|
|
25315
25430
|
childRecord: t,
|
|
25316
25431
|
query: r
|
|
25317
25432
|
});
|
|
@@ -25319,12 +25434,12 @@ async function He(e) {
|
|
|
25319
25434
|
}
|
|
25320
25435
|
//#endregion
|
|
25321
25436
|
//#region src/v2019C1/hooks/after-deep-clone/ref-paths.ts
|
|
25322
|
-
async function
|
|
25323
|
-
let { cumulativeCloneMappings: t, query: n } = e, { uuidMap: r, uuidToRef: i } = await
|
|
25437
|
+
async function $e(e) {
|
|
25438
|
+
let { cumulativeCloneMappings: t, query: n } = e, { uuidMap: r, uuidToRef: i } = await et(t, n);
|
|
25324
25439
|
if (r.size === 0) return [];
|
|
25325
25440
|
let a = [];
|
|
25326
25441
|
for (let { target: e } of t) {
|
|
25327
|
-
let t = await
|
|
25442
|
+
let t = await nt({
|
|
25328
25443
|
target: e,
|
|
25329
25444
|
uuidMap: r,
|
|
25330
25445
|
uuidToRef: i,
|
|
@@ -25334,9 +25449,9 @@ async function Ue(e) {
|
|
|
25334
25449
|
}
|
|
25335
25450
|
return a;
|
|
25336
25451
|
}
|
|
25337
|
-
async function
|
|
25452
|
+
async function et(e, t) {
|
|
25338
25453
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
25339
|
-
for (let { source: i, target: a } of e) await
|
|
25454
|
+
for (let { source: i, target: a } of e) await tt({
|
|
25340
25455
|
source: i,
|
|
25341
25456
|
target: a,
|
|
25342
25457
|
query: t,
|
|
@@ -25348,7 +25463,7 @@ async function We(e, t) {
|
|
|
25348
25463
|
uuidToRef: r
|
|
25349
25464
|
};
|
|
25350
25465
|
}
|
|
25351
|
-
async function
|
|
25466
|
+
async function tt(e) {
|
|
25352
25467
|
let { source: t, target: n, query: r, uuidMap: i, uuidToRef: a } = e, o = await r.getRecord(n);
|
|
25353
25468
|
if (!o) return;
|
|
25354
25469
|
let s = t.attributes.find((e) => e.name === "uuid")?.value, c = o.attributes.find((e) => e.name === "uuid")?.value;
|
|
@@ -25357,14 +25472,14 @@ async function Ge(e) {
|
|
|
25357
25472
|
id: o.id
|
|
25358
25473
|
}));
|
|
25359
25474
|
}
|
|
25360
|
-
async function
|
|
25475
|
+
async function nt(e) {
|
|
25361
25476
|
let { target: t, uuidMap: n, uuidToRef: r, query: a } = e, o = t.tagName;
|
|
25362
|
-
if (!(o in
|
|
25477
|
+
if (!(o in A)) return null;
|
|
25363
25478
|
let s = await a.getRecord(t);
|
|
25364
25479
|
if (!s) return null;
|
|
25365
|
-
let c =
|
|
25480
|
+
let c = A[o], l = [...s.attributes], u = !1;
|
|
25366
25481
|
for (let e of c) {
|
|
25367
|
-
let t = await
|
|
25482
|
+
let t = await rt({
|
|
25368
25483
|
pair: e,
|
|
25369
25484
|
tagName: o,
|
|
25370
25485
|
refId: s.id,
|
|
@@ -25384,14 +25499,14 @@ async function Ke(e) {
|
|
|
25384
25499
|
})
|
|
25385
25500
|
} : null;
|
|
25386
25501
|
}
|
|
25387
|
-
async function
|
|
25502
|
+
async function rt(e) {
|
|
25388
25503
|
let { pair: t, tagName: n, refId: r, uuidMap: i, uuidToRef: a, query: o } = e, s = [...e.updatedAttributes], c = s.find((e) => e.name === t.attribute.uuid)?.value;
|
|
25389
25504
|
if (!c) return null;
|
|
25390
25505
|
let l = i.get(c);
|
|
25391
25506
|
if (!l) return null;
|
|
25392
|
-
let u = !1, d =
|
|
25507
|
+
let u = !1, d = it(s, t.attribute.uuid, c, l);
|
|
25393
25508
|
d && (s = d, u = !0);
|
|
25394
|
-
let f = await
|
|
25509
|
+
let f = await at({
|
|
25395
25510
|
attributes: s,
|
|
25396
25511
|
pathAttrName: t.attribute.path,
|
|
25397
25512
|
newUuid: l,
|
|
@@ -25402,16 +25517,16 @@ async function qe(e) {
|
|
|
25402
25517
|
});
|
|
25403
25518
|
return f && (s = f, u = !0), u ? s : null;
|
|
25404
25519
|
}
|
|
25405
|
-
function
|
|
25520
|
+
function it(e, t, n, r) {
|
|
25406
25521
|
return r === n ? null : e.map((e) => e.name === t ? {
|
|
25407
25522
|
...e,
|
|
25408
25523
|
value: r
|
|
25409
25524
|
} : e);
|
|
25410
25525
|
}
|
|
25411
|
-
async function
|
|
25526
|
+
async function at(e) {
|
|
25412
25527
|
let { attributes: t, pathAttrName: n, newUuid: r, uuidToRef: i, tagName: a, refId: o, query: s } = e, c = i.get(r);
|
|
25413
25528
|
if (!c) return null;
|
|
25414
|
-
let l = await
|
|
25529
|
+
let l = await R.query.buildReferencePath(s, {
|
|
25415
25530
|
reference: {
|
|
25416
25531
|
tagName: a,
|
|
25417
25532
|
id: o
|
|
@@ -25428,12 +25543,12 @@ async function Ye(e) {
|
|
|
25428
25543
|
}
|
|
25429
25544
|
//#endregion
|
|
25430
25545
|
//#region src/v2019C1/hooks/after-deep-clone/after-deep-clone.ts
|
|
25431
|
-
async function
|
|
25432
|
-
return
|
|
25546
|
+
async function ot(e) {
|
|
25547
|
+
return $e(e);
|
|
25433
25548
|
}
|
|
25434
25549
|
//#endregion
|
|
25435
25550
|
//#region src/v2019C1/hooks/after-standardized-record/uuid-attribute.ts
|
|
25436
|
-
function
|
|
25551
|
+
function st(e) {
|
|
25437
25552
|
let { record: t } = e, { tagName: n, attributes: r } = t, i = U.definition[n];
|
|
25438
25553
|
if (!("uuid" in i.attributes.details) || r.find((e) => e.name === "uuid")?.value) return t;
|
|
25439
25554
|
let a = i.attributes.details.uuid?.namespace, o = r.filter((e) => e.name !== "uuid");
|
|
@@ -25448,20 +25563,20 @@ function Ze(e) {
|
|
|
25448
25563
|
}
|
|
25449
25564
|
//#endregion
|
|
25450
25565
|
//#region src/v2019C1/hooks/after-standardized-record/after-standardized-record.ts
|
|
25451
|
-
function
|
|
25452
|
-
return
|
|
25566
|
+
function ct(e) {
|
|
25567
|
+
return st(e);
|
|
25453
25568
|
}
|
|
25454
25569
|
//#endregion
|
|
25455
25570
|
//#region src/v2019C1/hooks/after-updated/ref-paths.ts
|
|
25456
|
-
async function
|
|
25571
|
+
async function lt(e) {
|
|
25457
25572
|
let { oldRecord: t, newRecord: n, query: r } = e, i = [], a = n.attributes.find((e) => e.name === "uuid")?.value;
|
|
25458
25573
|
if (a) {
|
|
25459
|
-
let e =
|
|
25574
|
+
let e = B(n.tagName), t = {
|
|
25460
25575
|
tagName: n.tagName,
|
|
25461
25576
|
id: n.id
|
|
25462
25577
|
};
|
|
25463
25578
|
for (let n of e) {
|
|
25464
|
-
let e = await
|
|
25579
|
+
let e = await z({
|
|
25465
25580
|
uuid: a,
|
|
25466
25581
|
entry: n,
|
|
25467
25582
|
target: t,
|
|
@@ -25470,8 +25585,8 @@ async function $e(e) {
|
|
|
25470
25585
|
i.push(...e);
|
|
25471
25586
|
}
|
|
25472
25587
|
}
|
|
25473
|
-
if (
|
|
25474
|
-
let e = await
|
|
25588
|
+
if (ut(t, n)) {
|
|
25589
|
+
let e = await dt({
|
|
25475
25590
|
newRecord: n,
|
|
25476
25591
|
query: r
|
|
25477
25592
|
});
|
|
@@ -25479,11 +25594,11 @@ async function $e(e) {
|
|
|
25479
25594
|
}
|
|
25480
25595
|
return i;
|
|
25481
25596
|
}
|
|
25482
|
-
function
|
|
25483
|
-
for (let n of
|
|
25597
|
+
function ut(e, t) {
|
|
25598
|
+
for (let n of C) if (e.attributes.find((e) => e.name === n)?.value !== t.attributes.find((e) => e.name === n)?.value) return !0;
|
|
25484
25599
|
return !1;
|
|
25485
25600
|
}
|
|
25486
|
-
async function
|
|
25601
|
+
async function dt(e) {
|
|
25487
25602
|
let { newRecord: t, query: n } = e, r = {
|
|
25488
25603
|
tagName: t.tagName,
|
|
25489
25604
|
id: t.id
|
|
@@ -25492,14 +25607,14 @@ async function tt(e) {
|
|
|
25492
25607
|
if (r.id === t.id) continue;
|
|
25493
25608
|
let e = await n.any.getAttribute(r, { name: "uuid" });
|
|
25494
25609
|
if (!e) continue;
|
|
25495
|
-
let i =
|
|
25610
|
+
let i = B(r.tagName);
|
|
25496
25611
|
if (i.length === 0) continue;
|
|
25497
25612
|
let o = {
|
|
25498
25613
|
tagName: r.tagName,
|
|
25499
25614
|
id: r.id
|
|
25500
25615
|
};
|
|
25501
25616
|
for (let t of i) {
|
|
25502
|
-
let r = await
|
|
25617
|
+
let r = await z({
|
|
25503
25618
|
uuid: e,
|
|
25504
25619
|
entry: t,
|
|
25505
25620
|
target: o,
|
|
@@ -25512,12 +25627,12 @@ async function tt(e) {
|
|
|
25512
25627
|
}
|
|
25513
25628
|
//#endregion
|
|
25514
25629
|
//#region src/v2019C1/hooks/after-updated/after-updated.ts
|
|
25515
|
-
async function
|
|
25516
|
-
return
|
|
25630
|
+
async function ft(e) {
|
|
25631
|
+
return lt(e);
|
|
25517
25632
|
}
|
|
25518
25633
|
//#endregion
|
|
25519
25634
|
//#region src/v2019C1/hooks/before-clone/before-clone.ts
|
|
25520
|
-
function
|
|
25635
|
+
function pt(e) {
|
|
25521
25636
|
let { record: t } = e, n = !0;
|
|
25522
25637
|
t.tagName === "Private" && !t.tree.length && (n = !1);
|
|
25523
25638
|
let r = t.attributes.filter((e) => e.name !== "uuid");
|
|
@@ -25531,17 +25646,17 @@ function rt(e) {
|
|
|
25531
25646
|
}
|
|
25532
25647
|
//#endregion
|
|
25533
25648
|
//#region src/v2019C1/hooks/before-delete/orphaned-refs.ts
|
|
25534
|
-
async function
|
|
25649
|
+
async function mt(e) {
|
|
25535
25650
|
let { record: t, query: n } = e, r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
25536
|
-
if (await
|
|
25651
|
+
if (await V({
|
|
25537
25652
|
record: t,
|
|
25538
25653
|
query: n,
|
|
25539
25654
|
ids: r,
|
|
25540
25655
|
uuids: i
|
|
25541
25656
|
}), i.size === 0) return [];
|
|
25542
|
-
let a = [], o = Object.keys(
|
|
25657
|
+
let a = [], o = Object.keys(A);
|
|
25543
25658
|
for (let e of o) {
|
|
25544
|
-
let t = await
|
|
25659
|
+
let t = await ht({
|
|
25545
25660
|
refTagName: e,
|
|
25546
25661
|
subtreeIds: r,
|
|
25547
25662
|
subtreeUuids: i,
|
|
@@ -25551,11 +25666,11 @@ async function it(e) {
|
|
|
25551
25666
|
}
|
|
25552
25667
|
return a;
|
|
25553
25668
|
}
|
|
25554
|
-
async function
|
|
25555
|
-
let { refTagName: t, subtreeIds: n, subtreeUuids: r, query: i } = e, a =
|
|
25669
|
+
async function ht(e) {
|
|
25670
|
+
let { refTagName: t, subtreeIds: n, subtreeUuids: r, query: i } = e, a = A[t], o = await i.getRecordsByTagName(t), s = [];
|
|
25556
25671
|
for (let e of o) {
|
|
25557
25672
|
if (n.has(e.id)) continue;
|
|
25558
|
-
let o = await
|
|
25673
|
+
let o = await gt({
|
|
25559
25674
|
refTagName: t,
|
|
25560
25675
|
refRecord: e,
|
|
25561
25676
|
refPairs: a,
|
|
@@ -25566,15 +25681,15 @@ async function at(e) {
|
|
|
25566
25681
|
}
|
|
25567
25682
|
return s;
|
|
25568
25683
|
}
|
|
25569
|
-
async function
|
|
25570
|
-
let { refTagName: t, refRecord: n, refPairs: r, subtreeUuids: i, query: a } = e, o =
|
|
25684
|
+
async function gt(e) {
|
|
25685
|
+
let { refTagName: t, refRecord: n, refPairs: r, subtreeUuids: i, query: a } = e, o = _t({
|
|
25571
25686
|
refPairs: r,
|
|
25572
25687
|
refRecord: n,
|
|
25573
25688
|
subtreeUuids: i
|
|
25574
25689
|
});
|
|
25575
|
-
return o.size === 0 ? [] :
|
|
25690
|
+
return o.size === 0 ? [] : L.has(t) ? [vt(n, o)] : yt(n, a);
|
|
25576
25691
|
}
|
|
25577
|
-
function
|
|
25692
|
+
function _t(e) {
|
|
25578
25693
|
let { refPairs: t, refRecord: n, subtreeUuids: r } = e, i = /* @__PURE__ */ new Set();
|
|
25579
25694
|
for (let e of t) {
|
|
25580
25695
|
let t = n.attributes.find((t) => t.name === e.attribute.uuid)?.value;
|
|
@@ -25585,7 +25700,7 @@ function st(e) {
|
|
|
25585
25700
|
}
|
|
25586
25701
|
return i;
|
|
25587
25702
|
}
|
|
25588
|
-
function
|
|
25703
|
+
function vt(e, t) {
|
|
25589
25704
|
let n = e.attributes.filter((e) => !t.has(e.name));
|
|
25590
25705
|
return {
|
|
25591
25706
|
status: "updated",
|
|
@@ -25596,7 +25711,7 @@ function ct(e, t) {
|
|
|
25596
25711
|
})
|
|
25597
25712
|
};
|
|
25598
25713
|
}
|
|
25599
|
-
async function
|
|
25714
|
+
async function yt(e, t) {
|
|
25600
25715
|
let n = [{
|
|
25601
25716
|
status: "deleted",
|
|
25602
25717
|
oldRecord: i(e),
|
|
@@ -25618,14 +25733,14 @@ async function lt(e, t) {
|
|
|
25618
25733
|
}
|
|
25619
25734
|
return n;
|
|
25620
25735
|
}
|
|
25621
|
-
async function
|
|
25736
|
+
async function V(e) {
|
|
25622
25737
|
let { record: t, query: n, ids: r, uuids: i } = e;
|
|
25623
25738
|
r.add(t.id);
|
|
25624
25739
|
let a = t.attributes.find((e) => e.name === "uuid")?.value;
|
|
25625
25740
|
a && i.add(a);
|
|
25626
25741
|
for (let e of t.children) {
|
|
25627
25742
|
let t = await n.getRecord(e);
|
|
25628
|
-
t && await
|
|
25743
|
+
t && await V({
|
|
25629
25744
|
record: t,
|
|
25630
25745
|
query: n,
|
|
25631
25746
|
ids: r,
|
|
@@ -25635,31 +25750,31 @@ async function z(e) {
|
|
|
25635
25750
|
}
|
|
25636
25751
|
//#endregion
|
|
25637
25752
|
//#region src/v2019C1/hooks/before-delete/before-delete.ts
|
|
25638
|
-
async function
|
|
25639
|
-
return
|
|
25753
|
+
async function bt(e) {
|
|
25754
|
+
return mt(e);
|
|
25640
25755
|
}
|
|
25641
25756
|
//#endregion
|
|
25642
25757
|
//#region src/v2019C1/hooks/io/io-hooks.ts
|
|
25643
|
-
function
|
|
25758
|
+
function xt() {
|
|
25644
25759
|
let e = /* @__PURE__ */ new Map(), t = [], n = [];
|
|
25645
25760
|
return {
|
|
25646
25761
|
beforeImportRecord: (r) => {
|
|
25647
|
-
let { record: i, ancestry: a } = r, { tagName: o } = i, s =
|
|
25648
|
-
if (s &&
|
|
25649
|
-
let t =
|
|
25762
|
+
let { record: i, ancestry: a } = r, { tagName: o } = i, s = Tt(i);
|
|
25763
|
+
if (s && wt.has(o)) {
|
|
25764
|
+
let t = re({
|
|
25650
25765
|
record: i,
|
|
25651
25766
|
ancestry: a
|
|
25652
25767
|
});
|
|
25653
25768
|
t && e.set(t.path, s);
|
|
25654
25769
|
}
|
|
25655
|
-
if (!
|
|
25656
|
-
let c =
|
|
25770
|
+
if (!Ct.has(o)) return;
|
|
25771
|
+
let c = A[o];
|
|
25657
25772
|
for (let e of c) {
|
|
25658
25773
|
let r = i.attributes.find((t) => t.name === e.attribute.path)?.value;
|
|
25659
25774
|
if (!r || i.attributes.find((t) => t.name === e.attribute.uuid)?.value) continue;
|
|
25660
|
-
let s =
|
|
25775
|
+
let s = se(e.resolution, e.attribute.path, r, a);
|
|
25661
25776
|
if (!s) {
|
|
25662
|
-
e.resolution ===
|
|
25777
|
+
e.resolution === k.unsupported && n.push({
|
|
25663
25778
|
type: "unsupported-xpath-reference",
|
|
25664
25779
|
recordId: i.id,
|
|
25665
25780
|
details: {
|
|
@@ -25713,9 +25828,9 @@ function dt() {
|
|
|
25713
25828
|
}
|
|
25714
25829
|
};
|
|
25715
25830
|
}
|
|
25716
|
-
var
|
|
25717
|
-
function
|
|
25718
|
-
if (!
|
|
25831
|
+
var St = new Set(Object.entries(m).filter(([, e]) => "uuid" in e).map(([e]) => e)), Ct = new Set(Object.keys(A)), wt = new Set(Object.values(A).flatMap((e) => e.flatMap((e) => e.target)));
|
|
25832
|
+
function Tt(e) {
|
|
25833
|
+
if (!St.has(e.tagName)) return;
|
|
25719
25834
|
let t = e.attributes.find((e) => e.name === "uuid");
|
|
25720
25835
|
if (t) return t.value;
|
|
25721
25836
|
let n = crypto.randomUUID();
|
|
@@ -25726,14 +25841,14 @@ function ht(e) {
|
|
|
25726
25841
|
}
|
|
25727
25842
|
//#endregion
|
|
25728
25843
|
//#region src/v2019C1/hooks/index.ts
|
|
25729
|
-
var
|
|
25730
|
-
beforeClone:
|
|
25731
|
-
afterStandardizedRecord:
|
|
25732
|
-
afterCreated:
|
|
25733
|
-
afterDeepClone:
|
|
25734
|
-
afterUpdated:
|
|
25735
|
-
beforeDelete:
|
|
25736
|
-
},
|
|
25844
|
+
var Et = {
|
|
25845
|
+
beforeClone: pt,
|
|
25846
|
+
afterStandardizedRecord: ct,
|
|
25847
|
+
afterCreated: Qe,
|
|
25848
|
+
afterDeepClone: ot,
|
|
25849
|
+
afterUpdated: ft,
|
|
25850
|
+
beforeDelete: bt
|
|
25851
|
+
}, Dt = {
|
|
25737
25852
|
supportedFileExtensions: [
|
|
25738
25853
|
".fsd",
|
|
25739
25854
|
".asd",
|
|
@@ -25743,8 +25858,8 @@ var gt = {
|
|
|
25743
25858
|
".icd",
|
|
25744
25859
|
".xml"
|
|
25745
25860
|
],
|
|
25746
|
-
hooks:
|
|
25747
|
-
},
|
|
25861
|
+
hooks: xt()
|
|
25862
|
+
}, Ot = {
|
|
25748
25863
|
recordSchema: {
|
|
25749
25864
|
primaryKey: "id",
|
|
25750
25865
|
indexes: [
|
|
@@ -25774,22 +25889,22 @@ var gt = {
|
|
|
25774
25889
|
xsi: e
|
|
25775
25890
|
}, U = {
|
|
25776
25891
|
rootElementName: "SCL",
|
|
25777
|
-
singletonElements:
|
|
25892
|
+
singletonElements: p,
|
|
25778
25893
|
transparentElements: ["Private"],
|
|
25779
25894
|
elements: c,
|
|
25780
25895
|
namespaces: H,
|
|
25781
|
-
attributes:
|
|
25896
|
+
attributes: m,
|
|
25782
25897
|
children: l,
|
|
25783
25898
|
parents: u,
|
|
25784
25899
|
descendants: d,
|
|
25785
25900
|
ancestors: f,
|
|
25786
|
-
database:
|
|
25787
|
-
io:
|
|
25788
|
-
definition:
|
|
25901
|
+
database: Ot,
|
|
25902
|
+
io: Dt,
|
|
25903
|
+
definition: h
|
|
25789
25904
|
};
|
|
25790
25905
|
//#endregion
|
|
25791
25906
|
//#region src/v2019C1/extensions/clean-up/transaction/orphan-lnode-bindings.ts
|
|
25792
|
-
async function
|
|
25907
|
+
async function kt(e) {
|
|
25793
25908
|
let t = await e.getRecordsByTagName("LNode");
|
|
25794
25909
|
for (let n of t) {
|
|
25795
25910
|
let t = await e.getAttribute(n, { name: "iedName" });
|
|
@@ -25798,10 +25913,10 @@ async function _t(e) {
|
|
|
25798
25913
|
tagName: "IED",
|
|
25799
25914
|
attributes: { name: t }
|
|
25800
25915
|
});
|
|
25801
|
-
r || await
|
|
25916
|
+
r || await At(e, n);
|
|
25802
25917
|
}
|
|
25803
25918
|
}
|
|
25804
|
-
async function
|
|
25919
|
+
async function At(e, t) {
|
|
25805
25920
|
let n = await e.getChild(t, "LNodeSpecNaming");
|
|
25806
25921
|
if (n) {
|
|
25807
25922
|
let r = await e.getAttribute(n, { name: "sLnClass" }), i = await e.getAttribute(n, { name: "sLnInst" }), a = await e.getAttribute(n, { name: "sPrefix" });
|
|
@@ -25829,8 +25944,8 @@ async function vt(e, t) {
|
|
|
25829
25944
|
}
|
|
25830
25945
|
//#endregion
|
|
25831
25946
|
//#region src/v2019C1/extensions/clean-up/transaction/prune-empty-containers.ts
|
|
25832
|
-
async function
|
|
25833
|
-
let t = [...Object.values(
|
|
25947
|
+
async function jt(e) {
|
|
25948
|
+
let t = [...Object.values(Le).flat(), "Private"];
|
|
25834
25949
|
for (let n of t) {
|
|
25835
25950
|
let t = await e.getRecordsByTagName(n);
|
|
25836
25951
|
for (let n of t) n.children.length === 0 && await e.delete(n);
|
|
@@ -25838,27 +25953,27 @@ async function yt(e) {
|
|
|
25838
25953
|
}
|
|
25839
25954
|
//#endregion
|
|
25840
25955
|
//#region src/v2019C1/extensions/clean-up/transaction/orphan-uuid-refs.ts
|
|
25841
|
-
async function
|
|
25842
|
-
let t = Object.keys(
|
|
25956
|
+
async function Mt(e) {
|
|
25957
|
+
let t = Object.keys(A);
|
|
25843
25958
|
for (let n of t) {
|
|
25844
|
-
let t =
|
|
25959
|
+
let t = A[n], r = await e.getRecordsByTagName(n);
|
|
25845
25960
|
for (let i of r) {
|
|
25846
25961
|
let r = !1, a = !1, o = {};
|
|
25847
25962
|
for (let n of t) {
|
|
25848
25963
|
let t = await e.getAttribute(i, { name: n.attribute.uuid });
|
|
25849
|
-
if (t) if (r = !0, await
|
|
25964
|
+
if (t) if (r = !0, await Nt(e, t, n.target)) a = !0;
|
|
25850
25965
|
else {
|
|
25851
25966
|
o[n.attribute.uuid] = void 0, o[n.attribute.path] = void 0;
|
|
25852
25967
|
for (let e of n.companions) o[e.name] = void 0;
|
|
25853
25968
|
}
|
|
25854
25969
|
}
|
|
25855
25970
|
Object.keys(o).length > 0 && await e.update(i, { attributes: o });
|
|
25856
|
-
let s =
|
|
25971
|
+
let s = L.has(n);
|
|
25857
25972
|
r && !a && !s && await e.delete(i);
|
|
25858
25973
|
}
|
|
25859
25974
|
}
|
|
25860
25975
|
}
|
|
25861
|
-
async function
|
|
25976
|
+
async function Nt(e, t, n) {
|
|
25862
25977
|
for (let r of n) {
|
|
25863
25978
|
let [n] = await e.findByAttributes({
|
|
25864
25979
|
tagName: r,
|
|
@@ -25871,13 +25986,13 @@ async function xt(e, t, n) {
|
|
|
25871
25986
|
//#endregion
|
|
25872
25987
|
//#region src/v2019C1/extensions/clean-up/index.ts
|
|
25873
25988
|
var W = { transaction: /* @__PURE__ */ s({
|
|
25874
|
-
orphanUuidRefs: () =>
|
|
25875
|
-
pruneEmptyContainers: () =>
|
|
25876
|
-
resetLNode: () =>
|
|
25989
|
+
orphanUuidRefs: () => Mt,
|
|
25990
|
+
pruneEmptyContainers: () => jt,
|
|
25991
|
+
resetLNode: () => kt
|
|
25877
25992
|
}) };
|
|
25878
25993
|
//#endregion
|
|
25879
25994
|
//#region src/v2019C1/extensions/data-model/query/resolve.ts
|
|
25880
|
-
async function
|
|
25995
|
+
async function Pt(e, n) {
|
|
25881
25996
|
let { records: r } = n, i = {
|
|
25882
25997
|
lnodeTypes: /* @__PURE__ */ new Map(),
|
|
25883
25998
|
doTypes: /* @__PURE__ */ new Map(),
|
|
@@ -25894,7 +26009,7 @@ async function G(e, n) {
|
|
|
25894
26009
|
if (a(o, {
|
|
25895
26010
|
key: "ELEMENT_NOT_FOUND",
|
|
25896
26011
|
detail: `LNodeType not found for lnType="${r}"`
|
|
25897
|
-
}), !
|
|
26012
|
+
}), !G(i.lnodeTypes, r, o)) continue;
|
|
25898
26013
|
let s = o.children.filter((e) => t(e, "DO")), c = await e.getRecords(s);
|
|
25899
26014
|
for (let t of c) {
|
|
25900
26015
|
if (!t) continue;
|
|
@@ -25904,7 +26019,7 @@ async function G(e, n) {
|
|
|
25904
26019
|
tagName: "DOType",
|
|
25905
26020
|
attributes: { id: n }
|
|
25906
26021
|
});
|
|
25907
|
-
r &&
|
|
26022
|
+
r && G(i.doTypes, n, r) && await K({
|
|
25908
26023
|
query: e,
|
|
25909
26024
|
parent: r,
|
|
25910
26025
|
dataModelMap: i
|
|
@@ -25918,10 +26033,10 @@ async function G(e, n) {
|
|
|
25918
26033
|
enumTypes: Array.from(i.enumTypes.values())
|
|
25919
26034
|
};
|
|
25920
26035
|
}
|
|
25921
|
-
function
|
|
26036
|
+
function G(e, t, n) {
|
|
25922
26037
|
return e.has(t) ? !1 : (e.set(t, n), !0);
|
|
25923
26038
|
}
|
|
25924
|
-
async function
|
|
26039
|
+
async function K(e) {
|
|
25925
26040
|
let { query: n, parent: r, dataModelMap: i } = e, a = r.tagName === "DOType" ? await n.getRecords(r.children.filter((e) => t(e, "DA"))) : await n.getRecords(r.children.filter((e) => t(e, "BDA")));
|
|
25926
26041
|
for (let e of a) {
|
|
25927
26042
|
if (!e) continue;
|
|
@@ -25932,13 +26047,13 @@ async function q(e) {
|
|
|
25932
26047
|
tagName: "EnumType",
|
|
25933
26048
|
attributes: { id: r }
|
|
25934
26049
|
});
|
|
25935
|
-
e &&
|
|
26050
|
+
e && G(i.enumTypes, r, e);
|
|
25936
26051
|
} else if (t === "Struct") {
|
|
25937
26052
|
let [e] = await n.findByAttributes({
|
|
25938
26053
|
tagName: "DAType",
|
|
25939
26054
|
attributes: { id: r }
|
|
25940
26055
|
});
|
|
25941
|
-
e &&
|
|
26056
|
+
e && G(i.daTypes, r, e) && await K({
|
|
25942
26057
|
query: n,
|
|
25943
26058
|
parent: e,
|
|
25944
26059
|
dataModelMap: i
|
|
@@ -25955,7 +26070,7 @@ async function q(e) {
|
|
|
25955
26070
|
tagName: "DOType",
|
|
25956
26071
|
attributes: { id: t }
|
|
25957
26072
|
});
|
|
25958
|
-
r &&
|
|
26073
|
+
r && G(i.doTypes, t, r) && await K({
|
|
25959
26074
|
query: n,
|
|
25960
26075
|
parent: r,
|
|
25961
26076
|
dataModelMap: i
|
|
@@ -25965,306 +26080,346 @@ async function q(e) {
|
|
|
25965
26080
|
}
|
|
25966
26081
|
//#endregion
|
|
25967
26082
|
//#region src/v2019C1/extensions/data-model/query/index.ts
|
|
25968
|
-
var
|
|
26083
|
+
var Ft = /* @__PURE__ */ s({ resolve: () => Pt }), It = ["id", "uuid"];
|
|
26084
|
+
//#endregion
|
|
26085
|
+
//#region src/v2019C1/extensions/signature/query/element-signature.ts
|
|
26086
|
+
async function q(e, t) {
|
|
26087
|
+
let n = {
|
|
26088
|
+
query: e,
|
|
26089
|
+
resolveReferences: t.resolveReferences ?? !1,
|
|
26090
|
+
ignore: new Set(t.ignoreAttributes ?? It),
|
|
26091
|
+
memo: /* @__PURE__ */ new Map(),
|
|
26092
|
+
seen: /* @__PURE__ */ new Set()
|
|
26093
|
+
};
|
|
26094
|
+
return J(t.ref, n);
|
|
26095
|
+
}
|
|
26096
|
+
var Lt = /* @__PURE__ */ new Set();
|
|
26097
|
+
function Rt(e, t) {
|
|
26098
|
+
return h[e]?.attributes?.details?.[t]?.default;
|
|
26099
|
+
}
|
|
26100
|
+
async function J(e, t) {
|
|
26101
|
+
let n = `${e.tagName}:${e.id}`, r = t.memo.get(n);
|
|
26102
|
+
if (r !== void 0) return r;
|
|
26103
|
+
if (t.seen.has(n)) return `@cycle:${e.tagName}`;
|
|
26104
|
+
t.seen.add(n);
|
|
26105
|
+
let i = await t.query.getTree(e), a = i ? await zt(i, t) : "";
|
|
26106
|
+
return t.seen.delete(n), t.memo.set(n, a), a;
|
|
26107
|
+
}
|
|
26108
|
+
async function zt(e, t) {
|
|
26109
|
+
let n = t.resolveReferences ? Wt(e.tagName) : Lt, r = [];
|
|
26110
|
+
for (let i of e.attributes) {
|
|
26111
|
+
if (t.ignore.has(i.name) || n.has(i.name) || i.value === Rt(e.tagName, i.name)) continue;
|
|
26112
|
+
let a = i.value;
|
|
26113
|
+
if (t.resolveReferences) {
|
|
26114
|
+
let n = await Bt(e, i.name, i.value, t);
|
|
26115
|
+
n !== null && (a = `@sig:${n}`);
|
|
26116
|
+
}
|
|
26117
|
+
r.push(`${JSON.stringify(i.name)}:${JSON.stringify(a)}`);
|
|
26118
|
+
}
|
|
26119
|
+
r.sort();
|
|
26120
|
+
let i = (await Promise.all((e.tree ?? []).map((e) => zt(e, t)))).sort(), a = e.value?.trim(), o = a ? `,value:${JSON.stringify(a)}` : "";
|
|
26121
|
+
return `{tag:${JSON.stringify(e.tagName)},attrs:[${r.join(",")}]${o},children:[${i.join(",")}]}`;
|
|
26122
|
+
}
|
|
26123
|
+
async function Bt(e, t, n, r) {
|
|
26124
|
+
let i = Vt(e, t);
|
|
26125
|
+
if (i) {
|
|
26126
|
+
let e = await Gt(r.query, i.target, n);
|
|
26127
|
+
return e ? J(e, r) : `@missing:${n}`;
|
|
26128
|
+
}
|
|
26129
|
+
let a = Ut(e.tagName, t);
|
|
26130
|
+
if (a) {
|
|
26131
|
+
let e = await Kt(r.query, a.target, n);
|
|
26132
|
+
return e ? J(e, r) : `@missing:${n}`;
|
|
26133
|
+
}
|
|
26134
|
+
return null;
|
|
26135
|
+
}
|
|
26136
|
+
function Vt(e, t) {
|
|
26137
|
+
return j[e.tagName]?.find((n) => n.attribute === t && Ht(e, n));
|
|
26138
|
+
}
|
|
26139
|
+
function Ht(e, t) {
|
|
26140
|
+
return t.when ? e.attributes.find((e) => e.name === t.when.attribute)?.value === t.when.equals : !0;
|
|
26141
|
+
}
|
|
26142
|
+
function Ut(e, t) {
|
|
26143
|
+
return A[e]?.find((e) => e.attribute.uuid === t);
|
|
26144
|
+
}
|
|
26145
|
+
function Wt(e) {
|
|
26146
|
+
let t = A[e];
|
|
26147
|
+
return t ? new Set(t.map((e) => e.attribute.path)) : Lt;
|
|
26148
|
+
}
|
|
26149
|
+
async function Gt(e, t, n) {
|
|
26150
|
+
let [r] = await e.findByAttributes({
|
|
26151
|
+
tagName: t,
|
|
26152
|
+
attributes: { id: n }
|
|
26153
|
+
});
|
|
26154
|
+
return r ? {
|
|
26155
|
+
tagName: t,
|
|
26156
|
+
id: r.id
|
|
26157
|
+
} : null;
|
|
26158
|
+
}
|
|
26159
|
+
async function Kt(e, t, n) {
|
|
26160
|
+
for (let r of t) {
|
|
26161
|
+
let [t] = await e.findByAttributes({
|
|
26162
|
+
tagName: r,
|
|
26163
|
+
attributes: { uuid: n }
|
|
26164
|
+
});
|
|
26165
|
+
if (t) return {
|
|
26166
|
+
tagName: r,
|
|
26167
|
+
id: t.id
|
|
26168
|
+
};
|
|
26169
|
+
}
|
|
26170
|
+
return null;
|
|
26171
|
+
}
|
|
26172
|
+
//#endregion
|
|
26173
|
+
//#region src/v2019C1/extensions/signature/query/index.ts
|
|
26174
|
+
var qt = /* @__PURE__ */ s({ elementSignature: () => q });
|
|
25969
26175
|
//#endregion
|
|
25970
|
-
//#region src/v2019C1/extensions/data-model/transaction/
|
|
25971
|
-
async function
|
|
25972
|
-
let { sourceQuery: n, records: r } = t,
|
|
26176
|
+
//#region src/v2019C1/extensions/data-model/transaction/import-types.ts
|
|
26177
|
+
async function Jt(e, t) {
|
|
26178
|
+
let { sourceQuery: n, records: r, cloneMappings: i = [], forkPrefix: a = "" } = t, o = Yt(await Pt(n, { records: r })), s = await e.ensureChild(await e.getRoot(), {
|
|
25973
26179
|
tagName: "DataTypeTemplates",
|
|
25974
26180
|
attributes: {}
|
|
25975
|
-
})
|
|
25976
|
-
|
|
26181
|
+
}), c = await Zt(e), l = /* @__PURE__ */ new Map(), u = [], d = {
|
|
26182
|
+
reused: 0,
|
|
26183
|
+
preserved: 0,
|
|
26184
|
+
forked: 0
|
|
26185
|
+
};
|
|
26186
|
+
for (let t of o) {
|
|
25977
26187
|
let r = await n.getAttribute(t, { name: "id" });
|
|
25978
26188
|
if (!r) continue;
|
|
25979
|
-
let
|
|
26189
|
+
let i = await q(n, {
|
|
26190
|
+
ref: {
|
|
26191
|
+
tagName: t.tagName,
|
|
26192
|
+
id: t.id
|
|
26193
|
+
},
|
|
26194
|
+
resolveReferences: !0
|
|
26195
|
+
}), o = c.get(i);
|
|
26196
|
+
if (o !== void 0) {
|
|
26197
|
+
l.set(r, o), d.reused++;
|
|
26198
|
+
continue;
|
|
26199
|
+
}
|
|
26200
|
+
let f = await n.getTree(t);
|
|
26201
|
+
if (!f) continue;
|
|
26202
|
+
let p = (await e.findByAttributes({
|
|
25980
26203
|
tagName: t.tagName,
|
|
25981
26204
|
attributes: { id: r }
|
|
25982
|
-
});
|
|
25983
|
-
|
|
25984
|
-
let
|
|
25985
|
-
|
|
26205
|
+
})).length > 0, m = r, h = f;
|
|
26206
|
+
p ? (m = await tn(e, t.tagName, `${a}${r}_${nn(i)}`), h = Qt(f, m), d.forked++) : d.preserved++;
|
|
26207
|
+
let g = await e.deepClone(s, h);
|
|
26208
|
+
l.set(r, m), g?.record && u.push($t(g.record.tagName, g.record.id));
|
|
25986
26209
|
}
|
|
26210
|
+
let f = i.map((e) => e.target);
|
|
26211
|
+
for (let t of u) {
|
|
26212
|
+
let n = await e.getTree(t);
|
|
26213
|
+
n && en(n, f);
|
|
26214
|
+
}
|
|
26215
|
+
return await Ke(e, {
|
|
26216
|
+
records: f,
|
|
26217
|
+
idRemap: l
|
|
26218
|
+
}), {
|
|
26219
|
+
idRemap: l,
|
|
26220
|
+
stats: d
|
|
26221
|
+
};
|
|
25987
26222
|
}
|
|
25988
|
-
function
|
|
26223
|
+
function Yt(e) {
|
|
25989
26224
|
return [
|
|
25990
|
-
...e.
|
|
25991
|
-
...e.doTypes,
|
|
26225
|
+
...e.enumTypes,
|
|
25992
26226
|
...e.daTypes,
|
|
25993
|
-
...e.
|
|
26227
|
+
...e.doTypes,
|
|
26228
|
+
...e.lnodeTypes
|
|
25994
26229
|
];
|
|
25995
26230
|
}
|
|
26231
|
+
var Xt = [
|
|
26232
|
+
"EnumType",
|
|
26233
|
+
"DAType",
|
|
26234
|
+
"DOType",
|
|
26235
|
+
"LNodeType"
|
|
26236
|
+
];
|
|
26237
|
+
async function Zt(e) {
|
|
26238
|
+
let t = /* @__PURE__ */ new Map();
|
|
26239
|
+
for (let n of Xt) {
|
|
26240
|
+
let r = await e.getRecordsByTagName(n);
|
|
26241
|
+
for (let i of r) {
|
|
26242
|
+
let r = i.attributes.find((e) => e.name === "id")?.value;
|
|
26243
|
+
if (!r) continue;
|
|
26244
|
+
let a = await q(e, {
|
|
26245
|
+
ref: {
|
|
26246
|
+
tagName: n,
|
|
26247
|
+
id: i.id
|
|
26248
|
+
},
|
|
26249
|
+
resolveReferences: !0
|
|
26250
|
+
});
|
|
26251
|
+
t.has(a) || t.set(a, r);
|
|
26252
|
+
}
|
|
26253
|
+
}
|
|
26254
|
+
return t;
|
|
26255
|
+
}
|
|
26256
|
+
function Qt(e, t) {
|
|
26257
|
+
let n = structuredClone(e), r = n.attributes, i = r.find((e) => e.name === "id");
|
|
26258
|
+
return i ? i.value = t : r.push({
|
|
26259
|
+
name: "id",
|
|
26260
|
+
value: t
|
|
26261
|
+
}), n;
|
|
26262
|
+
}
|
|
26263
|
+
function $t(e, t) {
|
|
26264
|
+
return {
|
|
26265
|
+
tagName: e,
|
|
26266
|
+
id: t
|
|
26267
|
+
};
|
|
26268
|
+
}
|
|
26269
|
+
function en(e, t) {
|
|
26270
|
+
t.push($t(e.tagName, e.id));
|
|
26271
|
+
for (let n of e.tree ?? []) en(n, t);
|
|
26272
|
+
}
|
|
26273
|
+
async function tn(e, t, n) {
|
|
26274
|
+
let r = n, i = 2;
|
|
26275
|
+
for (; (await e.findByAttributes({
|
|
26276
|
+
tagName: t,
|
|
26277
|
+
attributes: { id: r }
|
|
26278
|
+
})).length > 0;) r = `${n}_${i}`, i += 1;
|
|
26279
|
+
return r;
|
|
26280
|
+
}
|
|
26281
|
+
function nn(e) {
|
|
26282
|
+
let t = 2166136261;
|
|
26283
|
+
for (let n = 0; n < e.length; n++) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
|
|
26284
|
+
return (t >>> 0).toString(16).padStart(8, "0");
|
|
26285
|
+
}
|
|
25996
26286
|
//#endregion
|
|
25997
26287
|
//#region src/v2019C1/extensions/data-model/index.ts
|
|
25998
|
-
var
|
|
25999
|
-
query:
|
|
26000
|
-
transaction: /* @__PURE__ */ s({
|
|
26288
|
+
var rn = {
|
|
26289
|
+
query: Ft,
|
|
26290
|
+
transaction: /* @__PURE__ */ s({ importTypes: () => Jt })
|
|
26291
|
+
}, an = {
|
|
26292
|
+
scope: "tree",
|
|
26293
|
+
attributes: ["templateUuid", "originUuid"]
|
|
26001
26294
|
};
|
|
26295
|
+
async function Y(e, t) {
|
|
26296
|
+
let { sourceQuery: n, ref: i, targetParent: a, omit: o, promoteRoot: s, strip: c = an } = t, l = await n.getTree(i, { omit: o });
|
|
26297
|
+
if (!l) return;
|
|
26298
|
+
let u = s && l.tagName === s.from ? {
|
|
26299
|
+
...l,
|
|
26300
|
+
tagName: s.to
|
|
26301
|
+
} : l, d = u;
|
|
26302
|
+
return c && (d = c.scope === "tree" ? r(u, c.attributes) : {
|
|
26303
|
+
...u,
|
|
26304
|
+
attributes: u.attributes.filter((e) => !c.attributes.includes(e.name))
|
|
26305
|
+
}), await e.deepClone(a, d);
|
|
26306
|
+
}
|
|
26002
26307
|
//#endregion
|
|
26003
|
-
//#region src/v2019C1/extensions/
|
|
26004
|
-
async function
|
|
26005
|
-
let t = await
|
|
26006
|
-
|
|
26007
|
-
|
|
26008
|
-
|
|
26009
|
-
return Number(e.attributes.find((e) => e.name === t)?.value || 0);
|
|
26308
|
+
//#region src/v2019C1/extensions/extraction/transaction/primitives/clone-referenced.ts
|
|
26309
|
+
async function on(e, t) {
|
|
26310
|
+
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a } = t, o = A[i][0].attribute.uuid, { [i]: s = [] } = await n.findDescendants(r, { collect: i }), c = /* @__PURE__ */ new Set();
|
|
26311
|
+
for (let e of s) {
|
|
26312
|
+
let t = e.attributes.find((e) => e.name === o)?.value;
|
|
26313
|
+
t && c.add(t);
|
|
26010
26314
|
}
|
|
26011
|
-
|
|
26012
|
-
|
|
26013
|
-
|
|
26315
|
+
let l = [];
|
|
26316
|
+
for (let t of c) {
|
|
26317
|
+
let r = { uuid: t }, [i] = await e.findByAttributes({
|
|
26318
|
+
tagName: a,
|
|
26319
|
+
attributes: r
|
|
26320
|
+
});
|
|
26321
|
+
if (i) continue;
|
|
26322
|
+
let [o] = await n.findByAttributes({
|
|
26323
|
+
tagName: a,
|
|
26324
|
+
attributes: r
|
|
26325
|
+
});
|
|
26326
|
+
o && l.push({
|
|
26327
|
+
tagName: a,
|
|
26328
|
+
id: o.id
|
|
26329
|
+
});
|
|
26330
|
+
}
|
|
26331
|
+
return l;
|
|
26332
|
+
}
|
|
26333
|
+
async function sn(e, t) {
|
|
26334
|
+
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, targetParent: o, omit: s } = t, c = await on(e, {
|
|
26335
|
+
sourceQuery: n,
|
|
26336
|
+
scopeRef: r,
|
|
26337
|
+
refTagName: i,
|
|
26338
|
+
targetTagName: a
|
|
26339
|
+
});
|
|
26340
|
+
for (let t of c) await Y(e, {
|
|
26341
|
+
sourceQuery: n,
|
|
26342
|
+
ref: t,
|
|
26343
|
+
targetParent: o,
|
|
26344
|
+
omit: s
|
|
26345
|
+
});
|
|
26346
|
+
}
|
|
26347
|
+
async function cn(e, t) {
|
|
26348
|
+
let { sourceQuery: n, scopeTagName: r, scopeRef: i, targetParent: a, skip: o = /* @__PURE__ */ new Set(), omit: s } = t, c = (d[r] ?? []).filter((e) => e in A && !o.has(e)), l = sn;
|
|
26349
|
+
for (let t of c) for (let r of A[t]) for (let o of r.target) await l(e, {
|
|
26350
|
+
sourceQuery: n,
|
|
26351
|
+
scopeRef: i,
|
|
26352
|
+
refTagName: t,
|
|
26353
|
+
targetTagName: o,
|
|
26354
|
+
targetParent: a,
|
|
26355
|
+
omit: s
|
|
26014
26356
|
});
|
|
26015
26357
|
}
|
|
26016
26358
|
//#endregion
|
|
26017
|
-
//#region src/v2019C1/extensions/
|
|
26018
|
-
async function
|
|
26019
|
-
|
|
26359
|
+
//#region src/v2019C1/extensions/extraction/transaction/deep.ts
|
|
26360
|
+
async function ln(e, t) {
|
|
26361
|
+
let { sourceQuery: n, ref: r, targetParent: i, withTypes: a = !0, withReferences: o = !0, skipReferences: s, omit: c, strip: l = !1, promoteRoot: u } = t;
|
|
26362
|
+
o && await cn(e, {
|
|
26363
|
+
sourceQuery: n,
|
|
26364
|
+
scopeTagName: r.tagName,
|
|
26365
|
+
scopeRef: r,
|
|
26366
|
+
targetParent: i,
|
|
26367
|
+
skip: s,
|
|
26368
|
+
omit: c
|
|
26369
|
+
});
|
|
26370
|
+
let d = await Y(e, {
|
|
26371
|
+
sourceQuery: n,
|
|
26372
|
+
ref: r,
|
|
26373
|
+
targetParent: i,
|
|
26374
|
+
omit: c,
|
|
26375
|
+
strip: l,
|
|
26376
|
+
promoteRoot: u
|
|
26377
|
+
});
|
|
26378
|
+
if (!d) throw Error(`extraction.deep: source element not found: ${r.tagName}#${r.id}`);
|
|
26379
|
+
let f = /* @__PURE__ */ new Map();
|
|
26380
|
+
if (a) {
|
|
26381
|
+
let t = await un(n, r);
|
|
26382
|
+
t.length > 0 && (f = (await Jt(e, {
|
|
26383
|
+
sourceQuery: n,
|
|
26384
|
+
records: t,
|
|
26385
|
+
cloneMappings: d.mappings
|
|
26386
|
+
})).idRemap);
|
|
26387
|
+
}
|
|
26388
|
+
return {
|
|
26389
|
+
record: d.record,
|
|
26390
|
+
idRemap: f
|
|
26391
|
+
};
|
|
26392
|
+
}
|
|
26393
|
+
async function un(e, t) {
|
|
26394
|
+
let { LNode: n = [] } = await e.findDescendants(t, { collect: "LNode" }), { LN: r = [] } = await e.findDescendants(t, { collect: "LN" });
|
|
26395
|
+
return [...n, ...r];
|
|
26020
26396
|
}
|
|
26021
26397
|
//#endregion
|
|
26022
|
-
//#region src/v2019C1/extensions/
|
|
26023
|
-
|
|
26024
|
-
|
|
26025
|
-
|
|
26026
|
-
}
|
|
26398
|
+
//#region src/v2019C1/extensions/extraction/transaction/recipes/shared/ensure-substation-structure.ts
|
|
26399
|
+
async function X(e) {
|
|
26400
|
+
let t = await e.getRoot(), n = await e.ensureChild(t, {
|
|
26401
|
+
tagName: "Substation",
|
|
26402
|
+
attributes: { name: "TEMPLATE" }
|
|
26403
|
+
}), r = await e.ensureChild(n, {
|
|
26404
|
+
tagName: "VoltageLevel",
|
|
26405
|
+
attributes: { name: "TEMPLATE" }
|
|
26406
|
+
});
|
|
26407
|
+
return {
|
|
26408
|
+
Substation: n,
|
|
26409
|
+
VoltageLevel: r,
|
|
26410
|
+
Bay: await e.ensureChild(r, {
|
|
26411
|
+
tagName: "Bay",
|
|
26412
|
+
attributes: { name: "TEMPLATE" }
|
|
26413
|
+
})
|
|
26414
|
+
};
|
|
26415
|
+
}
|
|
26027
26416
|
//#endregion
|
|
26028
|
-
//#region src/v2019C1/extensions/
|
|
26029
|
-
async function
|
|
26030
|
-
|
|
26031
|
-
tagName: "Header",
|
|
26032
|
-
attributes: {
|
|
26033
|
-
id: a ?? n.replace(/\.[^.]+$/, "").toLowerCase().replace(/\s+/g, "_"),
|
|
26034
|
-
toolID: l,
|
|
26035
|
-
fileType: o,
|
|
26036
|
-
...s ? { nameStructure: s } : {},
|
|
26037
|
-
version: "0",
|
|
26038
|
-
revision: "1",
|
|
26039
|
-
uuid: crypto.randomUUID()
|
|
26040
|
-
}
|
|
26041
|
-
}), m = await e.getRecord({ tagName: "History" }) ?? await e.addChild(p, {
|
|
26042
|
-
tagName: "History",
|
|
26043
|
-
attributes: {}
|
|
26044
|
-
}), h = await Dt(e), g = h?.attributes.find((e) => e.name === "version")?.value, _ = h?.attributes.find((e) => e.name === "revision")?.value, v = c === "keep" ? g ?? "0" : g ? String(Number(g) + 1) : "0", y = _ ? String(Number(_) + 1) : "1";
|
|
26045
|
-
await e.update(p, { attributes: {
|
|
26046
|
-
version: v,
|
|
26047
|
-
revision: y
|
|
26048
|
-
} });
|
|
26049
|
-
let b = /* @__PURE__ */ new Date(), x = b.toString().split(" "), te = b.toLocaleString("en", { timeZoneName: "short" }).split(" ").pop(), S = `${x[0]} ${x[1]} ${x[2]} ${x[4]} ${te} ${x[3]}`;
|
|
26050
|
-
await e.addChild(m, {
|
|
26051
|
-
tagName: "Hitem",
|
|
26052
|
-
attributes: {
|
|
26053
|
-
version: v,
|
|
26054
|
-
revision: y,
|
|
26055
|
-
when: S,
|
|
26056
|
-
who: u,
|
|
26057
|
-
what: d,
|
|
26058
|
-
why: f
|
|
26059
|
-
}
|
|
26060
|
-
}), await e.update(p, { attributes: {
|
|
26061
|
-
version: v,
|
|
26062
|
-
revision: y
|
|
26063
|
-
} });
|
|
26417
|
+
//#region src/v2019C1/extensions/extraction/transaction/recipes/shared/post-extraction-cleanup.ts
|
|
26418
|
+
async function dn(e) {
|
|
26419
|
+
await W.transaction.orphanUuidRefs(e), await W.transaction.resetLNode(e), await W.transaction.pruneEmptyContainers(e);
|
|
26064
26420
|
}
|
|
26065
26421
|
//#endregion
|
|
26066
|
-
//#region src/v2019C1/extensions/
|
|
26067
|
-
var J = {
|
|
26068
|
-
query: Ot,
|
|
26069
|
-
transaction: /* @__PURE__ */ s({ addEntry: () => kt })
|
|
26070
|
-
}, At = {
|
|
26071
|
-
LNode: {
|
|
26072
|
-
compact: [
|
|
26073
|
-
"prefix",
|
|
26074
|
-
"lnClass",
|
|
26075
|
-
"lnInst"
|
|
26076
|
-
],
|
|
26077
|
-
full: "{iedName}/{ldInst}/{prefix}{lnClass}{lnInst}"
|
|
26078
|
-
},
|
|
26079
|
-
LN: { compact: [
|
|
26080
|
-
"prefix",
|
|
26081
|
-
"lnClass",
|
|
26082
|
-
"inst"
|
|
26083
|
-
] },
|
|
26084
|
-
LN0: { compact: [
|
|
26085
|
-
"prefix",
|
|
26086
|
-
"lnClass",
|
|
26087
|
-
"inst"
|
|
26088
|
-
] },
|
|
26089
|
-
LDevice: { compact: ["inst"] },
|
|
26090
|
-
ConnectedAP: {
|
|
26091
|
-
compact: ["iedName", "apName"],
|
|
26092
|
-
separator: "/"
|
|
26093
|
-
},
|
|
26094
|
-
GSE: {
|
|
26095
|
-
compact: ["ldInst", "cbName"],
|
|
26096
|
-
separator: "/"
|
|
26097
|
-
},
|
|
26098
|
-
SMV: {
|
|
26099
|
-
compact: ["ldInst", "cbName"],
|
|
26100
|
-
separator: "/"
|
|
26101
|
-
},
|
|
26102
|
-
Private: { compact: ["type"] },
|
|
26103
|
-
EnumVal: { compact: ["ord"] },
|
|
26104
|
-
Association: { compact: ["associationID"] },
|
|
26105
|
-
ConnectivityNode: { compact: ["pathName"] },
|
|
26106
|
-
FunctionRoleContent: { compact: ["roleInst"] },
|
|
26107
|
-
Resource: { compact: ["resInst"] },
|
|
26108
|
-
Hitem: {
|
|
26109
|
-
compact: ["version", "revision"],
|
|
26110
|
-
separator: "."
|
|
26111
|
-
},
|
|
26112
|
-
History: {
|
|
26113
|
-
compact: ["version", "revision"],
|
|
26114
|
-
separator: "."
|
|
26115
|
-
},
|
|
26116
|
-
ControlRef: { compact: "{output}[{outputInst}]/{pLN}.{pDO}/{controlled}" },
|
|
26117
|
-
SourceRef: {
|
|
26118
|
-
compact: "{pLN}.{pDO}.{pDA}",
|
|
26119
|
-
full: "{service}/Input[{inputInst}]/{pLN}.{pDO}.{pDA}/{source}"
|
|
26120
|
-
},
|
|
26121
|
-
FunctionCatRef: { compact: ["function"] },
|
|
26122
|
-
FunctionRef: { compact: ["function"] },
|
|
26123
|
-
AllocationRoleRef: { compact: ["allocationRole"] },
|
|
26124
|
-
PowerSystemRelationRef: { compact: ["powerSystemRelation"] },
|
|
26125
|
-
BehaviorDescriptionRef: { compact: ["behaviorDescription"] },
|
|
26126
|
-
ProcessResourceRef: { compact: ["processResource"] },
|
|
26127
|
-
LNodeDataRef: { compact: ["data"] },
|
|
26128
|
-
FunctionCategoryRef: { compact: ["functionCategory"] },
|
|
26129
|
-
LNodeInputRef: { compact: ["sourceRef"] },
|
|
26130
|
-
LNodeOutputRef: { compact: ["controlRef"] },
|
|
26131
|
-
ApplicationScRef: {
|
|
26132
|
-
compact: "{fileType} v{version}.{revision}",
|
|
26133
|
-
full: "{fileUuid}/{fileType} v{version}.{revision}"
|
|
26134
|
-
},
|
|
26135
|
-
LNodeSpecNaming: { compact: "{sIedName}/{sLdInst}/{sPrefix}{sLnClass}{sLnInst}" },
|
|
26136
|
-
SubscriberLNode: {
|
|
26137
|
-
compact: "{pLN}({service})",
|
|
26138
|
-
full: "{resourceName}/{inputName}/{pLN}({service})"
|
|
26139
|
-
},
|
|
26140
|
-
ControllingLNode: {
|
|
26141
|
-
compact: ["pLN"],
|
|
26142
|
-
full: "{resourceName}/{pLN}"
|
|
26143
|
-
},
|
|
26144
|
-
InputVar: { compact: "{varName}:{inputName}" },
|
|
26145
|
-
OutputVar: { compact: "{varName}:{outputName}" },
|
|
26146
|
-
ExtRef: {
|
|
26147
|
-
compact: "{iedName}/{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}/{srcCBName}",
|
|
26148
|
-
full: "{pServT}/{intAddr}/{pLN}.{pDO}.{pDA}/{iedName}/{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}/{srcCBName}"
|
|
26149
|
-
},
|
|
26150
|
-
FCDA: {
|
|
26151
|
-
compact: "{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}[{fc}]",
|
|
26152
|
-
full: "{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}[{fc}][{ix}]"
|
|
26153
|
-
}
|
|
26154
|
-
};
|
|
26155
|
-
//#endregion
|
|
26156
|
-
//#region src/v2019C1/extensions/presentation/query/extract-element-title.ts
|
|
26157
|
-
async function jt(e, t, n = {}) {
|
|
26158
|
-
let r = await e.getRecord(t);
|
|
26159
|
-
if (!r) return n.withLabels ? {
|
|
26160
|
-
title: "",
|
|
26161
|
-
labels: {}
|
|
26162
|
-
} : "";
|
|
26163
|
-
let i = r.tagName, a = Mt({
|
|
26164
|
-
tag: i,
|
|
26165
|
-
mode: n.mode ?? "compact",
|
|
26166
|
-
attributes: await e.any.getAttributes(r),
|
|
26167
|
-
value: r.value
|
|
26168
|
-
});
|
|
26169
|
-
return n.withLabels ? {
|
|
26170
|
-
title: a,
|
|
26171
|
-
labels: await Nt(e, r)
|
|
26172
|
-
} : a;
|
|
26173
|
-
}
|
|
26174
|
-
function Mt(e) {
|
|
26175
|
-
let { tag: t, mode: n, attributes: r, value: i } = e, a = At[t];
|
|
26176
|
-
if (a) {
|
|
26177
|
-
let e = It(a, r, n);
|
|
26178
|
-
if (e) return e;
|
|
26179
|
-
}
|
|
26180
|
-
let o = (i ?? "").trim();
|
|
26181
|
-
if (o) return o;
|
|
26182
|
-
let s = m[t]?.attributes?.identityFields, c = s?.find((e) => e === "name" || e === "id") ?? s?.[0];
|
|
26183
|
-
return c && r[c] ? r[c] : r.name || t;
|
|
26184
|
-
}
|
|
26185
|
-
async function Nt(e, t) {
|
|
26186
|
-
return Ft(await Pt(e, t));
|
|
26187
|
-
}
|
|
26188
|
-
async function Pt(e, t) {
|
|
26189
|
-
let n = [], r = await e.any.getChildren(t, "Labels");
|
|
26190
|
-
for (let t of r) {
|
|
26191
|
-
let r = await e.any.getChildren(t, "Label");
|
|
26192
|
-
for (let t of r) {
|
|
26193
|
-
let r = await e.any.getAttributes(t), i = (r.lang ?? "").toLowerCase(), a = (t.value ?? "").trim();
|
|
26194
|
-
i && a && n.push({
|
|
26195
|
-
lang: i,
|
|
26196
|
-
id: r.id ?? "",
|
|
26197
|
-
text: a
|
|
26198
|
-
});
|
|
26199
|
-
}
|
|
26200
|
-
}
|
|
26201
|
-
return n;
|
|
26202
|
-
}
|
|
26203
|
-
function Ft(e) {
|
|
26204
|
-
let t = {};
|
|
26205
|
-
for (let { lang: n, id: r, text: i } of e) (t[n] ??= {})[r] = i;
|
|
26206
|
-
return t;
|
|
26207
|
-
}
|
|
26208
|
-
function It(e, t, n) {
|
|
26209
|
-
let r = n === "full" && e.full !== void 0, i = r ? e.full : e.compact, a = r ? e.fullSeparator ?? e.separator ?? "" : e.separator ?? "";
|
|
26210
|
-
if (typeof i == "string") return Lt(i, t);
|
|
26211
|
-
let o = i.map((e) => t[e]).filter(Boolean);
|
|
26212
|
-
return o.length > 0 ? o.join(a) : "";
|
|
26213
|
-
}
|
|
26214
|
-
function Lt(e, t) {
|
|
26215
|
-
return e.replace(/\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g, (e, n) => t[n] ?? "").replace(/\[\]/g, "").replace(/\(\)/g, "").split("/").map((e) => e.split(".").filter((e) => e !== "").join(".")).filter((e) => e !== "").join("/");
|
|
26216
|
-
}
|
|
26217
|
-
//#endregion
|
|
26218
|
-
//#region src/v2019C1/extensions/presentation/index.ts
|
|
26219
|
-
var Rt = { query: /* @__PURE__ */ s({ extractElementTitle: () => jt }) };
|
|
26220
|
-
//#endregion
|
|
26221
|
-
//#region src/v2019C1/extensions/template/transaction/ensure-substation-structure.ts
|
|
26222
|
-
async function Y(e) {
|
|
26223
|
-
let t = await e.getRoot(), n = await e.ensureChild(t, {
|
|
26224
|
-
tagName: "Substation",
|
|
26225
|
-
attributes: { name: "TEMPLATE" }
|
|
26226
|
-
}), r = await e.ensureChild(n, {
|
|
26227
|
-
tagName: "VoltageLevel",
|
|
26228
|
-
attributes: { name: "TEMPLATE" }
|
|
26229
|
-
});
|
|
26230
|
-
return {
|
|
26231
|
-
Substation: n,
|
|
26232
|
-
VoltageLevel: r,
|
|
26233
|
-
Bay: await e.ensureChild(r, {
|
|
26234
|
-
tagName: "Bay",
|
|
26235
|
-
attributes: { name: "TEMPLATE" }
|
|
26236
|
-
})
|
|
26237
|
-
};
|
|
26238
|
-
}
|
|
26239
|
-
//#endregion
|
|
26240
|
-
//#region src/v2019C1/extensions/template/transaction/shared/clone-utils.ts
|
|
26241
|
-
var zt = {
|
|
26242
|
-
scope: "tree",
|
|
26243
|
-
attributes: ["templateUuid", "originUuid"]
|
|
26244
|
-
};
|
|
26245
|
-
async function X(e, t) {
|
|
26246
|
-
let { sourceQuery: n, ref: i, targetParent: a, omit: o, promoteRoot: s, strip: c = zt } = t, l = await n.getTree(i, { omit: o });
|
|
26247
|
-
if (!l) return;
|
|
26248
|
-
let u = s && l.tagName === s.from ? {
|
|
26249
|
-
...l,
|
|
26250
|
-
tagName: s.to
|
|
26251
|
-
} : l, d = u;
|
|
26252
|
-
c && (d = c.scope === "tree" ? r(u, c.attributes) : {
|
|
26253
|
-
...u,
|
|
26254
|
-
attributes: u.attributes.filter((e) => !c.attributes.includes(e.name))
|
|
26255
|
-
}), await e.deepClone(a, d);
|
|
26256
|
-
}
|
|
26257
|
-
//#endregion
|
|
26258
|
-
//#region src/v2019C1/extensions/template/transaction/shared/extract-data-model.ts
|
|
26259
|
-
async function Bt(e, t) {
|
|
26260
|
-
let { sourceQuery: n, scopeRef: r } = t, { LNode: i = [] } = await n.findDescendants(r, { collect: "LNode" });
|
|
26261
|
-
i.length > 0 && await Tt.transaction.extract(e, {
|
|
26262
|
-
sourceQuery: n,
|
|
26263
|
-
records: i
|
|
26264
|
-
});
|
|
26265
|
-
}
|
|
26266
|
-
//#endregion
|
|
26267
|
-
//#region src/v2019C1/extensions/template/transaction/shared/resolve-structure-ref.ts
|
|
26422
|
+
//#region src/v2019C1/extensions/extraction/transaction/recipes/shared/resolve-structure-ref.ts
|
|
26268
26423
|
async function Z(e, t, n) {
|
|
26269
26424
|
let r = (await e.findAncestors(t, { stopAtTagName: "Substation" })).find((e) => e.tagName in n);
|
|
26270
26425
|
a(r, {
|
|
@@ -26278,36 +26433,35 @@ async function Z(e, t, n) {
|
|
|
26278
26433
|
};
|
|
26279
26434
|
}
|
|
26280
26435
|
//#endregion
|
|
26281
|
-
//#region src/v2019C1/extensions/
|
|
26282
|
-
async function
|
|
26436
|
+
//#region src/v2019C1/extensions/extraction/transaction/recipes/shared/clone-function.ts
|
|
26437
|
+
async function fn(e, t) {
|
|
26283
26438
|
let { sourceQuery: n, functionRef: r, targetParentRef: i, omit: a, stripRootAttributes: o } = t;
|
|
26284
|
-
await
|
|
26439
|
+
await ln(e, {
|
|
26285
26440
|
sourceQuery: n,
|
|
26286
26441
|
ref: r,
|
|
26287
26442
|
targetParent: i,
|
|
26288
26443
|
omit: a,
|
|
26444
|
+
strip: o?.length ? {
|
|
26445
|
+
scope: "root",
|
|
26446
|
+
attributes: [...o]
|
|
26447
|
+
} : !1,
|
|
26289
26448
|
promoteRoot: {
|
|
26290
26449
|
from: "SubFunction",
|
|
26291
26450
|
to: "Function"
|
|
26292
26451
|
},
|
|
26293
|
-
|
|
26294
|
-
|
|
26295
|
-
attributes: [...o]
|
|
26296
|
-
} : !1
|
|
26297
|
-
}), await Bt(e, {
|
|
26298
|
-
sourceQuery: n,
|
|
26299
|
-
scopeRef: r
|
|
26452
|
+
withTypes: !0,
|
|
26453
|
+
withReferences: !1
|
|
26300
26454
|
});
|
|
26301
26455
|
}
|
|
26302
|
-
async function
|
|
26303
|
-
let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await
|
|
26456
|
+
async function pn(e, t) {
|
|
26457
|
+
let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await mn(n, r);
|
|
26304
26458
|
for (let t of o) {
|
|
26305
|
-
if (await
|
|
26459
|
+
if (await gn(e, n, t)) continue;
|
|
26306
26460
|
let r = {
|
|
26307
26461
|
tagName: "FunctionCategory",
|
|
26308
26462
|
id: t
|
|
26309
26463
|
};
|
|
26310
|
-
await
|
|
26464
|
+
await Y(e, {
|
|
26311
26465
|
sourceQuery: n,
|
|
26312
26466
|
ref: r,
|
|
26313
26467
|
targetParent: await Z(n, r, i),
|
|
@@ -26315,18 +26469,18 @@ async function Ht(e, t) {
|
|
|
26315
26469
|
});
|
|
26316
26470
|
}
|
|
26317
26471
|
}
|
|
26318
|
-
async function
|
|
26319
|
-
let n = await
|
|
26472
|
+
async function mn(e, t) {
|
|
26473
|
+
let n = await hn(e, t), r = /* @__PURE__ */ new Set();
|
|
26320
26474
|
for (let { container: e } of n) e && r.add(e.id);
|
|
26321
26475
|
return r;
|
|
26322
26476
|
}
|
|
26323
|
-
async function
|
|
26324
|
-
let n = await
|
|
26477
|
+
async function hn(e, t) {
|
|
26478
|
+
let n = await R.query.findRefsPointingTo(e, {
|
|
26325
26479
|
target: t,
|
|
26326
26480
|
containerTagName: "FunctionCategory"
|
|
26327
26481
|
}), { SubFunction: r = [] } = await e.findDescendants(t, { collect: "SubFunction" });
|
|
26328
26482
|
for (let t of r) {
|
|
26329
|
-
let r = await
|
|
26483
|
+
let r = await R.query.findRefsPointingTo(e, {
|
|
26330
26484
|
target: {
|
|
26331
26485
|
tagName: "SubFunction",
|
|
26332
26486
|
id: t.id
|
|
@@ -26337,7 +26491,7 @@ async function Wt(e, t) {
|
|
|
26337
26491
|
}
|
|
26338
26492
|
return n;
|
|
26339
26493
|
}
|
|
26340
|
-
async function
|
|
26494
|
+
async function gn(e, t, n) {
|
|
26341
26495
|
let r = await t.getRecord({
|
|
26342
26496
|
tagName: "FunctionCategory",
|
|
26343
26497
|
id: n
|
|
@@ -26352,122 +26506,125 @@ async function Gt(e, t, n) {
|
|
|
26352
26506
|
return !!a;
|
|
26353
26507
|
}
|
|
26354
26508
|
//#endregion
|
|
26355
|
-
//#region src/v2019C1/extensions/
|
|
26356
|
-
|
|
26357
|
-
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a } = t, o = P[i][0].attribute.uuid, { [i]: s = [] } = await n.findDescendants(r, { collect: i }), c = /* @__PURE__ */ new Set();
|
|
26358
|
-
for (let e of s) {
|
|
26359
|
-
let t = e.attributes.find((e) => e.name === o)?.value;
|
|
26360
|
-
t && c.add(t);
|
|
26361
|
-
}
|
|
26362
|
-
let l = [];
|
|
26363
|
-
for (let t of c) {
|
|
26364
|
-
let r = { uuid: t }, [i] = await e.findByAttributes({
|
|
26365
|
-
tagName: a,
|
|
26366
|
-
attributes: r
|
|
26367
|
-
});
|
|
26368
|
-
if (i) continue;
|
|
26369
|
-
let [o] = await n.findByAttributes({
|
|
26370
|
-
tagName: a,
|
|
26371
|
-
attributes: r
|
|
26372
|
-
});
|
|
26373
|
-
o && l.push({
|
|
26374
|
-
tagName: a,
|
|
26375
|
-
id: o.id
|
|
26376
|
-
});
|
|
26377
|
-
}
|
|
26378
|
-
return l;
|
|
26379
|
-
}
|
|
26380
|
-
async function Kt(e, t) {
|
|
26381
|
-
let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, targetParent: o, omit: s } = t, c = await Q(e, {
|
|
26382
|
-
sourceQuery: n,
|
|
26383
|
-
scopeRef: r,
|
|
26384
|
-
refTagName: i,
|
|
26385
|
-
targetTagName: a
|
|
26386
|
-
});
|
|
26387
|
-
for (let t of c) await X(e, {
|
|
26388
|
-
sourceQuery: n,
|
|
26389
|
-
ref: t,
|
|
26390
|
-
targetParent: o,
|
|
26391
|
-
omit: s
|
|
26392
|
-
});
|
|
26393
|
-
}
|
|
26394
|
-
async function qt(e, t) {
|
|
26395
|
-
let { sourceQuery: n, scopeTagName: r, scopeRef: i, targetParent: a, skip: o = /* @__PURE__ */ new Set(), omit: s } = t, c = d[r].filter((e) => e in P && !o.has(e)), l = Kt;
|
|
26396
|
-
for (let t of c) for (let r of P[t]) for (let o of r.target) await l(e, {
|
|
26397
|
-
sourceQuery: n,
|
|
26398
|
-
scopeRef: i,
|
|
26399
|
-
refTagName: t,
|
|
26400
|
-
targetTagName: o,
|
|
26401
|
-
targetParent: a,
|
|
26402
|
-
omit: s
|
|
26403
|
-
});
|
|
26404
|
-
}
|
|
26405
|
-
//#endregion
|
|
26406
|
-
//#region src/v2019C1/extensions/template/transaction/shared/omit-filters.ts
|
|
26407
|
-
var $ = [
|
|
26509
|
+
//#region src/v2019C1/extensions/extraction/transaction/recipes/shared/omit-filters.ts
|
|
26510
|
+
var Q = [
|
|
26408
26511
|
"FunctionSclRef",
|
|
26409
26512
|
"ApplicationSclRef",
|
|
26410
26513
|
"GeneralEquipment",
|
|
26411
26514
|
"ConductingEquipment"
|
|
26412
|
-
], Jt = [
|
|
26413
|
-
...$,
|
|
26414
|
-
"DOS",
|
|
26415
|
-
"Labels",
|
|
26416
|
-
"LNodeInputs",
|
|
26417
|
-
"LNodeOutputs",
|
|
26418
|
-
"ProcessResources",
|
|
26419
|
-
"PowerSystemRelations",
|
|
26420
|
-
"BehaviorDescription",
|
|
26421
|
-
"Variable"
|
|
26422
26515
|
];
|
|
26423
26516
|
//#endregion
|
|
26424
|
-
//#region src/v2019C1/extensions/
|
|
26425
|
-
async function
|
|
26517
|
+
//#region src/v2019C1/extensions/extraction/transaction/recipes/asd/clone-application.ts
|
|
26518
|
+
async function _n(e, t) {
|
|
26426
26519
|
let { sourceQuery: n, applicationRef: r, structure: i } = t, a = {
|
|
26427
26520
|
tagName: "Substation",
|
|
26428
26521
|
id: i.Substation.id
|
|
26429
|
-
}, o = await
|
|
26522
|
+
}, o = await on(e, {
|
|
26430
26523
|
sourceQuery: n,
|
|
26431
26524
|
scopeRef: r,
|
|
26432
26525
|
refTagName: "FunctionRef",
|
|
26433
26526
|
targetTagName: "Function"
|
|
26434
26527
|
});
|
|
26435
|
-
for (let t of o) await
|
|
26528
|
+
for (let t of o) await fn(e, {
|
|
26436
26529
|
sourceQuery: n,
|
|
26437
26530
|
functionRef: t,
|
|
26438
26531
|
targetParentRef: await Z(n, t, i),
|
|
26439
|
-
omit:
|
|
26532
|
+
omit: Q
|
|
26440
26533
|
});
|
|
26441
|
-
for (let t of o) await
|
|
26534
|
+
for (let t of o) await pn(e, {
|
|
26442
26535
|
sourceQuery: n,
|
|
26443
26536
|
functionRef: t,
|
|
26444
26537
|
structure: i,
|
|
26445
26538
|
stripCategoriesUuid: !1
|
|
26446
26539
|
});
|
|
26447
|
-
await
|
|
26540
|
+
await cn(e, {
|
|
26448
26541
|
sourceQuery: n,
|
|
26449
26542
|
scopeTagName: "Application",
|
|
26450
26543
|
scopeRef: r,
|
|
26451
26544
|
targetParent: a,
|
|
26452
26545
|
skip: new Set(["FunctionRef", "FunctionCategoryRef"]),
|
|
26453
|
-
omit:
|
|
26454
|
-
}), await
|
|
26546
|
+
omit: Q
|
|
26547
|
+
}), await Y(e, {
|
|
26455
26548
|
sourceQuery: n,
|
|
26456
26549
|
ref: r,
|
|
26457
26550
|
targetParent: await Z(n, r, i),
|
|
26458
|
-
omit:
|
|
26551
|
+
omit: Q
|
|
26459
26552
|
});
|
|
26460
26553
|
}
|
|
26461
26554
|
//#endregion
|
|
26462
|
-
//#region src/v2019C1/extensions/
|
|
26463
|
-
async function
|
|
26464
|
-
|
|
26555
|
+
//#region src/v2019C1/extensions/history/query/get-sorted-hitem.ts
|
|
26556
|
+
async function vn(e) {
|
|
26557
|
+
let t = await e.getRecord({ tagName: "History" });
|
|
26558
|
+
if (!t) return [];
|
|
26559
|
+
let { Hitem: n = [] } = await e.findDescendants(t, { collect: "Hitem" });
|
|
26560
|
+
function r(e, t) {
|
|
26561
|
+
return Number(e.attributes.find((e) => e.name === t)?.value || 0);
|
|
26562
|
+
}
|
|
26563
|
+
return [...n].sort((e, t) => {
|
|
26564
|
+
let n = r(e, "version") - r(t, "version");
|
|
26565
|
+
return n === 0 ? r(e, "revision") - r(t, "revision") : n;
|
|
26566
|
+
});
|
|
26567
|
+
}
|
|
26568
|
+
//#endregion
|
|
26569
|
+
//#region src/v2019C1/extensions/history/query/get-latest-hitem.ts
|
|
26570
|
+
async function yn(e) {
|
|
26571
|
+
return (await vn(e)).at(-1);
|
|
26465
26572
|
}
|
|
26466
26573
|
//#endregion
|
|
26467
|
-
//#region src/v2019C1/extensions/
|
|
26468
|
-
|
|
26469
|
-
|
|
26470
|
-
|
|
26574
|
+
//#region src/v2019C1/extensions/history/query/index.ts
|
|
26575
|
+
var bn = /* @__PURE__ */ s({
|
|
26576
|
+
getLatestHitem: () => yn,
|
|
26577
|
+
getSortedHitems: () => vn
|
|
26578
|
+
});
|
|
26579
|
+
//#endregion
|
|
26580
|
+
//#region src/v2019C1/extensions/history/transaction/add-entry.ts
|
|
26581
|
+
async function xn(e, t) {
|
|
26582
|
+
let { filename: n, header: r, item: i } = t, { id: a, fileType: o, nameStructure: s, version: c, tool: l } = r, { who: u, what: d, why: f } = i, p = await e.getRoot(), m = await e.getRecord({ tagName: "Header" }) ?? await e.addChild(p, {
|
|
26583
|
+
tagName: "Header",
|
|
26584
|
+
attributes: {
|
|
26585
|
+
id: a ?? n.replace(/\.[^.]+$/, "").toLowerCase().replace(/\s+/g, "_"),
|
|
26586
|
+
toolID: l,
|
|
26587
|
+
fileType: o,
|
|
26588
|
+
...s ? { nameStructure: s } : {},
|
|
26589
|
+
version: "0",
|
|
26590
|
+
revision: "1",
|
|
26591
|
+
uuid: crypto.randomUUID()
|
|
26592
|
+
}
|
|
26593
|
+
}), h = await e.getRecord({ tagName: "History" }) ?? await e.addChild(m, {
|
|
26594
|
+
tagName: "History",
|
|
26595
|
+
attributes: {}
|
|
26596
|
+
}), g = await yn(e), _ = g?.attributes.find((e) => e.name === "version")?.value, v = g?.attributes.find((e) => e.name === "revision")?.value, y = c === "keep" ? _ ?? "0" : _ ? String(Number(_) + 1) : "0", b = v ? String(Number(v) + 1) : "1";
|
|
26597
|
+
await e.update(m, { attributes: {
|
|
26598
|
+
version: y,
|
|
26599
|
+
revision: b
|
|
26600
|
+
} });
|
|
26601
|
+
let x = /* @__PURE__ */ new Date(), S = x.toString().split(" "), ee = x.toLocaleString("en", { timeZoneName: "short" }).split(" ").pop(), C = `${S[0]} ${S[1]} ${S[2]} ${S[4]} ${ee} ${S[3]}`;
|
|
26602
|
+
await e.addChild(h, {
|
|
26603
|
+
tagName: "Hitem",
|
|
26604
|
+
attributes: {
|
|
26605
|
+
version: y,
|
|
26606
|
+
revision: b,
|
|
26607
|
+
when: C,
|
|
26608
|
+
who: u,
|
|
26609
|
+
what: d,
|
|
26610
|
+
why: f
|
|
26611
|
+
}
|
|
26612
|
+
}), await e.update(m, { attributes: {
|
|
26613
|
+
version: y,
|
|
26614
|
+
revision: b
|
|
26615
|
+
} });
|
|
26616
|
+
}
|
|
26617
|
+
//#endregion
|
|
26618
|
+
//#region src/v2019C1/extensions/history/index.ts
|
|
26619
|
+
var $ = {
|
|
26620
|
+
query: bn,
|
|
26621
|
+
transaction: /* @__PURE__ */ s({ addEntry: () => xn })
|
|
26622
|
+
};
|
|
26623
|
+
//#endregion
|
|
26624
|
+
//#region src/v2019C1/extensions/extraction/transaction/recipes/asd/to-asd.ts
|
|
26625
|
+
async function Sn(e, t) {
|
|
26626
|
+
let { sourceQuery: n, applicationRef: r, tool: i, who: a, nameStructure: o } = t, s = await X(e), c = await e.getAttribute(r, { name: "name" }) || "Unnamed Application";
|
|
26627
|
+
await $.transaction.addEntry(e, {
|
|
26471
26628
|
filename: `ASD_${c.replace(/\s+/g, "_")}`,
|
|
26472
26629
|
header: {
|
|
26473
26630
|
fileType: "ASD",
|
|
@@ -26480,20 +26637,33 @@ async function Zt(e, t) {
|
|
|
26480
26637
|
what: "ASD initialization",
|
|
26481
26638
|
why: "Application was extracted from a previous file"
|
|
26482
26639
|
}
|
|
26483
|
-
}), await
|
|
26640
|
+
}), await _n(e, {
|
|
26484
26641
|
sourceQuery: n,
|
|
26485
26642
|
applicationRef: r,
|
|
26486
26643
|
structure: s
|
|
26487
|
-
}), await
|
|
26644
|
+
}), await dn(e);
|
|
26488
26645
|
}
|
|
26489
26646
|
//#endregion
|
|
26490
|
-
//#region src/v2019C1/extensions/
|
|
26491
|
-
|
|
26492
|
-
|
|
26647
|
+
//#region src/v2019C1/extensions/extraction/transaction/recipes/fsd/omit.ts
|
|
26648
|
+
var Cn = [
|
|
26649
|
+
...Q,
|
|
26650
|
+
"DOS",
|
|
26651
|
+
"Labels",
|
|
26652
|
+
"LNodeInputs",
|
|
26653
|
+
"LNodeOutputs",
|
|
26654
|
+
"ProcessResources",
|
|
26655
|
+
"PowerSystemRelations",
|
|
26656
|
+
"BehaviorDescription",
|
|
26657
|
+
"Variable"
|
|
26658
|
+
];
|
|
26659
|
+
//#endregion
|
|
26660
|
+
//#region src/v2019C1/extensions/extraction/transaction/recipes/fsd/to-fsd.ts
|
|
26661
|
+
async function wn(e, t) {
|
|
26662
|
+
let { sourceQuery: n, functionRef: r, tool: i, who: a, nameStructure: o } = t, s = await X(e), c = {
|
|
26493
26663
|
tagName: s.Substation.tagName,
|
|
26494
26664
|
id: s.Substation.id
|
|
26495
26665
|
}, l = await n.getAttribute(r, { name: "name" }) || "Unnamed Function";
|
|
26496
|
-
await
|
|
26666
|
+
await $.transaction.addEntry(e, {
|
|
26497
26667
|
filename: `FSD_${l.replace(/\s+/g, "_")}`,
|
|
26498
26668
|
header: {
|
|
26499
26669
|
fileType: "FSD",
|
|
@@ -26506,31 +26676,182 @@ async function Qt(e, t) {
|
|
|
26506
26676
|
what: "FSD initialization",
|
|
26507
26677
|
why: "Function was extracted from a previous file"
|
|
26508
26678
|
}
|
|
26509
|
-
}), await
|
|
26679
|
+
}), await fn(e, {
|
|
26510
26680
|
sourceQuery: n,
|
|
26511
26681
|
functionRef: r,
|
|
26512
26682
|
targetParentRef: c,
|
|
26513
|
-
omit:
|
|
26683
|
+
omit: Cn,
|
|
26514
26684
|
stripRootAttributes: ["templateUuid"]
|
|
26515
|
-
}), await
|
|
26685
|
+
}), await pn(e, {
|
|
26516
26686
|
sourceQuery: n,
|
|
26517
26687
|
functionRef: r,
|
|
26518
26688
|
structure: s
|
|
26519
|
-
}), await
|
|
26689
|
+
}), await dn(e);
|
|
26690
|
+
}
|
|
26691
|
+
//#endregion
|
|
26692
|
+
//#region src/v2019C1/extensions/extraction/index.ts
|
|
26693
|
+
var Tn = { transaction: /* @__PURE__ */ s({
|
|
26694
|
+
deep: () => ln,
|
|
26695
|
+
ensureSubstationTemplateStructure: () => X,
|
|
26696
|
+
toAsd: () => Sn,
|
|
26697
|
+
toFsd: () => wn
|
|
26698
|
+
}) }, En = {
|
|
26699
|
+
LNode: {
|
|
26700
|
+
compact: [
|
|
26701
|
+
"prefix",
|
|
26702
|
+
"lnClass",
|
|
26703
|
+
"lnInst"
|
|
26704
|
+
],
|
|
26705
|
+
full: "{iedName}/{ldInst}/{prefix}{lnClass}{lnInst}"
|
|
26706
|
+
},
|
|
26707
|
+
LN: { compact: [
|
|
26708
|
+
"prefix",
|
|
26709
|
+
"lnClass",
|
|
26710
|
+
"inst"
|
|
26711
|
+
] },
|
|
26712
|
+
LN0: { compact: [
|
|
26713
|
+
"prefix",
|
|
26714
|
+
"lnClass",
|
|
26715
|
+
"inst"
|
|
26716
|
+
] },
|
|
26717
|
+
LDevice: { compact: ["inst"] },
|
|
26718
|
+
ConnectedAP: {
|
|
26719
|
+
compact: ["iedName", "apName"],
|
|
26720
|
+
separator: "/"
|
|
26721
|
+
},
|
|
26722
|
+
GSE: {
|
|
26723
|
+
compact: ["ldInst", "cbName"],
|
|
26724
|
+
separator: "/"
|
|
26725
|
+
},
|
|
26726
|
+
SMV: {
|
|
26727
|
+
compact: ["ldInst", "cbName"],
|
|
26728
|
+
separator: "/"
|
|
26729
|
+
},
|
|
26730
|
+
Private: { compact: ["type"] },
|
|
26731
|
+
EnumVal: { compact: ["ord"] },
|
|
26732
|
+
Association: { compact: ["associationID"] },
|
|
26733
|
+
ConnectivityNode: { compact: ["pathName"] },
|
|
26734
|
+
FunctionRoleContent: { compact: ["roleInst"] },
|
|
26735
|
+
Resource: { compact: ["resInst"] },
|
|
26736
|
+
Hitem: {
|
|
26737
|
+
compact: ["version", "revision"],
|
|
26738
|
+
separator: "."
|
|
26739
|
+
},
|
|
26740
|
+
History: {
|
|
26741
|
+
compact: ["version", "revision"],
|
|
26742
|
+
separator: "."
|
|
26743
|
+
},
|
|
26744
|
+
ControlRef: { compact: "{output}[{outputInst}]/{pLN}.{pDO}/{controlled}" },
|
|
26745
|
+
SourceRef: {
|
|
26746
|
+
compact: "{pLN}.{pDO}.{pDA}",
|
|
26747
|
+
full: "{service}/Input[{inputInst}]/{pLN}.{pDO}.{pDA}/{source}"
|
|
26748
|
+
},
|
|
26749
|
+
FunctionCatRef: { compact: ["function"] },
|
|
26750
|
+
FunctionRef: { compact: ["function"] },
|
|
26751
|
+
AllocationRoleRef: { compact: ["allocationRole"] },
|
|
26752
|
+
PowerSystemRelationRef: { compact: ["powerSystemRelation"] },
|
|
26753
|
+
BehaviorDescriptionRef: { compact: ["behaviorDescription"] },
|
|
26754
|
+
ProcessResourceRef: { compact: ["processResource"] },
|
|
26755
|
+
LNodeDataRef: { compact: ["data"] },
|
|
26756
|
+
FunctionCategoryRef: { compact: ["functionCategory"] },
|
|
26757
|
+
LNodeInputRef: { compact: ["sourceRef"] },
|
|
26758
|
+
LNodeOutputRef: { compact: ["controlRef"] },
|
|
26759
|
+
ApplicationScRef: {
|
|
26760
|
+
compact: "{fileType} v{version}.{revision}",
|
|
26761
|
+
full: "{fileUuid}/{fileType} v{version}.{revision}"
|
|
26762
|
+
},
|
|
26763
|
+
LNodeSpecNaming: { compact: "{sIedName}/{sLdInst}/{sPrefix}{sLnClass}{sLnInst}" },
|
|
26764
|
+
SubscriberLNode: {
|
|
26765
|
+
compact: "{pLN}({service})",
|
|
26766
|
+
full: "{resourceName}/{inputName}/{pLN}({service})"
|
|
26767
|
+
},
|
|
26768
|
+
ControllingLNode: {
|
|
26769
|
+
compact: ["pLN"],
|
|
26770
|
+
full: "{resourceName}/{pLN}"
|
|
26771
|
+
},
|
|
26772
|
+
InputVar: { compact: "{varName}:{inputName}" },
|
|
26773
|
+
OutputVar: { compact: "{varName}:{outputName}" },
|
|
26774
|
+
ExtRef: {
|
|
26775
|
+
compact: "{iedName}/{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}/{srcCBName}",
|
|
26776
|
+
full: "{pServT}/{intAddr}/{pLN}.{pDO}.{pDA}/{iedName}/{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}/{srcCBName}"
|
|
26777
|
+
},
|
|
26778
|
+
FCDA: {
|
|
26779
|
+
compact: "{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}[{fc}]",
|
|
26780
|
+
full: "{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}[{fc}][{ix}]"
|
|
26781
|
+
}
|
|
26782
|
+
};
|
|
26783
|
+
//#endregion
|
|
26784
|
+
//#region src/v2019C1/extensions/presentation/query/extract-element-title.ts
|
|
26785
|
+
async function Dn(e, t, n = {}) {
|
|
26786
|
+
let r = await e.getRecord(t);
|
|
26787
|
+
if (!r) return n.withLabels ? {
|
|
26788
|
+
title: "",
|
|
26789
|
+
labels: {}
|
|
26790
|
+
} : "";
|
|
26791
|
+
let i = r.tagName, a = On({
|
|
26792
|
+
tag: i,
|
|
26793
|
+
mode: n.mode ?? "compact",
|
|
26794
|
+
attributes: await e.any.getAttributes(r),
|
|
26795
|
+
value: r.value
|
|
26796
|
+
});
|
|
26797
|
+
return n.withLabels ? {
|
|
26798
|
+
title: a,
|
|
26799
|
+
labels: await kn(e, r)
|
|
26800
|
+
} : a;
|
|
26801
|
+
}
|
|
26802
|
+
function On(e) {
|
|
26803
|
+
let { tag: t, mode: n, attributes: r, value: i } = e, a = En[t];
|
|
26804
|
+
if (a) {
|
|
26805
|
+
let e = Mn(a, r, n);
|
|
26806
|
+
if (e) return e;
|
|
26807
|
+
}
|
|
26808
|
+
let o = (i ?? "").trim();
|
|
26809
|
+
if (o) return o;
|
|
26810
|
+
let s = h[t]?.attributes?.identityFields, c = s?.find((e) => e === "name" || e === "id") ?? s?.[0];
|
|
26811
|
+
return c && r[c] ? r[c] : r.name || t;
|
|
26812
|
+
}
|
|
26813
|
+
async function kn(e, t) {
|
|
26814
|
+
return jn(await An(e, t));
|
|
26815
|
+
}
|
|
26816
|
+
async function An(e, t) {
|
|
26817
|
+
let n = [], r = await e.any.getChildren(t, "Labels");
|
|
26818
|
+
for (let t of r) {
|
|
26819
|
+
let r = await e.any.getChildren(t, "Label");
|
|
26820
|
+
for (let t of r) {
|
|
26821
|
+
let r = await e.any.getAttributes(t), i = (r.lang ?? "").toLowerCase(), a = (t.value ?? "").trim();
|
|
26822
|
+
i && a && n.push({
|
|
26823
|
+
lang: i,
|
|
26824
|
+
id: r.id ?? "",
|
|
26825
|
+
text: a
|
|
26826
|
+
});
|
|
26827
|
+
}
|
|
26828
|
+
}
|
|
26829
|
+
return n;
|
|
26830
|
+
}
|
|
26831
|
+
function jn(e) {
|
|
26832
|
+
let t = {};
|
|
26833
|
+
for (let { lang: n, id: r, text: i } of e) (t[n] ??= {})[r] = i;
|
|
26834
|
+
return t;
|
|
26835
|
+
}
|
|
26836
|
+
function Mn(e, t, n) {
|
|
26837
|
+
let r = n === "full" && e.full !== void 0, i = r ? e.full : e.compact, a = r ? e.fullSeparator ?? e.separator ?? "" : e.separator ?? "";
|
|
26838
|
+
if (typeof i == "string") return Nn(i, t);
|
|
26839
|
+
let o = i.map((e) => t[e]).filter(Boolean);
|
|
26840
|
+
return o.length > 0 ? o.join(a) : "";
|
|
26841
|
+
}
|
|
26842
|
+
function Nn(e, t) {
|
|
26843
|
+
return e.replace(/\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g, (e, n) => t[n] ?? "").replace(/\[\]/g, "").replace(/\(\)/g, "").split("/").map((e) => e.split(".").filter((e) => e !== "").join(".")).filter((e) => e !== "").join("/");
|
|
26520
26844
|
}
|
|
26521
26845
|
//#endregion
|
|
26522
26846
|
//#region src/v2019C1/extensions/index.ts
|
|
26523
|
-
var
|
|
26847
|
+
var Pn = {
|
|
26524
26848
|
cleanUp: W,
|
|
26525
|
-
dataModel:
|
|
26526
|
-
|
|
26527
|
-
|
|
26528
|
-
|
|
26529
|
-
|
|
26530
|
-
|
|
26531
|
-
extractToFsd: () => Qt
|
|
26532
|
-
}) },
|
|
26533
|
-
presentation: Rt
|
|
26849
|
+
dataModel: rn,
|
|
26850
|
+
extraction: Tn,
|
|
26851
|
+
history: $,
|
|
26852
|
+
reference: R,
|
|
26853
|
+
signature: { query: qt },
|
|
26854
|
+
presentation: { query: /* @__PURE__ */ s({ extractElementTitle: () => Dn }) }
|
|
26534
26855
|
};
|
|
26535
26856
|
//#endregion
|
|
26536
|
-
export {
|
|
26857
|
+
export { S, Ie as _, Dt as a, k as b, Re as c, Fe as d, P as f, F as g, I as h, U as i, L as l, N as m, It as n, H as o, M as p, Ot as r, Et as s, Pn as t, Le as u, j as v, C as x, A as y };
|