]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@20986 ac1ea38d-2e2b...
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 17 May 2011 13:35:45 +0000 (13:35 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 17 May 2011 13:35:45 +0000 (13:35 +0000)
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ModuleOutputEditingSupport.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ReferenceRow.java
org.simantics.sysdyn/src/org/simantics/sysdyn/modelica/ModelicaWriter.java

index d8dbd3af21a2b1e946c6a2dce74969a0bab17b4b..7a69d742a0d8cef16c5e2efdec98101bd1c9f6f6 100644 (file)
@@ -71,8 +71,9 @@ public class ModuleOutputEditingSupport  extends EditingSupport {
                             SysdynResource sr = SysdynResource.getInstance(graph);\r
                             HashMap<String, Resource> result = new HashMap<String, Resource>();\r
                             for(Resource dependency : graph.syncRequest(new ObjectsWithType(module, sr.IsTailOf, sr.Dependency))) {\r
-                                if(graph.getPossibleObject(dependency, sr.RefersTo) == null ||\r
-                                        graph.getPossibleObject(dependency, sr.RefersTo).equals(outputVariable)) {\r
+                                if(graph.getPossibleObject(dependency, sr.RefersTo) == null \r
+                                               || !graph.hasStatement(graph.getPossibleObject(dependency, sr.RefersTo), l0.HasName)\r
+                                               || graph.getPossibleObject(dependency, sr.RefersTo).equals(outputVariable)) {\r
                                     Resource input = graph.getSingleObject(dependency, sr.HasHead);\r
                                     result.put((String)graph.getRelatedValue(input, l0.HasName), dependency);\r
                                 }\r
index d3ad27189b538d0911c0de9d316fedc6439b0c47..5aeeaec77acfdefc9ff0b835d3116dcedf91a7f8 100644 (file)
@@ -95,6 +95,8 @@ public class ReferenceRow {
                 SysdynResource sr = SysdynResource.getInstance(graph);\r
                 if(getDependency() != null && graph.hasStatement(getDependency(), sr.RefersTo))\r
                     graph.deny(getDependency(), sr.RefersTo);\r
+                if(dependency != null && graph.hasStatement(dependency, sr.RefersTo))\r
+                       graph.deny(dependency, sr.RefersTo);\r
                 setDependency(null);\r
                 if(dependency != null) {\r
                     setDependency(dependency);\r
index bd4629532745bf62144434af94bed615a137a04b..d88a02a50f5af3c53d57eb84f6e4bb462a92515b 100644 (file)
@@ -141,7 +141,7 @@ public class ModelicaWriter {
             Input variable = (Input)dependency.getHead();\r
             Module module = (Module)dependency.getTail();\r
             Variable reference = (Variable)dependency.refersTo();\r
-            if(reference != null)\r
+            if(reference != null && reference.getName() != null)\r
                b.append("    " + variable.getName() + " = " + module.getName() + "." + reference.getName() + ";\n");\r
             else\r
                b.append("    " + variable.getName() + " = " + variable.getDefaultInputValue() + ";\n");\r