for(SysdynResult result : results) {\r
SysdynDataSet ds = result.getDataSet(variableNamesWithIndexes.get(i));\r
if(ds != null) {\r
- ds.name = variableNames.get(i);\r
+ \r
+ /* Change the name if necessary\r
+ Name needs to be changed if it contains indexes. Dataset names\r
+ contains indexes as numbers, asked names as index names.\r
+ \r
+ There are cases where dataset names could actually be different \r
+ from asked names. HistoryDatasets are one example. In that case, show the \r
+ datasetname.\r
+ */\r
+ String askedName = variableNames.get(i);\r
+ if(askedName.contains("["))\r
+ askedName = askedName.substring(0, askedName.indexOf("["));\r
+ String datasetname = ds.name;\r
+ if(datasetname.contains("["))\r
+ datasetname = datasetname.substring(0, datasetname.indexOf("["));\r
+ \r
+ if(askedName.equals(datasetname))\r
+ ds.name = askedName;\r
+ \r
datasets.add(ds);\r
}\r
}\r
public MemoryResult(SimulationResult result, String resultName) {\r
super(resultName);\r
\r
+ results = new THashMap<String, SysdynDataSet>();\r
+\r
if(result != null)\r
setResult(result);\r
\r
- results = new THashMap<String, SysdynDataSet>();\r
}\r
\r
@Override\r
ds = simulationResult.readVariable(variable, resultFile);\r
\r
if(ds != null) {\r
- SysdynDataSet sds = new SysdynDataSet(variable, getResultName(), ds.times, ds.values, resultIndex);\r
+ SysdynDataSet sds = new SysdynDataSet(ds.name, getResultName(), ds.times, ds.values, resultIndex);\r
results.put(variable, sds);\r
return sds;\r
}\r