@enervance/insight-cim-model 0.0.1 → 0.0.3

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.
Files changed (262) hide show
  1. package/dist/config/westnetz-neplan/neplan-load.config.js +0 -1
  2. package/dist/config/westnetz-neplan/neplan-load.config.js.map +1 -1
  3. package/dist/constants/cim-class-definition.js +6 -0
  4. package/dist/constants/cim-class-definition.js.map +1 -1
  5. package/dist/constants/cim-class-names.d.ts +6 -0
  6. package/dist/constants/cim-class-names.js +6 -0
  7. package/dist/constants/cim-class-names.js.map +1 -1
  8. package/dist/converter/integral7/ConverterIntegral7.d.ts +17 -4
  9. package/dist/converter/integral7/ConverterIntegral7.js +530 -39
  10. package/dist/converter/integral7/ConverterIntegral7.js.map +1 -1
  11. package/dist/converter/integral7/config/db-config.d.ts +3 -1
  12. package/dist/converter/integral7/model/integral/Hgueleitung.d.ts +9 -0
  13. package/dist/converter/integral7/model/integral/Hgueleitung.js +3 -0
  14. package/dist/converter/integral7/model/integral/Hgueleitung.js.map +1 -0
  15. package/dist/converter/integral7/model/integral/Kopfstation.d.ts +31 -0
  16. package/dist/converter/integral7/model/integral/Kopfstation.js +3 -0
  17. package/dist/converter/integral7/model/integral/Kopfstation.js.map +1 -0
  18. package/dist/converter/integral7/model/interfaces.d.ts +8 -0
  19. package/dist/converter/integral7/sql/integral.sql.d.ts +8 -0
  20. package/dist/converter/integral7/sql/integral.sql.js +22 -1
  21. package/dist/converter/integral7/sql/integral.sql.js.map +1 -1
  22. package/dist/converter/integral7/utils.d.ts +4 -1
  23. package/dist/converter/integral7/utils.js +26 -8
  24. package/dist/converter/integral7/utils.js.map +1 -1
  25. package/dist/etl-neplan/etl-neplan-contingency-analysis.js +22 -7
  26. package/dist/etl-neplan/etl-neplan-contingency-analysis.js.map +1 -1
  27. package/dist/etl-neplan/etl-neplan-feederline.d.ts +3 -1
  28. package/dist/etl-neplan/etl-neplan-feederline.js +73 -15
  29. package/dist/etl-neplan/etl-neplan-feederline.js.map +1 -1
  30. package/dist/etl-neplan/etl-neplan.js.map +1 -1
  31. package/dist/etl-neplan/neplan-contingency-analysis.d.ts +14 -0
  32. package/dist/etl-neplan/neplan-contingency-analysis.js +337 -0
  33. package/dist/etl-neplan/neplan-contingency-analysis.js.map +1 -0
  34. package/dist/graph/Types.d.ts +5 -0
  35. package/dist/graph/Types.js +10 -0
  36. package/dist/graph/Types.js.map +1 -0
  37. package/dist/graph/connections/connection.d.ts +11 -0
  38. package/dist/graph/connections/connection.js +17 -0
  39. package/dist/graph/connections/connection.js.map +1 -0
  40. package/dist/graph/edges/edge.d.ts +8 -0
  41. package/dist/graph/edges/edge.js +16 -0
  42. package/dist/graph/edges/edge.js.map +1 -0
  43. package/dist/graph/graph-interfaces.d.ts +15 -0
  44. package/dist/graph/graph-interfaces.js +3 -0
  45. package/dist/graph/graph-interfaces.js.map +1 -0
  46. package/dist/graph/graph-util.d.ts +13 -0
  47. package/dist/graph/graph-util.js +114 -0
  48. package/dist/graph/graph-util.js.map +1 -0
  49. package/dist/graph/graph.d.ts +15 -0
  50. package/dist/graph/graph.js +75 -0
  51. package/dist/graph/graph.js.map +1 -0
  52. package/dist/graph/nodes/node.d.ts +14 -0
  53. package/dist/graph/nodes/node.js +28 -0
  54. package/dist/graph/nodes/node.js.map +1 -0
  55. package/dist/index.d.ts +6 -0
  56. package/dist/index.js +12 -0
  57. package/dist/index.js.map +1 -1
  58. package/dist/model/core/ACDCTerminal.js +2 -2
  59. package/dist/model/core/ACDCTerminal.js.map +1 -1
  60. package/dist/model/core/ConnectivityNode.js +3 -2
  61. package/dist/model/core/ConnectivityNode.js.map +1 -1
  62. package/dist/model/core/PSRType.d.ts +0 -1
  63. package/dist/model/core/PSRType.js +3 -6
  64. package/dist/model/core/PSRType.js.map +1 -1
  65. package/dist/model/core/PowerSystemResource.js +3 -8
  66. package/dist/model/core/PowerSystemResource.js.map +1 -1
  67. package/dist/model/core/Substation.d.ts +3 -0
  68. package/dist/model/core/Substation.js +4 -0
  69. package/dist/model/core/Substation.js.map +1 -1
  70. package/dist/model/core/Terminal.d.ts +2 -0
  71. package/dist/model/core/Terminal.js +2 -2
  72. package/dist/model/core/Terminal.js.map +1 -1
  73. package/dist/model/core/VoltageLevel.js +0 -1
  74. package/dist/model/core/VoltageLevel.js.map +1 -1
  75. package/dist/model/dc/ACDCConverter.d.ts +23 -0
  76. package/dist/model/dc/ACDCConverter.js +33 -0
  77. package/dist/model/dc/ACDCConverter.js.map +1 -0
  78. package/dist/model/dc/ACDCConverterDCTerminal.d.ts +13 -0
  79. package/dist/model/dc/ACDCConverterDCTerminal.js +54 -0
  80. package/dist/model/dc/ACDCConverterDCTerminal.js.map +1 -0
  81. package/dist/model/dc/CsConverter.d.ts +21 -0
  82. package/dist/model/dc/CsConverter.js +43 -0
  83. package/dist/model/dc/CsConverter.js.map +1 -0
  84. package/dist/model/dc/CsOperatingModeKind.d.ts +4 -0
  85. package/dist/model/dc/CsOperatingModeKind.js +9 -0
  86. package/dist/model/dc/CsOperatingModeKind.js.map +1 -0
  87. package/dist/model/dc/CsPpccControlKind.d.ts +5 -0
  88. package/dist/model/dc/CsPpccControlKind.js +10 -0
  89. package/dist/model/dc/CsPpccControlKind.js.map +1 -0
  90. package/dist/model/dc/DCBaseTerminal.d.ts +8 -0
  91. package/dist/model/dc/DCBaseTerminal.js +30 -0
  92. package/dist/model/dc/DCBaseTerminal.js.map +1 -0
  93. package/dist/model/dc/DCConductingEquipment.d.ts +5 -0
  94. package/dist/model/dc/DCConductingEquipment.js +12 -0
  95. package/dist/model/dc/DCConductingEquipment.js.map +1 -0
  96. package/dist/model/dc/DCConverterOperatingModeKind.d.ts +5 -0
  97. package/dist/model/dc/DCConverterOperatingModeKind.js +10 -0
  98. package/dist/model/dc/DCConverterOperatingModeKind.js.map +1 -0
  99. package/dist/model/dc/DCConverterUnit.d.ts +14 -0
  100. package/dist/model/dc/DCConverterUnit.js +54 -0
  101. package/dist/model/dc/DCConverterUnit.js.map +1 -0
  102. package/dist/model/dc/DCEquipmentContainer.d.ts +5 -0
  103. package/dist/model/dc/DCEquipmentContainer.js +12 -0
  104. package/dist/model/dc/DCEquipmentContainer.js.map +1 -0
  105. package/dist/model/dc/DCLine.d.ts +11 -0
  106. package/dist/model/dc/DCLine.js +48 -0
  107. package/dist/model/dc/DCLine.js.map +1 -0
  108. package/dist/model/dc/DCLineSegment.d.ts +13 -0
  109. package/dist/model/dc/DCLineSegment.js +69 -0
  110. package/dist/model/dc/DCLineSegment.js.map +1 -0
  111. package/dist/model/dc/DCNode.d.ts +12 -0
  112. package/dist/model/dc/DCNode.js +41 -0
  113. package/dist/model/dc/DCNode.js.map +1 -0
  114. package/dist/model/dc/DCPolarityKind.d.ts +5 -0
  115. package/dist/model/dc/DCPolarityKind.js +10 -0
  116. package/dist/model/dc/DCPolarityKind.js.map +1 -0
  117. package/dist/model/dc/DCTerminal.d.ts +10 -0
  118. package/dist/model/dc/DCTerminal.js +38 -0
  119. package/dist/model/dc/DCTerminal.js.map +1 -0
  120. package/dist/model/dc/VsConverter.d.ts +18 -0
  121. package/dist/model/dc/VsConverter.js +33 -0
  122. package/dist/model/dc/VsConverter.js.map +1 -0
  123. package/dist/model/dc/VsPpccControlKind.d.ts +7 -0
  124. package/dist/model/dc/VsPpccControlKind.js +12 -0
  125. package/dist/model/dc/VsPpccControlKind.js.map +1 -0
  126. package/dist/model/dc/VsQpccControlKind.d.ts +5 -0
  127. package/dist/model/dc/VsQpccControlKind.js +10 -0
  128. package/dist/model/dc/VsQpccControlKind.js.map +1 -0
  129. package/dist/model/domain/UnitMultiplier.js.map +1 -1
  130. package/dist/model/extensions/amprion/model/AmprionModell.d.ts +25 -0
  131. package/dist/model/extensions/amprion/model/AmprionModell.js +64 -0
  132. package/dist/model/extensions/amprion/model/AmprionModell.js.map +1 -0
  133. package/dist/model/extensions/amprion/project/AMPRIONConstructionProject.d.ts +34 -0
  134. package/dist/model/extensions/amprion/project/AMPRIONConstructionProject.js +134 -0
  135. package/dist/model/extensions/amprion/project/AMPRIONConstructionProject.js.map +1 -0
  136. package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.d.ts +17 -0
  137. package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.js +77 -0
  138. package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.js.map +1 -0
  139. package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.d.ts +14 -0
  140. package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.js +57 -0
  141. package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.js.map +1 -0
  142. package/dist/model/extensions/amprion/project/AMPRIONErpProject.d.ts +7 -0
  143. package/dist/model/extensions/amprion/project/AMPRIONErpProject.js +17 -0
  144. package/dist/model/extensions/amprion/project/AMPRIONErpProject.js.map +1 -0
  145. package/dist/model/extensions/amprion/project/AMPRIONErpProjectPhase.d.ts +19 -0
  146. package/dist/model/extensions/amprion/project/AMPRIONErpProjectPhase.js +74 -0
  147. package/dist/model/extensions/amprion/project/AMPRIONErpProjectPhase.js.map +1 -0
  148. package/dist/model/extensions/amprion/project/AMPRIONErpProjectStructure.d.ts +15 -0
  149. package/dist/model/extensions/amprion/project/AMPRIONErpProjectStructure.js +26 -0
  150. package/dist/model/extensions/amprion/project/AMPRIONErpProjectStructure.js.map +1 -0
  151. package/dist/model/extensions/amprion/project/AMPRIONProjectPriorityKind.d.ts +5 -0
  152. package/dist/model/extensions/amprion/project/AMPRIONProjectPriorityKind.js +10 -0
  153. package/dist/model/extensions/amprion/project/AMPRIONProjectPriorityKind.js.map +1 -0
  154. package/dist/model/extensions/amprion/wires/AMPRIONSeriesCompensator.d.ts +9 -0
  155. package/dist/model/extensions/amprion/wires/AMPRIONSeriesCompensator.js +46 -0
  156. package/dist/model/extensions/amprion/wires/AMPRIONSeriesCompensator.js.map +1 -0
  157. package/dist/model/extensions/enervance/operations/EVTerminalAction.js.map +1 -1
  158. package/dist/model/extensions/neplan-westnetz/assets/WNFacility.js.map +1 -1
  159. package/dist/model/generation/WindGeneratingUnit.d.ts +5 -0
  160. package/dist/model/generation/WindGeneratingUnit.js +66 -0
  161. package/dist/model/generation/WindGeneratingUnit.js.map +1 -1
  162. package/dist/model/model/Model.d.ts +39 -1
  163. package/dist/model/model/Model.js +91 -1
  164. package/dist/model/model/Model.js.map +1 -1
  165. package/dist/model/wires/ACLineSegment.d.ts +1 -0
  166. package/dist/model/wires/ACLineSegment.js +15 -2
  167. package/dist/model/wires/ACLineSegment.js.map +1 -1
  168. package/dist/model/wires/AsynchronousMachine.d.ts +1 -0
  169. package/dist/model/wires/AsynchronousMachine.js +37 -1
  170. package/dist/model/wires/AsynchronousMachine.js.map +1 -1
  171. package/dist/model/wires/Disconnector.js +1 -1
  172. package/dist/model/wires/EnergySource.d.ts +2 -0
  173. package/dist/model/wires/EnergySource.js +28 -2
  174. package/dist/model/wires/EnergySource.js.map +1 -1
  175. package/dist/model/wires/SeriesCompensator.d.ts +18 -2
  176. package/dist/model/wires/SeriesCompensator.js +108 -5
  177. package/dist/model/wires/SeriesCompensator.js.map +1 -1
  178. package/dist/util/util-create.js.map +1 -1
  179. package/dist/util/util-topology.d.ts +2 -2
  180. package/dist/util/util-topology.js +14 -6
  181. package/dist/util/util-topology.js.map +1 -1
  182. package/package.json +1 -1
  183. package/src/config/westnetz-neplan/neplan-load.config.ts +1 -1
  184. package/src/constants/cim-class-definition.ts +20 -1
  185. package/src/constants/cim-class-names.ts +9 -0
  186. package/src/converter/integral7/ConverterIntegral7.ts +753 -345
  187. package/src/converter/integral7/config/db-config.ts +3 -2
  188. package/src/converter/integral7/model/integral/Hgueleitung.ts +12 -0
  189. package/src/converter/integral7/model/integral/Kopfstation.ts +46 -0
  190. package/src/converter/integral7/model/interfaces.ts +23 -16
  191. package/src/converter/integral7/sql/integral.sql.ts +27 -1
  192. package/src/converter/integral7/utils.ts +43 -11
  193. package/src/etl-neplan/etl-neplan-contingency-analysis.ts +30 -12
  194. package/src/etl-neplan/etl-neplan-feederline.ts +100 -17
  195. package/src/etl-neplan/etl-neplan.ts +1 -0
  196. package/src/etl-neplan/neplan-contingency-analysis.ts +572 -0
  197. package/src/graph/Types.ts +7 -0
  198. package/src/graph/connections/connection.ts +29 -0
  199. package/src/graph/edges/edge.ts +27 -0
  200. package/src/graph/graph-interfaces.ts +21 -0
  201. package/src/graph/graph-util.ts +158 -0
  202. package/src/graph/graph.ts +84 -0
  203. package/src/graph/nodes/node.ts +43 -0
  204. package/src/index.ts +8 -0
  205. package/src/model/core/ACDCTerminal.ts +2 -2
  206. package/src/model/core/ConnectivityNode.ts +2 -2
  207. package/src/model/core/PSRType.ts +3 -6
  208. package/src/model/core/PowerSystemResource.ts +3 -7
  209. package/src/model/core/Substation.ts +6 -0
  210. package/src/model/core/Terminal.ts +15 -6
  211. package/src/model/core/VoltageLevel.ts +0 -1
  212. package/src/model/dc/ACDCConverter.ts +66 -0
  213. package/src/model/dc/ACDCConverterDCTerminal.ts +64 -0
  214. package/src/model/dc/CsConverter.ts +68 -0
  215. package/src/model/dc/CsOperatingModeKind.ts +4 -0
  216. package/src/model/dc/CsPpccControlKind.ts +5 -0
  217. package/src/model/dc/DCBaseTerminal.ts +30 -0
  218. package/src/model/dc/DCConductingEquipment.ts +8 -0
  219. package/src/model/dc/DCConverterOperatingModeKind.ts +6 -0
  220. package/src/model/dc/DCConverterUnit.ts +60 -0
  221. package/src/model/dc/DCEquipmentContainer.ts +8 -0
  222. package/src/model/dc/DCLine.ts +56 -0
  223. package/src/model/dc/DCLineSegment.ts +81 -0
  224. package/src/model/dc/DCNode.ts +49 -0
  225. package/src/model/dc/DCPolarityKind.ts +5 -0
  226. package/src/model/dc/DCTerminal.ts +45 -0
  227. package/src/model/dc/VsConverter.ts +48 -0
  228. package/src/model/dc/VsPpccControlKind.ts +7 -0
  229. package/src/model/dc/VsQpccControlKind.ts +5 -0
  230. package/src/model/domain/UnitMultiplier.ts +12 -12
  231. package/src/model/equivalents/EquivalentBranch.ts +10 -10
  232. package/src/model/extensions/amprion/model/AmprionModell.ts +92 -0
  233. package/src/model/extensions/amprion/project/AMPRIONConstructionProject.ts +174 -0
  234. package/src/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.ts +89 -0
  235. package/src/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.ts +64 -0
  236. package/src/model/extensions/amprion/project/AMPRIONErpProject.ts +21 -0
  237. package/src/model/extensions/amprion/project/AMPRIONErpProjectPhase.ts +89 -0
  238. package/src/model/extensions/amprion/project/AMPRIONErpProjectStructure.ts +36 -0
  239. package/src/model/extensions/amprion/project/AMPRIONProjectPriorityKind.ts +5 -0
  240. package/src/model/extensions/amprion/wires/AMPRIONSeriesCompensator.ts +53 -0
  241. package/src/model/extensions/enervance/core/EVTerminal.ts +1 -1
  242. package/src/model/extensions/enervance/operations/EVTerminalAction.ts +0 -1
  243. package/src/model/extensions/neplan-westnetz/assets/WNFacility.ts +0 -1
  244. package/src/model/generation/WindGeneratingUnit.ts +73 -0
  245. package/src/model/model/Model.ts +131 -7
  246. package/src/model/wires/ACLineSegment.ts +244 -228
  247. package/src/model/wires/AsynchronousMachine.ts +38 -1
  248. package/src/model/wires/Disconnector.ts +1 -1
  249. package/src/model/wires/EnergySource.ts +256 -222
  250. package/src/model/wires/SeriesCompensator.ts +145 -19
  251. package/src/util/util-create.ts +2 -0
  252. package/src/util/util-topology.ts +18 -7
  253. package/test/apache-jena-fuseki-interface/{apache-jena-fuseki-neplan.tests.spec.ts → apache-jena-fuseki-neplan-1.tests.sp-ec.ts} +0 -26
  254. package/test/apache-jena-fuseki-interface/apache-jena-fuseki-neplan-2.tests.spec.ts +255 -0
  255. package/test/apache-jena-fuseki-interface/data/xml/finnentrop/Finnentrop_Rootnet_Area 1_EQ_V1.xml +20867 -0
  256. package/test/apache-jena-fuseki-interface/data/xml/finnentrop/Finnentrop_Rootnet_Area 1_SSH_V1.xml +3784 -0
  257. package/test/apache-jena-fuseki-interface/data/xml/ruhrau-katharina/Ruhrau_Katharina_Rootnet_Area 1_EQ_V1.xml +42546 -0
  258. package/test/apache-jena-fuseki-interface/data/xml/ruhrau-katharina/Ruhrau_Katharina_Rootnet_Area 1_SSH_V1.xml +10101 -0
  259. package/test/apache-jena-fuseki-interface/data/xml/ruhrau-katharina/Ruhrau_Katharina_Rootnet_Area 1_SV_V1.xml +6229 -0
  260. package/test/integral7-converter/integral7-converter.tests.spec.ts +12 -3
  261. package/test/power-system-data-model-converter/power-system-data-model-converter.tests.spec.ts +1 -1
  262. package/test/apache-jena-fuseki-interface/data/apache-jena-fuseki-3.12.0/run/system/tdb.lock +0 -1
@@ -0,0 +1,158 @@
1
+ import { WNConnectivityNode } from '../model/extensions/neplan-westnetz/core/WNConnectivityNode';
2
+ import { Graph } from './graph';
3
+ import { OutageResult, SwitchEvalResult } from './graph-interfaces';
4
+ import { Node } from './nodes/node';
5
+ import { generateUUID } from '../util/utils';
6
+ import { Terminal } from '../model/core/Terminal';
7
+ import { Switch } from '../model/wires/Switch';
8
+ import { IdentifiedObject } from '../model/core/IdentifiedObject';
9
+ import { Connection } from './connections/connection';
10
+ import { Edge } from './edges/edge';
11
+ import { WNFeeder } from '../model/extensions/neplan-westnetz/core/WNFeeder';
12
+ import { IFeeder } from '../interfaces/model/core/IFeeder';
13
+ import { ConnectivityNode } from '../model/core/ConnectivityNode';
14
+
15
+ export function determineOutageAffectedSubstations(graph: Graph,
16
+ outageNodeUUIDs: string[],
17
+ stations: Map<string, WNConnectivityNode>,
18
+ slackUUIDs: string[]): OutageResult {
19
+
20
+ const outageStations = new Map<string, Node[]>();
21
+ const feededStations = new Map<string, Node[]>();
22
+ for (const object of stations.values()) {
23
+ if (outageNodeUUIDs.indexOf(object.mrid) === -1 &&
24
+ !isInMap(object.mrid, outageStations) && // betrachtetes Objekt ist noch nicht zugeordnet
25
+ !isInMap(object.mrid, feededStations)) { // betrachtetes Objekt ist noch nicht zugeordnet
26
+ const node = graph.nodes.get(object.mrid);
27
+ const resultBFS = graph.isObjectReachableBFS(node, slackUUIDs);
28
+
29
+ if (!resultBFS.found) {
30
+ outageStations.set(generateUUID(), resultBFS.nodesVisited);
31
+ } else {
32
+ feededStations.set(generateUUID(), resultBFS.nodesVisited);
33
+ }
34
+ }
35
+ }
36
+
37
+ return {
38
+ outageObjects: outageNodeUUIDs,
39
+ outageStations,
40
+ feededStations
41
+ }
42
+ }
43
+
44
+ export function isInMap(nodeUUID: string, stations: Map<string, Node[]>): boolean {
45
+ for (const nodes of stations.values()) {
46
+ if (nodes.find(node => node.uuid === nodeUUID)) return true;
47
+ }
48
+ return false;
49
+ }
50
+
51
+ export function isSwitchObjectInArray(switchObject: IdentifiedObject, switchActions: IdentifiedObject[][]): boolean {
52
+ for (const switchAction of switchActions) {
53
+ if (switchAction.indexOf(switchObject) !== -1) return true;
54
+ }
55
+ return false;
56
+ }
57
+
58
+
59
+ export function evaluateSwitchActions(outageNodeUUID: string, initOutageStations: Map<string, Node[]>,
60
+ normalEnergizedConnectivityNodes: Map<string, WNConnectivityNode>,
61
+ graph: Graph, switchActions: IdentifiedObject[][], slackUUIDs: string[]): SwitchEvalResult[] {
62
+
63
+
64
+ const switchEvalResults: SwitchEvalResult[] = []
65
+
66
+ for (const switchObject of switchActions) {
67
+ applySwitchState(graph, switchObject, false);
68
+ const switchedStationsResult = determineOutageAffectedSubstations(graph, [outageNodeUUID], normalEnergizedConnectivityNodes, slackUUIDs);
69
+ applySwitchState(graph, switchObject, true);
70
+ const evalResult = rateSwichAction(initOutageStations, switchedStationsResult.outageStations);
71
+ switchEvalResults.push({
72
+ switchObjects: arrayStringPropArray(switchObject, 'mrid'),
73
+ type: evalResult,
74
+ outageResult: switchedStationsResult
75
+ });
76
+
77
+ }
78
+ return switchEvalResults;
79
+ }
80
+
81
+ function applySwitchState(graph: Graph, switchObjects: IdentifiedObject[], open: boolean) {
82
+ for (const switchObject of switchObjects) {
83
+ if (switchObject instanceof Terminal) {
84
+ changeSwitchState(graph.terminals.get(switchObject.mrid), open ? false : true);
85
+ }
86
+ if (switchObject instanceof Switch) {
87
+ changeEdgeState(graph.edges.get(switchObject.mrid), open ? true : false);
88
+ }
89
+ }
90
+
91
+ }
92
+
93
+ function changeSwitchState(conn: Connection | undefined, state: boolean) {
94
+ if (!conn) return;
95
+ conn.connected = state;
96
+ }
97
+
98
+ function changeEdgeState(conn: Edge | undefined, state: boolean) {
99
+ if (!conn) return;
100
+ conn.open = state;
101
+ }
102
+
103
+ /*export function evaluateSwichActionSwitch(outageNodeUUID: string, initOutageStations: Map<string, Node[]>,
104
+ normalEnergizedConnectivityNodes: Map<string, WNConnectivityNode>,
105
+ graph: Graph, switches: Switch[], slackUUIDs: string[]): SwitchEvalResult[]{
106
+ const switchEvalResults: SwitchEvalResult[] = []
107
+ for (const swtch of switches) {
108
+ const connection = graph.edges.get(swtch.mrid);
109
+ if (!connection) continue;
110
+ connection.open = false;
111
+ const switchedStationsResult = determineOutageAffectedSubstations(graph, [outageNodeUUID], normalEnergizedConnectivityNodes, slackUUIDs);
112
+ connection.open = true;
113
+ const evalResult = evaluateSwichAction(initOutageStations, switchedStationsResult.outageStations);
114
+
115
+ switchEvalResults.push({
116
+ switchObjects: [swtch.mrid],
117
+ type: evalResult,
118
+ outageResult: switchedStationsResult
119
+ });
120
+
121
+ }
122
+ return switchEvalResults;
123
+ }*/
124
+
125
+ /** prüft, ob eine Schaltmaßnahme zu keiner, partieller oder vollständiger Wiederversorgung führt.
126
+ * 0 -> keine Wiederversorgung
127
+ * 1 -> partielle Wiederversorgung
128
+ * 2 -> vollständige Wiederversorgung */
129
+ export function rateSwichAction(outageStations: Map<string, Node[]>, switchActionOutageStations: Map<string, Node[]>): number {
130
+ if (switchActionOutageStations.size === 0) {
131
+ return 2;
132
+ } else if (switchActionOutageStations.size < outageStations.size) {
133
+ return 1;
134
+ } else {
135
+ return 0;
136
+ }
137
+ }
138
+
139
+ export function arrayStringPropArray (data: any[], propName): string[] {
140
+ return data.map(elemt => {
141
+ return elemt[propName];
142
+ });
143
+ }
144
+
145
+ export function isBelongingToFeeder(elementUUID: string, feeders: Map<string, IFeeder>, node: boolean): boolean {
146
+ for (const feeder of feeders.values()) {
147
+ const wnFeeder = feeder as WNFeeder;
148
+ // Konten
149
+ if (node && wnFeeder.normalEnergizedConnectivityNodes.has(elementUUID)) {
150
+ return true;
151
+ }
152
+ //Equipment
153
+ if (!node && wnFeeder.additionalGroupedEquipment.has(elementUUID)) {
154
+ return true;
155
+ }
156
+ }
157
+ return false;
158
+ }
@@ -0,0 +1,84 @@
1
+ import { Edge } from './edges/edge';
2
+ import { GraphObject, Node } from './nodes/node';
3
+ import { Connection } from './connections/connection';
4
+ import { ResultBFS } from './graph-interfaces';
5
+
6
+ export class Graph {
7
+
8
+ nodes: Map<string, Node> = new Map();
9
+ edges: Map<string, Edge> = new Map();
10
+ terminals: Map<string, Connection> = new Map();
11
+
12
+ constructor() { }
13
+
14
+ addNode(node: Node) {
15
+ this.nodes.set(node.uuid, node);
16
+ }
17
+
18
+ addEdge(edge: Edge) {
19
+ this.edges.set(edge.uuid, edge);
20
+ }
21
+ addTerminal(terminal: Connection) {
22
+ this.terminals.set(terminal.uuid, terminal);
23
+ }
24
+
25
+ /** Breitensuche zur Bestimmung der Slackerreichbarkeit */
26
+ isObjectReachableBFS(startNode: Node, toObjectUUID: string []): ResultBFS {
27
+ let pathNodeList: GraphObject [] = [];
28
+ let nodesOnCurrentLevel: GraphObject [];
29
+ let nodesOnNextLevel: GraphObject [] = [startNode];
30
+ let nodesVisited: string [] = [];
31
+ let foundNode = false;
32
+ const visitedStations = [];
33
+ while (!foundNode) {
34
+
35
+ nodesOnCurrentLevel = [];
36
+ nodesOnCurrentLevel = [...nodesOnNextLevel];
37
+ nodesOnNextLevel = [];
38
+
39
+ // gibt nichts mehr zu entdecken
40
+ if (nodesOnCurrentLevel.length === 0) break;
41
+ for (const currentNode of nodesOnCurrentLevel) {
42
+ nodesVisited.push(currentNode.uuid);
43
+ /** Wenn gefunden, dann abbruch*/
44
+ if (foundNode) break;
45
+ /** Wenn ausgefallen, dann abbruch*/
46
+ if (!currentNode.canPassThrough()) break;
47
+ for (const terminal of currentNode.terminals.values()) {
48
+ if (terminal.canPassThrough() && nodesVisited.indexOf(terminal.uuid) === -1) {
49
+ nodesVisited.push(terminal.uuid);
50
+ if (toObjectUUID.indexOf(terminal.edge.uuid) !== -1 || toObjectUUID.indexOf(terminal.node.uuid) !== -1) {
51
+ foundNode = true;
52
+ break;
53
+ } else {
54
+ /** suche weiter*/
55
+ if (nodesVisited.indexOf(terminal.node.uuid) === -1 && terminal.node.canPassThrough()) nodesOnNextLevel.push(terminal.node);
56
+ if (nodesVisited.indexOf(terminal.edge.uuid) === -1) nodesOnNextLevel.push(terminal.edge);
57
+ }
58
+ }
59
+ }
60
+ if(currentNode.constructor.name === 'Node') visitedStations.push(currentNode);
61
+
62
+ }
63
+ }
64
+
65
+ return {
66
+ found: foundNode,
67
+ nodesVisited: visitedStations
68
+ };
69
+ }
70
+
71
+ getObject(uuid: string): any {
72
+ if (this.terminals.has(uuid)) {
73
+ return this.terminals.get(uuid);
74
+ }
75
+ if (this.nodes.has(uuid)) {
76
+ return this.nodes.get(uuid);
77
+ }
78
+ if (this.edges.has(uuid)) {
79
+ return this.edges.get(uuid);
80
+ }
81
+ }
82
+
83
+ }
84
+
@@ -0,0 +1,43 @@
1
+ import { Connection } from '../connections/connection';
2
+
3
+ export class GraphObject {
4
+ uuid: string;
5
+ visited: boolean = false;
6
+ terminals: Map<string, Connection> = new Map();
7
+
8
+ constructor(uuid: string) {
9
+ this.uuid = uuid;
10
+ }
11
+
12
+ canPassThrough(): boolean {
13
+ return false
14
+ }
15
+
16
+ addTerminal(termnal: Connection) {
17
+ this.terminals.set(termnal.uuid, termnal);
18
+ }
19
+ }
20
+
21
+
22
+ export class Node extends GraphObject {
23
+ inService: boolean;
24
+ constructor(uuid: string) {
25
+ super(uuid);
26
+ this.inService = true;
27
+ }
28
+
29
+ canPassThrough(): boolean {
30
+ return this.inService;
31
+ }
32
+
33
+ /* isSlackReachable(): boolean {
34
+ if (this.inService && !this.visited) {
35
+ this.visited = true;
36
+ for (const term of this.terminals.values()) {
37
+ term.isSlackReachable();
38
+ }
39
+ }
40
+ return false;
41
+ }*/
42
+
43
+ }
package/src/index.ts CHANGED
@@ -196,6 +196,14 @@ export { UnitSymbol } from './model/domain/UnitSymbol';
196
196
  export { Status } from './model/common/Status';
197
197
 
198
198
 
199
+ // Amprion
200
+ export { AMPRIONConstructionProject } from './model/extensions/amprion/project/AMPRIONConstructionProject';
201
+ export { AMPRIONErpProjectPhase } from './model/extensions/amprion/project/AMPRIONErpProjectPhase';
202
+ export { AMPRIONConstructionProjectBundle } from './model/extensions/amprion/project/AMPRIONConstructionProjectBundle';
203
+ export { AMPRIONConstructionProjectPlan } from './model/extensions/amprion/project/AMPRIONConstructionProjectPlan';
204
+ export { AMPRIONErpProject } from './model/extensions/amprion/project/AMPRIONErpProject';
205
+ export { AMPRIONErpProjectStructure } from './model/extensions/amprion/project/AMPRIONErpProjectStructure';
206
+
199
207
  export {
200
208
  NS_PREFIX_CIM,
201
209
  NS_PREFIX_ENERVANCE,
@@ -38,8 +38,8 @@ export abstract class ACDCTerminal extends IdentifiedObject implements IACDCTerm
38
38
 
39
39
  protected resolveAttributesFusekiJSON(value: any) {
40
40
  super.resolveAttributesFusekiJSON(value);
41
- this.sequenceNumber = +getValue(value, 'sequenceNumber'),
42
- this.connected = toBoolean(getValue(value, 'connected'))
41
+ this.sequenceNumber = +getValue(value, 'sequenceNumber');
42
+ this.connected = toBoolean(getValue(value, 'connected'));
43
43
 
44
44
  }
45
45
 
@@ -186,8 +186,8 @@ export class ConnectivityNode extends IdentifiedObject implements IConnectivityN
186
186
 
187
187
 
188
188
  public determineMidVoltageLineElements(feederLineElemenets: IIdentifiedObject[], slackSubstationElements: IIdentifiedObject[][]) {
189
- if (!this.visited && !isInArray(this, slackSubstationElements)) {
190
- this.addNetworkElement(feederLineElemenets);
189
+ if (!this.visited /*&& !isInArray(this, slackSubstationElements)*/) {
190
+ if (!isInArray(this, slackSubstationElements)) this.addNetworkElement(feederLineElemenets);
191
191
  // 0 = key, 1 = value
192
192
  for (const entry of this.terminals.entries()) {
193
193
  const value = entry[1];
@@ -144,11 +144,11 @@ export class PSRType extends IdentifiedObject{
144
144
 
145
145
  /** CIM RDF/XML Serialisierung */
146
146
  public toCIMXML(xmlWriter: XMLWriter, profile: string) {
147
- if(!profile || profile === '') {
147
+ if(!profile || profile === RDF_XML.PROFILE_AMPI7) {
148
148
  xmlWriter.startElementNS(RDF_XML.CIM_NS_PREFIX, 'PSRType', RDF_XML.CIM_NS_16);
149
149
  writeElementAttribute(xmlWriter, RDF_XML.RDF_ID, `${RDF_XML.UNDERSCORE}${this.mrid}`);
150
- this.toCIMXMLAttributes(xmlWriter, profile);
151
- this.toCIMXMLAssociations(xmlWriter, profile);
150
+ this.toCIMXMLAttributes(xmlWriter, undefined);
151
+ this.toCIMXMLAssociations(xmlWriter, undefined);
152
152
  xmlWriter.endElement();
153
153
  }
154
154
  }
@@ -161,7 +161,4 @@ export class PSRType extends IdentifiedObject{
161
161
  super.toCIMXMLAssociations(xmlWriter, profile);
162
162
  }
163
163
 
164
- protected getSuffixID(profile: string): string {
165
- return RDF_XML.RDF_ID
166
- }
167
164
  }
@@ -68,13 +68,9 @@ export class PowerSystemResource extends IdentifiedObject implements IPowerSyste
68
68
  protected toCIMXMLAssociations(xmlWriter: XMLWriter, profile: string) {
69
69
  super.toCIMXMLAssociations(xmlWriter, profile);
70
70
  /*<cim:VoltageLevel.Substation rdf:resource="#_1be806f9-0316-4bb8-b350-f54a292353f1"/>*/
71
- if(profile !== RDF_XML.PROFILE_EQ && profile !== RDF_XML.PROFILE_DL && profile !== RDF_XML.PROFILE_GL &&
72
- profile !== RDF_XML.PROFILE_SSH && profile !== RDF_XML.PROFILE_SV && profile !== RDF_XML.PROFILE_TP) {
73
- if(this.psrType) {
74
- xmlWriter.startElementNS(RDF_XML.CIM_NS_PREFIX, 'PowerSystemResource.PSRType', RDF_XML.CIM_NS_16);
75
- writeElementAttribute(xmlWriter, RDF_XML.RDF_RESRC, `${RDF_XML.HASH_UNDERSCORE}${this.psrType.mrid}`);
76
- xmlWriter.endElement();
77
- } else if(this.psrTypeUUID) {
71
+ if(!profile || profile === RDF_XML.PROFILE_AMPI7) {
72
+ this.psrTypeUUID = this.psrType ? this.psrType.mrid: this.psrTypeUUID;
73
+ if(this.psrTypeUUID) {
78
74
  xmlWriter.startElementNS(RDF_XML.CIM_NS_PREFIX, 'PowerSystemResource.PSRType', RDF_XML.CIM_NS_16);
79
75
  writeElementAttribute(xmlWriter, RDF_XML.RDF_RESRC, `${RDF_XML.HASH_UNDERSCORE}${this.psrTypeUUID}`);
80
76
  xmlWriter.endElement();
@@ -8,6 +8,7 @@ import { RDF_XML } from '../../constants/rdf-xml';
8
8
  import { SubGeographicalRegion } from './SubGeographicalRegion';
9
9
  import { Feeder } from './Feeder';
10
10
  import { DiagramObject, IRectangleShapeInfo, ISchemaSettings } from '../..';
11
+ import { DCConverterUnit } from '../dc/DCConverterUnit';
11
12
 
12
13
  export class Substation extends EquipmentContainer {
13
14
 
@@ -16,6 +17,7 @@ export class Substation extends EquipmentContainer {
16
17
  voltageLevels: VoltageLevel[];
17
18
  bays: Bay[];
18
19
 
20
+ dcConverterUnit: Map<string, DCConverterUnit>
19
21
  /** The feeders that potentially energize the downstream substation. */
20
22
  normalEnergizingFeeder: Map<string, Feeder>;
21
23
 
@@ -28,6 +30,7 @@ export class Substation extends EquipmentContainer {
28
30
  this.bays = [];
29
31
  this.normalEnergizingFeeder = new Map();
30
32
  this.normalEnergizedFeeder = new Map();
33
+ this.dcConverterUnit = new Map();
31
34
  }
32
35
 
33
36
 
@@ -39,6 +42,9 @@ export class Substation extends EquipmentContainer {
39
42
  this.bays.push(bay);
40
43
  }
41
44
 
45
+ public addDCConverterUnit(dcConverterUnit: DCConverterUnit) {
46
+ this.dcConverterUnit.set(dcConverterUnit.mrid, dcConverterUnit);
47
+ }
42
48
  public static sparqlQuery: string = `
43
49
  PREFIX cim: <http://iec.ch/TC57/2013/CIM-schema-cim16#>
44
50
  PREFIX enervance: <http://enervance.com/CIM/Extensions#>
@@ -18,6 +18,7 @@ import { IdentifiedObject } from './IdentifiedObject';
18
18
  import { ITerminal } from '../../interfaces/model/core/ITerminal';
19
19
  import { ISvPowerFlow } from '../../interfaces/model/statevariables/ISvPowerFlow';
20
20
  import { IFeeder } from '../../interfaces/model/core/IFeeder';
21
+ import { ACDCConverter } from '../dc/ACDCConverter';
21
22
 
22
23
  export class Terminal extends ACDCTerminal implements ITerminal {
23
24
 
@@ -39,6 +40,13 @@ export class Terminal extends ACDCTerminal implements ITerminal {
39
40
 
40
41
  regulatingControl: Map<string, RegulatingControl>;
41
42
 
43
+ /** DC Model */
44
+
45
+ /** Point of common coupling terminal for this converter DC side.
46
+ * It is typically the terminal on the power transformer (or switch) closest to the AC network.
47
+ * The power flow measurement must be the sum of all flows into the transformer.*/
48
+ converterDCSides: ACDCConverter;
49
+
42
50
  /** The feeder that this terminal normally feeds. Only specified for the terminals at head of feeders.*/
43
51
  normalHeadFeeder: IFeeder;
44
52
  normalHeadFeederUUID: string;
@@ -248,13 +256,14 @@ export class Terminal extends ACDCTerminal implements ITerminal {
248
256
  if (this.connectivityNode) {
249
257
  this.connectivityNode.breadthFirstSearch(networkElements);
250
258
  }
251
- // if(this.topologicalNode){
252
- // this.topologicalNode.breadthFirstSearch(networkElements);
253
- // }
254
259
  if (this.conductingEquipment) {
255
260
  this.conductingEquipment.breadthFirstSearch(networkElements);
256
261
  }
257
262
  }
263
+ //TESTEN!
264
+ /* if (!this.visited && !this.isClosed()) {
265
+ this.addNetworkElement(networkElements);
266
+ }*/
258
267
  }
259
268
 
260
269
  public determineTopologicalNodes(connNodes: IConnectivityNode[]) {
@@ -301,7 +310,7 @@ export class Terminal extends ACDCTerminal implements ITerminal {
301
310
  }
302
311
 
303
312
 
304
- /* Bestimmt alle zum Slack gehörende Netzelemente (CN, Terminals Sammelschienen, Trafos)*/
313
+ /** Bestimmt alle zum Slack gehörende Netzelemente (CN, Terminals Sammelschienen, Trafos)*/
305
314
  public determineSlackNodes(slackElemenets: IIdentifiedObject[]) {
306
315
  if (!this.visited) {
307
316
  this.addNetworkElement(slackElemenets);
@@ -317,10 +326,10 @@ export class Terminal extends ACDCTerminal implements ITerminal {
317
326
  }
318
327
 
319
328
  public determineMidVoltageLineElements(feederLineElemenets: IIdentifiedObject[], slackSubstationElements: IIdentifiedObject[][]) {
320
- if (!this.visited && this.isClosed() && !isInArray(this, slackSubstationElements)) {
329
+ if (!this.visited && this.isClosed() /*&& !isInArray(this, slackSubstationElements)*/) {
321
330
  this.addNetworkElement(feederLineElemenets);
322
331
 
323
- if (this.conductingEquipment) {
332
+ if (this.conductingEquipment && !isInArray(this.conductingEquipment, slackSubstationElements)) {
324
333
  this.conductingEquipment.determineMidVoltageLineElements(feederLineElemenets, slackSubstationElements);
325
334
  }
326
335
 
@@ -61,7 +61,6 @@ export class VoltageLevel extends EquipmentContainer {
61
61
  PREFIX enervance: <http://enervance.com/CIM/Extensions#>
62
62
  PREFIX entsoe: <http://entsoe.eu/CIM/SchemaExtension/3/1#>
63
63
  PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
64
- PREFIX amp: <http://amprion.net/2018/cim_extensions#>
65
64
  PREFIX apf: <http://jena.hpl.hp.com/ARQ/property#>
66
65
  PREFIX afn: <http://jena.apache.org/ARQ/function#>
67
66
 
@@ -0,0 +1,66 @@
1
+ import { ConductingEquipment } from '../core/ConductingEquipment';
2
+ import { Terminal } from '../core/Terminal';
3
+ import { ACDCConverterDCTerminal } from './ACDCConverterDCTerminal';
4
+ import { RDF_XML } from '../../constants/rdf-xml';
5
+ import { writeElement, writeElementAttribute } from '../../util/utils';
6
+ import { DCConverterOperatingModeKind } from './DCConverterOperatingModeKind';
7
+ import XMLWriter from 'xml-writer';
8
+
9
+ export class ACDCConverter extends ConductingEquipment {
10
+
11
+ /** Base apparent power of the converter pole */
12
+ baseS: number;
13
+ /** Active power loss in pole at no power transfer. Converter configuration data used in power flow. */
14
+ idleLoss: number;
15
+
16
+ /** The maximum voltage on the DC side at which the converter should operate. Converter configuration data used in power flow.*/
17
+ maxUdc: number;
18
+
19
+ /** Min allowed converter DC voltage. Converter configuration data used in power flow. */
20
+ minUdc: number;
21
+
22
+ /** Number of valves in the converter. Used in loss calculations. */
23
+ numberOfValves: number;
24
+
25
+ /** Rated converter DC voltage, also called UdN. Converter configuration data used in power flow. */
26
+ ratedUdc: number;
27
+
28
+ /** Converter configuration data used in power flow. Refer to poleLossP. */
29
+ resistiveLoss: number;
30
+
31
+ /** Switching losses, relative to the base apparent power 'baseS'.
32
+ Refer to poleLossP.*/
33
+ switchingLoss: number;
34
+
35
+ /** Valve threshold voltage. Forward voltage drop when the valve is conducting. Used in loss calculations, i.e. the switchLoss depend on numberOfValves * valveU0. */
36
+ valveU0: number;
37
+
38
+
39
+ /** All converters' DC sides linked to this point of common coupling terminal.*/
40
+ pccTerminal: Terminal;
41
+ pccTerminalUUID: string;
42
+
43
+ dCTerminals: Map<string,ACDCConverterDCTerminal> = new Map();
44
+
45
+
46
+ //SSH Profil
47
+ p: number; //ActivePower mandatory
48
+ q: number; //ReactivePower mandatory
49
+ targetPpcc: number; //ActivePower mandatory
50
+ targetUdc:number; //Voltage mandatory
51
+
52
+ protected toCIMXMLAttributes(xmlWriter: XMLWriter, profile: string) {
53
+ super.toCIMXMLAttributes(xmlWriter, profile);
54
+ if (profile === RDF_XML.PROFILE_EQ) {
55
+ if (this.baseS > 0) writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACDCConverter.baseS`, this.baseS);
56
+ if (this.idleLoss) writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACDCConverter.idleLoss`, this.idleLoss);
57
+ if (this.maxUdc) writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACDCConverter.maxUdc`, this.maxUdc);
58
+ if (this.minUdc) writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACDCConverter.minUdc`, this.minUdc);
59
+
60
+ if (this.ratedUdc) writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACDCConverter.ratedUdc`, this.ratedUdc);
61
+ if (this.resistiveLoss) writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACDCConverter.resistiveLoss`, this.resistiveLoss);
62
+ if (this.switchingLoss) writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:ACDCConverter.switchingLoss`, this.switchingLoss);
63
+ }
64
+ }
65
+
66
+ }
@@ -0,0 +1,64 @@
1
+ import { DCBaseTerminal } from './DCBaseTerminal';
2
+ import { DCPolarityKind } from './DCPolarityKind';
3
+ import { ACDCConverter } from './ACDCConverter';
4
+ import { RDF_XML } from '../../constants/rdf-xml';
5
+ import { writeElement, writeElementAttribute } from '../../util/utils';
6
+ import XMLWriter from 'xml-writer';
7
+
8
+ export class ACDCConverterDCTerminal extends DCBaseTerminal {
9
+
10
+ polarity: DCPolarityKind;
11
+
12
+ dCConductingEquipment: ACDCConverter; // mandatory
13
+ dCConductingEquipmentUUID: string;
14
+
15
+ constructor(uuid?: string, name?: string, shortName?: string, description?: string) {
16
+ super(uuid, name, shortName, description);
17
+ }
18
+
19
+ /** CIM RDF/XML Serialisierung */
20
+ public toCIMXML(xmlWriter: XMLWriter, profile: string) {
21
+ if (profile === RDF_XML.PROFILE_EQ) {
22
+ const suffixID = this.getSuffixID(profile);
23
+ const prefixUUID = this.getPrefixUUID(suffixID);
24
+ xmlWriter.startElementNS(RDF_XML.CIM_NS_PREFIX, this.constructor.name, RDF_XML.CIM_NS_16);
25
+ writeElementAttribute(xmlWriter, suffixID, `${prefixUUID}${this.mrid}`);
26
+ this.toCIMXMLAttributes(xmlWriter, profile);
27
+ this.toCIMXMLAssociations(xmlWriter, profile);
28
+ xmlWriter.endElement();
29
+ }
30
+ }
31
+
32
+
33
+ protected toCIMXMLAttributes(xmlWriter: XMLWriter, profile: string) {
34
+ super.toCIMXMLAttributes(xmlWriter, profile);
35
+ if (profile === RDF_XML.PROFILE_EQ) {
36
+ if (this.polarity) {
37
+ xmlWriter.startElementNS(RDF_XML.CIM_NS_PREFIX, `${this.constructor.name}.polarity`, RDF_XML.CIM_NS_16);
38
+ writeElementAttribute(xmlWriter, RDF_XML.RDF_RESRC, `${RDF_XML.CIM_NS_16}DCPolarityKind.${this.polarity}`);
39
+ xmlWriter.endElement();
40
+ }
41
+ }
42
+ }
43
+
44
+
45
+ protected toCIMXMLAssociations(xmlWriter: XMLWriter, profile: string) {
46
+ super.toCIMXMLAssociations(xmlWriter, profile);
47
+ if (profile === RDF_XML.PROFILE_EQ) {
48
+ if (this.dCConductingEquipment) {
49
+ xmlWriter.startElementNS(RDF_XML.CIM_NS_PREFIX, 'ACDCConverterDCTerminal.DCConductingEquipment', RDF_XML.CIM_NS_16);
50
+ writeElementAttribute(xmlWriter, RDF_XML.RDF_RESRC, `${RDF_XML.HASH_UNDERSCORE}${this.dCConductingEquipment.mrid}`);
51
+ xmlWriter.endElement();
52
+ } else if (this.dCConductingEquipmentUUID) {
53
+ xmlWriter.startElementNS(RDF_XML.CIM_NS_PREFIX, 'ACDCConverterDCTerminal.DCConductingEquipment', RDF_XML.CIM_NS_16);
54
+ writeElementAttribute(xmlWriter, RDF_XML.RDF_RESRC, `${RDF_XML.HASH_UNDERSCORE}${this.dCConductingEquipmentUUID}`);
55
+ xmlWriter.endElement();
56
+ } else {
57
+ if (this.constructor.name === 'DCLineSegment') {
58
+ xmlWriter.writeComment('DCConductingEquipment is not defined');
59
+ }
60
+ }
61
+ }
62
+ }
63
+
64
+ }
@@ -0,0 +1,68 @@
1
+ import { ACDCConverter } from './ACDCConverter';
2
+ import { RDF_XML } from '../../constants/rdf-xml';
3
+ import { writeElement, writeElementAttribute } from '../../util/utils';
4
+
5
+ import XMLWriter from 'xml-writer';
6
+ import { CsOperatingModeKind } from './CsOperatingModeKind';
7
+ import { CsPpccControlKind } from './CsPpccControlKind';
8
+
9
+ export class CsConverter extends ACDCConverter {
10
+
11
+ /** Maximum firing angle. CSC configuration data used in power flow. */
12
+ maxAlpha: number;
13
+ /** Maximum extinction angle. CSC configuration data used in power flow. */
14
+ maxGamma: number;
15
+
16
+ /** The maximum direct current (Id) on the DC side at which the converter should operate. Converter configuration data use in power flow. */
17
+ maxIdc: number;
18
+
19
+ /** Minimum firing angle. CSC configuration data used in power flow. */
20
+ minAlpha: number;
21
+
22
+ /** Minimum extinction angle. CSC configuration data used in power flow.*/
23
+ minGamma: number;
24
+
25
+ /** The minimum direct current (Id) on the DC side at which the converter should operate. CSC configuration data used in power flow. */
26
+ minIdc: number;
27
+
28
+ /** Rated converter DC current, also called IdN. Converter configuration data used in power flow. */
29
+ ratedIdc: number;
30
+
31
+ //SSH Profil
32
+ operatingMode: CsOperatingModeKind; //mandatory
33
+ pPccControl: CsPpccControlKind; //mandatory
34
+ targetAlpha: number; //ActivePower mandatory
35
+ targetGamma: number; //ActivePower mandatory
36
+ targetIdc: number; //ActivePower mandatory
37
+
38
+ constructor(uuid?: string, name?: string, shortName?: string, description?: string) {
39
+ super(uuid, name, shortName, description);
40
+ }
41
+
42
+ /** CIM RDF/XML Serialisierung */
43
+ public toCIMXML(xmlWriter: XMLWriter, profile: string) {
44
+ if (profile === RDF_XML.PROFILE_EQ) {
45
+ const suffixID = this.getSuffixID(profile);
46
+ const prefixUUID = this.getPrefixUUID(suffixID);
47
+ xmlWriter.startElementNS(RDF_XML.CIM_NS_PREFIX, this.constructor.name, RDF_XML.CIM_NS_16);
48
+ writeElementAttribute(xmlWriter, suffixID, `${prefixUUID}${this.mrid}`);
49
+ this.toCIMXMLAttributes(xmlWriter, profile);
50
+ this.toCIMXMLAssociations(xmlWriter, profile);
51
+ xmlWriter.endElement();
52
+ }
53
+ }
54
+
55
+ protected toCIMXMLAttributes(xmlWriter: XMLWriter, profile: string) {
56
+ super.toCIMXMLAttributes(xmlWriter, profile);
57
+ if (profile === RDF_XML.PROFILE_EQ) {
58
+ if (this.maxAlpha > 0) writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:CsConverter.maxAlpha`, this.maxAlpha);
59
+ if (this.minAlpha > 0) writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:CsConverter.minAlpha`, this.minAlpha);
60
+ if (this.maxGamma > 0) writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:CsConverter.maxGamma`, this.maxGamma);
61
+ if (this.minGamma > 0) writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:CsConverter.minGamma`, this.minGamma);
62
+ if (this.maxIdc > 0) writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:CsConverter.maxIdc`, this.maxIdc);
63
+ if (this.minIdc > 0) writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:CsConverter.minIdc`, this.minIdc);
64
+ if (this.ratedIdc > 0) writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:CsConverter.ratedIdc`, this.ratedIdc);
65
+ }
66
+ }
67
+
68
+ }