From 9b3b26d6b68cf6d11ece48c02295b79ada02614e Mon Sep 17 00:00:00 2001 From: lempinen Date: Fri, 15 Feb 2013 15:01:30 +0000 Subject: [PATCH] Parameters used the first two of all time values instead of using the first and the last value (refs #3983) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@26787 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../src/org/simantics/modelica/data/SimulationResult.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.simantics.modelica/src/org/simantics/modelica/data/SimulationResult.java b/org.simantics.modelica/src/org/simantics/modelica/data/SimulationResult.java index cdfc3aca..bb8f2dd9 100644 --- a/org.simantics.modelica/src/org/simantics/modelica/data/SimulationResult.java +++ b/org.simantics.modelica/src/org/simantics/modelica/data/SimulationResult.java @@ -452,7 +452,10 @@ public class SimulationResult { List names = resultFileReader.getNames(); if (names.contains(variable)) { double[] resArray = resultFileReader.readData(variable, 0, allTimes.length, skip); - ds = new DataSet(variable, allTimes, resArray); + double[] timesArray = allTimes; + if(resArray.length == 2 && timesArray.length > 2) + timesArray = new double[] {timesArray[0], timesArray[timesArray.length - 1]}; + ds = new DataSet(variable, timesArray, resArray); for (DataSet tempds : variables){ if (tempds.name.equals(variable)) // We should never need to go there unless some change in -- 2.47.1