Found a glitch / bug when fusing wires
authorDaniel Kirschten <daniel.kirschten@gmx.de>
Sun, 1 Sep 2019 12:03:30 +0000 (14:03 +0200)
committerDaniel Kirschten <daniel.kirschten@gmx.de>
Sun, 1 Sep 2019 12:03:30 +0000 (14:03 +0200)
net.mograsim.logic.model.am2900/FusionNotWorking.json [new file with mode: 0644]
net.mograsim.logic.model.am2900/FusionNotWorkingTestbench.json [new file with mode: 0644]
net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/FusionNotWorkingTestbench.java [new file with mode: 0644]
net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/submodels/SubmodelComponent.java

diff --git a/net.mograsim.logic.model.am2900/FusionNotWorking.json b/net.mograsim.logic.model.am2900/FusionNotWorking.json
new file mode 100644 (file)
index 0000000..ce257e4
--- /dev/null
@@ -0,0 +1,420 @@
+{
+  "width": 115.0,
+  "height": 140.0,
+  "interfacePins": [
+    {
+      "location": {
+        "x": 0.0,
+        "y": 70.0
+      },
+      "name": "I",
+      "logicWidth": 13,
+      "usage": "INPUT"
+    }
+  ],
+  "innerScale": 1.0,
+  "submodel": {
+    "components": [
+      {
+        "id": "GUIBitDisplay",
+        "name": "GUIBitDisplay#0",
+        "pos": {
+          "x": 80.0,
+          "y": 60.0
+        },
+        "params": 13
+      },
+      {
+        "id": "GUIMerger",
+        "name": "GUIMerger#0",
+        "pos": {
+          "x": 30.0,
+          "y": 10.0
+        },
+        "params": 13
+      },
+      {
+        "id": "GUIMerger",
+        "name": "GUIMerger#1",
+        "pos": {
+          "x": 60.0,
+          "y": 10.0
+        },
+        "params": 13
+      },
+      {
+        "id": "GUISplitter",
+        "name": "GUISplitter#0",
+        "pos": {
+          "x": 15.0,
+          "y": 10.0
+        },
+        "params": 13
+      },
+      {
+        "id": "GUISplitter",
+        "name": "GUISplitter#1",
+        "pos": {
+          "x": 45.0,
+          "y": 10.0
+        },
+        "params": 13
+      }
+    ],
+    "wires": [
+      {
+        "pin1": {
+          "compName": "_submodelinterface",
+          "pinName": "I"
+        },
+        "pin2": {
+          "compName": "GUISplitter#0",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#0",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#0",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "GUIMerger#0",
+          "pinName": "I0"
+        },
+        "name": "unnamedWire#1",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#0",
+          "pinName": "O9"
+        },
+        "pin2": {
+          "compName": "GUIMerger#0",
+          "pinName": "I9"
+        },
+        "name": "unnamedWire#10",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#0",
+          "pinName": "O10"
+        },
+        "pin2": {
+          "compName": "GUIMerger#0",
+          "pinName": "I10"
+        },
+        "name": "unnamedWire#11",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUIMerger#0",
+          "pinName": "I11"
+        },
+        "pin2": {
+          "compName": "GUISplitter#0",
+          "pinName": "O11"
+        },
+        "name": "unnamedWire#12",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#0",
+          "pinName": "O12"
+        },
+        "pin2": {
+          "compName": "GUIMerger#0",
+          "pinName": "I12"
+        },
+        "name": "unnamedWire#13",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUIMerger#0",
+          "pinName": "O"
+        },
+        "pin2": {
+          "compName": "GUISplitter#1",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#14",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#1",
+          "pinName": "O0"
+        },
+        "pin2": {
+          "compName": "GUIMerger#1",
+          "pinName": "I0"
+        },
+        "name": "unnamedWire#15",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUIMerger#1",
+          "pinName": "I1"
+        },
+        "pin2": {
+          "compName": "GUISplitter#1",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#16",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#1",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "GUIMerger#1",
+          "pinName": "I2"
+        },
+        "name": "unnamedWire#17",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUIMerger#1",
+          "pinName": "I3"
+        },
+        "pin2": {
+          "compName": "GUISplitter#1",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#18",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#1",
+          "pinName": "O4"
+        },
+        "pin2": {
+          "compName": "GUIMerger#1",
+          "pinName": "I4"
+        },
+        "name": "unnamedWire#19",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUIMerger#0",
+          "pinName": "I1"
+        },
+        "pin2": {
+          "compName": "GUISplitter#0",
+          "pinName": "O1"
+        },
+        "name": "unnamedWire#2",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#1",
+          "pinName": "O5"
+        },
+        "pin2": {
+          "compName": "GUIMerger#1",
+          "pinName": "I5"
+        },
+        "name": "unnamedWire#20",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUIMerger#1",
+          "pinName": "I6"
+        },
+        "pin2": {
+          "compName": "GUISplitter#1",
+          "pinName": "O6"
+        },
+        "name": "unnamedWire#21",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#1",
+          "pinName": "O7"
+        },
+        "pin2": {
+          "compName": "GUIMerger#1",
+          "pinName": "I7"
+        },
+        "name": "unnamedWire#22",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUIMerger#1",
+          "pinName": "I8"
+        },
+        "pin2": {
+          "compName": "GUISplitter#1",
+          "pinName": "O8"
+        },
+        "name": "unnamedWire#23",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#1",
+          "pinName": "O9"
+        },
+        "pin2": {
+          "compName": "GUIMerger#1",
+          "pinName": "I9"
+        },
+        "name": "unnamedWire#24",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUIMerger#1",
+          "pinName": "I10"
+        },
+        "pin2": {
+          "compName": "GUISplitter#1",
+          "pinName": "O10"
+        },
+        "name": "unnamedWire#25",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#1",
+          "pinName": "O11"
+        },
+        "pin2": {
+          "compName": "GUIMerger#1",
+          "pinName": "I11"
+        },
+        "name": "unnamedWire#26",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUIMerger#1",
+          "pinName": "I12"
+        },
+        "pin2": {
+          "compName": "GUISplitter#1",
+          "pinName": "O12"
+        },
+        "name": "unnamedWire#27",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUIMerger#1",
+          "pinName": "O"
+        },
+        "pin2": {
+          "compName": "GUIBitDisplay#0",
+          "pinName": ""
+        },
+        "name": "unnamedWire#28",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#0",
+          "pinName": "O2"
+        },
+        "pin2": {
+          "compName": "GUIMerger#0",
+          "pinName": "I2"
+        },
+        "name": "unnamedWire#3",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUIMerger#0",
+          "pinName": "I3"
+        },
+        "pin2": {
+          "compName": "GUISplitter#0",
+          "pinName": "O3"
+        },
+        "name": "unnamedWire#4",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#0",
+          "pinName": "O4"
+        },
+        "pin2": {
+          "compName": "GUIMerger#0",
+          "pinName": "I4"
+        },
+        "name": "unnamedWire#5",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#0",
+          "pinName": "O5"
+        },
+        "pin2": {
+          "compName": "GUIMerger#0",
+          "pinName": "I5"
+        },
+        "name": "unnamedWire#6",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUIMerger#0",
+          "pinName": "I6"
+        },
+        "pin2": {
+          "compName": "GUISplitter#0",
+          "pinName": "O6"
+        },
+        "name": "unnamedWire#7",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUISplitter#0",
+          "pinName": "O7"
+        },
+        "pin2": {
+          "compName": "GUIMerger#0",
+          "pinName": "I7"
+        },
+        "name": "unnamedWire#8",
+        "path": []
+      },
+      {
+        "pin1": {
+          "compName": "GUIMerger#0",
+          "pinName": "I8"
+        },
+        "pin2": {
+          "compName": "GUISplitter#0",
+          "pinName": "O8"
+        },
+        "name": "unnamedWire#9",
+        "path": []
+      }
+    ],
+    "version": "0.1.1"
+  },
+  "symbolRendererSnippetID": "default",
+  "outlineRendererSnippetID": "default",
+  "highLevelStateHandlerSnippetID": "default",
+  "version": "0.1.5"
+}
\ No newline at end of file
diff --git a/net.mograsim.logic.model.am2900/FusionNotWorkingTestbench.json b/net.mograsim.logic.model.am2900/FusionNotWorkingTestbench.json
new file mode 100644 (file)
index 0000000..438b2a7
--- /dev/null
@@ -0,0 +1,46 @@
+{
+  "width": 0.0,
+  "height": 0.0,
+  "interfacePins": [],
+  "innerScale": 1.0,
+  "submodel": {
+    "components": [
+      {
+        "id": "file:FusionNotWorking.json",
+        "name": "FusionNotWorking#0",
+        "pos": {
+          "x": 220.0,
+          "y": 175.0
+        }
+      },
+      {
+        "id": "GUIManualSwitch",
+        "name": "GUIManualSwitch#0",
+        "pos": {
+          "x": 180.0,
+          "y": 235.0
+        },
+        "params": 13
+      }
+    ],
+    "wires": [
+      {
+        "pin1": {
+          "compName": "GUIManualSwitch#0",
+          "pinName": ""
+        },
+        "pin2": {
+          "compName": "FusionNotWorking#0",
+          "pinName": "I"
+        },
+        "name": "unnamedWire#0",
+        "path": []
+      }
+    ],
+    "version": "0.1.1"
+  },
+  "symbolRendererSnippetID": "default",
+  "outlineRendererSnippetID": "default",
+  "highLevelStateHandlerSnippetID": "default",
+  "version": "0.1.5"
+}
\ No newline at end of file
diff --git a/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/FusionNotWorkingTestbench.java b/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/FusionNotWorkingTestbench.java
new file mode 100644 (file)
index 0000000..6deaf23
--- /dev/null
@@ -0,0 +1,41 @@
+package net.mograsim.logic.model.examples;
+
+import net.haspamelodica.swt.helper.gcs.GeneralGC;
+import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
+import net.mograsim.logic.model.SimpleLogicUIStandalone;
+import net.mograsim.logic.model.model.ViewModelModifiable;
+import net.mograsim.logic.model.serializing.DeserializedSubmodelComponent;
+import net.mograsim.logic.model.serializing.IdentifierGetter;
+import net.mograsim.logic.model.serializing.IndirectGUIComponentCreator;
+import net.mograsim.logic.model.snippets.Renderer;
+
+public class FusionNotWorkingTestbench
+{
+       public static void main(String[] args)
+       {
+               SimpleLogicUIStandalone.executeVisualisation(FusionNotWorkingTestbench::create);
+       }
+
+       public static void create(ViewModelModifiable model)
+       {
+               // TODO replace with proper ViewModel deserialization
+               DeserializedSubmodelComponent testbench = (DeserializedSubmodelComponent) IndirectGUIComponentCreator.createComponent(model,
+                               "file:FusionNotWorkingTestbench.json", "testbench");
+               testbench.setSize(1000, 1000);
+               testbench.setOutlineRenderer(new Renderer()
+               {
+                       @Override
+                       public Object getParamsForSerializing(IdentifierGetter idGetter)
+                       {
+                               return null;
+                       }
+
+                       @Override
+                       public void render(GeneralGC gc, Rectangle visibleRegion)
+                       {
+                               // do nothing
+                       }
+               });
+       }
+
+}
\ No newline at end of file
index 621f721..aff4227 100644 (file)
@@ -108,8 +108,8 @@ public abstract class SubmodelComponent extends GUIComponent
                this.submodelInterface = new SubmodelInterface(submodelModifiable, SUBMODEL_INTERFACE_NAME);
 
                this.submodelScale = 1;
-               this.maxVisibleRegionFillRatioForAlpha0 = 0.8;
-               this.minVisibleRegionFillRatioForAlpha1 = 0.9;
+               this.maxVisibleRegionFillRatioForAlpha0 = 0.0;
+               this.minVisibleRegionFillRatioForAlpha1 = 0.0;
                this.renderer = new LogicUIRenderer(submodelModifiable);
 
                Consumer<Runnable> redrawHandlerChangedListener = submodelModifiable::setRedrawHandler;