@@ -12,9 +12,12 @@ export const supportedCdcTypes =
12
12
export type SupportedCdcType = typeof supportedCdcTypes [ number ] ;
13
13
14
14
export type CreateFunction = ( daiElement : Element , selectedTi : string , inverted : boolean ) => Create [ ] ;
15
+ export type CreateCheckFunction = ( daiElement : Element , selectedTi : string ) => Create [ ] ;
15
16
export interface TiInformation {
16
17
filter : string ;
17
18
create : CreateFunction ;
19
+ checkFilter ?: string ;
20
+ checkCreate ?: CreateCheckFunction ;
18
21
inverted ?: boolean ;
19
22
}
20
23
@@ -62,7 +65,9 @@ export const cdcProcessings: Record<
62
65
control : {
63
66
'63' : {
64
67
filter : ':scope > SDI[name="Oper"] > SDI[name="ctlVal"] > DAI[name="f"]' ,
65
- create : createAddressAction
68
+ create : createAddressAction ,
69
+ checkFilter : ':scope > SDI[name="Oper"] > DAI[name="Check"]' ,
70
+ checkCreate : createCheckAddressAction ,
66
71
} ,
67
72
}
68
73
} ,
@@ -85,7 +90,9 @@ export const cdcProcessings: Record<
85
90
control : {
86
91
'60' : {
87
92
filter : ':scope > SDI[name="Oper"] > DAI[name="ctlVal"]' ,
88
- create : createAddressAction
93
+ create : createAddressAction ,
94
+ checkFilter : ':scope > SDI[name="Oper"] > DAI[name="Check"]' ,
95
+ checkCreate : createCheckAddressAction ,
89
96
} ,
90
97
}
91
98
} ,
@@ -109,7 +116,9 @@ export const cdcProcessings: Record<
109
116
control : {
110
117
'60' : {
111
118
filter : ':scope > SDI[name="Oper"] > DAI[name=“ctlVal”]' ,
112
- create : createAddressAction
119
+ create : createAddressAction ,
120
+ checkFilter : ':scope > SDI[name="Oper"] > DAI[name="Check"]' ,
121
+ checkCreate : createCheckAddressAction ,
113
122
} ,
114
123
}
115
124
} ,
@@ -132,13 +141,15 @@ export const cdcProcessings: Record<
132
141
monitor : {
133
142
'31' : {
134
143
filter : ':scope > DAI[name="stVal"]' ,
135
- create : createAddressAction
144
+ create : createAddressAction ,
136
145
} ,
137
146
} ,
138
147
control : {
139
148
'59' : {
140
149
filter : ':scope > SDI[name="Oper"] > DAI[name="ctlVal"]' ,
141
- create : createAddressAction
150
+ create : createAddressAction ,
151
+ checkFilter : ':scope > SDI[name="Oper"] > DAI[name="Check"]' ,
152
+ checkCreate : createCheckAddressAction ,
142
153
} ,
143
154
}
144
155
} ,
@@ -161,7 +172,9 @@ export const cdcProcessings: Record<
161
172
control : {
162
173
'62' : {
163
174
filter : ':scope > SDI[name="Oper"] > DAI[name="ctlVal"]' ,
164
- create : createAddressAction
175
+ create : createAddressAction ,
176
+ checkFilter : ':scope > SDI[name="Oper"] > DAI[name="Check"]' ,
177
+ checkCreate : createCheckAddressAction ,
165
178
} ,
166
179
}
167
180
} ,
@@ -202,7 +215,9 @@ export const cdcProcessings: Record<
202
215
control : {
203
216
'62' : {
204
217
filter : ':scope > SDI[name="Oper"] > DAI[name="ctlVal"]' ,
205
- create : createAddressAction
218
+ create : createAddressAction ,
219
+ checkFilter : ':scope > SDI[name="Oper"] > DAI[name="Check"]' ,
220
+ checkCreate : createCheckAddressAction ,
206
221
} ,
207
222
}
208
223
} ,
@@ -239,7 +254,9 @@ export const cdcProcessings: Record<
239
254
control : {
240
255
'58' : {
241
256
filter : ':scope > SDI[name="Oper"] > DAI[name="ctlVal"]' ,
242
- create : createAddressAction
257
+ create : createAddressAction ,
258
+ checkFilter : ':scope > SDI[name="Oper"] > DAI[name="Check"]' ,
259
+ checkCreate : createCheckAddressAction ,
243
260
} ,
244
261
}
245
262
} ,
@@ -283,3 +300,23 @@ function createAddressAction(daiElement: Element, ti: string, inverted: boolean)
283
300
}
284
301
return [ { new : { parent : daiElement , element : privateElement } } ] ;
285
302
}
303
+
304
+
305
+ /**
306
+ * Create a new SCL Private element and add 104 Address element(s) below this.
307
+ * Set the attribute value of 'ti' to the passed ti value.
308
+ *
309
+ * @param daiElement - The DAI Element to use to set namespace on the root element and create new elements.
310
+ * @param ti - The value to be set on the attribute 'ti'.
311
+ */
312
+ function createCheckAddressAction ( daiElement : Element , ti : string ) : Create [ ] {
313
+ addPrefixAndNamespaceToDocument ( daiElement ) ;
314
+
315
+ const privateElement = createPrivateElement ( daiElement ) ;
316
+ let addressElement = createPrivateAddress ( daiElement , privateElement , ti ) ;
317
+ addressElement . setAttribute ( 'check' , 'interlocking' ) ;
318
+ addressElement = createPrivateAddress ( daiElement , privateElement , ti ) ;
319
+ addressElement . setAttribute ( 'check' , 'synchrocheck' ) ;
320
+
321
+ return [ { new : { parent : daiElement , element : privateElement } } ] ;
322
+ }
0 commit comments