X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fmodel%2Fcomponents%2Fmi%2Fnandbased%2FGUInand3.java;h=f102c3ba06076d10485e1d0cfb3d4e8505ffefcc;hb=19ee1a7fdb06a1df65cd7df78fed935124496707;hp=0b0a3b5fd63747881db54e8acebfc094ae8e2ee4;hpb=008eb0c3e4530b2758130264d0391ac7a246c282;p=Mograsim.git diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUInand3.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUInand3.java index 0b0a3b5f..f102c3ba 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUInand3.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUInand3.java @@ -14,18 +14,18 @@ public class GUInand3 extends SimpleRectangularSubmodelComponent { super(model, 1, "GUInand3"); setSubmodelScale(.4); - setInputCount(3); - setOutputCount(1); + setInputPins("A", "B", "C"); + setOutputPins("Y"); initSubmodelComponents(); } @SuppressWarnings("unused") // for GUIWires being created private void initSubmodelComponents() { - Pin A = getInputSubmodelPins().get(0); - Pin B = getInputSubmodelPins().get(1); - Pin C = getInputSubmodelPins().get(2); - Pin Y = getOutputSubmodelPins().get(0); + Pin A = getSubmodelPin("A"); + Pin B = getSubmodelPin("B"); + Pin C = getSubmodelPin("C"); + Pin Y = getSubmodelPin("Y"); GUINandGate nandAB = new GUINandGate(submodelModifiable, 1); GUINandGate andAB = new GUINandGate(submodelModifiable, 1); @@ -36,15 +36,15 @@ public class GUInand3 extends SimpleRectangularSubmodelComponent nandAB.moveTo(10, 15); andAB.moveTo(35, 15); nandABC.moveTo(62.5, 2.5); - cpNandAB.moveTo(32.5, 25); + cpNandAB.moveCenterTo(32.5, 25); - new GUIWire(submodelModifiable, A, nandAB.getInputPins().get(0)); - new GUIWire(submodelModifiable, B, nandAB.getInputPins().get(1)); - new GUIWire(submodelModifiable, nandAB.getOutputPin(), cpNandAB, new Point[0]); - new GUIWire(submodelModifiable, cpNandAB, andAB.getInputPins().get(0), new Point(32.5, 20)); - new GUIWire(submodelModifiable, cpNandAB, andAB.getInputPins().get(1), new Point(32.5, 30)); - new GUIWire(submodelModifiable, andAB.getOutputPin(), nandABC.getInputPins().get(0), new Point(57.5, 25), new Point(57.5, 7.5)); - new GUIWire(submodelModifiable, C, nandABC.getInputPins().get(1), new Point(60, 62.5), new Point(60, 17.5)); - new GUIWire(submodelModifiable, nandABC.getOutputPin(), Y, new Point[0]); + new GUIWire(submodelModifiable, A, nandAB.getPin("A")); + new GUIWire(submodelModifiable, B, nandAB.getPin("B")); + new GUIWire(submodelModifiable, nandAB.getPin("Y"), cpNandAB, new Point[0]); + new GUIWire(submodelModifiable, cpNandAB, andAB.getPin("A"), new Point(32.5, 20)); + new GUIWire(submodelModifiable, cpNandAB, andAB.getPin("B"), new Point(32.5, 30)); + new GUIWire(submodelModifiable, andAB.getPin("Y"), nandABC.getPin("A"), new Point(57.5, 25), new Point(57.5, 7.5)); + new GUIWire(submodelModifiable, C, nandABC.getPin("B"), new Point(60, 62.5), new Point(60, 17.5)); + new GUIWire(submodelModifiable, nandABC.getPin("Y"), Y, new Point[0]); } } \ No newline at end of file