Commented GUIWire
[Mograsim.git] / net.mograsim.logic.ui / src / net / mograsim / logic / ui / model / components / mi / nandbased / am2901 / GUIAm2901ALUFuncDecode.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.components.mi.nandbased.GUIand;
8 import net.mograsim.logic.ui.model.components.mi.nandbased.GUInand3;
9 import net.mograsim.logic.ui.model.wires.GUIWire;
10 import net.mograsim.logic.ui.model.wires.Pin;
11 import net.mograsim.logic.ui.model.wires.WireCrossPoint;
12
13 public class GUIAm2901ALUFuncDecode extends SimpleRectangularSubmodelComponent
14 {
15         public GUIAm2901ALUFuncDecode(ViewModelModifiable model)
16         {
17                 super(model, 1, "GUIAm2901ALUFuncDecode");
18                 setSubmodelScale(.25);
19                 setInputPins("I5", "I4", "I3");
20                 setOutputPins("CinE", "L", "SN", "SBE", "FN", "RN");
21                 initSubmodelComponents();
22         }
23
24         @SuppressWarnings("unused") // for GUIWires being created
25         private void initSubmodelComponents()
26         {
27                 Pin I5 = getSubmodelPin("I5");
28                 Pin I4 = getSubmodelPin("I4");
29                 Pin I3 = getSubmodelPin("I3");
30                 Pin CinE = getSubmodelPin("CinE");
31                 Pin L = getSubmodelPin("L");
32                 Pin SN = getSubmodelPin("SN");
33                 Pin SBE = getSubmodelPin("SBE");
34                 Pin FN = getSubmodelPin("FN");
35                 Pin RN = getSubmodelPin("RN");
36
37                 GUINandGate notI5 = new GUINandGate(submodelModifiable, 1);
38                 GUINandGate notI4 = new GUINandGate(submodelModifiable, 1);
39                 GUInand3 nandI4I3NotI5 = new GUInand3(submodelModifiable);
40                 GUINandGate nandI5NotI4 = new GUINandGate(submodelModifiable, 1);
41                 GUINandGate nandI3I4 = new GUINandGate(submodelModifiable, 1);
42                 GUINandGate nandL = new GUINandGate(submodelModifiable, 1);
43                 GUIand andSBE = new GUIand(submodelModifiable);
44
45                 WireCrossPoint cpI51 = new WireCrossPoint(submodelModifiable, 1);
46                 WireCrossPoint cpI52 = new WireCrossPoint(submodelModifiable, 1);
47                 WireCrossPoint cpI53 = new WireCrossPoint(submodelModifiable, 1);
48                 WireCrossPoint cpI41 = new WireCrossPoint(submodelModifiable, 1);
49                 WireCrossPoint cpI42 = new WireCrossPoint(submodelModifiable, 1);
50                 WireCrossPoint cpI43 = new WireCrossPoint(submodelModifiable, 1);
51                 WireCrossPoint cpI44 = new WireCrossPoint(submodelModifiable, 1);
52                 WireCrossPoint cpI31 = new WireCrossPoint(submodelModifiable, 1);
53                 WireCrossPoint cpI32 = new WireCrossPoint(submodelModifiable, 1);
54                 WireCrossPoint cpNotI51 = new WireCrossPoint(submodelModifiable, 1);
55                 WireCrossPoint cpNotI52 = new WireCrossPoint(submodelModifiable, 1);
56
57                 notI5.moveTo(15, 10);
58                 notI4.moveTo(15, 50);
59                 nandI4I3NotI5.moveTo(55, 10);
60                 nandI5NotI4.moveTo(55, 45);
61                 nandI3I4.moveTo(55, 70);
62                 nandL.moveTo(100, 50);
63                 andSBE.moveTo(100, 135);
64                 cpI51.moveCenterTo(5, 20);
65                 cpI52.moveCenterTo(5, 25);
66                 cpI53.moveCenterTo(5, 45);
67                 cpI41.moveCenterTo(10, 60);
68                 cpI42.moveCenterTo(10, 55);
69                 cpI43.moveCenterTo(10, 65);
70                 cpI44.moveCenterTo(10, 85);
71                 cpI31.moveCenterTo(50, 100);
72                 cpI32.moveCenterTo(50, 75);
73                 cpNotI51.moveCenterTo(40, 20);
74                 cpNotI52.moveCenterTo(40, 35);
75
76                 new GUIWire(submodelModifiable, I5, cpI51, new Point[0]);
77                 new GUIWire(submodelModifiable, cpI51, notI5.getPin("A"), new Point(5, 15));
78                 new GUIWire(submodelModifiable, cpI51, cpI52, new Point[0]);
79                 new GUIWire(submodelModifiable, cpI52, notI5.getPin("B"), new Point[0]);
80                 new GUIWire(submodelModifiable, cpI52, cpI53, new Point[0]);
81                 new GUIWire(submodelModifiable, cpI53, nandI5NotI4.getPin("A"), new Point(45, 45), new Point(45, 50));
82                 new GUIWire(submodelModifiable, cpI53, FN, new Point(5, 180));
83                 new GUIWire(submodelModifiable, I4, cpI41, new Point[0]);
84                 new GUIWire(submodelModifiable, cpI41, cpI42, new Point[0]);
85                 new GUIWire(submodelModifiable, cpI42, nandI4I3NotI5.getPin("A"), new Point(10, 40), new Point(45, 40), new Point(45, 15));
86                 new GUIWire(submodelModifiable, cpI42, notI4.getPin("A"), new Point[0]);
87                 new GUIWire(submodelModifiable, cpI41, cpI43, new Point[0]);
88                 new GUIWire(submodelModifiable, cpI43, notI4.getPin("B"), new Point[0]);
89                 new GUIWire(submodelModifiable, cpI43, cpI44, new Point[0]);
90                 new GUIWire(submodelModifiable, cpI44, nandI3I4.getPin("B"), new Point[0]);
91                 new GUIWire(submodelModifiable, cpI44, SN, new Point(10, 105), new Point(135, 105), new Point(135, 100));
92                 new GUIWire(submodelModifiable, I3, cpI31, new Point(50, 100));
93                 new GUIWire(submodelModifiable, cpI31, RN, new Point(50, 220));
94                 new GUIWire(submodelModifiable, cpI31, cpI32, new Point[0]);
95                 new GUIWire(submodelModifiable, cpI32, nandI4I3NotI5.getPin("B"), new Point(50, 25));
96                 new GUIWire(submodelModifiable, cpI32, nandI3I4.getPin("A"), new Point[0]);
97                 new GUIWire(submodelModifiable, notI5.getPin("Y"), cpNotI51, new Point[0]);
98                 new GUIWire(submodelModifiable, cpNotI51, CinE, new Point(40, 5), new Point(115, 5), new Point(115, 20));
99                 new GUIWire(submodelModifiable, cpNotI51, cpNotI52, new Point[0]);
100                 new GUIWire(submodelModifiable, cpNotI52, nandI4I3NotI5.getPin("C"), new Point[0]);
101                 new GUIWire(submodelModifiable, cpNotI52, andSBE.getPin("B"), new Point(40, 150));
102                 new GUIWire(submodelModifiable, notI4.getPin("Y"), nandI5NotI4.getPin("B"), new Point[0]);
103                 new GUIWire(submodelModifiable, nandI4I3NotI5.getPin("Y"), nandL.getPin("A"));
104                 new GUIWire(submodelModifiable, nandI5NotI4.getPin("Y"), nandL.getPin("B"));
105                 new GUIWire(submodelModifiable, nandI3I4.getPin("Y"), andSBE.getPin("A"));
106                 new GUIWire(submodelModifiable, nandL.getPin("Y"), L, new Point[0]);
107                 new GUIWire(submodelModifiable, andSBE.getPin("Y"), SBE, new Point[0]);
108         }
109 }