]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
refs #3674
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 3 Sep 2012 07:32:32 +0000 (07:32 +0000)
committerluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 3 Sep 2012 07:32:32 +0000 (07:32 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@25588 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.modelica/src/org/simantics/modelica/ModelicaManager.java
org.simantics.modelica/src/org/simantics/modelica/SimulationLocation.java

index 6445ce4057d3a9f71076d06b0d528e1952f2d60e..ff8170adbc02652376fded3d89f455e709e61482 100644 (file)
@@ -318,7 +318,9 @@ public class ModelicaManager {
         try {\r
 \r
             // Find OMC\r
-            File openModelicaHome = getModelicaHome();\r
+            File openModelicaHome = simulationLocation.omcHome;\r
+            if (openModelicaHome == null)\r
+               openModelicaHome = getModelicaHome();\r
             \r
             // Create the build process\r
             ProcessBuilder processBuilder = new ProcessBuilder(\r
@@ -384,7 +386,9 @@ public class ModelicaManager {
             \r
             // Set environment variables for the process\r
             Map<String, String> env = processBuilder.environment();\r
-            File openModelicaHome = getModelicaHome();\r
+            File openModelicaHome = simulationLocation.omcHome;\r
+            if (openModelicaHome == null)\r
+               openModelicaHome = getModelicaHome();\r
             env.put("OPENMODELICAHOME", openModelicaHome.getAbsolutePath());\r
             env.put("OPENMODELICALIBRARY", openModelicaHome.getAbsolutePath() + "\\lib\\omlibrary");\r
             env.put("OMPATH", openModelicaHome.getAbsolutePath() + "\\bin");\r
index c00bc77e482b1090edbae199246eaf78263233a7..696d2e01164b8b0cff2e643decfaa76092ef61ab 100644 (file)
@@ -24,6 +24,7 @@ public class SimulationLocation {
     public File outputFile;\r
     public File initFile;\r
     public File simulatorFile;\r
+    public File omcHome;\r
     \r
     public SimulationLocation(File simulationDir, File inputFile,\r
             File outputFile, File initFile, File exeFile) {\r
@@ -33,4 +34,8 @@ public class SimulationLocation {
         this.initFile = initFile;\r
         this.simulatorFile = exeFile;\r
     }\r
+    \r
+    public void setOMCHomeFolder(File omcHome) {\r
+       this.omcHome = omcHome;\r
+    }\r
 }
\ No newline at end of file