X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fmodel%2Fcomponents%2Fmi%2Fnandbased%2FGUIdemux2.java;h=6d9057f5998342fb97aeffebb24448ce9d15f197;hb=a84700145147c263ad6692c99117a7cf37832378;hp=2924c1a517a8382a6265ccb1a741a1e63f0daff7;hpb=7b0c8c840903ed334d02aa131a4c6f23fbfb9af2;p=Mograsim.git diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIdemux2.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIdemux2.java index 2924c1a5..6d9057f5 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIdemux2.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIdemux2.java @@ -14,20 +14,20 @@ public class GUIdemux2 extends SimpleRectangularSubmodelComponent { super(model, 1, "GUIdemux2"); setSubmodelScale(.4); - setInputCount(2); - setOutputCount(4); + setInputPins("S0", "S1"); + setOutputPins("Y00", "Y01", "Y10", "Y11"); initSubmodelComponents(); } @SuppressWarnings("unused") // for GUIWires being created private void initSubmodelComponents() { - Pin S0 = getInputSubmodelPins().get(0); - Pin S1 = getInputSubmodelPins().get(1); - Pin Y00 = getOutputSubmodelPins().get(0); - Pin Y01 = getOutputSubmodelPins().get(1); - Pin Y10 = getOutputSubmodelPins().get(2); - Pin Y11 = getOutputSubmodelPins().get(3); + Pin S0 = getSubmodelPin("S0"); + Pin S1 = getSubmodelPin("S1"); + Pin Y00 = getSubmodelPin("Y00"); + Pin Y01 = getSubmodelPin("Y01"); + Pin Y10 = getSubmodelPin("Y10"); + Pin Y11 = getSubmodelPin("Y11"); GUINandGate notS0 = new GUINandGate(submodelModifiable, 1); GUINandGate notS1 = new GUINandGate(submodelModifiable, 1); @@ -51,38 +51,38 @@ public class GUIdemux2 extends SimpleRectangularSubmodelComponent andY01.moveTo(40, 27.5); andY10.moveTo(40, 52.5); andY11.moveTo(40, 77.5); - cpS01.moveTo(7.5, 12.5); - cpS11.moveTo(5, 37.5); - cpS02.moveTo(7.5, 17.5); - cpS12.moveTo(5, 42.5); - cpS03.moveTo(37.5, 62.5); - cpS13.moveTo(32.5, 67.5); - cpNotS0.moveTo(32.5, 12.5); - cpNotS1.moveTo(35, 37.5); + cpS01.moveCenterTo(7.5, 12.5); + cpS11.moveCenterTo(5, 37.5); + cpS02.moveCenterTo(7.5, 17.5); + cpS12.moveCenterTo(5, 42.5); + cpS03.moveCenterTo(37.5, 62.5); + cpS13.moveCenterTo(32.5, 67.5); + cpNotS0.moveCenterTo(32.5, 12.5); + cpNotS1.moveCenterTo(35, 37.5); new GUIWire(submodelModifiable, S0, cpS01, new Point[0]); new GUIWire(submodelModifiable, S1, cpS11, new Point[0]); - new GUIWire(submodelModifiable, cpS01, notS0.getInputPins().get(0), new Point(7.5, 7.5)); - new GUIWire(submodelModifiable, cpS11, notS1.getInputPins().get(0), new Point(5, 32.5)); + new GUIWire(submodelModifiable, cpS01, notS0.getPin("A"), new Point(7.5, 7.5)); + new GUIWire(submodelModifiable, cpS11, notS1.getPin("A"), new Point(5, 32.5)); new GUIWire(submodelModifiable, cpS01, cpS02, new Point[0]); new GUIWire(submodelModifiable, cpS11, cpS12, new Point[0]); - new GUIWire(submodelModifiable, cpS02, notS0.getInputPins().get(1), new Point[0]); - new GUIWire(submodelModifiable, cpS12, notS1.getInputPins().get(1), new Point[0]); + new GUIWire(submodelModifiable, cpS02, notS0.getPin("B"), new Point[0]); + new GUIWire(submodelModifiable, cpS12, notS1.getPin("B"), new Point[0]); new GUIWire(submodelModifiable, cpS02, cpS03, new Point(7.5, 62.5)); new GUIWire(submodelModifiable, cpS12, cpS13, new Point(5, 67.5), new Point(32.5, 67.5)); - new GUIWire(submodelModifiable, notS0.getOutputPin(), cpNotS0, new Point[0]); - new GUIWire(submodelModifiable, notS1.getOutputPin(), cpNotS1, new Point[0]); - new GUIWire(submodelModifiable, cpNotS0, andY00.getInputPins().get(0), new Point(32.5, 7.5)); - new GUIWire(submodelModifiable, cpNotS1, andY00.getInputPins().get(1), new Point(35, 17.5)); - new GUIWire(submodelModifiable, cpS03, andY01.getInputPins().get(0), new Point(37.5, 32.5)); - new GUIWire(submodelModifiable, cpNotS1, andY01.getInputPins().get(1), new Point(35, 42.5)); - new GUIWire(submodelModifiable, cpNotS0, andY10.getInputPins().get(0), new Point(32.5, 57.5)); - new GUIWire(submodelModifiable, cpS13, andY10.getInputPins().get(1), new Point[0]); - new GUIWire(submodelModifiable, cpS03, andY11.getInputPins().get(0), new Point(37.5, 82.5)); - new GUIWire(submodelModifiable, cpS13, andY11.getInputPins().get(1), new Point(32.5, 92.5)); - new GUIWire(submodelModifiable, andY00.getOutputPins().get(0), Y00); - new GUIWire(submodelModifiable, andY01.getOutputPins().get(0), Y01); - new GUIWire(submodelModifiable, andY10.getOutputPins().get(0), Y10); - new GUIWire(submodelModifiable, andY11.getOutputPins().get(0), Y11); + new GUIWire(submodelModifiable, notS0.getPin("Y"), cpNotS0, new Point[0]); + new GUIWire(submodelModifiable, notS1.getPin("Y"), cpNotS1, new Point[0]); + new GUIWire(submodelModifiable, cpNotS0, andY00.getPin("A"), new Point(32.5, 7.5)); + new GUIWire(submodelModifiable, cpNotS1, andY00.getPin("B"), new Point(35, 17.5)); + new GUIWire(submodelModifiable, cpS03, andY01.getPin("A"), new Point(37.5, 32.5)); + new GUIWire(submodelModifiable, cpNotS1, andY01.getPin("B"), new Point(35, 42.5)); + new GUIWire(submodelModifiable, cpNotS0, andY10.getPin("A"), new Point(32.5, 57.5)); + new GUIWire(submodelModifiable, cpS13, andY10.getPin("B"), new Point[0]); + new GUIWire(submodelModifiable, cpS03, andY11.getPin("A"), new Point(37.5, 82.5)); + new GUIWire(submodelModifiable, cpS13, andY11.getPin("B"), new Point(32.5, 92.5)); + new GUIWire(submodelModifiable, andY00.getPin("Y"), Y00); + new GUIWire(submodelModifiable, andY01.getPin("Y"), Y01); + new GUIWire(submodelModifiable, andY10.getPin("Y"), Y10); + new GUIWire(submodelModifiable, andY11.getPin("Y"), Y11); } } \ No newline at end of file