Skip to content

Commit

Permalink
Merge pull request #1066 from GRIDAPPSD/releases/2019.08.1
Browse files Browse the repository at this point in the history
Release of version 2019.08.1
  • Loading branch information
poorva1209 authored Aug 20, 2019
2 parents c6facd4 + 7114c02 commit 1fbda8b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,13 @@ void parseMeasurement(Map<String, JsonArray> measurements, JsonObject measuremen
} else if (conductingEquipmentType.contains("SynchronousMachine")) {
if(measurementType.equals("VA")) {
objectName = conductingEquipmentName;
propertyName = "power_out_" + phases;
propertyName = "measured_power_" + phases;
} else if (measurementType.equals("PNV")) {
objectName = connectivityNode;
propertyName = "voltage_" + phases;
} else if (measurementType.equals("A")) {
objectName = conductingEquipmentName;
propertyName = "current_out_" + phases;
propertyName = "measured_current_" + phases;
} else {
throw new JsonParseException(String.format("CimMeasurementsToGldPubs::parseMeasurement: The value of measurementType is not a valid type.\nValid types for SynchronousMachine are VA, A, and PNV.\nmeasurementType = %s.",measurementType));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

public class TimeSeriesEntryResult {
ArrayList<HashMap<String,Object>> data;


public ArrayList<HashMap<String,Object>> getData() {
if(data==null){
Expand All @@ -32,33 +33,14 @@ public String toString() {
}

public static TimeSeriesEntryResult parse(String jsonString) {
Type listType = new TypeToken<ArrayList<HashMap<String, Object>>>(){}.getType();
Gson gson = new Gson();
TimeSeriesEntryResult obj = gson.fromJson(jsonString, TimeSeriesEntryResult.class);
TimeSeriesEntryResult obj = new TimeSeriesEntryResult();
ArrayList<HashMap<String, Object>> data = gson.fromJson(jsonString, listType);
obj.setData(data);
if(obj.data==null)
throw new JsonSyntaxException("Expected attribute measurements not found");
return obj;
}

public static void main(String[] args){

Type listType = new TypeToken<ArrayList<HashMap<String, Object>>>(){}.getType();

String jsonString = "{\"data\":[{\"Diffuse\":19.958636,\"AvgWindSpeed\":7.9434,\"TowerRH\":31.61,\"long\":\"105.18 W\",\"MST\":\"13:44\",\"TowerDryBulbTemp\":74.534,\"DATE\":\"892013\",\"DirectCH1\":-0.0531206845,\"GlobalCM22\":20.2478337,\"AvgWindDirection\":359.3,\"time\":1376077440,\"place\":\"Solar Radiation Research Laboratory\",\"lat\":\"39.74 N\"}]}";
Gson gson = new Gson();
//jsonString = jsonString.substring(8, jsonString.length()-1);

System.out.println(jsonString);

//ArrayList<HashMap<String, Object>> obj = gson.fromJson(jsonString, listType);
TimeSeriesEntryResult obj = gson.fromJson(jsonString, TimeSeriesEntryResult.class);
System.out.println(obj);







}

}
2 changes: 1 addition & 1 deletion services/fncsgossbridge/service/fncs_goss_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ def _create_cim_object_map(map_file=None):
elif "SynchronousMachine" in conducting_equipment_type:
if measurement_type == "VA":
object_name = conducting_equipment_name;
property_name = "power_out_" + phases;
property_name = "measured_power_" + phases;
elif measurement_type == "PNV":
object_name = connectivity_node;
property_name = "voltage_" + phases;
Expand Down

0 comments on commit 1fbda8b

Please sign in to comment.