]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@17165 ac1ea38d-2e2b...
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 12 Aug 2010 10:10:39 +0000 (10:10 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 12 Aug 2010 10:10:39 +0000 (10:10 +0000)
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/NewModuleNodeHandler.java
org.simantics.sysdyn/src/org/simantics/sysdyn/manager/SysdynExperiment.java

index 8145cd07c68470c68c83bb4bc8049d8540014acd..e08c29da9f014b6994fcdcfed342b80e4913659d 100644 (file)
@@ -39,7 +39,7 @@ public class NewModuleNodeHandler extends AbstractHandler {
                 SysdynResource sr = SysdynResource.getInstance(g);\r
                 ModelingUtils mu = new ModelingUtils(g);\r
                 \r
-                String name = GraphUtils.findFreshName(g, "Module type", model, mu.b.ConsistsOf, "%s %d");\r
+                String name = GraphUtils.findFreshName(g, "ModuleType", model, mu.b.ConsistsOf, "%s%d");\r
                 \r
                 Resource moduleType = g.newResource();\r
                 g.claimValue(moduleType, mu.b.HasName, name);\r
@@ -56,7 +56,7 @@ public class NewModuleNodeHandler extends AbstractHandler {
                 \r
                 Resource configuration = GraphUtils.create2(g, \r
                         sr.Configuration,\r
-                        mu.b.HasName, name.trim().replace(" ", ""),\r
+                        mu.b.HasName, name + "Configuration",\r
                         mu.mr.CompositeToDiagram, diagram,\r
                         mu.b.PartOf, model);\r
                 \r
index 0392d134246a3311a402c75865f5060b4f2585d2..ed77e98b33e74d1963ef349937fbe4b9dcff8905 100644 (file)
@@ -71,10 +71,12 @@ public class SysdynExperiment extends Experiment implements IDynamicExperiment {
                     if(!projectRoot.isDirectory()) projectRoot.mkdir();\r
                     File file = new File( projectRoot, UUID.randomUUID().toString() + ".dbb");\r
                     \r
+                    String name = GraphUtils.findFreshName(graph, "Result", model, b.ConsistsOf, "%s%d");\r
+                    \r
                     SysdynResource sr = SysdynResource.getInstance(graph);\r
                     Resource res = GraphUtils.create2(graph, sr.Result,\r
-                            b.HasLabel, "Result x",\r
-                            b.HasName, "Result x",\r
+                            b.HasLabel, name,\r
+                            b.HasName, name,\r
                             b.PartOf, model,\r
                             sr.HasResultFile, file.getAbsolutePath());\r
                     graph.claim(experiment, sr.HasResult, res);\r