]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Disable unit validation from enumerations in Sysdyn (refs #5772).
authormiettinen <miettinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 16 Apr 2015 11:17:20 +0000 (11:17 +0000)
committermiettinen <miettinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 16 Apr 2015 11:17:20 +0000 (11:17 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@31180 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/validation/UnitFunction.java

index 118bfaae4b89aca2e16e31684bdad09339c6464d..259fb6d6143878bf382f759595d275513c17ab89 100644 (file)
@@ -45,7 +45,9 @@ public class UnitFunction {
     @SCLValue(type = "ReadGraph -> Resource -> [Issue]")\r
     public static List<Issue> unitValidator(ReadGraph graph, Resource component) throws DatabaseException {\r
         SysdynResource SR = SysdynResource.getInstance(graph);\r
-        if(graph.isInstanceOf(component, SR.Variable) && !graph.isInstanceOf(component, SR.Cloud))\r
+        if(graph.isInstanceOf(component, SR.Variable)\r
+                       && !graph.isInstanceOf(component, SR.Cloud)\r
+                       && !graph.isInstanceOf(component, SR.Enumeration))\r
             return variableValidator(graph, component);\r
         else if(graph.isInstanceOf(component, SR.Module))\r
             return moduleValidator(graph, component);\r
@@ -178,7 +180,7 @@ public class UnitFunction {
         Layer0 L0 = Layer0.getInstance(graph);\r
         Resource configuration = graph.getPossibleObject(variable, L0.PartOf);\r
         if(configuration == null)\r
-            return "Error, No Confiugration";\r
+            return "Error, No Configuration";\r
 \r
 \r
         SysdynModelManager smm = SysdynModelManager.getInstance(graph.getSession());\r