]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
The single simulation results are now drawn in sensitivity analysis.
authormiettinen <miettinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 5 Apr 2013 07:34:59 +0000 (07:34 +0000)
committermiettinen <miettinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Fri, 5 Apr 2013 07:34:59 +0000 (07:34 +0000)
Added also two icons but they are not used currently. (refs #4177)

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@27249 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/icons/bullet_gray.png [new file with mode: 0644]
org.simantics.sysdyn.ui/icons/bullet_green.png [new file with mode: 0644]
org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynSensitivityAnalysisExperiment.java

diff --git a/org.simantics.sysdyn.ui/icons/bullet_gray.png b/org.simantics.sysdyn.ui/icons/bullet_gray.png
new file mode 100644 (file)
index 0000000..6f58b93
Binary files /dev/null and b/org.simantics.sysdyn.ui/icons/bullet_gray.png differ
diff --git a/org.simantics.sysdyn.ui/icons/bullet_green.png b/org.simantics.sysdyn.ui/icons/bullet_green.png
new file mode 100644 (file)
index 0000000..1b5409f
Binary files /dev/null and b/org.simantics.sysdyn.ui/icons/bullet_green.png differ
index 4d8816e09f3d3f94733816126b53d881a90ccc31..2a0d2c1d4c31106fbf88bdb249041203e35cac9d 100644 (file)
@@ -132,10 +132,18 @@ public class SysdynSensitivityAnalysisExperiment extends SysdynExperiment {
             \r
             results = null;\r
             // Simulate the model\r
+            \r
+            /* If the changes is altered, it affects also to the next simulation. So,\r
+             * All the parameters that are to be altered need to be defined explicitly\r
+             * before each new simulation.   \r
+             */\r
+            \r
+            changes = new HashMap<String, String>();\r
+            changes.put("Auxiliary1", "444.0");\r
             runModelica(simulationLocation, modelText, monitor, progressMonitor, experimentParameters, changes, 0);\r
-\r
+            changes.put("Auxiliary1", "333.0");\r
             runModelica(simulationLocation, modelText, monitor, progressMonitor, experimentParameters, changes, 1);\r
-\r
+            changes.put("Auxiliary1", "222.0");\r
             runModelica(simulationLocation, modelText, monitor, progressMonitor, experimentParameters, changes, 2);\r
         }\r
         if(canceled)\r
@@ -290,6 +298,32 @@ public class SysdynSensitivityAnalysisExperiment extends SysdynExperiment {
         return this.results;\r
     }\r
     \r
+    @Override\r
+    public Collection<SysdynResult> getActiveResults() {\r
+        ArrayList<SysdynResult> result = new ArrayList<SysdynResult>();\r
+        result.addAll(getCurrentResults());\r
+        result.addAll(sysdynModel.getDisplayedResults());\r
+        return result;\r
+    }\r
+    \r
+    @Override\r
+    public MemoryResult getCurrentResult() {\r
+        if (this.results == null || this.results.size() < 1)\r
+            return null;\r
+        /* There should be a better alternative solution for this. Currently\r
+         * the return value is next to nonsense.\r
+         */\r
+        return this.results.get(0);\r
+    }\r
+    \r
+    @Override\r
+    public void saveState() {\r
+        if(results == null || !(results instanceof ArrayList<?>)) \r
+            return;\r
+        //SaveResultJob saveResultJob = new SaveResultJob(SysdynSensitivityAnalysisExperiment.this, session, results);\r
+        //saveResultJob.schedule();\r
+    }\r
+    \r
     //this.results.add(new MemoryResult(null, null));\r
 \r
     \r