Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjnkruege.btc2016-01-13 15:32:10 -0500
committerjnkruege.btc2016-01-13 15:32:10 -0500
commit6ed85a9663800c7c8f749ddf32f7caaead367d5a (patch)
tree702947decccb0205c8121c273c2e4869f4b00329
parentef4de77d90528e5f2db585586d01d5443c53cc53 (diff)
downloadorg.eclipse.openk-platform.openk-repo-6ed85a9663800c7c8f749ddf32f7caaead367d5a.tar.gz
org.eclipse.openk-platform.openk-repo-6ed85a9663800c7c8f749ddf32f7caaead367d5a.tar.xz
org.eclipse.openk-platform.openk-repo-6ed85a9663800c7c8f749ddf32f7caaead367d5a.zip
fix ratio of reference synchronous machine
-rwxr-xr-xopenk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/adapter/rest/controller/SubGeographicalRegionRestController.java3
-rwxr-xr-xopenk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/service/AnalogJpaService.java26
2 files changed, 19 insertions, 10 deletions
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/adapter/rest/controller/SubGeographicalRegionRestController.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/adapter/rest/controller/SubGeographicalRegionRestController.java
index c21f9971..9eb9fcd4 100755
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/adapter/rest/controller/SubGeographicalRegionRestController.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/adapter/rest/controller/SubGeographicalRegionRestController.java
@@ -16,6 +16,7 @@ import org.eclipse.openk.cachedb.model.cim.core.SubGeographicalRegion;
import org.eclipse.openk.cachedb.model.jpa.core.SubGeographicalRegionJpa;
import org.eclipse.openk.cachedb.model.jpa.core.SubstationJpa;
import org.eclipse.openk.cachedb.model.jpa.core.VoltageLevelJpa;
+import org.eclipse.openk.cachedb.model.jpa.domain.CommunicationTypeJpa;
import org.eclipse.openk.cachedb.model.jpa.wires.SynchronousMachineJpa;
import org.eclipse.openk.cachedb.model.util.SubGeographicalRegion4Tree;
import org.eclipse.openk.cachedb.service.NetworkTraceService;
@@ -112,7 +113,7 @@ public class SubGeographicalRegionRestController {
public SubGeographicalRegion getSubGeographicalRegion4Eisman(@PathVariable final Long oid) {
final SubGeographicalRegionJpa subGeographicalRegionJpa =
- subGeographicalRegionJpaService.getSubGeographicalRegionJpa(oid, null);
+ subGeographicalRegionJpaService.getSubGeographicalRegionJpa(oid, CommunicationTypeJpa.FWT);
subGeographicalRegionJpa.getSubstationJpaList().add(
substationJpaService.createVirtualTransformerStation(Long.toString(oid * -1)));
diff --git a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/service/AnalogJpaService.java b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/service/AnalogJpaService.java
index 8a22d95a..7c8617a8 100755
--- a/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/service/AnalogJpaService.java
+++ b/openk-platform/openk-eisman-portlet/src/main/java/org/eclipse/openk/eisman/service/AnalogJpaService.java
@@ -91,15 +91,23 @@ public class AnalogJpaService extends AbstractService {
analogValueJpaGeneratorPower.setMeasurementValueQualityJpa(
analogValueJpa.getMeasurementValueQualityJpa());
- final float ratioMaxP =
- ActivePowerJpaService.getValueUnitW(
- synchronousMachineJpa.getGeneratingUnitJpa().getMaxOperatingP())
- .divide(
- ActivePowerJpaService.getValueUnitW(
- synchronousMachineJpaRef.getGeneratingUnitJpa().getMaxOperatingP()),
- RoundingMode.HALF_UP).floatValue();
- final Float analogValueRef = analogValueJpa.getValue() * ratioMaxP;
- analogValueJpaGeneratorPower.setValue(analogValueRef);
+ if (synchronousMachineJpa.getGeneratingUnitJpa() == null
+ || synchronousMachineJpaRef.getGeneratingUnitJpa() == null) {
+
+ analogValueJpaGeneratorPower.setValue(analogValueJpa.getValue());
+
+ } else {
+
+ final float ratioMaxP =
+ ActivePowerJpaService.getValueUnitW(
+ synchronousMachineJpa.getGeneratingUnitJpa().getMaxOperatingP())
+ .divide(
+ ActivePowerJpaService.getValueUnitW(
+ synchronousMachineJpaRef.getGeneratingUnitJpa().getMaxOperatingP()),
+ RoundingMode.HALF_UP).floatValue();
+ final Float analogValueRef = analogValueJpa.getValue() * ratioMaxP;
+ analogValueJpaGeneratorPower.setValue(analogValueRef);
+ }
analogJpaGeneratorPower.getAnalogValueJpaList().add(analogValueJpaGeneratorPower);
}

Back to the top