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.GUINandGate;
6 import net.mograsim.logic.ui.model.components.SimpleRectangularSubmodelComponent;
7 import net.mograsim.logic.ui.model.wires.GUIWire;
8 import net.mograsim.logic.ui.model.wires.Pin;
9 import net.mograsim.logic.ui.model.wires.WireCrossPoint;
11 public class GUIAm2901DestDecode extends SimpleRectangularSubmodelComponent
13 public GUIAm2901DestDecode(ViewModelModifiable model)
15 super(model, 1, "GUIAm2901DestDecode");
16 setSubmodelScale(.25);
17 setInputPins("I8", "I7", "I6");
18 setOutputPins("NSH", "RSH", "RAMWE", "YF", "LSH", "QWE");
19 initSubmodelComponents();
22 @SuppressWarnings("unused") // for GUIWires being created
23 private void initSubmodelComponents()
25 Pin I8 = getInputSubmodelPins().get(0);
26 Pin I7 = getInputSubmodelPins().get(1);
27 Pin I6 = getInputSubmodelPins().get(2);
28 Pin NSH = getOutputSubmodelPins().get(0);
29 Pin RSH = getOutputSubmodelPins().get(1);
30 Pin RAMWE = getOutputSubmodelPins().get(2);
31 Pin YF = getOutputSubmodelPins().get(3);
32 Pin LSH = getOutputSubmodelPins().get(4);
33 Pin QWE = getOutputSubmodelPins().get(5);
35 GUINandGate notI8 = new GUINandGate(submodelModifiable, 1);
36 GUINandGate notI7 = new GUINandGate(submodelModifiable, 1);
37 GUINandGate nandI8I7 = new GUINandGate(submodelModifiable, 1);
38 GUINandGate notI6 = new GUINandGate(submodelModifiable, 1);
39 GUINandGate nandRSH = new GUINandGate(submodelModifiable, 1);
40 GUINandGate nandRAMWE = new GUINandGate(submodelModifiable, 1);
41 GUINandGate nandI7NotI8 = new GUINandGate(submodelModifiable, 1);
42 GUINandGate nandLSH = new GUINandGate(submodelModifiable, 1);
43 GUINandGate notRSH = new GUINandGate(submodelModifiable, 1);
44 GUINandGate andI7NotI8 = new GUINandGate(submodelModifiable, 1);
45 GUINandGate nandQWE = new GUINandGate(submodelModifiable, 1);
46 GUINandGate nandYF = new GUINandGate(submodelModifiable, 1);
47 GUINandGate notQWE = new GUINandGate(submodelModifiable, 1);
49 WireCrossPoint cpI81 = new WireCrossPoint(submodelModifiable, 1);
50 WireCrossPoint cpI82 = new WireCrossPoint(submodelModifiable, 1);
51 WireCrossPoint cpI83 = new WireCrossPoint(submodelModifiable, 1);
52 WireCrossPoint cpI71 = new WireCrossPoint(submodelModifiable, 1);
53 WireCrossPoint cpI72 = new WireCrossPoint(submodelModifiable, 1);
54 WireCrossPoint cpI73 = new WireCrossPoint(submodelModifiable, 1);
55 WireCrossPoint cpI6 = new WireCrossPoint(submodelModifiable, 1);
56 WireCrossPoint cpNotI7 = new WireCrossPoint(submodelModifiable, 1);
57 WireCrossPoint cpNotI81 = new WireCrossPoint(submodelModifiable, 1);
58 WireCrossPoint cpNotI82 = new WireCrossPoint(submodelModifiable, 1);
59 WireCrossPoint cpNandI8I7 = new WireCrossPoint(submodelModifiable, 1);
60 WireCrossPoint cpNotRSH = new WireCrossPoint(submodelModifiable, 1);
61 WireCrossPoint cpNandI7NotI81 = new WireCrossPoint(submodelModifiable, 1);
62 WireCrossPoint cpNandI7NotI82 = new WireCrossPoint(submodelModifiable, 1);
63 WireCrossPoint cpNotI6 = new WireCrossPoint(submodelModifiable, 1);
64 WireCrossPoint cpNandQWE = new WireCrossPoint(submodelModifiable, 1);
68 nandI8I7.moveTo(15, 90);
69 notI6.moveTo(15, 150);
70 nandRSH.moveTo(50, 10);
71 nandRAMWE.moveTo(50, 50);
72 nandI7NotI8.moveTo(50, 90);
73 nandLSH.moveTo(50, 130);
74 notRSH.moveTo(80, 10);
75 andI7NotI8.moveTo(80, 90);
76 nandQWE.moveTo(80, 145);
77 nandYF.moveTo(110, 105);
78 notQWE.moveTo(115, 210);
79 cpI81.moveCenterTo(5, 20);
80 cpI82.moveCenterTo(5, 15);
81 cpI83.moveCenterTo(5, 25);
82 cpI71.moveCenterTo(10, 60);
83 cpI72.moveCenterTo(10, 65);
84 cpI73.moveCenterTo(10, 105);
85 cpI6.moveCenterTo(5, 155);
86 cpNotI7.moveCenterTo(40, 60);
87 cpNotI81.moveCenterTo(45, 20);
88 cpNotI82.moveCenterTo(45, 55);
89 cpNandI8I7.moveCenterTo(40, 135);
90 cpNotRSH.moveCenterTo(75, 20);
91 cpNandI7NotI81.moveCenterTo(75, 100);
92 cpNandI7NotI82.moveCenterTo(75, 105);
93 cpNotI6.moveCenterTo(75, 160);
94 cpNandQWE.moveCenterTo(110, 215);
96 new GUIWire(submodelModifiable, I8, cpI81, new Point[0]);
97 new GUIWire(submodelModifiable, cpI81, cpI82, new Point[0]);
98 new GUIWire(submodelModifiable, cpI81, cpI83, new Point[0]);
99 new GUIWire(submodelModifiable, cpI82, notI8.getInputPins().get(0), new Point[0]);
100 new GUIWire(submodelModifiable, cpI83, notI8.getInputPins().get(1), new Point[0]);
101 new GUIWire(submodelModifiable, I7, cpI71, new Point[0]);
102 new GUIWire(submodelModifiable, cpI71, notI7.getInputPins().get(0), new Point(10, 55));
103 new GUIWire(submodelModifiable, cpI71, cpI72, new Point[0]);
104 new GUIWire(submodelModifiable, cpI72, notI7.getInputPins().get(1), new Point[0]);
105 new GUIWire(submodelModifiable, cpI72, cpI73, new Point[0]);
106 new GUIWire(submodelModifiable, cpI73, nandI8I7.getInputPins().get(1), new Point[0]);
107 new GUIWire(submodelModifiable, cpI83, nandI8I7.getInputPins().get(0), new Point(5, 95));
108 new GUIWire(submodelModifiable, I6, cpI6, new Point(5, 100));
109 new GUIWire(submodelModifiable, cpI6, notI6.getInputPins().get(0), new Point[0]);
110 new GUIWire(submodelModifiable, cpI6, notI6.getInputPins().get(1), new Point(5, 165));
111 new GUIWire(submodelModifiable, cpI82, nandRSH.getInputPins().get(0), new Point(5, 5), new Point(40, 5), new Point(40, 15));
112 new GUIWire(submodelModifiable, notI7.getOutputPin(), cpNotI7, new Point[0]);
113 new GUIWire(submodelModifiable, cpNotI7, nandRSH.getInputPins().get(1), new Point(40, 25));
114 new GUIWire(submodelModifiable, cpNotI7, nandRAMWE.getInputPins().get(1), new Point(40, 65));
115 new GUIWire(submodelModifiable, notI8.getOutputPin(), cpNotI81, new Point[0]);
116 new GUIWire(submodelModifiable, cpNotI81, NSH, new Point(45, 5), new Point(135, 5), new Point(135, 20));
117 new GUIWire(submodelModifiable, cpNotI81, cpNotI82, new Point[0]);
118 new GUIWire(submodelModifiable, cpNotI82, nandRAMWE.getInputPins().get(0), new Point[0]);
119 new GUIWire(submodelModifiable, cpNotI82, nandI7NotI8.getInputPins().get(0), new Point(45, 95));
120 new GUIWire(submodelModifiable, cpI73, nandI7NotI8.getInputPins().get(1), new Point(10, 115), new Point(45, 115),
122 new GUIWire(submodelModifiable, nandI8I7.getOutputPin(), cpNandI8I7, new Point(40, 100));
123 new GUIWire(submodelModifiable, cpNandI8I7, nandLSH.getInputPins().get(0), new Point[0]);
124 new GUIWire(submodelModifiable, cpNandI8I7, nandLSH.getInputPins().get(1), new Point(40, 145));
125 new GUIWire(submodelModifiable, nandRSH.getOutputPin(), cpNotRSH, new Point[0]);
126 new GUIWire(submodelModifiable, cpNotRSH, notRSH.getInputPins().get(0), new Point(75, 15));
127 new GUIWire(submodelModifiable, cpNotRSH, notRSH.getInputPins().get(1), new Point(75, 25));
128 new GUIWire(submodelModifiable, nandRAMWE.getOutputPin(), RAMWE, new Point(125, 60), new Point(125, 100));
129 new GUIWire(submodelModifiable, nandI7NotI8.getOutputPin(), cpNandI7NotI81, new Point[0]);
130 new GUIWire(submodelModifiable, cpNandI7NotI81, andI7NotI8.getInputPins().get(0), new Point(75, 95));
131 new GUIWire(submodelModifiable, cpNandI7NotI81, cpNandI7NotI82, new Point[0]);
132 new GUIWire(submodelModifiable, cpNandI7NotI82, andI7NotI8.getInputPins().get(1), new Point[0]);
133 new GUIWire(submodelModifiable, nandLSH.getOutputPin(), LSH, new Point(125, 140), new Point(125, 180));
134 new GUIWire(submodelModifiable, cpNandI7NotI82, nandQWE.getInputPins().get(0), new Point(75, 150));
135 new GUIWire(submodelModifiable, notI6.getOutputPin(), cpNotI6, new Point[0]);
136 new GUIWire(submodelModifiable, cpNotI6, nandQWE.getInputPins().get(1), new Point[0]);
137 new GUIWire(submodelModifiable, notRSH.getOutputPin(), RSH, new Point(130, 20), new Point(130, 60));
138 new GUIWire(submodelModifiable, andI7NotI8.getOutputPin(), nandYF.getInputPins().get(0));
139 new GUIWire(submodelModifiable, cpNotI6, nandYF.getInputPins().get(1), new Point(75, 170), new Point(105, 170),
140 new Point(105, 120));
141 new GUIWire(submodelModifiable, nandQWE.getOutputPin(), cpNandQWE, new Point(110, 155));
142 new GUIWire(submodelModifiable, cpNandQWE, notQWE.getInputPins().get(0), new Point[0]);
143 new GUIWire(submodelModifiable, cpNandQWE, notQWE.getInputPins().get(1), new Point(110, 225));
144 new GUIWire(submodelModifiable, nandYF.getOutputPin(), YF);
145 new GUIWire(submodelModifiable, notQWE.getOutputPin(), QWE, new Point[0]);