From: lempinen Date: Thu, 12 Aug 2010 10:10:39 +0000 (+0000) Subject: git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@17165 ac1ea38d-2e2b... X-Git-Tag: simantics-1.2.0~108 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=4f10c7037075bc14779c4e6180882139603a9b93;p=simantics%2Fsysdyn.git git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@17165 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/NewModuleNodeHandler.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/NewModuleNodeHandler.java index 8145cd07..e08c29da 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/NewModuleNodeHandler.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/NewModuleNodeHandler.java @@ -39,7 +39,7 @@ public class NewModuleNodeHandler extends AbstractHandler { SysdynResource sr = SysdynResource.getInstance(g); ModelingUtils mu = new ModelingUtils(g); - String name = GraphUtils.findFreshName(g, "Module type", model, mu.b.ConsistsOf, "%s %d"); + String name = GraphUtils.findFreshName(g, "ModuleType", model, mu.b.ConsistsOf, "%s%d"); Resource moduleType = g.newResource(); g.claimValue(moduleType, mu.b.HasName, name); @@ -56,7 +56,7 @@ public class NewModuleNodeHandler extends AbstractHandler { Resource configuration = GraphUtils.create2(g, sr.Configuration, - mu.b.HasName, name.trim().replace(" ", ""), + mu.b.HasName, name + "Configuration", mu.mr.CompositeToDiagram, diagram, mu.b.PartOf, model); diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynExperiment.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynExperiment.java index 0392d134..ed77e98b 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynExperiment.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynExperiment.java @@ -71,10 +71,12 @@ public class SysdynExperiment extends Experiment implements IDynamicExperiment { if(!projectRoot.isDirectory()) projectRoot.mkdir(); File file = new File( projectRoot, UUID.randomUUID().toString() + ".dbb"); + String name = GraphUtils.findFreshName(graph, "Result", model, b.ConsistsOf, "%s%d"); + SysdynResource sr = SysdynResource.getInstance(graph); Resource res = GraphUtils.create2(graph, sr.Result, - b.HasLabel, "Result x", - b.HasName, "Result x", + b.HasLabel, name, + b.HasName, name, b.PartOf, model, sr.HasResultFile, file.getAbsolutePath()); graph.claim(experiment, sr.HasResult, res);