-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpsu_backend.py
588 lines (421 loc) · 20.1 KB
/
psu_backend.py
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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
import treeview_functions
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib.figure import Figure
import copy
import Default_AC_Models
import pandas as pd
def setup_variables(w):
w.type = 'PSU'
w.title = None
w.aircraft_type = None
w.description = None
w.lopa = None
w.drawing_no = None
w.drawing_rev = None
w.parts = []
w.psu_layout = {'LHS': [], 'RHS': []}
w.gasper_layout = {'LHS': [['N/A','23.0','353.0' ],['N/A','24.25','379.25' ],['N/A','25.75','410.75' ],
['N/A','27.0','437.0' ],['N/A','28.25','463.25' ],['N/A','29.75','494.75' ],
['N/A','31.0','521.0' ],['N/A','32.25','547.25' ],['N/A','33.75','578.75' ],
['N/A','35.0','605.0' ],['N/A','36.25','631.0' ],['N/A','38.25','662.58' ],
['N/A','40.25','695.9' ],['N/A','41.5','724.32' ],['N/A','42.75','751.75' ],
['N/A','44.0','778.0' ],['N/A','45.25','804.25' ],['N/A','46.75','835.75' ],
['N/A','48.0','862.0' ],['N/A','49.25','888.25' ],['N/A','50.75','919.75' ],
['N/A','52.0','946.0' ],['N/A','53.25','972.25' ],['N/A','54.75','1003.75' ],
['N/A','56.0','1030.0' ],['N/A','57.25','1056.25' ],['N/A','58.75','1087.75' ],
['N/A','60.0','1114.0' ],['N/A','61.25','1140.25'],['N/A','62.75','1171.75' ],
['N/A','64.0','1198.0' ]],
'RHS': [['N/A','23.0','353.0' ],['N/A','24.25','379.25' ],['N/A','25.75','410.75' ],
['N/A','27.0','437.0' ],['N/A','28.25','463.25' ],['N/A','29.75','494.75' ],
['N/A','31.0','521.0' ],['N/A','32.25','547.25' ],['N/A','33.75','578.75' ],
['N/A','35.0','605.0' ],['N/A','36.25','631.0' ],['N/A','38.25','662.58' ],
['N/A','40.25','695.9' ],['N/A','41.5','724.32' ],['N/A','42.75','751.75' ],
['N/A','44.0','778.0' ],['N/A','45.25','804.25' ],['N/A','46.75','835.75' ],
['N/A','48.0','862.0' ],['N/A','49.25','888.25' ],['N/A','50.75','919.75' ],
['N/A','52.0','946.0' ],['N/A','53.25','972.25' ],['N/A','54.75','1003.75' ],
['N/A','56.0','1030.0' ],['N/A','57.25','1056.25' ],['N/A','58.75','1087.75' ],
['N/A','60.0','1114.0' ],['N/A','61.25','1140.25'],['N/A','62.75','1171.75' ],
['N/A','64.0','1198.0' ]]
}
#add blank foe gasper length
for side in ['LHS', 'RHS']:
for idx, g in enumerate(w.gasper_layout[side]):
w.gasper_layout[side][idx].append('')
w.deu_layout = {'LHS': [['200RH1','985','387.795','LHS'],['200RH3','1412','555.9055','LHS'],['200RH7','1849','727.9528','LHS'],
['200RH11','2278','896.8504','LHS'],['200RH13','2704','1064.567','LHS'],['200RH15','2918','1148.819','LHS'],],
'RHS': [['200RH2','985','387.795','RHS'],['200RH4','1412','555.9055','RHS'],['200RH8','1849','727.9528','RHS'],
['200RH12','2278','896.8504','RHS'],['200RH14','2704','1064.567','RHS'],['200RH16','2918','1148.819','RHS']]}
w.vc_layout = {'LHS': [['7381 VC13','22.25','345.125','200RH1','N/A'],['7381 VC14','24.0','374.0','200RH1','N/A'],['7381 VC15','25.5','405.5','200RH1','N/A'],
['7381 VC16','26.75','431.75','200RH1','N/A'],['7381 VC31','28.0','458.0','200RH3','N/A'],['7381 VC32','29.5','489.5','200RH3','N/A'],
['7381 VC33','30.75','515.75','200RH3','N/A'],['7381 VC34','32.0','542.0','200RH3','N/A'],['7381 VC35','33.25','568.25','200RH3','N/A'],
['7381 VC36','34.75','599.75','200RH3','N/A'],['7381 VC71','36.0','626.0','200RH7','N/A'],['7381 VC72','37.75','654.25','200RH7','N/A'],
['7381 VC73','39.75','687.57','200RH7','N/A'],['7381 VC74','41.25','718.48','200RH7','N/A'],['7381 VC75','42.25','741.25','200RH7','N/A'],
['7381 VC76','43.75','772.75','200RH7','N/A'], ['7381 VC111','45.0','799.0','200RH11','N/A'],['7381 VC112','46.25','825.25','200RH11','N/A'],
['7381 VC113','47.75','856.75','200RH11','N/A'], ['7381 VC114','49.0','883.0','200RH11','N/A'],['7381 VC115','50.25','909.25','200RH11','N/A'],
['7381 VC116','51.75','940.75','200RH11','N/A'],['7381 VC131','53.0','967.0','200RH13','N/A'],['7381 VC132','54.25','993.25','200RH13','N/A'],
['7381 VC133','55.75','1024.75','200RH13','N/A'],['7381 VC134','57.0','1051.0','200RH13','N/A'],['7381 VC135','58.5','1082.5','200RH13','N/A'],
['7381 VC136','59.75','1108.75','200RH13','N/A'], ['7381 VC151','61.0','1135.0','200RH15','N/A'],
['7381 VC152','62.25','1161.25','200RH15','N/A'],['7381 VC153','63.5','1187.5','200RH15','N/A']],
'RHS': [['7382 VC23','22.25','345.125','200RH2','N/A'],['7382 VC24','24.0','374.0','200RH2','N/A'],['7382 VC25','25.5','405.5','200RH2','N/A'],
['7382 VC26','26.75','431.75','200RH2','N/A'],['7382 VC41','28.0','458.0','200RH4','N/A'],['7382 VC42','29.5','489.5','200RH4','N/A'],
['7382 VC43','30.75','515.75','200RH4','N/A'],['7382 VC44','32.0','542.0','200RH4','N/A'],['7382 VC45','33.25','568.25','200RH4','N/A'],
['7382 VC46','34.75','599.75','200RH4','N/A'],['7382 VC81','36.0','626.0','200RH8','N/A'],['7382 VC82','37.75','654.25','200RH8','N/A'],
['7382 VC83','39.75','687.57','200RH8','N/A'],['7382 VC84','41.25','718.48','200RH8','N/A'],['7382 VC85','42.25','741.25','200RH8','N/A'],
['7382 VC86','43.75','772.75','200RH8','N/A'], ['7382 VC121','45.0','799.0','200RH12','N/A'],['7382 VC122','46.25','825.25','200RH12','N/A'],
['7382 VC123','47.75','856.75','200RH12','N/A'], ['7382 VC124','49.0','883.0','200RH12','N/A'],['7382 VC125','50.25','909.25','200RH12','N/A'],
['7382 VC126','51.75','940.75','200RH12','N/A'],['7382 VC141','53.0','967.0','200RH14','N/A'],['7382 VC142','54.25','993.25','200RH14','N/A'],
['7382 VC143','55.75','1024.75','200RH14','N/A'],['7382 VC144','57.0','1051.0','200RH14','N/A'],['7382 VC145','58.5','1082.5','200RH14','N/A'],
['7382 VC146','59.75','1108.75','200RH14','N/A'], ['7382 VC161','61.0','1135.0','200RH16','N/A'],
['7382 VC162','62.25','1161.25','200RH16','N/A'],['7382 VC163','63.5','1187.5','200RH16','N/A']]
}
class PSU_Backend():
def __init__(self, parent_page, controller):
self.controller = controller #main append
self.parent_page = parent_page #this is the tkinter frame associated with this BE.
setup_variables(self)
self.setup_plot()
self.save_class = PSU_Saved_State
self.mainapp = self.parent_page.mainapp
def update_variables(self, source):
self.title = source.title
self.aircraft_type = source.aircraft_type
self.description = source.description
self.lopa = source.lopa
self.drawing_no = source.drawing_no
self.drawing_rev = source.drawing_rev
self.parts = copy.deepcopy(source.parts)
self.psu_layout = copy.deepcopy(source.psu_layout)
self.gasper_layout = copy.deepcopy(source.gasper_layout)
self.deu_layout = copy.deepcopy(source.deu_layout)
self.vc_layout = copy.deepcopy(source.vc_layout)
if self.aircraft_type in ['A320', 'A319']:
self.treeview_node = 'A320 PSUs'
self.psu_y_coords = [70, 75]
elif self.aircraft_type in ['B737-800']:
self.treeview_node = 'B737 PSUs'
def update_component(self, source, type):
#pass current joint through to state class (for undo redo)
if type != 'undo_redo':
self.controller.states.component_updated(type, self, PSU_Saved_State)
elif type == 'new':
self.controller.states.component_updated(type, self, PSU_Saved_State)
self.update_variables(source)
def setup_plot(self):
#self.lopa_figure = Figure(figsize=(5,5), dpi=100)
self.lopa_figure = Figure(figsize=(5,3), dpi=100)
self.ax1 = self.lopa_figure.add_subplot(211, aspect='equal', adjustable='box')
#self.ax2 = self.lopa_figure.add_subplot(111, aspect='equal', adjustable='box')
self.ax3 = self.lopa_figure.add_subplot(212, aspect='equal', adjustable='box')
self.lopa_figure.subplots_adjust(left=0.05, bottom=0.02, right=0.99, top=0.98, wspace=None, hspace=None)
self.gasper_figure = Figure(figsize=(5,3), dpi=100)
self.ax4 = self.gasper_figure.add_subplot(111, aspect='equal', adjustable='box')
#self.ax2 = self.lopa_figure.add_subplot(111, aspect='equal', adjustable='box')
#self.ax6 = self.gasper_figure.add_subplot(212, aspect='equal', adjustable='box')
self.gasper_figure.subplots_adjust(left=0.05, bottom=0.02, right=0.99, top=0.98, wspace=None, hspace=None)
self.deu_figure = Figure(figsize=(5,3), dpi=100)
self.ax7 = self.deu_figure.add_subplot(111, aspect='equal', adjustable='box')
self.deu_figure.subplots_adjust(left=0.05, bottom=0.02, right=0.99, top=0.98, wspace=None, hspace=None)
def gen_save_dict(self, comments_from_text_widget = True, comments = None):
if comments_from_text_widget:
comments = self.parent_page.comment_text.get("1.0","end")
else:
comments = comments
return {'Title': self.title,
'Description': self.description,
'Aircraft Type': self.aircraft_type,
'LOPA': self.lopa,
'Drawing Number': self.drawing_no,
'Drawing Rev': self.drawing_rev,
'Parts': self.parts,
'Layout': self.psu_layout,
'Gasper Layout': self.gasper_layout,
'DEU Layout': self.deu_layout,
'VCC Layout': self.vc_layout,
'Comments': comments}
def gen_parts_table(self):
parts_table = [] #[qty, part_no, description]
for part in self.parts:
parts_table.append([part[4], part[2], part[1]])
return parts_table
def gen_ipc_table(self):
ipc_table = []
count = 0
for part in self.parts:
count += 1
ipc_table.append([count, part[2], part[1], '', part[4]])
return ipc_table
def auto_assign_psius(self):
self.psiu_layout = {}
for side in ['LHS', 'RHS']:
self.psiu_layout[side] = self.assign_320_psius(side)
return self.psiu_layout
def gen_a320_psu_layout(self, psiu_layout, start_lhs, end_lhs, start_rhs, end_rhs, wb_installed, lav_d, lav_e):
start_stations = {'LHS': start_lhs, 'RHS': start_rhs}
end_stations = {'LHS': end_lhs, 'RHS': end_rhs}
#start = 320
#end = 1206.98
self.available_parts = {} #tracker for existing parts, decreases in qty as used up
for p in self.parts:
if 'Filler Panel' in p[1]:
self.available_parts[int(p[1].split('"')[0])] = int(p[3])
psu_layout = {'LHS': [], 'RHS': []}
if wb_installed[0]:
psu_layout['LHS'] = [['WB', 'Partition Panel LHS', '-', start_stations['LHS']]]
start_stations['LHS'] = start_stations['LHS']+2
if wb_installed[1]:
psu_layout['RHS'] = [['WB', 'Partition Panel RHS', '-', start_stations['RHS']]]
start_stations['RHS'] = start_stations['LHS']+2
self.lopa_page = self.mainapp.frames[self.lopa]
oxygen_len = 12
gasper_len = 3
for side in ['LHS', 'RHS']:
start = start_stations[side]
end = end_stations[side]
# 1. Get LOPA layout
seat_layout = copy.deepcopy(self.lopa_page.backend.seat_layout[side])
for index, row in enumerate(seat_layout):
row_number = row[0]
#2 . get the start and end stations of row
if index == 0:
row_start = start
else:
row_start = row_end
#if index != len(seat_layout)-1:
seat = self.mainapp.frames[row[1]]
station = float(row[3])
srp = float(seat.backend.srp_x)
row_end = srp + station+4
#else:
# row_end = end
#3. Calculate gap to filled in front of psiu_layout
psiu = psiu_layout[side][index]
if '11"' in psiu:
psiu_len = 11
elif '8"' in psiu:
psiu_len = 8
gap_to_fill = row_end - row_start - psiu_len - oxygen_len - gasper_len
local_station = row_start
count = 0 #counter for panels
while gap_to_fill > 0:
if gap_to_fill >= 8:
panels = self.select_filler_panels(8)
gap_to_fill = gap_to_fill - 8
else:
panels = self.select_filler_panels(gap_to_fill)
gap_to_fill = gap_to_fill - gap_to_fill
#break
for p in panels:
text = f'{p}" Filler Panel'
psu_layout[side].append([row_number, text, '-', local_station])
local_station += p
self.available_parts[p] -= 1
psu_layout[side].append([row_number, psiu, '-', row_end - psiu_len - oxygen_len - gasper_len])
psu_layout[side].append([row_number, f'Oxygen Box {side}', '-', row_end - oxygen_len - gasper_len])
psu_layout[side].append([row_number, 'Gasper', '-', row_end - gasper_len])
# Add panels at end of layout
if side == 'LHS':
if lav_d:
end = 1207
lav = True
else:
end = 1250
lav = False
elif side == 'RHS':
if lav_e:
end = 1207
lav = True
else:
end = 1250
lav = False
gap_to_fill = end-row_end
if lav and gap_to_fill >= 6:
gap_to_fill = gap_to_fill - 6 # account for clamping and adjustment panel
local_station = row_end
while gap_to_fill > 0:
if gap_to_fill >= 8:
panels = self.select_filler_panels(8)
gap_to_fill = gap_to_fill - 8
else:
panels = self.select_filler_panels(gap_to_fill)
gap_to_fill = gap_to_fill - gap_to_fill
for p in panels:
text = f'{p}" Filler Panel'
psu_layout[side].append([row_number, text, '-', local_station])
local_station += p
if lav:
psu_layout[side].append([row_number, f'Adjustment Panel {side}', '-', local_station])
psu_layout[side].append([row_number, 'Clamping Panel', '-', local_station+4])
return psu_layout
def select_filler_panels(self, gap):
possible_solutions = {8: [ [2,2,2,2], [4,2,2],
[6,1,1], [4,4], [6,2], [8]],
7: [[2,2,2,1], [4,2,1],[6,1]],
6: [[2,2,1,1],[2,2,2], [4,1,1],
[4,2],[6]],
5: [[2,1,1,1],[2,2,1],
[4,1]],
4: [[1,1,1,1], [2,1,1],[2,2],[4]],
3: [[1,1, 1], [2,1]],
2: [[1, 1], [2]],
1: [[1]]}
solutions = reversed(possible_solutions[gap])
found_solution = False
for sol in solutions:
if self.check_can_use_existing_filler_panels(sol):
found_solution = True
break
if found_solution:
return sol
else:
return possible_solutions[gap][-1]
def check_can_use_existing_filler_panels(self, panels):
can_use = True
qtys = {}
for p in panels:
if p not in qtys.keys():
qtys[p] = 1
else:
qtys[p] += 1
for p in qtys:
if qtys[p] > self.available_parts[p]:
can_use = False
break
return can_use
def update_parts_table(self):
qtys = {}
for side in ['LHS', 'RHS']:
for p in self.psu_layout[side]:
#if 'Filler Panel' in p[1]:
if p[1] not in qtys.keys():
qtys[p[1]] = 1
else:
qtys[p[1]] += 1
# Add the gasper hoses
for p in self.gasper_layout[side]:
if 'mm' in p[3]:
hose = f'Gasper Hose {p[3]}'
if hose not in qtys.keys():
qtys[hose] = 1
else:
qtys[hose] += 1
for p in self.parts:
if p[1] in qtys.keys():
existing_qty = int(p[3])
required_qty = qtys[p[1]]
additonal_qty = int(p[5])
p[4] = qtys[p[1]]
if required_qty - existing_qty + additonal_qty< 0: #don't need any additonal items
p[6] = 0
else:
p[6] = required_qty - existing_qty + additonal_qty
def gen_excel_data(self):
excel_data = {'type': 'df', 'data': {}}
df_parts = treeview_functions.treeview_to_df(self.parent_page.parts_tree)
df_parts.set_index('#')
excel_data['data']['Parts'] = df_parts
#Layout
df_lhs_layout = treeview_functions.treeview_to_df(self.parent_page.LHS_tree_psu)
df_lhs_layout.rename(columns={"Row": "LHS Row", "Component": "LHS Component", 'P/N': 'LHS P/N', 'Station': 'LHS Station'}, inplace=True)
df_rhs_layout = treeview_functions.treeview_to_df(self.parent_page.RHS_tree_psu)
df_rhs_layout.rename(columns={"Row": "RHS Row", "Component": "RHS Component", 'P/N': 'RHS P/N', 'Station': 'RHS Station'}, inplace=True)
df_layout = pd.concat([df_lhs_layout, df_rhs_layout], axis=1,)
excel_data['data']['Layout'] = df_layout
#Gasper Hoses
df_lhs_gasper = treeview_functions.treeview_to_df(self.parent_page.LHS_tree_gasper)
df_lhs_gasper.rename(columns={"Row": "LHS Row", "Vent Frame": "LHS Vent Frame", 'Vent Station': 'LHS Vent Station', 'Hose length': 'LHS Hose Length'}, inplace=True)
df_rhs_gasper = treeview_functions.treeview_to_df(self.parent_page.RHS_tree_gasper)
df_rhs_gasper.rename(columns={"Row": "RHS Row", "Vent Frame": "RHS Vent Frame", 'Vent Station': 'RHS Vent Station', 'Hose length': 'RHS Hose Length'}, inplace=True)
df_gasper = pd.concat([df_lhs_gasper, df_rhs_gasper], axis=1,)
excel_data['data']['Gasper Hoses'] = df_gasper
#DEU
df_deu = treeview_functions.treeview_to_df(self.parent_page.deu_tree)
excel_data['data']['DEU'] = df_deu
#VCC
df_lhs_vcc = treeview_functions.treeview_to_df(self.parent_page.lhs_vcc_tree)
df_lhs_vcc.rename(columns={"VC Title": "LHS VC Title", "Frame": "LHS Frame", 'Station (in)': 'LHS Station (in)', 'DEU': 'LHS DEU', 'Row': 'LHS Row'}, inplace=True)
df_rhs_vcc = treeview_functions.treeview_to_df(self.parent_page.rhs_vcc_tree)
df_rhs_vcc.rename(columns={"VC Title": "RHS VC Title", "Frame": "RHS Frame", 'Station (in)': 'RHS Station (in)', 'DEU': 'RHS DEU', 'Row': 'RHS Row'}, inplace=True)
df_vcc = pd.concat([df_lhs_vcc, df_rhs_vcc], axis=1,)
excel_data['data']['VCC'] = df_vcc
return excel_data
def determine_first_psu_station(self, side):
return 320
def determine_last_psu_station(self, side):
return 1206.98
def assign_320_psius(self, side):
# 1. Get LOPA layout
self.lopa_page = self.mainapp.frames[self.lopa]
psiu_layout = copy.deepcopy(self.lopa_page.backend.seat_layout[side])
for index, row in enumerate(psiu_layout):
psiu_layout[index].append(None)
# 2. Assign every second row 11"
start_row = 0
psiu_layout[start_row][-1] = '11" PSIU'
for index in range(0, len(psiu_layout),2):
#for index, row in enumerate(psiu_layout):
psiu_layout[index][-1] = '11" PSIU'
# 3. Find Rows nearest Emergency Exit ans Assign 11"
if self.lopa_page.backend.aircraft_type == 'A320':
exits = [668.15, 701.5]
for exit in exits:
closest_dist = None
closest_row = None
for index, row in enumerate(psiu_layout):
dist = abs(row[3] - exit)
if not closest_dist:
#if not psiu_layout[index][-1]:
closest_dist = dist
closest_row = index
elif dist < closest_dist:
#if not psiu_layout[index][-1]:
closest_dist = dist
closest_row = index
psiu_layout[closest_row][-1] = '11" PSIU'
# 4. Assign all other rows 8" PSIU
for index, row in enumerate(psiu_layout):
if not row[-1]:
psiu_layout[index][-1] = '8" PSIU'
check_number_11 = 0
check_number_8 = 0
for index, row in enumerate(psiu_layout):
if row[-1] == '11" PSIU':
check_number_11 += 1
elif row[-1] == '8" PSIU':
check_number_8 += 1
return psiu_layout
def gen_ipc_data(self, fromto):
#data = treeview_functions.get_all_treeview_items(self.item_tree)
ipc_data = []
for d in self.parts:
#desc = self.mainapp.frames[d[1]].backend.description
ipc_data.append(['', str(d[2]), str(d[1]), fromto, str(d[4])])
return ipc_data
def get_gasper_stations(self):
gasper_stations = {'LHS': [], 'RHS': []}
for side in ['LHS', 'RHS']:
for part in self.psu_layout[side]:
if part[1] == 'Gasper':
gasper_stations[side].append(float(part[3]))
return gasper_stations
def get_psiu_stations(self):
psiu_stations = {'LHS': [], 'RHS': []}
for side in ['LHS', 'RHS']:
for part in self.psu_layout[side]:
if 'PSIU' in part[1]:
psiu_stations[side].append(float(part[3]))
return psiu_stations
def get_psiu_rows(self):
#get psiu size for each row
psiu_rows = {'LHS': [], 'RHS': []}
for side in ['LHS', 'RHS']:
for part in self.psu_layout[side]:
if 'PSIU' in part[1]:
psiu_rows[side].append(part[1])
return psiu_rows
class PSU_Saved_State():
def __init__(self, psu):
setup_variables(self)
PSU_Backend.update_variables(self, psu)