Changed high level addressing to have the correct bit and reg. order
[Mograsim.git] / net.mograsim.logic.ui.am2900 / src / net / mograsim / logic / ui / model / components / mi / nandbased / GUIram4.java
1 package net.mograsim.logic.ui.model.components.mi.nandbased;
2
3 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
4 import net.mograsim.logic.core.types.BitVector;
5 import net.mograsim.logic.ui.model.ViewModelModifiable;
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 GUIram4 extends SimpleRectangularSubmodelComponent
12 {
13         private GUIram2 cell00;
14         private GUIram2 cell01;
15         private GUIram2 cell10;
16         private GUIram2 cell11;
17
18         public GUIram4(ViewModelModifiable model)
19         {
20                 super(model, 1, "GUIram4");
21                 setSubmodelScale(.1);
22                 setInputPins("A0", "A1", "A2", "A3", "B0", "B1", "B2", "B3", "WE", "D1", "D2", "D3", "D4");
23                 setOutputPins("QA1", "QA2", "QA3", "QA4", "QB1", "QB2", "QB3", "QB4");
24                 initSubmodelComponents();
25         }
26
27         @SuppressWarnings("unused") // for GUIWires being created
28         private void initSubmodelComponents()
29         {
30                 //@formatter:off
31                 Pin  A0 = getSubmodelPin("A0");
32                 Pin  A1 = getSubmodelPin("A1");
33                 Pin  A2 = getSubmodelPin("A2");
34                 Pin  A3 = getSubmodelPin("A3");
35                 Pin  B0 = getSubmodelPin("B0");
36                 Pin  B1 = getSubmodelPin("B1");
37                 Pin  B2 = getSubmodelPin("B2");
38                 Pin  B3 = getSubmodelPin("B3");
39                 Pin  WE = getSubmodelPin("WE");
40                 Pin  D1 = getSubmodelPin("D1");
41                 Pin  D2 = getSubmodelPin("D2");
42                 Pin  D3 = getSubmodelPin("D3");
43                 Pin  D4 = getSubmodelPin("D4");
44                 Pin QA1 =getSubmodelPin("QA1");
45                 Pin QA2 =getSubmodelPin("QA2");
46                 Pin QA3 =getSubmodelPin("QA3");
47                 Pin QA4 =getSubmodelPin("QA4");
48                 Pin QB1 =getSubmodelPin("QB1");
49                 Pin QB2 =getSubmodelPin("QB2");
50                 Pin QB3 =getSubmodelPin("QB3");
51                 Pin QB4 =getSubmodelPin("QB4");
52
53                 GUIdemux2   demuxA   = new GUIdemux2  (submodelModifiable);
54                 GUIdemux2   demuxB   = new GUIdemux2  (submodelModifiable);
55                 GUIand41    weAndB   = new GUIand41   (submodelModifiable);
56                   cell00   = new GUIram2    (submodelModifiable);
57                   cell01   = new GUIram2    (submodelModifiable);
58                   cell10   = new GUIram2    (submodelModifiable);
59                   cell11   = new GUIram2    (submodelModifiable);
60                 GUIand41    andB00   = new GUIand41   (submodelModifiable);
61                 GUIandor414 andorB01 = new GUIandor414(submodelModifiable);
62                 GUIandor414 andorB10 = new GUIandor414(submodelModifiable);
63                 GUIandor414 andorB11 = new GUIandor414(submodelModifiable);
64                 GUIand41    andA00   = new GUIand41   (submodelModifiable);
65                 GUIandor414 andorA01 = new GUIandor414(submodelModifiable);
66                 GUIandor414 andorA10 = new GUIandor414(submodelModifiable);
67                 GUIandor414 andorA11 = new GUIandor414(submodelModifiable);
68
69                 WireCrossPoint cpB00  = new WireCrossPoint(submodelModifiable, 1);
70                 WireCrossPoint cpB01  = new WireCrossPoint(submodelModifiable, 1);
71                 WireCrossPoint cpB10  = new WireCrossPoint(submodelModifiable, 1);
72                 WireCrossPoint cpB11  = new WireCrossPoint(submodelModifiable, 1);
73                 WireCrossPoint cpD_101 = new WireCrossPoint(submodelModifiable, 1);
74                 WireCrossPoint cpD_201 = new WireCrossPoint(submodelModifiable, 1);
75                 WireCrossPoint cpD_301 = new WireCrossPoint(submodelModifiable, 1);
76                 WireCrossPoint cpD_401 = new WireCrossPoint(submodelModifiable, 1);
77                 WireCrossPoint cpD_110 = new WireCrossPoint(submodelModifiable, 1);
78                 WireCrossPoint cpD_210 = new WireCrossPoint(submodelModifiable, 1);
79                 WireCrossPoint cpD_310 = new WireCrossPoint(submodelModifiable, 1);
80                 WireCrossPoint cpD_410 = new WireCrossPoint(submodelModifiable, 1);
81                 WireCrossPoint cpD_111 = new WireCrossPoint(submodelModifiable, 1);
82                 WireCrossPoint cpD_211 = new WireCrossPoint(submodelModifiable, 1);
83                 WireCrossPoint cpD_311 = new WireCrossPoint(submodelModifiable, 1);
84                 WireCrossPoint cpD_411 = new WireCrossPoint(submodelModifiable, 1);
85                 WireCrossPoint cpAB101 = new WireCrossPoint(submodelModifiable, 1);
86                 WireCrossPoint cpAB201 = new WireCrossPoint(submodelModifiable, 1);
87                 WireCrossPoint cpAB301 = new WireCrossPoint(submodelModifiable, 1);
88                 WireCrossPoint cpAB401 = new WireCrossPoint(submodelModifiable, 1);
89                 WireCrossPoint cpAB110 = new WireCrossPoint(submodelModifiable, 1);
90                 WireCrossPoint cpAB210 = new WireCrossPoint(submodelModifiable, 1);
91                 WireCrossPoint cpAB310 = new WireCrossPoint(submodelModifiable, 1);
92                 WireCrossPoint cpAB410 = new WireCrossPoint(submodelModifiable, 1);
93                 WireCrossPoint cpAB1in = new WireCrossPoint(submodelModifiable, 1);
94                 WireCrossPoint cpAB2in = new WireCrossPoint(submodelModifiable, 1);
95                 WireCrossPoint cpAB3in = new WireCrossPoint(submodelModifiable, 1);
96                 WireCrossPoint cpAB4in = new WireCrossPoint(submodelModifiable, 1);
97
98                 demuxA  .moveTo( 55,  45);
99                 demuxB  .moveTo( 55, 150);
100                 weAndB  .moveTo(235, 150);
101                 cell00  .moveTo( 80, 330);
102                 cell01  .moveTo( 80, 480);
103                 cell10  .moveTo( 80, 630);
104                 cell11  .moveTo( 80, 780);
105                 andB00  .moveTo(250, 375);
106                 andorB01.moveTo(250, 485);
107                 andorB10.moveTo(250, 635);
108                 andorB11.moveTo(250, 785);
109                 andA00  .moveTo(155, 325);
110                 andorA01.moveTo(155, 435);
111                 andorA10.moveTo(155, 585);
112                 andorA11.moveTo(155, 735);
113                 cpB00 .moveCenterTo(230, 155);
114                 cpB01 .moveCenterTo(225, 165);
115                 cpB10 .moveCenterTo(220, 175);
116                 cpB11 .moveCenterTo(215, 185);
117                 cpD_101.moveCenterTo( 60, 535);
118                 cpD_201.moveCenterTo( 65, 545);
119                 cpD_301.moveCenterTo( 70, 555);
120                 cpD_401.moveCenterTo( 75, 565);
121                 cpD_110.moveCenterTo( 60, 685);
122                 cpD_210.moveCenterTo( 65, 695);
123                 cpD_310.moveCenterTo( 70, 705);
124                 cpD_410.moveCenterTo( 75, 715);
125                 cpD_111.moveCenterTo( 60, 835);
126                 cpD_211.moveCenterTo( 65, 845);
127                 cpD_311.moveCenterTo( 70, 855);
128                 cpD_411.moveCenterTo( 75, 865);
129                 cpAB101.moveCenterTo( 40, 485);
130                 cpAB201.moveCenterTo( 45, 495);
131                 cpAB301.moveCenterTo( 50, 505);
132                 cpAB401.moveCenterTo( 55, 515);
133                 cpAB110.moveCenterTo( 40, 635);
134                 cpAB210.moveCenterTo( 45, 645);
135                 cpAB310.moveCenterTo( 50, 655);
136                 cpAB410.moveCenterTo( 55, 665);
137                 cpAB1in.moveCenterTo( 40, 335);
138                 cpAB2in.moveCenterTo( 45, 350);
139                 cpAB3in.moveCenterTo( 50, 650);
140                 cpAB4in.moveCenterTo( 55, 750);
141
142                 new GUIWire(submodelModifiable, A0, demuxA.getPin("S0"), new Point[0]);
143                 new GUIWire(submodelModifiable, A1, demuxA.getPin("S1"), new Point(10, 150), new Point(10,  60));
144                 new GUIWire(submodelModifiable, B0, demuxB.getPin("S0"), new Point( 5, 450), new Point( 5, 155));
145                 new GUIWire(submodelModifiable, B1, demuxB.getPin("S1"), new Point(10, 550), new Point(10, 165));
146                 new GUIWire(submodelModifiable, demuxB.getPin("Y00"), cpB00, new Point[0]);
147                 new GUIWire(submodelModifiable, demuxB.getPin("Y01"), cpB01, new Point[0]);
148                 new GUIWire(submodelModifiable, demuxB.getPin("Y10"), cpB10, new Point[0]);
149                 new GUIWire(submodelModifiable, demuxB.getPin("Y11"), cpB11, new Point[0]);
150                 new GUIWire(submodelModifiable, cpB00, weAndB.getPin("A1"), new Point[0]);
151                 new GUIWire(submodelModifiable, cpB01, weAndB.getPin("A2"), new Point[0]);
152                 new GUIWire(submodelModifiable, cpB10, weAndB.getPin("A3"), new Point[0]);
153                 new GUIWire(submodelModifiable, cpB11, weAndB.getPin("A4"), new Point[0]);
154                 new GUIWire(submodelModifiable, WE, weAndB.getPin("B"), new Point(15, 850), new Point(15, 195));
155                 new GUIWire(submodelModifiable, weAndB.getPin("Y1"), cell00.getPin("WE"), new Point(290, 155), new Point(290, 230), new Point(35, 230), new Point(35, 375));
156                 new GUIWire(submodelModifiable, weAndB.getPin("Y2"), cell01.getPin("WE"), new Point(285, 165), new Point(285, 225), new Point(30, 225), new Point(30, 525));
157                 new GUIWire(submodelModifiable, weAndB.getPin("Y3"), cell10.getPin("WE"), new Point(280, 175), new Point(280, 220), new Point(25, 220), new Point(25, 675));
158                 new GUIWire(submodelModifiable, weAndB.getPin("Y4"), cell11.getPin("WE"), new Point(275, 185), new Point(275, 215), new Point(20, 215), new Point(20, 825));
159                 new GUIWire(submodelModifiable, cpAB101, cpAB1in            , new Point[0]);
160                 new GUIWire(submodelModifiable, cpAB1in, cell00.getPin("A0"), new Point[0]);
161                 new GUIWire(submodelModifiable, cpAB201, cpAB2in            , new Point[0]);
162                 new GUIWire(submodelModifiable, cpAB2in, cell00.getPin("A1"), new Point(45, 345));
163                 new GUIWire(submodelModifiable, cpAB301, cell00.getPin("B0"), new Point(50, 355));
164                 new GUIWire(submodelModifiable, cpAB401, cell00.getPin("B1"), new Point(55, 365));
165                 new GUIWire(submodelModifiable, cpAB101, cell01.getPin("A0"), new Point[0]);
166                 new GUIWire(submodelModifiable, cpAB201, cell01.getPin("A1"), new Point[0]);
167                 new GUIWire(submodelModifiable, cpAB301, cell01.getPin("B0"), new Point[0]);
168                 new GUIWire(submodelModifiable, cpAB401, cell01.getPin("B1"), new Point[0]);
169                 new GUIWire(submodelModifiable, cpAB101, cpAB110            , new Point[0]);
170                 new GUIWire(submodelModifiable, cpAB201, cpAB210            , new Point[0]);
171                 new GUIWire(submodelModifiable, cpAB301, cpAB3in            , new Point[0]);
172                 new GUIWire(submodelModifiable, B2     , cpAB3in            , new Point[0]);
173                 new GUIWire(submodelModifiable, cpAB3in, cpAB310            , new Point[0]);
174                 new GUIWire(submodelModifiable, cpAB401, cpAB410            , new Point[0]);
175                 new GUIWire(submodelModifiable, cpAB110, cell10.getPin("A0"), new Point[0]);
176                 new GUIWire(submodelModifiable, cpAB210, cell10.getPin("A1"), new Point[0]);
177                 new GUIWire(submodelModifiable, cpAB310, cell10.getPin("B0"), new Point[0]);
178                 new GUIWire(submodelModifiable, cpAB410, cell10.getPin("B1"), new Point[0]);
179                 new GUIWire(submodelModifiable, cpAB110, cell11.getPin("A0"), new Point(40, 785));
180                 new GUIWire(submodelModifiable, cpAB210, cell11.getPin("A1"), new Point(45, 795));
181                 new GUIWire(submodelModifiable, cpAB310, cell11.getPin("B0"), new Point(50, 805));
182                 new GUIWire(submodelModifiable, cpAB410, cpAB4in            , new Point[0]);
183                 new GUIWire(submodelModifiable, cpAB4in, cell11.getPin("B1"), new Point(55, 815));
184                 new GUIWire(submodelModifiable, A2, cpAB1in                 , new Point(40, 250));
185                 new GUIWire(submodelModifiable, A3, cpAB2in                 , new Point[0]);
186                 new GUIWire(submodelModifiable, B3, cpAB4in                 , new Point[0]);
187                 new GUIWire(submodelModifiable, cpD_101, cell00.getPin("D1"), new Point(60, 385));
188                 new GUIWire(submodelModifiable, cpD_201, cell00.getPin("D2"), new Point(65, 395));
189                 new GUIWire(submodelModifiable, cpD_301, cell00.getPin("D3"), new Point(70, 405));
190                 new GUIWire(submodelModifiable, cpD_401, cell00.getPin("D4"), new Point(75, 415));
191                 new GUIWire(submodelModifiable, cpD_101, cell01.getPin("D1"), new Point[0]);
192                 new GUIWire(submodelModifiable, cpD_201, cell01.getPin("D2"), new Point[0]);
193                 new GUIWire(submodelModifiable, cpD_301, cell01.getPin("D3"), new Point[0]);
194                 new GUIWire(submodelModifiable, cpD_401, cell01.getPin("D4"), new Point[0]);
195                 new GUIWire(submodelModifiable, cpD_101, cpD_110            , new Point[0]);
196                 new GUIWire(submodelModifiable, cpD_201, cpD_210            , new Point[0]);
197                 new GUIWire(submodelModifiable, cpD_301, cpD_310            , new Point[0]);
198                 new GUIWire(submodelModifiable, cpD_401, cpD_410            , new Point[0]);
199                 new GUIWire(submodelModifiable, cpD_110, cell10.getPin("D1"), new Point[0]);
200                 new GUIWire(submodelModifiable, cpD_210, cell10.getPin("D2"), new Point[0]);
201                 new GUIWire(submodelModifiable, cpD_310, cell10.getPin("D3"), new Point[0]);
202                 new GUIWire(submodelModifiable, cpD_410, cell10.getPin("D4"), new Point[0]);
203                 new GUIWire(submodelModifiable, cpD_110, cpD_111            , new Point[0]);
204                 new GUIWire(submodelModifiable, cpD_210, cpD_211            , new Point[0]);
205                 new GUIWire(submodelModifiable, cpD_310, cpD_311            , new Point[0]);
206                 new GUIWire(submodelModifiable, cpD_410, cpD_411            , new Point[0]);
207                 new GUIWire(submodelModifiable, cpD_111, cell11.getPin("D1"), new Point[0]);
208                 new GUIWire(submodelModifiable, cpD_211, cell11.getPin("D2"), new Point[0]);
209                 new GUIWire(submodelModifiable, cpD_311, cell11.getPin("D3"), new Point[0]);
210                 new GUIWire(submodelModifiable, cpD_411, cell11.getPin("D4"), new Point[0]);
211                 new GUIWire(submodelModifiable, D1, cpD_111                 , new Point(60,  950));
212                 new GUIWire(submodelModifiable, D2, cpD_211                 , new Point(65, 1050));
213                 new GUIWire(submodelModifiable, D3, cpD_311                 , new Point(70, 1150));
214                 new GUIWire(submodelModifiable, D4, cpD_411                 , new Point(75, 1250));
215                 new GUIWire(submodelModifiable, demuxA.getPin("Y00"), andA00  .getPin("B"), new Point(135, 50), new Point(135, 370));
216                 new GUIWire(submodelModifiable, demuxA.getPin("Y01"), andorA01.getPin("B"), new Point(130, 60), new Point(130, 520));
217                 new GUIWire(submodelModifiable, demuxA.getPin("Y10"), andorA10.getPin("B"), new Point(125, 70), new Point(125, 670));
218                 new GUIWire(submodelModifiable, demuxA.getPin("Y11"), andorA11.getPin("B"), new Point(120, 80), new Point(120, 820));
219                 new GUIWire(submodelModifiable, cpB00, andB00  .getPin("B"), new Point(230, 420));
220                 new GUIWire(submodelModifiable, cpB01, andorB01.getPin("B"), new Point(225, 570));
221                 new GUIWire(submodelModifiable, cpB10, andorB10.getPin("B"), new Point(220, 720));
222                 new GUIWire(submodelModifiable, cpB11, andorB11.getPin("B"), new Point(215, 870));
223                 new GUIWire(submodelModifiable, cell00.getPin("QB1"), andB00  .getPin("A1"), new Point(140, 375), new Point(140, 380));
224                 new GUIWire(submodelModifiable, cell00.getPin("QB2"), andB00  .getPin("A2"), new Point(140, 385), new Point(140, 390));
225                 new GUIWire(submodelModifiable, cell00.getPin("QB3"), andB00  .getPin("A3"), new Point(140, 395), new Point(140, 400));
226                 new GUIWire(submodelModifiable, cell00.getPin("QB4"), andB00  .getPin("A4"), new Point(140, 405), new Point(140, 410));
227                 new GUIWire(submodelModifiable, cell01.getPin("QB1"), andorB01.getPin("A1"), new Point(140, 525), new Point(140, 530));
228                 new GUIWire(submodelModifiable, cell01.getPin("QB2"), andorB01.getPin("A2"), new Point(140, 535), new Point(140, 540));
229                 new GUIWire(submodelModifiable, cell01.getPin("QB3"), andorB01.getPin("A3"), new Point(140, 545), new Point(140, 550));
230                 new GUIWire(submodelModifiable, cell01.getPin("QB4"), andorB01.getPin("A4"), new Point(140, 555), new Point(140, 560));
231                 new GUIWire(submodelModifiable, cell10.getPin("QB1"), andorB10.getPin("A1"), new Point(140, 675), new Point(140, 680));
232                 new GUIWire(submodelModifiable, cell10.getPin("QB2"), andorB10.getPin("A2"), new Point(140, 685), new Point(140, 690));
233                 new GUIWire(submodelModifiable, cell10.getPin("QB3"), andorB10.getPin("A3"), new Point(140, 695), new Point(140, 700));
234                 new GUIWire(submodelModifiable, cell10.getPin("QB4"), andorB10.getPin("A4"), new Point(140, 705), new Point(140, 710));
235                 new GUIWire(submodelModifiable, cell11.getPin("QB1"), andorB11.getPin("A1"), new Point(140, 825), new Point(140, 830));
236                 new GUIWire(submodelModifiable, cell11.getPin("QB2"), andorB11.getPin("A2"), new Point(140, 835), new Point(140, 840));
237                 new GUIWire(submodelModifiable, cell11.getPin("QB3"), andorB11.getPin("A3"), new Point(140, 845), new Point(140, 850));
238                 new GUIWire(submodelModifiable, cell11.getPin("QB4"), andorB11.getPin("A4"), new Point(140, 855), new Point(140, 860));
239                 new GUIWire(submodelModifiable, cell00.getPin("QA1"), andA00  .getPin("A1"), new Point(140, 335), new Point(140, 330));
240                 new GUIWire(submodelModifiable, cell00.getPin("QA2"), andA00  .getPin("A2"), new Point(140, 345), new Point(140, 340));
241                 new GUIWire(submodelModifiable, cell00.getPin("QA3"), andA00  .getPin("A3"), new Point(140, 355), new Point(140, 350));
242                 new GUIWire(submodelModifiable, cell00.getPin("QA4"), andA00  .getPin("A4"), new Point(140, 365), new Point(140, 360));
243                 new GUIWire(submodelModifiable, cell01.getPin("QA1"), andorA01.getPin("A1"), new Point(140, 485), new Point(140, 480));
244                 new GUIWire(submodelModifiable, cell01.getPin("QA2"), andorA01.getPin("A2"), new Point(140, 495), new Point(140, 490));
245                 new GUIWire(submodelModifiable, cell01.getPin("QA3"), andorA01.getPin("A3"), new Point(140, 505), new Point(140, 500));
246                 new GUIWire(submodelModifiable, cell01.getPin("QA4"), andorA01.getPin("A4"), new Point(140, 515), new Point(140, 510));
247                 new GUIWire(submodelModifiable, cell10.getPin("QA1"), andorA10.getPin("A1"), new Point(140, 635), new Point(140, 630));
248                 new GUIWire(submodelModifiable, cell10.getPin("QA2"), andorA10.getPin("A2"), new Point(140, 645), new Point(140, 640));
249                 new GUIWire(submodelModifiable, cell10.getPin("QA3"), andorA10.getPin("A3"), new Point(140, 655), new Point(140, 650));
250                 new GUIWire(submodelModifiable, cell10.getPin("QA4"), andorA10.getPin("A4"), new Point(140, 665), new Point(140, 660));
251                 new GUIWire(submodelModifiable, cell11.getPin("QA1"), andorA11.getPin("A1"), new Point(140, 785), new Point(140, 780));
252                 new GUIWire(submodelModifiable, cell11.getPin("QA2"), andorA11.getPin("A2"), new Point(140, 795), new Point(140, 790));
253                 new GUIWire(submodelModifiable, cell11.getPin("QA3"), andorA11.getPin("A3"), new Point(140, 805), new Point(140, 800));
254                 new GUIWire(submodelModifiable, cell11.getPin("QA4"), andorA11.getPin("A4"), new Point(140, 815), new Point(140, 810));
255                 new GUIWire(submodelModifiable, andB00  .getPin("Y1"), andorB01.getPin("C1"), new Point(305, 380), new Point(305, 445), new Point(245, 445), new Point(245, 490));
256                 new GUIWire(submodelModifiable, andB00  .getPin("Y2"), andorB01.getPin("C2"), new Point(300, 390), new Point(300, 440), new Point(240, 440), new Point(240, 500));
257                 new GUIWire(submodelModifiable, andB00  .getPin("Y3"), andorB01.getPin("C3"), new Point(295, 400), new Point(295, 435), new Point(235, 435), new Point(235, 510));
258                 new GUIWire(submodelModifiable, andB00  .getPin("Y4"), andorB01.getPin("C4"), new Point(290, 410), new Point(290, 430), new Point(230, 430), new Point(230, 520));
259                 new GUIWire(submodelModifiable, andorB01.getPin("Y1"), andorB10.getPin("C1"), new Point(305, 490), new Point(305, 595), new Point(245, 595), new Point(245, 640));
260                 new GUIWire(submodelModifiable, andorB01.getPin("Y2"), andorB10.getPin("C2"), new Point(300, 500), new Point(300, 590), new Point(240, 590), new Point(240, 650));
261                 new GUIWire(submodelModifiable, andorB01.getPin("Y3"), andorB10.getPin("C3"), new Point(295, 510), new Point(295, 585), new Point(235, 585), new Point(235, 660));
262                 new GUIWire(submodelModifiable, andorB01.getPin("Y4"), andorB10.getPin("C4"), new Point(290, 520), new Point(290, 580), new Point(230, 580), new Point(230, 670));
263                 new GUIWire(submodelModifiable, andorB10.getPin("Y1"), andorB11.getPin("C1"), new Point(305, 640), new Point(305, 745), new Point(245, 745), new Point(245, 790));
264                 new GUIWire(submodelModifiable, andorB10.getPin("Y2"), andorB11.getPin("C2"), new Point(300, 650), new Point(300, 740), new Point(240, 740), new Point(240, 800));
265                 new GUIWire(submodelModifiable, andorB10.getPin("Y3"), andorB11.getPin("C3"), new Point(295, 660), new Point(295, 735), new Point(235, 735), new Point(235, 810));
266                 new GUIWire(submodelModifiable, andorB10.getPin("Y4"), andorB11.getPin("C4"), new Point(290, 670), new Point(290, 730), new Point(230, 730), new Point(230, 820));
267                 new GUIWire(submodelModifiable, andorB11.getPin("Y1"), QB1                           , new Point(330, 790), new Point(330, 450));
268                 new GUIWire(submodelModifiable, andorB11.getPin("Y2"), QB2                           , new Point(335, 800), new Point(335, 550));
269                 new GUIWire(submodelModifiable, andorB11.getPin("Y3"), QB3                           , new Point(340, 810), new Point(340, 650));
270                 new GUIWire(submodelModifiable, andorB11.getPin("Y4"), QB4                           , new Point(345, 820), new Point(345, 750));
271                 new GUIWire(submodelModifiable, andA00  .getPin("Y1"), andorA01.getPin("C1"), new Point(210, 330), new Point(210, 430), new Point(150, 430), new Point(150, 440));
272                 new GUIWire(submodelModifiable, andA00  .getPin("Y2"), andorA01.getPin("C2"), new Point(205, 340), new Point(205, 425), new Point(145, 425), new Point(145, 450));
273                 new GUIWire(submodelModifiable, andA00  .getPin("Y3"), andorA01.getPin("C3"), new Point(200, 350), new Point(200, 420), new Point(140, 420), new Point(140, 460));
274                 new GUIWire(submodelModifiable, andA00  .getPin("Y4"), andorA01.getPin("C4"), new Point(195, 360), new Point(195, 415), new Point(135, 415), new Point(135, 470));
275                 new GUIWire(submodelModifiable, andorA01.getPin("Y1"), andorA10.getPin("C1"), new Point(210, 440), new Point(210, 580), new Point(150, 580), new Point(150, 590));
276                 new GUIWire(submodelModifiable, andorA01.getPin("Y2"), andorA10.getPin("C2"), new Point(205, 450), new Point(205, 575), new Point(145, 575), new Point(145, 600));
277                 new GUIWire(submodelModifiable, andorA01.getPin("Y3"), andorA10.getPin("C3"), new Point(200, 460), new Point(200, 570), new Point(140, 570), new Point(140, 610));
278                 new GUIWire(submodelModifiable, andorA01.getPin("Y4"), andorA10.getPin("C4"), new Point(195, 470), new Point(195, 565), new Point(135, 565), new Point(135, 620));
279                 new GUIWire(submodelModifiable, andorA10.getPin("Y1"), andorA11.getPin("C1"), new Point(210, 590), new Point(210, 730), new Point(150, 730), new Point(150, 740));
280                 new GUIWire(submodelModifiable, andorA10.getPin("Y2"), andorA11.getPin("C2"), new Point(205, 600), new Point(205, 725), new Point(145, 725), new Point(145, 750));
281                 new GUIWire(submodelModifiable, andorA10.getPin("Y3"), andorA11.getPin("C3"), new Point(200, 610), new Point(200, 720), new Point(140, 720), new Point(140, 760));
282                 new GUIWire(submodelModifiable, andorA10.getPin("Y4"), andorA11.getPin("C4"), new Point(195, 620), new Point(195, 715), new Point(135, 715), new Point(135, 770));
283                 new GUIWire(submodelModifiable, andorA11.getPin("Y1"), QA1                           , new Point(210, 740), new Point(210, 880), new Point(310, 880), new Point(310,  50));
284                 new GUIWire(submodelModifiable, andorA11.getPin("Y2"), QA2                           , new Point(205, 750), new Point(205, 885), new Point(315, 885), new Point(315, 150));
285                 new GUIWire(submodelModifiable, andorA11.getPin("Y3"), QA3                           , new Point(200, 760), new Point(200, 890), new Point(320, 890), new Point(320, 250));
286                 new GUIWire(submodelModifiable, andorA11.getPin("Y4"), QA4                           , new Point(195, 770), new Point(195, 895), new Point(325, 895), new Point(325, 350));
287                 //@formatter:on
288         }
289
290         @Override
291         public Object getHighLevelState(String stateID)
292         {
293                 switch (stateID)
294                 {
295                 case "q":
296                         BitVector q0000 = (BitVector) getHighLevelState("c0000.q");
297                         BitVector q0001 = (BitVector) getHighLevelState("c0100.q");
298                         BitVector q0010 = (BitVector) getHighLevelState("c1000.q");
299                         BitVector q0011 = (BitVector) getHighLevelState("c1100.q");
300                         BitVector q0100 = (BitVector) getHighLevelState("c0001.q");
301                         BitVector q0101 = (BitVector) getHighLevelState("c0101.q");
302                         BitVector q0110 = (BitVector) getHighLevelState("c1001.q");
303                         BitVector q0111 = (BitVector) getHighLevelState("c1101.q");
304                         BitVector q1000 = (BitVector) getHighLevelState("c0010.q");
305                         BitVector q1001 = (BitVector) getHighLevelState("c0110.q");
306                         BitVector q1010 = (BitVector) getHighLevelState("c1010.q");
307                         BitVector q1011 = (BitVector) getHighLevelState("c1110.q");
308                         BitVector q1100 = (BitVector) getHighLevelState("c0011.q");
309                         BitVector q1101 = (BitVector) getHighLevelState("c1011.q");
310                         BitVector q1110 = (BitVector) getHighLevelState("c0111.q");
311                         BitVector q1111 = (BitVector) getHighLevelState("c1111.q");
312                         return q0000.concat(q0001).concat(q0010).concat(q0011).concat(q0100).concat(q0101).concat(q0110).concat(q0111).concat(q1000)
313                                         .concat(q1001).concat(q1010).concat(q1011).concat(q1100).concat(q1101).concat(q1110).concat(q1111);
314                 default:
315                         int indexOfDot = stateID.indexOf('.');
316                         if (indexOfDot != -1)
317                         {
318                                 String cellID = stateID.substring(0, indexOfDot);
319                                 switch (cellID)
320                                 {
321                                 case "c0000":
322                                 case "c0100":
323                                 case "c1000":
324                                 case "c1100":
325                                         return cell00.getHighLevelState(cellID.substring(0, 3) + stateID.substring(indexOfDot));
326                                 case "c0001":
327                                 case "c0101":
328                                 case "c1001":
329                                 case "c1101":
330                                         return cell01.getHighLevelState(cellID.substring(0, 3) + stateID.substring(indexOfDot));
331                                 case "c0010":
332                                 case "c0110":
333                                 case "c1010":
334                                 case "c1110":
335                                         return cell10.getHighLevelState(cellID.substring(0, 3) + stateID.substring(indexOfDot));
336                                 case "c0011":
337                                 case "c0111":
338                                 case "c1011":
339                                 case "c1111":
340                                         return cell11.getHighLevelState(cellID.substring(0, 3) + stateID.substring(indexOfDot));
341                                 default:
342                                         return super.getHighLevelState(stateID);
343                                 }
344                         }
345                         return super.getHighLevelState(stateID);
346                 }
347         }
348
349         @Override
350         public void setHighLevelState(String stateID, Object newState)
351         {
352                 switch (stateID)
353                 {
354                 case "q":
355                         BitVector newStateCasted = (BitVector) newState;
356                         setHighLevelState("c0000.q", newStateCasted.subVector(0, 4));
357                         setHighLevelState("c0100.q", newStateCasted.subVector(4, 8));
358                         setHighLevelState("c1000.q", newStateCasted.subVector(8, 12));
359                         setHighLevelState("c1100.q", newStateCasted.subVector(12, 16));
360                         setHighLevelState("c0001.q", newStateCasted.subVector(16, 20));
361                         setHighLevelState("c0101.q", newStateCasted.subVector(20, 24));
362                         setHighLevelState("c1001.q", newStateCasted.subVector(24, 28));
363                         setHighLevelState("c1101.q", newStateCasted.subVector(28, 32));
364                         setHighLevelState("c0010.q", newStateCasted.subVector(32, 36));
365                         setHighLevelState("c0110.q", newStateCasted.subVector(36, 40));
366                         setHighLevelState("c1010.q", newStateCasted.subVector(40, 44));
367                         setHighLevelState("c1110.q", newStateCasted.subVector(44, 48));
368                         setHighLevelState("c0011.q", newStateCasted.subVector(48, 52));
369                         setHighLevelState("c1011.q", newStateCasted.subVector(52, 56));
370                         setHighLevelState("c0111.q", newStateCasted.subVector(56, 60));
371                         setHighLevelState("c1111.q", newStateCasted.subVector(60, 64));
372                         break;
373                 default:
374                         int indexOfDot = stateID.indexOf('.');
375                         if (indexOfDot != -1)
376                         {
377                                 String cellID = stateID.substring(0, indexOfDot);
378                                 switch (cellID)
379                                 {
380                                 case "c0000":
381                                 case "c0100":
382                                 case "c1000":
383                                 case "c1100":
384                                         cell00.setHighLevelState(cellID.substring(0, 3) + stateID.substring(indexOfDot), newState);
385                                         break;
386                                 case "c0001":
387                                 case "c0101":
388                                 case "c1001":
389                                 case "c1101":
390                                         cell01.setHighLevelState(cellID.substring(0, 3) + stateID.substring(indexOfDot), newState);
391                                         break;
392                                 case "c0010":
393                                 case "c0110":
394                                 case "c1010":
395                                 case "c1110":
396                                         cell10.setHighLevelState(cellID.substring(0, 3) + stateID.substring(indexOfDot), newState);
397                                         break;
398                                 case "c0011":
399                                 case "c0111":
400                                 case "c1011":
401                                 case "c1111":
402                                         cell11.setHighLevelState(cellID.substring(0, 3) + stateID.substring(indexOfDot), newState);
403                                         break;
404                                 default:
405                                         super.setHighLevelState(stateID, newState);
406                                         break;
407                                 }
408                         } else
409                                 super.setHighLevelState(stateID, newState);
410                 }
411         }
412 }