X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fmodel%2Fcomponents%2Fmi%2Fnandbased%2FGUIdlatch.java;h=f6246a44fe738b4c089842c8874806f0b944737d;hb=19ee1a7fdb06a1df65cd7df78fed935124496707;hp=3dfb3e8b2301e61e896fa41f94609ad78eb4686a;hpb=1b29e51301a0c5cedd148a32bf9584a835aff2c1;p=Mograsim.git diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIdlatch.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIdlatch.java index 3dfb3e8b..f6246a44 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIdlatch.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIdlatch.java @@ -14,18 +14,18 @@ public class GUIdlatch extends SimpleRectangularSubmodelComponent { super(model, 1, "GUIdlatch"); setSubmodelScale(.4); - setInputCount(2); - setOutputCount(2); + setInputPins("D", "E"); + setOutputPins("Q", "_Q"); initSubmodelComponents(); } @SuppressWarnings("unused") // for GUIWires being created private void initSubmodelComponents() { - Pin D = getInputSubmodelPins().get(0); - Pin E = getInputSubmodelPins().get(1); - Pin Q = getOutputSubmodelPins().get(0); - Pin _Q = getOutputSubmodelPins().get(1); + Pin D = getSubmodelPin("D"); + Pin E = getSubmodelPin("E"); + Pin Q = getSubmodelPin("Q"); + Pin _Q = getSubmodelPin("_Q"); GUINandGate nand1 = new GUINandGate(submodelModifiable, 1); GUINandGate nand2 = new GUINandGate(submodelModifiable, 1); @@ -37,18 +37,18 @@ public class GUIdlatch extends SimpleRectangularSubmodelComponent nand1.moveTo(10, 2.5); nand2.moveTo(15, 27.5); _rsLatch.moveTo(45, 7.5); - cp1.moveTo(5, 37.5); - cp2.moveTo(35, 12.5); + cp1.moveCenterTo(5, 37.5); + cp2.moveCenterTo(35, 12.5); - new GUIWire(submodelModifiable, D, nand1.getInputPins().get(0)); + new GUIWire(submodelModifiable, D, nand1.getPin("A")); new GUIWire(submodelModifiable, E, cp1, new Point[0]); - new GUIWire(submodelModifiable, cp1, nand1.getInputPins().get(1), new Point(5, 17.5)); - new GUIWire(submodelModifiable, cp1, nand2.getInputPins().get(1), new Point(5, 42.5)); - new GUIWire(submodelModifiable, nand1.getOutputPin(), cp2, new Point[0]); - new GUIWire(submodelModifiable, cp2, nand2.getInputPins().get(0), new Point(35, 25), new Point(10, 25), new Point(10, 32.5)); - new GUIWire(submodelModifiable, cp2, _rsLatch.getInputPins().get(0), new Point[0]); - new GUIWire(submodelModifiable, nand2.getOutputPin(), _rsLatch.getInputPins().get(1), new Point(40, 37.5), new Point(40, 22.5)); - new GUIWire(submodelModifiable, _rsLatch.getOutputPins().get(0), Q, new Point[0]); - new GUIWire(submodelModifiable, _rsLatch.getOutputPins().get(1), _Q); + new GUIWire(submodelModifiable, cp1, nand1.getPin("B"), new Point(5, 17.5)); + new GUIWire(submodelModifiable, cp1, nand2.getPin("B"), new Point(5, 42.5)); + new GUIWire(submodelModifiable, nand1.getPin("Y"), cp2, new Point[0]); + new GUIWire(submodelModifiable, cp2, nand2.getPin("A"), new Point(35, 25), new Point(10, 25), new Point(10, 32.5)); + new GUIWire(submodelModifiable, cp2, _rsLatch.getPin("_S"), new Point[0]); + new GUIWire(submodelModifiable, nand2.getPin("Y"), _rsLatch.getPin("_R"), new Point(40, 37.5), new Point(40, 22.5)); + new GUIWire(submodelModifiable, _rsLatch.getPin("Q"), Q, new Point[0]); + new GUIWire(submodelModifiable, _rsLatch.getPin("_Q"), _Q); } } \ No newline at end of file