59df09bc32e1ad6bba4fb9bea37d082de757b6a6
[Mograsim.git] / net.mograsim.logic.ui / src / net / mograsim / logic / ui / model / components / mi / nandbased / am2901 / GUIAm2901DestDecode.java
1 package net.mograsim.logic.ui.model.components.mi.nandbased.am2901;
2
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;
10
11 public class GUIAm2901DestDecode extends SimpleRectangularSubmodelComponent
12 {
13         public GUIAm2901DestDecode(ViewModelModifiable model)
14         {
15                 super(model, 1, "GUIAm2901DestDecode");
16                 setSubmodelScale(.25);
17                 setInputPins("I8", "I7", "I6");
18                 setOutputPins("NSH", "RSH", "RAMWE", "YF", "LSH", "QWE");
19                 initSubmodelComponents();
20         }
21
22         @SuppressWarnings("unused") // for GUIWires being created
23         private void initSubmodelComponents()
24         {
25                 Pin I8 = getSubmodelPin("I8");
26                 Pin I7 = getSubmodelPin("I7");
27                 Pin I6 = getSubmodelPin("I6");
28                 Pin NSH = getSubmodelPin("NSH");
29                 Pin RSH = getSubmodelPin("RSH");
30                 Pin RAMWE = getSubmodelPin("RAMWE");
31                 Pin YF = getSubmodelPin("YF");
32                 Pin LSH = getSubmodelPin("LSH");
33                 Pin QWE = getSubmodelPin("QWE");
34
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);
48
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);
65
66                 notI8.moveTo(15, 10);
67                 notI7.moveTo(15, 50);
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);
95
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.getPin("A"), new Point[0]);
100                 new GUIWire(submodelModifiable, cpI83, notI8.getPin("B"), new Point[0]);
101                 new GUIWire(submodelModifiable, I7, cpI71, new Point[0]);
102                 new GUIWire(submodelModifiable, cpI71, notI7.getPin("A"), new Point(10, 55));
103                 new GUIWire(submodelModifiable, cpI71, cpI72, new Point[0]);
104                 new GUIWire(submodelModifiable, cpI72, notI7.getPin("B"), new Point[0]);
105                 new GUIWire(submodelModifiable, cpI72, cpI73, new Point[0]);
106                 new GUIWire(submodelModifiable, cpI73, nandI8I7.getPin("B"), new Point[0]);
107                 new GUIWire(submodelModifiable, cpI83, nandI8I7.getPin("A"), new Point(5, 95));
108                 new GUIWire(submodelModifiable, I6, cpI6, new Point(5, 100));
109                 new GUIWire(submodelModifiable, cpI6, notI6.getPin("A"), new Point[0]);
110                 new GUIWire(submodelModifiable, cpI6, notI6.getPin("B"), new Point(5, 165));
111                 new GUIWire(submodelModifiable, cpI82, nandRSH.getPin("A"), new Point(5, 5), new Point(40, 5), new Point(40, 15));
112                 new GUIWire(submodelModifiable, notI7.getPin("Y"), cpNotI7, new Point[0]);
113                 new GUIWire(submodelModifiable, cpNotI7, nandRSH.getPin("B"), new Point(40, 25));
114                 new GUIWire(submodelModifiable, cpNotI7, nandRAMWE.getPin("B"), new Point(40, 65));
115                 new GUIWire(submodelModifiable, notI8.getPin("Y"), 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.getPin("A"), new Point[0]);
119                 new GUIWire(submodelModifiable, cpNotI82, nandI7NotI8.getPin("A"), new Point(45, 95));
120                 new GUIWire(submodelModifiable, cpI73, nandI7NotI8.getPin("B"), new Point(10, 115), new Point(45, 115),
121                                 new Point(45, 105));
122                 new GUIWire(submodelModifiable, nandI8I7.getPin("Y"), cpNandI8I7, new Point(40, 100));
123                 new GUIWire(submodelModifiable, cpNandI8I7, nandLSH.getPin("A"), new Point[0]);
124                 new GUIWire(submodelModifiable, cpNandI8I7, nandLSH.getPin("B"), new Point(40, 145));
125                 new GUIWire(submodelModifiable, nandRSH.getPin("Y"), cpNotRSH, new Point[0]);
126                 new GUIWire(submodelModifiable, cpNotRSH, notRSH.getPin("A"), new Point(75, 15));
127                 new GUIWire(submodelModifiable, cpNotRSH, notRSH.getPin("B"), new Point(75, 25));
128                 new GUIWire(submodelModifiable, nandRAMWE.getPin("Y"), RAMWE, new Point(125, 60), new Point(125, 100));
129                 new GUIWire(submodelModifiable, nandI7NotI8.getPin("Y"), cpNandI7NotI81, new Point[0]);
130                 new GUIWire(submodelModifiable, cpNandI7NotI81, andI7NotI8.getPin("A"), new Point(75, 95));
131                 new GUIWire(submodelModifiable, cpNandI7NotI81, cpNandI7NotI82, new Point[0]);
132                 new GUIWire(submodelModifiable, cpNandI7NotI82, andI7NotI8.getPin("B"), new Point[0]);
133                 new GUIWire(submodelModifiable, nandLSH.getPin("Y"), LSH, new Point(125, 140), new Point(125, 180));
134                 new GUIWire(submodelModifiable, cpNandI7NotI82, nandQWE.getPin("A"), new Point(75, 150));
135                 new GUIWire(submodelModifiable, notI6.getPin("Y"), cpNotI6, new Point[0]);
136                 new GUIWire(submodelModifiable, cpNotI6, nandQWE.getPin("B"), new Point[0]);
137                 new GUIWire(submodelModifiable, notRSH.getPin("Y"), RSH, new Point(130, 20), new Point(130, 60));
138                 new GUIWire(submodelModifiable, andI7NotI8.getPin("Y"), nandYF.getPin("A"));
139                 new GUIWire(submodelModifiable, cpNotI6, nandYF.getPin("B"), new Point(75, 170), new Point(105, 170),
140                                 new Point(105, 120));
141                 new GUIWire(submodelModifiable, nandQWE.getPin("Y"), cpNandQWE, new Point(110, 155));
142                 new GUIWire(submodelModifiable, cpNandQWE, notQWE.getPin("A"), new Point[0]);
143                 new GUIWire(submodelModifiable, cpNandQWE, notQWE.getPin("B"), new Point(110, 225));
144                 new GUIWire(submodelModifiable, nandYF.getPin("Y"), YF);
145                 new GUIWire(submodelModifiable, notQWE.getPin("Y"), QWE, new Point[0]);
146         }
147 }