]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Support for typed subprocesses 50/250/1
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Mon, 2 Jan 2017 15:14:57 +0000 (17:14 +0200)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Wed, 4 Jan 2017 14:39:16 +0000 (16:39 +0200)
Added a method to test if there are pending removals.

[PRIVATE-12928]

Change-Id: I5bf94202209714af0163ef95b61b874a14db0aa8

bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/SpreadsheetBook.java
bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/MappingBase.java
bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/ModuleUpdaterBase.java
bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/Solver.java
bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/base/SynchronizationEventHandlerBase.java

index b41e9c754fa751883896ce48b7b007f7edd0ce1d..277b10cb0635f6e8401f78069a175f56104bc037 100644 (file)
@@ -316,7 +316,7 @@ public class SpreadsheetBook implements SpreadsheetElement<SpreadsheetElement, S
        }
 
        @Override
-       public void addSubprocess(String name) {
+       public void addSubprocess(String name, String subprocessType) {
                ensureSubprocess(name);
        }
        
index ae66937764a9865af0cdc3ca3d496e7446969be8..78678b5054d95b2559ef8ff6f37bbc6f7b4650e0 100644 (file)
@@ -214,5 +214,9 @@ abstract public class MappingBase<T extends ComponentBase<T>> {
             configurationByUid.clear();
         pendingRemoval.clear();
     }
+    
+    public boolean hasPendingRemovals() {
+        return !pendingRemoval.isEmpty();
+    }
 
 }
index a3edea09e7ddc8fc89ee7d0b2b03cd4a016cf8f4..9ec63c06167846f619da56d24f939e5603d150ad 100644 (file)
@@ -19,6 +19,7 @@ abstract public class ModuleUpdaterBase<T extends ComponentBase<T>> {
             new THashMap<String, ConnectionUpdateRule<T>>();
     public boolean isUserComponent;
     public boolean isComposite;
+    public String subprocessType;
     
     public ModuleUpdaterBase(String moduleType) {
         this.moduleType = moduleType;
index a4d19283a5174a95984f21e8c22acbee5b0ff0b6..6bda544180077c80cccadef38efd8a0424857579 100644 (file)
@@ -8,7 +8,7 @@ public interface Solver {
        
        public void remove(int id);
        
-       public void addSubprocess(String name);
+       public void addSubprocess(String name, String subprocessType);
        public void includeSubprocess(String parentName, String subprocessName);
        
        public <T> T getConcreteSolver();
index d2eb50f22e30ee1a47448255bb73d98be81aa7a7..94bfbf89626bc1e1230688233dddbb0d8155d2f9 100644 (file)
@@ -1,8 +1,5 @@
 package org.simantics.structural.synchronization.base;
 
-import gnu.trove.map.hash.THashMap;
-import gnu.trove.set.hash.THashSet;
-
 import java.util.ArrayDeque;
 import java.util.Collection;
 import java.util.Collections;
@@ -19,6 +16,9 @@ import org.simantics.structural.synchronization.protocol.SerializedVariable;
 import org.simantics.structural.synchronization.protocol.SynchronizationEventHandler;
 import org.simantics.structural.synchronization.protocol.SynchronizationException;
 
+import gnu.trove.map.hash.THashMap;
+import gnu.trove.set.hash.THashSet;
+
 /**
  * Handles synchronization events by updating the simulator designated by the
  * provided {@link Solver} instance.
@@ -186,7 +186,7 @@ public abstract class SynchronizationEventHandlerBase<T extends ComponentBase<T>
                             parentSolverComponentName,
                             getSubprocessName(name, properties));
                     try {
-                       solver.addSubprocess(subprocessName);
+                       solver.addSubprocess(subprocessName, updater.subprocessType);
                     } catch(Exception e) {
                        reportProblem("Exception while adding subprocess.", e);
                     }