Skip to content

Commit

Permalink
Merge pull request #1784 from tdtalbot/cimext_master_merge
Browse files Browse the repository at this point in the history
Cimext master merge
  • Loading branch information
poorva1209 authored Jul 25, 2024
2 parents c931616 + 464572c commit f2c206c
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cnf/ext/repositories.bnd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-plugin: \
aQute.bnd.deployer.repository.FixedIndexedRepo;name=GOSS Core;locations=https://raw.githubusercontent.com/GridOptics/GOSS/master/cnf/releaserepo/index.xml,\
aQute.bnd.deployer.repository.FixedIndexedRepo; name=GOSS Dependencies; locations=https://github.com/GridOptics/GOSS-Repository/raw/master/dependencies/index.xml.gz,\
aQute.bnd.deployer.repository.FixedIndexedRepo;name=CIMHub;locations=https://raw.githubusercontent.com/GRIDAPPSD/CIMHub/master/cnf/release/index.xml,\
aQute.bnd.deployer.repository.FixedIndexedRepo;name=CIMHub;locations=https://raw.githubusercontent.com/GRIDAPPSD/CIMHub/seto_master_merge/cnf/release/index.xml,\
aQute.bnd.deployer.repository.LocalIndexedRepo;name=Local;local=${workspace}/cnf/Local;pretty=true,\
aQute.bnd.deployer.repository.FixedIndexedRepo;name=BND Hub;locations=https://raw.githubusercontent.com/bndtools/bundle-hub/master/index.xml.gz,\
aQute.lib.deployer.FileRepo;name=Build;location=${workspace}/cnf/buildrepo;latest=false
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion gov.pnnl.goss.gridappsd/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
osgi.enroute.base.api,\
org.mockito.mockito-all,\
httpcore,\
cimhub.lib;version=1.0.1,\
cimhub.lib;version=2.0.1,\
httpclient,\
com.bigdata.rdf,\
org.glassfish.jersey.core.jersey-client;version=2.26,\
Expand Down
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 @@ -5,7 +5,7 @@ fncs.bridge.path = ./scripts/goss_fncs_bridge.py
applications.path = /gridappsd/applications
services.path = /gridappsd/services
# Requires no /
blazegraph.ns.path = http://localhost:8889/bigdata/namespace/kb/sparql
blazegraph.ns.path = urn:uuid:

# Uses docker composed blazegraph host here. Note this is not the
# external address, but from inside one of the containers on the
Expand Down
2 changes: 1 addition & 1 deletion gov.pnnl.goss.gridappsd/gridappsd.api.bnd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Bundle-Version: 1.0.0.${tstamp}
Bundle-Version: 2.0.0.${tstamp}
Export-Package: \
gov.pnnl.goss.gridappsd.dto.field,\
gov.pnnl.goss.gridappsd.api,\
Expand Down
2 changes: 1 addition & 1 deletion gov.pnnl.goss.gridappsd/gridappsd.bnd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Bundle-Version: 0.0.1.${tstamp}
Bundle-Version: 1.0.0.${tstamp}

Private-Package: \
gov.pnnl.goss.gridappsd.configuration,\
Expand Down
2 changes: 1 addition & 1 deletion gov.pnnl.goss.gridappsd/run.bnd.bndrun
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
httpcore,\
httpclient,\
xml-apis,\
cimhub.lib;version=1.0.1,\
cimhub.lib;version=2.0.1,\
org.eclipse.jetty.aggregate.jetty-all-server;version=7.6.9,\
com.bigdata.rdf,\
proven-message;version=0.5,\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
* PACIFIC NORTHWEST NATIONAL LABORATORY operated by BATTELLE for the
* UNITED STATES DEPARTMENT OF ENERGY under Contract DE-AC05-76RL01830
******************************************************************************/
@aQute.bnd.annotation.Version("1.0.0")
@aQute.bnd.annotation.Version("2.0.0")
package gov.pnnl.goss.gridappsd.api;
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@

import java.io.File;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Properties;

import org.apache.felix.dm.annotation.api.Component;
Expand Down Expand Up @@ -227,12 +228,14 @@ public void generateConfig(Properties parameters, PrintWriter out, String proces
boolean bHaveEventGen = true;

//TODO add climate

String fEarth = "carson"; //values "deri", "carson", or "fullcarson". This only matters for OpenDSS, which uses "deri" by default. However, "carson" gives the best match to GridLAB-D
int iManualFile = 0; //values 1 to reference manual pre-edits, 2 for post-edits, 3 for both edits in exported
boolean bUseProfiles = true; //true to use players, schedules and shapes
//cimhub utility uses
CIMImporter cimImporter = new CIMImporter();
CIMQuerySetter qs = new CIMQuerySetter();
cimImporter.start(queryHandler, qs, CONFIGTARGET, fRoot, scheduleName, loadScale, bWantSched, bWantZip, bWantRandomFractions, useHouses, zFraction, iFraction, pFraction, bHaveEventGen, modelState, false);
cimImporter.start(queryHandler, qs, CONFIGTARGET, fRoot, scheduleName, loadScale, bWantSched, bWantZip, bWantRandomFractions, useHouses, zFraction, iFraction, pFraction, bHaveEventGen, modelState, false, fEarth, iManualFile, bUseProfiles);
logManager.info(ProcessStatus.RUNNING, processId, "Finished generating all DSS configuration files.");


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,18 @@ public void generateConfig(Properties parameters, PrintWriter out, String proces
//TODO write a query handler that uses the built in powergrid model data manager that talks to blazegraph internally
QueryHandler queryHandler = new BlazegraphQueryHandler(bgHost, logManager, processId, username);
queryHandler.addFeederSelection(modelId);

String fEarth = "carson"; //values "deri", "carson", or "fullcarson". This only matters for OpenDSS, which uses "deri" by default. However, "carson" gives the best match to GridLAB-D
boolean bUseProfiles = true; //true to use players, schedules and shapes
CIMImporter cimImporter = new CIMImporter();
//If the simulation info is available also write to file
if(configFile!=null){
cimImporter.generateDSSFile(queryHandler, new PrintWriter(new FileWriter(configFile)), new PrintWriter(new FileWriter(idFile)), buscoords, guids, loadScale,
bWantSched, null, bWantZip, zFraction, iFraction, pFraction);
bWantSched, null, bWantZip, zFraction, iFraction, pFraction, fEarth, bUseProfiles);
//config was written to base file, so return that
printFileToOutput(configFile, out);
} else {
PrintWriter idFileWriter = new PrintWriter(new StringWriter());
cimImporter.generateDSSFile(queryHandler, out, idFileWriter, buscoords, guids, loadScale, bWantSched, null, bWantZip, zFraction, iFraction, pFraction);
cimImporter.generateDSSFile(queryHandler, out, idFileWriter, buscoords, guids, loadScale, bWantSched, null, bWantZip, zFraction, iFraction, pFraction, fEarth, bUseProfiles);
idFileWriter.close();
}
logManager.info(ProcessStatus.RUNNING, processId, "Finished generating DSS Base configuration file.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,13 @@ public void generateConfig(Properties parameters, PrintWriter out, String proces
logManager.error(ProcessStatus.ERROR,processId,"No "+SEPARATED_LOADS_FILE+" parameter provided");
throw new Exception("Missing parameter "+SEPARATED_LOADS_FILE);
}

String fEarth = "carson"; //values "deri", "carson", or "fullcarson". This only matters for OpenDSS, which uses "deri" by default. However, "carson" gives the best match to GridLAB-D
int iManualFile = 0; //values 1 to reference manual pre-edits, 2 for post-edits, 3 for both edits in exported
boolean bUseProfiles = true; //true to use players, schedules and shapes
//cimhub utility uses
CIMImporter cimImporter = new CIMImporter();
CIMQuerySetter qs = new CIMQuerySetter();
cimImporter.start(queryHandler, qs, CONFIGTARGET, fRoot, scheduleName, loadScale, bWantSched, bWantZip, bWantRandomFractions, useHouses, zFraction, iFraction, pFraction, -1, bHaveEventGen, modelState, false, separateLoads);
cimImporter.start(queryHandler, qs, CONFIGTARGET, fRoot, scheduleName, loadScale, bWantSched, bWantZip, bWantRandomFractions, useHouses, zFraction, iFraction, pFraction, -1, bHaveEventGen, modelState, false, fEarth, iManualFile, bUseProfiles, separateLoads);
String tempDataPath = dir.getAbsolutePath();

//If use climate, then generate gridlabd weather data file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,17 @@ public void generateConfig(Properties parameters, PrintWriter out, String proces
queryHandler.addFeederSelection(modelId);

boolean useHouses = GridAppsDConstants.getBooleanProperty(parameters, USEHOUSES, false);

boolean bUseProfiles = true; //bUseProfiles true to use players, schedules and shapes
boolean bHaveEventGen = true;

CIMImporter cimImporter = new CIMImporter();
CIMQuerySetter qs = new CIMQuerySetter();

//If the simulation info is available also write to file
if(configFile!=null){
cimImporter.generateGLMFile(queryHandler, qs, new PrintWriter(new FileWriter(configFile)), scheduleName, loadScale, bWantSched, bWantZip, bWantRandomFractions, useHouses, zFraction, iFraction, pFraction, bHaveEventGen);
cimImporter.generateGLMFile(queryHandler, qs, new PrintWriter(new FileWriter(configFile)), scheduleName, loadScale, bWantSched, bWantZip, bWantRandomFractions, useHouses, zFraction, iFraction, pFraction, bHaveEventGen, bUseProfiles);
} else {
cimImporter.generateGLMFile(queryHandler, qs, out, scheduleName, loadScale, bWantSched, bWantZip, bWantRandomFractions, useHouses,zFraction, iFraction, pFraction, bHaveEventGen);
cimImporter.generateGLMFile(queryHandler, qs, out, scheduleName, loadScale, bWantSched, bWantZip, bWantRandomFractions, useHouses,zFraction, iFraction, pFraction, bHaveEventGen, bUseProfiles);
}
if(configFile!=null){
//config was written to file, so return that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ public static void main(String[] args){
// " ?pxf c:IdentifiedObject.name ?key"+
// "} GROUP BY ?key ORDER BY ?key";
// BGPowergridModelDataManagerImpl bg = new BGPowergridModelDataManagerImpl("http://localhost:9999/blazegraph/namespace/kb/sparql");
// BGPowergridModelDataManagerImpl bg = new BGPowergridModelDataManagerImpl("http://192.168.99.100:8889/bigdata/namespace/kb/sparql");
BGPowergridModelDataManagerImpl bg = new BGPowergridModelDataManagerImpl("http://localhost:8889/bigdata/namespace/kb/sparql");
// BGPowergridModelDataManagerImpl bg = new BGPowergridModelDataManagerImpl("http://192.168.99.100:8889/bigdata/namespace/kb/sparql");
BGPowergridModelDataManagerImpl bg = new BGPowergridModelDataManagerImpl("urn:uuid");
bg.logManager = new LogManagerImpl();

bg.endpointNSURL = "http://localhost:8889/bigdata/namespace/kb/sparql";
bg.endpointNSURL = "urn:uuid";
try {
// String query = "select ?s ?p ?o where {?s r:type c:ConnectivityNode. ?s ?p ?o}";
// System.out.println(bg.query("ieee13", query, "JSON"));
Expand Down Expand Up @@ -978,7 +978,7 @@ public void putModel(String modelId, String model, String inputFormat, String pr

private String getEndpointNS(String modelId){
if(modelId!=null) {
return endpointNSURL+"#"+modelId;
return endpointNSURL+modelId;
}
return endpointNSURL;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
* PACIFIC NORTHWEST NATIONAL LABORATORY operated by BATTELLE for the
* UNITED STATES DEPARTMENT OF ENERGY under Contract DE-AC05-76RL01830
******************************************************************************/
@aQute.bnd.annotation.Version("1.0.0")
@aQute.bnd.annotation.Version("2.0.0")
package gov.pnnl.goss.gridappsd.dto;

0 comments on commit f2c206c

Please sign in to comment.