@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
@@ -1,29 +1,29 @@
1
- import {ConductingEquipment} from '../core/ConductingEquipment';
1
+ import { ConductingEquipment } from '../core/ConductingEquipment';
2
2
  import { Voltage } from '../domain/Voltage';
3
3
  import { Model } from '../model/Model';
4
4
  import { ConnectivityNode } from '../core/ConnectivityNode';
5
5
 
6
6
  import { DiagramObject } from '../diagram/DiagramObject';
7
- import {IRectangleShapeInfo, ISchemaSettings} from '../../interfaces/schema-settings/ShapeInfos';
7
+ import { IRectangleShapeInfo, ISchemaSettings } from '../../interfaces/schema-settings/ShapeInfos';
8
8
  import { getValue, writeElement, writeElementAttribute } from '../../util/utils';
9
9
  import { CIM_CLASS_NAMES } from '../../constants/cim-class-names';
10
10
 
11
11
  import {
12
- NS_PREFIX_AFN,
13
- NS_PREFIX_APF,
14
- NS_PREFIX_CIM,
15
- NS_PREFIX_ENERVANCE,
16
- NS_PREFIX_ENTSOE,
17
- NS_PREFIX_RDF,
12
+ NS_PREFIX_AFN,
13
+ NS_PREFIX_APF,
14
+ NS_PREFIX_CIM,
15
+ NS_PREFIX_ENERVANCE,
16
+ NS_PREFIX_ENTSOE,
17
+ NS_PREFIX_RDF,
18
18
  } from '../../util/sparql/sparql-building-block';
19
19
  import { convertValue } from '../../util/datatype-converter';
20
20
  import XMLWriter from 'xml-writer';
21
21
  import { RDF_XML } from '../../constants/rdf-xml';
22
22
  import { IConnectivityNode, IdentifiedObject } from "../..";
23
23
 
24
- export class EnergySource extends ConductingEquipment{
24
+ export class EnergySource extends ConductingEquipment {
25
25
 
26
- public static sparqlQuery : string = `
26
+ public static sparqlQuery: string = `
27
27
  ${NS_PREFIX_CIM}
28
28
  ${NS_PREFIX_ENERVANCE}
29
29
  ${NS_PREFIX_ENTSOE}
@@ -70,234 +70,268 @@ export class EnergySource extends ConductingEquipment{
70
70
  ?r ?r0 ?rx ?x ?x0 ?xn ?nominalVoltage ?voltageMagnitude ?voltageAngle ?ecUUID ?ptUUID
71
71
  `
72
72
 
73
- activePower: number;
74
- reactivePower: number;
75
-
76
- r: number;
77
- r0: number;
78
- rn: number;
79
- x: number;
80
- x0: number;
81
- xn: number;
82
-
83
- nominalVoltage: Voltage;
84
- nominalVoltageValue: number;
85
- //voltageMagnitude
86
- //voltageAngle
87
-
88
-
89
- constructor(uuid?: string, name?: string, shortName?: string, description?: string){
90
- super(uuid, name, shortName, description);
91
-
92
- this.prop2namespacePrefix.set('activePower', 'cim'); // zur Generierung der Insert-Statements
93
- this.prop2Class.set('activePower', 'EnergySource');
94
- this.prop2Datatype.set('activePower', 'number');
95
-
96
- this.prop2namespacePrefix.set('reactivePower', 'cim'); // zur Generierung der Insert-Statements
97
- this.prop2Class.set('reactivePower', 'EnergySource');
98
- this.prop2Datatype.set('reactivePower', 'number');
99
-
100
- }
101
-
102
- public print(){
103
- super.print();
104
- console.log('\tactivePower ' + this.activePower + ' reactivePower ' + this.reactivePower);
105
- }
106
-
107
-
108
- public toGeoJSON (geoJSON: any, profile: string, schemaSettings: ISchemaSettings, diagramObject?: DiagramObject): any {
109
-
110
- const coordinates : number[] = diagramObject.computeRectBounds(diagramObject);
111
- const shapeInfos: IRectangleShapeInfo = schemaSettings.getRectangleShapeInfo(profile);
112
-
113
- const x = coordinates[0];
114
- const y = coordinates[1] * -1;
115
- const width = coordinates[2] == 1 ? +shapeInfos.width : coordinates[2];
116
- const height = (coordinates[3] == 1 ? +shapeInfos.height : coordinates[3]) * -1;
117
- const offsetX = width == 1 ? +width/2 : 0;
118
- const offsetY = height == 1 ? +height/2 : 0;
119
-
120
- if(x != 0 && y != 0 && width != 0 && height != 0) {
121
- super.toGeoJSON(geoJSON, profile, schemaSettings, diagramObject);
122
-
123
- const pointsPolygon : number[][][] = [
124
- [
125
- [x - offsetX, y - offsetY],
126
- [x + width, y],
127
- [x + width, y + height],
128
- [x, y + height],
129
- [x - offsetX, y - offsetY]
130
- ]
131
- ];
132
- geoJSON['geometry'] = {
133
- type: 'Polygon',
134
- coordinates: pointsPolygon
135
- }
136
-
137
- geoJSON['properties'] = {
138
- diagramObjectUUID: diagramObject.mrid,
139
- objectType: this.constructor.name,
140
- }
141
- }
142
- return geoJSON;
143
- }
144
-
145
- public static getQuerySPARQL(graphURI : string) : string{
146
- if(graphURI.length > 0){
147
- return EnergySource.sparqlQuery.replace('<http://default/>', graphURI);
148
- }
149
- return EnergySource.sparqlQuery;
150
- }
151
-
152
- public static resolveClassFusekiJSON(data: any, cimModel: Model){
153
- data.results.bindings.forEach((value: any) => {
154
- const newClass = new EnergySource();
155
- newClass.resolveAttributesFusekiJSON(value);
156
- cimModel.addEnergySource(newClass);
157
- });
158
- }
159
-
160
- protected resolveAttributesFusekiJSON(value: any){
161
- super.resolveAttributesFusekiJSON(value);
162
- this.activePower = +getValue(value, 'activePower');
163
- this.reactivePower = +getValue(value, 'reactivePower');
164
- this.nominalVoltageValue = +getValue(value, 'nominalVoltage');
165
- }
166
- public resolveParsedAssociations(cimModel: Model){
167
- super.resolveParsedAssociations(cimModel);
168
- const voltage = cimModel.getVoltage(this.nominalVoltageValue)
169
- this.nominalVoltage = voltage;
170
- }
171
-
172
-
173
-
174
- public toJSON(){
175
- super.toJSON();
176
- this.toJSONAttributes();
177
- this.toJSONAssociations();
178
- return this.json;
179
- }
180
-
181
- public toJSONAttributes(){
182
- super.toJSONAttributes();
183
- this.json['activePower'] = this.activePower;
184
- this.json['reactivePower'] = this.reactivePower;
185
-
73
+ activePower: number;
74
+ reactivePower: number;
75
+
76
+ r: number;
77
+ r0: number;
78
+ rn: number;
79
+ x: number;
80
+ x0: number;
81
+ xn: number;
82
+
83
+ nominalVoltage: Voltage;
84
+ nominalVoltageValue: number;
85
+ //voltageMagnitude
86
+ //voltageAngle
87
+
88
+
89
+ constructor(uuid?: string, name?: string, shortName?: string, description?: string) {
90
+ super(uuid, name, shortName, description);
91
+
92
+ this.prop2namespacePrefix.set('activePower', 'cim'); // zur Generierung der Insert-Statements
93
+ this.prop2Class.set('activePower', 'EnergySource');
94
+ this.prop2Datatype.set('activePower', 'number');
95
+
96
+ this.prop2namespacePrefix.set('reactivePower', 'cim'); // zur Generierung der Insert-Statements
97
+ this.prop2Class.set('reactivePower', 'EnergySource');
98
+ this.prop2Datatype.set('reactivePower', 'number');
99
+
100
+ }
101
+
102
+ public print() {
103
+ super.print();
104
+ console.log('\tactivePower ' + this.activePower + ' reactivePower ' + this.reactivePower);
105
+ }
106
+
107
+
108
+ public toGeoJSON(geoJSON: any, profile: string, schemaSettings: ISchemaSettings, diagramObject?: DiagramObject): any {
109
+
110
+ const coordinates: number[] = diagramObject.computeRectBounds(diagramObject);
111
+ const shapeInfos: IRectangleShapeInfo = schemaSettings.getRectangleShapeInfo(profile);
112
+
113
+ const x = coordinates[0];
114
+ const y = coordinates[1] * -1;
115
+ const width = coordinates[2] == 1 ? +shapeInfos.width : coordinates[2];
116
+ const height = (coordinates[3] == 1 ? +shapeInfos.height : coordinates[3]) * -1;
117
+ const offsetX = width == 1 ? +width / 2 : 0;
118
+ const offsetY = height == 1 ? +height / 2 : 0;
119
+
120
+ if (x != 0 && y != 0 && width != 0 && height != 0) {
121
+ super.toGeoJSON(geoJSON, profile, schemaSettings, diagramObject);
122
+
123
+ const pointsPolygon: number[][][] = [
124
+ [
125
+ [x - offsetX, y - offsetY],
126
+ [x + width, y],
127
+ [x + width, y + height],
128
+ [x, y + height],
129
+ [x - offsetX, y - offsetY]
130
+ ]
131
+ ];
132
+ geoJSON['geometry'] = {
133
+ type: 'Polygon',
134
+ coordinates: pointsPolygon
135
+ }
136
+
137
+ geoJSON['properties'] = {
138
+ diagramObjectUUID: diagramObject.mrid,
139
+ objectType: this.constructor.name,
140
+ }
186
141
  }
142
+ return geoJSON;
143
+ }
187
144
 
188
- public toJSONAssociations(){
189
- super.toJSONAssociations();
145
+ public static getQuerySPARQL(graphURI: string): string {
146
+ if (graphURI.length > 0) {
147
+ return EnergySource.sparqlQuery.replace('<http://default/>', graphURI);
190
148
  }
191
-
192
- public determineGridIslands(networkElements: any []){
193
- super.determineGridIslands(networkElements);
149
+ return EnergySource.sparqlQuery;
150
+ }
151
+
152
+ public static resolveClassFusekiJSON(data: any, cimModel: Model) {
153
+ data.results.bindings.forEach((value: any) => {
154
+ const newClass = new EnergySource();
155
+ newClass.resolveAttributesFusekiJSON(value);
156
+ cimModel.addEnergySource(newClass);
157
+ });
158
+ }
159
+
160
+ protected resolveAttributesFusekiJSON(value: any) {
161
+ super.resolveAttributesFusekiJSON(value);
162
+ this.activePower = +getValue(value, 'activePower');
163
+ this.reactivePower = +getValue(value, 'reactivePower');
164
+ this.nominalVoltageValue = +getValue(value, 'nominalVoltage');
165
+ }
166
+
167
+ public resolveParsedAssociations(cimModel: Model) {
168
+ super.resolveParsedAssociations(cimModel);
169
+ const voltage = cimModel.getVoltage(this.nominalVoltageValue)
170
+ this.nominalVoltage = voltage;
171
+ }
172
+
173
+
174
+ public toJSON() {
175
+ super.toJSON();
176
+ this.toJSONAttributes();
177
+ this.toJSONAssociations();
178
+ return this.json;
179
+ }
180
+
181
+ public toJSONAttributes() {
182
+ super.toJSONAttributes();
183
+ this.json['activePower'] = this.activePower;
184
+ this.json['reactivePower'] = this.reactivePower;
185
+
186
+ }
187
+
188
+ public toJSONAssociations() {
189
+ super.toJSONAssociations();
190
+ }
191
+
192
+ public determineGridIslands(networkElements: any []) {
193
+ super.determineGridIslands(networkElements);
194
+ }
195
+
196
+ public breadthFirstSearch(networkElements: any[]) {
197
+ if (!this.visited) {
198
+ this.addNetworkElement(networkElements);
199
+ super.breadthFirstSearch(networkElements);
194
200
  }
201
+ }
202
+
203
+ //hier endet der Aufruf
204
+ public determineTopologicalNodes(connNodes: IConnectivityNode[]) {
205
+ return;
206
+ }
207
+
208
+ public isLoadOrFeed(): boolean {
209
+ return true;
210
+ }
211
+
212
+ public getApparentPower() {
213
+ return Math.sqrt(Math.pow(this.activePower ? this.activePower : 0, 2) +
214
+ Math.pow(this.reactivePower ? this.reactivePower : 0, 2));
215
+ }
216
+
217
+ /** die Methode bestimmen den Datentyp, konvertiert und weist den Wert zu */
218
+ /* public setProperty(cimModel: Model, propName: string, propertyValue: any){
219
+ const dataType: string = this.prop2Datatype.get(propName);
220
+
221
+ if(dataType) {
222
+ if(CIM_CLASS_NAMES[dataType]) { // komplexer Datentyp
223
+ this.setAssociation(cimModel, propName, propertyValue);
224
+ } else { // primitiver Datentyp
225
+ this[propName] = convertValue(dataType, propertyValue);
226
+ }
227
+ }
228
+ }*/
229
+
230
+
231
+ /** die Methode gibt basierend auf der aktuellen Ausprägung des übergebenen Property
232
+ * ein SPARQL-INSERT Statement zurück.
233
+ * 2 Szearien:
234
+ * Löschen der aktuellen Ausprägung -> wird im DELETE DATA Block platziert.
235
+ * Einfügen der aktuellen Ausprägung -> wird im INSERT DATA Block platziert. */
236
+
237
+ /* public getUpdateSPARQL(className: string, propName: string): string {
238
+ if(this.constructor.name === className) {
239
+ const dataType: string = this.prop2Datatype.get(propName);
240
+ if(CIM_CLASS_NAMES[dataType]) { // komplexer Datentyp
241
+ return super.getUpdateSPARQL(className, propName);
242
+ } else {
243
+ const propValue = String(this[propName]); // aktuelle Ausprägung auslesen
244
+
245
+ const propNS = this.prop2namespacePrefix.get(String(propName));
246
+ const propClassName = this.prop2Class.get(String(propName));
247
+ if(propNS) {
248
+ return `<${this.baseIRI}${this.mrid}> ${propNS}:${propClassName}.${propName} \'${propValue}\' . `;
249
+ }
250
+ }
251
+ } else {
252
+ //TODO überarbeiten
253
+ return super.getUpdateSPARQL(className, propName);
254
+ }
255
+ return;
256
+ }*/
257
+
258
+
259
+ /** CIM RDF/XML Serialisierung */
260
+ public toCIMXML(xmlWriter: XMLWriter, profile: string) {
261
+ let defaultValues = '';
262
+ this.checkMandatoryAttributes(profile, defaultValues);
263
+ this.description += defaultValues;
264
+ if (profile === RDF_XML.PROFILE_EQ) {
265
+ const suffixID = this.getSuffixID(profile);
266
+ const prefixUUID = this.getPrefixUUID(suffixID);
267
+ xmlWriter.startElementNS(RDF_XML.CIM_NS_PREFIX, this.constructor.name, RDF_XML.CIM_NS_16);
268
+ writeElementAttribute(xmlWriter, suffixID, `${prefixUUID}${this.mrid}`);
269
+ this.toCIMXMLAttributes(xmlWriter, profile);
270
+ this.toCIMXMLAssociations(xmlWriter, profile);
271
+ xmlWriter.endElement();
272
+ } else if (profile === RDF_XML.PROFILE_SSH && this.checkExportData(profile)) {
195
273
 
196
- public breadthFirstSearch(networkElements: any[]){
197
- if(!this.visited){
198
- this.addNetworkElement(networkElements);
199
- super.breadthFirstSearch(networkElements);
200
- }
201
274
  }
275
+ }
202
276
 
203
- //hier endet der Aufruf
204
- public determineTopologicalNodes(connNodes: IConnectivityNode[]){
205
- return;
277
+ protected toCIMXMLAttributes(xmlWriter: XMLWriter, profile: string) {
278
+ super.toCIMXMLAttributes(xmlWriter, profile);
279
+ if (profile === RDF_XML.PROFILE_SSH && this.checkExportData(profile)) {
280
+ writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:${this.constructor.name}.activePower`, this.activePower);
281
+ writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:${this.constructor.name}.reactivePower`, this.reactivePower);
206
282
  }
207
-
208
- public isLoadOrFeed(): boolean{
283
+ }
284
+
285
+ protected toCIMXMLAssociations(xmlWriter: XMLWriter, profile: string) {
286
+ super.toCIMXMLAssociations(xmlWriter, profile);
287
+ }
288
+
289
+ /** Die Methode überprüft, ob für die übergebene ProfilURI
290
+ * relevante Informationen gepflegt sind.
291
+ * @param profile URI des Profils. */
292
+ checkExportData(profile: string): boolean {
293
+ if (profile === RDF_XML.PROFILE_SSH) {
294
+ if (this.activePower || !this.reactivePower) {
209
295
  return true;
296
+ }
210
297
  }
211
-
212
- public getApparentPower() {
213
- return Math.sqrt(Math.pow(this.activePower ? this.activePower : 0, 2) +
214
- Math.pow(this.reactivePower ? this.reactivePower : 0, 2));
298
+ return false;
299
+ }
300
+
301
+ checkMandatoryAttributes(profile: string, defaultValues: string) {
302
+ super.checkMandatoryAttributes(profile, defaultValues);
303
+ if (profile === RDF_XML.PROFILE_SSH) {
304
+ if (!this.activePower) {
305
+ this.activePower = 0;
306
+ defaultValues += 'activePower,'
307
+ }
308
+ if (!this.reactivePower) {
309
+ this.reactivePower = 0;
310
+ defaultValues += 'reactivePower,'
311
+ }
215
312
  }
313
+ }
216
314
 
217
- /** die Methode bestimmen den Datentyp, konvertiert und weist den Wert zu */
218
- /* public setProperty(cimModel: Model, propName: string, propertyValue: any){
219
- const dataType: string = this.prop2Datatype.get(propName);
315
+ /** CIM XML Parser */
316
+ public static resolveClassRDFXML(uuid: string, cimModel: Model): IdentifiedObject | undefined {
317
+ const newClass = new EnergySource(uuid);
318
+ cimModel.addEnergySource(newClass);
319
+ return newClass;
320
+ }
220
321
 
221
- if(dataType) {
222
- if(CIM_CLASS_NAMES[dataType]) { // komplexer Datentyp
223
- this.setAssociation(cimModel, propName, propertyValue);
224
- } else { // primitiver Datentyp
225
- this[propName] = convertValue(dataType, propertyValue);
226
- }
227
- }
228
- }*/
229
-
230
-
231
- /** die Methode gibt basierend auf der aktuellen Ausprägung des übergebenen Property
232
- * ein SPARQL-INSERT Statement zurück.
233
- * 2 Szearien:
234
- * Löschen der aktuellen Ausprägung -> wird im DELETE DATA Block platziert.
235
- * Einfügen der aktuellen Ausprägung -> wird im INSERT DATA Block platziert. */
236
- /* public getUpdateSPARQL(className: string, propName: string): string {
237
- if(this.constructor.name === className) {
238
- const dataType: string = this.prop2Datatype.get(propName);
239
- if(CIM_CLASS_NAMES[dataType]) { // komplexer Datentyp
240
- return super.getUpdateSPARQL(className, propName);
241
- } else {
242
- const propValue = String(this[propName]); // aktuelle Ausprägung auslesen
243
-
244
- const propNS = this.prop2namespacePrefix.get(String(propName));
245
- const propClassName = this.prop2Class.get(String(propName));
246
- if(propNS) {
247
- return `<${this.baseIRI}${this.mrid}> ${propNS}:${propClassName}.${propName} \'${propValue}\' . `;
248
- }
249
- }
250
- } else {
251
- //TODO überarbeiten
252
- return super.getUpdateSPARQL(className, propName);
253
- }
254
- return;
255
- }*/
256
-
257
-
258
- /** CIM RDF/XML Serialisierung */
259
- public toCIMXML(xmlWriter: XMLWriter, profile: string) {
260
- if(profile === RDF_XML.PROFILE_EQ || profile === RDF_XML.PROFILE_SSH) {
261
- const suffixID = this.getSuffixID(profile);
262
- const prefixUUID = this.getPrefixUUID(suffixID);
263
- xmlWriter.startElementNS(RDF_XML.CIM_NS_PREFIX, this.constructor.name, RDF_XML.CIM_NS_16);
264
- writeElementAttribute(xmlWriter, suffixID, `${prefixUUID}${this.mrid}`);
265
- this.toCIMXMLAttributes(xmlWriter, profile);
266
- this.toCIMXMLAssociations(xmlWriter, profile);
267
- xmlWriter.endElement();
268
- }
269
- }
322
+ public resolveAttributesRDFXML(className: string, attrName: string, value: string) {
323
+ if (className === 'EnergySource') {
270
324
 
271
- protected toCIMXMLAttributes(xmlWriter: XMLWriter, profile: string) {
272
- super.toCIMXMLAttributes(xmlWriter, profile);
273
- if(profile === RDF_XML.PROFILE_SSH) {
274
- writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:${this.constructor.name}.activePower`, this.activePower);
275
- writeElement(xmlWriter, `${RDF_XML.CIM_NS_PREFIX}:${this.constructor.name}.reactivePower`, this.reactivePower);
276
- }
325
+ } else {
326
+ super.resolveAttributesRDFXML(className, attrName, value);
277
327
  }
328
+ }
278
329
 
279
- protected toCIMXMLAssociations(xmlWriter: XMLWriter, profile: string) {
280
- super.toCIMXMLAssociations(xmlWriter, profile);
281
- }
330
+ public resolveAssociationRDFXML(className: string, resourceName: string, resourceUUID: string) {
331
+ if (className === 'EnergySource') {
282
332
 
283
- /** CIM XML Parser */
284
- public static resolveClassRDFXML(uuid: string, cimModel: Model): IdentifiedObject | undefined {
285
- const newClass = new EnergySource(uuid);
286
- cimModel.addEnergySource(newClass);
287
- return newClass;
288
- }
289
- public resolveAttributesRDFXML(className: string, attrName: string, value: string){
290
- if(className === 'EnergySource') {
291
-
292
- } else {
293
- super.resolveAttributesRDFXML(className, attrName, value);
294
- }
295
- }
296
- public resolveAssociationRDFXML(className: string, resourceName: string, resourceUUID: string){
297
- if(className === 'EnergySource') {
298
-
299
- } else {
300
- super.resolveAssociationRDFXML(className, resourceName, resourceUUID);
301
- }
333
+ } else {
334
+ super.resolveAssociationRDFXML(className, resourceName, resourceUUID);
302
335
  }
336
+ }
303
337
  }