From ff3ca553c8ced49da089faf58dce06c31d341c74 Mon Sep 17 00:00:00 2001 From: luukkainen Date: Mon, 3 Sep 2012 07:32:32 +0000 Subject: [PATCH] refs #3674 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@25588 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../src/org/simantics/modelica/ModelicaManager.java | 8 ++++++-- .../src/org/simantics/modelica/SimulationLocation.java | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) 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 -- 2.47.1