if(map != null) resource = map;\r
\r
if(g.isInstanceOf(resource, sr.Variable)) {\r
- Resource configuration = g.getPossibleObject(resource, b.PartOf);\r
- if(g.isInstanceOf(configuration, sr.Configuration)) {\r
- SysdynModel model = getModel(g, configuration);\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
+ SysdynModel model = getModel(g, module);\r
if(model == null)\r
return null;\r
\r
Collection<SysdynResult> activeResults = model.getActiveResults(g);\r
ArrayList<SysdynDataSet> datasets = new ArrayList<SysdynDataSet>();\r
for(SysdynResult r : activeResults) {\r
- datasets.add(r.getDataSet(var.getName()));\r
+ datasets.add(r.getDataSet(var.getFullName()));\r
}\r
return datasets;\r
} \r
import java.util.ArrayList;\r
\r
import org.simantics.objmap.annotations.GraphType;\r
+import org.simantics.objmap.annotations.RelatedElement;\r
import org.simantics.objmap.annotations.RelatedElements;\r
import org.simantics.objmap.annotations.RelatedValue;\r
import org.simantics.sysdyn.representation.visitors.ElementVisitorVoidAdapter;\r
\r
@RelatedValue("http://www.simantics.org/Layer0-1.0/HasLabel")\r
private String label;\r
+ \r
+ @RelatedElement("http://www.simantics.org/Layer0-1.0/PartOf")\r
+ protected IModule module;\r
\r
@RelatedElements(\r
value = "http://www.simantics.org/Layer0-1.0/ConsistsOf",\r
public String getLabel() {\r
return label;\r
}\r
+ \r
+ public IModule getParentModule() {\r
+ return this.module;\r
+ }\r
}\r
public String getName() {\r
return this.name;\r
}\r
+ \r
+ public String getFullName() {\r
+ String name = getName();\r
+ IModule m = getParentModule(); \r
+ while(!(m instanceof Configuration) && m instanceof Module) {\r
+ name = m.getLabel() + "." + name;\r
+ m = ((Module)m).getParentModule();\r
+ }\r
+ return name;\r
+ }\r
\r
public String getType() {\r
return this.type;\r
\r
Module1 @ "FirstModule" : Module\r
L0.ConsistsOf \r
+ Module2\r
+ L0.HasLabel "TokaModuuli" : L0.String\r
FirstModuleInput1 @ "Aux1" : Auxiliary\r
L0.HasType "Real" : L0.String\r
HasUnit "s" : L0.String\r
HasInput FirstModuleInput2\r
HasOutput FirstModuleOutput1\r
\r
+Module2 @ "SecondModule" : Module\r
+ L0.ConsistsOf \r
+ SecondModuleInput1 @ "Aux1" : Auxiliary\r
+ L0.HasType "Real" : L0.String\r
+ HasUnit "s" : L0.String\r
+ HasExpression _ : NormalExpression\r
+ HasEquation "2+2" : L0.String\r
+ RefersTo FirstModuleOutput1\r
+ SecondModuleInput2 @ "Aux2" : Auxiliary\r
+ L0.HasType "Real" : L0.String\r
+ HasUnit "s" : L0.String\r
+ HasExpression _ : NormalExpression\r
+ HasEquation "2+2" : L0.String\r
+ SecondModuleStock @ "Stock1" : Stock\r
+ HasExpression _ : StockExpression\r
+ HasInitialEquation "0" : L0.String\r
+ SecondModuleCloud : Cloud\r
+ SecondModuleOutput1 @ "Valve" : Valve\r
+ HasUnit "s" : L0.String\r
+ HasExpression _ : NormalExpression\r
+ HasEquation "Aux1 + Aux2" : L0.String \r
+ _ : Flow\r
+ HasHead SecondModuleOutput1\r
+ HasTail SecondModuleCloud\r
+ _ : Flow\r
+ HasHead SecondModuleStock\r
+ HasTail SecondModuleOutput1\r
+ _ : Dependency\r
+ HasHead SecondModuleOutput1\r
+ HasTail SecondModuleInput1\r
+ _ : Dependency\r
+ HasHead SecondModuleOutput1\r
+ HasTail SecondModuleInput2\r
+ HasInput SecondModuleInput1\r
\r