X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fmodel%2Fcomponents%2Fmi%2Fnandbased%2FGUIandor414.java;h=cf5146b03278af0c644402d03e346606050b871e;hb=a84700145147c263ad6692c99117a7cf37832378;hp=d00c22b482ef6e8ac47b6fbfe368e172f67e5229;hpb=5c9a571be01c04a0fb2c14318c2d30346871245c;p=Mograsim.git diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIandor414.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIandor414.java index d00c22b4..cf5146b0 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIandor414.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/mi/nandbased/GUIandor414.java @@ -2,155 +2,64 @@ package net.mograsim.logic.ui.model.components.mi.nandbased; import net.haspamelodica.swt.helper.swtobjectwrappers.Point; import net.mograsim.logic.ui.model.ViewModelModifiable; -import net.mograsim.logic.ui.model.components.SubmodelComponent; +import net.mograsim.logic.ui.model.components.SimpleRectangularSubmodelComponent; import net.mograsim.logic.ui.model.wires.GUIWire; import net.mograsim.logic.ui.model.wires.Pin; -public class GUIandor414 extends SubmodelComponent +public class GUIandor414 extends SimpleRectangularSubmodelComponent { - private final Pin pinC1; - private final Pin pinC2; - private final Pin pinC3; - private final Pin pinC4; - private final Pin pinA1; - private final Pin pinA2; - private final Pin pinA3; - private final Pin pinA4; - private final Pin pinB; - private final Pin pinY1; - private final Pin pinY2; - private final Pin pinY3; - private final Pin pinY4; - public GUIandor414(ViewModelModifiable model) { - super(model, "GUIandor414"); - setSize(50, 90); + super(model, 1, "GUIandor414"); setSubmodelScale(.4); - - Pin C1 = addSubmodelInterface(1, 0, 5); - Pin C2 = addSubmodelInterface(1, 0, 15); - Pin C3 = addSubmodelInterface(1, 0, 25); - Pin C4 = addSubmodelInterface(1, 0, 35); - Pin A1 = addSubmodelInterface(1, 0, 45); - Pin A2 = addSubmodelInterface(1, 0, 55); - Pin A3 = addSubmodelInterface(1, 0, 65); - Pin A4 = addSubmodelInterface(1, 0, 75); - Pin B = addSubmodelInterface(1, 0, 85); - Pin Y1 = addSubmodelInterface(1, 50, 5); - Pin Y2 = addSubmodelInterface(1, 50, 15); - Pin Y3 = addSubmodelInterface(1, 50, 25); - Pin Y4 = addSubmodelInterface(1, 50, 35); - - this.pinC1 = getSupermodelPin(C1); - this.pinC2 = getSupermodelPin(C2); - this.pinC3 = getSupermodelPin(C3); - this.pinC4 = getSupermodelPin(C4); - this.pinA1 = getSupermodelPin(A1); - this.pinA2 = getSupermodelPin(A2); - this.pinA3 = getSupermodelPin(A3); - this.pinA4 = getSupermodelPin(A4); - this.pinB = getSupermodelPin(B); - this.pinY1 = getSupermodelPin(Y1); - this.pinY2 = getSupermodelPin(Y2); - this.pinY3 = getSupermodelPin(Y3); - this.pinY4 = getSupermodelPin(Y4); - - initSubmodelComponents(C1, C2, C3, C4, A1, A2, A3, A4, B, Y1, Y2, Y3, Y4); + setInputPins("C1", "C2", "C3", "C4", "A1", "A2", "A3", "A4", "B"); + setOutputPins("Y1", "Y2", "Y3", "Y4"); + initSubmodelComponents(); } @SuppressWarnings("unused") // for GUIWires being created - private void initSubmodelComponents(Pin C1, Pin C2, Pin C3, Pin C4, Pin A1, Pin A2, Pin A3, Pin A4, Pin B, Pin Y1, Pin Y2, Pin Y3, - Pin Y4) + private void initSubmodelComponents() { + Pin C1 = getSubmodelPin("C1"); + Pin C2 = getSubmodelPin("C2"); + Pin C3 = getSubmodelPin("C3"); + Pin C4 = getSubmodelPin("C4"); + Pin A1 = getSubmodelPin("A1"); + Pin A2 = getSubmodelPin("A2"); + Pin A3 = getSubmodelPin("A3"); + Pin A4 = getSubmodelPin("A4"); + Pin B = getSubmodelPin("B"); + Pin Y1 = getSubmodelPin("Y1"); + Pin Y2 = getSubmodelPin("Y2"); + Pin Y3 = getSubmodelPin("Y3"); + Pin Y4 = getSubmodelPin("Y4"); + GUIand41 and = new GUIand41(submodelModifiable); GUIor_4 or = new GUIor_4(submodelModifiable); and.moveTo(15, 137.5); - or.moveTo(55, 97.5); - - new GUIWire(submodelModifiable, A1, and.getPinA1(), new Point(10, 112.5), new Point(10, 142.5)); - new GUIWire(submodelModifiable, A2, and.getPinA2(), new Point(5, 137.5), new Point(5, 152.5)); - new GUIWire(submodelModifiable, A3, and.getPinA3()); - new GUIWire(submodelModifiable, A4, and.getPinA4(), new Point(5, 187.5), new Point(5, 172.5)); - new GUIWire(submodelModifiable, B, and.getPinB(), new Point(10, 212.5), new Point(10, 187.5)); - new GUIWire(submodelModifiable, C1, or.getPinA1(), new Point(50, 12.5), new Point(50, 102.5)); - new GUIWire(submodelModifiable, C2, or.getPinA2(), new Point(45, 37.5), new Point(45, 112.5)); - new GUIWire(submodelModifiable, C3, or.getPinA3(), new Point(40, 62.5), new Point(40, 122.5)); - new GUIWire(submodelModifiable, C4, or.getPinA4(), new Point(35, 87.5), new Point(35, 132.5)); - new GUIWire(submodelModifiable, and.getPinY1(), or.getPinB1()); - new GUIWire(submodelModifiable, and.getPinY2(), or.getPinB2()); - new GUIWire(submodelModifiable, and.getPinY3(), or.getPinB3()); - new GUIWire(submodelModifiable, and.getPinY4(), or.getPinB4()); - new GUIWire(submodelModifiable, or.getPinY1(), Y1, new Point(100, 102.5), new Point(100, 12.5)); - new GUIWire(submodelModifiable, or.getPinY2(), Y2, new Point(105, 112.5), new Point(105, 37.5)); - new GUIWire(submodelModifiable, or.getPinY3(), Y3, new Point(110, 122.5), new Point(110, 62.5)); - new GUIWire(submodelModifiable, or.getPinY4(), Y4, new Point(115, 132.5), new Point(115, 87.5)); - } - - public Pin getPinC1() - { - return pinC1; - } - - public Pin getPinC2() - { - return pinC2; - } - - public Pin getPinC3() - { - return pinC3; - } - - public Pin getPinC4() - { - return pinC4; - } - - public Pin getPinA1() - { - return pinA1; - } - - public Pin getPinA2() - { - return pinA2; - } - - public Pin getPinA3() - { - return pinA3; - } - - public Pin getPinA4() - { - return pinA4; - } - - public Pin getPinB() - { - return pinB; + or.moveTo(35, 37.5); + + new GUIWire(submodelModifiable, A1, and.getPin("A1"), new Point(10, 112.5), new Point(10, 142.5)); + new GUIWire(submodelModifiable, A2, and.getPin("A2"), new Point(5, 137.5), new Point(5, 152.5)); + new GUIWire(submodelModifiable, A3, and.getPin("A3"), new Point[0]); + new GUIWire(submodelModifiable, A4, and.getPin("A4"), new Point(5, 187.5), new Point(5, 172.5)); + new GUIWire(submodelModifiable, B, and.getPin("B"), new Point(10, 212.5), new Point(10, 182.5)); + new GUIWire(submodelModifiable, C1, or.getPin("A1"), new Point(10, 12.5), new Point(10, 42.5)); + new GUIWire(submodelModifiable, C2, or.getPin("A2"), new Point(5, 37.5), new Point(5, 52.5)); + new GUIWire(submodelModifiable, C3, or.getPin("A3"), new Point[0]); + new GUIWire(submodelModifiable, C4, or.getPin("A4"), new Point(5, 87.5), new Point(5, 72.5)); + new GUIWire(submodelModifiable, and.getPin("Y1"), or.getPin("B1"), new Point(70, 142.5), new Point(70, 120), new Point(30, 120), + new Point(30, 82.5)); + new GUIWire(submodelModifiable, and.getPin("Y2"), or.getPin("B2"), new Point(65, 152.5), new Point(65, 125), new Point(25, 125), + new Point(25, 92.5)); + new GUIWire(submodelModifiable, and.getPin("Y3"), or.getPin("B3"), new Point(60, 162.5), new Point(60, 130), new Point(20, 130), + new Point(20, 102.5)); + new GUIWire(submodelModifiable, and.getPin("Y4"), or.getPin("B4"), new Point(55, 172.5), new Point(55, 135), new Point(15, 135), + new Point(15, 112.5)); + new GUIWire(submodelModifiable, or.getPin("Y1"), Y1, new Point(75, 42.5), new Point(75, 12.5)); + new GUIWire(submodelModifiable, or.getPin("Y2"), Y2, new Point(80, 52.5), new Point(80, 37.5)); + new GUIWire(submodelModifiable, or.getPin("Y3"), Y3, new Point[0]); + new GUIWire(submodelModifiable, or.getPin("Y4"), Y4, new Point(80, 72.5), new Point(80, 87.5)); } - - public Pin getPinY1() - { - return pinY1; - } - - public Pin getPinY2() - { - return pinY2; - } - - public Pin getPinY3() - { - return pinY3; - } - - public Pin getPinY4() - { - return pinY4; - } - } \ No newline at end of file