1 package net.mograsim.logic.ui.model.components.mi.nandbased.am2901;
3 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
4 import net.mograsim.logic.ui.model.ViewModelModifiable;
5 import net.mograsim.logic.ui.model.components.mi.nandbased.GUIsel2_4;
6 import net.mograsim.logic.ui.model.components.mi.nandbased.GUIsel3_4;
7 import net.mograsim.logic.ui.model.components.submodels.SimpleRectangularSubmodelComponent;
8 import net.mograsim.logic.ui.model.wires.GUIWire;
9 import net.mograsim.logic.ui.model.wires.Pin;
10 import net.mograsim.logic.ui.model.wires.WireCrossPoint;
11 import net.mograsim.logic.ui.serializing.IndirectGUIComponentCreator;
13 public class GUIAm2901ALUInclSourceDecodeInclFunctionDecode extends SimpleRectangularSubmodelComponent
15 public GUIAm2901ALUInclSourceDecodeInclFunctionDecode(ViewModelModifiable model)
17 super(model, 1, "GUIAm2901ALUInclSourceDecodeInclFunctionDecode");
18 setSubmodelScale(.25);
19 setInputPins("I5", "I4", "I3", "I2", "I1", "I0", "Cn", "D1", "D2", "D3", "D4", "A1", "A2", "A3", "A4", "B1", "B2", "B3", "B4", "Q1",
21 setOutputPins("F1", "F2", "F3", "F4", "Cn+4", "OVR");
22 initSubmodelComponents();
25 @SuppressWarnings("unused") // for GUIWires being created
26 private void initSubmodelComponents()
28 Pin I5 = getSubmodelPin("I5");
29 Pin I4 = getSubmodelPin("I4");
30 Pin I3 = getSubmodelPin("I3");
31 Pin I2 = getSubmodelPin("I2");
32 Pin I1 = getSubmodelPin("I1");
33 Pin I0 = getSubmodelPin("I0");
34 Pin Cn = getSubmodelPin("Cn");
35 Pin D1 = getSubmodelPin("D1");
36 Pin D2 = getSubmodelPin("D2");
37 Pin D3 = getSubmodelPin("D3");
38 Pin D4 = getSubmodelPin("D4");
39 Pin A1 = getSubmodelPin("A1");
40 Pin A2 = getSubmodelPin("A2");
41 Pin A3 = getSubmodelPin("A3");
42 Pin A4 = getSubmodelPin("A4");
43 Pin B1 = getSubmodelPin("B1");
44 Pin B2 = getSubmodelPin("B2");
45 Pin B3 = getSubmodelPin("B3");
46 Pin B4 = getSubmodelPin("B4");
47 Pin Q1 = getSubmodelPin("Q1");
48 Pin Q2 = getSubmodelPin("Q2");
49 Pin Q3 = getSubmodelPin("Q3");
50 Pin Q4 = getSubmodelPin("Q4");
51 Pin F1 = getSubmodelPin("F1");
52 Pin F2 = getSubmodelPin("F2");
53 Pin F3 = getSubmodelPin("F3");
54 Pin F4 = getSubmodelPin("F4");
55 Pin Cnplus4 = getSubmodelPin("Cn+4");
56 Pin OVR = getSubmodelPin("OVR");
58 GUIAm2901SourceDecode sourceDecode = new GUIAm2901SourceDecode(submodelModifiable);
59 GUIsel2_4 selR = new GUIsel2_4(submodelModifiable);
60 GUIsel3_4 selS = new GUIsel3_4(submodelModifiable);
61 GUIAm2901ALUInclDecode alu = new GUIAm2901ALUInclDecode(submodelModifiable);
63 WireCrossPoint cpA1 = new WireCrossPoint(submodelModifiable, 1);
64 WireCrossPoint cpA2 = new WireCrossPoint(submodelModifiable, 1);
65 WireCrossPoint cpA3 = new WireCrossPoint(submodelModifiable, 1);
66 WireCrossPoint cpA4 = new WireCrossPoint(submodelModifiable, 1);
68 sourceDecode.moveTo(15, 165);
72 cpA1.moveCenterTo(10, 460);
73 cpA2.moveCenterTo(15, 500);
74 cpA3.moveCenterTo(20, 540);
75 cpA4.moveCenterTo(25, 580);
77 new GUIWire(submodelModifiable, I5, alu.getPin("I5"), new Point[0]);
78 new GUIWire(submodelModifiable, I4, alu.getPin("I4"), new Point(5, 60), new Point(5, 30));
79 new GUIWire(submodelModifiable, I3, alu.getPin("I3"), new Point(15, 100), new Point(15, 40));
80 new GUIWire(submodelModifiable, I2, sourceDecode.getPin("I2"), new Point(5, 140), new Point(5, 170));
81 new GUIWire(submodelModifiable, I1, sourceDecode.getPin("I1"), new Point[0]);
82 new GUIWire(submodelModifiable, I0, sourceDecode.getPin("I0"), new Point(5, 220), new Point(5, 190));
83 new GUIWire(submodelModifiable, Cn, alu.getPin("Cn"), new Point(10, 260), new Point(10, 50));
84 new GUIWire(submodelModifiable, D1, selR.getPin("A1"), new Point(15, 300), new Point(15, 390));
85 new GUIWire(submodelModifiable, D2, selR.getPin("A2"), new Point(10, 340), new Point(10, 400));
86 new GUIWire(submodelModifiable, D3, selR.getPin("A3"), new Point(5, 380), new Point(5, 410));
87 new GUIWire(submodelModifiable, D4, selR.getPin("A4"), new Point[0]);
88 new GUIWire(submodelModifiable, A1, cpA1, new Point[0]);
89 new GUIWire(submodelModifiable, A2, cpA2, new Point[0]);
90 new GUIWire(submodelModifiable, A3, cpA3, new Point[0]);
91 new GUIWire(submodelModifiable, A4, cpA4, new Point[0]);
92 new GUIWire(submodelModifiable, cpA1, selR.getPin("B1"), new Point(10, 430));
93 new GUIWire(submodelModifiable, cpA2, selR.getPin("B2"), new Point(15, 440));
94 new GUIWire(submodelModifiable, cpA3, selR.getPin("B3"), new Point(20, 450));
95 new GUIWire(submodelModifiable, cpA4, selR.getPin("B4"), new Point(25, 460));
96 new GUIWire(submodelModifiable, cpA1, selS.getPin("A1"), new Point(10, 610));
97 new GUIWire(submodelModifiable, cpA2, selS.getPin("A2"), new Point(15, 620));
98 new GUIWire(submodelModifiable, cpA3, selS.getPin("A3"), new Point(20, 630));
99 new GUIWire(submodelModifiable, cpA4, selS.getPin("A4"), new Point(25, 640));
100 new GUIWire(submodelModifiable, B1, selS.getPin("B1"), new Point(5, 620), new Point(5, 650));
101 new GUIWire(submodelModifiable, B2, selS.getPin("B2"), new Point[0]);
102 new GUIWire(submodelModifiable, B3, selS.getPin("B3"), new Point(5, 700), new Point(5, 670));
103 new GUIWire(submodelModifiable, B4, selS.getPin("B4"), new Point(10, 740), new Point(10, 680));
104 new GUIWire(submodelModifiable, Q1, selS.getPin("C1"), new Point(15, 780), new Point(15, 690));
105 new GUIWire(submodelModifiable, Q2, selS.getPin("C2"), new Point(20, 820), new Point(20, 700));
106 new GUIWire(submodelModifiable, Q3, selS.getPin("C3"), new Point(25, 860), new Point(25, 710));
107 new GUIWire(submodelModifiable, Q4, selS.getPin("C4"), new Point(30, 900), new Point(30, 720));
108 new GUIWire(submodelModifiable, sourceDecode.getPin("SQ"), selS.getPin("SC"), new Point(75, 170), new Point(75, 240),
109 new Point(30, 240), new Point(30, 600));
110 new GUIWire(submodelModifiable, sourceDecode.getPin("RA"), selR.getPin("SB"), new Point(70, 180), new Point(70, 235),
111 new Point(20, 235), new Point(20, 380));
112 new GUIWire(submodelModifiable, sourceDecode.getPin("SB"), selS.getPin("SB"), new Point(65, 190), new Point(65, 230),
113 new Point(35, 230), new Point(35, 590));
114 new GUIWire(submodelModifiable, sourceDecode.getPin("SA"), selS.getPin("SA"), new Point(60, 200), new Point(60, 225),
115 new Point(40, 225), new Point(40, 580));
116 new GUIWire(submodelModifiable, sourceDecode.getPin("RD"), selR.getPin("SA"), new Point(55, 210), new Point(55, 220),
117 new Point(25, 220), new Point(25, 370));
118 new GUIWire(submodelModifiable, selR.getPin("Y1"), alu.getPin("R1"), new Point(82.5, 370), new Point(82.5, 162.5),
119 new Point(20, 162.5), new Point(20, 60));
120 new GUIWire(submodelModifiable, selR.getPin("Y2"), alu.getPin("R2"), new Point(85, 380), new Point(85, 160), new Point(22.5, 160),
121 new Point(22.5, 70));
122 new GUIWire(submodelModifiable, selR.getPin("Y3"), alu.getPin("R3"), new Point(87.5, 390), new Point(87.5, 157.5),
123 new Point(25, 157.5), new Point(25, 80));
124 new GUIWire(submodelModifiable, selR.getPin("Y4"), alu.getPin("R4"), new Point(90, 400), new Point(90, 155), new Point(27.5, 155),
125 new Point(27.5, 90));
126 new GUIWire(submodelModifiable, selS.getPin("Y1"), alu.getPin("S1"), new Point(92.5, 580), new Point(92.5, 152.5),
127 new Point(30, 152.5), new Point(30, 100));
128 new GUIWire(submodelModifiable, selS.getPin("Y2"), alu.getPin("S2"), new Point(95, 590), new Point(95, 150), new Point(32.5, 150),
129 new Point(32.5, 110));
130 new GUIWire(submodelModifiable, selS.getPin("Y3"), alu.getPin("S3"), new Point(97.5, 600), new Point(97.5, 147.5),
131 new Point(35, 147.5), new Point(35, 120));
132 new GUIWire(submodelModifiable, selS.getPin("Y4"), alu.getPin("S4"), new Point(100, 610), new Point(100, 145), new Point(37.5, 145),
133 new Point(37.5, 130));
134 new GUIWire(submodelModifiable, alu.getPin("F1"), F1, new Point[0]);
135 new GUIWire(submodelModifiable, alu.getPin("F2"), F2, new Point(135, 30), new Point(135, 60));
136 new GUIWire(submodelModifiable, alu.getPin("F3"), F3, new Point(130, 40), new Point(130, 100));
137 new GUIWire(submodelModifiable, alu.getPin("F4"), F4, new Point(125, 50), new Point(125, 140));
138 new GUIWire(submodelModifiable, alu.getPin("Cn+4"), Cnplus4, new Point(120, 60), new Point(120, 180));
139 new GUIWire(submodelModifiable, alu.getPin("OVR"), OVR, new Point(115, 70), new Point(115, 220));
144 IndirectGUIComponentCreator.setComponentProvider(GUIAm2901ALUInclSourceDecodeInclFunctionDecode.class.getCanonicalName(),
145 (m, p) -> new GUIAm2901ALUInclSourceDecodeInclFunctionDecode(m));