@@ -33,11 +33,8 @@ |
private void addRestResourceClasses(Set<Class<?>> resources) { |
resources.add(c.MsSQLGIS.class); |
resources.add(csip.ArchiveService.class); |
- resources.add(csip.CatalogService.class); |
- resources.add(csip.ControlService.class); |
resources.add(csip.QueryService.class); |
resources.add(csip.ReportService.class); |
- resources.add(csip.UIService.class); |
resources.add(d.rusle2.CMZ1_0.class); |
resources.add(d.rusle2.CMZ1_1.class); |
resources.add(d.rusle2.Climate1_0.class); |
@@ -49,11 +49,13 @@ |
// New member variables |
public String m_sDirectory; |
public String m_sUnits; |
+ private double conversionFactor; |
|
- public StirEnergyResultSet(WepsConnection con, String sDirectory, String sUnits) { |
+ public StirEnergyResultSet(WepsConnection con, String sDirectory, String sUnits,double conversionFactor) { |
super(con); |
m_sDirectory = sDirectory; |
m_sUnits = sUnits; |
+ this.conversionFactor = conversionFactor; |
|
// c_con = con; |
// addColumn(RunsResultSet.COLUMN_RUNID, Types.INTEGER, 10, 0); |
@@ -168,7 +170,7 @@ |
setRowValue(row, COLUMN_FUELDEFAULT, false); |
} |
|
- setRowValue(row, COLUMN_FUEL, fuelText); |
+ setRowValue(row, COLUMN_FUEL,fuelText); |
} |
else{ |
String fuelText = ConfigData.getDefault().getData(ConfigData.FuelDefault); |
@@ -189,7 +191,7 @@ |
String energyText = values[column(columns, "energy")].trim(); |
Double energy = Double.valueOf(energyText); |
if (isUSUnits()){ |
- energy = ConversionCalculator.convert(energy, "L/ha", "gal/ac"); |
+ energy = ConversionCalculator.convert(energy, "L/ha", "gal/ac") * conversionFactor;; |
} |
setRowValue(row, COLUMN_ENERGY, energy); |
} |
@@ -42,11 +42,14 @@ |
m_con = con; |
} |
|
+ public boolean loadFiles(String path,String stdfilename,String version){ |
+ return loadFiles(path,stdfilename,version,1); // default is diesel so the conversionFactor should have no affect on the fuel |
+ } |
/** |
* Load WEPS output files into the data map. |
* @return true on success, false on failure. |
*/ |
- public boolean loadFiles(String path,String stdfilename,String version) { |
+ public boolean loadFiles(String path,String stdfilename,String version,double conversionFactor) { |
try { |
|
// Try loading each of the output files in sequence. |
@@ -58,9 +61,10 @@ |
loadOutputResultSet(path); |
loadRunsResultSet(stdfilename); |
loadSciEnergyResultSet(); |
- loadStirEnergyResultSet(); |
+ loadStirEnergyResultSet(conversionFactor); |
} |
catch(Exception e) { |
+ |
return false; |
} |
|
@@ -68,7 +72,7 @@ |
} |
|
public boolean loadFiles(String path) { |
- return loadFiles(path,RunFileData.StdOut,""); |
+ return loadFiles(path,RunFileData.StdOut,"",1); |
} |
|
/** |
@@ -137,10 +141,11 @@ |
|
/** |
* Load the WEPS output data from one of its text files. |
+ * @param conversionFactor |
*/ |
- public void loadStirEnergyResultSet() { |
+ public void loadStirEnergyResultSet(double conversionFactor) { |
// @todo Check configuration options to see if we should load this file. |
- StirEnergyResultSet resultset = new StirEnergyResultSet(m_con, m_sInputDirectory, m_sUnits); |
+ StirEnergyResultSet resultset = new StirEnergyResultSet(m_con, m_sInputDirectory, m_sUnits,conversionFactor); |
resultset.fill(); |
} |
|
@@ -1,5 +1,5 @@ |
{ |
- "csip-erosion.version": "$version: 2.0.83 88385be665f0 2017-04-05 Jakob23, built at 2017-04-11 13:32 by Brad$", |
+ "csip-erosion.version": "$version: 2.0.86 b95b2313f6f8 2017-04-11 Jakob23, built at 2017-05-04 09:41 by Brad$", |
"lmod.db": "jdbc:sqlserver:\/\/129.82.20.129:1433;databaseName=lmod_temp;user=lmod-rw;password=managements", |
"conservation_resources.db": "jdbc:sqlserver://129.82.20.129:1433;databaseName=conservation_resources;user=sa;password=csurams#1", |
"conservation_resources.database": "mssql", |
@@ -1,5 +1,5 @@ |
{ |
- "csip-erosion.version": "$version: 2.0.83 88385be665f0 2017-04-05 Jakob23, built at 2017-04-11 13:32 by Brad$", |
+ "csip-erosion.version": "$version: 2.0.86 b95b2313f6f8 2017-04-11 Jakob23, built at 2017-05-04 09:41 by Brad$", |
"weps.version" : "1.3.9", |
"lmod.db": "jdbc:sqlserver:\/\/129.82.20.242:1433;databaseName=lmod_zedx;user=lmod-rw;password=managements", |
"conservation_resources.db": "jdbc:sqlserver://129.82.20.241:1433;databaseName=conservation_resources;user=sa;password=csurams#1", |