diff --git a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/api/FieldBusManager.java b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/api/FieldBusManager.java index 6d51989b..b4a434ac 100644 --- a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/api/FieldBusManager.java +++ b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/api/FieldBusManager.java @@ -5,5 +5,7 @@ public interface FieldBusManager { public Serializable handleRequest(String requestQueue, Serializable request); + + public String getFieldModelMrid(); } diff --git a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/distributed/FieldBusManagerImpl.java b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/distributed/FieldBusManagerImpl.java index 9eba9b6f..e137def5 100644 --- a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/distributed/FieldBusManagerImpl.java +++ b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/distributed/FieldBusManagerImpl.java @@ -77,7 +77,6 @@ public class FieldBusManagerImpl implements FieldBusManager { Client client; - List feederList = null; Map> messageBus_measIds_map = new HashMap>(); Map measId_messageBus_map = new HashMap(); @@ -132,14 +131,6 @@ public Serializable handleRequest(String request_queue, Serializable request) { if (request_queue.endsWith("context")) { RequestFieldContext requestFieldContext = RequestFieldContext.parse(request.toString()); - // TODO: This block will be used if FieldBusManager is initialized - // with multiple feeders - /* - * for(Feeder feeder : feederList){ - * if(feeder.feeder_id.equals(requestFieldContext.modelId)) - * responseFeeder = feeder; } - */ - if (requestFieldContext.areaId == null) return topology.root.feeders; else { diff --git a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/PlatformStatus.java b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/PlatformStatus.java index 4643313f..e77b0ee8 100644 --- a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/PlatformStatus.java +++ b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/PlatformStatus.java @@ -11,6 +11,7 @@ public class PlatformStatus implements Serializable{ List services; List appInstances; List serviceInstances; + String fieldModelMrid; public PlatformStatus() {} @@ -50,5 +51,9 @@ public List getServiceInstances() { public void setServiceInstances(List serviceInstances) { this.serviceInstances = serviceInstances; } + public void setField(String fieldModelMrid) { + this.fieldModelMrid = fieldModelMrid; + + } } diff --git a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/RequestPlatformStatus.java b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/RequestPlatformStatus.java index 55d68ea4..6a1e292f 100644 --- a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/RequestPlatformStatus.java +++ b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/RequestPlatformStatus.java @@ -12,6 +12,7 @@ public class RequestPlatformStatus implements Serializable { boolean services = false; boolean appInstances = false; boolean serviceInstances = false; + boolean field = false; public boolean isApplications() { return applications; @@ -37,15 +38,22 @@ public boolean isServiceInstances() { public void setServiceInstances(boolean serviceInstances) { this.serviceInstances = serviceInstances; } + public boolean isField() { + return field; + } + public void setField(boolean field) { + this.field = field; + } public static RequestPlatformStatus parse(String jsonString){ Gson gson = new Gson(); RequestPlatformStatus obj = gson.fromJson(jsonString, RequestPlatformStatus.class); - if(!obj.appInstances & !obj.services & !obj.applications & !obj.serviceInstances){ + if(!obj.appInstances & !obj.services & !obj.applications & !obj.serviceInstances & !obj.field){ obj.applications = true; obj.services = true; obj.appInstances = true; obj.serviceInstances = true; + obj.field = true; } return obj; } diff --git a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/ServiceInstance.java b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/ServiceInstance.java index 4c8b018b..8a5a9e2d 100644 --- a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/ServiceInstance.java +++ b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/ServiceInstance.java @@ -52,7 +52,7 @@ public class ServiceInstance implements Serializable{ ServiceInfo servcie_info; HashMap runtime_options; String simulation_id; - Process process; + transient Process process; public ServiceInstance(String instance_id, ServiceInfo servcie_info, HashMap runtime_options, String simulation_id, Process process){ diff --git a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/field/SecondaryArea.java b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/field/SecondaryArea.java index fdd69895..83a33428 100644 --- a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/field/SecondaryArea.java +++ b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/field/SecondaryArea.java @@ -3,6 +3,8 @@ import java.io.Serializable; import java.util.ArrayList; +import com.google.gson.Gson; + public class SecondaryArea implements Serializable{ private static final long serialVersionUID = 1L; @@ -13,4 +15,10 @@ public class SecondaryArea implements Serializable{ public ArrayList connectivity_node; public String message_bus_id; + @Override + public String toString() { + Gson gson = new Gson(); + return gson.toJson(this); + } + } diff --git a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/field/SwitchArea.java b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/field/SwitchArea.java index 7f1ae3d0..016e08b3 100644 --- a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/field/SwitchArea.java +++ b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/dto/field/SwitchArea.java @@ -3,6 +3,8 @@ import java.io.Serializable; import java.util.ArrayList; +import com.google.gson.Gson; + public class SwitchArea implements Serializable { private static final long serialVersionUID = 1L; @@ -13,5 +15,11 @@ public class SwitchArea implements Serializable { public ArrayList secondary_areas; public ArrayList connectivity_node; public String message_bus_id; + + @Override + public String toString() { + Gson gson = new Gson(); + return gson.toJson(this); + } } diff --git a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/process/ProcessEvent.java b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/process/ProcessEvent.java index c9a75542..0e6e8f1c 100644 --- a/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/process/ProcessEvent.java +++ b/gov.pnnl.goss.gridappsd/src/gov/pnnl/goss/gridappsd/process/ProcessEvent.java @@ -347,6 +347,8 @@ else if(event.getDestination().contains(GridAppsDConstants.topic_requestPlatform platformStatus.setAppInstances(appManager.listRunningApps()); if(request.isServiceInstances()) platformStatus.setServiceInstances(serviceManager.listRunningServices()); + if(request.isField()) + platformStatus.setField(fieldBusManager.getFieldModelMrid()); client.publish(event.getReplyDestination(), platformStatus); } else if (event.getDestination().contains(GridAppsDConstants.topic_requestMyRoles)){