ViewLogicModelAdapter now supports directly connected interface pins
authorDaniel Kirschten <daniel.kirschten@gmx.de>
Fri, 21 Jun 2019 12:14:50 +0000 (14:14 +0200)
committerDaniel Kirschten <daniel.kirschten@gmx.de>
Fri, 21 Jun 2019 12:14:50 +0000 (14:14 +0200)
net.mograsim.logic.ui/src/net/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java

index 3e081ad..193e240 100644 (file)
@@ -114,8 +114,11 @@ public class ViewLogicModelAdapter
                                        if (externalWireCandidate != null)
                                                if (externalWire == null)
                                                        externalWire = externalWireCandidate;
+                                               else if (externalWire.length == externalWireCandidate.length)
+                                                       Wire.fuse(externalWire, externalWireCandidate);
                                                else
-                                                       throw new IllegalArgumentException("Two pins to external wires can't be connected directly");
+                                                       throw new IllegalArgumentException(
+                                                                       "Two pins to external wires with different logicWidths can't be connected directly");
                                }
                                return externalWire == null ? new Wire(timeline, e.getKey().logicWidth, params.wireTravelTime) : externalWire;
                        }));