Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to work with the new seto models #1800

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gov.pnnl.goss.gridappsd/conf/pnnl.goss.gridappsd.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ proven.advanced_query.path = http://proven:8080/hybrid/rest/v1/repository/getAdv


# Power grid model MRID for deployed Field Bus
field.model.mrid = _49AD8E07-3BF9-A4E2-CB8F-C3722F837B62
field.model.mrid = 49AD8E07-3BF9-A4E2-CB8F-C3722F837B62
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ public static void main(String[] args){
// System.out.println(bg.queryObjectTypes("_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3", "JSON", "12345", "user"));
System.out.println(bg.queryModelNameList("12345", "user"));
long start = new Date().getTime();
String model = bg.queryModel("_5B816B93-7A5F-B64C-8460-47C17D6E4B0F", "", "", "XML", "12345", "user");
// String model = bg.queryModel("_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3", "", "", "XML", "12345", "user");
// String model = bg.queryModel("_503D6E20-F499-4CC7-8051-971E23D0BF79", "", "", "XML", "12345", "user");
String model = bg.queryModel("5B816B93-7A5F-B64C-8460-47C17D6E4B0F", "", "", "XML", "12345", "user");
// String model = bg.queryModel("4F76A5F9-271D-9EB8-5E31-AA362D86F2C3", "", "", "XML", "12345", "user");
// String model = bg.queryModel("503D6E20-F499-4CC7-8051-971E23D0BF79", "", "", "XML", "12345", "user");


FileOutputStream fout = new FileOutputStream(new File("xml_new_full.xml"));
Expand All @@ -163,23 +163,23 @@ public static void main(String[] args){
// System.out.println(bg.queryModelNames("XML"));
// System.out.println(bg.queryModelNamesAndIds("XML", "12345", "user"));

// System.out.println(bg.queryObjectIds("JSON", "_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3", "LoadBreakSwitch", "12345", "user"));
// System.out.println(bg.queryObjectIds("JSON", "4F76A5F9-271D-9EB8-5E31-AA362D86F2C3", "LoadBreakSwitch", "12345", "user"));
//test with both object id and type
// System.out.println(bg.queryObjectDictByType("JSON", "_C1C3E687-6FFD-C753-582B-632A27E28507", "LinearShuntCompensator", "_EF2FF8C1-A6A6-4771-ADDD-A371AD929D5B", "12345", "user")); //ieee123
// System.out.println(bg.queryObjectDictByType("JSON", "C1C3E687-6FFD-C753-582B-632A27E28507", "LinearShuntCompensator", "_EF2FF8C1-A6A6-4771-ADDD-A371AD929D5B", "12345", "user")); //ieee123
//test with only object id
// System.out.println(bg.queryObjectDictByType("JSON", "_C1C3E687-6FFD-C753-582B-632A27E28507", null, "_EF2FF8C1-A6A6-4771-ADDD-A371AD929D5B", "12345", "user")); //ieee123
// System.out.println(bg.queryObjectDictByType("JSON", "C1C3E687-6FFD-C753-582B-632A27E28507", null, "_EF2FF8C1-A6A6-4771-ADDD-A371AD929D5B", "12345", "user")); //ieee123
//test with only object type
// System.out.println(bg.queryObjectDictByType("JSON", "_C1C3E687-6FFD-C753-582B-632A27E28507", "LinearShuntCompensator", null, "12345", "user")); //ieee123
// System.out.println(bg.queryObjectDictByType("JSON", "C1C3E687-6FFD-C753-582B-632A27E28507", "LinearShuntCompensator", null, "12345", "user")); //ieee123
//test with neither object or type, should fail
// try{
// System.out.println(bg.queryObjectDictByType("JSON", "_C1C3E687-6FFD-C753-582B-632A27E28507", null, null, "12345", "user")); //ieee123
// System.out.println(bg.queryObjectDictByType("JSON", "C1C3E687-6FFD-C753-582B-632A27E28507", null, null, "12345", "user")); //ieee123
// }catch (Exception e) {
// System.out.println("Expected error "+e.getMessage());
// // TODO: handle exception
// }
// System.out.println(bg.queryObjectDictByType("JSON", "_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3", "LinearShuntCompensator", null, "12345", "user")); //ieee8500
// System.out.println(bg.queryMeasurementDictByObject("JSON", "_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3", null, "_7A02B3B0-2746-EB24-45A5-C3FBA8ACB88E", "12345", "user"));
// System.out.println(bg.queryMeasurementDictByObject("JSON", "_4F76A5F9-271D-9EB8-5E31-AA362D86F2C3", "LinearShuntCompensator", null, "12345", "user"));
// System.out.println(bg.queryObjectDictByType("JSON", "4F76A5F9-271D-9EB8-5E31-AA362D86F2C3", "LinearShuntCompensator", null, "12345", "user")); //ieee8500
// System.out.println(bg.queryMeasurementDictByObject("JSON", "4F76A5F9-271D-9EB8-5E31-AA362D86F2C3", null, "_7A02B3B0-2746-EB24-45A5-C3FBA8ACB88E", "12345", "user"));
// System.out.println(bg.queryMeasurementDictByObject("JSON", "4F76A5F9-271D-9EB8-5E31-AA362D86F2C3", "LinearShuntCompensator", null, "12345", "user"));

// System.out.println
} catch (Exception e) {
Expand Down Expand Up @@ -733,7 +733,12 @@ protected String resultSetToJson(ResultSet rs){
HashMap<String, JsonObject> resultObjects = new HashMap<String, JsonObject>();
while( rs.hasNext()) {
QuerySolution qs = rs.nextSolution();
String subject = qs.getResource(SUBJECT).getLocalName();
String subject = qs.getResource(SUBJECT).toString();
if(!subject.contains("urn:uuid")){
subject = qs.getResource(SUBJECT).getLocalName();
} else {
subject = subject.substring(subject.lastIndexOf(':')+1);
}
JsonObject obj = new JsonObject();
if(resultObjects.containsKey(subject)){
obj = resultObjects.get(subject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public String startServiceForSimultion(String serviceId, HashMap<String, Object>
if(serviceDirectory.exists())
processServiceBuilder.directory(serviceDirectory);
processServiceBuilder.redirectErrorStream(true);
processServiceBuilder.redirectOutput();
processServiceBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);

logManager.info(ProcessStatus.RUNNING, simulationId, "Starting service with command "+ String.join(" ",commands));
process = processServiceBuilder.start();
Expand All @@ -350,7 +350,7 @@ public String startServiceForSimultion(String serviceId, HashMap<String, Object>
if(serviceDirectory.exists())
processServiceBuilder.directory(serviceDirectory);
processServiceBuilder.redirectErrorStream(true);
processServiceBuilder.redirectOutput();
processServiceBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
logManager.info(ProcessStatus.RUNNING, simulationId, "Starting service with command "+ String.join(" ",commands));
process = processServiceBuilder.start();

Expand All @@ -361,7 +361,7 @@ public String startServiceForSimultion(String serviceId, HashMap<String, Object>
if(serviceDirectory.exists())
processServiceBuilder.directory(serviceDirectory);
processServiceBuilder.redirectErrorStream(true);
processServiceBuilder.redirectOutput();
processServiceBuilder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
logManager.info(ProcessStatus.RUNNING, simulationId, "Starting service with command "+ String.join(" ",commands));
process = processServiceBuilder.start();

Expand Down
4 changes: 2 additions & 2 deletions services/helicsgossbridge/service/helics_goss_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1431,9 +1431,9 @@ def _create_cim_object_map(self,map_file=None):
"prefix" : "cap_"
}
for y in regulators:
object_mrids = y.get("mRID",[])
object_mrids = y.get("mRIDs",[])
object_name = y.get("bankName")
object_phases = y.get("endPhase",[])
object_phases = y.get("endPhases",[])
for z in range(len(object_mrids)):
self._object_mrid_to_name[object_mrids[z]] = {
"name" : object_name,
Expand Down