ghy
Alejandro Acuña
2025-03-12 26319e4c5bfbee722c15b8e7ccca9b6127bb1cb8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
package art.servers.rtzserver.controller;
 
import art.library.model.devices.colors.controller.RTZ32.configuration.RTZ32_Configuration;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_1;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_11_28;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_2;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_3;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_31;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_32;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_33;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_34;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_35;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_36;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_37;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_38_40;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_4;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_42;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_43;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_44;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_45;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_46;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_5;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_6;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.RTZ32_Configuration_Table_7;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.eprom.RTZ32_Configuration_Table_91;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.eprom.RTZ32_Configuration_Table_92;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.eprom.RTZ32_Configuration_Table_93;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.eprom.RTZ32_Configuration_Table_94;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.eprom.RTZ32_Configuration_Table_95;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.microregulation.RTZ32_Configuration_Table_65;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.microregulation.RTZ32_Configuration_Table_66;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.microregulation.RTZ32_Configuration_Table_67;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.microregulation.RTZ32_Configuration_Table_68;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.microregulation.RTZ32_Configuration_Table_69;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.timetables.RTZ32_Configuration_Table_50;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.timetables.RTZ32_Configuration_Table_51;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.timetables.RTZ32_Configuration_Table_52;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.timetables.RTZ32_Configuration_Table_53_60;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.trolleygroups.RTZ32_Configuration_Table_70;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.trolleygroups.RTZ32_Configuration_Table_71;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.trolleygroups.RTZ32_Configuration_Table_72;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.trolleygroups.RTZ32_Configuration_Table_73;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.trolleygroups.RTZ32_Configuration_Table_74;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.trolleygroups.RTZ32_Configuration_Table_75;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.trolleygroups.RTZ32_Configuration_Table_78;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.trolleygroups.RTZ32_Configuration_Table_79;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.trolleygroups.RTZ32_Configuration_Table_80;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.trolleygroups.RTZ32_Configuration_Table_81;
import art.library.model.devices.colors.controller.RTZ32.configuration.tables.trolleygroups.RTZ32_Configuration_Table_82_85;
import java.util.HashMap;
 
public class Controller_RTZ32_Factory_Configuration
{
    public HashMap<Integer, byte[]> tables = new HashMap();
    public RTZ32_Configuration configuration = null;
 
    public Controller_RTZ32_Factory_Configuration(RTZ32_Configuration configuration)
    {
        this.configuration = configuration;
    }
    
    
    public void serialize() throws Exception
    {
        try
        {
            serialize(new RTZ32_Configuration_Table_1(1));
            serialize(new RTZ32_Configuration_Table_2(2));
            serialize(new RTZ32_Configuration_Table_3(3));
            serialize(new RTZ32_Configuration_Table_4(4));
            serialize(new RTZ32_Configuration_Table_5(5));
            serialize(new RTZ32_Configuration_Table_6(6));
            serialize(new RTZ32_Configuration_Table_7(7));
 
            for (int i=11; i<=28; i++)
            {
               serialize(new RTZ32_Configuration_Table_11_28(i)); 
            }
 
            serialize(new RTZ32_Configuration_Table_31(31));
            serialize(new RTZ32_Configuration_Table_32(32));
            serialize(new RTZ32_Configuration_Table_33(33));
            serialize(new RTZ32_Configuration_Table_34(34));
            serialize(new RTZ32_Configuration_Table_35(35));
            serialize(new RTZ32_Configuration_Table_36(36));
            serialize(new RTZ32_Configuration_Table_37(37));
 
            for (int i=38; i<=40; i++)
            {
               serialize(new RTZ32_Configuration_Table_38_40(i)); 
            }
 
            serialize(new RTZ32_Configuration_Table_42(42));
            serialize(new RTZ32_Configuration_Table_43(43));
            serialize(new RTZ32_Configuration_Table_44(44));
            serialize(new RTZ32_Configuration_Table_45(45));
            serialize(new RTZ32_Configuration_Table_46(46));
            serialize(new RTZ32_Configuration_Table_50(50));
            serialize(new RTZ32_Configuration_Table_51(51));
            serialize(new RTZ32_Configuration_Table_52(52));
 
            for (int i=53; i<=60; i++)
            {
               serialize(new RTZ32_Configuration_Table_53_60(i)); 
            }
 
            serialize(new RTZ32_Configuration_Table_65(65));
            serialize(new RTZ32_Configuration_Table_66(66));
            serialize(new RTZ32_Configuration_Table_67(67));
            serialize(new RTZ32_Configuration_Table_68(68));
            serialize(new RTZ32_Configuration_Table_69(69));
            serialize(new RTZ32_Configuration_Table_70(70));
            serialize(new RTZ32_Configuration_Table_71(71));
            serialize(new RTZ32_Configuration_Table_72(72));
            serialize(new RTZ32_Configuration_Table_73(73));
            serialize(new RTZ32_Configuration_Table_74(74));
            serialize(new RTZ32_Configuration_Table_75(75));
            serialize(new RTZ32_Configuration_Table_78(78));
            serialize(new RTZ32_Configuration_Table_79(79));
            serialize(new RTZ32_Configuration_Table_80(80));
            serialize(new RTZ32_Configuration_Table_81(81));
 
            for (int i=82; i<=85; i++)
            {
               serialize(new RTZ32_Configuration_Table_82_85(i)); 
            }
 
//            serialize(new RTZ32_Configuration_Table_91(91));
//            serialize(new RTZ32_Configuration_Table_92(92));
//            serialize(new RTZ32_Configuration_Table_93(93));
//            serialize(new RTZ32_Configuration_Table_94(94));
            serialize(new RTZ32_Configuration_Table_95(95));
 
 
            
            
        }
        catch (Exception exception)
        {
            exception.printStackTrace();
            throw exception;
        }
    }
    
    
    
 
    public RTZ32_Configuration deserialize() throws Exception
    {
        int i=0;
        try
        {
            for (i=1; i<=7; i++)  deserialize(configuration, i, (byte[])tables.get(i));
            for (i=11; i<=28; i++) deserialize(configuration, i, (byte[])tables.get(i));
            for (i=31; i<=40; i++) deserialize(configuration, i, (byte[])tables.get(i));
            for (i=42; i<=46; i++) deserialize(configuration, i, (byte[])tables.get(i));
            for (i=50; i<=60; i++) deserialize(configuration, i, (byte[])tables.get(i));
            for (i=65; i<=75; i++) deserialize(configuration, i, (byte[])tables.get(i));
            for (i=78; i<=85; i++) deserialize(configuration, i, (byte[])tables.get(i));
 
            i = 95;
            deserialize(configuration, 95, (byte[])tables.get(95));
 
            return configuration;
        }
        catch (Exception e)
        {
            e.printStackTrace();
            throw e;
        }
    }
 
    
    
    
    
    
    
    
    
    
    
    private void serialize (RTZ32_Configuration_Table table) throws Exception
    {
        tables.put(table.number, table.serialize(configuration));
    }
    
 
    
    private void deserialize (RTZ32_Configuration configuration, int tableNumber, byte[] data) throws Exception
    {
        if (data == null) return;
        RTZ32_Configuration_Table table = null;
 
        if ((tableNumber >= 11) && (tableNumber) <= 28)
        {
            table = new RTZ32_Configuration_Table_11_28(tableNumber); 
        }
        else if ((tableNumber >= 38) && (tableNumber) <= 40)
        {
            table = new RTZ32_Configuration_Table_38_40(tableNumber); 
        }
        else if ((tableNumber >= 53) && (tableNumber) <= 60)
        {
            table = new RTZ32_Configuration_Table_53_60(tableNumber); 
        }
        else if ((tableNumber >= 82) && (tableNumber) <= 85)
        {
            table = new RTZ32_Configuration_Table_82_85(tableNumber); 
        }
        else
        {
            switch (tableNumber)
            {
                case 1: table = new RTZ32_Configuration_Table_1(tableNumber); break;
                case 2: table = new RTZ32_Configuration_Table_2(tableNumber); break;
                case 3: table = new RTZ32_Configuration_Table_3(tableNumber); break;
                case 4: table = new RTZ32_Configuration_Table_4(tableNumber); break;
                case 5: table = new RTZ32_Configuration_Table_5(tableNumber); break;
                case 6: table = new RTZ32_Configuration_Table_6(tableNumber); break;
                case 7: table = new RTZ32_Configuration_Table_7(tableNumber); break;
                case 31: table = new RTZ32_Configuration_Table_31(tableNumber); break;
                case 32: table = new RTZ32_Configuration_Table_32(tableNumber); break;
                case 33: table = new RTZ32_Configuration_Table_33(tableNumber); break;
                case 34: table = new RTZ32_Configuration_Table_34(tableNumber); break;
                case 35: table = new RTZ32_Configuration_Table_35(tableNumber); break;
                case 36: table = new RTZ32_Configuration_Table_36(tableNumber); break;
                case 37: table = new RTZ32_Configuration_Table_37(tableNumber); break;
                case 42: table = new RTZ32_Configuration_Table_42(tableNumber); break;
                case 43: table = new RTZ32_Configuration_Table_43(tableNumber); break;
                case 44: table = new RTZ32_Configuration_Table_44(tableNumber); break;
                case 45: table = new RTZ32_Configuration_Table_45(tableNumber); break;
                case 46: table = new RTZ32_Configuration_Table_46(tableNumber); break;
                case 50: table = new RTZ32_Configuration_Table_50(tableNumber); break;
                case 51: table = new RTZ32_Configuration_Table_51(tableNumber); break;
                case 52: table = new RTZ32_Configuration_Table_52(tableNumber); break;
                case 65: table = new RTZ32_Configuration_Table_65(tableNumber); break;
                case 66: table = new RTZ32_Configuration_Table_66(tableNumber); break;
                case 67: table = new RTZ32_Configuration_Table_67(tableNumber); break;
                case 68: table = new RTZ32_Configuration_Table_68(tableNumber); break;
                case 69: table = new RTZ32_Configuration_Table_69(tableNumber); break;
                case 70: table = new RTZ32_Configuration_Table_70(tableNumber); break;
                case 71: table = new RTZ32_Configuration_Table_71(tableNumber); break;
                case 72: table = new RTZ32_Configuration_Table_72(tableNumber); break;
                case 73: table = new RTZ32_Configuration_Table_73(tableNumber); break;
                case 74: table = new RTZ32_Configuration_Table_74(tableNumber); break;
                case 75: table = new RTZ32_Configuration_Table_75(tableNumber); break;
                case 78: table = new RTZ32_Configuration_Table_78(tableNumber); break;
                case 79: table = new RTZ32_Configuration_Table_79(tableNumber); break;
                case 80: table = new RTZ32_Configuration_Table_80(tableNumber); break;
                case 81: table = new RTZ32_Configuration_Table_81(tableNumber); break;
                case 91: table = new RTZ32_Configuration_Table_91(tableNumber); break;
                case 92: table = new RTZ32_Configuration_Table_92(tableNumber); break;
                case 93: table = new RTZ32_Configuration_Table_93(tableNumber); break;
                case 94: table = new RTZ32_Configuration_Table_94(tableNumber); break;
                case 95: table = new RTZ32_Configuration_Table_95(tableNumber); break;
                default: table = new RTZ32_Configuration_Table(tableNumber); break;
            }
        }
 
        table.number = tableNumber;
        table.deserialize(configuration, data);
    }
    
        
    
 
}