Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Krueger2015-05-06 03:45:39 -0400
committerJan Krueger2015-05-06 03:45:39 -0400
commit609e32eb6ae9987775fd4b3bef9bdda8254fe537 (patch)
treed36c1c83513a732d4dc9414b2642620268356d08
parent9497b147f44bc8815a0e69ccef2477ff1003f22d (diff)
downloadorg.eclipse.openk-platform.openk-repo-609e32eb6ae9987775fd4b3bef9bdda8254fe537.tar.gz
org.eclipse.openk-platform.openk-repo-609e32eb6ae9987775fd4b3bef9bdda8254fe537.tar.xz
org.eclipse.openk-platform.openk-repo-609e32eb6ae9987775fd4b3bef9bdda8254fe537.zip
develop feed-in management: initial setup
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/EditController.java46
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubGeographicalRegionRestController.java16
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubstationRestController.java7
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/AbsoluteDateTime.java10
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/AnalogValue.java3
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/Measurement.java26
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/repository/SubstationRepository.java2
-rw-r--r--openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/service/SubstationService.java8
-rw-r--r--openk-platform/openk-cachedb-service/src/main/resources/flyway-migration/V01/_00/OPENK_CACHEDB_V01_00_001__init.sql2
-rw-r--r--openk-platform/openk-cachedb-service/src/main/webapp/WEB-INF/portlet.xml3
-rw-r--r--openk-platform/openk-cachedb-service/src/main/webapp/jsp/configuration.jsp85
-rw-r--r--openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/adapter/rest/GeographicalRegionRestConsumerTest.java2
-rw-r--r--openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SubstationRepositoryTest.java43
-rw-r--r--openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SynchronousMachineRepositoryTest.java2
-rw-r--r--openk-platform/openk-cachedb-service/src/test/sql/cachedb-insert-data.sql18
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubGeographicalRegionRestConsumer.java6
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubstationRestConsumer.java17
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/ActivityRestController.java21
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/ElectronicAddress.java33
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/Location.java107
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/StreetAddress.java55
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/StreetDetail.java42
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/TownDetail.java40
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/EquipmentContainer.java18
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/SubGeographicalRegion.java40
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/CommunicationType.java37
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/PerCent.java35
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/ReductionSetting.java54
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/UnitMultiplier.java3
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/UnitSymbol.java6
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/informative/infoperations/PsrEvent.java64
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/informative/infoperations/PsrEventKind.java39
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/Analog.java105
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/AnalogValue.java60
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/Measurement.java87
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/MeasurementValue.java39
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Activity.java18
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Preselection.java6
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/wires/SynchronousMachine.java293
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/wires/SynchronousMachineKind.java37
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/service/SwitchOffAdviceService.java73
-rw-r--r--openk-platform/openk-eisman-portlet/src/main/resources/flyway-migration/V01/_00/OPENK_EISMAN_V01_00_001__init.sql115
-rw-r--r--openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/repository/ActivityRepositoryTest.java11
-rw-r--r--openk-platform/openk-eisman-portlet/src/test/sql/appdb-eisman-insert-data.sql3
-rw-r--r--openk-platform/openk-eisman-portlet/uml-diagram/appdb-eisman.uml34
-rw-r--r--openk-platform/pom.xml2
46 files changed, 1484 insertions, 289 deletions
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/EditController.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/EditController.java
new file mode 100644
index 00000000..22d6fae3
--- /dev/null
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/EditController.java
@@ -0,0 +1,46 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.controller;
+
+import com.liferay.portal.model.PortletPreferences;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.portlet.bind.annotation.ActionMapping;
+import org.springframework.web.portlet.bind.annotation.RenderMapping;
+
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletModeException;
+import javax.portlet.ReadOnlyException;
+import javax.portlet.ValidatorException;
+import java.io.IOException;
+
+@Controller(value = "editController")
+@RequestMapping(value = "EDIT")
+public class EditController {
+
+ @RenderMapping
+ public String render() { /*final Model model,
+ final PortletPreferences prefs) {*/
+ //model.addAttribute("attribute", prefs.getValue("prefVal", "default"));
+ return "configuration";
+ }
+
+ @ActionMapping(params = "action=action")
+ public void action(@RequestParam("param") final String param,
+ final PortletPreferences prefs,
+ final ActionResponse resp) throws ReadOnlyException, ValidatorException,
+ IOException, PortletModeException {
+ // do something
+ }
+}
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubGeographicalRegionRestController.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubGeographicalRegionRestController.java
index 88d38471..df064900 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubGeographicalRegionRestController.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubGeographicalRegionRestController.java
@@ -18,6 +18,7 @@ import org.apache.log4j.Logger;
import org.eclipse.openk.adapter.rest.GeographicalRegionRestConsumer;
import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json;
import org.eclipse.openk.model.core.SubGeographicalRegion;
+import org.eclipse.openk.model.core.Substation;
import org.eclipse.openk.repository.GeographicalRegionRepository;
import org.eclipse.openk.repository.SubGeographicalRegionRepository;
import org.springframework.beans.factory.annotation.Autowired;
@@ -25,6 +26,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
+import java.util.ArrayList;
import java.util.List;
@RestController
@@ -60,4 +62,18 @@ public class SubGeographicalRegionRestController {
return Lists.newArrayList(subGeographicalRegionRepository.findAll());
}
+ @RequestMapping(value = "/subgeographicalregion/substationlist", method = RequestMethod.GET)
+ public List<Substation> getSubstationListOfSubGeographicalRegionList(
+ final List<SubGeographicalRegion> subGeographicalRegionList) {
+
+ final List<Substation> substationList = new ArrayList<Substation>();
+
+ for (final SubGeographicalRegion subGeographicalRegion : subGeographicalRegionList) {
+ substationList.addAll(subGeographicalRegion.getSubstationList());
+ }
+
+ return substationList;
+ }
+
+
}
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubstationRestController.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubstationRestController.java
index 19341512..22233659 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubstationRestController.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/controller/rest/SubstationRestController.java
@@ -17,6 +17,7 @@ import com.google.common.collect.Lists;
import org.apache.log4j.Logger;
import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json;
import org.eclipse.openk.model.core.Substation;
+import org.eclipse.openk.model.wires.SynchronousMachine;
import org.eclipse.openk.repository.SubstationRepository;
import org.eclipse.openk.service.SubstationService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -79,4 +80,10 @@ public class SubstationRestController {
return substationService.getSubsationHoldingSynchronousMachine();
}
+ @RequestMapping(value = "/substation/mrid/{mRid}/synchronousmachinelist", method = RequestMethod.GET)
+ public List<SynchronousMachine> getSynchronousMachineListOfSubstation(@PathVariable(value = "mRid") final String mRid) {
+ return substationService.getSynchronousMachineListOfSubstation(mRid);
+ }
+
+
}
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/AbsoluteDateTime.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/AbsoluteDateTime.java
index 2963744e..faacf3ac 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/AbsoluteDateTime.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/domain/AbsoluteDateTime.java
@@ -12,10 +12,12 @@
*/
package org.eclipse.openk.model.domain;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonView;
import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json;
import javax.persistence.Embeddable;
+import java.sql.Timestamp;
/**
* Date and time as "yyyy-mm-ddThh:mm:ss.sss", which conforms with ISO 8601. UTC
@@ -30,13 +32,11 @@ public class AbsoluteDateTime {
/**
* String representation of date and time, refer to description of the class.
*/
- // todo: use date! no string!
@JsonView({IncludeAttribute4Json.NetworkState.class, IncludeAttribute4Json.SynchronousMachine.class})
- private String value;
+ @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd.MM.yyyy hh.mm.ss", timezone = "CET")
+ private Timestamp value;
- public String getValue() {
+ public Timestamp getValue() {
return value;
}
-
-
} \ No newline at end of file
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/AnalogValue.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/AnalogValue.java
index d8db3083..43b57f0f 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/AnalogValue.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/AnalogValue.java
@@ -56,7 +56,4 @@ public class AnalogValue extends MeasurementValue {
return value;
}
-// public void setValue(Float value) {
-// this.value = value;
-// }
} \ No newline at end of file
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/Measurement.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/Measurement.java
index bde518c3..c7fd71e7 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/Measurement.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/model/meas/Measurement.java
@@ -12,6 +12,8 @@
*/
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.core.IdentifiedObject;
import org.eclipse.openk.model.domain.UnitMultiplier;
import org.eclipse.openk.model.domain.UnitSymbol;
@@ -53,17 +55,22 @@ public class Measurement extends IdentifiedObject {
* Specifies the type of Measurement, e.g. IndoorTemperature, OutDoorTemperature,
* BusVoltage, GeneratorVoltage, LineFlow etc.
*/
+ @JsonView(IncludeAttribute4Json.NetworkState.class)
@Column(name = "MEASUREMENT_TYPE")
private String measurementType;
+
/**
* The unit multiplier of the measured quantity.
*/
+ @JsonView(IncludeAttribute4Json.NetworkState.class)
@Enumerated(EnumType.STRING)
@Column(name = "MEASUREMENT_UNIT_MULTIPLIER")
private UnitMultiplier unitMultiplier;
+
/**
* The unit of measure of the measured quantity.
*/
+ @JsonView(IncludeAttribute4Json.NetworkState.class)
@Enumerated(EnumType.STRING)
@Column(name = "MEASUREMENT_UNIT_SYMBOL")
private UnitSymbol unitSymbol;
@@ -72,31 +79,12 @@ public class Measurement extends IdentifiedObject {
return measurementType;
}
-// public void setMeasurementType(String measurementType) {
-// this.measurementType = measurementType;
-// }
-
public UnitMultiplier getUnitMultiplier() {
return unitMultiplier;
}
-// public void setUnitMultiplier(UnitMultiplier unitMultiplier) {
-// this.unitMultiplier = unitMultiplier;
-// }
-
public UnitSymbol getUnitSymbol() {
return unitSymbol;
}
-// public void setUnitSymbol(UnitSymbol unitSymbol) {
-// this.unitSymbol = unitSymbol;
-// }
-
- // public ViolationLimit ViolationLimits;
-// public Pnode Pnode;
- /**
- * One or more measurements may be associated with a terminal in the network
- */
-// public Terminal Terminal;
-
} \ No newline at end of file
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/repository/SubstationRepository.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/repository/SubstationRepository.java
index b0ed05d0..d6ebdf2b 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/repository/SubstationRepository.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/repository/SubstationRepository.java
@@ -29,4 +29,6 @@ public interface SubstationRepository extends PagingAndSortingRepository<Substat
+ " from Substation st join st.voltageLevelList vl"
+ " where vl.synchronousMachineList is not empty")
List<Substation> findAllSubstationsVoltageLevelHoldingSynchronousMachine();
+
+ Substation findSubstationByMRid(String mRid);
}
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/service/SubstationService.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/service/SubstationService.java
index 2cc0903b..599d846a 100644
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/service/SubstationService.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/service/SubstationService.java
@@ -13,6 +13,7 @@
package org.eclipse.openk.service;
import org.eclipse.openk.model.core.Substation;
+import org.eclipse.openk.model.wires.SynchronousMachine;
import org.eclipse.openk.repository.SubstationRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -33,5 +34,12 @@ public class SubstationService {
return substationList;
}
+ public List<SynchronousMachine> getSynchronousMachineListOfSubstation(final String mRid) {
+
+ final Substation substation = substationRepository.findSubstationByMRid(mRid);
+
+ return substation.getSynchronousMachineList();
+ }
+
}
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 2331769e..9dbd85ef 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
@@ -55,7 +55,7 @@ ALTER TABLE SUBGEOGRAPHICAL_REGION OWNER TO cachedb;
CREATE TABLE EQUIPMENT_CONTAINER
(
ID INTEGER NOT NULL,
- MRID VARCHAR(16),
+ MRID VARCHAR(16) NOT NULL ,
NAME VARCHAR(64),
HIGH_VOLTAGE_LIMIT_VALUE NUMERIC,
HIGH_VOLTAGE_LIMIT_UNIT_MULTIPLIER VARCHAR(12),
diff --git a/openk-platform/openk-cachedb-service/src/main/webapp/WEB-INF/portlet.xml b/openk-platform/openk-cachedb-service/src/main/webapp/WEB-INF/portlet.xml
index 2415e8b4..f9022962 100644
--- a/openk-platform/openk-cachedb-service/src/main/webapp/WEB-INF/portlet.xml
+++ b/openk-platform/openk-cachedb-service/src/main/webapp/WEB-INF/portlet.xml
@@ -2,15 +2,18 @@
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+
<portlet>
<portlet-name>cachedb</portlet-name>
<portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
+ <!--<portlet-mode>edit</portlet-mode>-->
</supports>
<portlet-info>
<title>CacheDB App</title>
</portlet-info>
</portlet>
+
</portlet-app> \ No newline at end of file
diff --git a/openk-platform/openk-cachedb-service/src/main/webapp/jsp/configuration.jsp b/openk-platform/openk-cachedb-service/src/main/webapp/jsp/configuration.jsp
new file mode 100644
index 00000000..ccdab6af
--- /dev/null
+++ b/openk-platform/openk-cachedb-service/src/main/webapp/jsp/configuration.jsp
@@ -0,0 +1,85 @@
+<!--
+/*******************************************************************************
+* 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
+*******************************************************************************/
+-->
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
+
+<portlet:defineObjects/>
+
+<div ng-app="app">
+ <b>Hello Controller Sample</b>
+ <div ng-controller="HelloCtrl">
+ Say hi via Controller to me: <input type="text" ng-model="name"><br>
+ Hello, {{name}}!
+ </div>
+
+ <b>Phone List Sample</b>
+ <div ng-controller="PhoneListCtrl">
+ Search: <input ng-model="query">
+ <ul>
+ <li ng-repeat="phone in phones | filter:query">
+ {{phone.name}}
+ <p>{{phone.snippet}}</p>
+ </li>
+ </ul>
+ </div>
+
+ <b>Text Area Sample</b>
+ <div ng-controller="TextAreaWithLimitCtrl">
+ <span ng-class="{'text-warning' : shouldWarn()}">Remaining: {{remaining()}}</span>
+ <div>
+ <textarea ng-model="message">{{message}}</textarea>
+ </div>
+ <div>
+ <button ng-click="send()" ng-disabled="!hasValidLength()">Send</button>
+ <button ng-click="clear()">Clear</button>
+ </div>
+ </div>
+
+ <b>World Population Sample</b>
+ <div ng-controller="WorldCtrl">
+ <ul>
+ <li ng-repeat="country in countries">
+ {{country.name}} has population of {{country.population}} millions,
+ {{worldsPercentage(country.population)}} % of the World's population
+ </li>
+ </ul>
+ World's population: {{population}} millions
+ </div>
+
+ <!-- siehe https://spring.io/guides/gs/consuming-rest-angularjs/ -->
+ <b>Spring Greeting REST Sample</b>
+ <div ng-controller="SpringGreetingRestCtrl">
+ <p>The ID is {{greeting.id}}</p>
+ <p>The content is {{greeting.content}}</p>
+ </div>
+
+ <b>Locale Greeting REST Sample</b>
+ <div ng-controller="LocalGreetingRestCtrl">
+ <p>The ID is {{greeting.id}}</p>
+ <p>The content is {{greeting.content}}</p>
+ </div>
+
+ <b>No Controller Sample</b>
+ <div ng-init="namefrominput = 'World'">
+ Say hello to: <input type="text" ng-model="namefrominput">
+ Hello, {{namefrominput}}!
+ </div>
+
+ <b>List Nomination via REST Sample</b>
+ <div ng-controller="NominationListCtrl">
+ <ul>
+ <li ng-repeat="nomination in nominations">
+ {{nomination.identification}} - {{nomination.version}}
+ </li>
+ </ul>
+ </div>
+</div>
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 4354a50b..5e2564c2 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
@@ -91,7 +91,7 @@ public class GeographicalRegionRestConsumerTest extends AbstractRepositoryJpaTes
Assert.assertEquals(getCountConnectivityNode(), Long.valueOf(19));
}
- // Test mit Measurement, allerdings sind in der Topology die Messdaten nicht enthalten
+ // Test mit Measurement, allerdings sollen in der Topology die Messdaten nicht enthalten sein todo: anpassen
@Test()
public void getAndSaveGeographicalRegionFromJsonFileWithMeasurement() throws IOException, URISyntaxException {
diff --git a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SubstationRepositoryTest.java b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SubstationRepositoryTest.java
index 073c616f..704b0b1d 100644
--- a/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SubstationRepositoryTest.java
+++ b/openk-platform/openk-cachedb-service/src/test/java/org/eclipse/openk/repository/SubstationRepositoryTest.java
@@ -14,15 +14,34 @@ import org.eclipse.openk.model.core.Substation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
import java.util.List;
public class SubstationRepositoryTest extends AbstractRepositoryJpaTest {
+ @PersistenceContext(unitName = "cacheDbEntityManagerFactory")
+ protected EntityManager entityManager;
+
@Autowired
private SubstationRepository substationRepository;
+ @BeforeMethod
+ private void prepare() {
+ insertData();
+ }
+
+ @AfterMethod
+ private void cleanup() {
+ deleteData();
+ }
+
@Test
public void findAllSubstation() {
List<Substation> substationList = (List<Substation>) substationRepository.findAll();
@@ -55,5 +74,29 @@ public class SubstationRepositoryTest extends AbstractRepositoryJpaTest {
substationList.size();
}
+ @Test
+ public void findSubstationsByMrid(){
+ Substation substation = substationRepository.findSubstationByMRid("778899");
+ Assert.assertTrue(substation.getId().equals(Long.valueOf(5557L)));
+ }
+
+ private void insertData() {
+ Query insertSubstation = entityManager.createNativeQuery(
+ "INSERT INTO EQUIPMENT_CONTAINER " +
+ "(ID, MRID, EQUIPMENT_CONTAINER_TYPE) " +
+ "VALUES (?1, ?2, ?3)");
+ insertSubstation.setParameter(1, 5557L);
+ insertSubstation.setParameter(2, "778899");
+ insertSubstation.setParameter(3, "SubstationType");
+ insertSubstation.executeUpdate();
+ }
+
+ private void deleteData() {
+ Query deleteSubstation = entityManager.createNativeQuery(
+ "DELETE FROM EQUIPMENT_CONTAINER WHERE ID = ?1");
+ deleteSubstation.setParameter(1, 5557L);
+ deleteSubstation.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 6e883fb5..db388fbf 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
@@ -78,6 +78,4 @@ public class SynchronousMachineRepositoryTest extends AbstractRepositoryJpaTest
deleteSynchronousMachine.executeUpdate();
}
-
-
}
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 e55d8b54..fb327485 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
@@ -2,7 +2,7 @@ INSERT INTO GEOGRAPHICAL_REGION VALUES (1000, '1000', 'Geamtes Netz Netzbetreibe
INSERT INTO SUBGEOGRAPHICAL_REGION VALUES (1000, '1000', 'Netzgebiet A', 1000);
-INSERT INTO EQUIPMENT_CONTAINER VALUES (1000, '236454466', 'Substation01 - Ortsnetzstation Stopfenheim',null,null,null, 'SubstationType', null, 1000);
+INSERT INTO EQUIPMENT_CONTAINER VALUES (1000, '7788', 'Substation01 - Ortsnetzstation Stopfenheim',null,null,null, 'SubstationType', null, 1000);
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);
@@ -53,29 +53,29 @@ 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,
- reference_synchronous_machine, communication_group, synchronous_machine_id)
+ communication_group, synchronous_machine_id)
VALUES (1000,'458899', 'SynchronousMachine01', 'GENERATOR' , 'EFT',
'TRUE', 1000, 1000, 1000, 14,
- 'TRUE', 1, null);
+ 1, 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,
- reference_synchronous_machine, communication_group, synchronous_machine_id)
+ communication_group, synchronous_machine_id)
VALUES (1001, '2000', 'SynchronousMachine02', 'GENERATOR', 'EFT',
'TRUE', 1001, 1001, 1000, 15,
- 'FALSE', 1, 1000);
+ 1, 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,
- reference_synchronous_machine, communication_group, synchronous_machine_id)
+ communication_group, synchronous_machine_id)
VALUES (1002, '1002', 'SynchronousMachine03', 'GENERATOR', 'EFT',
'TRUE', 1002, 1002, 1002, 15,
- 'FALSE', 1, 1000);
+ 1, 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,
- reference_synchronous_machine, communication_group, synchronous_machine_id)
+ communication_group, synchronous_machine_id)
VALUES (1003, '1002', 'SynchronousMachine99', 'GENERATOR', 'EFT',
'TRUE', 1002, 1002, 1011, 15,
- 'FALSE', 1, 1000);
+ 1, 1000);
INSERT INTO REDUCTION_SETTING VALUES (1000, 10, 1000);
INSERT INTO REDUCTION_SETTING VALUES (1001, 20, 1000);
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubGeographicalRegionRestConsumer.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubGeographicalRegionRestConsumer.java
index 126b441c..593bd849 100644
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubGeographicalRegionRestConsumer.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubGeographicalRegionRestConsumer.java
@@ -14,6 +14,7 @@ package org.eclipse.openk.eisman.adapter.rest;
import com.liferay.portal.kernel.util.PropsUtil;
import org.eclipse.openk.eisman.model.core.SubGeographicalRegion;
+import org.eclipse.openk.eisman.model.core.Substation;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
@@ -36,4 +37,9 @@ public class SubGeographicalRegionRestConsumer {
return Arrays.asList(restTemplate.getForObject(uri, SubGeographicalRegion[].class));
}
+ public List<Substation> getSubstationListOfSubGeographicalRegionList() {
+ final String uri = PropsUtil.get("esb.url.base") + PropsUtil.get("esb.rest.uri.subgeographicalregion.substationlist");
+ return Arrays.asList(restTemplate.getForObject(uri, Substation[].class));
+ }
+
}
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubstationRestConsumer.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubstationRestConsumer.java
index 0be33b23..1f456402 100644
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubstationRestConsumer.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/adapter/rest/SubstationRestConsumer.java
@@ -14,6 +14,7 @@ package org.eclipse.openk.eisman.adapter.rest;
import com.liferay.portal.kernel.util.PropsUtil;
import org.eclipse.openk.eisman.model.core.Substation;
+import org.eclipse.openk.eisman.model.wires.SynchronousMachine;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
@@ -36,4 +37,20 @@ public class SubstationRestConsumer {
return Arrays.asList(restTemplate.getForObject(uri, Substation[].class));
}
+ // todo: ist diese Methode hier korrekt?
+ public List<SynchronousMachine> getSynchronousMachineListOfSubstation(final String mRid) {
+
+// final SynchronousMachine synchronousMachine =
+// restTemplate.getForObject("http://localhost:8080/openk-cachedb-service/rest/synchronousmachine/1000", SynchronousMachine.class);
+// String name = synchronousMachine.getName();
+
+ final String uri = PropsUtil.get("esb.url.base")
+ + PropsUtil.get("esb.rest.uri.substation.mrid")
+ + "/" + mRid
+ + PropsUtil.get("esb.rest.substationlist");
+ //+ synchronousMachine.getName();
+ return Arrays.asList(restTemplate.getForObject(uri, SynchronousMachine[].class));
+ }
+
+
}
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/ActivityRestController.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/ActivityRestController.java
index 315b2fad..28771761 100644
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/ActivityRestController.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/controller/rest/ActivityRestController.java
@@ -19,6 +19,7 @@ import org.eclipse.openk.eisman.controller.rest.config.IncludeAttribute4Json;
import org.eclipse.openk.eisman.controller.util.JpaUtils;
import org.eclipse.openk.eisman.model.process.Activity;
import org.eclipse.openk.eisman.repository.ActivityRepository;
+import org.eclipse.openk.eisman.service.SwitchOffAdviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@@ -52,6 +53,9 @@ public class ActivityRestController {
@Autowired
private ActivityRepository activityRepository;
+ @Autowired
+ private SwitchOffAdviceService switchOffAdviceService;
+
@RequestMapping(value = "/activity", method = RequestMethod.GET)
public List<Activity> findAllActivity() {
LOG.info("calling REST - find all Activity");
@@ -61,8 +65,8 @@ public class ActivityRestController {
@RequestMapping(value = "/findDetailActivities", method = RequestMethod.GET)
public Page<Activity> findDetailActivities(final Pageable pageable,
- @RequestParam(required = true) final String activityId,
- @RequestParam(required = false) final String filter) {
+ @RequestParam(required = true) final String activityId,
+ @RequestParam(required = false) final String filter) {
LOG.info("calling REST - find Details for Activities");
Specification<Activity> specification = null;
@@ -135,8 +139,17 @@ public class ActivityRestController {
return activityRepository.save(activity);
}
+ @RequestMapping(value = "/activity/{id}/calculateswitchoffadvice", method = RequestMethod.PUT)
+ public Activity calculateSwitchOffAdvice(@RequestBody final Activity activity) {
+
+ LOG.info("Calculate Switch-Off Advice for Activity: " + activity.getId());
+
+ switchOffAdviceService.calculateAdvice(activity);
+
+ return activity;
+ }
+
/**
- *
* @param specification
* @param filterValues
* @return
@@ -189,4 +202,6 @@ public class ActivityRestController {
return spec;
}
+
+
}
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/ElectronicAddress.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/ElectronicAddress.java
new file mode 100644
index 00000000..aac4ae9e
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/ElectronicAddress.java
@@ -0,0 +1,33 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.common;
+
+import javax.persistence.Embeddable;
+
+/**
+ * Electronic address information.
+ */
+@Embeddable
+public class ElectronicAddress {
+
+ /**
+ * Email address.
+ */
+// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ private String email;
+
+ public String getEmail() {
+ return email;
+ }
+
+} \ No newline at end of file
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/Location.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/Location.java
new file mode 100644
index 00000000..19101050
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/Location.java
@@ -0,0 +1,107 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.common;
+
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import javax.persistence.Access;
+import javax.persistence.AccessType;
+import javax.persistence.AttributeOverride;
+import javax.persistence.AttributeOverrides;
+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;
+
+/**
+ * The place, scene, or point of something where someone or something has been, is,
+ * and/or will be at a given moment in time. It may be:
+ * - Spatial location of an actual or planned structure, or a set of point-
+ * oriented structures (as a substation, structure, building, town, etc.) or
+ * diagram objects, which may be defined as a point or polygon, or,
+ * - Path of an underground or overhead conductor, or a linear diagram object.
+ */
+@Entity
+@Table(name = "LOCATION")
+@Access(AccessType.FIELD)
+public class Location { // extends IdentifiedObject {
+
+ @JsonIgnore
+ @Id
+ @TableGenerator(name = "LocationTableGen",
+ table = "OPENK_CACHEDB_SEQ_TABLE",
+ pkColumnName = "SEQ_NAME",
+ valueColumnName = "SEQ_COUNT",
+ pkColumnValue = "LOCATION_SEQ")
+ @GeneratedValue(strategy = GenerationType.TABLE, generator = "LocationTableGen")
+ @Column(name = "ID")
+ private Long id;
+
+ // @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ @Column(name = "NAME")
+ private String name;
+
+ /**
+ * Electronic address.
+ */
+// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ @Embedded
+ @AttributeOverrides({
+ @AttributeOverride(name = "email", column = @Column(name = "EMAIL"))
+ })
+ private ElectronicAddress electronicAddress;
+
+ /**
+ * Main address of the location.
+ */
+// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ @Embedded
+ @AttributeOverrides({
+ @AttributeOverride(name = "postalCode", column = @Column(name = "POSTAL_CODE")),
+ @AttributeOverride(name = "streetDetail.name", column = @Column(name = "STREET_NAME")),
+ @AttributeOverride(name = "streetDetail.number", column = @Column(name = "STREET_NUMBER")),
+ @AttributeOverride(name = "townDetail.name", column = @Column(name = "CITY")),
+ @AttributeOverride(name = "townDetail.country", column = @Column(name = "COUNTRY"))
+ })
+ private StreetAddress mainAddress;
+
+ /**
+ * Sequence of position points describing this location, expressed in coordinate
+ * system 'Location.CoordinateSystem'.
+ */
+// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+// @OneToMany(targetEntity = PositionPoint.class, cascade = CascadeType.PERSIST)
+// @JoinColumn(name = "LOCATION_ID")
+// private List<PositionPoint> positionPointList;
+ public StreetAddress getMainAddress() {
+ return mainAddress;
+ }
+
+ public ElectronicAddress getElectronicAddress() {
+ return electronicAddress;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+
+} \ No newline at end of file
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/StreetAddress.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/StreetAddress.java
new file mode 100644
index 00000000..fb9e8fd9
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/StreetAddress.java
@@ -0,0 +1,55 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.common;
+
+import javax.persistence.Embeddable;
+
+/**
+ * General purpose street address information.
+ */
+@Embeddable
+public class StreetAddress {
+
+ /**
+ * Street detail.
+ */
+// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ private StreetDetail streetDetail;
+
+ /**
+ * Postal code for the address.
+ * (Postleitzahl)
+ */
+// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ private String postalCode;
+
+ /**
+ * Town detail.
+ */
+// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ private TownDetail townDetail;
+
+ public StreetDetail getStreetDetail() {
+ return streetDetail;
+ }
+
+ public String getPostalCode() {
+ return postalCode;
+ }
+
+ public TownDetail getTownDetail() {
+ return townDetail;
+ }
+
+
+} \ No newline at end of file
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/StreetDetail.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/StreetDetail.java
new file mode 100644
index 00000000..1ab4eeb0
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/StreetDetail.java
@@ -0,0 +1,42 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.common;
+
+import javax.persistence.Embeddable;
+
+/**
+ * Street details, in the context of address.
+ */
+@Embeddable
+public class StreetDetail {
+
+ /**
+ * Name of the street.
+ */
+// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ private String name;
+ /**
+ * Designator of the specific location on the street.
+ */
+// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ private String number;
+
+ public String getName() {
+ return name;
+ }
+
+ public String getNumber() {
+ return number;
+ }
+
+} \ No newline at end of file
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/TownDetail.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/TownDetail.java
new file mode 100644
index 00000000..a2781105
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/common/TownDetail.java
@@ -0,0 +1,40 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.common;
+
+import javax.persistence.Embeddable;
+
+/**
+ * Town details, in the context of address.
+ */
+@Embeddable
+public class TownDetail {
+ /**
+ * Name of the country.
+ */
+// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ private String country;
+ /**
+ * Town name.
+ */
+// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ private String name;
+
+ public String getCountry() {
+ return country;
+ }
+
+ public String getName() {
+ return name;
+ }
+} \ No newline at end of file
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/EquipmentContainer.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/EquipmentContainer.java
index 87fb154b..79fc5ad7 100644
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/EquipmentContainer.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/EquipmentContainer.java
@@ -14,9 +14,11 @@ package org.eclipse.openk.eisman.model.core;
import com.fasterxml.jackson.annotation.JsonView;
import org.eclipse.openk.eisman.controller.rest.config.IncludeAttribute4Json;
+import org.eclipse.openk.eisman.model.wires.SynchronousMachine;
import javax.persistence.Access;
import javax.persistence.AccessType;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.Entity;
@@ -24,8 +26,11 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
+import java.util.List;
/**
* A modeling construct to provide a root class for containing equipment.
@@ -56,9 +61,9 @@ public class EquipmentContainer {
private String name;
// @JsonView({IncludeAttribute4Json.Topology.class, IncludeAttribute4Json.NetworkState.class})
-// @OneToMany(targetEntity = SynchronousMachine.class, cascade = CascadeType.PERSIST)
-// @JoinColumn(name = "EQUIPMENT_CONTAINER_ID")
-// private List<SynchronousMachine> synchronousMachineList;
+ @OneToMany(targetEntity = SynchronousMachine.class, cascade = CascadeType.PERSIST)
+ @JoinColumn(name = "EQUIPMENT_CONTAINER_ID")
+ private List<SynchronousMachine> synchronousMachineList;
public Long getId() {
return id;
@@ -72,4 +77,11 @@ public class EquipmentContainer {
return name;
}
+ public List<SynchronousMachine> getSynchronousMachineList() {
+ return synchronousMachineList;
+ }
+
+ public void setSynchronousMachineList(final List<SynchronousMachine> synchronousMachineList) {
+ this.synchronousMachineList = synchronousMachineList;
+ }
}
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/SubGeographicalRegion.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/SubGeographicalRegion.java
index fee394b5..3e9b9761 100644
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/SubGeographicalRegion.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/core/SubGeographicalRegion.java
@@ -11,58 +11,50 @@
* *****************************************************************************
*/
package org.eclipse.openk.eisman.model.core;
-/*
+
import com.fasterxml.jackson.annotation.JsonView;
-import org.eclipse.openk.controller.rest.config.IncludeAttribute4Json;
+import org.eclipse.openk.eisman.controller.rest.config.IncludeAttribute4Json;
import javax.persistence.Access;
import javax.persistence.AccessType;
-import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
-import java.util.List;
-*/
-
-import com.fasterxml.jackson.annotation.JsonView;
-import org.eclipse.openk.eisman.controller.rest.config.IncludeAttribute4Json;
/**
* A subset of a geographical region of a power system network model.
* <p/>
* Netzgebiet
*/
-//@Entity
-//@Table(name = "SUBGEOGRAPHICAL_REGION")
-//@Access(AccessType.FIELD)
+@Entity
+@Table(name = "SUBGEOGRAPHICAL_REGION")
+@Access(AccessType.FIELD)
public class SubGeographicalRegion {// extends IdentifiedObject {
@JsonView(IncludeAttribute4Json.SubGeographicalRegion.class)
-// @Id
-// @TableGenerator(name = "SubGeographicalRegionTableGen",
-// table = "OPENK_CACHEDB_SEQ_TABLE",
-// pkColumnName = "SEQ_NAME",
-// valueColumnName = "SEQ_COUNT",
-// pkColumnValue = "SUBGEOGRAPHICAL_REGION_SEQ")
-// @GeneratedValue(strategy = GenerationType.TABLE, generator = "SubGeographicalRegionTableGen")
-// @Column(name = "ID")
+ @Id
+ @TableGenerator(name = "SubGeographicalRegionTableGen",
+ table = "OPENK_CACHEDB_SEQ_TABLE",
+ pkColumnName = "SEQ_NAME",
+ valueColumnName = "SEQ_COUNT",
+ pkColumnValue = "SUBGEOGRAPHICAL_REGION_SEQ")
+ @GeneratedValue(strategy = GenerationType.TABLE, generator = "SubGeographicalRegionTableGen")
+ @Column(name = "ID")
private Long id;
// @JsonView({IncludeAttribute4Json.Topology.class, IncludeAttribute4Json.NetworkState.class})
-// @Column(name = "MRID")
+ @Column(name = "MRID")
private String mRid;
// @JsonView({IncludeAttribute4Json.Topology.class,
// IncludeAttribute4Json.NetworkState.class,
// IncludeAttribute4Json.SubGeographicalRegion.class})
-// @Column(name = "NAME")
- @JsonView(IncludeAttribute4Json.SubGeographicalRegion.class)
+// @JsonView(IncludeAttribute4Json.SubGeographicalRegion.class)
+ @Column(name = "NAME")
private String name;
// @JsonView({IncludeAttribute4Json.Topology.class, IncludeAttribute4Json.NetworkState.class})
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/CommunicationType.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/CommunicationType.java
new file mode 100644
index 00000000..ba2ab652
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/CommunicationType.java
@@ -0,0 +1,37 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.domain;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+/**
+ * Communication Type EFT, FWT, TRA
+ * CIM extension by Jan Krueger, April 2015
+ */
+public enum CommunicationType {
+ EFT("EFT"),
+ FWT("FWT"),
+ TRA("TRA");
+
+ private final String value;
+
+ private CommunicationType(final String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String value() {
+ return this.value;
+ }
+
+}
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/PerCent.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/PerCent.java
new file mode 100644
index 00000000..658dce69
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/PerCent.java
@@ -0,0 +1,35 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.domain;
+
+import javax.persistence.Embeddable;
+
+/**
+ * Normally 0 - 100 on a defined base
+ */
+@Embeddable
+public class PerCent {
+
+ private static final UnitMultiplier MULTIPLIER = UnitMultiplier.NONE;
+ private static final UnitSymbol UNIT = UnitSymbol.NONE;
+ /**
+ * Normally 0 - 100 on a defined base
+ */
+// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ private Integer value;
+
+ public Integer getValue() {
+ return value;
+ }
+
+} \ No newline at end of file
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/ReductionSetting.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/ReductionSetting.java
new file mode 100644
index 00000000..569d3849
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/ReductionSetting.java
@@ -0,0 +1,54 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.domain;
+
+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;
+
+/**
+ * A Reduction Setting of a SynchronousMachine.
+ * CIM extension by Jan Krueger, April 2015
+ */
+@Entity
+@Table(name = "REDUCTION_SETTING")
+@Access(AccessType.FIELD)
+public class ReductionSetting {
+
+ @Id
+ @TableGenerator(name = "ReductionSettingTableGen",
+ table = "OPENK_CACHEDB_SEQ_TABLE",
+ pkColumnName = "SEQ_NAME",
+ valueColumnName = "SEQ_COUNT",
+ pkColumnValue = "REDUCTION_SETTING_SEQ")
+ @GeneratedValue(strategy = GenerationType.TABLE, generator = "ReductionSettingTableGen")
+ @Column(name = "ID")
+ private Long id;
+
+ // @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ @Embedded
+ @AttributeOverride(name = "value", column = @Column(name = "REDUCTION_SETTING_PER_CENT"))
+ private PerCent setting;
+
+ public PerCent getSetting() {
+ return setting;
+ }
+}
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/UnitMultiplier.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/UnitMultiplier.java
index 69b9f96b..d1d64f5f 100644
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/UnitMultiplier.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/UnitMultiplier.java
@@ -26,7 +26,8 @@ public enum UnitMultiplier {
/**
* Mega 10**6
*/
- MEGA("M");
+ MEGA("M"),
+ NONE("none");;
private final String value;
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/UnitSymbol.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/UnitSymbol.java
index c8988319..9981adde 100644
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/UnitSymbol.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/domain/UnitSymbol.java
@@ -26,7 +26,11 @@ public enum UnitSymbol {
/**
* Active power in watt
*/
- W("W");
+ W("W"),
+ /**
+ * Dimension less quantity, e.g. count, per unit, etc.
+ */
+ NONE("none");
private final String value;
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/informative/infoperations/PsrEvent.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/informative/infoperations/PsrEvent.java
new file mode 100644
index 00000000..29ee89a4
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/informative/infoperations/PsrEvent.java
@@ -0,0 +1,64 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.informative.infoperations;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import javax.persistence.Access;
+import javax.persistence.AccessType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+import java.sql.Timestamp;
+
+/**
+ * Event recording the change in operational status of a PowerSystemResource.
+ */
+@Entity
+@Table(name = "PSR_EVENT")
+@Access(AccessType.FIELD)
+public class PsrEvent { // extends ActivityRecord {
+
+ @JsonIgnore
+ @Id
+ @TableGenerator(name = "PsrEventTableGen",
+ table = "OPENK_CACHEDB_SEQ_TABLE",
+ pkColumnName = "SEQ_NAME",
+ valueColumnName = "SEQ_COUNT",
+ pkColumnValue = "PSR_EVENT_SEQ")
+ @GeneratedValue(strategy = GenerationType.TABLE, generator = "PsrEventTableGen")
+ @Column(name = "ID")
+ private Long id;
+
+ /**
+ * Kind of event.
+ */
+// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ @Enumerated(EnumType.STRING)
+ @Column(name = "PSR_EVENT_KIND")
+ public PsrEventKind psrEventKind;
+
+ @Column(name = "TIMESTAMP_CREATED")
+ private Timestamp createdDateTime;
+
+ public PsrEventKind getPsrEventKind() {
+ return psrEventKind;
+ }
+
+} \ No newline at end of file
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/informative/infoperations/PsrEventKind.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/informative/infoperations/PsrEventKind.java
new file mode 100644
index 00000000..8e84cec3
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/informative/infoperations/PsrEventKind.java
@@ -0,0 +1,39 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.informative.infoperations;
+
+/**
+ * Kind of power system resource event.
+ */
+public enum PsrEventKind {
+ IN_SERVICE("inService"),
+ OUT_OF_SERVICE("outOfService"),
+ PENDING_ADD("pendingAdd"),
+ PENDING_REMOVE("pendingRemove"),
+ PENDING_REPLACE("pendingReplace"),
+ OTHER("other"),
+ UNKNOWN("unknown");
+
+ // @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ private final String value;
+
+ private PsrEventKind(final String value) {
+ this.value = value;
+ }
+
+ // @JsonValue
+ public String value() {
+ return this.value;
+ }
+
+} \ No newline at end of file
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/Analog.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/Analog.java
new file mode 100644
index 00000000..b9722af1
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/Analog.java
@@ -0,0 +1,105 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.meas;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import javax.persistence.Access;
+import javax.persistence.AccessType;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+import java.util.List;
+
+/**
+ * Analog represents an analog Measurement.
+ */
+@Entity
+@Table(name = "MEASUREMENT_ANALOG")
+@Access(AccessType.FIELD)
+public class Analog extends Measurement {
+
+ @JsonIgnore
+ @Id
+ @TableGenerator(name = "AnalogTableGen",
+ table = "OPENK_CACHEDB_SEQ_TABLE",
+ pkColumnName = "SEQ_NAME",
+ valueColumnName = "SEQ_COUNT",
+ pkColumnValue = "MEASUREMENT_ANALOG_SEQ")
+ @GeneratedValue(strategy = GenerationType.TABLE, generator = "AnalogTableGen")
+ @Column(name = "ID")
+ private Long id;
+
+ // @JsonView(IncludeAttribute4Json.NetworkState.class)
+ @Column(name = "MRID")
+ private String mRid;
+
+ /**
+ * Normal value range maximum for any of the MeasurementValue.values. Used for
+ * scaling, e.g. in bar graphs or of telemetered raw values.
+ */
+// @JsonView(IncludeAttribute4Json.NetworkState.class)
+ @Column(name = "MAX_VALUE")
+ private Float maxValue;
+
+ /**
+ * Normal value range minimum for any of the MeasurementValue.values. Used for
+ * scaling, e.g. in bar graphs or of telemetered raw values
+ */
+// @JsonView(IncludeAttribute4Json.NetworkState.class)
+ @Column(name = "MIN_VALUE")
+ private Float minValue;
+
+ /**
+ * Normal measurement value, e.g., used for percentage calculations.
+ */
+// @JsonView(IncludeAttribute4Json.NetworkState.class)
+ @Column(name = "NORMAL_VALUE")
+ private Float normalValue;
+
+ /**
+ * The values connected to this measurement.
+ */
+// @JsonView(IncludeAttribute4Json.NetworkState.class)
+ @OneToMany(targetEntity = AnalogValue.class, cascade = CascadeType.PERSIST)
+ @JoinColumn(name = "MEASUREMENT_ANALOG_ID")
+ private List<AnalogValue> analogValueList;
+
+ public String getmRid() {
+ return mRid;
+ }
+
+ public Float getMaxValue() {
+ return maxValue;
+ }
+
+ public Float getMinValue() {
+ return minValue;
+ }
+
+ public Float getNormalValue() {
+ return normalValue;
+ }
+
+ public List<AnalogValue> getAnalogValueList() {
+ return analogValueList;
+ }
+
+} \ No newline at end of file
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/AnalogValue.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/AnalogValue.java
new file mode 100644
index 00000000..c3a2c91f
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/AnalogValue.java
@@ -0,0 +1,60 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.meas;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import javax.persistence.Access;
+import javax.persistence.AccessType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+
+/**
+ * AnalogValue represents an analog MeasurementValue.
+ */
+@Entity
+@Table(name = "MEASUREMENT_ANALOG_VALUE")
+@Access(AccessType.FIELD)
+public class AnalogValue extends MeasurementValue {
+
+ @JsonIgnore
+ @Id
+ @TableGenerator(name = "AnalogValueTableGen",
+ table = "OPENK_CACHEDB_SEQ_TABLE",
+ pkColumnName = "SEQ_NAME",
+ valueColumnName = "SEQ_COUNT",
+ pkColumnValue = "MEASUREMENT_ANALOG_VALUE_SEQ")
+ @GeneratedValue(strategy = GenerationType.TABLE, generator = "AnalogValueTableGen")
+ @Column(name = "ID")
+ private Long id;
+
+ /**
+ * The value to supervise.
+ */
+// @JsonView(IncludeAttribute4Json.NetworkState.class)
+ @Column(name = "VALUE")
+ private Float value;
+
+ public Float getValue() {
+ return value;
+ }
+
+// public void setValue(Float value) {
+// this.value = value;
+// }
+} \ No newline at end of file
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/Measurement.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/Measurement.java
new file mode 100644
index 00000000..82d9781f
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/Measurement.java
@@ -0,0 +1,87 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.meas;
+
+import org.eclipse.openk.eisman.model.domain.UnitMultiplier;
+import org.eclipse.openk.eisman.model.domain.UnitSymbol;
+
+import javax.persistence.Column;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.MappedSuperclass;
+
+/**
+ * A Measurement represents any measured, calculated or non-measured non-
+ * calculated quantity. Any piece of equipment may contain Measurements, e.g. a
+ * substation may have temperature measurements and door open indications, a
+ * transformer may have oil temperature and tank pressure measurements, a bay may
+ * contain a number of power flow measurements and a Breaker may contain a switch
+ * status measurement.
+ * The PSR - Measurement association is intended to capture this use of
+ * Measurement and is included in the naming hierarchy based on EquipmentContainer.
+ * The naming hierarchy typically has Measurements as leafs, e.g. Substation-
+ * VoltageLevel-Bay-Switch-Measurement.
+ * Some Measurements represent quantities related to a particular sensor location
+ * in the network, e.g. a voltage transformer (PT) at a busbar or a current
+ * transformer (CT) at the bar between a breaker and an isolator. The sensing
+ * position is not captured in the PSR - Measurement association. Instead it is
+ * captured by the Measurement - Terminal association that is used to define the
+ * sensing location in the network topology. The location is defined by the
+ * connection of the Terminal to ConductingEquipment.
+ * Two possible paths exist:
+ * 1) Measurement-Terminal- ConnectivityNode-Terminal-ConductingEquipment
+ * 2) Measurement-Terminal-ConductingEquipment
+ * Alternative 2 is the only allowed use.
+ * When the sensor location is needed both Measurement-PSR and Measurement-
+ * Terminal are used. The Measurement-Terminal association is never used alone.
+ */
+@MappedSuperclass
+public class Measurement { // extends IdentifiedObject {
+
+ /**
+ * Specifies the type of Measurement, e.g. IndoorTemperature, OutDoorTemperature,
+ * BusVoltage, GeneratorVoltage, LineFlow etc.
+ */
+// @JsonView(IncludeAttribute4Json.NetworkState.class)
+ @Column(name = "MEASUREMENT_TYPE")
+ private String measurementType;
+
+ /**
+ * The unit multiplier of the measured quantity.
+ */
+// @JsonView(IncludeAttribute4Json.NetworkState.class)
+ @Enumerated(EnumType.STRING)
+ @Column(name = "MEASUREMENT_UNIT_MULTIPLIER")
+ private UnitMultiplier unitMultiplier;
+
+ /**
+ * The unit of measure of the measured quantity.
+ */
+// @JsonView(IncludeAttribute4Json.NetworkState.class)
+ @Enumerated(EnumType.STRING)
+ @Column(name = "MEASUREMENT_UNIT_SYMBOL")
+ private UnitSymbol unitSymbol;
+
+ public String getMeasurementType() {
+ return measurementType;
+ }
+
+ public UnitMultiplier getUnitMultiplier() {
+ return unitMultiplier;
+ }
+
+ public UnitSymbol getUnitSymbol() {
+ return unitSymbol;
+ }
+
+} \ No newline at end of file
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/MeasurementValue.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/MeasurementValue.java
new file mode 100644
index 00000000..fd75b314
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/meas/MeasurementValue.java
@@ -0,0 +1,39 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.meas;
+
+import javax.persistence.Column;
+import javax.persistence.MappedSuperclass;
+import java.sql.Timestamp;
+
+/**
+ * The current state for a measurement. A state value is an instance of a
+ * measurement from a specific source. Measurements can be associated with many
+ * state values, each representing a different source for the measurement.
+ */
+@MappedSuperclass
+public class MeasurementValue { // extends IdentifiedObject {
+
+ /**
+ * The time when the value was last updated
+ */
+// @JsonView(IncludeAttribute4Json.NetworkState.class)
+// @Embedded
+ @Column(name = "TIMESTAMP_VALUE")
+ private Timestamp timeStamp;
+
+// public AbsoluteDateTime getTimeStamp() {
+// return timeStamp;
+// }
+
+} \ No newline at end of file
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 da8d2fe4..196350fe 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
@@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonView;
import org.eclipse.openk.eisman.controller.rest.config.IncludeAttribute4Json;
import org.eclipse.openk.eisman.model.AbstractBaseEntitiy;
+import org.eclipse.openk.eisman.model.core.SubGeographicalRegion;
import org.eclipse.openk.eisman.model.core.Substation;
import org.eclipse.openk.eisman.model.domain.Power;
import org.eclipse.openk.eisman.model.utils.converter.Boolean2StringConverter;
@@ -82,23 +83,20 @@ public class Activity extends AbstractBaseEntitiy {
})
private Power powerToBeReduced;
- // nicht String sondern enum!
+ // todo: nicht String sondern enum!
// Tabelle oder Porpety-Datei
@JsonView(IncludeAttribute4Json.ParentActivity.class)
@Column(name = "REASON_REDUCTION")
private String reasonOfReduction;
- // nicht String, der Datentyp ist noch mit dem CIM-Modell zu bestimmen. -> Liste der einbezogenen Speisepunkte
- // es kann ein Netzgebit oder ein Einspeisepunkt ausgewählt werden. Einer oder mehrere?
- // kann nur eine Einspeisepunkt oder mehrere ausgewählt werden
- //private List<String> bundledGeneratorUnits;
-// private String substation;
-// private String subGeographicalRegion;
+ @OneToMany(targetEntity = SubGeographicalRegion.class, cascade = CascadeType.PERSIST)
+ @JoinColumn(name = "ACTIVITY_ID")
+ private List<SubGeographicalRegion> subGeographicalRegionList;
+
@OneToMany(targetEntity = Substation.class, cascade = CascadeType.PERSIST)
@JoinColumn(name = "ACTIVITY_ID")
private List<Substation> substationList;
-
/**
* If this activity is a practice.
*/
@@ -201,4 +199,8 @@ public class Activity extends AbstractBaseEntitiy {
public List<Substation> getSubstationList() {
return substationList;
}
+
+ public List<SubGeographicalRegion> getSubGeographicalRegionList() {
+ return subGeographicalRegionList;
+ }
}
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Preselection.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Preselection.java
index 7b6a146b..222e7e87 100644
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Preselection.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/process/Preselection.java
@@ -66,7 +66,7 @@ public class Preselection extends AbstractBaseEntitiy {
private Integer substituteValuePhotovoltaic;
@Column(name = "SUBSTITUTE_VALUE_BIOG_PER_CENT")
- private Integer substitureValueBiogas;
+ private Integer substituteValueBiogas;
@Column(name = "SECURITY_REDUCTION_PER_CENT")
private Integer securityFactorForReduction;
@@ -103,8 +103,8 @@ public class Preselection extends AbstractBaseEntitiy {
return substituteValuePhotovoltaic;
}
- public Integer getSubstitureValueBiogas() {
- return substitureValueBiogas;
+ public Integer getSubstituteValueBiogas() {
+ return substituteValueBiogas;
}
public Integer getSecurityFactorForReduction() {
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/wires/SynchronousMachine.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/wires/SynchronousMachine.java
index e35886fb..09ac873d 100644
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/wires/SynchronousMachine.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/wires/SynchronousMachine.java
@@ -12,66 +12,62 @@
*/
package org.eclipse.openk.eisman.model.wires;
-//import com.fasterxml.jackson.annotation.JsonIgnore;
-//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.Terminal;
-//import org.eclipse.openk.model.domain.CommunicationType;
-//import org.eclipse.openk.model.domain.ReductionSetting;
-//import org.eclipse.openk.model.informative.infoperations.PsrEvent;
-//import org.eclipse.openk.model.meas.Analog;
-//import org.eclipse.openk.model.production.GeneratingUnit;
-//import org.eclipse.openk.model.utils.converter.Boolean2StringConverter;
-
-//import javax.persistence.Access;
-//import javax.persistence.AccessType;
-//import javax.persistence.CascadeType;
-//import javax.persistence.Column;
-//import javax.persistence.Convert;
-//import javax.persistence.Entity;
-//import javax.persistence.EnumType;
-//import javax.persistence.Enumerated;
-//import javax.persistence.GeneratedValue;
-//import javax.persistence.GenerationType;
-//import javax.persistence.Id;
-//import javax.persistence.JoinColumn;
-//import javax.persistence.ManyToOne;
-//import javax.persistence.OneToMany;
-//import javax.persistence.Table;
-//import javax.persistence.TableGenerator;
-//import javax.persistence.Transient;
-//import java.util.List;
-
-//@JsonIgnoreProperties(ignoreUnknown = true)
-//@Entity
-//@Table(name = "SYNCHRONOUS_MACHINE")
-//@Access(AccessType.FIELD)
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import org.eclipse.openk.eisman.model.common.Location;
+import org.eclipse.openk.eisman.model.domain.CommunicationType;
+import org.eclipse.openk.eisman.model.domain.PerCent;
+import org.eclipse.openk.eisman.model.domain.ReductionSetting;
+import org.eclipse.openk.eisman.model.informative.infoperations.PsrEvent;
+import org.eclipse.openk.eisman.model.meas.Analog;
+
+import javax.persistence.Access;
+import javax.persistence.AccessType;
+import javax.persistence.AttributeOverride;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+import java.util.List;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+@Entity
+@Table(name = "SYNCHRONOUS_MACHINE")
+@Access(AccessType.FIELD)
public class SynchronousMachine { //extends RotatingMachine {
-// @JsonIgnore
-// @Id
-// @TableGenerator(name = "SynchronousMachineTableGen",
-// table = "OPENK_CACHEDB_SEQ_TABLE",
-// pkColumnName = "SEQ_NAME",
-// valueColumnName = "SEQ_COUNT",
-// pkColumnValue = "SYNCHRONOUS_MACHINE_SEQ")
-// @GeneratedValue(strategy = GenerationType.TABLE, generator = "SynchronousMachineTableGen")
-// @Column(name = "ID")
+ // @JsonIgnore
+ @Id
+ @TableGenerator(name = "SynchronousMachineTableGen",
+ table = "OPENK_CACHEDB_SEQ_TABLE",
+ pkColumnName = "SEQ_NAME",
+ valueColumnName = "SEQ_COUNT",
+ pkColumnValue = "SYNCHRONOUS_MACHINE_SEQ")
+ @GeneratedValue(strategy = GenerationType.TABLE, generator = "SynchronousMachineTableGen")
+ @Column(name = "ID")
private Long id;
-// @JsonView({IncludeAttribute4Json.Topology.class, IncludeAttribute4Json.NetworkState.class,
+ // @JsonView({IncludeAttribute4Json.Topology.class, IncludeAttribute4Json.NetworkState.class,
// IncludeAttribute4Json.SynchronousMachine.class})
-// @Column(name = "MRID")
+ @Column(name = "MRID")
private String mRid;
-// @JsonView({IncludeAttribute4Json.Topology.class, IncludeAttribute4Json.NetworkState.class,
+ // @JsonView({IncludeAttribute4Json.Topology.class, IncludeAttribute4Json.NetworkState.class,
// IncludeAttribute4Json.SynchronousMachine.class})
-// @Column(name = "NAME")
+ @Column(name = "NAME")
private String name;
-// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ // @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
// @Convert(converter = Boolean2StringConverter.class)
// @Column(name = "NORMALLY_IN_SERVICE")
private Boolean normallyInService;
@@ -81,8 +77,8 @@ public class SynchronousMachine { //extends RotatingMachine {
*/
// @JsonView({IncludeAttribute4Json.Topology.class,IncludeAttribute4Json.SynchronousMachine.class})
// @Enumerated(EnumType.STRING)
-// @Column(name = "SYNCHRONOUS_MACHINE_KIND")
-// private SynchronousMachineKind synchronousMachineKind;
+ @Column(name = "SYNCHRONOUS_MACHINE_KIND")
+ private SynchronousMachineKind synchronousMachineKind;
// todo: ist das hier richtig? das ist eigentlich ein Messwert?
/**
@@ -92,15 +88,18 @@ public class SynchronousMachine { //extends RotatingMachine {
// @Embedded
// @AttributeOverride(name = "value", column = @Column(name = "REDUCTION_SETTING_PER_CENT"))
// private PerCent reductionSetting;
+ @Embedded
+ @AttributeOverride(name = "value", column = @Column(name = "CURRENT_REDUCTION_SETTING_PER_CENT"))
+ private PerCent currentReductionSetting;
/**
* 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<ReductionSetting> reductionSettingList;
+ @OneToMany(targetEntity = ReductionSetting.class, cascade = CascadeType.PERSIST)
+ @JoinColumn(name = "SYNCHRONOUS_MACHINE_ID")
+ private List<ReductionSetting> reductionSettingList;
/**
* The feed-in ranking of a generator (SynchronousMachine) as
@@ -110,135 +109,121 @@ public class SynchronousMachine { //extends RotatingMachine {
* CIM extension by Jan Krueger, April 2015
*/
// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
-// @Column(name = "FEED_IN_RANKING")
+ @Column(name = "FEED_IN_RANKING")
private Integer feedInRanking;
/**
- * Communication Type EFT, FWT, TRA
+ * The feed-in priority of a generator (SynchronousMachine)
+ * 1 - high priority, ... 5 - low priority
* CIM extension by Jan Krueger, April 2015
*/
// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
-// @Enumerated(EnumType.STRING)
-// @Column(name = "COMMUNICATION_TYPE")
-// private CommunicationType communicationType;
+ @Column(name = "FEED_IN_PRIORITY")
+ private Integer feedInPriority;
/**
- * Communication Group
+ * Communication Type EFT, FWT, TRA
* CIM extension by Jan Krueger, April 2015
*/
// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
-// @Column(name = "COMMUNICATION_GROUP")
-// private Integer communicationGroup;
+ @Enumerated(EnumType.STRING)
+ @Column(name = "COMMUNICATION_TYPE")
+ private CommunicationType communicationType;
/**
- * SynchronousMachine is referenced.
+ * Communication Group
* CIM extension by Jan Krueger, April 2015
*/
// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
-// @Convert(converter = Boolean2StringConverter.class)
-// @Column(name = "REFERENCE_SYNCHRONOUS_MACHINE")
-// private Boolean parentSynchronousMachine;
+ @Column(name = "COMMUNICATION_GROUP")
+ private Integer communicationGroup;
/**
* Referenced SynchronousMachine
* CIM extension by Jan Krueger, April 2015
*/
// @JsonIgnore
-// @ManyToOne
-// @JoinColumn(name = "SYNCHRONOUS_MACHINE_ID", referencedColumnName = "ID")
-// private SynchronousMachine referencedSynchronousMachine;
+ @ManyToOne
+ @JoinColumn(name = "SYNCHRONOUS_MACHINE_ID", referencedColumnName = "ID")
+ private SynchronousMachine referencedSynchronousMachine;
// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
// @Transient
// private String referencedSynchronousMachineMrid;
-// @JsonView({IncludeAttribute4Json.Topology.class, IncludeAttribute4Json.SynchronousMachine.class})
+ // @JsonView({IncludeAttribute4Json.Topology.class, IncludeAttribute4Json.SynchronousMachine.class})
// @ManyToOne(cascade = CascadeType.PERSIST)
// @JoinColumn(name = "GENERATING_UNIT_ID")
// private GeneratingUnit generatingUnit;
//
// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
-// @ManyToOne(cascade = CascadeType.PERSIST)
-// @JoinColumn(name = "LOCATION_ID")
-// private Location location;
-//
-// @JsonView(IncludeAttribute4Json.Topology.class)
-// @OneToMany(targetEntity = Terminal.class, cascade = CascadeType.PERSIST)
-// @JoinColumn(name = "SYNCHRONOUS_MACHINE_ID")
-// private List<Terminal> terminalList;
-//
-// @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
-// @OneToMany(targetEntity = PsrEvent.class, cascade = CascadeType.PERSIST)
-// @JoinColumn(name = "SYNCHRONOUS_MACHINE_ID")
-// private List<PsrEvent> psrEventList;
-//
-// @JsonView(IncludeAttribute4Json.NetworkState.class)
-// @OneToMany(targetEntity = Analog.class, cascade = CascadeType.PERSIST)
-// @JoinColumn(name = "SYNCHRONOUS_MACHINE_ID")
-// private List<Analog> analogList;
-//
-// public String getReferencedSynchronousMachineMrid() {
-// return referencedSynchronousMachine == null ? null : referencedSynchronousMachine.getmRid();
-// }
-//
-// public String getmRid() {
-// return mRid;
-// }
-//
-// public String getName() {
-// return name;
-// }
-//
-// public Boolean getNormallyInService() {
-// return normallyInService;
-// }
-//
-// public Location getLocation() {
-// return location;
-// }
-//
-// public List<PsrEvent> getPsrEventList() {
-// return psrEventList;
-// }
-//
-// public GeneratingUnit getGeneratingUnit() {
-// return generatingUnit;
-// }
-//
-// public List<Terminal> getTerminalList() {
-// return terminalList;
-// }
-//
-// public SynchronousMachineKind getSynchronousMachineKind() {
-// return synchronousMachineKind;
-// }
-//
-// public List<Analog> getAnalogList() {
-// return analogList;
-// }
-//
-// public List<ReductionSetting> getReductionSettingList() {
-// return reductionSettingList;
-// }
-//
-// public Integer getFeedInRanking() {
-// return feedInRanking;
-// }
-//
-// public CommunicationType getCommunicationType() {
-// return communicationType;
-// }
-//
-// public Integer getCommunicationGroup() {
-// return communicationGroup;
-// }
-//
-// public Boolean isParentSynchronousMachine() {
-// return parentSynchronousMachine;
-// }
-//
-// public SynchronousMachine getReferencedSynchronousMachine() {
-// return referencedSynchronousMachine;
-// }
-
+ @ManyToOne(cascade = CascadeType.PERSIST)
+ @JoinColumn(name = "LOCATION_ID")
+ private Location location;
+
+ // @JsonView(IncludeAttribute4Json.SynchronousMachine.class)
+ @OneToMany(targetEntity = PsrEvent.class, cascade = CascadeType.PERSIST)
+ @JoinColumn(name = "SYNCHRONOUS_MACHINE_ID")
+ private List<PsrEvent> psrEventList;
+
+ // @JsonView(IncludeAttribute4Json.NetworkState.class)
+ @OneToMany(targetEntity = Analog.class, cascade = CascadeType.PERSIST)
+ @JoinColumn(name = "SYNCHRONOUS_MACHINE_ID")
+ private List<Analog> analogList;
+
+ public String getmRid() {
+ return mRid;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Boolean isNormallyInService() {
+ return normallyInService;
+ }
+
+ public SynchronousMachineKind getSynchronousMachineKind() {
+ return synchronousMachineKind;
+ }
+
+ public PerCent getCurrentReductionSetting() {
+ return currentReductionSetting;
+ }
+
+ public List<ReductionSetting> getReductionSettingList() {
+ return reductionSettingList;
+ }
+
+ public Integer getFeedInRanking() {
+ return feedInRanking;
+ }
+
+ public Integer getFeedInPriority() {
+ return feedInPriority;
+ }
+
+ public CommunicationType getCommunicationType() {
+ return communicationType;
+ }
+
+ public Integer getCommunicationGroup() {
+ return communicationGroup;
+ }
+
+ public SynchronousMachine getReferencedSynchronousMachine() {
+ return referencedSynchronousMachine;
+ }
+
+ public Location getLocation() {
+ return location;
+ }
+
+ public List<PsrEvent> getPsrEventList() {
+ return psrEventList;
+ }
+
+ public List<Analog> getAnalogList() {
+ return analogList;
+ }
}
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/wires/SynchronousMachineKind.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/wires/SynchronousMachineKind.java
new file mode 100644
index 00000000..b967cfdd
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/model/wires/SynchronousMachineKind.java
@@ -0,0 +1,37 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.model.wires;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+public enum SynchronousMachineKind {
+ GENERATOR("GENERATOR"),
+ CONDENSER("CONDENSER"),
+ MOTOR("MOTOR");
+// generatorOrCondenser,
+// generatorOrMotor,
+// motorOrCondenser,
+// generatorOrCondenserOrMotor
+
+ private final String value;
+
+ private SynchronousMachineKind(final String value) {
+ this.value = value;
+ }
+
+ @JsonValue
+ public String value() {
+ return this.value;
+ }
+
+}
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/service/SwitchOffAdviceService.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/service/SwitchOffAdviceService.java
new file mode 100644
index 00000000..9d1ba7b7
--- /dev/null
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/service/SwitchOffAdviceService.java
@@ -0,0 +1,73 @@
+/**
+ * ****************************************************************************
+ * 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
+ * <p/>
+ * Contributors:
+ * Jan Krueger - initial API and implementation
+ * *****************************************************************************
+ */
+package org.eclipse.openk.eisman.service;
+
+import org.eclipse.openk.eisman.adapter.rest.SubGeographicalRegionRestConsumer;
+import org.eclipse.openk.eisman.adapter.rest.SubstationRestConsumer;
+import org.eclipse.openk.eisman.model.core.Substation;
+import org.eclipse.openk.eisman.model.process.Activity;
+import org.eclipse.openk.eisman.model.wires.SynchronousMachine;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class SwitchOffAdviceService {
+
+ @Autowired
+ private SubGeographicalRegionRestConsumer subGeographicalRegionRestConsumer;
+
+ @Autowired
+ private SubstationRestConsumer substationRestConsumer;
+
+ /**
+ * Calculate the advie for an activity.
+ */
+ public Activity calculateAdvice(final Activity activity) {
+ final Activity activityWithSynchronousMachine = getSynchronousMachineListForActivity(activity);
+
+ return activityWithSynchronousMachine;
+ }
+
+
+ /**
+ * Get all SynchronousMachine, which have to be part of an activity.
+ */
+ private Activity getSynchronousMachineListForActivity(final Activity activity) {
+
+ for (final Substation substation : activity.getSubstationList()) {
+ final List<SynchronousMachine> synchronousMachineList =
+ substationRestConsumer.getSynchronousMachineListOfSubstation(substation.getmRid());
+ // todo: die ids entfernen
+ substation.setSynchronousMachineList(synchronousMachineList);
+ }
+
+ //substationRestConsumer.getSynchronousMachineListOfSubstationList();
+
+
+ activity.getSubstationList();
+ //activity.get
+
+ return activity;
+ }
+//
+// /**
+// * Get historical Activties and their switch of advices.
+// */
+// private void getHistoricalActivityList() {
+//
+// }
+
+
+}
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 807e6964..940a9a4d 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
@@ -68,8 +68,8 @@ ALTER TABLE ACTIVITY OWNER TO eisman;
CREATE TABLE EQUIPMENT_CONTAINER
(
- ID INTEGER NOT NULL,
- MRID VARCHAR(16),
+ ID INTEGER NOT NULL,
+ MRID VARCHAR(16) NOT NULL,
NAME VARCHAR(64),
HIGH_VOLTAGE_LIMIT_VALUE NUMERIC,
HIGH_VOLTAGE_LIMIT_UNIT_MULTIPLIER VARCHAR(12),
@@ -86,49 +86,62 @@ WITH (OIDS =FALSE
);
ALTER TABLE EQUIPMENT_CONTAINER OWNER TO eisman;
-/*
-CREATE TABLE GENERATING_UNIT
+CREATE TABLE SUBGEOGRAPHICAL_REGION
(
- ID INTEGER NOT NULL,
- HIGH_CONTROL_LIMIT_VALUE NUMERIC,
- HIGH_CONTROL_LIMIT_UNIT_MULTIPLIER VARCHAR(12),
- HIGH_CONTROL_LIMIT_UNIT_SYMBOL VARCHAR(12),
- MAX_OPERATING_POWER_LIMIT_VALUE NUMERIC,
- MAX_OPERATING_POWER_UNIT_MULTIPLIER VARCHAR(12),
- MAX_OPERATING_POWER_UNIT_SYMBOL VARCHAR(12),
- CONTROL_SOURCE VARCHAR(24),
- UNIT_TYPE VARCHAR(12),
- CONSTRAINT "PK_GENERATING_UNIT_ID" PRIMARY KEY (ID)
+ ID INTEGER NOT NULL,
+ MRID VARCHAR(16),
+ NAME VARCHAR(64),
+ ACTIVITY_ID INTEGER,
+ -- GEOGRAPHICAL_REGION_ID INTEGER,
+ CONSTRAINT "PK_SUBGEOGRAPHICAL_REGION" PRIMARY KEY (ID),
+ CONSTRAINT "FK_SUBGEOGRAPHICAL_REGION_ACTIVITY" FOREIGN KEY (ACTIVITY_ID) REFERENCES ACTIVITY (ID) ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (OIDS =FALSE
);
-ALTER TABLE GENERATING_UNIT OWNER TO cachedb;
+ALTER TABLE SUBGEOGRAPHICAL_REGION OWNER TO eisman;
+
+CREATE TABLE LOCATION
+(
+ ID INTEGER NOT NULL,
+ NAME VARCHAR(64),
+ STREET_NAME VARCHAR(64),
+ STREET_NUMBER VARCHAR(12),
+ POSTAL_CODE VARCHAR(12),
+ CITY VARCHAR(64),
+ COUNTRY VARCHAR(64),
+ EMAIL VARCHAR(64),
+ CONSTRAINT "PK_LOCATION" PRIMARY KEY (ID)
+)
+WITH (OIDS =FALSE
+);
+ALTER TABLE LOCATION OWNER TO eisman;
CREATE TABLE SYNCHRONOUS_MACHINE
(
- ID INTEGER NOT NULL,
- MRID VARCHAR(16),
- NAME VARCHAR(64),
- NORMALLY_IN_SERVICE VARCHAR(5),
- SYNCHRONOUS_MACHINE_KIND VARCHAR(32),
- -- REDUCTION_SETTING_PER_CENT INTEGER,
- FEED_IN_RANKING INTEGER,
- COMMUNICATION_TYPE VARCHAR(12),
- COMMUNICATION_GROUP INTEGER,
- REFERENCE_SYNCHRONOUS_MACHINE VARCHAR(5),
- SYNCHRONOUS_MACHINE_ID INTEGER,
- GENERATING_UNIT_ID INTEGER,
+ ID INTEGER NOT NULL,
+ MRID VARCHAR(16) NOT NULL,
+ NAME VARCHAR(64),
+ NORMALLY_IN_SERVICE VARCHAR(5),
+ SYNCHRONOUS_MACHINE_KIND VARCHAR(32),
+ CURRENT_REDUCTION_SETTING_PER_CENT INTEGER,
+ FEED_IN_RANKING INTEGER,
+ FEED_IN_PRIORITY INTEGER,
+ COMMUNICATION_TYPE VARCHAR(12),
+ COMMUNICATION_GROUP INTEGER,
+ REFERENCE_SYNCHRONOUS_MACHINE VARCHAR(5),
+ SYNCHRONOUS_MACHINE_ID INTEGER,
+ -- GENERATING_UNIT_ID INTEGER,
LOCATION_ID INTEGER,
- EQUIPMENT_CONTAINER_ID INTEGER,
+ EQUIPMENT_CONTAINER_ID INTEGER,
CONSTRAINT "PK_SYNCHRONOUS_MACHINE_ID" PRIMARY KEY (ID),
CONSTRAINT "FK_SYNCHRONOUS_MACHINE_SYNCHRONOUS_MACHINE" FOREIGN KEY (SYNCHRONOUS_MACHINE_ID) REFERENCES SYNCHRONOUS_MACHINE (ID) ON UPDATE NO ACTION ON DELETE NO ACTION,
- CONSTRAINT "FK_SYNCHRONOUS_MACHINE_GENERATING_UNIT" FOREIGN KEY (GENERATING_UNIT_ID) REFERENCES GENERATING_UNIT (ID) ON UPDATE NO ACTION ON DELETE NO ACTION,
+ -- CONSTRAINT "FK_SYNCHRONOUS_MACHINE_GENERATING_UNIT" FOREIGN KEY (GENERATING_UNIT_ID) REFERENCES GENERATING_UNIT (ID) ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "FK_SYNCHRONOUS_MACHINE_LOCATION" FOREIGN KEY (LOCATION_ID) REFERENCES LOCATION (ID) ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "FK_SYNCHRONOUS_MACHINE_EQUIPMENT_CONTAINER" FOREIGN KEY (EQUIPMENT_CONTAINER_ID) REFERENCES EQUIPMENT_CONTAINER (ID) ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (OIDS =FALSE
);
-ALTER TABLE SYNCHRONOUS_MACHINE OWNER TO cachedb;
+ALTER TABLE SYNCHRONOUS_MACHINE OWNER TO eisman;
CREATE TABLE REDUCTION_SETTING
(
@@ -140,7 +153,26 @@ CREATE TABLE REDUCTION_SETTING
)
WITH (OIDS =FALSE
);
-ALTER TABLE REDUCTION_SETTING OWNER TO cachedb;
+ALTER TABLE REDUCTION_SETTING OWNER TO eisman;
+
+/*
+CREATE TABLE GENERATING_UNIT
+(
+ ID INTEGER NOT NULL,
+ HIGH_CONTROL_LIMIT_VALUE NUMERIC,
+ HIGH_CONTROL_LIMIT_UNIT_MULTIPLIER VARCHAR(12),
+ HIGH_CONTROL_LIMIT_UNIT_SYMBOL VARCHAR(12),
+ MAX_OPERATING_POWER_LIMIT_VALUE NUMERIC,
+ MAX_OPERATING_POWER_UNIT_MULTIPLIER VARCHAR(12),
+ MAX_OPERATING_POWER_UNIT_SYMBOL VARCHAR(12),
+ CONTROL_SOURCE VARCHAR(24),
+ UNIT_TYPE VARCHAR(12),
+ CONSTRAINT "PK_GENERATING_UNIT_ID" PRIMARY KEY (ID)
+)
+WITH (OIDS =FALSE
+);
+ALTER TABLE GENERATING_UNIT OWNER TO cachedb;
+*/
CREATE TABLE MEASUREMENT_ANALOG
(
@@ -158,7 +190,7 @@ CREATE TABLE MEASUREMENT_ANALOG
)
WITH (OIDS =FALSE
);
-ALTER TABLE MEASUREMENT_ANALOG OWNER TO cachedb;
+ALTER TABLE MEASUREMENT_ANALOG OWNER TO eisman;
CREATE TABLE MEASUREMENT_ANALOG_VALUE
(
@@ -171,6 +203,21 @@ CREATE TABLE MEASUREMENT_ANALOG_VALUE
)
WITH (OIDS =FALSE
);
-ALTER TABLE MEASUREMENT_ANALOG_VALUE OWNER TO cachedb;
-*/
+ALTER TABLE MEASUREMENT_ANALOG_VALUE OWNER TO eisman;
+
+CREATE TABLE PSR_EVENT
+(
+ ID INTEGER NOT NULL,
+ MRID VARCHAR(16),
+ PSR_EVENT_KIND VARCHAR(16),
+ TIMESTAMP_CREATED VARCHAR(30),
+ SYNCHRONOUS_MACHINE_ID INTEGER,
+ CONSTRAINT "PK_PSR_EVENT" PRIMARY KEY (ID),
+ CONSTRAINT "FK_PSR_EVENT_SYNCHRONOUS_MACHINE" FOREIGN KEY (SYNCHRONOUS_MACHINE_ID) REFERENCES SYNCHRONOUS_MACHINE (ID) ON UPDATE NO ACTION ON DELETE NO ACTION
+)
+WITH (OIDS =FALSE
+);
+ALTER TABLE PSR_EVENT OWNER TO eisman;
+
+
diff --git a/openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/repository/ActivityRepositoryTest.java b/openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/repository/ActivityRepositoryTest.java
index 20703907..532134c3 100644
--- a/openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/repository/ActivityRepositoryTest.java
+++ b/openk-platform/openk-eisman-portlet/src/test/java/org/eclipse/openk/eisman/repository/ActivityRepositoryTest.java
@@ -75,12 +75,13 @@ public class ActivityRepositoryTest extends AbstractRepositoryJpaTest {
Query insertSubstation = entityManager.createNativeQuery(
"INSERT INTO equipment_container " +
- "(id, name, equipment_container_type, activity_id) " +
- "VALUES (?1, ?2, ?3, ?4)");
+ "(id, mrid, name, equipment_container_type, activity_id) " +
+ "VALUES (?1, ?2, ?3, ?4,?5)");
insertSubstation.setParameter(1, 4000L);
- insertSubstation.setParameter(2, "Substion ActivityRepositoryTest 01");
- insertSubstation.setParameter(3, "SubstationType");
- insertSubstation.setParameter(4, 4000L);
+ insertSubstation.setParameter(2, "ABRT6788");
+ insertSubstation.setParameter(3, "Substion ActivityRepositoryTest 01");
+ insertSubstation.setParameter(4, "SubstationType");
+ insertSubstation.setParameter(5, 4000L);
insertSubstation.executeUpdate();
}
diff --git a/openk-platform/openk-eisman-portlet/src/test/sql/appdb-eisman-insert-data.sql b/openk-platform/openk-eisman-portlet/src/test/sql/appdb-eisman-insert-data.sql
index 2c71ff18..dda7740a 100644
--- a/openk-platform/openk-eisman-portlet/src/test/sql/appdb-eisman-insert-data.sql
+++ b/openk-platform/openk-eisman-portlet/src/test/sql/appdb-eisman-insert-data.sql
@@ -56,6 +56,9 @@ INSERT INTO ACTIVITY VALUES (
22, 'MEGA', 'W', 'FALSE',
'END','Info to Feedin', 'END', 'Info to DSO',
now(), 'user 01', null, null,null,1000);
+INSERT INTO EQUIPMENT_CONTAINER VALUES (
+ 1000, '7788', 'Substation01 - Ortsnetzstation Stopfenheim', null, null, null, 'SubstationType', null, 1008);
+
INSERT INTO ACTIVITY VALUES (
1009, 'Inspection', now(), null,
diff --git a/openk-platform/openk-eisman-portlet/uml-diagram/appdb-eisman.uml b/openk-platform/openk-eisman-portlet/uml-diagram/appdb-eisman.uml
index 884bcead..7c72f34e 100644
--- a/openk-platform/openk-eisman-portlet/uml-diagram/appdb-eisman.uml
+++ b/openk-platform/openk-eisman-portlet/uml-diagram/appdb-eisman.uml
@@ -1,37 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<Diagram>
<ID>DATABASE</ID>
- <OriginalElement>3e973b2d-2378-4b75-813d-77d17e6b2a56.schema:appdb.eisman</OriginalElement>
+ <OriginalElement />
<nodes>
- <node x="250.00000000000003" y="866.0">3e973b2d-2378-4b75-813d-77d17e6b2a56.table:appdb.eisman.equipment_container</node>
- <node x="94.5" y="0.0">3e973b2d-2378-4b75-813d-77d17e6b2a56.table:appdb.eisman.preselection</node>
- <node x="54.5" y="389.0">3e973b2d-2378-4b75-813d-77d17e6b2a56.table:appdb.eisman.activity</node>
+ <node x="94.5" y="0.0">5b852e3b-d62f-4cd6-b8ca-e6ec976563a0.table:appdb.eisman.preselection</node>
+ <node x="250.0" y="866.0">5b852e3b-d62f-4cd6-b8ca-e6ec976563a0.table:appdb.eisman.equipment_container</node>
+ <node x="54.5" y="389.0">5b852e3b-d62f-4cd6-b8ca-e6ec976563a0.table:appdb.eisman.activity</node>
+ <node x="230.0" y="1145.0">5b852e3b-d62f-4cd6-b8ca-e6ec976563a0.table:appdb.eisman.synchronous_machine</node>
</nodes>
<notes />
<edges>
- <edge source="3e973b2d-2378-4b75-813d-77d17e6b2a56.table:appdb.eisman.equipment_container" target="3e973b2d-2378-4b75-813d-77d17e6b2a56.table:appdb.eisman.activity">
+ <edge source="5b852e3b-d62f-4cd6-b8ca-e6ec976563a0.table:appdb.eisman.equipment_container" target="5b852e3b-d62f-4cd6-b8ca-e6ec976563a0.table:appdb.eisman.activity">
<point x="0.0" y="-114.5" />
<point x="105.5" y="213.5" />
</edge>
- <edge source="3e973b2d-2378-4b75-813d-77d17e6b2a56.table:appdb.eisman.activity" target="3e973b2d-2378-4b75-813d-77d17e6b2a56.table:appdb.eisman.preselection">
+ <edge source="5b852e3b-d62f-4cd6-b8ca-e6ec976563a0.table:appdb.eisman.activity" target="5b852e3b-d62f-4cd6-b8ca-e6ec976563a0.table:appdb.eisman.preselection">
<point x="0.0" y="-213.5" />
<point x="0.0" y="169.5" />
</edge>
- <edge source="3e973b2d-2378-4b75-813d-77d17e6b2a56.table:appdb.eisman.activity" target="3e973b2d-2378-4b75-813d-77d17e6b2a56.table:appdb.eisman.activity">
+ <edge source="5b852e3b-d62f-4cd6-b8ca-e6ec976563a0.table:appdb.eisman.synchronous_machine" target="5b852e3b-d62f-4cd6-b8ca-e6ec976563a0.table:appdb.eisman.equipment_container">
+ <point x="0.0" y="-136.5" />
+ <point x="0.0" y="114.5" />
+ </edge>
+ <edge source="5b852e3b-d62f-4cd6-b8ca-e6ec976563a0.table:appdb.eisman.activity" target="5b852e3b-d62f-4cd6-b8ca-e6ec976563a0.table:appdb.eisman.activity">
<point x="-105.5" y="213.5" />
<point x="160.0" y="836.0" />
<point x="34.5" y="836.0" />
<point x="34.5" y="602.5" />
<point x="-211.0" y="-0.0" />
</edge>
+ <edge source="5b852e3b-d62f-4cd6-b8ca-e6ec976563a0.table:appdb.eisman.synchronous_machine" target="5b852e3b-d62f-4cd6-b8ca-e6ec976563a0.table:appdb.eisman.synchronous_machine">
+ <point x="0.0" y="136.5" />
+ <point x="371.0" y="1438.0" />
+ <point x="210.0" y="1438.0" />
+ <point x="210.0" y="1281.5" />
+ <point x="-141.0" y="-0.0" />
+ </edge>
</edges>
- <settings layout="Hierarchic Group" zoom="0.9" x="212.0454545454545" y="510.0909090909091" />
- <SelectedNodes>
- <node>3e973b2d-2378-4b75-813d-77d17e6b2a56.table:appdb.eisman.equipment_container</node>
- </SelectedNodes>
+ <settings layout="Hierarchic Group" zoom="0.7173024523160763" x="256.0" y="724.0" />
+ <SelectedNodes />
<Categories>
- <Category>Key columns</Category>
<Category>Columns</Category>
+ <Category>Key columns</Category>
</Categories>
</Diagram>
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.
-->
- <liferay.version>6.2.2</liferay.version>
+ <liferay.version>6.1.1</liferay.version>
<liferay.maven.plugin.version>${liferay.version}</liferay.maven.plugin.version>
<liferay.root.dir>${liferay.home}</liferay.root.dir>
<liferay.app.server.deploy.dir>${liferay.root.dir}/tomcat-7.0.42/webapps</liferay.app.server.deploy.dir>

Back to the top