1 package net.mograsim.logic.ui.model.components.mi.nandbased;
3 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
4 import net.mograsim.logic.ui.model.ViewModelModifiable;
5 import net.mograsim.logic.ui.model.components.SimpleRectangularSubmodelComponent;
6 import net.mograsim.logic.ui.model.wires.GUIWire;
7 import net.mograsim.logic.ui.model.wires.Pin;
8 import net.mograsim.logic.ui.model.wires.WireCrossPoint;
29 public class GUImux1_4 extends SimpleRectangularSubmodelComponent
31 public GUImux1_4(ViewModelModifiable model)
33 super(model, 1, "GUImux1_4");
37 initSubmodelComponents();
40 @SuppressWarnings("unused")
41 private void initSubmodelComponents()
43 Pin S0 = getInputSubmodelPins().get(0);
44 Pin I0_1 = getInputSubmodelPins().get(1);
45 Pin I0_2 = getInputSubmodelPins().get(2);
46 Pin I0_3 = getInputSubmodelPins().get(3);
47 Pin I0_4 = getInputSubmodelPins().get(4);
48 Pin I1_1 = getInputSubmodelPins().get(5);
49 Pin I1_2 = getInputSubmodelPins().get(6);
50 Pin I1_3 = getInputSubmodelPins().get(7);
51 Pin I1_4 = getInputSubmodelPins().get(8);
52 Pin Y1 = getOutputSubmodelPins().get(0);
53 Pin Y2 = getOutputSubmodelPins().get(1);
54 Pin Y3 = getOutputSubmodelPins().get(2);
55 Pin Y4 = getOutputSubmodelPins().get(3);
57 GUImux1 mux1 = new GUImux1(submodelModifiable);
58 GUImux1 mux2 = new GUImux1(submodelModifiable);
59 GUImux1 mux3 = new GUImux1(submodelModifiable);
60 GUImux1 mux4 = new GUImux1(submodelModifiable);
62 WireCrossPoint cp1 = new WireCrossPoint(submodelModifiable, 1);
63 WireCrossPoint cp2 = new WireCrossPoint(submodelModifiable, 1);
64 WireCrossPoint cp3 = new WireCrossPoint(submodelModifiable, 1);
67 mux2.moveTo(30, 42.5);
68 mux3.moveTo(30, 77.5);
69 mux4.moveTo(30, 112.5);
74 new GUIWire(submodelModifiable, S0, cp1, new Point[0]);
75 new GUIWire(submodelModifiable, cp1, mux1.getInputPins().get(0), new Point[0]);
76 new GUIWire(submodelModifiable, I0_1, mux1.getInputPins().get(1), new Point(5, 37.5), new Point(5, 22.5));
77 new GUIWire(submodelModifiable, I1_1, mux1.getInputPins().get(2), new Point(10, 137.5), new Point(10, 32.5));
78 new GUIWire(submodelModifiable, mux1.getOutputPins().get(0), Y1, new Point[0]);
79 new GUIWire(submodelModifiable, cp1, cp2, new Point[0]);
80 new GUIWire(submodelModifiable, cp2, mux2.getInputPins().get(0), new Point[0]);
81 new GUIWire(submodelModifiable, I0_2, mux2.getInputPins().get(1), new Point(5, 62.5), new Point(5, 57.5));
82 new GUIWire(submodelModifiable, I1_2, mux2.getInputPins().get(2), new Point(15, 162.5), new Point(15, 67.5));
83 new GUIWire(submodelModifiable, mux2.getOutputPins().get(0), Y2);
84 new GUIWire(submodelModifiable, cp2, cp3, new Point[0]);
85 new GUIWire(submodelModifiable, cp3, mux3.getInputPins().get(0), new Point[0]);
86 new GUIWire(submodelModifiable, I0_3, mux3.getInputPins().get(1), new Point(5, 87.5), new Point(5, 92.5));
87 new GUIWire(submodelModifiable, I1_3, mux3.getInputPins().get(2), new Point(20, 187.5), new Point(20, 102.5));
88 new GUIWire(submodelModifiable, mux3.getOutputPins().get(0), Y3);
89 new GUIWire(submodelModifiable, cp3, mux4.getInputPins().get(0), new Point(25, 117.5));
90 new GUIWire(submodelModifiable, I0_4, mux4.getInputPins().get(1), new Point(5, 112.5), new Point(5, 127.5));
91 new GUIWire(submodelModifiable, I1_4, mux4.getInputPins().get(2), new Point(25, 212.5), new Point(25, 137.5));
92 new GUIWire(submodelModifiable, mux4.getOutputPins().get(0), Y4);