@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.
- package/dist/config/westnetz-neplan/neplan-load.config.js +0 -1
- package/dist/config/westnetz-neplan/neplan-load.config.js.map +1 -1
- package/dist/constants/cim-class-definition.js +6 -0
- package/dist/constants/cim-class-definition.js.map +1 -1
- package/dist/constants/cim-class-names.d.ts +6 -0
- package/dist/constants/cim-class-names.js +6 -0
- package/dist/constants/cim-class-names.js.map +1 -1
- package/dist/converter/integral7/ConverterIntegral7.d.ts +17 -4
- package/dist/converter/integral7/ConverterIntegral7.js +530 -39
- package/dist/converter/integral7/ConverterIntegral7.js.map +1 -1
- package/dist/converter/integral7/config/db-config.d.ts +3 -1
- package/dist/converter/integral7/model/integral/Hgueleitung.d.ts +9 -0
- package/dist/converter/integral7/model/integral/Hgueleitung.js +3 -0
- package/dist/converter/integral7/model/integral/Hgueleitung.js.map +1 -0
- package/dist/converter/integral7/model/integral/Kopfstation.d.ts +31 -0
- package/dist/converter/integral7/model/integral/Kopfstation.js +3 -0
- package/dist/converter/integral7/model/integral/Kopfstation.js.map +1 -0
- package/dist/converter/integral7/model/interfaces.d.ts +8 -0
- package/dist/converter/integral7/sql/integral.sql.d.ts +8 -0
- package/dist/converter/integral7/sql/integral.sql.js +22 -1
- package/dist/converter/integral7/sql/integral.sql.js.map +1 -1
- package/dist/converter/integral7/utils.d.ts +4 -1
- package/dist/converter/integral7/utils.js +26 -8
- package/dist/converter/integral7/utils.js.map +1 -1
- package/dist/etl-neplan/etl-neplan-contingency-analysis.js +22 -7
- package/dist/etl-neplan/etl-neplan-contingency-analysis.js.map +1 -1
- package/dist/etl-neplan/etl-neplan-feederline.d.ts +3 -1
- package/dist/etl-neplan/etl-neplan-feederline.js +73 -15
- package/dist/etl-neplan/etl-neplan-feederline.js.map +1 -1
- package/dist/etl-neplan/etl-neplan.js.map +1 -1
- package/dist/etl-neplan/neplan-contingency-analysis.d.ts +14 -0
- package/dist/etl-neplan/neplan-contingency-analysis.js +337 -0
- package/dist/etl-neplan/neplan-contingency-analysis.js.map +1 -0
- package/dist/graph/Types.d.ts +5 -0
- package/dist/graph/Types.js +10 -0
- package/dist/graph/Types.js.map +1 -0
- package/dist/graph/connections/connection.d.ts +11 -0
- package/dist/graph/connections/connection.js +17 -0
- package/dist/graph/connections/connection.js.map +1 -0
- package/dist/graph/edges/edge.d.ts +8 -0
- package/dist/graph/edges/edge.js +16 -0
- package/dist/graph/edges/edge.js.map +1 -0
- package/dist/graph/graph-interfaces.d.ts +15 -0
- package/dist/graph/graph-interfaces.js +3 -0
- package/dist/graph/graph-interfaces.js.map +1 -0
- package/dist/graph/graph-util.d.ts +13 -0
- package/dist/graph/graph-util.js +114 -0
- package/dist/graph/graph-util.js.map +1 -0
- package/dist/graph/graph.d.ts +15 -0
- package/dist/graph/graph.js +75 -0
- package/dist/graph/graph.js.map +1 -0
- package/dist/graph/nodes/node.d.ts +14 -0
- package/dist/graph/nodes/node.js +28 -0
- package/dist/graph/nodes/node.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/model/core/ACDCTerminal.js +2 -2
- package/dist/model/core/ACDCTerminal.js.map +1 -1
- package/dist/model/core/ConnectivityNode.js +3 -2
- package/dist/model/core/ConnectivityNode.js.map +1 -1
- package/dist/model/core/PSRType.d.ts +0 -1
- package/dist/model/core/PSRType.js +3 -6
- package/dist/model/core/PSRType.js.map +1 -1
- package/dist/model/core/PowerSystemResource.js +3 -8
- package/dist/model/core/PowerSystemResource.js.map +1 -1
- package/dist/model/core/Substation.d.ts +3 -0
- package/dist/model/core/Substation.js +4 -0
- package/dist/model/core/Substation.js.map +1 -1
- package/dist/model/core/Terminal.d.ts +2 -0
- package/dist/model/core/Terminal.js +2 -2
- package/dist/model/core/Terminal.js.map +1 -1
- package/dist/model/core/VoltageLevel.js +0 -1
- package/dist/model/core/VoltageLevel.js.map +1 -1
- package/dist/model/dc/ACDCConverter.d.ts +23 -0
- package/dist/model/dc/ACDCConverter.js +33 -0
- package/dist/model/dc/ACDCConverter.js.map +1 -0
- package/dist/model/dc/ACDCConverterDCTerminal.d.ts +13 -0
- package/dist/model/dc/ACDCConverterDCTerminal.js +54 -0
- package/dist/model/dc/ACDCConverterDCTerminal.js.map +1 -0
- package/dist/model/dc/CsConverter.d.ts +21 -0
- package/dist/model/dc/CsConverter.js +43 -0
- package/dist/model/dc/CsConverter.js.map +1 -0
- package/dist/model/dc/CsOperatingModeKind.d.ts +4 -0
- package/dist/model/dc/CsOperatingModeKind.js +9 -0
- package/dist/model/dc/CsOperatingModeKind.js.map +1 -0
- package/dist/model/dc/CsPpccControlKind.d.ts +5 -0
- package/dist/model/dc/CsPpccControlKind.js +10 -0
- package/dist/model/dc/CsPpccControlKind.js.map +1 -0
- package/dist/model/dc/DCBaseTerminal.d.ts +8 -0
- package/dist/model/dc/DCBaseTerminal.js +30 -0
- package/dist/model/dc/DCBaseTerminal.js.map +1 -0
- package/dist/model/dc/DCConductingEquipment.d.ts +5 -0
- package/dist/model/dc/DCConductingEquipment.js +12 -0
- package/dist/model/dc/DCConductingEquipment.js.map +1 -0
- package/dist/model/dc/DCConverterOperatingModeKind.d.ts +5 -0
- package/dist/model/dc/DCConverterOperatingModeKind.js +10 -0
- package/dist/model/dc/DCConverterOperatingModeKind.js.map +1 -0
- package/dist/model/dc/DCConverterUnit.d.ts +14 -0
- package/dist/model/dc/DCConverterUnit.js +54 -0
- package/dist/model/dc/DCConverterUnit.js.map +1 -0
- package/dist/model/dc/DCEquipmentContainer.d.ts +5 -0
- package/dist/model/dc/DCEquipmentContainer.js +12 -0
- package/dist/model/dc/DCEquipmentContainer.js.map +1 -0
- package/dist/model/dc/DCLine.d.ts +11 -0
- package/dist/model/dc/DCLine.js +48 -0
- package/dist/model/dc/DCLine.js.map +1 -0
- package/dist/model/dc/DCLineSegment.d.ts +13 -0
- package/dist/model/dc/DCLineSegment.js +69 -0
- package/dist/model/dc/DCLineSegment.js.map +1 -0
- package/dist/model/dc/DCNode.d.ts +12 -0
- package/dist/model/dc/DCNode.js +41 -0
- package/dist/model/dc/DCNode.js.map +1 -0
- package/dist/model/dc/DCPolarityKind.d.ts +5 -0
- package/dist/model/dc/DCPolarityKind.js +10 -0
- package/dist/model/dc/DCPolarityKind.js.map +1 -0
- package/dist/model/dc/DCTerminal.d.ts +10 -0
- package/dist/model/dc/DCTerminal.js +38 -0
- package/dist/model/dc/DCTerminal.js.map +1 -0
- package/dist/model/dc/VsConverter.d.ts +18 -0
- package/dist/model/dc/VsConverter.js +33 -0
- package/dist/model/dc/VsConverter.js.map +1 -0
- package/dist/model/dc/VsPpccControlKind.d.ts +7 -0
- package/dist/model/dc/VsPpccControlKind.js +12 -0
- package/dist/model/dc/VsPpccControlKind.js.map +1 -0
- package/dist/model/dc/VsQpccControlKind.d.ts +5 -0
- package/dist/model/dc/VsQpccControlKind.js +10 -0
- package/dist/model/dc/VsQpccControlKind.js.map +1 -0
- package/dist/model/domain/UnitMultiplier.js.map +1 -1
- package/dist/model/extensions/amprion/model/AmprionModell.d.ts +25 -0
- package/dist/model/extensions/amprion/model/AmprionModell.js +64 -0
- package/dist/model/extensions/amprion/model/AmprionModell.js.map +1 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProject.d.ts +34 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProject.js +134 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProject.js.map +1 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.d.ts +17 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.js +77 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.js.map +1 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.d.ts +14 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.js +57 -0
- package/dist/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.js.map +1 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProject.d.ts +7 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProject.js +17 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProject.js.map +1 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProjectPhase.d.ts +19 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProjectPhase.js +74 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProjectPhase.js.map +1 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProjectStructure.d.ts +15 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProjectStructure.js +26 -0
- package/dist/model/extensions/amprion/project/AMPRIONErpProjectStructure.js.map +1 -0
- package/dist/model/extensions/amprion/project/AMPRIONProjectPriorityKind.d.ts +5 -0
- package/dist/model/extensions/amprion/project/AMPRIONProjectPriorityKind.js +10 -0
- package/dist/model/extensions/amprion/project/AMPRIONProjectPriorityKind.js.map +1 -0
- package/dist/model/extensions/amprion/wires/AMPRIONSeriesCompensator.d.ts +9 -0
- package/dist/model/extensions/amprion/wires/AMPRIONSeriesCompensator.js +46 -0
- package/dist/model/extensions/amprion/wires/AMPRIONSeriesCompensator.js.map +1 -0
- package/dist/model/extensions/enervance/operations/EVTerminalAction.js.map +1 -1
- package/dist/model/extensions/neplan-westnetz/assets/WNFacility.js.map +1 -1
- package/dist/model/generation/WindGeneratingUnit.d.ts +5 -0
- package/dist/model/generation/WindGeneratingUnit.js +66 -0
- package/dist/model/generation/WindGeneratingUnit.js.map +1 -1
- package/dist/model/model/Model.d.ts +39 -1
- package/dist/model/model/Model.js +91 -1
- package/dist/model/model/Model.js.map +1 -1
- package/dist/model/wires/ACLineSegment.d.ts +1 -0
- package/dist/model/wires/ACLineSegment.js +15 -2
- package/dist/model/wires/ACLineSegment.js.map +1 -1
- package/dist/model/wires/AsynchronousMachine.d.ts +1 -0
- package/dist/model/wires/AsynchronousMachine.js +37 -1
- package/dist/model/wires/AsynchronousMachine.js.map +1 -1
- package/dist/model/wires/Disconnector.js +1 -1
- package/dist/model/wires/EnergySource.d.ts +2 -0
- package/dist/model/wires/EnergySource.js +28 -2
- package/dist/model/wires/EnergySource.js.map +1 -1
- package/dist/model/wires/SeriesCompensator.d.ts +18 -2
- package/dist/model/wires/SeriesCompensator.js +108 -5
- package/dist/model/wires/SeriesCompensator.js.map +1 -1
- package/dist/util/util-create.js.map +1 -1
- package/dist/util/util-topology.d.ts +2 -2
- package/dist/util/util-topology.js +14 -6
- package/dist/util/util-topology.js.map +1 -1
- package/package.json +1 -1
- package/src/config/westnetz-neplan/neplan-load.config.ts +1 -1
- package/src/constants/cim-class-definition.ts +20 -1
- package/src/constants/cim-class-names.ts +9 -0
- package/src/converter/integral7/ConverterIntegral7.ts +753 -345
- package/src/converter/integral7/config/db-config.ts +3 -2
- package/src/converter/integral7/model/integral/Hgueleitung.ts +12 -0
- package/src/converter/integral7/model/integral/Kopfstation.ts +46 -0
- package/src/converter/integral7/model/interfaces.ts +23 -16
- package/src/converter/integral7/sql/integral.sql.ts +27 -1
- package/src/converter/integral7/utils.ts +43 -11
- package/src/etl-neplan/etl-neplan-contingency-analysis.ts +30 -12
- package/src/etl-neplan/etl-neplan-feederline.ts +100 -17
- package/src/etl-neplan/etl-neplan.ts +1 -0
- package/src/etl-neplan/neplan-contingency-analysis.ts +572 -0
- package/src/graph/Types.ts +7 -0
- package/src/graph/connections/connection.ts +29 -0
- package/src/graph/edges/edge.ts +27 -0
- package/src/graph/graph-interfaces.ts +21 -0
- package/src/graph/graph-util.ts +158 -0
- package/src/graph/graph.ts +84 -0
- package/src/graph/nodes/node.ts +43 -0
- package/src/index.ts +8 -0
- package/src/model/core/ACDCTerminal.ts +2 -2
- package/src/model/core/ConnectivityNode.ts +2 -2
- package/src/model/core/PSRType.ts +3 -6
- package/src/model/core/PowerSystemResource.ts +3 -7
- package/src/model/core/Substation.ts +6 -0
- package/src/model/core/Terminal.ts +15 -6
- package/src/model/core/VoltageLevel.ts +0 -1
- package/src/model/dc/ACDCConverter.ts +66 -0
- package/src/model/dc/ACDCConverterDCTerminal.ts +64 -0
- package/src/model/dc/CsConverter.ts +68 -0
- package/src/model/dc/CsOperatingModeKind.ts +4 -0
- package/src/model/dc/CsPpccControlKind.ts +5 -0
- package/src/model/dc/DCBaseTerminal.ts +30 -0
- package/src/model/dc/DCConductingEquipment.ts +8 -0
- package/src/model/dc/DCConverterOperatingModeKind.ts +6 -0
- package/src/model/dc/DCConverterUnit.ts +60 -0
- package/src/model/dc/DCEquipmentContainer.ts +8 -0
- package/src/model/dc/DCLine.ts +56 -0
- package/src/model/dc/DCLineSegment.ts +81 -0
- package/src/model/dc/DCNode.ts +49 -0
- package/src/model/dc/DCPolarityKind.ts +5 -0
- package/src/model/dc/DCTerminal.ts +45 -0
- package/src/model/dc/VsConverter.ts +48 -0
- package/src/model/dc/VsPpccControlKind.ts +7 -0
- package/src/model/dc/VsQpccControlKind.ts +5 -0
- package/src/model/domain/UnitMultiplier.ts +12 -12
- package/src/model/equivalents/EquivalentBranch.ts +10 -10
- package/src/model/extensions/amprion/model/AmprionModell.ts +92 -0
- package/src/model/extensions/amprion/project/AMPRIONConstructionProject.ts +174 -0
- package/src/model/extensions/amprion/project/AMPRIONConstructionProjectBundle.ts +89 -0
- package/src/model/extensions/amprion/project/AMPRIONConstructionProjectPlan.ts +64 -0
- package/src/model/extensions/amprion/project/AMPRIONErpProject.ts +21 -0
- package/src/model/extensions/amprion/project/AMPRIONErpProjectPhase.ts +89 -0
- package/src/model/extensions/amprion/project/AMPRIONErpProjectStructure.ts +36 -0
- package/src/model/extensions/amprion/project/AMPRIONProjectPriorityKind.ts +5 -0
- package/src/model/extensions/amprion/wires/AMPRIONSeriesCompensator.ts +53 -0
- package/src/model/extensions/enervance/core/EVTerminal.ts +1 -1
- package/src/model/extensions/enervance/operations/EVTerminalAction.ts +0 -1
- package/src/model/extensions/neplan-westnetz/assets/WNFacility.ts +0 -1
- package/src/model/generation/WindGeneratingUnit.ts +73 -0
- package/src/model/model/Model.ts +131 -7
- package/src/model/wires/ACLineSegment.ts +244 -228
- package/src/model/wires/AsynchronousMachine.ts +38 -1
- package/src/model/wires/Disconnector.ts +1 -1
- package/src/model/wires/EnergySource.ts +256 -222
- package/src/model/wires/SeriesCompensator.ts +145 -19
- package/src/util/util-create.ts +2 -0
- package/src/util/util-topology.ts +18 -7
- package/test/apache-jena-fuseki-interface/{apache-jena-fuseki-neplan.tests.spec.ts → apache-jena-fuseki-neplan-1.tests.sp-ec.ts} +0 -26
- package/test/apache-jena-fuseki-interface/apache-jena-fuseki-neplan-2.tests.spec.ts +255 -0
- package/test/apache-jena-fuseki-interface/data/xml/finnentrop/Finnentrop_Rootnet_Area 1_EQ_V1.xml +20867 -0
- package/test/apache-jena-fuseki-interface/data/xml/finnentrop/Finnentrop_Rootnet_Area 1_SSH_V1.xml +3784 -0
- package/test/apache-jena-fuseki-interface/data/xml/ruhrau-katharina/Ruhrau_Katharina_Rootnet_Area 1_EQ_V1.xml +42546 -0
- package/test/apache-jena-fuseki-interface/data/xml/ruhrau-katharina/Ruhrau_Katharina_Rootnet_Area 1_SSH_V1.xml +10101 -0
- package/test/apache-jena-fuseki-interface/data/xml/ruhrau-katharina/Ruhrau_Katharina_Rootnet_Area 1_SV_V1.xml +6229 -0
- package/test/integral7-converter/integral7-converter.tests.spec.ts +12 -3
- package/test/power-system-data-model-converter/power-system-data-model-converter.tests.spec.ts +1 -1
- 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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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
|
-
|
|
189
|
-
|
|
145
|
+
public static getQuerySPARQL(graphURI: string): string {
|
|
146
|
+
if (graphURI.length > 0) {
|
|
147
|
+
return EnergySource.sparqlQuery.replace('<http://default/>', graphURI);
|
|
190
148
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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
|
-
|
|
222
|
-
|
|
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
|
-
|
|
272
|
-
|
|
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
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
330
|
+
public resolveAssociationRDFXML(className: string, resourceName: string, resourceUUID: string) {
|
|
331
|
+
if (className === 'EnergySource') {
|
|
282
332
|
|
|
283
|
-
|
|
284
|
-
|
|
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
|
}
|