import org.simantics.db.WriteGraph;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.variable.Variable;\r
+import org.simantics.fmu.FMUJNIException;\r
import org.simantics.sysdyn.manager.SysdynDataSet;\r
+import org.simantics.sysdyn.manager.SysdynGameExperiment;\r
import org.simantics.sysdyn.manager.SysdynResult;\r
\r
public class ValuesIndexVariable extends IndexVariable<double[][]> {\r
for(int j = 0; j < ds.values.length; j++) {\r
result[i][j] = ds.values[j];\r
}\r
+ \r
+ // if this is the actual simulation result and experiment is game experiment, \r
+ // get the last value from fmu control.\r
+ if(experiment instanceof SysdynGameExperiment && ds.result == null) {\r
+ try {\r
+ double d = ((SysdynGameExperiment)experiment).getFMUControl().getRealValue(variableNames.get(i));\r
+ result[i][ds.values.length - 1] = d;\r
+ } catch (FMUJNIException e) {\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ \r
} else {\r
result[i] = new double[0];\r
}\r