From: luukkainen Date: Mon, 3 Sep 2012 07:32:32 +0000 (+0000) Subject: refs #3674 X-Git-Tag: simantics-1.7~4^2~12 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=ff3ca553c8ced49da089faf58dce06c31d341c74;p=simantics%2Fsysdyn.git refs #3674 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@25588 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java b/org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java index 6445ce40..ff8170ad 100644 --- a/org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java +++ b/org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java @@ -318,7 +318,9 @@ public class ModelicaManager { try { // Find OMC - File openModelicaHome = getModelicaHome(); + File openModelicaHome = simulationLocation.omcHome; + if (openModelicaHome == null) + openModelicaHome = getModelicaHome(); // Create the build process ProcessBuilder processBuilder = new ProcessBuilder( @@ -384,7 +386,9 @@ public class ModelicaManager { // Set environment variables for the process Map env = processBuilder.environment(); - File openModelicaHome = getModelicaHome(); + File openModelicaHome = simulationLocation.omcHome; + if (openModelicaHome == null) + openModelicaHome = getModelicaHome(); env.put("OPENMODELICAHOME", openModelicaHome.getAbsolutePath()); env.put("OPENMODELICALIBRARY", openModelicaHome.getAbsolutePath() + "\\lib\\omlibrary"); env.put("OMPATH", openModelicaHome.getAbsolutePath() + "\\bin"); diff --git a/org.simantics.modelica/src/org/simantics/modelica/SimulationLocation.java b/org.simantics.modelica/src/org/simantics/modelica/SimulationLocation.java index c00bc77e..696d2e01 100644 --- a/org.simantics.modelica/src/org/simantics/modelica/SimulationLocation.java +++ b/org.simantics.modelica/src/org/simantics/modelica/SimulationLocation.java @@ -24,6 +24,7 @@ public class SimulationLocation { public File outputFile; public File initFile; public File simulatorFile; + public File omcHome; public SimulationLocation(File simulationDir, File inputFile, File outputFile, File initFile, File exeFile) { @@ -33,4 +34,8 @@ public class SimulationLocation { this.initFile = initFile; this.simulatorFile = exeFile; } + + public void setOMCHomeFolder(File omcHome) { + this.omcHome = omcHome; + } } \ No newline at end of file