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

Addition to powergrid model api to insert measurements #1589

Open
wants to merge 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ public enum ResultFormat {

void putModel(String modelId, String model, String inputFormat, String processId, String username);

void insertAllMeasurements(String processId, String username, String baseDirectory) throws Exception;
void insertMeasurements(String modelNames, String modelId, String processId, String username, String baseDirectory);
void dropAllMeasurements(String processId, String username);
void dropMeasurements(String modelNames, String modelId, String processId, String username);

void insertAllHouses( String processId, String username, String baseDirectory);
void insertHouses(String modelName, String modelId, String processId, String username, String baseDirectory);
void dropHouses(String modelName, String modelId, String processId, String username, String baseDirectory);

void insertDER(String modelNames, String processId, String username, String baseDirectory);

//Also will need putObject and deleteObject (will need to support the right security permissions)

}
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ public Serializable handle(Serializable requestContent, String processId, String
//TODO send error
}
return dataManager.queryMeasurementDictByObject(pgDataRequest.getResultFormat(), pgDataRequest.getModelId(), pgDataRequest.getObjectType(), pgDataRequest.getObjectId(), processId, username);
} else if(PowergridModelDataRequest.RequestType.INSERT_ALL_MEASUREMENTS.toString().equals(pgDataRequest.requestType)){
//TODO configmgr.get base directory
dataManager.insertAllMeasurements(processId, username, null);
return "";
} else if(PowergridModelDataRequest.RequestType.DROP_ALL_MEASUREMENTS.toString().equals(pgDataRequest.requestType)){
dataManager.dropAllMeasurements(processId, username);
return "";
} else {
//TODO report error, request type not recognized
System.out.println("DOESNT RECOGNIZE REQUEST TYPE "+pgDataRequest.requestType);
Expand Down
Loading