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.submodels.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;
10 public class GUImux1_4 extends SimpleRectangularSubmodelComponent
12 public GUImux1_4(ViewModelModifiable model)
14 super(model, 1, "GUImux1_4");
16 setInputPins("S0", "I0_1", "I0_2", "I0_3", "I0_4", "I1_1", "I1_2", "I1_3", "I1_4");
17 setOutputPins("Y1", "Y2", "Y3", "Y4");
18 initSubmodelComponents();
21 @SuppressWarnings("unused")
22 private void initSubmodelComponents()
24 Pin S0 = getSubmodelPin("S0");
25 Pin I0_1 = getSubmodelPin("I0_1");
26 Pin I0_2 = getSubmodelPin("I0_2");
27 Pin I0_3 = getSubmodelPin("I0_3");
28 Pin I0_4 = getSubmodelPin("I0_4");
29 Pin I1_1 = getSubmodelPin("I1_1");
30 Pin I1_2 = getSubmodelPin("I1_2");
31 Pin I1_3 = getSubmodelPin("I1_3");
32 Pin I1_4 = getSubmodelPin("I1_4");
33 Pin Y1 = getSubmodelPin("Y1");
34 Pin Y2 = getSubmodelPin("Y2");
35 Pin Y3 = getSubmodelPin("Y3");
36 Pin Y4 = getSubmodelPin("Y4");
38 GUImux1 mux1 = new GUImux1(submodelModifiable);
39 GUImux1 mux2 = new GUImux1(submodelModifiable);
40 GUImux1 mux3 = new GUImux1(submodelModifiable);
41 GUImux1 mux4 = new GUImux1(submodelModifiable);
43 WireCrossPoint cp1 = new WireCrossPoint(submodelModifiable, 1);
44 WireCrossPoint cp2 = new WireCrossPoint(submodelModifiable, 1);
45 WireCrossPoint cp3 = new WireCrossPoint(submodelModifiable, 1);
48 mux2.moveTo(30, 42.5);
49 mux3.moveTo(30, 77.5);
50 mux4.moveTo(30, 112.5);
51 cp1.moveCenterTo(25, 12.5);
52 cp2.moveCenterTo(25, 47.5);
53 cp3.moveCenterTo(25, 82.5);
55 new GUIWire(submodelModifiable, S0, cp1, new Point[0]);
56 new GUIWire(submodelModifiable, cp1, mux1.getPin("S0"), new Point[0]);
57 new GUIWire(submodelModifiable, I0_1, mux1.getPin("I0"), new Point(5, 37.5), new Point(5, 22.5));
58 new GUIWire(submodelModifiable, I1_1, mux1.getPin("I1"), new Point(10, 137.5), new Point(10, 32.5));
59 new GUIWire(submodelModifiable, mux1.getPin("Y"), Y1, new Point[0]);
60 new GUIWire(submodelModifiable, cp1, cp2, new Point[0]);
61 new GUIWire(submodelModifiable, cp2, mux2.getPin("S0"), new Point[0]);
62 new GUIWire(submodelModifiable, I0_2, mux2.getPin("I0"), new Point(5, 62.5), new Point(5, 57.5));
63 new GUIWire(submodelModifiable, I1_2, mux2.getPin("I1"), new Point(15, 162.5), new Point(15, 67.5));
64 new GUIWire(submodelModifiable, mux2.getPin("Y"), Y2);
65 new GUIWire(submodelModifiable, cp2, cp3, new Point[0]);
66 new GUIWire(submodelModifiable, cp3, mux3.getPin("S0"), new Point[0]);
67 new GUIWire(submodelModifiable, I0_3, mux3.getPin("I0"), new Point(5, 87.5), new Point(5, 92.5));
68 new GUIWire(submodelModifiable, I1_3, mux3.getPin("I1"), new Point(20, 187.5), new Point(20, 102.5));
69 new GUIWire(submodelModifiable, mux3.getPin("Y"), Y3);
70 new GUIWire(submodelModifiable, cp3, mux4.getPin("S0"), new Point(25, 117.5));
71 new GUIWire(submodelModifiable, I0_4, mux4.getPin("I0"), new Point(5, 112.5), new Point(5, 127.5));
72 new GUIWire(submodelModifiable, I1_4, mux4.getPin("I1"), new Point(25, 212.5), new Point(25, 137.5));
73 new GUIWire(submodelModifiable, mux4.getPin("Y"), Y4);