From: lempinen Date: Tue, 17 May 2011 13:35:45 +0000 (+0000) Subject: git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@20986 ac1ea38d-2e2b... X-Git-Tag: simantics-1.4RC1~7 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=14a8a30926dec6a8b85e958f8aafc5cc7638cd72;p=simantics%2Fsysdyn.git git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@20986 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ModuleOutputEditingSupport.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ModuleOutputEditingSupport.java index d8dbd3af..7a69d742 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ModuleOutputEditingSupport.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ModuleOutputEditingSupport.java @@ -71,8 +71,9 @@ public class ModuleOutputEditingSupport extends EditingSupport { SysdynResource sr = SysdynResource.getInstance(graph); HashMap result = new HashMap(); for(Resource dependency : graph.syncRequest(new ObjectsWithType(module, sr.IsTailOf, sr.Dependency))) { - if(graph.getPossibleObject(dependency, sr.RefersTo) == null || - graph.getPossibleObject(dependency, sr.RefersTo).equals(outputVariable)) { + if(graph.getPossibleObject(dependency, sr.RefersTo) == null + || !graph.hasStatement(graph.getPossibleObject(dependency, sr.RefersTo), l0.HasName) + || graph.getPossibleObject(dependency, sr.RefersTo).equals(outputVariable)) { Resource input = graph.getSingleObject(dependency, sr.HasHead); result.put((String)graph.getRelatedValue(input, l0.HasName), dependency); } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ReferenceRow.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ReferenceRow.java index d3ad2718..5aeeaec7 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ReferenceRow.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/widgets/ReferenceRow.java @@ -95,6 +95,8 @@ public class ReferenceRow { SysdynResource sr = SysdynResource.getInstance(graph); if(getDependency() != null && graph.hasStatement(getDependency(), sr.RefersTo)) graph.deny(getDependency(), sr.RefersTo); + if(dependency != null && graph.hasStatement(dependency, sr.RefersTo)) + graph.deny(dependency, sr.RefersTo); setDependency(null); if(dependency != null) { setDependency(dependency); diff --git a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelica/ModelicaWriter.java b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelica/ModelicaWriter.java index bd462953..d88a02a5 100644 --- a/org.simantics.sysdyn/src/org/simantics/sysdyn/modelica/ModelicaWriter.java +++ b/org.simantics.sysdyn/src/org/simantics/sysdyn/modelica/ModelicaWriter.java @@ -141,7 +141,7 @@ public class ModelicaWriter { Input variable = (Input)dependency.getHead(); Module module = (Module)dependency.getTail(); Variable reference = (Variable)dependency.refersTo(); - if(reference != null) + if(reference != null && reference.getName() != null) b.append(" " + variable.getName() + " = " + module.getName() + "." + reference.getName() + ";\n"); else b.append(" " + variable.getName() + " = " + variable.getDefaultInputValue() + ";\n");