Sync git svn branch with SVN repository r33158.
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 1 Sep 2016 11:05:42 +0000 (14:05 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 1 Sep 2016 11:05:42 +0000 (14:05 +0300)
refs #6475

bundles/org.simantics.charts/src/org/simantics/charts/Charts.java
bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/request/PossibleActiveExperiment.java
bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/DomainProcessorState.java
bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/ModelTransferableGraphSource.java
bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/ModelTransferableGraphSourceRequest.java
bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/Variables.java
bundles/org.simantics.modeling/src/org/simantics/modeling/mapping/DiagramToCompositeMapping3.java
bundles/org.simantics.modeling/src/org/simantics/modeling/subscription/SubscriptionItemLabel.java
bundles/org.simantics.structural2/src/org/simantics/structural2/Functions.java

index 69aea11ee2773f0ea4ed3f93fefdab99b2f74ced..dd7ae02a08bf809c4b5aaa607a7681e89af5520b 100644 (file)
@@ -10,8 +10,8 @@ import org.simantics.databoard.binding.error.BindingException;
 import org.simantics.databoard.util.Bean;\r
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.PossibleIndexRoot;\r
 import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.request.PossibleModel;\r
 import org.simantics.history.HistoryException;\r
 import org.simantics.history.HistorySamplerItem;\r
 import org.simantics.history.ItemManager;\r
@@ -42,7 +42,7 @@ public final class Charts {
                \r
                try {\r
 \r
-                       Resource model = graph.syncRequest(new PossibleModel(subscriptionItem));\r
+                       Resource model = graph.syncRequest(new PossibleIndexRoot(subscriptionItem));\r
                        if ( model == null ) {\r
                                throw new DatabaseException("There is no model for " + subscriptionItem);\r
                        }\r
index 3db016d79bcc5fc28154fc2b89d2fa404d454dfc..6caca12c5fe20cb00572fdeb0674fe0d90f6fc4d 100644 (file)
@@ -13,6 +13,7 @@ package org.simantics.db.layer0.request;
 \r
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.PossibleIndexRoot;\r
 import org.simantics.db.common.request.ResourceRead;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.layer0.Layer0;\r
@@ -27,7 +28,7 @@ public class PossibleActiveExperiment extends ResourceRead<Resource> {
     @Override\r
     public Resource perform(ReadGraph graph) throws DatabaseException {\r
 \r
-       Resource model = graph.sync(new PossibleModel(resource));\r
+       Resource model = graph.sync(new PossibleIndexRoot(resource));\r
        if(model == null) return null;\r
        \r
        Layer0 b = Layer0.getInstance(graph);\r
index d4f0dbe017674ec2f9c82f0147e4190aee0e3c84..de8a17c78787bfb9e986cd295f9fa417c26ef8dd 100644 (file)
@@ -16,6 +16,7 @@ public class DomainProcessorState {
        public TIntIntHashMap inverses = new TIntIntHashMap();\r
        public TIntHashSet externals = new TIntHashSet();\r
        public TIntIntHashMap ids = new TIntIntHashMap(100, 0.6f, -1, -1);\r
+       public TIntHashSet pending = new TIntHashSet();\r
 \r
        public int statementCount;\r
        public int valueCount;\r
index 2636bb0d7a3dcf43a9e4b888cc53c75a1d4247e7..79f0937480dff59eeea2de8935576aea8e8809cf 100644 (file)
@@ -248,7 +248,9 @@ public class ModelTransferableGraphSource implements TransferableGraphSource {
                                int p = state.otherStatementsInput.readInt();\r
                                int o = state.otherStatementsInput.readInt();\r
                                if(!exclude) {\r
-                                       if(state.excludedShared.contains(o)) {\r
+                                       if(state.pending.contains(o)) {\r
+                                               System.err.println("excluding garbage statement " + s + " " + p + " " + o + ", object resource is garbage");\r
+                                       } else if(state.excludedShared.contains(o)) {\r
                                                System.err.println("excluding shared " + s + " " + p + " " + o);\r
                                        } else {\r
                                                \r
index c61fdadcbabf5d2f6667e1a8b1947ba3a6159c93..d7fe5c690ddb64760b4f351ec9917e9bb028991f 100644 (file)
@@ -440,8 +440,10 @@ public class ModelTransferableGraphSourceRequest extends UniqueRead<ModelTransfe
                                String uri = graph.getPossibleURI(r);\r
                                if(uri != null)\r
                                        state.externals.add(transientId);\r
-                               else\r
+                               else {\r
+                                       state.pending.add(transientId);\r
                                        System.err.println("Pending status in export: " + NameUtils.getSafeName(graph, r, true) + " (" + graph.getPossibleURI(r) + ")");\r
+                               }\r
                        }\r
                }\r
 \r
index 81e1e46e94a3d027faed3853938a739e8d78d05e..e323f4f8c28bc4cb755bb38e609b7d0c6461ea44 100644 (file)
@@ -26,13 +26,13 @@ import org.simantics.databoard.util.URIStringUtils;
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.RequestProcessor;\r
 import org.simantics.db.Resource;\r
+import org.simantics.db.common.request.PossibleIndexRoot;\r
 import org.simantics.db.common.request.TernaryRead;\r
 import org.simantics.db.common.utils.Logger;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.db.layer0.exception.MissingVariableException;\r
 import org.simantics.db.layer0.request.Model;\r
 import org.simantics.db.layer0.request.PossibleActiveVariableFromVariable;\r
-import org.simantics.db.layer0.request.PossibleModel;\r
 import org.simantics.db.layer0.request.PossibleVariableIndexRoot;\r
 import org.simantics.db.layer0.request.PossibleVariableModel;\r
 import org.simantics.db.layer0.request.PropertyInfo;\r
@@ -332,7 +332,7 @@ final public class Variables {
 \r
     public static Variable getPossibleConfigurationContext(ReadGraph graph, Resource resource) throws DatabaseException {\r
         SimulationResource SIMU = SimulationResource.getInstance(graph);\r
-        if (!graph.isInstanceOf(resource, SIMU.Model)) resource = graph.sync(new PossibleModel(resource));\r
+        if (!graph.isInstanceOf(resource, SIMU.Model)) resource = graph.sync(new PossibleIndexRoot(resource));\r
         if (resource == null)\r
             return null;\r
         Resource configurationResource = graph.getPossibleObject(resource, SIMU.HasConfiguration);\r
@@ -343,7 +343,7 @@ final public class Variables {
 \r
     public static Variable getPossibleConfigurationContext(ReadGraph graph, Variable variable) throws DatabaseException {\r
         SimulationResource SIMU = SimulationResource.getInstance(graph);\r
-        Resource model = getPossibleModel(graph, variable);\r
+        Resource model = getPossibleIndexRoot(graph, variable);\r
         if (model == null)\r
             return null;\r
         Resource configurationResource = graph.getPossibleObject(model, SIMU.HasConfiguration);\r
index df54d5426f2dc3ffc71c541baf23e5afc69500a8..d44e4c16269d9a9f7c00ce386fe93229650c4091 100644 (file)
@@ -237,6 +237,11 @@ public class DiagramToCompositeMapping3 extends MappingBase {
                         bb(DIA.FlagIsJoinedBy, Element, Join)\r
                         ),\r
                         deny(bb(STR.Joins, Join, Connection)))\r
+        ),\r
+        if_(and(bf(L0.ConsistsOf, Diagram, Element),\r
+                bf(MOD.DiagramConnectionToConnectionSpecial, Element, Connection),\r
+                not(b(new Tag(STR.Connects), Connection))),\r
+                deny(exists(Connection))\r
         ));\r
        }\r
        \r
index ac35599c20afa4926b4ac24cb56f794bd33ba920..ddc33342085cd9cf983a8ad9e87ccdd22f8e5bc9 100644 (file)
@@ -11,9 +11,9 @@ import org.simantics.databoard.util.URIStringUtils;
 import org.simantics.db.ReadGraph;\r
 import org.simantics.db.Resource;\r
 import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;\r
+import org.simantics.db.common.request.PossibleIndexRoot;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.db.layer0.exception.PendingVariableException;\r
-import org.simantics.db.layer0.request.PossibleModel;\r
 import org.simantics.db.layer0.request.PossibleVariableValue;\r
 import org.simantics.db.layer0.variable.RVI;\r
 import org.simantics.db.layer0.variable.Variable;\r
@@ -54,7 +54,7 @@ public class SubscriptionItemLabel {
         if (rvi == null)\r
             return NO_VARIABLE_ID;\r
 \r
-        Resource model = graph.syncRequest(new PossibleModel(item));\r
+        Resource model = graph.syncRequest(new PossibleIndexRoot(item));\r
         if (model != null) {\r
             ModelContexts contexts = graph.syncRequest(new ModelContextsRequest(model), TransientCacheAsyncListener.<ModelContexts>instance());\r
             Variable configurationContext = contexts.getConfigurationContext();\r
index 70b9ab03942b400eb16604ff5e93d354618489ae..fd4012355b9005022abcdd056713a0aacd280f0b 100644 (file)
@@ -26,12 +26,12 @@ import org.simantics.db.common.issue.StandardIssue;
 import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener;\r
 import org.simantics.db.common.procedure.adapter.TransientCacheListener;\r
 import org.simantics.db.common.request.ObjectsWithType;\r
+import org.simantics.db.common.request.PossibleIndexRoot;\r
 import org.simantics.db.common.request.ResourceRead;\r
 import org.simantics.db.common.uri.UnescapedChildMapOfResource;\r
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.db.layer0.function.All;\r
 import org.simantics.db.layer0.function.StandardChildDomainChildren;\r
-import org.simantics.db.layer0.request.PossibleModel;\r
 import org.simantics.db.layer0.request.PropertyInfo;\r
 import org.simantics.db.layer0.request.PropertyInfoRequest;\r
 import org.simantics.db.layer0.request.VariableRead;\r
@@ -372,7 +372,7 @@ public class Functions {
 \r
                        Layer0 L0 = Layer0.getInstance(graph);\r
                        SimulationResource SIMU = SimulationResource.getInstance(graph);\r
-                       Resource model = graph.sync(new PossibleModel(resource));\r
+                       Resource model = graph.sync(new PossibleIndexRoot(resource));\r
                        if(graph.isInstanceOf(model, L0.RVIContext)) {\r
                                return fromContext(graph, model);\r
                        }\r