From 6dab691d57fd3ace666982bcb8ba350ef2aff5a5 Mon Sep 17 00:00:00 2001 From: Jan Krueger Date: Mon, 18 May 2015 16:14:50 +0200 Subject: extend interfaces and CIM --- .../config/setup-database/setup-postgeSQL.sql | 3 + .../openk/model/core/OperatingParticipant.java | 59 +- .../eclipse/openk/model/core/OperatingShare.java | 39 +- .../org/eclipse/openk/model/core/Terminal.java | 22 +- .../eclipse/openk/model/meas/MeasurementValue.java | 11 + .../openk/model/meas/MeasurementValueQuality.java | 41 + .../utils/converter/Boolean2StringConverter.java | 2 +- .../eclipse/openk/model/wires/AcLineSegment.java | 5 + .../eclipse/openk/model/wires/BusbarSection.java | 7 +- .../openk/model/wires/PowerTransformer.java | 5 + .../java/org/eclipse/openk/model/wires/Switch.java | 7 +- .../openk/model/wires/SynchronousMachine.java | 38 +- .../V01/_00/OPENK_CACHEDB_V01_00_001__init.sql | 106 +- .../rest/GeographicalRegionRestConsumerTest.java | 80 +- .../rest/SynchronousMachineRestConsumerTest.java | 18 +- .../repository/AbstractRepositoryJpaTest.java | 27 +- .../SynchronousMachineRepositoryTest.java | 6 +- .../geographicalregion-sample-01.json | 1518 +++++++++++++------- .../geographicalregion-sample-02.json | 20 +- .../geographicalregion-sample-03.json | 62 +- .../geographicalregion-sample-04.json | 708 +++++++++ .../geographicalregion-sample-05.json | 63 + .../json-test-samples/netstate-sample-01.json | 7 + .../synchronousmachine-sample-01.json | 133 +- .../synchronousmachine-sample-03.json | 190 +++ .../src/test/sql/cachedb-insert-data.sql | 348 +++-- .../openk/eisman/model/process/Activity.java | 6 +- .../V01/_00/OPENK_EISMAN_V01_00_001__init.sql | 10 +- .../eclipse/openk/model/cim/core/ACDCTerminal.java | 2 +- .../org/eclipse/openk/model/cim/core/Terminal.java | 21 +- .../openk/model/cim/meas/MeasurementValue.java | 2 +- .../model/cim/meas/MeasurementValueQuality.java | 9 + .../eclipse/openk/model/cim/meas/Quality61850.java | 84 ++ .../openk/model/cim/wires/SynchronousMachine.java | 35 +- openk-platform/pom.xml | 2 +- 35 files changed, 2852 insertions(+), 844 deletions(-) create mode 100644 openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/MeasurementValueQuality.java create mode 100644 openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-04.json create mode 100644 openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-05.json create mode 100644 openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-03.json create mode 100644 openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/meas/MeasurementValueQuality.java create mode 100644 openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/meas/Quality61850.java diff --git a/openk-platform/config/setup-database/setup-postgeSQL.sql b/openk-platform/config/setup-database/setup-postgeSQL.sql index 07eb496f..12cf11f8 100644 --- a/openk-platform/config/setup-database/setup-postgeSQL.sql +++ b/openk-platform/config/setup-database/setup-postgeSQL.sql @@ -7,6 +7,7 @@ -- -- Liferay Portal Database +-- Connect as postgres (master) user CREATE ROLE lportalopenk LOGIN PASSWORD 'lportalopenk' VALID UNTIL 'infinity' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; CREATE DATABASE openk @@ -18,6 +19,7 @@ CREATE DATABASE openk CREATE SCHEMA lportalopenk AUTHORIZATION lportalopenk; -- CacheDB Database +-- Connect as postgres (master) user CREATE ROLE cachedb LOGIN PASSWORD 'cachedb' VALID UNTIL 'infinity' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; CREATE DATABASE cachedb @@ -29,6 +31,7 @@ CREATE DATABASE cachedb CREATE SCHEMA cachedb AUTHORIZATION cachedb; -- AppDB Database +-- Connect as postgres (master) user CREATE ROLE eisman LOGIN PASSWORD 'eisman' VALID UNTIL 'infinity' NOSUPERUSER INHERIT NOCREATEDB NOCREATEROLE NOREPLICATION; --CREATE ROLE netstate LOGIN PASSWORD 'netstate' VALID UNTIL 'infinity' diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/OperatingParticipant.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/OperatingParticipant.java index 39a58d03..5131b0a7 100644 --- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/OperatingParticipant.java +++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/OperatingParticipant.java @@ -13,7 +13,23 @@ package org.eclipse.openk.model.core; -import java.util.List; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonView; +import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json; +import org.eclipse.openk.model.domain.PerCent; + +import javax.persistence.Access; +import javax.persistence.AccessType; +import javax.persistence.AttributeOverride; +import javax.persistence.Column; +import javax.persistence.Embedded; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.TableGenerator; +import javax.validation.constraints.NotNull; /** * An operator of multiple power system resource objects. Note multple operating @@ -21,8 +37,47 @@ import java.util.List; * used for modeling jointly owned units where each owner operates as a * contractual share. */ +@Entity +@Table(name = "OPERATING_PARTICIPANT") +@Access(AccessType.FIELD) public class OperatingParticipant extends IdentifiedObject { - private List operatingShareList; + @JsonIgnore + @Id + @TableGenerator(name = "OperatingParticipantTableGen", + table = "OPENK_CACHEDB_SEQ_TABLE", + pkColumnName = "SEQ_NAME", + valueColumnName = "SEQ_COUNT", + pkColumnValue = "OPERATING_PARTICIPANT_SEQ") + @GeneratedValue(strategy = GenerationType.TABLE, generator = "OperatingParticipantTableGen") + @Column(name = "ID") + private Long id; + + @Id + @NotNull + @JsonView(IncludeAttribute4Json.SynchronousMachine.class) + @Column(name = "MRID") + private String mRid; + + @NotNull + @JsonView(IncludeAttribute4Json.SynchronousMachine.class) + @Column(name = "NAME") + private String name; + + @JsonView(IncludeAttribute4Json.SynchronousMachine.class) + @Embedded + @AttributeOverride(name = "value", column = @Column(name = "SHARE_PER_CENT")) + private PerCent percentage; + + public String getmRid() { + return mRid; + } + + public String getName() { + return name; + } + public PerCent getPercentage() { + return percentage; + } } \ No newline at end of file diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/OperatingShare.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/OperatingShare.java index 0edb9178..0e6226d0 100644 --- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/OperatingShare.java +++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/OperatingShare.java @@ -13,29 +13,58 @@ package org.eclipse.openk.model.core; +import com.fasterxml.jackson.annotation.JsonView; +import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json; import org.eclipse.openk.model.domain.PerCent; +import javax.persistence.Embeddable; + /** * Specifies the operations contract relationship between a power system resource * and a contract participant. */ +//@Entity +//@Table(name = "OPERATING_SHARE") +//@Access(AccessType.FIELD) +@Embeddable public class OperatingShare { +// @JsonIgnore +// @Id +// @TableGenerator(name = "OperatingShareTableGen", +// table = "OPENK_CACHEDB_SEQ_TABLE", +// pkColumnName = "SEQ_NAME", +// valueColumnName = "SEQ_COUNT", +// pkColumnValue = "OPERATING_SHARE_SEQ") +// @GeneratedValue(strategy = GenerationType.TABLE, generator = "OperatingShareTableGen") +// @Column(name = "ID") +// private Long id; + /** * Percentage operational ownership between the pair (power system resource and * operatging participant) associated with this share. The total percentage * ownership for a power system resource should add to 100%. */ + @JsonView(IncludeAttribute4Json.SynchronousMachine.class) +// @Embedded +// @AttributeOverride(name = "value", column = @Column(name = "SHARE_PER_CENT")) private PerCent percentage; /** * The operating participant having this share with the associated power system * resource. */ - private OperatingParticipant operatingParticipant; - /** - * The power system resource to which the share applies. - */ - private PowerSystemResource powerSystemResource; +// @JsonView(IncludeAttribute4Json.SynchronousMachine.class) +// @ManyToOne(cascade = CascadeType.MERGE) +// @JoinColumn(name = "OPERATING_PARTICIPANT_MRID", referencedColumnName = "MRID") +//// @JoinColumn(name = "OPERATING_PARTICIPANT_ID", referencedColumnName = "ID", insertable = false) +// private OperatingParticipant operatingParticipant; + + public PerCent getPercentage() { + return percentage; + } +// public OperatingParticipant getOperatingParticipant() { +// return operatingParticipant; +// } } \ No newline at end of file diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/Terminal.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/Terminal.java index 48ec7e3d..50ee6e57 100644 --- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/Terminal.java +++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/core/Terminal.java @@ -15,16 +15,19 @@ package org.eclipse.openk.model.core; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonView; import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json; +import org.eclipse.openk.model.utils.converter.Boolean2StringConverter; import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.Column; +import javax.persistence.Convert; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.TableGenerator; +import javax.validation.constraints.NotNull; /** * An AC electrical connection point to a piece of conducting equipment. Terminals @@ -46,15 +49,16 @@ public class Terminal extends AcDcTerminal { @Column(name = "ID") private Long id; + @NotNull @JsonView(IncludeAttribute4Json.Topology.class) @Column(name = "MRID") private String mRid; + @NotNull @JsonView(IncludeAttribute4Json.Topology.class) @Column(name = "NAME") private String name; - /** * The terminal connection status. True implies the terminal is connected, and * false implies the terminal is not connected. This is the result of topoplogical @@ -64,20 +68,20 @@ public class Terminal extends AcDcTerminal { * terminal device may simultaneously have connected and disconnected terminals. * No other aspect of the algorithm */ -// public Boolean connected; + @NotNull + @Convert(converter = Boolean2StringConverter.class) + @Column(name = "CONNECTED") + public Boolean connected; + public String getmRid() { return mRid; } -// public void setmRid(String mRid) { -// this.mRid = mRid; -// } - public String getName() { return name; } -// public void setName(String name) { -// this.name = name; -// } + public Boolean isConnected() { + return connected; + } } \ No newline at end of file diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/MeasurementValue.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/MeasurementValue.java index 16485890..50ff9c7c 100644 --- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/MeasurementValue.java +++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/MeasurementValue.java @@ -38,8 +38,19 @@ public class MeasurementValue extends IdentifiedObject { @AttributeOverride(name = "value", column = @Column(name = "TIMESTAMP_VALUE")) private AbsoluteDateTime timeStamp; + /** + * A MeasurementValue has a MeasurementValueQuality associated with it. + */ + @JsonView(IncludeAttribute4Json.NetworkState.class) + @Embedded + @AttributeOverride(name = "failure", column = @Column(name = "VALUE_QUALITY_FAILURE")) + private MeasurementValueQuality measurementValueQuality; + public AbsoluteDateTime getTimeStamp() { return timeStamp; } + public MeasurementValueQuality getMeasurementValueQuality() { + return measurementValueQuality; + } } \ No newline at end of file diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/MeasurementValueQuality.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/MeasurementValueQuality.java new file mode 100644 index 00000000..b5600e1e --- /dev/null +++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/MeasurementValueQuality.java @@ -0,0 +1,41 @@ +/** + * **************************************************************************** + * Copyright (c) 2015 BTC AG. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *

+ * Contributors: + * Jan Krueger - initial API and implementation + * ***************************************************************************** + */ +package org.eclipse.openk.model.meas; + +import com.fasterxml.jackson.annotation.JsonView; +import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json; +import org.eclipse.openk.model.utils.converter.Boolean2StringConverter; + +import javax.persistence.Convert; +import javax.persistence.Embeddable; + +/** + * Measurement quality flags. Bits 0-10 are defined for substation automation in + * draft IEC 61850 part 7-3. Bits 11-15 are reserved for future expansion by that + * document. Bits 16-31 are reserved for EMS applications. + */ +@Embeddable +public class MeasurementValueQuality { + + /** + * This identifier indicates that a supervision function has detected an internal + * or external failure, e.g. communication failure. + */ + @JsonView(IncludeAttribute4Json.NetworkState.class) + @Convert(converter = Boolean2StringConverter.class) + private Boolean failure; + + public Boolean isFailure() { + return failure; + } +} diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/utils/converter/Boolean2StringConverter.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/utils/converter/Boolean2StringConverter.java index 8e7c12e6..e12d9676 100644 --- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/utils/converter/Boolean2StringConverter.java +++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/utils/converter/Boolean2StringConverter.java @@ -30,7 +30,7 @@ public class Boolean2StringConverter implements AttributeConverter operatingParticipantList; + @JsonView(IncludeAttribute4Json.Topology.class) @OneToMany(targetEntity = Terminal.class, cascade = CascadeType.PERSIST) @JoinColumn(name = "AC_LINE_SEGMENT_ID") diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/BusbarSection.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/BusbarSection.java index 785646ea..b1cd8713 100644 --- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/BusbarSection.java +++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/BusbarSection.java @@ -15,6 +15,7 @@ package org.eclipse.openk.model.wires; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonView; import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json; +import org.eclipse.openk.model.core.OperatingParticipant; import org.eclipse.openk.model.core.Terminal; import javax.persistence.Access; @@ -37,7 +38,7 @@ import java.util.List; * Voltage measurements are typically obtained from VoltageTransformers that are * connected to busbar sections. A bus bar section may have many physical * terminals but for analysis is modelled with exactly one logical terminal. - * + *

* Sammelschiene */ @Entity @@ -64,6 +65,10 @@ public class BusbarSection extends Connector { @Column(name = "NAME") private String name; + @OneToMany(targetEntity = OperatingParticipant.class, cascade = CascadeType.PERSIST) + @JoinColumn(name = "BUSBAR_SECTION_ID") + private List operatingParticipantList; + @JsonView(IncludeAttribute4Json.Topology.class) @OneToMany(targetEntity = Terminal.class, cascade = CascadeType.PERSIST) @JoinColumn(name = "BUSBAR_SECTION_ID") diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/PowerTransformer.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/PowerTransformer.java index 1fdd558c..0312ec3a 100644 --- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/PowerTransformer.java +++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/PowerTransformer.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonView; import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json; import org.eclipse.openk.model.core.ConductingEquipment; +import org.eclipse.openk.model.core.OperatingParticipant; import org.eclipse.openk.model.core.Terminal; import javax.persistence.Access; @@ -70,6 +71,10 @@ public class PowerTransformer extends ConductingEquipment { @Column(name = "NAME") private String name; + @OneToMany(targetEntity = OperatingParticipant.class, cascade = CascadeType.PERSIST) + @JoinColumn(name = "POWER_TRANSFOMER_ID") + private List operatingParticipantList; + @JsonView(IncludeAttribute4Json.Topology.class) @OneToMany(targetEntity = Terminal.class, cascade = CascadeType.PERSIST) @JoinColumn(name = "POWER_TRANSFORMER_ID") diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/Switch.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/Switch.java index 3753de01..0c94f9e9 100644 --- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/Switch.java +++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/Switch.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonView; import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json; import org.eclipse.openk.model.core.ConductingEquipment; +import org.eclipse.openk.model.core.OperatingParticipant; import org.eclipse.openk.model.core.Terminal; import org.eclipse.openk.model.utils.converter.Boolean2StringConverter; @@ -37,7 +38,7 @@ import java.util.List; /** * A generic device designed to close, or open, or both, one or more electric * circuits. - * + *

* Schalter */ @Entity @@ -68,6 +69,10 @@ public class Switch extends ConductingEquipment { @Column(name = "NAME") private String name; + @OneToMany(targetEntity = OperatingParticipant.class, cascade = CascadeType.PERSIST) + @JoinColumn(name = "SWITCH_ID") + private List operatingParticipantList; + @JsonView(IncludeAttribute4Json.Topology.class) @OneToMany(targetEntity = Terminal.class, cascade = CascadeType.PERSIST) @JoinColumn(name = "SWITCH_ID") diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/SynchronousMachine.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/SynchronousMachine.java index 8bf962ae..adeae9d3 100644 --- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/SynchronousMachine.java +++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/wires/SynchronousMachine.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonView; import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json; import org.eclipse.openk.model.common.Location; +import org.eclipse.openk.model.core.OperatingParticipant; import org.eclipse.openk.model.core.Terminal; import org.eclipse.openk.model.domain.CommunicationType; import org.eclipse.openk.model.domain.PerCent; @@ -102,7 +103,6 @@ public class SynchronousMachine extends RotatingMachine { }) private Voltage maxU; - /** * Modes that this synchronous machine can operate in. */ @@ -122,13 +122,13 @@ public class SynchronousMachine extends RotatingMachine { private PerCent currentReductionSetting; /** - * All reduction settings of a Synchronous Machine, e.g. 30%, 60% and 100% - * CIM extension by Jan Krueger, April 2015 + * Status of the reduction setting which is currently set. + * CIM extension by Jan Krueger, May 2015 */ @JsonView(IncludeAttribute4Json.SynchronousMachine.class) - @OneToMany(targetEntity = ReductionSetting.class, cascade = CascadeType.PERSIST) - @JoinColumn(name = "SYNCHRONOUS_MACHINE_ID") - private List reductionSettingList; + @Convert(converter = Boolean2StringConverter.class) + @Column(name = "STATUS_CURRENT_REDUCTION_SETTING") + private Boolean statusCurrentReductionSetting; /** * The feed-in ranking of a generator (SynchronousMachine) as @@ -191,6 +191,20 @@ public class SynchronousMachine extends RotatingMachine { @JoinColumn(name = "LOCATION_ID") private Location location; + /** + * All reduction settings of a Synchronous Machine, e.g. 30%, 60% and 100% + * CIM extension by Jan Krueger, April 2015 + */ + @JsonView(IncludeAttribute4Json.SynchronousMachine.class) + @OneToMany(targetEntity = ReductionSetting.class, cascade = CascadeType.PERSIST) + @JoinColumn(name = "SYNCHRONOUS_MACHINE_ID") + private List reductionSettingList; + + @JsonView(IncludeAttribute4Json.SynchronousMachine.class) + @OneToMany(targetEntity = OperatingParticipant.class, cascade = CascadeType.PERSIST) + @JoinColumn(name = "SYNCHRONOUS_MACHINE_ID") + private List operatingParticipantList; + @JsonView(IncludeAttribute4Json.Topology.class) @OneToMany(targetEntity = Terminal.class, cascade = CascadeType.PERSIST) @JoinColumn(name = "SYNCHRONOUS_MACHINE_ID") @@ -281,4 +295,16 @@ public class SynchronousMachine extends RotatingMachine { public Integer getFeedInPriority() { return feedInPriority; } + + public Boolean isControlEnabled() { + return controlEnabled; + } + + public Boolean isStatusCurrentReductionSetting() { + return statusCurrentReductionSetting; + } + + public List getOperatingParticipantList() { + return operatingParticipantList; + } } diff --git a/openk-platform/openk-cachedb-service/src/main/resources/flyway-migration/V01/_00/OPENK_CACHEDB_V01_00_001__init.sql b/openk-platform/openk-cachedb-service/src/main/resources/flyway-migration/V01/_00/OPENK_CACHEDB_V01_00_001__init.sql index d312ab34..c5ab0cda 100644 --- a/openk-platform/openk-cachedb-service/src/main/resources/flyway-migration/V01/_00/OPENK_CACHEDB_V01_00_001__init.sql +++ b/openk-platform/openk-cachedb-service/src/main/resources/flyway-migration/V01/_00/OPENK_CACHEDB_V01_00_001__init.sql @@ -27,12 +27,14 @@ INSERT INTO OPENK_CACHEDB_SEQ_TABLE (seq_name, seq_count) VALUES ('REDUCTION_SET INSERT INTO OPENK_CACHEDB_SEQ_TABLE (seq_name, seq_count) VALUES ('AC_LINE_SEGMENT_SEQ', 1); INSERT INTO OPENK_CACHEDB_SEQ_TABLE (seq_name, seq_count) VALUES ('GEOGRAPHICAL_REGION_SEQ', 1); INSERT INTO OPENK_CACHEDB_SEQ_TABLE (seq_name, seq_count) VALUES ('SUBGEOGRAPHICAL_REGION_SEQ', 1); +INSERT INTO OPENK_CACHEDB_SEQ_TABLE (seq_name, seq_count) VALUES ('OPERATING_PARTICIPANT_SEQ', 1); +INSERT INTO OPENK_CACHEDB_SEQ_TABLE (seq_name, seq_count) VALUES ('OPERATING_SHARE_SEQ', 1); CREATE TABLE GEOGRAPHICAL_REGION ( ID INTEGER NOT NULL, MRID VARCHAR(16), - NAME VARCHAR(64), + NAME VARCHAR(128), CONSTRAINT "PK_GEOGRAPHICAL_REGION" PRIMARY KEY (ID) ) WITH (OIDS =FALSE @@ -42,8 +44,8 @@ ALTER TABLE GEOGRAPHICAL_REGION OWNER TO cachedb; CREATE TABLE SUBGEOGRAPHICAL_REGION ( ID INTEGER NOT NULL, - MRID VARCHAR(16), - NAME VARCHAR(64), + MRID VARCHAR(16) UNIQUE, + NAME VARCHAR(128), GEOGRAPHICAL_REGION_ID INTEGER, CONSTRAINT "PK_SUBGEOGRAPHICAL_REGION" PRIMARY KEY (ID), CONSTRAINT "FK_SUBGEOGRAPHICAL_REGION_GEOGRAPHICAL_REGION" FOREIGN KEY (GEOGRAPHICAL_REGION_ID) REFERENCES GEOGRAPHICAL_REGION (ID) ON UPDATE NO ACTION ON DELETE NO ACTION @@ -54,9 +56,9 @@ ALTER TABLE SUBGEOGRAPHICAL_REGION OWNER TO cachedb; CREATE TABLE EQUIPMENT_CONTAINER ( - ID INTEGER NOT NULL, - MRID VARCHAR(16) NOT NULL , - NAME VARCHAR(64), + ID INTEGER NOT NULL, + MRID VARCHAR(16) NOT NULL UNIQUE, + NAME VARCHAR(128), HIGH_VOLTAGE_LIMIT_VALUE NUMERIC, HIGH_VOLTAGE_LIMIT_UNIT_MULTIPLIER VARCHAR(12), HIGH_VOLTAGE_LIMIT_UNIT_SYMBOL VARCHAR(12), @@ -73,7 +75,7 @@ ALTER TABLE EQUIPMENT_CONTAINER OWNER TO cachedb; CREATE TABLE LOCATION ( ID INTEGER NOT NULL, - NAME VARCHAR(64), + NAME VARCHAR(128), STREET_NAME VARCHAR(64), STREET_NUMBER VARCHAR(12), POSTAL_CODE VARCHAR(12), @@ -121,21 +123,22 @@ ALTER TABLE GENERATING_UNIT OWNER TO cachedb; CREATE TABLE SYNCHRONOUS_MACHINE ( ID INTEGER NOT NULL, - MRID VARCHAR(16) NOT NULL, - NAME VARCHAR(64), - NORMALLY_IN_SERVICE VARCHAR(5) NOT NULL, + MRID VARCHAR(16) NOT NULL UNIQUE, + NAME VARCHAR(128), + NORMALLY_IN_SERVICE VARCHAR(5) NOT NULL, MAX_VOLTAGE_LIMIT_VALUE NUMERIC, MAX_VOLTAGE_LIMIT_UNIT_MULTIPLIER VARCHAR(12), MAX_VOLTAGE_LIMIT_UNIT_SYMBOL VARCHAR(12), SYNCHRONOUS_MACHINE_KIND VARCHAR(32) NOT NULL, CURRENT_REDUCTION_SETTING_PER_CENT INTEGER, + STATUS_CURRENT_REDUCTION_SETTING VARCHAR(5) NOT NULL, FEED_IN_RANKING INTEGER, FEED_IN_PRIORITY INTEGER, COMMUNICATION_TYPE VARCHAR(12), COMMUNICATION_GROUP INTEGER, - CONTROL_ENABLED VARCHAR(5) NOT NULL, + CONTROL_ENABLED VARCHAR(5) NOT NULL, SYNCHRONOUS_MACHINE_ID INTEGER, - GENERATING_UNIT_ID INTEGER NOT NULL, + GENERATING_UNIT_ID INTEGER NOT NULL, LOCATION_ID INTEGER, EQUIPMENT_CONTAINER_ID INTEGER, CONSTRAINT "PK_SYNCHRONOUS_MACHINE_ID" PRIMARY KEY (ID), @@ -163,7 +166,7 @@ ALTER TABLE REDUCTION_SETTING OWNER TO cachedb; CREATE TABLE MEASUREMENT_ANALOG ( ID INTEGER NOT NULL, - MRID VARCHAR(16), + MRID VARCHAR(16) UNIQUE, MEASUREMENT_TYPE VARCHAR(16), MEASUREMENT_UNIT_MULTIPLIER VARCHAR(12), MEASUREMENT_UNIT_SYMBOL VARCHAR(12), @@ -180,9 +183,10 @@ ALTER TABLE MEASUREMENT_ANALOG OWNER TO cachedb; CREATE TABLE MEASUREMENT_ANALOG_VALUE ( - ID INTEGER NOT NULL, + ID INTEGER NOT NULL, TIMESTAMP_VALUE TIMESTAMP, VALUE NUMERIC, + VALUE_QUALITY_FAILURE VARCHAR(5) NOT NULL, MEASUREMENT_ANALOG_ID INTEGER, CONSTRAINT "PK_MEASUREMENT_ANALOG_VALUE" PRIMARY KEY (ID), CONSTRAINT "FK_MEASUREMENT_ANALOG_VALUE_MEASUREMENT_ANALOG" FOREIGN KEY (MEASUREMENT_ANALOG_ID) REFERENCES MEASUREMENT_ANALOG (ID) ON UPDATE NO ACTION ON DELETE NO ACTION @@ -194,7 +198,7 @@ ALTER TABLE MEASUREMENT_ANALOG_VALUE OWNER TO cachedb; CREATE TABLE PSR_EVENT ( ID INTEGER NOT NULL, - MRID VARCHAR(16), + MRID VARCHAR(16) UNIQUE, PSR_EVENT_KIND VARCHAR(16), TIMESTAMP_CREATED TIMESTAMP, SYNCHRONOUS_MACHINE_ID INTEGER, @@ -208,8 +212,8 @@ ALTER TABLE PSR_EVENT OWNER TO cachedb; CREATE TABLE AC_LINE_SEGMENT ( ID INTEGER NOT NULL, - MRID VARCHAR(16), - NAME VARCHAR(64), + MRID VARCHAR(16) UNIQUE, + NAME VARCHAR(128), EQUIPMENT_CONTAINER_ID INTEGER, CONSTRAINT "PK_ACL_LINE_SEGMENT" PRIMARY KEY (ID), CONSTRAINT "FK_AC_LINE_SEGMENT_EQUIPMENT_CONTAINER" FOREIGN KEY (EQUIPMENT_CONTAINER_ID) REFERENCES EQUIPMENT_CONTAINER (ID) ON UPDATE NO ACTION ON DELETE NO ACTION @@ -221,8 +225,8 @@ ALTER TABLE AC_LINE_SEGMENT OWNER TO cachedb; CREATE TABLE POWER_TRANSFORMER ( ID INTEGER NOT NULL, - MRID VARCHAR(16), - NAME VARCHAR(64), + MRID VARCHAR(16) UNIQUE, + NAME VARCHAR(128), EQUIPMENT_CONTAINER_ID INTEGER, CONSTRAINT "PK_POWER_TRANSFORMER" PRIMARY KEY (ID), CONSTRAINT "FK_POWER_TRANSFORMER_EQUIPMENT_CONTAINER" FOREIGN KEY (EQUIPMENT_CONTAINER_ID) REFERENCES EQUIPMENT_CONTAINER (ID) ON UPDATE NO ACTION ON DELETE NO ACTION @@ -234,8 +238,8 @@ ALTER TABLE POWER_TRANSFORMER OWNER TO cachedb; CREATE TABLE SWITCH ( ID INTEGER NOT NULL, - MRID VARCHAR(16), - NAME VARCHAR(64), + MRID VARCHAR(16) UNIQUE, + NAME VARCHAR(128), OPEN VARCHAR(5), EQUIPMENT_CONTAINER_ID INTEGER, CONSTRAINT "PK_SWITCH" PRIMARY KEY (ID), @@ -248,8 +252,8 @@ ALTER TABLE SWITCH OWNER TO cachedb; CREATE TABLE BUSBAR_SECTION ( ID INTEGER NOT NULL, - MRID VARCHAR(16), - NAME VARCHAR(64), + MRID VARCHAR(16) UNIQUE, + NAME VARCHAR(128), EQUIPMENT_CONTAINER_ID INTEGER, CONSTRAINT "PK_BUSBAR_SECTION" PRIMARY KEY (ID), CONSTRAINT "FK_BUSBAR_SECTION_EQUIPMENT_CONTAINER" FOREIGN KEY (EQUIPMENT_CONTAINER_ID) REFERENCES EQUIPMENT_CONTAINER (ID) ON UPDATE NO ACTION ON DELETE NO ACTION @@ -258,11 +262,58 @@ WITH (OIDS =FALSE ); ALTER TABLE BUSBAR_SECTION OWNER TO cachedb; + +CREATE TABLE OPERATING_PARTICIPANT +( + ID INTEGER NOT NULL, + MRID VARCHAR(16) NOT NULL, + NAME VARCHAR(128), + SHARE_PER_CENT INTEGER, + POWER_TRANSFORMER_ID INTEGER, + BUSBAR_SECTION_ID INTEGER, + SWITCH_ID INTEGER, + SYNCHRONOUS_MACHINE_ID INTEGER, + AC_LINE_SEGMENT_ID INTEGER, + CONSTRAINT "PK_OPERATING_PARTICIPANT" PRIMARY KEY (ID), + CONSTRAINT "FK_OPERATING_PARTICIPIENT_POWER_TRANSFORMER" FOREIGN KEY (POWER_TRANSFORMER_ID) REFERENCES POWER_TRANSFORMER (ID) ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT "FK_OPERATING_PARTICIPIENT_BUSBAR_SECTION" FOREIGN KEY (BUSBAR_SECTION_ID) REFERENCES BUSBAR_SECTION (ID) ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT "FK_OPERATING_PARTICIPIENT_SWITCH" FOREIGN KEY (SWITCH_ID) REFERENCES SWITCH (ID) ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT "FK_OPERATING_PARTICIPIENT_SYNCHRONOUS_MACHINE" FOREIGN KEY (SYNCHRONOUS_MACHINE_ID) REFERENCES SYNCHRONOUS_MACHINE (ID) ON UPDATE NO ACTION ON DELETE NO ACTION, + CONSTRAINT "FK_OPERATING_PARTICIPIENT_AC_LINE_SEGMENT" FOREIGN KEY (AC_LINE_SEGMENT_ID) REFERENCES AC_LINE_SEGMENT (ID) ON UPDATE NO ACTION ON DELETE NO ACTION +) +WITH (OIDS =FALSE +); +ALTER TABLE OPERATING_PARTICIPANT OWNER TO cachedb; + +-- CREATE TABLE OPERATING_SHARE +-- ( +-- ID INTEGER NOT NULL, +-- SHARE_PER_CENT INTEGER, +-- OPERATING_PARTICIPANT_MRID VARCHAR(16), + -- OPERATING_PARTICIPANT_ID INTEGER, +-- POWER_TRANSFORMER_ID INTEGER, +-- BUSBAR_SECTION_ID INTEGER, +-- SWITCH_ID INTEGER, +-- SYNCHRONOUS_MACHINE_ID INTEGER, +-- AC_LINE_SEGMENT_ID INTEGER, +-- CONSTRAINT "PK_OPERATING_SHARE" PRIMARY KEY (ID), +-- CONSTRAINT "FK_OPERATING_SHARE_OPERATING_PARTICIPANT" FOREIGN KEY (OPERATING_PARTICIPANT_MRID) REFERENCES OPERATING_PARTICIPANT (MRID) ON UPDATE NO ACTION ON DELETE NO ACTION, +-- -- CONSTRAINT "FK_OPERATING_SHARE_OPERATING_PARTICIPANT" FOREIGN KEY (OPERATING_PARTICIPANT_ID) REFERENCES OPERATING_PARTICIPANT (ID) ON UPDATE NO ACTION ON DELETE NO ACTION, +-- CONSTRAINT "FK_OPERATING_SHARE_POWER_TRANSFORMER" FOREIGN KEY (POWER_TRANSFORMER_ID) REFERENCES POWER_TRANSFORMER (ID) ON UPDATE NO ACTION ON DELETE NO ACTION, +-- CONSTRAINT "FK_OPERATING_SHARE_BUSBAR_SECTION" FOREIGN KEY (BUSBAR_SECTION_ID) REFERENCES BUSBAR_SECTION (ID) ON UPDATE NO ACTION ON DELETE NO ACTION, +-- CONSTRAINT "FK_OPERATING_SHARE_SWITCH" FOREIGN KEY (SWITCH_ID) REFERENCES SWITCH (ID) ON UPDATE NO ACTION ON DELETE NO ACTION, +-- CONSTRAINT "FK_OPERATING_SHARE_SYNCHRONOUS_MACHINE" FOREIGN KEY (SYNCHRONOUS_MACHINE_ID) REFERENCES SYNCHRONOUS_MACHINE (ID) ON UPDATE NO ACTION ON DELETE NO ACTION, +-- CONSTRAINT "FK_OPERATING_SHARE_AC_LINE_SEGMENT" FOREIGN KEY (AC_LINE_SEGMENT_ID) REFERENCES AC_LINE_SEGMENT (ID) ON UPDATE NO ACTION ON DELETE NO ACTION +-- ) +-- WITH (OIDS =FALSE +-- ); +-- ALTER TABLE OPERATING_SHARE OWNER TO cachedb; + CREATE TABLE CONNECTIVITY_NODE ( ID INTEGER NOT NULL, MRID VARCHAR(16), - NAME VARCHAR(64), + NAME VARCHAR(128), EQUIPMENT_CONTAINER_ID INTEGER, CONSTRAINT "PK_CONNECTIVITY_NODE" PRIMARY KEY (ID), CONSTRAINT "FK_CONNECTIVITY_NODE_EQUIPMENT_CONTAINER" FOREIGN KEY (EQUIPMENT_CONTAINER_ID) REFERENCES EQUIPMENT_CONTAINER (ID) ON UPDATE NO ACTION ON DELETE NO ACTION @@ -273,9 +324,10 @@ ALTER TABLE CONNECTIVITY_NODE OWNER TO cachedb; CREATE TABLE TERMINAL ( - ID INTEGER NOT NULL, - MRID VARCHAR(16), - NAME VARCHAR(64), + ID INTEGER NOT NULL, + MRID VARCHAR(16) NOT NULL, + NAME VARCHAR(128) NOT NULL, + CONNECTED VARCHAR(5) NOT NULL, CONNECTIVITY_NODE_ID INTEGER, POWER_TRANSFORMER_ID INTEGER, BUSBAR_SECTION_ID INTEGER, diff --git a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumerTest.java b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumerTest.java index 5e2564c2..539885ec 100644 --- a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumerTest.java +++ b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumerTest.java @@ -12,7 +12,6 @@ */ package org.eclipse.openk.adapter.rest; -import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json; import org.eclipse.openk.model.core.GeographicalRegion; import org.eclipse.openk.model.core.SubGeographicalRegion; import org.eclipse.openk.model.core.Substation; @@ -22,7 +21,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; import org.springframework.test.web.client.MockRestServiceServer; -import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestTemplate; import org.testng.Assert; import org.testng.annotations.AfterMethod; @@ -31,7 +29,6 @@ import org.testng.annotations.Test; import javax.persistence.Query; import java.io.IOException; import java.net.URISyntaxException; -import java.util.List; import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; @@ -45,7 +42,7 @@ public class GeographicalRegionRestConsumerTest extends AbstractRepositoryJpaTes @AfterMethod private void cleanup() { - deleteDataTopology(); + //deleteDataTopology(); } @Test(enabled = false) // nur enablen, wenn Liferay Portal gestartet ist @@ -56,13 +53,70 @@ public class GeographicalRegionRestConsumerTest extends AbstractRepositoryJpaTes geographicalRegionRepository.save(geographicalRegionNew); } + // Test mit Measurement, allerdings sollen in der Topology die Messdaten nicht enthalten sein todo: anpassen @Test() - public void getAndSaveGeographicalRegionFromJsonFile() throws IOException, URISyntaxException { + public void getAndSaveGeographicalRegionFromJsonFile01() throws IOException, URISyntaxException { - final String contentJson = getContentOfJsonFile("json-test-samples/geographicalregion-sample-03.json"); + final String contentJson = getContentOfJsonFile("json-test-samples/geographicalregion-sample-01.json"); + final String uri = "/openk-cachedb-service/rest/topology/geographicalregion/1000"; + + GeographicalRegion geographicalRegion = + initRestTemplate(contentJson, uri).getForObject(uri, GeographicalRegion.class); + + Assert.assertTrue(geographicalRegion.getName().startsWith(PREFIX_TEST_NAME)); + Assert.assertFalse(geographicalRegion.getmRid().isEmpty()); + Assert.assertFalse(geographicalRegion.getSubGeographicalRegionList().isEmpty()); + SubGeographicalRegion subGeographicalRegion = geographicalRegion.getSubGeographicalRegionList().get(0); + Assert.assertEquals(subGeographicalRegion.getName(), "UnitTest - Netzgebiet A"); + Substation substation = subGeographicalRegion.getSubstationList().get(0); + Assert.assertEquals(substation.getName(), "UnitTest - Substation01 - Ortsnetzstation Stopfenheim"); + Assert.assertEquals(substation.getSynchronousMachineList().size(), 2); + Assert.assertEquals(substation.getConnectivityNodeList().size(), 5); + Assert.assertEquals(substation.getVoltageLevelList().size(), 0); + Assert.assertEquals(substation.getAcLineSegmentList().size(), 1); + + geographicalRegionRepository.save(geographicalRegion); + +// Assert.assertEquals(getCountTerminals(), Long.valueOf(82)); +// Assert.assertEquals(getCountConnectivityNode(), Long.valueOf(19)); + } + + @Test() + public void getAndSaveGeographicalRegionFromJsonFile05() throws IOException, URISyntaxException { + + final String contentJson = getContentOfJsonFile("json-test-samples/geographicalregion-sample-05.json"); + final String uri = "/openk-cachedb-service/rest/topology/geographicalregion/1000899"; + + GeographicalRegion geographicalRegion = + initRestTemplate(contentJson, uri).getForObject(uri, GeographicalRegion.class); + + Assert.assertTrue(geographicalRegion.getName().startsWith(PREFIX_TEST_NAME)); + Assert.assertFalse(geographicalRegion.getmRid().isEmpty()); +// Assert.assertFalse(geographicalRegion.getSubGeographicalRegionList().isEmpty()); +// SubGeographicalRegion subGeographicalRegion = geographicalRegion.getSubGeographicalRegionList().get(0); +// Assert.assertEquals(subGeographicalRegion.getName(), "UnitTest - Netzgebiet A"); +// Substation substation = subGeographicalRegion.getSubstationList().get(0); +// Assert.assertEquals(substation.getName(), "UnitTest - Substation01 - Ortsnetzstation Stopfenheim"); +// Assert.assertEquals(substation.getSynchronousMachineList().size(), 2); +// Assert.assertEquals(substation.getConnectivityNodeList().size(), 5); +// Assert.assertEquals(substation.getVoltageLevelList().size(), 0); +// Assert.assertEquals(substation.getAcLineSegmentList().size(), 1); + + geographicalRegionRepository.save(geographicalRegion); + +// Assert.assertEquals(getCountTerminals(), Long.valueOf(82)); +// Assert.assertEquals(getCountConnectivityNode(), Long.valueOf(19)); + } + + // Test mit Measurement, allerdings sollen in der Topology die Messdaten nicht enthalten sein todo: anpassen +// @Test() + public void getAndSaveGeographicalRegionFromJsonFileWithMeasurement() throws IOException, URISyntaxException { + + final String contentJson = getContentOfJsonFile("json-test-samples/geographicalregion-sample-02.json"); RestTemplate restTemplate = new RestTemplate(); MockRestServiceServer mockServer = MockRestServiceServer.createServer(restTemplate); + mockServer.expect(requestTo("/openk-cachedb-service/rest/topology/geographicalregion/1000")).andExpect(method(HttpMethod.GET)) .andRespond(withSuccess(contentJson, MediaType.APPLICATION_JSON)); @@ -80,7 +134,7 @@ public class GeographicalRegionRestConsumerTest extends AbstractRepositoryJpaTes Assert.assertEquals(subGeographicalRegion.getName(), "UnitTest - Netzgebiet A"); Substation substation = subGeographicalRegion.getSubstationList().get(0); Assert.assertEquals(substation.getName(), "UnitTest - Substation01 - Ortsnetzstation Stopfenheim"); - Assert.assertEquals(substation.getSynchronousMachineList().size(), 2); + Assert.assertEquals(substation.getSynchronousMachineList().size(), 1); Assert.assertEquals(substation.getConnectivityNodeList().size(), 3); Assert.assertEquals(substation.getVoltageLevelList().size(), 0); Assert.assertEquals(substation.getAcLineSegmentList().size(), 1); @@ -91,15 +145,13 @@ public class GeographicalRegionRestConsumerTest extends AbstractRepositoryJpaTes Assert.assertEquals(getCountConnectivityNode(), Long.valueOf(19)); } - // Test mit Measurement, allerdings sollen in der Topology die Messdaten nicht enthalten sein todo: anpassen @Test() - public void getAndSaveGeographicalRegionFromJsonFileWithMeasurement() throws IOException, URISyntaxException { + public void getAndSaveGeographicalRegionFromJsonFile() throws IOException, URISyntaxException { - final String contentJson = getContentOfJsonFile("json-test-samples/geographicalregion-sample-02.json"); + final String contentJson = getContentOfJsonFile("json-test-samples/geographicalregion-sample-03.json"); RestTemplate restTemplate = new RestTemplate(); MockRestServiceServer mockServer = MockRestServiceServer.createServer(restTemplate); - mockServer.expect(requestTo("/openk-cachedb-service/rest/topology/geographicalregion/1000")).andExpect(method(HttpMethod.GET)) .andRespond(withSuccess(contentJson, MediaType.APPLICATION_JSON)); @@ -117,7 +169,7 @@ public class GeographicalRegionRestConsumerTest extends AbstractRepositoryJpaTes Assert.assertEquals(subGeographicalRegion.getName(), "UnitTest - Netzgebiet A"); Substation substation = subGeographicalRegion.getSubstationList().get(0); Assert.assertEquals(substation.getName(), "UnitTest - Substation01 - Ortsnetzstation Stopfenheim"); - Assert.assertEquals(substation.getSynchronousMachineList().size(), 1); + Assert.assertEquals(substation.getSynchronousMachineList().size(), 2); Assert.assertEquals(substation.getConnectivityNodeList().size(), 3); Assert.assertEquals(substation.getVoltageLevelList().size(), 0); Assert.assertEquals(substation.getAcLineSegmentList().size(), 1); @@ -128,14 +180,14 @@ public class GeographicalRegionRestConsumerTest extends AbstractRepositoryJpaTes Assert.assertEquals(getCountConnectivityNode(), Long.valueOf(19)); } - private Long getCountTerminals(){ + private Long getCountTerminals() { Query selectCountTerminal = entityManager.createNativeQuery( "select count(*) from terminal where name like ?1"); selectCountTerminal.setParameter(1, PREFIX_TEST_NAME + "%"); return (Long) selectCountTerminal.getSingleResult(); } - private Long getCountConnectivityNode(){ + private Long getCountConnectivityNode() { Query selectCountConnectivityNode = entityManager.createNativeQuery( "select count(*) from connectivity_node where name like ?1"); selectCountConnectivityNode.setParameter(1, PREFIX_TEST_NAME + "%"); diff --git a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/SynchronousMachineRestConsumerTest.java b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/SynchronousMachineRestConsumerTest.java index 072f9927..f74eab0e 100644 --- a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/SynchronousMachineRestConsumerTest.java +++ b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/SynchronousMachineRestConsumerTest.java @@ -60,7 +60,23 @@ public class SynchronousMachineRestConsumerTest extends AbstractRepositoryJpaTes } @Test() - public void getAndSaveSynchronousMachineListFromJsonFile() throws IOException, URISyntaxException { + public void getAndSaveSynchronousMachineListFromJsonFile01() throws IOException, URISyntaxException { + + final String contentJson = getContentOfJsonFile("json-test-samples/synchronousmachine-sample-01.json"); + final String uri = "/openk-cachedb-service/rest/synchronousmachine/"; + + SynchronousMachine[] synchronousMachineList = initRestTemplate(contentJson, uri).getForObject(uri, SynchronousMachine[].class); + + Assert.assertEquals(synchronousMachineList.length, 3); + + for (SynchronousMachine synchronousMachine : Arrays.asList(synchronousMachineList)) { + Assert.assertTrue(synchronousMachine.getGeneratingUnit() != null); + synchronousMachineRepository.save(synchronousMachine); + } + } +// todo: funktioniert aktuell nur wenn die DB leer ist +// @Test() + public void getAndSaveSynchronousMachineListFromJsonFile02() throws IOException, URISyntaxException { final String contentJson = getContentOfJsonFile("json-test-samples/synchronousmachine-sample-02.json"); diff --git a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/AbstractRepositoryJpaTest.java b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/AbstractRepositoryJpaTest.java index d1f89913..73096cde 100644 --- a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/AbstractRepositoryJpaTest.java +++ b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/AbstractRepositoryJpaTest.java @@ -14,12 +14,16 @@ package org.eclipse.openk.repository; import com.google.common.base.Charsets; import com.google.common.io.CharStreams; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.TestExecutionListeners; import org.springframework.test.context.testng.AbstractTestNGSpringContextTests; import org.springframework.test.context.transaction.TransactionConfiguration; import org.springframework.test.context.transaction.TransactionalTestExecutionListener; +import org.springframework.test.web.client.MockRestServiceServer; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.client.RestTemplate; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; @@ -29,6 +33,10 @@ import java.io.InputStreamReader; import java.net.URISyntaxException; import java.util.List; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; +import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; + @TransactionConfiguration(defaultRollback = false) @Transactional(value = "cacheDbTransactionManager", rollbackFor = Throwable.class) @TestExecutionListeners(TransactionalTestExecutionListener.class) @@ -40,12 +48,30 @@ public class AbstractRepositoryJpaTest extends AbstractTestNGSpringContextTests @PersistenceContext(unitName = "cacheDbEntityManagerFactory") protected EntityManager entityManager; + protected RestTemplate initRestTemplate(String contentJson, String uri) { + RestTemplate restTemplate = new RestTemplate(); + MockRestServiceServer mockServer = MockRestServiceServer.createServer(restTemplate); + mockServer.expect(requestTo(uri)).andExpect(method(HttpMethod.GET)) + .andRespond(withSuccess(contentJson, MediaType.APPLICATION_JSON)); + return restTemplate; + } + protected String getContentOfJsonFile(final String path) throws IOException, URISyntaxException { return CharStreams.toString(new InputStreamReader(ClassLoader.getSystemResourceAsStream(path), Charsets.UTF_8)); } protected void deleteDataTopology() { + Query deleteOperatingParticipant = entityManager.createNativeQuery( + "delete from operating_participant where synchronous_machine_id in (select id from synchronous_machine where name like ?1)"); + deleteOperatingParticipant.setParameter(1, PREFIX_TEST_NAME + "%"); + deleteOperatingParticipant.executeUpdate(); + +// Query deleteOperatingShare = entityManager.createNativeQuery( +// "delete from operating_share where synchronous_machine_id in (select id from synchronous_machine where name like ?1)"); +// deleteOperatingShare.setParameter(1, PREFIX_TEST_NAME + "%"); +// deleteOperatingShare.executeUpdate(); + Query deleteTerminalStatement = entityManager.createNativeQuery( "delete from terminal where name like ?1"); deleteTerminalStatement.setParameter(1, PREFIX_TEST_NAME + "%"); @@ -140,5 +166,4 @@ public class AbstractRepositoryJpaTest extends AbstractTestNGSpringContextTests deleteGeographicalRegionStatement.executeUpdate(); } - } diff --git a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SynchronousMachineRepositoryTest.java b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SynchronousMachineRepositoryTest.java index f75ed46e..6218a84b 100644 --- a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SynchronousMachineRepositoryTest.java +++ b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SynchronousMachineRepositoryTest.java @@ -90,8 +90,9 @@ public class SynchronousMachineRepositoryTest extends AbstractRepositoryJpaTest Query insertSynchronousMachine = entityManager.createNativeQuery( "INSERT INTO SYNCHRONOUS_MACHINE " + - "(ID, MRID, SYNCHRONOUS_MACHINE_KIND, GENERATING_UNIT_ID, EQUIPMENT_CONTAINER_ID, NORMALLY_IN_SERVICE, CONTROL_ENABLED) " + - "VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)"); + "(ID, MRID, SYNCHRONOUS_MACHINE_KIND, GENERATING_UNIT_ID, EQUIPMENT_CONTAINER_ID, " + + "NORMALLY_IN_SERVICE, CONTROL_ENABLED, STATUS_CURRENT_REDUCTION_SETTING) " + + "VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8)"); insertSynchronousMachine.setParameter(1, 5557L); insertSynchronousMachine.setParameter(2, "Test5557"); insertSynchronousMachine.setParameter(3, "GENERATOR"); @@ -99,6 +100,7 @@ public class SynchronousMachineRepositoryTest extends AbstractRepositoryJpaTest insertSynchronousMachine.setParameter(5, 998844L); insertSynchronousMachine.setParameter(6, "TRUE"); insertSynchronousMachine.setParameter(7, "TRUE"); + insertSynchronousMachine.setParameter(8, "TRUE"); insertSynchronousMachine.executeUpdate(); } diff --git a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-01.json b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-01.json index bdeba850..122e0843 100644 --- a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-01.json +++ b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-01.json @@ -1,469 +1,1182 @@ -[{ - "name": "Test - Geamtes Netz Netzbetreiber A", - "mRid": "1000", +{ + "name": "UnitTest - Geamtes Netz Netzbetreiber A", + "mRid": "1000544", "subGeographicalRegionList": [ { - "name": "Netzgebiet A", - "mRid": "1000", + "name": "UnitTest - Netzgebiet A", + "mRid": "10005454", "substationList": [ { - "name": "Substation01 - Ortsnetzstation Stopfenheim", - "mRid": "236454466", + "name": "UnitTest - Substation01 - Ortsnetzstation Stopfenheim", + "mRid": "77845558", "connectivityNodeList": [ { - "name": "CN01", + "name": "UnitTest - CN01", "mRid": "12359", "terminalList": [ { - "name": "T01", + "name": "UnitTest - T01", "mRid": "1000" }, { - "name": "T02", + "name": "UnitTest - T02", "mRid": "1002" } ] }, { - "name": "CN02", + "name": "UnitTest - CN02", "mRid": "235699898", "terminalList": [ { - "name": "T03", + "name": "UnitTest - T03", "mRid": "1003" }, { - "name": "T04", + "name": "UnitTest - T04", "mRid": "1004" } ] }, { - "name": "CN03", + "name": "UnitTest - CN03", "mRid": "2343589", "terminalList": [ { - "name": "T05", + "name": "UnitTest - T05", "mRid": "1005" }, { - "name": "T06", + "name": "UnitTest - T06", "mRid": "1006" } ] + }, + { + "name": "UnitTest - CN04", + "mRid": "222333589", + "terminalList": [ + { + "name": "UnitTest - T07", + "mRid": "1007" + }, + { + "name": "UnitTest - T08", + "mRid": "1008" + } + ] + }, + { + "name": "UnitTest - CN05", + "mRid": "25789989", + "terminalList": [ + { + "name": "UnitTest - T09", + "mRid": "1009" + }, + { + "name": "UnitTest - T10", + "mRid": "1010" + } + ] } ], "powerTransformerList": [], "busbarSectionList": [], - "switchList": [], - "synchronousMachineList": [ { - "name": "SynchronousMachine01", - "mRid": "458899", - "terminalList": [ { - "name": "T01", - "mRid": "1000" - }], - "synchronousMachineKind": "generator", - "generatingUnit": {"registeredGenerator": {"unitType": "PHOT"}} - }], + "switchList": [ + { + "name": "UnitTest - Switch01", + "mRid": "10005488", + "terminalList": [ + { + "name": "UnitTest - T02", + "mRid": "1002" + }, + { + "name": "UnitTest - T05", + "mRid": "1005" + } + ] + }, + { + "name": "UnitTest - Switch02", + "mRid": "22115000", + "terminalList": [ + { + "name": "UnitTest - T04", + "mRid": "1004" + }, + { + "name": "UnitTest - T07", + "mRid": "1007" + } + ] + }, + { + "name": "UnitTest - Switch03", + "mRid": "30005487", + "terminalList": [ + { + "name": "UnitTest - T10", + "mRid": "1010" + }, + { + "name": "UnitTest - T11", + "mRid": "1011" + } + ] + } + ], + "synchronousMachineList": [ + { + "name": "UnitTest - SynchronousMachine01", + "mRid": "4336658899", + "terminalList": [ { + "name": "UnitTest - T01", + "mRid": "1000" + }], + "synchronousMachineKind": "GENERATOR", + "generatingUnit": {"registeredGenerator": {"unitType": "PHOT"}} + }, + { + "name": "UnitTest - SynchronousMachine02", + "mRid": "200564450", + "terminalList": [ { + "name": "UnitTest - T03", + "mRid": "1003" + }], + "synchronousMachineKind": "GENERATOR", + "generatingUnit": {"registeredGenerator": {"unitType": "PTUR"}} + } + ], "acLineSegmentList": [ { - "name": "Cable01", - "mRid": "45889", + "name": "UnitTest - Cable01", + "mRid": "456565889", "terminalList": [ { - "name": "T02", - "mRid": "1002" + "name": "UnitTest - T06", + "mRid": "1006" }, { - "name": "T04", - "mRid": "1004" + "name": "UnitTest - T08", + "mRid": "1008" }, { - "name": "T05", - "mRid": "1005" + "name": "UnitTest - T09", + "mRid": "1009" } ] }], "voltageLevelList": [] }, { - "name": "Substation02 - Ortsnetzstation Störzelbach", - "mRid": "23222666", - "connectivityNodeList": [ { - "name": "CN04", - "mRid": "222333589", + "name": "UnitTest - Substation02 - Ortsnetzstation Störzelbach", + "mRid": "232554422666", + "connectivityNodeList": [ + { + "name": "UnitTest - CN06", + "mRid": "25341189", + "terminalList": [ + { + "name": "UnitTest - T11", + "mRid": "1011" + }, + { + "name": "UnitTest - T12", + "mRid": "1012" + }, + { + "name": "UnitTest - T13", + "mRid": "1013" + } + ] + }, + { + "name": "UnitTest - CN07", + "mRid": "25546489", + "terminalList": [ + { + "name": "UnitTest - T14", + "mRid": "1014" + }, + { + "name": "UnitTest - T15", + "mRid": "1015" + } + ] + }, + { + "name": "UnitTest - CN08", + "mRid": "1045507", + "terminalList": [ + { + "name": "UnitTest - T16", + "mRid": "1016" + }, + { + "name": "UnitTest - T17", + "mRid": "1017" + } + ] + } + ], + "powerTransformerList": [ { + "name": "UnitTest - PowerTransformer01", + "mRid": "100655650100", + "terminalList": [ { + "name": "UnitTest - T15", + "mRid": "1015" + }] + }], + "busbarSectionList": [], + "switchList": [ + { + "name": "UnitTest - Switch04", + "mRid": "10045544553", + "terminalList": [ + { + "name": "UnitTest - T13", + "mRid": "1013" + }, + { + "name": "UnitTest - T14", + "mRid": "1014" + } + ] + }, + { + "name": "UnitTest - Switch05", + "mRid": "104554604", + "terminalList": [ + { + "name": "UnitTest - T12", + "mRid": "1012" + }, + { + "name": "UnitTest - T16", + "mRid": "1016" + } + ] + } + ], + "synchronousMachineList": [], + "acLineSegmentList": [], + "voltageLevelList": [] + }, + { + "name": "UnitTest - Substation03 - Ortsnetzstation Alesheim04", + "mRid": "23647786456", + "connectivityNodeList": [ + { + "name": "UnitTest - CN09", + "mRid": "2577789", + "terminalList": [ + { + "name": "UnitTest - T18", + "mRid": "1018" + }, + { + "name": "UnitTest - T19", + "mRid": "1019" + } + ] + }, + { + "name": "UnitTest - CN10", + "mRid": "29000589", + "terminalList": [ + { + "name": "UnitTest - T21", + "mRid": "1021" + }, + { + "name": "UnitTest - T22", + "mRid": "1022" + } + ] + }, + { + "name": "UnitTest - CN11", + "mRid": "258345349", + "terminalList": [ + { + "name": "UnitTest - T24", + "mRid": "1024" + }, + { + "name": "UnitTest - T25", + "mRid": "1024" + } + ] + }, + { + "name": "UnitTest - CN12", + "mRid": "253453489", + "terminalList": [ + { + "name": "UnitTest - T20", + "mRid": "1020" + }, + { + "name": "UnitTest - T23", + "mRid": "1023" + }, + { + "name": "UnitTest - T26", + "mRid": "1025" + }, + { + "name": "UnitTest - T27", + "mRid": "1026" + }, + { + "name": "UnitTest - T28", + "mRid": "1027" + } + ] + }, + { + "name": "UnitTest - CN13", + "mRid": "2533434453489", + "terminalList": [ { + "name": "UnitTest - T29", + "mRid": "1028" + }] + }, + { + "name": "UnitTest - CN14", + "mRid": "2534534", + "terminalList": [ + { + "name": "UnitTest - T30", + "mRid": "1029" + }, + { + "name": "UnitTest - T31", + "mRid": "1030" + } + ] + } + ], + "powerTransformerList": [ { + "name": "UnitTest - PowerTransformer02", + "mRid": "1065654601", + "terminalList": [ { + "name": "UnitTest - T22", + "mRid": "1022" + }] + }], + "busbarSectionList": [], + "switchList": [ + { + "name": "UnitTest - Switch06", + "mRid": "1054654605", + "terminalList": [ + { + "name": "UnitTest - T19", + "mRid": "1019" + }, + { + "name": "UnitTest - T27", + "mRid": "1026" + } + ] + }, + { + "name": "UnitTest - Switch07", + "mRid": "105455506", + "terminalList": [ + { + "name": "UnitTest - T28", + "mRid": "1027" + }, + { + "name": "UnitTest - T30", + "mRid": "1029" + } + ] + }, + { + "name": "UnitTest - Switch08", + "mRid": "10546607", + "terminalList": [ + { + "name": "UnitTest - T26", + "mRid": "1025" + }, + { + "name": "UnitTest - T29", + "mRid": "1028" + } + ] + }, + { + "name": "UnitTest - Switch09", + "mRid": "165466008", + "terminalList": [ + { + "name": "UnitTest - T20", + "mRid": "1020" + }, + { + "name": "UnitTest - T21", + "mRid": "1021" + } + ] + }, + { + "name": "UnitTest - Switch10", + "mRid": "106409", + "terminalList": [ + { + "name": "UnitTest - T23", + "mRid": "1023" + }, + { + "name": "UnitTest - T24", + "mRid": "1024" + } + ] + } + ], + "synchronousMachineList": [ { + "name": "UnitTest - SynchronousMachine03", + "mRid": "106546402", + "terminalList": [ { + "name": "UnitTest - T25", + "mRid": "1024" + }], + "synchronousMachineKind": "GENERATOR", + "generatingUnit": {"registeredGenerator": {"unitType": "WIND"}} + }], + "acLineSegmentList": [ + { + "name": "UnitTest - Cable02", + "mRid": "1034554634501", + "terminalList": [ + { + "name": "UnitTest - T17", + "mRid": "1017" + }, + { + "name": "UnitTest - T18", + "mRid": "1018" + } + ] + }, + { + "name": "UnitTest - Cable03", + "mRid": "103455234501", + "terminalList": [ + { + "name": "UnitTest - T31", + "mRid": "1030" + }, + { + "name": "UnitTest - T32", + "mRid": "1031" + } + ] + } + ], + "voltageLevelList": [] + }, + { + "name": "UnitTest - Substation04 - Ortsnetzstation A02", + "mRid": "236457866", + "connectivityNodeList": [ + { + "name": "UnitTest - CN15", + "mRid": "2534587834", + "terminalList": [ + { + "name": "UnitTest - T32", + "mRid": "1031" + }, + { + "name": "UnitTest - T33", + "mRid": "1032" + } + ] + }, + { + "name": "UnitTest - CN16", + "mRid": "25345434", + "terminalList": [ + { + "name": "UnitTest - T34", + "mRid": "1033" + }, + { + "name": "UnitTest - T35", + "mRid": "1034" + }, + { + "name": "UnitTest - T38", + "mRid": "1037" + } + ] + }, + { + "name": "UnitTest - CN17", + "mRid": "2534343834", + "terminalList": [ + { + "name": "UnitTest - T36", + "mRid": "1035" + }, + { + "name": "UnitTest - T37", + "mRid": "1036" + } + ] + }, + { + "name": "UnitTest - CN18", + "mRid": "8888884", + "terminalList": [ + { + "name": "UnitTest - T39", + "mRid": "1038" + }, + { + "name": "UnitTest - T40", + "mRid": "1039" + } + ] + } + ], + "powerTransformerList": [ { + "name": "UnitTest - PowerTransformer03", + "mRid": "106546402", + "terminalList": [ { + "name": "UnitTest - T37", + "mRid": "1036" + }] + }], + "busbarSectionList": [], + "switchList": [ + { + "name": "UnitTest - Switch11", + "mRid": "1212121010", + "terminalList": [ + { + "name": "UnitTest - T33", + "mRid": "1032" + }, + { + "name": "UnitTest - T34", + "mRid": "1033" + } + ] + }, + { + "name": "UnitTest - Switch12", + "mRid": "106546411", + "terminalList": [ + { + "name": "UnitTest - T35", + "mRid": "1034" + }, + { + "name": "UnitTest - T36", + "mRid": "1035" + } + ] + }, + { + "name": "UnitTest - Switch13", + "mRid": "15464012", + "terminalList": [ + { + "name": "UnitTest - T38", + "mRid": "1037" + }, + { + "name": "UnitTest - T39", + "mRid": "1038" + } + ] + } + ], + "synchronousMachineList": [], + "acLineSegmentList": [ { + "name": "UnitTest - Cable04", + "mRid": "103/664534501", "terminalList": [ { - "name": "T07", - "mRid": "1007" + "name": "UnitTest - T40", + "mRid": "1039" }, { - "name": "T08", - "mRid": "1008" + "name": "UnitTest - T41", + "mRid": "1040" } ] }], - "powerTransformerList": [], + "voltageLevelList": [] + }, + { + "name": "UnitTest - Substation05 - Ortsnetzstation A06", + "mRid": "344236411166", + "connectivityNodeList": [ + { + "name": "UnitTest - CN19", + "mRid": "1018", + "terminalList": [ + { + "name": "UnitTest - T41", + "mRid": "1040" + }, + { + "name": "UnitTest - T42", + "mRid": "1041" + } + ] + }, + { + "name": "UnitTest - CN20", + "mRid": "1019", + "terminalList": [ + { + "name": "UnitTest - T43", + "mRid": "1042" + }, + { + "name": "UnitTest - T44", + "mRid": "1043" + }, + { + "name": "UnitTest - T47", + "mRid": "1046" + } + ] + }, + { + "name": "UnitTest - CN21", + "mRid": "1020", + "terminalList": [ + { + "name": "UnitTest - T45", + "mRid": "1044" + }, + { + "name": "UnitTest - T46", + "mRid": "1045" + } + ] + }, + { + "name": "UnitTest - CN22", + "mRid": "1021", + "terminalList": [ + { + "name": "UnitTest - T48", + "mRid": "1047" + }, + { + "name": "UnitTest - T49", + "mRid": "1048" + } + ] + } + ], + "powerTransformerList": [ { + "name": "UnitTest - PowerTransformer04", + "mRid": "100656563", + "terminalList": [ { + "name": "UnitTest - T46", + "mRid": "1045" + }] + }], "busbarSectionList": [], - "switchList": [ { - "name": "Switch01", - "mRid": "1000", + "switchList": [ + { + "name": "UnitTest - Switch14", + "mRid": "10545654613", + "terminalList": [ + { + "name": "UnitTest - T42", + "mRid": "1041" + }, + { + "name": "UnitTest - T43", + "mRid": "1042" + } + ] + }, + { + "name": "UnitTest - Switch15", + "mRid": "105465414", + "terminalList": [ + { + "name": "UnitTest - T44", + "mRid": "1043" + }, + { + "name": "UnitTest - T45", + "mRid": "1044" + } + ] + }, + { + "name": "UnitTest - Switch16", + "mRid": "10546415", + "terminalList": [ + { + "name": "UnitTest - T47", + "mRid": "1046" + }, + { + "name": "UnitTest - T48", + "mRid": "1047" + } + ] + } + ], + "synchronousMachineList": [], + "acLineSegmentList": [ { + "name": "UnitTest - Cable05", + "mRid": "104544157884301", "terminalList": [ { - "name": "T06", - "mRid": "1006" + "name": "UnitTest - T49", + "mRid": "1048" }, { - "name": "T07", - "mRid": "1007" + "name": "UnitTest - T50", + "mRid": "1049" } ] }], - "synchronousMachineList": [ { - "name": "SynchronousMachine02", - "mRid": "2000", + "voltageLevelList": [] + }, + { + "name": "UnitTest - Substation06 - Ortsnetzstation Alesheim 01", + "mRid": "2367122766", + "connectivityNodeList": [ + { + "name": "UnitTest - CN23", + "mRid": "1022", + "terminalList": [ + { + "name": "UnitTest - T50", + "mRid": "1049" + }, + { + "name": "UnitTest - T51", + "mRid": "1050" + } + ] + }, + { + "name": "UnitTest - CN24", + "mRid": "1023", + "terminalList": [ + { + "name": "UnitTest - T52", + "mRid": "1051" + }, + { + "name": "UnitTest - T53", + "mRid": "1052" + } + ] + }, + { + "name": "UnitTest - CN25", + "mRid": "1024", + "terminalList": [ + { + "name": "UnitTest - T54", + "mRid": "1053" + }, + { + "name": "UnitTest - T55", + "mRid": "1054" + } + ] + }, + { + "name": "UnitTest - CN26", + "mRid": "1025", + "terminalList": [ + { + "name": "UnitTest - T56", + "mRid": "1055" + }, + { + "name": "UnitTest - T57", + "mRid": "1056" + } + ] + }, + { + "name": "UnitTest - CN27", + "mRid": "1026", + "terminalList": [ + { + "name": "UnitTest - T58", + "mRid": "1057" + }, + { + "name": "UnitTest - T59", + "mRid": "1058" + } + ] + } + ], + "powerTransformerList": [ { + "name": "UnitTest - PowerTransformer05", + "mRid": "105465604", "terminalList": [ { - "name": "T03", - "mRid": "1003" - }], - "synchronousMachineKind": "generator", - "generatingUnit": {"registeredGenerator": {"unitType": "PTUR"}} + "name": "UnitTest - T55", + "mRid": "1054" + }] }], + "busbarSectionList": [], + "switchList": [ + { + "name": "UnitTest - Switch17", + "mRid": "1044516", + "terminalList": [ + { + "name": "UnitTest - T51", + "mRid": "1050" + }, + { + "name": "UnitTest - T52", + "mRid": "1051" + } + ] + }, + { + "name": "UnitTest - Switch18", + "mRid": "10654617", + "terminalList": [ + { + "name": "UnitTest - T53", + "mRid": "1052" + }, + { + "name": "UnitTest - T54", + "mRid": "1053" + } + ] + }, + { + "name": "UnitTest - Switch19", + "mRid": "10546418", + "terminalList": [ { + "name": "UnitTest - T56", + "mRid": "1055" + }] + } + ], + "synchronousMachineList": [], "acLineSegmentList": [ { - "name": "Cable02", - "mRid": "1034534501", + "name": "UnitTest - Cable06", + "mRid": "1745545780301", "terminalList": [ { - "name": "T08", - "mRid": "1008" + "name": "UnitTest - T57", + "mRid": "1056" }, { - "name": "T09", - "mRid": "1009" + "name": "UnitTest - T58", + "mRid": "1057" } ] }], "voltageLevelList": [] }, { - "name": "Substation03 - Ortsnetzstation Alesheim04", - "mRid": "2366456", + "name": "UnitTest - Substation07 - Ortsnetzstation A03", + "mRid": "2361228866", "connectivityNodeList": [ { - "name": "CN05", - "mRid": "25789989", + "name": "UnitTest - CN28", + "mRid": "1027", "terminalList": [ { - "name": "T09", - "mRid": "1009" + "name": "UnitTest - T60", + "mRid": "1059" }, { - "name": "T10", - "mRid": "1010" + "name": "UnitTest - T61", + "mRid": "1060" + }, + { + "name": "UnitTest - T64", + "mRid": "1063" } ] }, { - "name": "CN06", - "mRid": "25341189", + "name": "UnitTest - CN29", + "mRid": "1028", "terminalList": [ { - "name": "T11", - "mRid": "1011" + "name": "UnitTest - T62", + "mRid": "1061" }, { - "name": "T12", - "mRid": "1012" + "name": "UnitTest - T63", + "mRid": "1062" + } + ] + }, + { + "name": "UnitTest - CN30", + "mRid": "1029", + "terminalList": [ + { + "name": "UnitTest - T65", + "mRid": "1064" }, { - "name": "T13", - "mRid": "1013" + "name": "UnitTest - T66", + "mRid": "1065" + } + ] + }, + { + "name": "UnitTest - CN31", + "mRid": "1030", + "terminalList": [ + { + "name": "UnitTest - T67", + "mRid": "1066" }, { - "name": "T14", - "mRid": "1014" + "name": "UnitTest - T68", + "mRid": "1067" + } + ] + }, + { + "name": "UnitTest - CN32", + "mRid": "1031", + "terminalList": [ + { + "name": "UnitTest - T69", + "mRid": "1068" + }, + { + "name": "UnitTest - T70", + "mRid": "1069" + }, + { + "name": "UnitTest - T73", + "mRid": "1072" + } + ] + }, + { + "name": "UnitTest - CN33", + "mRid": "1032", + "terminalList": [ + { + "name": "UnitTest - T71", + "mRid": "1070" + }, + { + "name": "UnitTest - T72", + "mRid": "1071" + } + ] + }, + { + "name": "UnitTest - CN34", + "mRid": "1033", + "terminalList": [ + { + "name": "UnitTest - T74", + "mRid": "1073" + }, + { + "name": "UnitTest - T75", + "mRid": "1074" + } + ] + }, + { + "name": "UnitTest - CN35", + "mRid": "1034", + "terminalList": [ + { + "name": "UnitTest - T76", + "mRid": "1075" + }, + { + "name": "UnitTest - T77", + "mRid": "1076" + }, + { + "name": "UnitTest - T78", + "mRid": "1077" } ] } ], - "powerTransformerList": [], + "powerTransformerList": [ { + "name": "UnitTest - PowerTransformer06", + "mRid": "1054405", + "terminalList": [ { + "name": "UnitTest - T63", + "mRid": "1062" + }] + }], "busbarSectionList": [], "switchList": [ { - "name": "Switch02", - "mRid": "2000", + "name": "UnitTest - Switch20", + "mRid": "1054545419", "terminalList": [ { - "name": "T10", - "mRid": "1010" + "name": "UnitTest - T59", + "mRid": "1058" }, { - "name": "T11", - "mRid": "1011" + "name": "UnitTest - T60", + "mRid": "1059" } ] }, { - "name": "Switch03", - "mRid": "3000", + "name": "UnitTest - Switch21", + "mRid": "101225520", "terminalList": [ { - "name": "T12", - "mRid": "1012" + "name": "UnitTest - T61", + "mRid": "1060" }, { - "name": "T16", - "mRid": "1016" + "name": "UnitTest - T62", + "mRid": "1061" } ] }, { - "name": "Switch04", - "mRid": "1003", + "name": "UnitTest - Switch22", + "mRid": "15454021", "terminalList": [ { - "name": "T13", - "mRid": "1013" + "name": "UnitTest - T64", + "mRid": "1063" }, { - "name": "T15", - "mRid": "1015" + "name": "UnitTest - T65", + "mRid": "1064" } ] } ], - "synchronousMachineList": [ { - "name": "SynchronousMachine03", - "mRid": "1002", - "terminalList": [ { - "name": "T14", - "mRid": "1014" - }], - "synchronousMachineKind": "generator", - "generatingUnit": {"registeredGenerator": {"unitType": "WIND"}} - }], - "acLineSegmentList": [], - "voltageLevelList": [] - }, - { - "name": "Substation04 - Ortsnetzstation A02", - "mRid": "236453466", - "connectivityNodeList": [ { - "name": "CN07", - "mRid": "25546489", - "terminalList": [ - { - "name": "T16", - "mRid": "1016" - }, - { - "name": "T17", - "mRid": "1017" - } - ] - }], - "powerTransformerList": [], - "busbarSectionList": [], - "switchList": [], - "synchronousMachineList": [], - "acLineSegmentList": [ { - "name": "Cable03", - "mRid": "1034534501", - "terminalList": [ - { - "name": "T17", - "mRid": "1017" - }, - { - "name": "T18", - "mRid": "1018" - } - ] - }], - "voltageLevelList": [] - }, - { - "name": "Substation05 - Ortsnetzstation A06", - "mRid": "34423666", - "connectivityNodeList": [ { - "name": "CN08", - "mRid": "1045507", - "terminalList": [ - { - "name": "T18", - "mRid": "1018" - }, - { - "name": "T19", - "mRid": "1019" - } - ] - }], - "powerTransformerList": [], - "busbarSectionList": [], - "switchList": [], "synchronousMachineList": [], "acLineSegmentList": [ { - "name": "Cable04", - "mRid": "1034534501", + "name": "UnitTest - Cable07", + "mRid": "14/302251", "terminalList": [ { - "name": "T19", - "mRid": "1019" + "name": "UnitTest - T66", + "mRid": "1065" }, { - "name": "T20", - "mRid": "1020" + "name": "UnitTest - T67", + "mRid": "1066" } ] }], "voltageLevelList": [] }, { - "name": "Substation06 - Ortsnetzstation Alesheim06", - "mRid": "2367766", - "connectivityNodeList": [ { - "name": "CN09", - "mRid": "2577789", - "terminalList": [ - { - "name": "T20", - "mRid": "1020" - }, - { - "name": "T21", - "mRid": "1021" - } - ] + "name": "UnitTest - Substation08 - Ortsnetzstation W02", + "mRid": "2365465633366", + "connectivityNodeList": [], + "powerTransformerList": [ { + "name": "UnitTest - PowerTransformer07", + "mRid": "10545406", + "terminalList": [ { + "name": "UnitTest - T72", + "mRid": "1071" + }] }], - "powerTransformerList": [], "busbarSectionList": [], - "switchList": [], - "synchronousMachineList": [], - "acLineSegmentList": [ { - "name": "Cable05", - "mRid": "10454301", - "terminalList": [ - { - "name": "T21", - "mRid": "1021" - }, - { - "name": "T22", - "mRid": "1022" - } - ] - }], - "voltageLevelList": [] - }, - { - "name": "Substation07 - Ortsnetzstation A03", - "mRid": "2368866", - "connectivityNodeList": [ + "switchList": [ { - "name": "CN10", - "mRid": "29000589", + "name": "UnitTest - Switch23", + "mRid": "154545022", "terminalList": [ { - "name": "T22", - "mRid": "1022" + "name": "UnitTest - T68", + "mRid": "1067" }, { - "name": "T23", - "mRid": "1023" + "name": "UnitTest - T69", + "mRid": "1068" } ] }, { - "name": "CN11", - "mRid": "258345349", + "name": "UnitTest - Switch24", + "mRid": "10546523", "terminalList": [ { - "name": "T24", - "mRid": "1024" + "name": "UnitTest - T70", + "mRid": "1069" }, { - "name": "T25", - "mRid": "1024" + "name": "UnitTest - T71", + "mRid": "1070" + } + ] + }, + { + "name": "UnitTest - Switch25", + "mRid": "105465424", + "terminalList": [ + { + "name": "UnitTest - T73", + "mRid": "1072" + }, + { + "name": "UnitTest - T74", + "mRid": "1073" } ] } ], - "powerTransformerList": [], - "busbarSectionList": [], - "switchList": [], "synchronousMachineList": [], - "acLineSegmentList": [ { - "name": "Cable06", - "mRid": "1042534234301", - "terminalList": [ - { - "name": "T23", - "mRid": "1023" - }, - { - "name": "T24", - "mRid": "1024" - } - ] - }], + "acLineSegmentList": [], "voltageLevelList": [] }, { - "name": "Substation08 - Ortsnetzstation W02", - "mRid": "23633366", + "name": "UnitTest - Substation09 - Umspannwerk WAHF", + "mRid": "23634113366", "connectivityNodeList": [ { - "name": "CN12", - "mRid": "253453489", - "terminalList": [ - { - "name": "T26", - "mRid": "1025" - }, - { - "name": "T27", - "mRid": "1026" - }, - { - "name": "T28", - "mRid": "1027" - } - ] - }], - "powerTransformerList": [], - "busbarSectionList": [], - "switchList": [], - "synchronousMachineList": [], - "acLineSegmentList": [ { - "name": "Cable07", - "mRid": "104234301", + "name": "UnitTest - CN36", + "mRid": "1035", "terminalList": [ { - "name": "T25", - "mRid": "1024" + "name": "UnitTest - T79", + "mRid": "1078" }, { - "name": "T26", - "mRid": "1025" + "name": "UnitTest - T80", + "mRid": "1079" } ] }], - "voltageLevelList": [] - }, - { - "name": "Substation09 - Umspannwerk WAHF", - "mRid": "23633366", - "connectivityNodeList": [], "powerTransformerList": [ { - "name": "PowerTransformer01", - "mRid": "1000100", + "name": "UnitTest - PowerTransformer08", + "mRid": "105412207", "terminalList": [ { - "name": "T39", - "mRid": "1038" + "name": "UnitTest - T89", + "mRid": "1088" }, { - "name": "T40", - "mRid": "1039" + "name": "UnitTest - T90", + "mRid": "1089" } ] }], @@ -471,231 +1184,12 @@ "switchList": [], "synchronousMachineList": [], "acLineSegmentList": [], - "voltageLevelList": [ - { - "name": "VoltageLevel01 - 110kV", - "mRid": "236634336", - "connectivityNodeList": [ { - "name": "CN18", - "mRid": "8888884", - "terminalList": [ - { - "name": "T40", - "mRid": "1039" - }, - { - "name": "T41", - "mRid": "1040" - } - ] - }], - "powerTransformerList": [], - "busbarSectionList": [], - "switchList": [], - "synchronousMachineList": [], - "acLineSegmentList": [ { - "name": "Cable08", - "mRid": "188804234301", - "terminalList": [ { - "name": "T41", - "mRid": "1040" - }] - }], - "highVoltageLimit": { - "value": 110, - "multiplier": "k", - "unit": "V" - } - }, - { - "name": "VoltageLevel02", - "mRid": "8974455", - "connectivityNodeList": [ - { - "name": "CN13", - "mRid": "2533434453489", - "terminalList": [ - { - "name": "T29", - "mRid": "1028" - }, - { - "name": "T30", - "mRid": "1029" - } - ] - }, - { - "name": "CN14", - "mRid": "2534534", - "terminalList": [ - { - "name": "T31", - "mRid": "1030" - }, - { - "name": "T32", - "mRid": "1031" - } - ] - }, - { - "name": "CN15", - "mRid": "2534587834", - "terminalList": [ - { - "name": "T33", - "mRid": "1032" - }, - { - "name": "T34", - "mRid": "1033" - } - ] - }, - { - "name": "CN16", - "mRid": "25345434", - "terminalList": [ - { - "name": "T35", - "mRid": "1034" - }, - { - "name": "T36", - "mRid": "1035" - } - ] - }, - { - "name": "CN17", - "mRid": "2534343834", - "terminalList": [ - { - "name": "T37", - "mRid": "1036" - }, - { - "name": "T38", - "mRid": "1037" - }, - { - "name": "T39", - "mRid": "1038" - } - ] - } - ], - "powerTransformerList": [], - "busbarSectionList": [ - { - "name": "BusbarSection01", - "mRid": "5488855", - "terminalList": [ - { - "name": "T32", - "mRid": "1031" - }, - { - "name": "T35", - "mRid": "1034" - } - ] - }, - { - "name": "BusbarSection02", - "mRid": "53423488855", - "terminalList": [ - { - "name": "T30", - "mRid": "1029" - }, - { - "name": "T33", - "mRid": "1032" - } - ] - } - ], - "switchList": [ - { - "name": "Switch05", - "mRid": "1004", - "terminalList": [ - { - "name": "T27", - "mRid": "1026" - }, - { - "name": "T31", - "mRid": "1030" - } - ] - }, - { - "name": "Switch06", - "mRid": "1005", - "terminalList": [ - { - "name": "T28", - "mRid": "1027" - }, - { - "name": "T29", - "mRid": "1028" - } - ] - }, - { - "name": "Switch07", - "mRid": "1006", - "terminalList": [ - { - "name": "T36", - "mRid": "1035" - }, - { - "name": "T38", - "mRid": "1037" - } - ] - }, - { - "name": "Switch08", - "mRid": "1007", - "terminalList": [ - { - "name": "T34", - "mRid": "1033" - }, - { - "name": "T37", - "mRid": "1036" - } - ] - } - ], - "synchronousMachineList": [], - "acLineSegmentList": [], - "highVoltageLimit": { - "value": 20, - "multiplier": "k", - "unit": "V" - } - } - ] + "voltageLevelList": [] }, { - "name": "Substation10 - Ortsnetzstation Alesheim05A", - "mRid": "23633366", - "connectivityNodeList": [ { - "name": "CN19", - "mRid": "1018", - "terminalList": [ { - "name": "T15", - "mRid": "1015" - }] - }], + "name": "UnitTest - Substation10 - Ortsnetzstation Alesheim05A", + "mRid": "23633122366", + "connectivityNodeList": [], "powerTransformerList": [], "busbarSectionList": [], "switchList": [], @@ -705,4 +1199,4 @@ } ] }] -}] \ No newline at end of file +} \ No newline at end of file diff --git a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-02.json b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-02.json index f95a722f..bc21e676 100644 --- a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-02.json +++ b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-02.json @@ -1,6 +1,6 @@ { "name": "UnitTest - Geamtes Netz Netzbetreiber A", - "mRid": "1000", + "mRid": "548996", "subGeographicalRegionList": [ { "name": "UnitTest - Netzgebiet A", "mRid": "1000", @@ -126,18 +126,22 @@ "analogValueList": [ { "timeStamp": {"value": "10.04.2015 12:12:35"}, + "measurementValueQuality": {"failure": false}, "value": 11.11 }, { "timeStamp": {"value": "10.04.2015 12:12:35"}, + "measurementValueQuality": {"failure": false}, "value": 12.12 }, { "timeStamp": {"value": "10.04.2015 12:12:35"}, + "measurementValueQuality": {"failure": false}, "value": 13.13 }, { "timeStamp": {"value": "10.04.2015 12:12:35"}, + "measurementValueQuality": {"failure": false}, "value": 14.14 } ] @@ -256,7 +260,7 @@ }], "acLineSegmentList": [ { "name": "UnitTest - Cable02", - "mRid": "1034534501", + "mRid": "10345387884501", "terminalList": [ { "name": "UnitTest - T08", @@ -362,7 +366,7 @@ ], "synchronousMachineList": [ { "name": "UnitTest - SynchronousMachine03", - "mRid": "1002", + "mRid": "10022366", "psrEventList": [], "normallyInService": true, "terminalList": [ { @@ -434,7 +438,7 @@ "synchronousMachineList": [], "acLineSegmentList": [ { "name": "UnitTest - Cable03", - "mRid": "1034534501", + "mRid": "10345368994501", "terminalList": [ { "name": "UnitTest - T17", @@ -471,7 +475,7 @@ "synchronousMachineList": [], "acLineSegmentList": [ { "name": "UnitTest - Cable04", - "mRid": "1034534501", + "mRid": "103453453325401", "terminalList": [ { "name": "UnitTest - T19", @@ -577,7 +581,7 @@ }, { "name": "UnitTest - Substation08 - Ortsnetzstation W02", - "mRid": "23633366", + "mRid": "2363332166", "connectivityNodeList": [ { "name": "UnitTest - CN12", "mRid": "253453489", @@ -618,7 +622,7 @@ }, { "name": "UnitTest - Substation09 - Umspannwerk WAHF", - "mRid": "23633366", + "mRid": "2363336687", "connectivityNodeList": [], "powerTransformerList": [ { "name": "UnitTest - PowerTransformer01", @@ -858,7 +862,7 @@ }, { "name": "UnitTest - Substation10 - Ortsnetzstation Alesheim05A", - "mRid": "23633366", + "mRid": "2363336699", "connectivityNodeList": [ { "name": "UnitTest - CN19", "mRid": "1018", diff --git a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-03.json b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-03.json index e859ade6..6f2e7b43 100644 --- a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-03.json +++ b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-03.json @@ -1,9 +1,9 @@ { "name": "UnitTest - Geamtes Netz Netzbetreiber A", - "mRid": "1000", + "mRid": "541223987", "subGeographicalRegionList": [ { "name": "UnitTest - Netzgebiet A", - "mRid": "1000", + "mRid": "1000899", "substationList": [ { "name": "UnitTest - Substation01 - Ortsnetzstation Stopfenheim", @@ -58,7 +58,7 @@ "synchronousMachineList": [ { "name": "UnitTest - SynchronousMachine01", - "mRid": "458899", + "mRid": "458854599", "terminalList": [ { "name": "UnitTest - T01", "mRid": "1000" @@ -68,7 +68,7 @@ }, { "name": "UnitTest - SynchronousMachine02", - "mRid": "2000", + "mRid": "20054550", "terminalList": [ { "name": "UnitTest - T03", "mRid": "1003" @@ -79,7 +79,7 @@ ], "acLineSegmentList": [ { "name": "UnitTest - Cable01", - "mRid": "45889", + "mRid": "4585454877889", "terminalList": [ { "name": "UnitTest - T02", @@ -99,7 +99,7 @@ }, { "name": "UnitTest - Substation02 - Ortsnetzstation Störzelbach", - "mRid": "23222666", + "mRid": "23227882666", "connectivityNodeList": [ { "name": "UnitTest - CN04", "mRid": "222333589", @@ -118,7 +118,7 @@ "busbarSectionList": [], "switchList": [ { "name": "UnitTest - Switch01", - "mRid": "1000", + "mRid": "10008777", "terminalList": [ { "name": "UnitTest - T06", @@ -133,7 +133,7 @@ "synchronousMachineList": [], "acLineSegmentList": [ { "name": "UnitTest - Cable02", - "mRid": "1034534501", + "mRid": "10345345987701", "terminalList": [ { "name": "UnitTest - T08", @@ -149,7 +149,7 @@ }, { "name": "UnitTest - Substation03 - Ortsnetzstation Alesheim04", - "mRid": "2366456", + "mRid": "2366456777", "connectivityNodeList": [ { "name": "UnitTest - CN05", @@ -193,7 +193,7 @@ "switchList": [ { "name": "UnitTest - Switch02", - "mRid": "2000", + "mRid": "278888000", "terminalList": [ { "name": "UnitTest - T10", @@ -207,7 +207,7 @@ }, { "name": "UnitTest - Switch03", - "mRid": "3000", + "mRid": "387778000", "terminalList": [ { "name": "UnitTest - T12", @@ -221,7 +221,7 @@ }, { "name": "UnitTest - Switch04", - "mRid": "1003", + "mRid": "1545003", "terminalList": [ { "name": "UnitTest - T13", @@ -236,7 +236,7 @@ ], "synchronousMachineList": [ { "name": "UnitTest - SynchronousMachine03", - "mRid": "1002", + "mRid": "526998", "terminalList": [ { "name": "UnitTest - T14", "mRid": "1014" @@ -249,7 +249,7 @@ }, { "name": "UnitTest - Substation04 - Ortsnetzstation A02", - "mRid": "236453466", + "mRid": "2364534678886", "connectivityNodeList": [ { "name": "UnitTest - CN07", "mRid": "25546489", @@ -270,7 +270,7 @@ "synchronousMachineList": [], "acLineSegmentList": [ { "name": "UnitTest - Cable03", - "mRid": "1034534501", + "mRid": "10345345325801", "terminalList": [ { "name": "UnitTest - T17", @@ -286,7 +286,7 @@ }, { "name": "UnitTest - Substation05 - Ortsnetzstation A06", - "mRid": "34423666", + "mRid": "34427773666", "connectivityNodeList": [ { "name": "UnitTest - CN08", "mRid": "1045507", @@ -307,7 +307,7 @@ "synchronousMachineList": [], "acLineSegmentList": [ { "name": "UnitTest - Cable04", - "mRid": "1034534501", + "mRid": "10345345689901", "terminalList": [ { "name": "UnitTest - T19", @@ -323,7 +323,7 @@ }, { "name": "UnitTest - Substation06 - Ortsnetzstation Alesheim06", - "mRid": "2367766", + "mRid": "23677457766", "connectivityNodeList": [ { "name": "UnitTest - CN09", "mRid": "2577789", @@ -360,7 +360,7 @@ }, { "name": "UnitTest - Substation07 - Ortsnetzstation A03", - "mRid": "2368866", + "mRid": "23688669987", "connectivityNodeList": [ { "name": "UnitTest - CN10", @@ -413,7 +413,7 @@ }, { "name": "UnitTest - Substation08 - Ortsnetzstation W02", - "mRid": "23633366", + "mRid": "2363336601", "connectivityNodeList": [ { "name": "UnitTest - CN12", "mRid": "253453489", @@ -454,11 +454,11 @@ }, { "name": "UnitTest - Substation09 - Umspannwerk WAHF", - "mRid": "23633366", + "mRid": "2363336602", "connectivityNodeList": [], "powerTransformerList": [ { "name": "UnitTest - PowerTransformer01", - "mRid": "1000100", + "mRid": "1999000100", "terminalList": [ { "name": "UnitTest - T39", @@ -512,7 +512,7 @@ }, { "name": "UnitTest - VoltageLevel02", - "mRid": "8974455", + "mRid": "8978774455", "connectivityNodeList": [ { "name": "UnitTest - CN13", @@ -593,7 +593,7 @@ "busbarSectionList": [ { "name": "UnitTest - BusbarSection01", - "mRid": "5488855", + "mRid": "5487888855", "terminalList": [ { "name": "UnitTest - T32", @@ -607,7 +607,7 @@ }, { "name": "UnitTest - BusbarSection02", - "mRid": "53423488855", + "mRid": "5374455423488855", "terminalList": [ { "name": "UnitTest - T30", @@ -623,7 +623,7 @@ "switchList": [ { "name": "UnitTest - Switch05", - "mRid": "1004", + "mRid": "10054444", "terminalList": [ { "name": "UnitTest - T27", @@ -637,7 +637,7 @@ }, { "name": "UnitTest - Switch06", - "mRid": "1005", + "mRid": "10544505", "terminalList": [ { "name": "UnitTest - T28", @@ -651,7 +651,7 @@ }, { "name": "UnitTest - Switch07", - "mRid": "1006", + "mRid": "10545406", "terminalList": [ { "name": "UnitTest - T36", @@ -665,7 +665,7 @@ }, { "name": "UnitTest - Switch08", - "mRid": "1007", + "mRid": "10878707", "terminalList": [ { "name": "UnitTest - T34", @@ -680,7 +680,7 @@ ], "synchronousMachineList": [ { "name": "UnitTest - SynchronousMachine99", - "mRid": "1002", + "mRid": "100548882", "terminalList": [], "synchronousMachineKind": "GENERATOR", "generatingUnit": {"registeredGenerator": {"unitType": "WIND"}} @@ -696,7 +696,7 @@ }, { "name": "UnitTest - Substation10 - Ortsnetzstation Alesheim05A", - "mRid": "23633366", + "mRid": "2363336326", "connectivityNodeList": [ { "name": "UnitTest - CN19", "mRid": "1018", diff --git a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-04.json b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-04.json new file mode 100644 index 00000000..9cabff91 --- /dev/null +++ b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-04.json @@ -0,0 +1,708 @@ +[{ + "name": "UnitTest - Geamtes Netz Netzbetreiber A", + "mRid": "568877", + "subGeographicalRegionList": [ { + "name": "Netzgebiet A", + "mRid": "1000888", + "substationList": [ + { + "name": "Substation01 - Ortsnetzstation Stopfenheim", + "mRid": "236454466", + "connectivityNodeList": [ + { + "name": "CN01", + "mRid": "12359", + "terminalList": [ + { + "name": "T01", + "mRid": "1000" + }, + { + "name": "T02", + "mRid": "1002" + } + ] + }, + { + "name": "CN02", + "mRid": "235699898", + "terminalList": [ + { + "name": "T03", + "mRid": "1003" + }, + { + "name": "T04", + "mRid": "1004" + } + ] + }, + { + "name": "CN03", + "mRid": "2343589", + "terminalList": [ + { + "name": "T05", + "mRid": "1005" + }, + { + "name": "T06", + "mRid": "1006" + } + ] + } + ], + "powerTransformerList": [], + "busbarSectionList": [], + "switchList": [], + "synchronousMachineList": [ { + "name": "SynchronousMachine01", + "mRid": "458899", + "terminalList": [ { + "name": "T01", + "mRid": "1000" + }], + "synchronousMachineKind": "generator", + "generatingUnit": {"registeredGenerator": {"unitType": "PHOT"}} + }], + "acLineSegmentList": [ { + "name": "Cable01", + "mRid": "45889", + "terminalList": [ + { + "name": "T02", + "mRid": "1002" + }, + { + "name": "T04", + "mRid": "1004" + }, + { + "name": "T05", + "mRid": "1005" + } + ] + }], + "voltageLevelList": [] + }, + { + "name": "Substation02 - Ortsnetzstation Störzelbach", + "mRid": "23222666", + "connectivityNodeList": [ { + "name": "CN04", + "mRid": "222333589", + "terminalList": [ + { + "name": "T07", + "mRid": "1007" + }, + { + "name": "T08", + "mRid": "1008" + } + ] + }], + "powerTransformerList": [], + "busbarSectionList": [], + "switchList": [ { + "name": "Switch01", + "mRid": "1000", + "terminalList": [ + { + "name": "T06", + "mRid": "1006" + }, + { + "name": "T07", + "mRid": "1007" + } + ] + }], + "synchronousMachineList": [ { + "name": "SynchronousMachine02", + "mRid": "2000", + "terminalList": [ { + "name": "T03", + "mRid": "1003" + }], + "synchronousMachineKind": "generator", + "generatingUnit": {"registeredGenerator": {"unitType": "PTUR"}} + }], + "acLineSegmentList": [ { + "name": "Cable02", + "mRid": "10345323444501", + "terminalList": [ + { + "name": "T08", + "mRid": "1008" + }, + { + "name": "T09", + "mRid": "1009" + } + ] + }], + "voltageLevelList": [] + }, + { + "name": "Substation03 - Ortsnetzstation Alesheim04", + "mRid": "2155003", + "connectivityNodeList": [ + { + "name": "CN05", + "mRid": "25789989", + "terminalList": [ + { + "name": "T09", + "mRid": "1009" + }, + { + "name": "T10", + "mRid": "1010" + } + ] + }, + { + "name": "CN06", + "mRid": "25341189", + "terminalList": [ + { + "name": "T11", + "mRid": "1011" + }, + { + "name": "T12", + "mRid": "1012" + }, + { + "name": "T13", + "mRid": "1013" + }, + { + "name": "T14", + "mRid": "1014" + } + ] + } + ], + "powerTransformerList": [], + "busbarSectionList": [], + "switchList": [ + { + "name": "Switch02", + "mRid": "2000", + "terminalList": [ + { + "name": "T10", + "mRid": "1010" + }, + { + "name": "T11", + "mRid": "1011" + } + ] + }, + { + "name": "Switch03", + "mRid": "3000", + "terminalList": [ + { + "name": "T12", + "mRid": "1012" + }, + { + "name": "T16", + "mRid": "1016" + } + ] + }, + { + "name": "Switch04", + "mRid": "1003", + "terminalList": [ + { + "name": "T13", + "mRid": "1013" + }, + { + "name": "T15", + "mRid": "1015" + } + ] + } + ], + "synchronousMachineList": [ { + "name": "SynchronousMachine03", + "mRid": "1002", + "terminalList": [ { + "name": "T14", + "mRid": "1014" + }], + "synchronousMachineKind": "generator", + "generatingUnit": {"registeredGenerator": {"unitType": "WIND"}} + }], + "acLineSegmentList": [], + "voltageLevelList": [] + }, + { + "name": "Substation04 - Ortsnetzstation A02", + "mRid": "236458746", + "connectivityNodeList": [ { + "name": "CN07", + "mRid": "25546489", + "terminalList": [ + { + "name": "T16", + "mRid": "1016" + }, + { + "name": "T17", + "mRid": "1017" + } + ] + }], + "powerTransformerList": [], + "busbarSectionList": [], + "switchList": [], + "synchronousMachineList": [], + "acLineSegmentList": [ { + "name": "Cable03", + "mRid": "10345345567501", + "terminalList": [ + { + "name": "T17", + "mRid": "1017" + }, + { + "name": "T18", + "mRid": "1018" + } + ] + }], + "voltageLevelList": [] + }, + { + "name": "Substation05 - Ortsnetzstation A06", + "mRid": "3441256666", + "connectivityNodeList": [ { + "name": "CN08", + "mRid": "1045507", + "terminalList": [ + { + "name": "T18", + "mRid": "1018" + }, + { + "name": "T19", + "mRid": "1019" + } + ] + }], + "powerTransformerList": [], + "busbarSectionList": [], + "switchList": [], + "synchronousMachineList": [], + "acLineSegmentList": [ { + "name": "Cable04", + "mRid": "10345346978501", + "terminalList": [ + { + "name": "T19", + "mRid": "1019" + }, + { + "name": "T20", + "mRid": "1020" + } + ] + }], + "voltageLevelList": [] + }, + { + "name": "Substation06 - Ortsnetzstation Alesheim06", + "mRid": "23677669987", + "connectivityNodeList": [ { + "name": "CN09", + "mRid": "2577789", + "terminalList": [ + { + "name": "T20", + "mRid": "1020" + }, + { + "name": "T21", + "mRid": "1021" + } + ] + }], + "powerTransformerList": [], + "busbarSectionList": [], + "switchList": [], + "synchronousMachineList": [], + "acLineSegmentList": [ { + "name": "Cable05", + "mRid": "10454301", + "terminalList": [ + { + "name": "T21", + "mRid": "1021" + }, + { + "name": "T22", + "mRid": "1022" + } + ] + }], + "voltageLevelList": [] + }, + { + "name": "Substation07 - Ortsnetzstation A03", + "mRid": "23433368866", + "connectivityNodeList": [ + { + "name": "CN10", + "mRid": "29000589", + "terminalList": [ + { + "name": "T22", + "mRid": "1022" + }, + { + "name": "T23", + "mRid": "1023" + } + ] + }, + { + "name": "CN11", + "mRid": "258345349", + "terminalList": [ + { + "name": "T24", + "mRid": "1024" + }, + { + "name": "T25", + "mRid": "1024" + } + ] + } + ], + "powerTransformerList": [], + "busbarSectionList": [], + "switchList": [], + "synchronousMachineList": [], + "acLineSegmentList": [ { + "name": "Cable06", + "mRid": "1042534234301", + "terminalList": [ + { + "name": "T23", + "mRid": "1023" + }, + { + "name": "T24", + "mRid": "1024" + } + ] + }], + "voltageLevelList": [] + }, + { + "name": "Substation08 - Ortsnetzstation W02", + "mRid": "236333665688", + "connectivityNodeList": [ { + "name": "CN12", + "mRid": "253453489", + "terminalList": [ + { + "name": "T26", + "mRid": "1025" + }, + { + "name": "T27", + "mRid": "1026" + }, + { + "name": "T28", + "mRid": "1027" + } + ] + }], + "powerTransformerList": [], + "busbarSectionList": [], + "switchList": [], + "synchronousMachineList": [], + "acLineSegmentList": [ { + "name": "Cable07", + "mRid": "104234301", + "terminalList": [ + { + "name": "T25", + "mRid": "1024" + }, + { + "name": "T26", + "mRid": "1025" + } + ] + }], + "voltageLevelList": [] + }, + { + "name": "Substation09 - Umspannwerk WAHF", + "mRid": "23633366345663", + "connectivityNodeList": [], + "powerTransformerList": [ { + "name": "PowerTransformer01", + "mRid": "1000100", + "terminalList": [ + { + "name": "T39", + "mRid": "1038" + }, + { + "name": "T40", + "mRid": "1039" + } + ] + }], + "busbarSectionList": [], + "switchList": [], + "synchronousMachineList": [], + "acLineSegmentList": [], + "voltageLevelList": [ + { + "name": "VoltageLevel01 - 110kV", + "mRid": "236634336", + "connectivityNodeList": [ { + "name": "CN18", + "mRid": "8888884", + "terminalList": [ + { + "name": "T40", + "mRid": "1039" + }, + { + "name": "T41", + "mRid": "1040" + } + ] + }], + "powerTransformerList": [], + "busbarSectionList": [], + "switchList": [], + "synchronousMachineList": [], + "acLineSegmentList": [ { + "name": "Cable08", + "mRid": "188804234301", + "terminalList": [ { + "name": "T41", + "mRid": "1040" + }] + }], + "highVoltageLimit": { + "value": 110, + "multiplier": "k", + "unit": "V" + } + }, + { + "name": "VoltageLevel02", + "mRid": "8974455", + "connectivityNodeList": [ + { + "name": "CN13", + "mRid": "2533434453489", + "terminalList": [ + { + "name": "T29", + "mRid": "1028" + }, + { + "name": "T30", + "mRid": "1029" + } + ] + }, + { + "name": "CN14", + "mRid": "2534534", + "terminalList": [ + { + "name": "T31", + "mRid": "1030" + }, + { + "name": "T32", + "mRid": "1031" + } + ] + }, + { + "name": "CN15", + "mRid": "2534587834", + "terminalList": [ + { + "name": "T33", + "mRid": "1032" + }, + { + "name": "T34", + "mRid": "1033" + } + ] + }, + { + "name": "CN16", + "mRid": "25345434", + "terminalList": [ + { + "name": "T35", + "mRid": "1034" + }, + { + "name": "T36", + "mRid": "1035" + } + ] + }, + { + "name": "CN17", + "mRid": "2534343834", + "terminalList": [ + { + "name": "T37", + "mRid": "1036" + }, + { + "name": "T38", + "mRid": "1037" + }, + { + "name": "T39", + "mRid": "1038" + } + ] + } + ], + "powerTransformerList": [], + "busbarSectionList": [ + { + "name": "BusbarSection01", + "mRid": "5488855", + "terminalList": [ + { + "name": "T32", + "mRid": "1031" + }, + { + "name": "T35", + "mRid": "1034" + } + ] + }, + { + "name": "BusbarSection02", + "mRid": "53423488855", + "terminalList": [ + { + "name": "T30", + "mRid": "1029" + }, + { + "name": "T33", + "mRid": "1032" + } + ] + } + ], + "switchList": [ + { + "name": "Switch05", + "mRid": "1004", + "terminalList": [ + { + "name": "T27", + "mRid": "1026" + }, + { + "name": "T31", + "mRid": "1030" + } + ] + }, + { + "name": "Switch06", + "mRid": "1005", + "terminalList": [ + { + "name": "T28", + "mRid": "1027" + }, + { + "name": "T29", + "mRid": "1028" + } + ] + }, + { + "name": "Switch07", + "mRid": "1006", + "terminalList": [ + { + "name": "T36", + "mRid": "1035" + }, + { + "name": "T38", + "mRid": "1037" + } + ] + }, + { + "name": "Switch08", + "mRid": "1007", + "terminalList": [ + { + "name": "T34", + "mRid": "1033" + }, + { + "name": "T37", + "mRid": "1036" + } + ] + } + ], + "synchronousMachineList": [], + "acLineSegmentList": [], + "highVoltageLimit": { + "value": 20, + "multiplier": "k", + "unit": "V" + } + } + ] + }, + { + "name": "Substation10 - Ortsnetzstation Alesheim05A", + "mRid": "2363336669877", + "connectivityNodeList": [ { + "name": "CN19", + "mRid": "1018", + "terminalList": [ { + "name": "T15", + "mRid": "1015" + }] + }], + "powerTransformerList": [], + "busbarSectionList": [], + "switchList": [], + "synchronousMachineList": [], + "acLineSegmentList": [], + "voltageLevelList": [] + } + ] + }] +}] \ No newline at end of file diff --git a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-05.json b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-05.json new file mode 100644 index 00000000..eaf37196 --- /dev/null +++ b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/geographicalregion-sample-05.json @@ -0,0 +1,63 @@ +{ + "name": "UnitTest - Geamtes Netz MDN", + "mRid": "1000899", + "subGeographicalRegionList": [ { + "name": "UnitTest - Netzgebiet MDN", + "mRid": "10004566", + "substationList": [ + { + "name": "UnitTest - Breslauer Straße", + "mRid": "54887", + "connectivityNodeList": [], + "powerTransformerList": [], + "busbarSectionList": [], + "switchList": [], + "synchronousMachineList": [ + { + "name": "UnitTest - AS 012 Bayern 98 20 PV NTF KundEEG Öko-Aktiv MW P", + "mRid": "110/10488", + "terminalList": [], + "synchronousMachineKind": "GENERATOR", + "generatingUnit": {"registeredGenerator": {"unitType": "PHOT"}} + }, + { + "name": "UnitTest - AS 0269 Karl-Steigelmann 20 PV EEG PV1 Eco-Invest MW P", + "mRid": "110/10989", + "terminalList": [], + "synchronousMachineKind": "GENERATOR", + "generatingUnit": {"registeredGenerator": {"unitType": "PTUR"}} + }, + { + "name": "UnitTest - AS 0269 Karl-Steigelmann 20 PV EEG PV2 KQV Solarpar MW P", + "mRid": "110/10991", + "terminalList": [], + "synchronousMachineKind": "GENERATOR", + "generatingUnit": {"registeredGenerator": {"unitType": "PTUR"}} + } + ], + "acLineSegmentList": [], + "voltageLevelList": [] + }, + { + "name": "UnitTest - Horneckerweg", + "mRid": "54666", + "connectivityNodeList": [], + "powerTransformerList": [], + "busbarSectionList": [], + "switchList": [], + "synchronousMachineList": [ + { + "name": "UnitTest - AS 1051 Pretzfelder 7A 20 BIO NTF 1 EEG Grunds. Oschmann MW P", + "mRid": "110/13013", + "terminalList": [], + "synchronousMachineKind": "GENERATOR", + "generatingUnit": {"registeredGenerator": {"unitType": "PHOT"}} + } + ], + "acLineSegmentList": [], + "voltageLevelList": [] + } + + ] + }] +} \ No newline at end of file diff --git a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/netstate-sample-01.json b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/netstate-sample-01.json index ad52d133..5e0e4d85 100644 --- a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/netstate-sample-01.json +++ b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/netstate-sample-01.json @@ -13,18 +13,22 @@ "analogValueList": [ { "timeStamp": {"value": "10.04.2015 12:12:35"}, + "measurementValueQuality": {"failure": false}, "value": 11.11 }, { "timeStamp": {"value": "10.04.2015 12:12:35"}, + "measurementValueQuality": {"failure": false}, "value": 12.12 }, { "timeStamp": {"value": "10.04.2015 12:12:35"}, + "measurementValueQuality": {"failure": false}, "value": 13.13 }, { "timeStamp": {"value": "10.04.2015 12:12:35"}, + "measurementValueQuality": {"failure": false}, "value": 14.14 } ] @@ -44,6 +48,7 @@ "normalValue": 2000, "analogValueList": [ { "timeStamp": {"value": "10.04.2015 12:12:35"}, + "measurementValueQuality": {"failure": false}, "value": 11.11 }] }] @@ -63,6 +68,7 @@ "analogValueList": [ { "timeStamp": {"value": "10.04.2015 12:12:35"}, + "measurementValueQuality": {"failure": false}, "value": 12.12 }, { @@ -71,6 +77,7 @@ }, { "timeStamp": {"value": "10.04.2015 12:12:35"}, + "measurementValueQuality": {"failure": false}, "value": 14.14 } ] diff --git a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-01.json b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-01.json index 80ea215d..234a5873 100644 --- a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-01.json +++ b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-01.json @@ -1,28 +1,25 @@ [ { "name": "UnitTest - SynchronousMachine01", - "mRid": "458899", + "mRid": "4588995444", "psrEventList": [ { - "createdDateTime": {"value": "08.10.2015 12:01:54"}, + "createdDateTime": {"value": "10.12.2015 12:00:00"}, "psrEventKind": "inService" }], "normallyInService": true, - "terminalList": [ { - "name": "UnitTest - T01", - "mRid": "1000" - }], - "synchronousMachineKind": "generator", - "reductionSettingList": [ - {"value": {"value": 10}}, - {"value": {"value": 20}}, - {"value": {"value": 30}}, - {"value": {"value": 40}}, - {"value": {"value": 50}} - ], + "controlEnabled": true, + "maxU": { + "value": 30, + "multiplier": "k", + "unit": "W" + }, + "synchronousMachineKind": "GENERATOR", + "currentReductionSetting": {"value": 60}, + "statusCurrentReductionSetting": true, "feedInRanking": 14, + "feedInPriority": 1, "communicationType": "EFT", "communicationGroup": 1, - "parentSynchronousMachine": true, "referencedSynchronousMachineMrid": null, "generatingUnit": { "highControlLimit": { @@ -39,7 +36,7 @@ "registeredGenerator": {"unitType": "PHOT"} }, "location": { - "name": "Location01", + "name": "UnitTest - Location01", "electronicAddress": {"email": "mail@einspeiser-01.de"}, "mainAddress": { "streetDetail": { @@ -59,49 +56,37 @@ "zPosition": null }] }, - "analogList": [ { - "mRid": "11", - "measurementType": "GeneratorVoltage", - "unitMultiplier": "k", - "unitSymbol": "W", - "maxValue": 300, - "minValue": 100, - "normalValue": 1000, - "analogValueList": [ - { - "timeStamp": {"value": "10.04.2015 12:12:35"}, - "value": 11.11 - }, - { - "timeStamp": {"value": "10.04.2015 12:12:35"}, - "value": 12.12 - }, - { - "timeStamp": {"value": "10.04.2015 12:12:35"}, - "value": 13.13 - }, - { - "timeStamp": {"value": "10.04.2015 12:12:35"}, - "value": 14.14 - } - ] + "reductionSettingList": [ + {"setting": {"value": 10}}, + {"setting": {"value": 20}}, + {"setting": {"value": 30}}, + {"setting": {"value": 40}}, + {"setting": {"value": 50}} + ], + "operatingParticipantList": [ { + "name": "MDN-0479", + "mRid": "1000", + "percentage": {"value": 100} }] }, { - "name": "SynchronousMachine02", - "mRid": "2000", + "name": "UnitTest - SynchronousMachine02", + "mRid": "20054540", "psrEventList": [], "normallyInService": true, - "terminalList": [ { - "name": "T03", - "mRid": "1003" - }], - "synchronousMachineKind": "generator", - "reductionSettingList": [], + "controlEnabled": true, + "maxU": { + "value": 30, + "multiplier": "k", + "unit": "W" + }, + "synchronousMachineKind": "GENERATOR", + "currentReductionSetting": {"value": 90}, + "statusCurrentReductionSetting": true, "feedInRanking": 15, + "feedInPriority": 1, "communicationType": "EFT", "communicationGroup": 1, - "parentSynchronousMachine": false, "referencedSynchronousMachineMrid": "458899", "generatingUnit": { "highControlLimit": { @@ -118,7 +103,7 @@ "registeredGenerator": {"unitType": "PTUR"} }, "location": { - "name": "Location02", + "name": "UnitTest - Location02", "electronicAddress": {"email": "mail@einspeiser-02.de"}, "mainAddress": { "streetDetail": { @@ -133,32 +118,31 @@ }, "positionPointList": [] }, - "analogList": [ { - "mRid": "22", - "measurementType": "GeneratorVoltage", - "unitMultiplier": "k", - "unitSymbol": "W", - "maxValue": 222, - "minValue": 22, - "normalValue": 2000, - "analogValueList": [] + "reductionSettingList": [], + "operatingParticipantList": [ { + "name": "MDN-0479", + "mRid": "1000", + "percentage": {"value": 100} }] }, { - "name": "SynchronousMachine03", - "mRid": "1002", + "name": "UnitTest - SynchronousMachine03", + "mRid": "1054502", "psrEventList": [], "normallyInService": true, - "terminalList": [ { - "name": "T14", - "mRid": "1014" - }], - "synchronousMachineKind": "generator", - "reductionSettingList": [], + "controlEnabled": true, + "maxU": { + "value": 30, + "multiplier": "k", + "unit": "W" + }, + "synchronousMachineKind": "GENERATOR", + "currentReductionSetting": {"value": 80}, + "statusCurrentReductionSetting": true, "feedInRanking": 15, + "feedInPriority": 1, "communicationType": "EFT", "communicationGroup": 1, - "parentSynchronousMachine": false, "referencedSynchronousMachineMrid": "458899", "generatingUnit": { "highControlLimit": { @@ -175,7 +159,7 @@ "registeredGenerator": {"unitType": "WIND"} }, "location": { - "name": "Location03", + "name": "UnitTest - Location03", "electronicAddress": {"email": "mail@einspeiser-03.de"}, "mainAddress": { "streetDetail": { @@ -190,6 +174,11 @@ }, "positionPointList": [] }, - "analogList": [] + "reductionSettingList": [], + "operatingParticipantList": [ { + "name": "MDN-0479", + "mRid": "1000", + "percentage": {"value": 100} + }] } ] \ No newline at end of file diff --git a/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-03.json b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-03.json new file mode 100644 index 00000000..7029c41a --- /dev/null +++ b/openk-platform/openk-cachedb-service/src/test/resources/json-test-samples/synchronousmachine-sample-03.json @@ -0,0 +1,190 @@ +[ + { + "name": "UnitTest - SynchronousMachine01", + "mRid": "458899", + "psrEventList": [ { + "createdDateTime": {"value": "10.12.2015 12:00:00"}, + "psrEventKind": "inService" + }], + "operatingShareList": [ { + "percentage": {"value": 100}, + "operatingParticipant": { + "name": "UnitTest - MDN-0479", + "mRid": "1000" + } + }], + "normallyInService": true, + "controlEnabled": true, + "maxU": { + "value": 30, + "multiplier": "k", + "unit": "W" + }, + "synchronousMachineKind": "GENERATOR", + "currentReductionSetting": {"value": 60}, + "statusCurrentReductionSetting": true, + "feedInRanking": 14, + "feedInPriority": 1, + "communicationType": "EFT", + "communicationGroup": 1, + "referencedSynchronousMachineMrid": null, + "generatingUnit": { + "highControlLimit": { + "value": 30, + "multiplier": "k", + "unit": "W" + }, + "maxOperatingP": { + "value": 50, + "multiplier": "k", + "unit": "W" + }, + "generatorControlSource": "isControllable", + "registeredGenerator": {"unitType": "PHOT"} + }, + "location": { + "name": "UnitTest - Location01", + "electronicAddress": {"email": "mail@einspeiser-01.de"}, + "mainAddress": { + "streetDetail": { + "name": "Strasse A", + "number": "21" + }, + "postalCode": "22000", + "townDetail": { + "country": "Germany", + "name": "City A" + } + }, + "positionPointList": [ { + "sequenceNumber": null, + "xPosition": "56.002554", + "yPosition": "20.00122", + "zPosition": null + }] + }, + "reductionSettingList": [ + {"setting": {"value": 10}}, + {"setting": {"value": 20}}, + {"setting": {"value": 30}}, + {"setting": {"value": 40}}, + {"setting": {"value": 50}} + ] + }, + { + "name": "UnitTest - SynchronousMachine02", + "mRid": "2000", + "psrEventList": [], + "operatingShareList": [ { + "percentage": {"value": 100}, + "operatingParticipant": { + "name": "UnitTest - MDN-0479", + "mRid": "1000" + } + }], + "normallyInService": true, + "controlEnabled": true, + "maxU": { + "value": 30, + "multiplier": "k", + "unit": "W" + }, + "synchronousMachineKind": "GENERATOR", + "currentReductionSetting": {"value": 90}, + "statusCurrentReductionSetting": true, + "feedInRanking": 15, + "feedInPriority": 1, + "communicationType": "EFT", + "communicationGroup": 1, + "referencedSynchronousMachineMrid": "458899", + "generatingUnit": { + "highControlLimit": { + "value": 22, + "multiplier": "k", + "unit": "W" + }, + "maxOperatingP": { + "value": 222, + "multiplier": "k", + "unit": "W" + }, + "generatorControlSource": "isControllable", + "registeredGenerator": {"unitType": "PTUR"} + }, + "location": { + "name": "UnitTest - Location02", + "electronicAddress": {"email": "mail@einspeiser-02.de"}, + "mainAddress": { + "streetDetail": { + "name": "Strasse B", + "number": "21" + }, + "postalCode": "22000", + "townDetail": { + "country": "Germany", + "name": "City B" + } + }, + "positionPointList": [] + }, + "reductionSettingList": [] + }, + { + "name": "UnitTest - SynchronousMachine03", + "mRid": "1002", + "psrEventList": [], + "operatingShareList": [ { + "percentage": {"value": 100}, + "operatingParticipant": { + "name": "UnitTest - MDN-0479", + "mRid": "1000" + } + }], + "normallyInService": true, + "controlEnabled": true, + "maxU": { + "value": 30, + "multiplier": "k", + "unit": "W" + }, + "synchronousMachineKind": "GENERATOR", + "currentReductionSetting": {"value": 80}, + "statusCurrentReductionSetting": true, + "feedInRanking": 15, + "feedInPriority": 1, + "communicationType": "EFT", + "communicationGroup": 1, + "referencedSynchronousMachineMrid": "458899", + "generatingUnit": { + "highControlLimit": { + "value": 33, + "multiplier": "k", + "unit": "W" + }, + "maxOperatingP": { + "value": 222, + "multiplier": "k", + "unit": "W" + }, + "generatorControlSource": "isControllable", + "registeredGenerator": {"unitType": "WIND"} + }, + "location": { + "name": "UnitTest - Location03", + "electronicAddress": {"email": "mail@einspeiser-03.de"}, + "mainAddress": { + "streetDetail": { + "name": "Strasse C", + "number": "21" + }, + "postalCode": "22000", + "townDetail": { + "country": "Germany", + "name": "City C" + } + }, + "positionPointList": [] + }, + "reductionSettingList": [] + } +] \ No newline at end of file diff --git a/openk-platform/openk-cachedb-service/src/test/sql/cachedb-insert-data.sql b/openk-platform/openk-cachedb-service/src/test/sql/cachedb-insert-data.sql index bcd00ed0..af20b99d 100644 --- a/openk-platform/openk-cachedb-service/src/test/sql/cachedb-insert-data.sql +++ b/openk-platform/openk-cachedb-service/src/test/sql/cachedb-insert-data.sql @@ -6,23 +6,14 @@ INSERT INTO EQUIPMENT_CONTAINER VALUES (1000, '7788', 'Substation01 - Ortsnetzst INSERT INTO EQUIPMENT_CONTAINER VALUES (1001, '23222666', 'Substation02 - Ortsnetzstation Störzelbach',null,null,null, 'SubstationType', null, 1000); INSERT INTO EQUIPMENT_CONTAINER VALUES (1002, '2366456', 'Substation03 - Ortsnetzstation Alesheim04',null,null,null, 'SubstationType', null, 1000); INSERT INTO EQUIPMENT_CONTAINER VALUES (1003, '236453466', 'Substation04 - Ortsnetzstation A02',null,null,null, 'SubstationType', null, 1000); -INSERT INTO EQUIPMENT_CONTAINER VALUES (1005, '34423666', 'Substation05 - Ortsnetzstation A06',null,null,null, 'SubstationType', null, 1000); -INSERT INTO EQUIPMENT_CONTAINER VALUES (1006, '2367766', 'Substation06 - Ortsnetzstation Alesheim06',null,null,null, 'SubstationType', null, 1000); -INSERT INTO EQUIPMENT_CONTAINER VALUES (1007, '2368866', 'Substation07 - Ortsnetzstation A03',null,null,null, 'SubstationType', null, 1000); -INSERT INTO EQUIPMENT_CONTAINER VALUES (1008, '23633366', 'Substation08 - Ortsnetzstation W02',null,null,null, 'SubstationType', null, 1000); -INSERT INTO EQUIPMENT_CONTAINER VALUES (1009, '23633366', 'Substation09 - Umspannwerk WAHF',null,null,null, 'SubstationType', null, 1000); -INSERT INTO EQUIPMENT_CONTAINER VALUES (1010, '236634336', 'VoltageLevel01 - 110kV', 110, 'KILO', 'V', 'VoltageLevelType', 1009, null); -INSERT INTO EQUIPMENT_CONTAINER VALUES (1011, '8974455', 'VoltageLevel02', 20,'KILO','V','VoltageLevelType', 1009, null); -INSERT INTO EQUIPMENT_CONTAINER VALUES (1012, '23633366', 'Substation10 - Ortsnetzstation Alesheim05A',null,null,null, 'SubstationType', null, 1000); - -INSERT INTO AC_LINE_SEGMENT VALUES (1000, '45889', 'Cable01', 1000); -INSERT INTO AC_LINE_SEGMENT VALUES (1001, '1034534501', 'Cable02', 1001); -INSERT INTO AC_LINE_SEGMENT VALUES (1002, '1034534501', 'Cable03', 1003); -INSERT INTO AC_LINE_SEGMENT VALUES (1003, '1034534501', 'Cable04', 1005); -INSERT INTO AC_LINE_SEGMENT VALUES (1004, '10454301', 'Cable05', 1006); -INSERT INTO AC_LINE_SEGMENT VALUES (1005, '1042534234301', 'Cable06', 1007); -INSERT INTO AC_LINE_SEGMENT VALUES (1006, '104234301', 'Cable07', 1008); -INSERT INTO AC_LINE_SEGMENT VALUES (1007, '188804234301', 'Cable08', 1010); +INSERT INTO EQUIPMENT_CONTAINER VALUES (1004, '34423666', 'Substation05 - Ortsnetzstation A06',null,null,null, 'SubstationType', null, 1000); +INSERT INTO EQUIPMENT_CONTAINER VALUES (1005, '2367766', 'Substation06 - Ortsnetzstation Alesheim 01',null,null,null, 'SubstationType', null, 1000); +INSERT INTO EQUIPMENT_CONTAINER VALUES (1006, '2368866', 'Substation07 - Ortsnetzstation A03',null,null,null, 'SubstationType', null, 1000); +INSERT INTO EQUIPMENT_CONTAINER VALUES (1007, '2365633366', 'Substation08 - Ortsnetzstation W02',null,null,null, 'SubstationType', null, 1000); +INSERT INTO EQUIPMENT_CONTAINER VALUES (1008, '23634883366', 'Substation09 - Umspannwerk WAHF',null,null,null, 'SubstationType', null, 1000); +INSERT INTO EQUIPMENT_CONTAINER VALUES (1009, '236634589336', 'VoltageLevel01 - 110kV', 110, 'KILO', 'V', 'VoltageLevelType', 1009, null); +INSERT INTO EQUIPMENT_CONTAINER VALUES (1010, '8974455', 'VoltageLevel02', 20,'KILO','V','VoltageLevelType', 1009, null); +INSERT INTO EQUIPMENT_CONTAINER VALUES (1011, '23633366', 'Substation10 - Ortsnetzstation Alesheim05A',null,null,null, 'SubstationType', null, 1000); INSERT INTO generating_unit( id, high_control_limit_value, high_control_limit_unit_multiplier, @@ -41,6 +32,7 @@ INSERT INTO generating_unit( VALUES (1002,33, 'KILO', 'W',222,'KILO','W','IS_CONTROLLABLE','WIND'); --########################################################################### -- weitere Beispiele fuer Abschaltvorgang +/* INSERT INTO generating_unit( id, high_control_limit_value, high_control_limit_unit_multiplier, high_control_limit_unit_symbol, max_operating_power_limit_value, @@ -61,6 +53,7 @@ INSERT INTO generating_unit( high_control_limit_unit_symbol, max_operating_power_limit_value, max_operating_power_unit_multiplier, max_operating_power_unit_symbol, control_source, unit_type) VALUES (9003,33, 'KILO', 'W',222,'KILO','W','IS_CONTROLLABLE','WIND'); +*/ --########################################################################### INSERT INTO location(id, name, email,street_name, street_number, postal_code,city,country) @@ -75,32 +68,41 @@ INSERT INTO location(id, name, email,street_name, street_number, postal_code,cit INSERT INTO position_point VALUES(1000,null,'56.002554','20.00122',null, 1000); INSERT INTO synchronous_machine(id, mrid, name, synchronous_machine_kind, communication_type, - normally_in_service, generating_unit_id, location_id, equipment_container_id, feed_in_ranking, - communication_group, control_enabled, synchronous_machine_id) + normally_in_service, generating_unit_id, location_id, equipment_container_id, feed_in_ranking, FEED_IN_PRIORITY, + max_voltage_limit_value, MAX_VOLTAGE_LIMIT_UNIT_MULTIPLIER, MAX_VOLTAGE_LIMIT_UNIT_SYMBOL, + communication_group, control_enabled, CURRENT_REDUCTION_SETTING_PER_CENT, status_current_reduction_setting, synchronous_machine_id) VALUES (1000,'458899', 'SynchronousMachine01', 'GENERATOR' , 'EFT', - 'TRUE', 1000, 1000, 1000, 14, - 1, 'TRUE', null); -INSERT INTO synchronous_machine(id, mrid, name, synchronous_machine_kind, communication_type, - normally_in_service, generating_unit_id,location_id, equipment_container_id, feed_in_ranking, - communication_group, control_enabled, synchronous_machine_id) + 'TRUE', 1000, 1000, 1000, 14,1, + 30, 'KILO', 'W', + 1, 'TRUE', '60', true, null); +INSERT INTO synchronous_machine(id, mrid, name, synchronous_machine_kind, communication_type, + normally_in_service, generating_unit_id, location_id, equipment_container_id, feed_in_ranking, FEED_IN_PRIORITY, + max_voltage_limit_value, MAX_VOLTAGE_LIMIT_UNIT_MULTIPLIER, MAX_VOLTAGE_LIMIT_UNIT_SYMBOL, + communication_group, control_enabled, CURRENT_REDUCTION_SETTING_PER_CENT, status_current_reduction_setting, synchronous_machine_id) VALUES (1001, '2000', 'SynchronousMachine02', 'GENERATOR', 'EFT', - 'TRUE', 1001, 1001, 1000, 15, - 1, 'TRUE', 1000); -INSERT INTO synchronous_machine(id, mrid, name, synchronous_machine_kind, communication_type, - normally_in_service, generating_unit_id,location_id, equipment_container_id, feed_in_ranking, - communication_group, control_enabled, synchronous_machine_id) + 'TRUE', 1001, 1001, 1000, 15, 1, + 30, 'KILO', 'W', + 1, 'TRUE', '90', true, 1000); +INSERT INTO synchronous_machine(id, mrid, name, synchronous_machine_kind, communication_type, + normally_in_service, generating_unit_id, location_id, equipment_container_id, feed_in_ranking,FEED_IN_PRIORITY, + max_voltage_limit_value, MAX_VOLTAGE_LIMIT_UNIT_MULTIPLIER, MAX_VOLTAGE_LIMIT_UNIT_SYMBOL, + communication_group, control_enabled, CURRENT_REDUCTION_SETTING_PER_CENT, status_current_reduction_setting, synchronous_machine_id) VALUES (1002, '1002', 'SynchronousMachine03', 'GENERATOR', 'EFT', - 'TRUE', 1002, 1002, 1002, 15, - 1, 'TRUE', 1000); + 'TRUE', 1002, 1002, 1002, 15, 1, + 30, 'KILO', 'W', + 1, 'TRUE', '80', true, 1000); -- Beispiel: SynchronousMachine an VoltageLevel +/* INSERT INTO synchronous_machine(id, mrid, name, synchronous_machine_kind, communication_type, normally_in_service, generating_unit_id,location_id, equipment_container_id, feed_in_ranking, communication_group, control_enabled, synchronous_machine_id) VALUES (1003, '1002', 'SynchronousMachine99', 'GENERATOR', 'EFT', 'TRUE', 1002, 1002, 1011, 15, 1, 'TRUE', 1000); +*/ --########################################################################### -- weitere Beispiele fuer Abschaltvorgang +/* INSERT INTO synchronous_machine(id, mrid, name, synchronous_machine_kind, communication_type, normally_in_service, generating_unit_id,location_id, equipment_container_id, feed_in_ranking, communication_group, control_enabled, synchronous_machine_id) @@ -125,10 +127,17 @@ INSERT INTO synchronous_machine(id, mrid, name, synchronous_machine_kind, commun VALUES (9003, '9003', 'SynchronousMachine9003', 'GENERATOR', 'EFT', 'TRUE', 9003, 1001, 1000, 1, 1, 'TRUE', 1000); - - +*/ --########################################################################### +INSERT INTO OPERATING_PARTICIPANT VALUES (1000, '1000', 'MDN-0479',100, null, null, null,1000, null); +INSERT INTO OPERATING_PARTICIPANT VALUES (1001, '1000', 'MDN-0479',100, null, null, null,1001, null); +INSERT INTO OPERATING_PARTICIPANT VALUES (1002, '1000', 'MDN-0479',100, null, null, null,1002, null); +--INSERT INTO OPERATING_PARTICIPANT VALUES ('1000', 'MDN-0479'); + +--INSERT INTO OPERATING_SHARE VALUES (1000, 100, '1000', null, null, null, 1000, null); +--INSERT INTO OPERATING_SHARE VALUES (1001, 100, '1000', null, null, null, 1001, null); +--INSERT INTO OPERATING_SHARE VALUES (1002, 100, '1000', null, null, null, 1002, null); INSERT INTO REDUCTION_SETTING VALUES (1000, 10, 1000); INSERT INTO REDUCTION_SETTING VALUES (1001, 20, 1000); @@ -143,88 +152,201 @@ INSERT INTO measurement_analog VALUES (1000, '11', 'GeneratorVoltage','KILO','W' INSERT INTO measurement_analog VALUES (1001, '22', 'GeneratorVoltage','KILO','W',22,222, 2000,1001); INSERT INTO measurement_analog VALUES (1002, '2233', 'GeneratorVoltage','KILO','W',33,233, 3000,1002); -INSERT INTO measurement_analog_value VALUES (1000, '10.04.2015 12:12:35', 11.11, 1000); -INSERT INTO measurement_analog_value VALUES (1001, '10.04.2015 12:12:35', 12.12, 1000); -INSERT INTO measurement_analog_value VALUES (1002, '10.04.2015 12:12:35', 13.13, 1000); -INSERT INTO measurement_analog_value VALUES (1003, '10.04.2015 12:12:35', 14.14, 1000); -INSERT INTO measurement_analog_value VALUES (1004, '10.04.2015 12:12:35', 11.11, 1001); -INSERT INTO measurement_analog_value VALUES (1005, '10.04.2015 12:12:35', 12.12, 1002); -INSERT INTO measurement_analog_value VALUES (1006, '10.04.2015 12:12:35', 13.13, 1002); -INSERT INTO measurement_analog_value VALUES (1007, '10.04.2015 12:12:35', 14.14, 1002); - -INSERT INTO POWER_TRANSFORMER VALUES (1000, '1000100', 'PowerTransformer01', 1009); - -INSERT INTO BUSBAR_SECTION VALUES (1000, '5488855', 'BusbarSection01', 1011); -INSERT INTO BUSBAR_SECTION VALUES (1001, '53423488855', 'BusbarSection02', 1011); - -INSERT INTO SWITCH VALUES (1000, '1000', 'Switch01','FALSE', 1001); -INSERT INTO SWITCH VALUES (1001, '2000', 'Switch02','FALSE', 1002); -INSERT INTO SWITCH VALUES (1002, '3000', 'Switch03','TRUE',1002); -INSERT INTO SWITCH VALUES (1003, '1003', 'Switch04','TRUE',1002); -INSERT INTO SWITCH VALUES (1004, '1004', 'Switch05','TRUE',1011); -INSERT INTO SWITCH VALUES (1005, '1005', 'Switch06','TRUE',1011); -INSERT INTO SWITCH VALUES (1006, '1006', 'Switch07','TRUE',1011); -INSERT INTO SWITCH VALUES (1007, '1007', 'Switch08','TRUE',1011); +INSERT INTO measurement_analog_value VALUES (1000, '10.04.2015 12:12:35', 11.11, false, 1000); +INSERT INTO measurement_analog_value VALUES (1001, '10.04.2015 12:12:35', 12.12, false, 1000); +INSERT INTO measurement_analog_value VALUES (1002, '10.04.2015 12:12:35', 13.13, false, 1000); +INSERT INTO measurement_analog_value VALUES (1003, '10.04.2015 12:12:35', 14.14, false, 1000); +INSERT INTO measurement_analog_value VALUES (1004, '10.04.2015 12:12:35', 11.11, false, 1001); +INSERT INTO measurement_analog_value VALUES (1005, '10.04.2015 12:12:35', 12.12, false, 1002); +INSERT INTO measurement_analog_value VALUES (1006, '10.04.2015 12:12:35', 13.13, false, 1002); +INSERT INTO measurement_analog_value VALUES (1007, '10.04.2015 12:12:35', 14.14, false, 1002); + +INSERT INTO AC_LINE_SEGMENT VALUES (1000, '45889', 'Cable01', 1000); +INSERT INTO AC_LINE_SEGMENT VALUES (1001, '1034534501', 'Cable02', 1002); +INSERT INTO AC_LINE_SEGMENT VALUES (1002, '103234501', 'Cable03', 1002); +INSERT INTO AC_LINE_SEGMENT VALUES (1003, '103/4534501', 'Cable04', 1003); +INSERT INTO AC_LINE_SEGMENT VALUES (1004, '104557884301', 'Cable05', 1004); +INSERT INTO AC_LINE_SEGMENT VALUES (1005, '17780301', 'Cable06', 1005); +INSERT INTO AC_LINE_SEGMENT VALUES (1006, '14/301', 'Cable07', 1006); +INSERT INTO AC_LINE_SEGMENT VALUES (1007, '14555/01', 'Cable08', 1009); + +INSERT INTO POWER_TRANSFORMER VALUES (1000, '1000100', 'PowerTransformer01', 1001); +INSERT INTO POWER_TRANSFORMER VALUES (1001, '1001', 'PowerTransformer02', 1002); +INSERT INTO POWER_TRANSFORMER VALUES (1002, '1002', 'PowerTransformer03', 1003); +INSERT INTO POWER_TRANSFORMER VALUES (1003, '1003', 'PowerTransformer04', 1004); +INSERT INTO POWER_TRANSFORMER VALUES (1004, '1004', 'PowerTransformer05', 1005); +INSERT INTO POWER_TRANSFORMER VALUES (1005, '1005', 'PowerTransformer06', 1006); +INSERT INTO POWER_TRANSFORMER VALUES (1006, '1006', 'PowerTransformer07', 1007); +INSERT INTO POWER_TRANSFORMER VALUES (1007, '1007', 'PowerTransformer08', 1008); + +INSERT INTO BUSBAR_SECTION VALUES (1000, '5488855', 'BusbarSection01', 1010); +INSERT INTO BUSBAR_SECTION VALUES (1001, '53423488855', 'BusbarSection02', 1010); + +INSERT INTO SWITCH VALUES (1000, '1000', 'Switch01','FALSE', 1000); +INSERT INTO SWITCH VALUES (1001, '2000', 'Switch02','FALSE', 1000); +INSERT INTO SWITCH VALUES (1002, '3000', 'Switch03','FALSE',1000); +INSERT INTO SWITCH VALUES (1003, '1003', 'Switch04','FALSE',1001); +INSERT INTO SWITCH VALUES (1004, '1004', 'Switch05','FALSE',1001); +INSERT INTO SWITCH VALUES (1005, '1005', 'Switch06','FALSE',1002); +INSERT INTO SWITCH VALUES (1006, '1006', 'Switch07','FALSE',1002); +INSERT INTO SWITCH VALUES (1007, '1007', 'Switch08','FALSE',1002); +INSERT INTO SWITCH VALUES (1008, '1008', 'Switch09','FALSE',1002); +INSERT INTO SWITCH VALUES (1009, '1009', 'Switch10','FALSE',1002); +INSERT INTO SWITCH VALUES (1010, '1010', 'Switch11','FALSE',1003); +INSERT INTO SWITCH VALUES (1011, '1011', 'Switch12','FALSE',1003); +INSERT INTO SWITCH VALUES (1012, '1012', 'Switch13','FALSE',1003); +INSERT INTO SWITCH VALUES (1013, '1013', 'Switch14','FALSE',1004); +INSERT INTO SWITCH VALUES (1014, '1014', 'Switch15','FALSE',1004); +INSERT INTO SWITCH VALUES (1015, '1015', 'Switch16','FALSE',1004); +INSERT INTO SWITCH VALUES (1016, '1016', 'Switch17','FALSE',1005); +INSERT INTO SWITCH VALUES (1017, '1017', 'Switch18','FALSE',1005); +INSERT INTO SWITCH VALUES (1018, '1018', 'Switch19','FALSE',1005); +INSERT INTO SWITCH VALUES (1019, '1019', 'Switch20','FALSE',1006); +INSERT INTO SWITCH VALUES (1020, '1020', 'Switch21','FALSE',1006); +INSERT INTO SWITCH VALUES (1021, '1021', 'Switch22','FALSE',1006); +INSERT INTO SWITCH VALUES (1022, '1022', 'Switch23','FALSE',1007); +INSERT INTO SWITCH VALUES (1023, '1023', 'Switch24','FALSE',1007); +INSERT INTO SWITCH VALUES (1024, '1024', 'Switch25','FALSE',1007); +INSERT INTO SWITCH VALUES (1025, '1025', 'Switch26','FALSE',1010); +INSERT INTO SWITCH VALUES (1026, '1026', 'Switch27','FALSE',1010); +INSERT INTO SWITCH VALUES (1027, '1027', 'Switch28','FALSE',1010); +INSERT INTO SWITCH VALUES (1028, '1028', 'Switch29','FALSE',1010); +INSERT INTO SWITCH VALUES (1029, '1029', 'Switch30','FALSE',1009); INSERT INTO CONNECTIVITY_NODE VALUES (1000, '12359', 'CN01', 1000); INSERT INTO CONNECTIVITY_NODE VALUES (1001, '235699898', 'CN02', 1000); INSERT INTO CONNECTIVITY_NODE VALUES (1002, '2343589', 'CN03', 1000); -INSERT INTO CONNECTIVITY_NODE VALUES (1003, '222333589', 'CN04', 1001); -INSERT INTO CONNECTIVITY_NODE VALUES (1004, '25789989', 'CN05', 1002); -INSERT INTO CONNECTIVITY_NODE VALUES (1005, '25341189', 'CN06', 1002); -INSERT INTO CONNECTIVITY_NODE VALUES (1006, '25546489', 'CN07', 1003); -INSERT INTO CONNECTIVITY_NODE VALUES (1007, '1045507', 'CN08', 1005); -INSERT INTO CONNECTIVITY_NODE VALUES (1008, '2577789', 'CN09', 1006); -INSERT INTO CONNECTIVITY_NODE VALUES (1009, '29000589', 'CN10', 1007); -INSERT INTO CONNECTIVITY_NODE VALUES (1010, '258345349', 'CN11', 1007); -INSERT INTO CONNECTIVITY_NODE VALUES (1011, '253453489', 'CN12', 1008); -INSERT INTO CONNECTIVITY_NODE VALUES (1012, '2533434453489', 'CN13', 1011); -INSERT INTO CONNECTIVITY_NODE VALUES (1013, '2534534', 'CN14', 1011); -INSERT INTO CONNECTIVITY_NODE VALUES (1014, '2534587834', 'CN15', 1011); -INSERT INTO CONNECTIVITY_NODE VALUES (1015, '25345434', 'CN16', 1011); -INSERT INTO CONNECTIVITY_NODE VALUES (1016, '2534343834', 'CN17', 1011); -INSERT INTO CONNECTIVITY_NODE VALUES (1017, '8888884', 'CN18', 1010); -INSERT INTO CONNECTIVITY_NODE VALUES (1018, '1018', 'CN19', 1012); - -INSERT INTO TERMINAL VALUES (1000, '1000', 'T01', 1000, null, null, null, 1000, null); -INSERT INTO TERMINAL VALUES (1001, '1002', 'T02', 1000, null, null, null, null, 1000); -INSERT INTO TERMINAL VALUES (1002, '1003', 'T03', 1001, null, null, null, 1001, null); -INSERT INTO TERMINAL VALUES (1003, '1004', 'T04', 1001, null, null, null, null, 1000); -INSERT INTO TERMINAL VALUES (1004, '1005', 'T05', 1002, null, null, null, null, 1000); -INSERT INTO TERMINAL VALUES (1005, '1006', 'T06', 1002, null, null, 1000, null, null); -INSERT INTO TERMINAL VALUES (1006, '1007', 'T07', 1003, null, null, 1000, null, null); -INSERT INTO TERMINAL VALUES (1007, '1008', 'T08', 1003, null, null, null, null, 1001); -INSERT INTO TERMINAL VALUES (1008, '1009', 'T09', 1004, null, null, null, null, 1001); -INSERT INTO TERMINAL VALUES (1009, '1010', 'T10', 1004, null, null, 1001, null, null); -INSERT INTO TERMINAL VALUES (1010, '1011', 'T11', 1005, null, null, 1001, null, null); -INSERT INTO TERMINAL VALUES (1011, '1012', 'T12', 1005, null, null, 1002, null, null); -INSERT INTO TERMINAL VALUES (1012, '1013', 'T13', 1005, null, null, 1003, null, null); -INSERT INTO TERMINAL VALUES (1013, '1014', 'T14', 1005, null, null, null, 1002, null); -INSERT INTO TERMINAL VALUES (1014, '1015', 'T15', 1018, null, null, 1003, null, null); -INSERT INTO TERMINAL VALUES (1015, '1016', 'T16', 1006, null, null, 1002, null, null); -INSERT INTO TERMINAL VALUES (1016, '1017', 'T17', 1006, null, null, null, null, 1002); -INSERT INTO TERMINAL VALUES (1017, '1018', 'T18', 1007, null, null, null, null, 1002); -INSERT INTO TERMINAL VALUES (1018, '1019', 'T19', 1007, null, null, null, null, 1003); -INSERT INTO TERMINAL VALUES (1019, '1020', 'T20', 1008, null, null, null, null, 1003); -INSERT INTO TERMINAL VALUES (1020, '1021', 'T21', 1008, null, null, null, null, 1004); -INSERT INTO TERMINAL VALUES (1021, '1022', 'T22', 1009, null, null, null, null, 1004); -INSERT INTO TERMINAL VALUES (1022, '1023', 'T23', 1009, null, null, null, null, 1005); -INSERT INTO TERMINAL VALUES (1023, '1024', 'T24', 1010, null, null, null, null, 1005); -INSERT INTO TERMINAL VALUES (1024, '1024', 'T25', 1010, null, null, null, null, 1006); -INSERT INTO TERMINAL VALUES (1025, '1025', 'T26', 1011, null, null, null, null, 1006); -INSERT INTO TERMINAL VALUES (1026, '1026', 'T27', 1011, null, null, 1004, null, null); -INSERT INTO TERMINAL VALUES (1027, '1027', 'T28', 1011, null, null, 1005, null, null); -INSERT INTO TERMINAL VALUES (1028, '1028', 'T29', 1012, null, null, 1005, null, null); -INSERT INTO TERMINAL VALUES (1029, '1029', 'T30', 1012, null, 1001, null, null, null); -INSERT INTO TERMINAL VALUES (1030, '1030', 'T31', 1013, null, null, 1004, null, null); -INSERT INTO TERMINAL VALUES (1031, '1031', 'T32', 1013, null, 1000, null, null, null); -INSERT INTO TERMINAL VALUES (1032, '1032', 'T33', 1014, null, 1001, null, null, null); -INSERT INTO TERMINAL VALUES (1033, '1033', 'T34', 1014, null, null, 1007, null, null); -INSERT INTO TERMINAL VALUES (1034, '1034', 'T35', 1015, null, 1000, null, null, null); -INSERT INTO TERMINAL VALUES (1035, '1035', 'T36', 1015, null, null, 1006, null, null); -INSERT INTO TERMINAL VALUES (1036, '1036', 'T37', 1016, null, null, 1007, null, null); -INSERT INTO TERMINAL VALUES (1037, '1037', 'T38', 1016, null, null, 1006, null, null); -INSERT INTO TERMINAL VALUES (1038, '1038', 'T39', 1016, 1000, null, null, null, null); -INSERT INTO TERMINAL VALUES (1039, '1039', 'T40', 1017, 1000, null, null, null, null); -INSERT INTO TERMINAL VALUES (1040, '1040', 'T41', 1017, null, null, null, null, 1007); +INSERT INTO CONNECTIVITY_NODE VALUES (1003, '222333589', 'CN04', 1000); +INSERT INTO CONNECTIVITY_NODE VALUES (1004, '25789989', 'CN05', 1000); +INSERT INTO CONNECTIVITY_NODE VALUES (1005, '25341189', 'CN06', 1001); +INSERT INTO CONNECTIVITY_NODE VALUES (1006, '25546489', 'CN07', 1001); +INSERT INTO CONNECTIVITY_NODE VALUES (1007, '1045507', 'CN08', 1001); +INSERT INTO CONNECTIVITY_NODE VALUES (1008, '2577789', 'CN09', 1002); +INSERT INTO CONNECTIVITY_NODE VALUES (1009, '29000589', 'CN10', 1002); +INSERT INTO CONNECTIVITY_NODE VALUES (1010, '258345349', 'CN11', 1002); +INSERT INTO CONNECTIVITY_NODE VALUES (1011, '253453489', 'CN12', 1002); +INSERT INTO CONNECTIVITY_NODE VALUES (1012, '2533434453489', 'CN13', 1002); +INSERT INTO CONNECTIVITY_NODE VALUES (1013, '2534534', 'CN14', 1002); +INSERT INTO CONNECTIVITY_NODE VALUES (1014, '2534587834', 'CN15', 1003); +INSERT INTO CONNECTIVITY_NODE VALUES (1015, '25345434', 'CN16', 1003); +INSERT INTO CONNECTIVITY_NODE VALUES (1016, '2534343834', 'CN17', 1003); +INSERT INTO CONNECTIVITY_NODE VALUES (1017, '8888884', 'CN18', 1003); +INSERT INTO CONNECTIVITY_NODE VALUES (1018, '1018', 'CN19', 1004); +INSERT INTO CONNECTIVITY_NODE VALUES (1019, '1019', 'CN20', 1004); +INSERT INTO CONNECTIVITY_NODE VALUES (1020, '1020', 'CN21', 1004); +INSERT INTO CONNECTIVITY_NODE VALUES (1021, '1021', 'CN22', 1004); +INSERT INTO CONNECTIVITY_NODE VALUES (1022, '1022', 'CN23', 1005); +INSERT INTO CONNECTIVITY_NODE VALUES (1023, '1023', 'CN24', 1005); +INSERT INTO CONNECTIVITY_NODE VALUES (1024, '1024', 'CN25', 1005); +INSERT INTO CONNECTIVITY_NODE VALUES (1025, '1025', 'CN26', 1005); +INSERT INTO CONNECTIVITY_NODE VALUES (1026, '1026', 'CN27', 1005); +INSERT INTO CONNECTIVITY_NODE VALUES (1027, '1027', 'CN28', 1006); +INSERT INTO CONNECTIVITY_NODE VALUES (1028, '1028', 'CN29', 1006); +INSERT INTO CONNECTIVITY_NODE VALUES (1029, '1029', 'CN30', 1006); +INSERT INTO CONNECTIVITY_NODE VALUES (1030, '1030', 'CN31', 1006); +INSERT INTO CONNECTIVITY_NODE VALUES (1031, '1031', 'CN32', 1006); +INSERT INTO CONNECTIVITY_NODE VALUES (1032, '1032', 'CN33', 1006); +INSERT INTO CONNECTIVITY_NODE VALUES (1033, '1033', 'CN34', 1006); +INSERT INTO CONNECTIVITY_NODE VALUES (1034, '1034', 'CN35', 1006); +INSERT INTO CONNECTIVITY_NODE VALUES (1035, '1035', 'CN36', 1008); +INSERT INTO CONNECTIVITY_NODE VALUES (1036, '1036', 'CN37', 1010); +INSERT INTO CONNECTIVITY_NODE VALUES (1037, '1037', 'CN38', 1010); +INSERT INTO CONNECTIVITY_NODE VALUES (1038, '1038', 'CN39', 1010); +INSERT INTO CONNECTIVITY_NODE VALUES (1039, '1039', 'CN40', 1010); +INSERT INTO CONNECTIVITY_NODE VALUES (1040, '1040', 'CN41', 1009); +INSERT INTO CONNECTIVITY_NODE VALUES (1041, '1041', 'CN42', 1009); + +INSERT INTO TERMINAL VALUES (1000, '1000', 'T01', 'TRUE', 1000, null, null, null, 1000, null); +INSERT INTO TERMINAL VALUES (1001, '1002', 'T02', 'TRUE', 1000, null, null, 1000, null, null); +INSERT INTO TERMINAL VALUES (1002, '1003', 'T03', 'TRUE', 1001, null, null, null, 1001, null); +INSERT INTO TERMINAL VALUES (1003, '1004', 'T04', 'TRUE', 1001, null, null, 1001, null, null); +INSERT INTO TERMINAL VALUES (1004, '1005', 'T05', 'TRUE', 1002, null, null, 1000, null, null); +INSERT INTO TERMINAL VALUES (1005, '1006', 'T06', 'TRUE', 1002, null, null, null, null, 1000); +INSERT INTO TERMINAL VALUES (1006, '1007', 'T07', 'TRUE', 1003, null, null, 1001, null, null); +INSERT INTO TERMINAL VALUES (1007, '1008', 'T08', 'TRUE', 1003, null, null, null, null, 1000); +INSERT INTO TERMINAL VALUES (1008, '1009', 'T09', 'TRUE', 1004, null, null, null, null, 1000); +INSERT INTO TERMINAL VALUES (1009, '1010', 'T10', 'TRUE', 1004, null, null, 1002, null, null); +INSERT INTO TERMINAL VALUES (1010, '1011', 'T11', 'TRUE', 1005, null, null, 1002, null, null); +INSERT INTO TERMINAL VALUES (1011, '1012', 'T12', 'TRUE', 1005, null, null, 1004, null, null); +INSERT INTO TERMINAL VALUES (1012, '1013', 'T13', 'TRUE', 1005, null, null, 1003, null, null); +INSERT INTO TERMINAL VALUES (1013, '1014', 'T14', 'TRUE', 1006, null, null, 1003, null, null); +INSERT INTO TERMINAL VALUES (1014, '1015', 'T15', 'TRUE', 1006, 1000, null, null, null, null); +INSERT INTO TERMINAL VALUES (1015, '1016', 'T16', 'TRUE', 1007, null, null, 1004, null, null); +INSERT INTO TERMINAL VALUES (1016, '1017', 'T17', 'TRUE', 1007, null, null, null, null, 1001); +INSERT INTO TERMINAL VALUES (1017, '1018', 'T18', 'TRUE', 1008, null, null, null, null, 1001); +INSERT INTO TERMINAL VALUES (1018, '1019', 'T19', 'TRUE', 1008, null, null, 1005, null, null); +INSERT INTO TERMINAL VALUES (1019, '1020', 'T20', 'TRUE', 1011, null, null, 1008, null, null); +INSERT INTO TERMINAL VALUES (1020, '1021', 'T21', 'TRUE', 1009, null, null, 1008, null, null); +INSERT INTO TERMINAL VALUES (1021, '1022', 'T22', 'TRUE', 1009, 1001, null, null, null, null); +INSERT INTO TERMINAL VALUES (1022, '1023', 'T23', 'TRUE', 1011, null, null, 1009, null, null); +INSERT INTO TERMINAL VALUES (1023, '1024', 'T24', 'TRUE', 1010, null, null, 1009, null, null); +INSERT INTO TERMINAL VALUES (1024, '1024', 'T25', 'TRUE', 1010, null, null, null, 1002, null); +INSERT INTO TERMINAL VALUES (1025, '1025', 'T26', 'TRUE', 1011, null, null, 1007, null, null); +INSERT INTO TERMINAL VALUES (1026, '1026', 'T27', 'TRUE', 1011, null, null, 1005, null, null); +INSERT INTO TERMINAL VALUES (1027, '1027', 'T28', 'TRUE', 1011, null, null, 1006, null, null); +INSERT INTO TERMINAL VALUES (1028, '1028', 'T29', 'TRUE', 1012, null, null, 1007, null, null); +INSERT INTO TERMINAL VALUES (1029, '1029', 'T30', 'TRUE', 1013, null, null, 1006, null, null); +INSERT INTO TERMINAL VALUES (1030, '1030', 'T31', 'TRUE', 1013, null, null, null, null, 1002); +INSERT INTO TERMINAL VALUES (1031, '1031', 'T32', 'TRUE', 1014, null, null, null, null, 1002); +INSERT INTO TERMINAL VALUES (1032, '1032', 'T33', 'TRUE', 1014, null, null, 1010, null, null); +INSERT INTO TERMINAL VALUES (1033, '1033', 'T34', 'TRUE', 1015, null, null, 1010, null, null); +INSERT INTO TERMINAL VALUES (1034, '1034', 'T35', 'TRUE', 1015, null, null, 1011, null, null); +INSERT INTO TERMINAL VALUES (1035, '1035', 'T36', 'TRUE', 1016, null, null, 1011, null, null); +INSERT INTO TERMINAL VALUES (1036, '1036', 'T37', 'TRUE', 1016, 1002, null, null, null, null); +INSERT INTO TERMINAL VALUES (1037, '1037', 'T38', 'TRUE', 1015, null, null, 1012, null, null); +INSERT INTO TERMINAL VALUES (1038, '1038', 'T39', 'TRUE', 1017, null, null, 1012, null, null); +INSERT INTO TERMINAL VALUES (1039, '1039', 'T40', 'TRUE', 1017, null, null, null, null, 1003); +INSERT INTO TERMINAL VALUES (1040, '1040', 'T41', 'TRUE', 1018, null, null, null, null, 1003); +INSERT INTO TERMINAL VALUES (1041, '1041', 'T42', 'TRUE', 1018, null, null, 1013, null, null); +INSERT INTO TERMINAL VALUES (1042, '1042', 'T43', 'TRUE', 1019, null, null, 1013, null, null); +INSERT INTO TERMINAL VALUES (1043, '1043', 'T44', 'TRUE', 1019, null, null, 1014, null, null); +INSERT INTO TERMINAL VALUES (1044, '1044', 'T45', 'TRUE', 1020, null, null, 1014, null, null); +INSERT INTO TERMINAL VALUES (1045, '1045', 'T46', 'TRUE', 1020, 1003, null, null, null, null); +INSERT INTO TERMINAL VALUES (1046, '1046', 'T47', 'TRUE', 1019, null, null, 1015, null, null); +INSERT INTO TERMINAL VALUES (1047, '1047', 'T48', 'TRUE', 1021, null, null, 1015, null, null); +INSERT INTO TERMINAL VALUES (1048, '1048', 'T49', 'TRUE', 1021, null, null, null, null, 1004); +INSERT INTO TERMINAL VALUES (1049, '1049', 'T50', 'TRUE', 1022, null, null, null, null, 1004); +INSERT INTO TERMINAL VALUES (1050, '1050', 'T51', 'TRUE', 1022, null, null, 1016, null, null); +INSERT INTO TERMINAL VALUES (1051, '1051', 'T52', 'TRUE', 1023, null, null, 1016, null, null); +INSERT INTO TERMINAL VALUES (1052, '1052', 'T53', 'TRUE', 1023, null, null, 1017, null, null); +INSERT INTO TERMINAL VALUES (1053, '1053', 'T54', 'TRUE', 1024, null, null, 1017, null, null); +INSERT INTO TERMINAL VALUES (1054, '1054', 'T55', 'TRUE', 1024, 1004, null, null, null, null); +INSERT INTO TERMINAL VALUES (1055, '1055', 'T56', 'TRUE', 1025, null, null, 1018, null, null); +INSERT INTO TERMINAL VALUES (1056, '1056', 'T57', 'TRUE', 1025, null, null, null, null, 1005); +INSERT INTO TERMINAL VALUES (1057, '1057', 'T58', 'TRUE', 1026, null, null, null, null, 1005); +INSERT INTO TERMINAL VALUES (1058, '1058', 'T59', 'TRUE', 1026, null, null, 1019, null, null); +INSERT INTO TERMINAL VALUES (1059, '1059', 'T60', 'TRUE', 1027, null, null, 1019, null, null); +INSERT INTO TERMINAL VALUES (1060, '1060', 'T61', 'TRUE', 1027, null, null, 1020, null, null); +INSERT INTO TERMINAL VALUES (1061, '1061', 'T62', 'TRUE', 1028, null, null, 1020, null, null); +INSERT INTO TERMINAL VALUES (1062, '1062', 'T63', 'TRUE', 1028, 1005, null, null, null, null); +INSERT INTO TERMINAL VALUES (1063, '1063', 'T64', 'TRUE', 1027, null, null, 1021, null, null); +INSERT INTO TERMINAL VALUES (1064, '1064', 'T65', 'TRUE', 1029, null, null, 1021, null, null); +INSERT INTO TERMINAL VALUES (1065, '1065', 'T66', 'TRUE', 1029, null, null, null, null, 1006); +INSERT INTO TERMINAL VALUES (1066, '1066', 'T67', 'TRUE', 1030, null, null, null, null, 1006); +INSERT INTO TERMINAL VALUES (1067, '1067', 'T68', 'TRUE', 1030, null, null, 1022, null, null); +INSERT INTO TERMINAL VALUES (1068, '1068', 'T69', 'TRUE', 1031, null, null, 1022, null, null); +INSERT INTO TERMINAL VALUES (1069, '1069', 'T70', 'TRUE', 1031, null, null, 1023, null, null); +INSERT INTO TERMINAL VALUES (1070, '1070', 'T71', 'TRUE', 1032, null, null, 1023, null, null); +INSERT INTO TERMINAL VALUES (1071, '1071', 'T72', 'TRUE', 1032, 1006, null, null, null, null); +INSERT INTO TERMINAL VALUES (1072, '1072', 'T73', 'TRUE', 1031, null, null, 1024, null, null); +INSERT INTO TERMINAL VALUES (1073, '1073', 'T74', 'TRUE', 1033, null, null, 1024, null, null); +INSERT INTO TERMINAL VALUES (1074, '1074', 'T75', 'TRUE', 1033, null, null, null, null, 1007); +INSERT INTO TERMINAL VALUES (1075, '1075', 'T76', 'TRUE', 1034, null, null, null, null, 1007); +INSERT INTO TERMINAL VALUES (1076, '1076', 'T77', 'TRUE', 1034, null, null, 1025, null, null); +INSERT INTO TERMINAL VALUES (1077, '1077', 'T78', 'TRUE', 1034, null, null, 1026, null, null); +INSERT INTO TERMINAL VALUES (1078, '1078', 'T79', 'TRUE', 1035, null, null, 1025, null, null); +INSERT INTO TERMINAL VALUES (1079, '1079', 'T80', 'TRUE', 1035, null, 1001, null, null, null); +INSERT INTO TERMINAL VALUES (1080, '1080', 'T81', 'TRUE', 1036, null, null, 1026, null, null); +INSERT INTO TERMINAL VALUES (1081, '1081', 'T82', 'TRUE', 1036, null, 1000, null, null, null); +INSERT INTO TERMINAL VALUES (1082, '1082', 'T83', 'TRUE', 1037, null, 1001, null, null, null); +INSERT INTO TERMINAL VALUES (1083, '1083', 'T84', 'TRUE', 1037, null, null, 1027, null, null); +INSERT INTO TERMINAL VALUES (1084, '1084', 'T85', 'TRUE', 1038, null, 1000, null, null, null); +INSERT INTO TERMINAL VALUES (1085, '1085', 'T86', 'TRUE', 1038, null, null, 1028, null, null); +INSERT INTO TERMINAL VALUES (1086, '1086', 'T87', 'TRUE', 1039, null, null, 1028, null, null); +INSERT INTO TERMINAL VALUES (1087, '1087', 'T88', 'TRUE', 1039, null, null, 1027, null, null); +INSERT INTO TERMINAL VALUES (1088, '1088', 'T89', 'TRUE', 1039, 1007, null, null, null, null); +INSERT INTO TERMINAL VALUES (1089, '1089', 'T90', 'TRUE', 1040, 1007, null, null, null, null); +INSERT INTO TERMINAL VALUES (1090, '1090', 'T91', 'TRUE', 1040, null, null, 1029, null, null); +INSERT INTO TERMINAL VALUES (1091, '1091', 'T92', 'TRUE', 1041, null, null, 1029, null, null); +INSERT INTO TERMINAL VALUES (1092, '1092', 'T93', 'TRUE', 1041, null, null, null, null, 1007); diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Activity.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Activity.java index 2bb94a83..757e8422 100644 --- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Activity.java +++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Activity.java @@ -137,12 +137,8 @@ public class Activity extends AbstractBaseEntitiy { // // nicht String sondern Referenz zu dem Netstate für den Zeitpunkt der Abregelung // // todo: welche Daten sollen da alle rein? // private String netstate; -// -// // Liste der abzregelnden Einspeiser mit Ist-Wert und Abschlatforschlag -// private List synchronousMachineList; -// -// private Boolean sendMailWithCommit; +// private Boolean sendMailWithCommit; public Long getId() { return id; diff --git a/openk-platform/openk-eisman-portlet/src/main/resources/flyway-migration/V01/_00/OPENK_EISMAN_V01_00_001__init.sql b/openk-platform/openk-eisman-portlet/src/main/resources/flyway-migration/V01/_00/OPENK_EISMAN_V01_00_001__init.sql index 940a9a4d..19e652b1 100644 --- a/openk-platform/openk-eisman-portlet/src/main/resources/flyway-migration/V01/_00/OPENK_EISMAN_V01_00_001__init.sql +++ b/openk-platform/openk-eisman-portlet/src/main/resources/flyway-migration/V01/_00/OPENK_EISMAN_V01_00_001__init.sql @@ -69,7 +69,7 @@ ALTER TABLE ACTIVITY OWNER TO eisman; CREATE TABLE EQUIPMENT_CONTAINER ( ID INTEGER NOT NULL, - MRID VARCHAR(16) NOT NULL, + MRID VARCHAR(16) NOT NULL UNIQUE , NAME VARCHAR(64), HIGH_VOLTAGE_LIMIT_VALUE NUMERIC, HIGH_VOLTAGE_LIMIT_UNIT_MULTIPLIER VARCHAR(12), @@ -89,7 +89,7 @@ ALTER TABLE EQUIPMENT_CONTAINER OWNER TO eisman; CREATE TABLE SUBGEOGRAPHICAL_REGION ( ID INTEGER NOT NULL, - MRID VARCHAR(16), + MRID VARCHAR(16) UNIQUE , NAME VARCHAR(64), ACTIVITY_ID INTEGER, -- GEOGRAPHICAL_REGION_ID INTEGER, @@ -120,7 +120,7 @@ CREATE TABLE SYNCHRONOUS_MACHINE ( ID INTEGER NOT NULL, MRID VARCHAR(16) NOT NULL, - NAME VARCHAR(64), + NAME VARCHAR(64) UNIQUE , NORMALLY_IN_SERVICE VARCHAR(5), SYNCHRONOUS_MACHINE_KIND VARCHAR(32), CURRENT_REDUCTION_SETTING_PER_CENT INTEGER, @@ -177,7 +177,7 @@ ALTER TABLE GENERATING_UNIT OWNER TO cachedb; CREATE TABLE MEASUREMENT_ANALOG ( ID INTEGER NOT NULL, - MRID VARCHAR(16), + MRID VARCHAR(16) UNIQUE , MEASUREMENT_TYPE VARCHAR(16), MEASUREMENT_UNIT_MULTIPLIER VARCHAR(12), MEASUREMENT_UNIT_SYMBOL VARCHAR(12), @@ -208,7 +208,7 @@ ALTER TABLE MEASUREMENT_ANALOG_VALUE OWNER TO eisman; CREATE TABLE PSR_EVENT ( ID INTEGER NOT NULL, - MRID VARCHAR(16), + MRID VARCHAR(16) UNIQUE , PSR_EVENT_KIND VARCHAR(16), TIMESTAMP_CREATED VARCHAR(30), SYNCHRONOUS_MACHINE_ID INTEGER, diff --git a/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/core/ACDCTerminal.java b/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/core/ACDCTerminal.java index fabcf11a..043170f9 100644 --- a/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/core/ACDCTerminal.java +++ b/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/core/ACDCTerminal.java @@ -34,7 +34,7 @@ public class ACDCTerminal extends IdentifiedObject { * should follow in increasing order. The first terminal is the "starting point" * for a two terminal branch. */ - public Integer sequenceNumber; +// public Integer sequenceNumber; public ACDCTerminal(){ diff --git a/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/core/Terminal.java b/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/core/Terminal.java index 0aca0a32..d063bf79 100644 --- a/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/core/Terminal.java +++ b/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/core/Terminal.java @@ -18,34 +18,18 @@ import org.eclipse.openk.model.cim.wires.RegulatingControl; */ public class Terminal extends ACDCTerminal { - /** - * The terminal connection status. True implies the terminal is connected, and - * false implies the terminal is not connected. This is the result of topoplogical - * processing of a detailed Connectivity node and Switch model whether present in - * the model or not. A terminal that is not connected cannot support a current - * flow. A terminal that is connected may have flow. In general a multi- - * terminal device may simultaneously have connected and disconnected terminals. - * No other aspect of the algorithm - */ - public Boolean connected; - /** - * The orientation of the terminal connections for a multiple terminal conducting - * equipment. The sequence numbering starts with 1 and additional terminals - * should follow in increasing order. The first terminal is the "starting point" - * for a two terminal branch. In the case of class TransformerWinding only one - * terminal is used so its sequenceNumber must be 1. - */ - public Integer sequenceNumber; /** * The conducting equipment of the terminal. Conducting equipment have terminals * that may be connected to other conducting equipment terminals via connectivity * nodes or topological nodes. */ // public ConductingEquipment ConductingEquipment; + /** * The controls regulating this terminal. */ // public RegulatingControl RegulatingControl; + /** * The connectivity node to which this terminal connects with zero impedance. */ @@ -56,6 +40,7 @@ public class Terminal extends ACDCTerminal { * If the attribute is missing three phases (ABC or ABCN) shall be assumed. */ // public PhaseCode phases; + public Terminal() { } diff --git a/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/meas/MeasurementValue.java b/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/meas/MeasurementValue.java index b117d9dc..92ce907e 100644 --- a/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/meas/MeasurementValue.java +++ b/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/meas/MeasurementValue.java @@ -37,7 +37,7 @@ public class MeasurementValue extends IdentifiedObject { /** * A MeasurementValue has a MeasurementValueQuality associated with it. */ -// public MeasurementValueQuality MeasurementValueQuality; + public MeasurementValueQuality MeasurementValueQuality; public MeasurementValue() { diff --git a/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/meas/MeasurementValueQuality.java b/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/meas/MeasurementValueQuality.java new file mode 100644 index 00000000..0ea4effe --- /dev/null +++ b/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/meas/MeasurementValueQuality.java @@ -0,0 +1,9 @@ +package org.eclipse.openk.model.cim.meas; + +/** + * Measurement quality flags. Bits 0-10 are defined for substation automation in + * draft IEC 61850 part 7-3. Bits 11-15 are reserved for future expansion by that + * document. Bits 16-31 are reserved for EMS applications. + */ +public class MeasurementValueQuality extends Quality61850 { +} diff --git a/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/meas/Quality61850.java b/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/meas/Quality61850.java new file mode 100644 index 00000000..598c70fe --- /dev/null +++ b/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/meas/Quality61850.java @@ -0,0 +1,84 @@ +package org.eclipse.openk.model.cim.meas; + +/** + * Quality flags in this class are as defined in IEC 61850, except for + * estimatorReplaced, which has been included in this class for convenience. + * @created 08-Mai-2015 23:56:42 + */ +public class Quality61850 { + + /** + * Measurement value may be incorrect due to a reference being out of calibration. + */ +// public Boolean badReference; + /** + * Value has been replaced by State Estimator. estimatorReplaced is not an + * IEC61850 quality bit but has been put in this class for convenience. + */ +// public Boolean estimatorReplaced; + /** + * This identifier indicates that a supervision function has detected an internal + * or external failure, e.g. communication failure. + */ + public Boolean failure; + /** + * Measurement value is old and possibly invalid, as it has not been successfully + * updated during a specified time interval. + */ +// public Boolean oldData; + /** + * Measurement value is blocked and hence unavailable for transmission. + */ +// public Boolean operatorBlocked; + /** + * To prevent some overload of the communication it is sensible to detect and + * suppress oscillating (fast changing) binary inputs. If a signal changes in a + * defined time (tosc) twice in the same direction (from 0 to 1 or from 1 to 0) + * then oscillation is detected and the detail quality identifier "oscillatory" is + * set. If it is detected a configured numbers of transient changes could be + * passed by. In this time the validity status "questionable" is set. If after + * this defined numbers of changes the signal is still in the oscillating state + * the value shall be set either to the opposite state of the previous stable + * value or to a defined default value. In this case the validity status + * "questionable" is reset and "invalid" is set as long as the signal is + * oscillating. If it is configured such that no transient changes should be + * passed by then the validity status "invalid" is set immediately in addition to + * the detail quality identifier "oscillatory" (used for status information only). + */ +// public Boolean oscillatory; + /** + * Measurement value is beyond a predefined range of value. + */ +// public Boolean outOfRange; + /** + * Measurement value is beyond the capability of being represented properly. For + * example, a counter value overflows from maximum count back to a value of zero. + */ +// public Boolean overFlow; + /** + * Source gives information related to the origin of a value. The value may be + * acquired from the process, defaulted or substituted. + */ +// public Source source; + /** + * A correlation function has detected that the value is not consitent with other + * values. Typically set by a network State Estimator. + */ +// public Boolean suspect; + /** + * Measurement value is transmitted for test purposes. + */ +// public Boolean test; + /** + * Validity of the measurement value. + */ +// public Validity validity; + + public Quality61850(){ + + } + + public void finalize() throws Throwable { + + } +}//end Quality61850 \ No newline at end of file diff --git a/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/wires/SynchronousMachine.java b/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/wires/SynchronousMachine.java index 939dd6e3..7143279c 100644 --- a/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/wires/SynchronousMachine.java +++ b/openk-platform/openk-interfaces/src/main/java/org/eclipse/openk/model/cim/wires/SynchronousMachine.java @@ -11,7 +11,9 @@ package org.eclipse.openk.model.cim.wires; import org.eclipse.openk.model.cim.domain.CommunicationType; +import org.eclipse.openk.model.cim.domain.PerCent; import org.eclipse.openk.model.cim.domain.ReductionSetting; +import org.eclipse.openk.model.cim.domain.Voltage; import java.util.List; @@ -28,6 +30,18 @@ public class SynchronousMachine extends RotatingMachine { */ // public Integer referencePriority; + /** + * Reduction setting which is currently set. + * CIM extension by Jan Krueger, April 2015 + */ + public PerCent currentReductionSetting; + + /** + * Status of the reduction setting which is currently set. + * CIM extension by Jan Krueger, May 2015 + */ + public PerCent statusCurrentReductionSetting; + /** * Modes that this synchronous machine can operate in. */ @@ -37,7 +51,7 @@ public class SynchronousMachine extends RotatingMachine { * All reduction settings of a Synchronous Machine, e.g. 30%, 60% and 100% * CIM extension by Jan Krueger, April 2015 */ - private List reductionSettingList; + public List reductionSettingList; /** * The feed-in ranking of a generator (SynchronousMachine) as @@ -46,31 +60,38 @@ public class SynchronousMachine extends RotatingMachine { * 31.10.2014 * CIM extension by Jan Krueger, April 2015 */ - private Integer feedInRanking; + public Integer feedInRanking; + + /** + * The feed-in priority of a generator (SynchronousMachine) + * 1 - high priority, ... 5 - low priority + * CIM extension by Jan Krueger, April 2015 + */ + public Integer feedInPriority; /** * Communication Type EFT, FWT, TRA * CIM extension by Jan Krueger, April 2015 */ - private CommunicationType communicationType; + public CommunicationType communicationType; /** * Communication Group * CIM extension by Jan Krueger, April 2015 */ - private Integer communicationGroup; + public Integer communicationGroup; /** * SynchronousMachine is referenced. * CIM extension by Jan Krueger, April 2015 */ - private Boolean parentSynchronousMachine; +// public Boolean parentSynchronousMachine; /** * Referenced SynchronousMachine * CIM extension by Jan Krueger, April 2015 */ - private SynchronousMachine referencedSynchronousMachine; + public SynchronousMachine referencedSynchronousMachine; /** * Time delay required when switching from Automatic Voltage Regulation (AVR) to @@ -125,7 +146,7 @@ public class SynchronousMachine extends RotatingMachine { /** * Maximum voltage limit for the unit. */ -// public Voltage maxU; + public Voltage maxU; /** * Minimum reactive power limit for the unit. */ diff --git a/openk-platform/pom.xml b/openk-platform/pom.xml index c6e906d0..f3c0a797 100644 --- a/openk-platform/pom.xml +++ b/openk-platform/pom.xml @@ -37,7 +37,7 @@ Fuer Entwicklung Theme unbedingt 6.2.1 verwenden. Fuer Entwicklung Portlet kann 6.1.1 verwendet werden. --> - 6.2.2 + 6.1.1 ${liferay.version} ${liferay.home} ${liferay.root.dir}/tomcat-7.0.42/webapps -- cgit v1.2.1