Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjnkruege.btc2016-01-13 10:52:57 -0500
committerjnkruege.btc2016-01-13 10:52:57 -0500
commit170927911672e2a28418568e3da77cd46c33e482 (patch)
tree9f83f4d3456575209969de0197565c7fa6d839fb
parent64795a2f3f8ba4acd702373d4e89fde8ad8167e3 (diff)
downloadorg.eclipse.openk-platform.openk-repo-170927911672e2a28418568e3da77cd46c33e482.tar.gz
org.eclipse.openk-platform.openk-repo-170927911672e2a28418568e3da77cd46c33e482.tar.xz
org.eclipse.openk-platform.openk-repo-170927911672e2a28418568e3da77cd46c33e482.zip
fix display EFR and virtual TransfomerStation
-rwxr-xr-xopenk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/service/SubGeographicalRegion4TreeService.java10
-rwxr-xr-xopenk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/service/SubstationJpaService.java29
2 files changed, 21 insertions, 18 deletions
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/service/SubGeographicalRegion4TreeService.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/service/SubGeographicalRegion4TreeService.java
index 473ce6d1..f0000fe4 100755
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/service/SubGeographicalRegion4TreeService.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/service/SubGeographicalRegion4TreeService.java
@@ -84,7 +84,7 @@ public class SubGeographicalRegion4TreeService {
if (sumContainerTransformerStationEfr.getSum().compareTo(BigDecimal.ZERO) == 1) {
Substation4Tree virtualTransformerStationEfr
- = findInList(transformerStation4TreeList, VIRT_TS, VIRT_TS);
+ = findInList(transformerStation4TreeList, VIRT_TS);
if (virtualTransformerStationEfr == null) {
@@ -105,7 +105,6 @@ public class SubGeographicalRegion4TreeService {
transformerStation4TreeList.add(transformerStation4Tree);
sumContainerSubGeographicalRegion.add(sumContainerTransformerStationFwt);
-
}
final SubGeographicalRegion4Tree subGeographicalRegion4Tree =
@@ -197,15 +196,14 @@ public class SubGeographicalRegion4TreeService {
}
private Substation4Tree findInList(final List<Substation4Tree> substation4TreeList,
- final String virtualTransformerStationName,
- final String virtualTransformerStationOid) {
+ final String virtualTransformerStationName) {
return (Substation4Tree) CollectionUtils.find(substation4TreeList, new Predicate() {
+
@Override
public boolean evaluate(final Object o) {
- return ((Substation4Tree) o).getName().equals(virtualTransformerStationName)
- && ((Substation4Tree) o).getOid().equals(virtualTransformerStationOid);
+ return ((Substation4Tree) o).getName().equals(virtualTransformerStationName);
}
});
}
diff --git a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/service/SubstationJpaService.java b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/service/SubstationJpaService.java
index 0bde5c27..cbee3e3d 100755
--- a/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/service/SubstationJpaService.java
+++ b/openk-platform/openk-cachedb-service/src/main/java/org/eclipse/openk/cachedb/service/SubstationJpaService.java
@@ -158,35 +158,39 @@ public class SubstationJpaService extends AbstractJpaService {
return null;
}
- final List<EquipmentJpa> virtualSynchronousMachineJpaList = new ArrayList<>();
+ final List<EquipmentJpa> synchronousMachineJpaList = new ArrayList<>();
for (final SubstationJpa substationJpa : subGeographicalRegionJpa.getSubstationJpaList()) {
for (final SynchronousMachineJpa synchronousMachineJpa
: substationJpa.getSynchronousMachineJpaList()) {
- SynchronousMachineJpa virtualSynchronousMachineJpa = null;
-
if (synchronousMachineJpa.getCommunicationTypeJpa() != null
- && synchronousMachineJpa.getCommunicationGroup() != null) {
+ && synchronousMachineJpa.getCommunicationGroup() == null) {
+
+ synchronousMachineJpaList.add(synchronousMachineJpa);
+
+ } else if (synchronousMachineJpa.getCommunicationGroup() != null) {
+
+ SynchronousMachineJpa virtualSynchronousMachineJpa = null;
virtualSynchronousMachineJpa
- = findInList(virtualSynchronousMachineJpaList, synchronousMachineJpa);
- }
+ = findInList(synchronousMachineJpaList, synchronousMachineJpa);
- if (virtualSynchronousMachineJpa == null) {
+ if (virtualSynchronousMachineJpa == null) {
- virtualSynchronousMachineJpa = createVirtualSynchronousMachine(synchronousMachineJpa);
- virtualSynchronousMachineJpaList.add(virtualSynchronousMachineJpa);
+ virtualSynchronousMachineJpa = createVirtualSynchronousMachine(synchronousMachineJpa);
+ synchronousMachineJpaList.add(virtualSynchronousMachineJpa);
- } else {
+ } else {
- addValues(virtualSynchronousMachineJpa, synchronousMachineJpa);
+ addValues(virtualSynchronousMachineJpa, synchronousMachineJpa);
+ }
}
}
}
- virtualTransformerStation.setEquipmentJpaList(virtualSynchronousMachineJpaList);
+ virtualTransformerStation.setEquipmentJpaList(synchronousMachineJpaList);
return virtualTransformerStation;
}
@@ -199,6 +203,7 @@ public class SubstationJpaService extends AbstractJpaService {
virtualSynchronousMachineJpa.setCommunicationTypeJpa(synchronousMachineJpa.getCommunicationTypeJpa());
virtualSynchronousMachineJpa.setCommunicationGroup(synchronousMachineJpa.getCommunicationGroup());
virtualSynchronousMachineJpa.setGeneratingUnitJpa(synchronousMachineJpa.getGeneratingUnitJpa());
+ virtualSynchronousMachineJpa.getGeneratingUnitJpa().setRegisteredGeneratorJpa(null);
virtualSynchronousMachineJpa.setReductionSettingJpaList(synchronousMachineJpa.getReductionSettingJpaList());
virtualSynchronousMachineJpa.setFeedInRanking(synchronousMachineJpa.getFeedInRanking());
virtualSynchronousMachineJpa.setFeedInPriority(synchronousMachineJpa.getFeedInPriority());

Back to the top