From: Daniel Kirschten Date: Fri, 21 Jun 2019 12:14:50 +0000 (+0200) Subject: ViewLogicModelAdapter now supports directly connected interface pins X-Git-Url: https://mograsim.net/gitweb/?a=commitdiff_plain;h=f2dc7886a24f031599c9cce7965ecb00f3140956;p=Mograsim.git ViewLogicModelAdapter now supports directly connected interface pins --- diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java index 3e081ad7..193e2407 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/modeladapter/ViewLogicModelAdapter.java @@ -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; }));