return sets[series].times.length;\r
}\r
\r
- @SuppressWarnings("unchecked")\r
@Override\r
- public Comparable getSeriesKey(int series) { \r
+ public Comparable<String> getSeriesKey(int series) { \r
SysdynDataSet sds = sets[series];\r
if(sds.result == null)\r
return sds.name;\r
return;\r
if(selection instanceof IStructuredSelection) {\r
Set<Resource> ress = ISelectionUtils.filterSetSelection(selection, Resource.class);\r
- Resource runtime = ISelectionUtils.getSinglePossibleKey(selection, SelectionHints.KEY_VARIABLE_RESOURCE, Resource.class);\r
-// Object[] els = ((IStructuredSelection) selection).toArray();\r
-// Resource[] resources = new Resource[els.length];\r
-// for(int i=0;i<els.length;++i) {\r
-// if(els[i] instanceof Resource)\r
-// resources[i] = (Resource)els[i];\r
-// else\r
-// return;\r
-// }\r
+ Resource runtime = ISelectionUtils.getPossibleKeys(selection, SelectionHints.KEY_VARIABLE_RESOURCE, Resource.class).get(0);\r
setSelection(ress.toArray(Resource.NONE), runtime);\r
} \r
}\r
});\r
\r
- /*composite.getDisplay().asyncExec(new Runnable() {\r
-\r
- @Override\r
- public void run() {\r
- // Do something\r
- }\r
-\r
- });*/ \r
}\r
\r
Resource[] resources;\r
final ArrayList<SysdynDataSet> datasets = new ArrayList<SysdynDataSet>();\r
for(Resource resource : resources) {\r
SysdynDataSet set = load(g, resource, runtime);\r
- if(set == null) return;\r
+ if(set == null) {\r
+ return;\r
+ }\r
datasets.add(set);\r
}
\r
});\r
}\r
\r
-// Runnable updater = new Runnable() {\r
-// @Override\r
-// public void run() {\r
-// updateView();\r
-// } \r
-// };\r
-//\r
-// HashMap<Resource, SysdynModel> models = new HashMap<Resource, SysdynModel>(); \r
-// protected SysdynModel getModel(ReadGraph g, Resource configuration) {\r
-// synchronized(models) {\r
-// SysdynModel model = models.get(configuration);\r
-// if(model == null) {\r
-// model = \r
-// SysdynModelManager.getInstance(g.getSession()).getModel(g, configuration);\r
-// // SimulationScheduler.start(model); Don't want this to operate simulation\r
-// model.addResultListener(updater);\r
-// models.put(configuration, model);\r
-// }\r
-// return model;\r
-// }\r
-// }\r
-\r
protected SysdynDataSet load(ReadGraph g, Resource element, Resource runtime) throws DatabaseException {\r
\r
Builtins b = g.getBuiltins();\r
}\r
return null;\r
\r
-// graph.syncre\r
-// \r
-// \r
-// String prefix = "";\r
-// Resource model = g.getResource((String)g.getPossibleRelatedValue(runtime, dr.HasModelURI));\r
-// Resource configuration = g.getPossibleObject(model, b.HasConfiguration);\r
-// String rvi = g.getPossibleRelatedValue(runtime, dr.HasRVI);\r
-// if(rvi.startsWith("/")) {\r
-// rvi = rvi.substring(1);\r
-// prefix = rvi.replace("/", ".") + ".";\r
-// } \r
-//// System.out.println("load results rvi='" + rvi + "' prefix='" + prefix + "'");\r
-// \r
-// ModelingResources mr = ModelingResources.getInstance(g);\r
-// Resource map = g.getPossibleObject(resource, mr.ElementToComponent);\r
-// if(map != null) resource = map;\r
-//\r
-// if(g.isInstanceOf(resource, sr.Variable)) {\r
-// Resource module = g.getPossibleObject(resource, b.PartOf);\r
-//// while(!g.isInstanceOf(module, sr.Configuration)) {\r
-//// module = g.getPossibleObject(module, b.PartOf);\r
-//// }\r
-// if(g.isInstanceOf(module, sr.Configuration)) {\r
-// \r
-// SysdynModel sm = getModel(g, configuration);\r
-// if(model == null)\r
-// return null;\r
-//\r
-// IElement element = sm.getElement(resource);\r
-// if(element instanceof Variable) {\r
-// Variable var = (Variable)element; \r
-//\r
-// Collection<SysdynResult> activeResults = sm.getActiveResults(g);\r
-// ArrayList<SysdynDataSet> datasets = new ArrayList<SysdynDataSet>();\r
-// for(SysdynResult r : activeResults) {\r
-// SysdynDataSet sdds = r.getDataSet(prefix + var.getName());\r
-// if(sdds != null) datasets.add(sdds);\r
-// }\r
-// return datasets;\r
-// } \r
-//\r
-// }\r
-// }\r
-// return null;\r
}\r
\r
@Override\r