@@ -11,7 +11,6 @@ |
import java.io.IOException; |
import java.util.logging.Logger; |
import oms3.util.ProcessComponent; |
-import csip.utils.Binaries; |
import csip.utils.Services; |
import java.io.BufferedReader; |
import java.io.BufferedWriter; |
@@ -45,36 +44,6 @@ |
|
|
/** |
- * Execute the r2 script. |
- * |
- * @param r2_rsh |
- * @return |
- * @throws IOException |
- */ |
- int execute(File r2_rsh) throws IOException { |
- LOG.info("Execute method"); |
- String binDir = Config.getString("csip.bin.dir", "/tmp/csip/bin"); |
- |
- File romeshell = Binaries.unpackResource("/bin/win-x86/RomeShell.exe", new File(binDir)); |
- Binaries.unpackResource("/bin/win-x86/RomeDLL.dll", new File(binDir)); |
- |
- pc.exe = Config.getString("wine.path", "/usr/bin/wine"); |
- pc.working_dir = r2_rsh.getParent(); |
- pc.args = new String[]{romeshell.toString(), r2_rsh.toString()}; |
- LOG.info("Executing"); |
- pc.execute(); |
- LOG.info("executed"); |
- stdout += "\n" + pc.stdout; |
- stderr += "\n" + pc.stderr; |
- LOG.info("stdout: "+ stdout); |
- LOG.info(("stderr: "+ stderr)); |
- //LOG.info("rusle2 model run stdout=" + stdout); |
- LOG.info("exit val: "+pc.exitValue); |
- return pc.exitValue; |
- } |
- |
- |
- /** |
* Execute the rusle2 pyrome python script |
* |
* We assume that Python3.4 is installed under /home/ubuntu/.wine/drive_c/Python34 |
@@ -124,33 +93,6 @@ |
return ret; |
} |
|
- int executePyromeLegacy(File r2_rsh) throws IOException, ServiceException { |
- LOG.info("Execute method"); |
- String binDir = Config.getString("m.bin.dir", "/tmp/csip/bin"); |
- |
- File romeshell = Binaries.unpackResource("/bin/win-x86/RomeShell.exe", new File(binDir)); |
- |
- Binaries.unpackResource("/bin/win-x86/RomeDLL.dll", new File(binDir)); |
- Binaries.unpackResource("/bin/win-x86/pyrome.py", new File(binDir)); |
- Binaries.unpackResource("/bin/win-x86/_pyrome.pyd", new File(binDir)); |
- File runpyrome = new File(r2_rsh.getParent() + "/runrusle2.sh"); |
- String runrusle2 = "winetricks vd=off ; wine /home/ubuntu/.wine/drive_c/Python34/python.exe rusle2csip.py\n"; |
- FileUtils.writeStringToFile(runpyrome, runrusle2); |
- runpyrome.setExecutable(true); |
- pc.exe = "./runrusle2.sh"; |
- pc.working_dir = r2_rsh.getParent(); |
- pc.args = new String[]{}; |
- LOG.info("Executing pyrome rusle2"); |
- pc.execute(); |
- LOG.info("executed pyrome rusle2"); |
- stdout += "\n" + pc.stdout; |
- stderr += "\n" + pc.stderr; |
- LOG.info("stdout: "+ stdout); |
- LOG.info(("stderr: "+ stderr)); |
- LOG.info("exit val: "+pc.exitValue); |
- return pc.exitValue; |
- } |
- |
// prepares soils file for legacy 1.3 rusle2 service |
int prepareSoilsFile(String soilsHttpPtr, File workingDir, boolean bPyrome, String idx) throws IOException { |
// Generate shell script to prepare soils file for romeshell or pyrome |