Skip to content

Commit

Permalink
Fixes to work with the new seto models, updated service manager so th…
Browse files Browse the repository at this point in the history
…at the output from the services is added to the gridappsd logs
  • Loading branch information
tdtalbot committed Feb 13, 2025
1 parent 874309d commit 6b07911
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
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
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

0 comments on commit 6b07911

Please sign in to comment.