itkdb-gtk 0.9.0__py3-none-any.whl → 0.10.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of itkdb-gtk might be problematic. Click here for more details.
- itkdb_gtk/CreateShipments.py +41 -55
- itkdb_gtk/GetShipments.py +4 -21
- itkdb_gtk/GlueWeight.py +2 -2
- itkdb_gtk/ITkDButils.py +25 -13
- itkdb_gtk/PanelVisualInspection.py +230 -0
- itkdb_gtk/{GroundVITests.py → PetalReceptionTests.py} +7 -6
- itkdb_gtk/SensorUtils.py +490 -0
- itkdb_gtk/UploadModuleIV.py +206 -497
- itkdb_gtk/UploadMultipleTests.py +2 -2
- itkdb_gtk/UploadPetalInformation.py +164 -94
- itkdb_gtk/UploadTest.py +6 -4
- itkdb_gtk/__init__.py +5 -3
- itkdb_gtk/dashBoard.py +13 -12
- itkdb_gtk/dbGtkUtils.py +93 -5
- itkdb_gtk/readAVSdata.py +204 -72
- {itkdb_gtk-0.9.0.dist-info → itkdb_gtk-0.10.0.dist-info}/METADATA +1 -1
- itkdb_gtk-0.10.0.dist-info/RECORD +29 -0
- {itkdb_gtk-0.9.0.dist-info → itkdb_gtk-0.10.0.dist-info}/entry_points.txt +2 -2
- itkdb_gtk-0.9.0.dist-info/RECORD +0 -27
- {itkdb_gtk-0.9.0.dist-info → itkdb_gtk-0.10.0.dist-info}/WHEEL +0 -0
- {itkdb_gtk-0.9.0.dist-info → itkdb_gtk-0.10.0.dist-info}/top_level.txt +0 -0
itkdb_gtk/readAVSdata.py
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env pythoon3
|
|
2
2
|
"""Read AVS dats file."""
|
|
3
3
|
import sys
|
|
4
|
+
import re
|
|
4
5
|
from argparse import ArgumentParser
|
|
5
6
|
from pathlib import Path
|
|
6
7
|
|
|
8
|
+
import dateutil.parser
|
|
9
|
+
import openpyxl as XL
|
|
10
|
+
from openpyxl.cell.cell import MergedCell
|
|
11
|
+
from openpyxl.utils.exceptions import InvalidFileException
|
|
12
|
+
|
|
7
13
|
try:
|
|
8
14
|
import itkdb_gtk
|
|
9
|
-
|
|
15
|
+
|
|
10
16
|
except ImportError:
|
|
11
|
-
from pathlib import Path
|
|
12
17
|
cwd = Path(sys.argv[0]).parent.parent
|
|
13
18
|
sys.path.append(cwd.as_posix())
|
|
14
19
|
|
|
15
20
|
from itkdb_gtk import ITkDBlogin, ITkDButils
|
|
16
21
|
|
|
17
|
-
import dateutil.parser
|
|
18
|
-
import openpyxl as XL
|
|
19
|
-
from openpyxl.cell.cell import MergedCell
|
|
20
|
-
from openpyxl.utils.exceptions import InvalidFileException
|
|
21
|
-
|
|
22
22
|
sk_defaults = {
|
|
23
23
|
"institution": "AVS",
|
|
24
24
|
"runNumber": "1",
|
|
@@ -33,7 +33,7 @@ class AVSDataException(Exception):
|
|
|
33
33
|
super().__init__(message)
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
def create_weight(session, SN, the_date=None, manager="", passed=True, problems=False, comments=
|
|
36
|
+
def create_weight(session, SN, the_date=None, manager="", passed=True, problems=False, comments=None):
|
|
37
37
|
"""Creates the dictionary for a WEIGHT test.
|
|
38
38
|
|
|
39
39
|
Args:
|
|
@@ -46,10 +46,15 @@ def create_weight(session, SN, the_date=None, manager="", passed=True, problems=
|
|
|
46
46
|
comments: list of comments to append to the test
|
|
47
47
|
|
|
48
48
|
"""
|
|
49
|
+
if comments is None:
|
|
50
|
+
comments = []
|
|
51
|
+
|
|
49
52
|
the_date = ITkDButils.get_db_date(the_date)
|
|
50
53
|
out = ITkDButils.get_test_skeleton(session, "CORE_PETAL", "WEIGHING", sk_defaults)
|
|
51
54
|
out['component'] = SN
|
|
52
55
|
out['date'] = the_date
|
|
56
|
+
out["institution"] = "AVS"
|
|
57
|
+
out["runNumber"] = "1"
|
|
53
58
|
out['passed'] = passed
|
|
54
59
|
out['problems'] = problems
|
|
55
60
|
out['properties']['PRODUCTION_MANAGER'] = manager
|
|
@@ -57,7 +62,7 @@ def create_weight(session, SN, the_date=None, manager="", passed=True, problems=
|
|
|
57
62
|
return out
|
|
58
63
|
|
|
59
64
|
|
|
60
|
-
def create_manufacturing(session, SN, the_date=None, manager="", passed=True, problems=False, comments=
|
|
65
|
+
def create_manufacturing(session, SN, the_date=None, manager="", passed=True, problems=False, comments=None):
|
|
61
66
|
"""Create the dictionary or the MANUFACTURING test.
|
|
62
67
|
|
|
63
68
|
Args:
|
|
@@ -70,10 +75,14 @@ def create_manufacturing(session, SN, the_date=None, manager="", passed=True, pr
|
|
|
70
75
|
comments: list of comments to append to the test
|
|
71
76
|
|
|
72
77
|
"""
|
|
78
|
+
if comments is None:
|
|
79
|
+
comments = []
|
|
73
80
|
the_date = ITkDButils.get_db_date(the_date)
|
|
74
81
|
out = ITkDButils.get_test_skeleton(session, "CORE_PETAL", "MANUFACTURING", sk_defaults)
|
|
75
82
|
out['component'] = SN
|
|
76
83
|
out['date'] = the_date
|
|
84
|
+
out["institution"] = "AVS"
|
|
85
|
+
out["runNumber"] = "1"
|
|
77
86
|
out['passed'] = passed
|
|
78
87
|
out['problems'] = problems
|
|
79
88
|
out['properties']['PRODUCTION_MANAGER'] = manager
|
|
@@ -82,11 +91,15 @@ def create_manufacturing(session, SN, the_date=None, manager="", passed=True, pr
|
|
|
82
91
|
return out
|
|
83
92
|
|
|
84
93
|
|
|
85
|
-
def create_visual_inpection(session, SN, the_date=None, operator="", passed=True, problems=False, comments=
|
|
94
|
+
def create_visual_inpection(session, SN, the_date=None, operator="", passed=True, problems=False, comments=None):
|
|
86
95
|
"""Create Visual Inspection test skeleton."""
|
|
96
|
+
if comments is None:
|
|
97
|
+
comments = []
|
|
87
98
|
the_date = ITkDButils.get_db_date(the_date)
|
|
88
99
|
out = ITkDButils.get_test_skeleton(session, "CORE_PETAL", "VISUAL_INSPECTION", sk_defaults)
|
|
89
100
|
out['component'] = SN
|
|
101
|
+
out["institution"] = "AVS"
|
|
102
|
+
out["runNumber"] = "1"
|
|
90
103
|
out['date'] = the_date
|
|
91
104
|
out['passed'] = passed
|
|
92
105
|
out['problems'] = problems
|
|
@@ -96,7 +109,7 @@ def create_visual_inpection(session, SN, the_date=None, operator="", passed=True
|
|
|
96
109
|
return out
|
|
97
110
|
|
|
98
111
|
|
|
99
|
-
def create_delamination_test(session, SN, the_date=None, operator="", passed=True, problems=False, comments=
|
|
112
|
+
def create_delamination_test(session, SN, the_date=None, operator="", passed=True, problems=False, comments=None):
|
|
100
113
|
"""Create the delamination test JSON.
|
|
101
114
|
|
|
102
115
|
Args:
|
|
@@ -109,10 +122,15 @@ def create_delamination_test(session, SN, the_date=None, operator="", passed=Tru
|
|
|
109
122
|
comments: list of comments to append to the test
|
|
110
123
|
|
|
111
124
|
"""
|
|
125
|
+
if comments is None:
|
|
126
|
+
comments = []
|
|
127
|
+
|
|
112
128
|
the_date = ITkDButils.get_db_date(the_date)
|
|
113
129
|
out = ITkDButils.get_test_skeleton(session, "CORE_PETAL", "DELAMINATION", sk_defaults, {"boolean": False})
|
|
114
130
|
out['component'] = SN
|
|
115
131
|
out['date'] = the_date
|
|
132
|
+
out["institution"] = "AVS"
|
|
133
|
+
out["runNumber"] = "1"
|
|
116
134
|
out['passed'] = passed
|
|
117
135
|
out['problems'] = problems
|
|
118
136
|
out['properties']['OPERATOR'] = operator
|
|
@@ -121,7 +139,7 @@ def create_delamination_test(session, SN, the_date=None, operator="", passed=Tru
|
|
|
121
139
|
return out
|
|
122
140
|
|
|
123
141
|
|
|
124
|
-
def create_grounding_test(session, SN, the_date=None, operator="", passed=True, problems=False, comments=
|
|
142
|
+
def create_grounding_test(session, SN, the_date=None, operator="", passed=True, problems=False, comments=None):
|
|
125
143
|
"""Create grounding test.
|
|
126
144
|
|
|
127
145
|
Args:
|
|
@@ -134,10 +152,14 @@ def create_grounding_test(session, SN, the_date=None, operator="", passed=True,
|
|
|
134
152
|
comments: list of comments to append to the test
|
|
135
153
|
|
|
136
154
|
"""
|
|
155
|
+
if comments is None:
|
|
156
|
+
comments = []
|
|
137
157
|
the_date = ITkDButils.get_db_date(the_date)
|
|
138
158
|
out = ITkDButils.get_test_skeleton(session, "CORE_PETAL", "GROUNDING_CHECK", sk_defaults, {"boolean": False})
|
|
139
159
|
out['component'] = SN
|
|
140
160
|
out['date'] = the_date
|
|
161
|
+
out["institution"] = "AVS"
|
|
162
|
+
out["runNumber"] = "1"
|
|
141
163
|
out['passed'] = passed
|
|
142
164
|
out['problems'] = problems
|
|
143
165
|
out['properties']['OPERATOR'] = operator
|
|
@@ -146,7 +168,7 @@ def create_grounding_test(session, SN, the_date=None, operator="", passed=True,
|
|
|
146
168
|
return out
|
|
147
169
|
|
|
148
170
|
|
|
149
|
-
def create_metrology_test(session, SN, the_date=None, operator="", passed=True, problems=False, comments=
|
|
171
|
+
def create_metrology_test(session, SN, the_date=None, operator="", passed=True, problems=False, comments=None):
|
|
150
172
|
"""Metrology test.
|
|
151
173
|
|
|
152
174
|
Args:
|
|
@@ -159,12 +181,17 @@ def create_metrology_test(session, SN, the_date=None, operator="", passed=True,
|
|
|
159
181
|
comments: list of comments to append to the test
|
|
160
182
|
|
|
161
183
|
"""
|
|
184
|
+
if comments is None:
|
|
185
|
+
comments = []
|
|
186
|
+
|
|
162
187
|
the_date = ITkDButils.get_db_date(the_date)
|
|
163
188
|
out = ITkDButils.get_test_skeleton(session, "CORE_PETAL", "METROLOGY_AVS",
|
|
164
189
|
sk_defaults, {"integer": -1, "float": -1.0})
|
|
165
190
|
out['component'] = SN
|
|
166
191
|
out['date'] = the_date
|
|
167
192
|
out['passed'] = passed
|
|
193
|
+
out["institution"] = "AVS"
|
|
194
|
+
out["runNumber"] = "1"
|
|
168
195
|
out['problems'] = problems
|
|
169
196
|
out['properties']['OPERATOR'] = operator
|
|
170
197
|
out['comments'] = comments
|
|
@@ -210,6 +237,18 @@ def get_float(cell, separator=None, default=0.0):
|
|
|
210
237
|
if isinstance(txt, int):
|
|
211
238
|
return float(txt)
|
|
212
239
|
|
|
240
|
+
if isinstance(txt, str):
|
|
241
|
+
try:
|
|
242
|
+
txt = txt.replace(',', '.')
|
|
243
|
+
rr = re.findall(r"[-+]?[.]?[\d]+(?:,\d\d\d)*[\.]?\d*(?:[eE][-+]?\d+)?", txt)
|
|
244
|
+
if len(rr) == 0:
|
|
245
|
+
return default
|
|
246
|
+
|
|
247
|
+
val = float(rr[0])
|
|
248
|
+
return val
|
|
249
|
+
except ValueError:
|
|
250
|
+
return default
|
|
251
|
+
|
|
213
252
|
return default
|
|
214
253
|
|
|
215
254
|
else:
|
|
@@ -228,6 +267,13 @@ def get_float(cell, separator=None, default=0.0):
|
|
|
228
267
|
|
|
229
268
|
return values
|
|
230
269
|
|
|
270
|
+
def get_int(cell, default=None):
|
|
271
|
+
"""Get an int from a cell."""
|
|
272
|
+
value = cell.value
|
|
273
|
+
if value is None:
|
|
274
|
+
return default
|
|
275
|
+
|
|
276
|
+
return int(value)
|
|
231
277
|
|
|
232
278
|
def get_boolean(cell):
|
|
233
279
|
"""Get a boolean from a cell."""
|
|
@@ -237,7 +283,7 @@ def get_boolean(cell):
|
|
|
237
283
|
|
|
238
284
|
else:
|
|
239
285
|
txt = value.strip().lower()
|
|
240
|
-
return
|
|
286
|
+
return txt == "pass"
|
|
241
287
|
|
|
242
288
|
|
|
243
289
|
def get_text(cell):
|
|
@@ -251,14 +297,44 @@ def get_text(cell):
|
|
|
251
297
|
|
|
252
298
|
def get_res_and_accep(sheet, indx):
|
|
253
299
|
"""Return result and acceptancee."""
|
|
254
|
-
|
|
255
|
-
|
|
300
|
+
sval = sheet["g{}".format(indx)].value
|
|
301
|
+
if isinstance(sval, float) or isinstance(sval, int):
|
|
302
|
+
val = sval
|
|
303
|
+
|
|
304
|
+
else:
|
|
305
|
+
sval = ' '.join(sval.strip().split()).split()
|
|
306
|
+
|
|
307
|
+
scale = 1.0
|
|
308
|
+
try:
|
|
309
|
+
rr = re.findall(r"[-+]?[.]?[\d]+(?:,\d\d\d)*[\.]?\d*(?:[eE][-+]?\d+)?", sval[0])
|
|
310
|
+
if len(rr) == 0:
|
|
311
|
+
val = 0.0
|
|
312
|
+
else:
|
|
313
|
+
val = float(rr[0])
|
|
314
|
+
if len(sval)>1:
|
|
315
|
+
U = sval[1].upper()[0]
|
|
316
|
+
if U=='G':
|
|
317
|
+
scale = 1000
|
|
318
|
+
|
|
319
|
+
except ValueError:
|
|
320
|
+
val = 0
|
|
321
|
+
|
|
322
|
+
val = val * scale
|
|
323
|
+
#val = get_float(sheet["g{}".format(indx)])
|
|
324
|
+
pass_val = sheet["h{}".format(indx)]
|
|
325
|
+
if pass_val.value is None:
|
|
326
|
+
# Operator did not set the PASS/FAIL thing
|
|
327
|
+
accept = True
|
|
328
|
+
else:
|
|
329
|
+
accept = get_boolean(pass_val)
|
|
330
|
+
|
|
256
331
|
return val, accept
|
|
257
332
|
|
|
258
333
|
|
|
259
334
|
def find_idx(lst, val):
|
|
260
335
|
"""Return index of occurence of val in lst."""
|
|
261
|
-
|
|
336
|
+
R = re.compile(val, re.DOTALL|re.IGNORECASE)
|
|
337
|
+
idx = [i for i, x in enumerate(lst) if (x and R.search(x))]
|
|
262
338
|
return idx
|
|
263
339
|
|
|
264
340
|
|
|
@@ -269,9 +345,9 @@ def cell_value(sheet, coord):
|
|
|
269
345
|
return cell.value
|
|
270
346
|
|
|
271
347
|
# "Oh no, the cell is merged!"
|
|
272
|
-
for
|
|
273
|
-
if coord in
|
|
274
|
-
return
|
|
348
|
+
for cell_range in sheet.merged_cells.ranges:
|
|
349
|
+
if coord in cell_range:
|
|
350
|
+
return cell_range.start_cell.value
|
|
275
351
|
|
|
276
352
|
return None
|
|
277
353
|
|
|
@@ -290,12 +366,13 @@ def check_for_problems(sheet, the_test, row_range):
|
|
|
290
366
|
hdr = get_text(sheet["d{}".format(row)])
|
|
291
367
|
reason = cell_value(sheet, "i{}".format(row))
|
|
292
368
|
|
|
293
|
-
if
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
369
|
+
if reason:
|
|
370
|
+
if len(reason) < 20:
|
|
371
|
+
msg = "{}: {}".format(hdr, reason)
|
|
372
|
+
the_test["defects"].append({"name": msg})
|
|
373
|
+
else:
|
|
374
|
+
the_test["defects"].append({"name": hdr,
|
|
375
|
+
"description": reason})
|
|
299
376
|
|
|
300
377
|
if nfail:
|
|
301
378
|
the_test["passed"] = False
|
|
@@ -307,20 +384,20 @@ def get_coreID(bustapeID):
|
|
|
307
384
|
return SN
|
|
308
385
|
|
|
309
386
|
|
|
310
|
-
def readFATfile(session,
|
|
387
|
+
def readFATfile(session, file_path, SN=None):
|
|
311
388
|
"""Read data from FAT excel file.
|
|
312
389
|
|
|
313
390
|
Args:
|
|
314
391
|
session: the DB session
|
|
315
|
-
|
|
392
|
+
file_path: File path
|
|
316
393
|
SN: COre serial number
|
|
317
394
|
|
|
318
395
|
"""
|
|
319
396
|
# Open spreadsheet
|
|
320
397
|
try:
|
|
321
|
-
wb = XL.load_workbook(
|
|
398
|
+
wb = XL.load_workbook(file_path)
|
|
322
399
|
except InvalidFileException as ee:
|
|
323
|
-
print("Could not open input file: ",
|
|
400
|
+
print("Could not open input file: ", file_path)
|
|
324
401
|
print(ee)
|
|
325
402
|
return None
|
|
326
403
|
|
|
@@ -359,7 +436,7 @@ def readFATfile(session, fnam, SN=None):
|
|
|
359
436
|
# Visual inspection
|
|
360
437
|
vi_text = get_text(sheet['i9'])
|
|
361
438
|
vi_result = get_text(sheet['g9'])
|
|
362
|
-
vi_pass =
|
|
439
|
+
vi_pass = sheet['h9'].value.strip().lower() == "pass"
|
|
363
440
|
vi_defects = []
|
|
364
441
|
if vi_pass:
|
|
365
442
|
if vi_result and len(vi_result):
|
|
@@ -380,7 +457,7 @@ def readFATfile(session, fnam, SN=None):
|
|
|
380
457
|
# Delamination test
|
|
381
458
|
dl_text = get_text(sheet['i10'])
|
|
382
459
|
dl_result = get_text(sheet['g10'])
|
|
383
|
-
dl_pass =
|
|
460
|
+
dl_pass = sheet['h10'].value.strip().lower() == "pass"
|
|
384
461
|
dl_defects = []
|
|
385
462
|
if dl_pass:
|
|
386
463
|
if dl_result and len(dl_result):
|
|
@@ -413,10 +490,12 @@ def readFATfile(session, fnam, SN=None):
|
|
|
413
490
|
else:
|
|
414
491
|
loop_gnd_val, loop_gnd_pass = get_res_and_accep(sheet, tests.index("INS_FACE"))
|
|
415
492
|
|
|
493
|
+
passed = cond_pass and loop_pass and loop_gnd_pass
|
|
494
|
+
grounding_test["passed"] = passed
|
|
416
495
|
grounding_test["results"]["RESISTANCE_FB"] = cond_val
|
|
417
496
|
grounding_test["results"]["RESISTANCE_PIPES"] = loop_val
|
|
418
497
|
grounding_test["results"]["RESISTANCE_PIPE_GND"] = loop_gnd_val
|
|
419
|
-
check_for_problems(sheet, grounding_test, [tests.index('COND'), tests.index("WEIGH")])
|
|
498
|
+
#check_for_problems(sheet, grounding_test, [tests.index('COND'), tests.index("WEIGH")])
|
|
420
499
|
|
|
421
500
|
#
|
|
422
501
|
# Weight
|
|
@@ -440,12 +519,12 @@ def readFATfile(session, fnam, SN=None):
|
|
|
440
519
|
metrology_test["results"]["FIDUCIAL2_Y"] = get_float(sheet["g{}".format(find_idx(tests, "FD02_Y")[0])])
|
|
441
520
|
metrology_test["results"]["ANGLE_VCHANNEL"] = get_float(sheet["g{}".format(find_idx(tests, "VANGL")[0])])
|
|
442
521
|
metrology_test["results"]["ENVELOPE"] = get_float(sheet["g{}".format(find_idx(tests, "ENVEL")[0])])
|
|
443
|
-
metrology_test["results"]["COPLANARITY_FRONT"] = get_float(sheet["g{}".format(find_idx(tests, "F
|
|
444
|
-
metrology_test["results"]["LOCAL_FLATNESS_FRONT"] = get_float(sheet["g{}".format(find_idx(tests, "F
|
|
445
|
-
metrology_test["results"]["PARALLELISM_FRONT"] = get_float(sheet["g{}".format(find_idx(tests, "F
|
|
446
|
-
metrology_test["results"]["COPLANARITY_BACK"] = get_float(sheet["g{}".format(find_idx(tests, "B
|
|
447
|
-
metrology_test["results"]["LOCAL_FLATNESS_BACK"] = get_float(sheet["g{}".format(find_idx(tests, "B
|
|
448
|
-
metrology_test["results"]["PARALLELISM_BACK"] = get_float(sheet["g{}".format(find_idx(tests, "B
|
|
522
|
+
metrology_test["results"]["COPLANARITY_FRONT"] = get_float(sheet["g{}".format(find_idx(tests, "F.PL_PLAN")[0])])
|
|
523
|
+
metrology_test["results"]["LOCAL_FLATNESS_FRONT"] = get_float(sheet["g{}".format(find_idx(tests, "F.FS_PLAN")[0])], '/')
|
|
524
|
+
metrology_test["results"]["PARALLELISM_FRONT"] = get_float(sheet["g{}".format(find_idx(tests, "F.PARAL")[0])])
|
|
525
|
+
metrology_test["results"]["COPLANARITY_BACK"] = get_float(sheet["g{}".format(find_idx(tests, "B.PL_PLAN")[0])])
|
|
526
|
+
metrology_test["results"]["LOCAL_FLATNESS_BACK"] = get_float(sheet["g{}".format(find_idx(tests, "B.FS_PLAN")[0])], '/')
|
|
527
|
+
metrology_test["results"]["PARALLELISM_BACK"] = get_float(sheet["g{}".format(find_idx(tests, "B.PARAL")[0])])
|
|
449
528
|
|
|
450
529
|
# Get defects
|
|
451
530
|
check_for_problems(sheet, metrology_test, [tests.index("WEIGH")+1, sheet.max_row])
|
|
@@ -453,20 +532,43 @@ def readFATfile(session, fnam, SN=None):
|
|
|
453
532
|
return vi_test, delamination_test, grounding_test, metrology_test, batch, petal_weight
|
|
454
533
|
|
|
455
534
|
|
|
456
|
-
def
|
|
535
|
+
def find_label(sheet, label, column, max_row=20):
|
|
536
|
+
"""Find label in given column
|
|
537
|
+
|
|
538
|
+
Args:
|
|
539
|
+
sheet (): The spread sheet
|
|
540
|
+
label (): The label to search for
|
|
541
|
+
column (): The column to scan.
|
|
542
|
+
|
|
543
|
+
Return:
|
|
544
|
+
indx (int) - the index. <0 means not found.
|
|
545
|
+
"""
|
|
546
|
+
indx = -1
|
|
547
|
+
for i in range(1, 15):
|
|
548
|
+
val = sheet["{}{}".format(column, i)].value
|
|
549
|
+
if val is None:
|
|
550
|
+
continue
|
|
551
|
+
|
|
552
|
+
if val.find(label)>=0:
|
|
553
|
+
indx = i
|
|
554
|
+
break
|
|
555
|
+
|
|
556
|
+
return indx
|
|
557
|
+
|
|
558
|
+
def readProductionSheet(session, file_path, SN):
|
|
457
559
|
"""Read data fro AVS PS.
|
|
458
560
|
|
|
459
561
|
Args:
|
|
460
562
|
session: the DB session
|
|
461
|
-
|
|
563
|
+
file_path: path of input file
|
|
462
564
|
SN: The serial number
|
|
463
565
|
write_json: if true, test json is writen to file.
|
|
464
566
|
|
|
465
567
|
"""
|
|
466
568
|
try:
|
|
467
|
-
wb = XL.load_workbook(
|
|
569
|
+
wb = XL.load_workbook(file_path)
|
|
468
570
|
except InvalidFileException as ee:
|
|
469
|
-
print("Could not open input file: ",
|
|
571
|
+
print("Could not open input file: ", file_path)
|
|
470
572
|
print(ee.message)
|
|
471
573
|
return None
|
|
472
574
|
|
|
@@ -475,35 +577,64 @@ def readProductionSheet(session, fnam, SN):
|
|
|
475
577
|
if sheet.max_row > 30 or sheet.max_column > 8:
|
|
476
578
|
raise AVSDataException("Wrong PS file")
|
|
477
579
|
|
|
478
|
-
|
|
580
|
+
# Find the start
|
|
581
|
+
indx = find_label(sheet, "PETAL", "A")
|
|
582
|
+
if indx < 0:
|
|
583
|
+
# Try with second column
|
|
584
|
+
indx = find_label(sheet, "PETAL", "B")
|
|
585
|
+
if indx < 0:
|
|
586
|
+
print("Wrong Production Sheet.")
|
|
587
|
+
return None
|
|
588
|
+
else:
|
|
589
|
+
icol = ord('B')
|
|
590
|
+
ccol = 'B'
|
|
591
|
+
else:
|
|
592
|
+
icol = ord('A')
|
|
593
|
+
ccol = 'A'
|
|
594
|
+
|
|
595
|
+
i_items = find_label(sheet, "DRAWING", ccol)
|
|
596
|
+
if i_items < 0:
|
|
597
|
+
print("Wrong Production Sheet.")
|
|
598
|
+
return None
|
|
599
|
+
|
|
600
|
+
i_items += 1
|
|
601
|
+
|
|
602
|
+
# Get the SN of the fron facesheet and create the Petal SN
|
|
603
|
+
ID = sheet["{}{}".format(chr(icol+2), i_items)].value.strip()
|
|
479
604
|
SN = get_coreID(ID)
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
605
|
+
nn = get_int(sheet["{}{}".format(chr(icol+1), indx)])
|
|
606
|
+
petal_id = "PPC.{:03d}".format(nn)
|
|
607
|
+
mould_id = sheet["{}{}".format(chr(icol+1), indx+3)].value
|
|
608
|
+
|
|
609
|
+
# find the date (use the end date)
|
|
610
|
+
start_date = sheet["{}{}".format(chr(icol+4), indx+2)].value
|
|
611
|
+
end_date = sheet["{}{}".format(chr(icol+4), indx+3)].value
|
|
612
|
+
test_date = start_date
|
|
486
613
|
|
|
487
|
-
manager = sheet[
|
|
614
|
+
manager = sheet["{}{}".format(chr(icol+4), indx+1)].value
|
|
488
615
|
|
|
489
616
|
# Manufacturing
|
|
617
|
+
id_col = chr(icol+2)
|
|
618
|
+
w_col = chr(icol+3)
|
|
619
|
+
n_col = chr(icol+4)
|
|
490
620
|
comments = get_comments(sheet['a25'].value)
|
|
491
621
|
manufacturing = create_manufacturing(session, SN, test_date, manager, comments=comments)
|
|
492
|
-
manufacturing['properties']['START_DATE'] = ITkDButils.get_db_date(
|
|
493
|
-
manufacturing['properties']['FINISH_DATE'] = ITkDButils.get_db_date(
|
|
622
|
+
manufacturing['properties']['START_DATE'] = ITkDButils.get_db_date(start_date)
|
|
623
|
+
manufacturing['properties']['FINISH_DATE'] = ITkDButils.get_db_date(end_date)
|
|
494
624
|
manufacturing["properties"]["MOULD_ID"] = mould_id
|
|
495
|
-
manufacturing["properties"]["PROCESS_DOCUMENT"] = sheet[
|
|
496
|
-
manufacturing["results"]["LOCATOR_A"] = sheet[
|
|
497
|
-
manufacturing["results"]["LOCATOR_B"] = sheet[
|
|
498
|
-
manufacturing["results"]["LOCATOR_C"] = sheet[
|
|
499
|
-
manufacturing["results"]["HONEYCOMBSET"] = split_comp_list(sheet[
|
|
500
|
-
manufacturing["results"]["EPOXY_ADHESIVE"] = split_comp_list(sheet[
|
|
501
|
-
manufacturing["results"]["EPOXY_PUTTY"] = split_comp_list(sheet[
|
|
502
|
-
manufacturing["results"]["EPOXY_CONDUCTIVE"] = split_comp_list(sheet[
|
|
625
|
+
manufacturing["properties"]["PROCESS_DOCUMENT"] = sheet["{}{}".format(chr(icol+4), indx)].value
|
|
626
|
+
manufacturing["results"]["LOCATOR_A"] = sheet["{}{}".format(id_col, i_items+2)].value
|
|
627
|
+
manufacturing["results"]["LOCATOR_B"] = sheet["{}{}".format(id_col, i_items+3)].value
|
|
628
|
+
manufacturing["results"]["LOCATOR_C"] = sheet["{}{}".format(id_col, i_items+4)].value
|
|
629
|
+
manufacturing["results"]["HONEYCOMBSET"] = split_comp_list( sheet["{}{}".format(id_col, i_items+5)].value)
|
|
630
|
+
manufacturing["results"]["EPOXY_ADHESIVE"] = split_comp_list(sheet["{}{}".format(id_col, i_items+8)].value)
|
|
631
|
+
manufacturing["results"]["EPOXY_PUTTY"] = split_comp_list( sheet["{}{}".format(id_col, i_items+9)].value)
|
|
632
|
+
manufacturing["results"]["EPOXY_CONDUCTIVE"] = split_comp_list( sheet["{}{}".format(id_col, i_items+10)].value)
|
|
503
633
|
|
|
504
634
|
# Weighing
|
|
505
635
|
weighing = create_weight(session, SN, test_date, manager)
|
|
506
|
-
|
|
636
|
+
scol = "{}{}:{}{}".format(w_col, i_items, w_col, i_items+10)
|
|
637
|
+
comp_weight = [get_float(x[0]) for x in sheet[scol]]
|
|
507
638
|
petal_weight = sum([float(x) for x in comp_weight])
|
|
508
639
|
weighing["results"]["WEIGHT_FACING_FRONT"] = comp_weight[0]
|
|
509
640
|
weighing["results"]["WEIGHT_FACING_BACK"] = comp_weight[1]
|
|
@@ -518,23 +649,24 @@ def readProductionSheet(session, fnam, SN):
|
|
|
518
649
|
weighing["results"]["WEIGHT_CORE"] = petal_weight
|
|
519
650
|
|
|
520
651
|
# Comments
|
|
521
|
-
for i in range(
|
|
522
|
-
cell_id = sheet['
|
|
523
|
-
comment = sheet['
|
|
652
|
+
for i in range(i_items, i_items+11):
|
|
653
|
+
cell_id = sheet['{}{}'.format(ccol, i)].value
|
|
654
|
+
comment = sheet['{}{}'.format(n_col, i)].value
|
|
524
655
|
if comment is not None:
|
|
525
656
|
comment = comment.strip()
|
|
526
|
-
|
|
527
|
-
|
|
657
|
+
if len(comment):
|
|
658
|
+
msg = "{}: {}".format(cell_id, comment)
|
|
659
|
+
weighing["comments"].append(msg)
|
|
528
660
|
|
|
529
661
|
DESY = {
|
|
530
|
-
"FacingFront": sheet[
|
|
531
|
-
"FacingBack": sheet[
|
|
532
|
-
"CoolingLoop":
|
|
533
|
-
"AllcompSet": sheet[
|
|
662
|
+
"FacingFront": sheet["{}{}".format(id_col, i_items)].value.strip(),
|
|
663
|
+
"FacingBack": sheet["{}{}".format(id_col, i_items+1)].value.strip(),
|
|
664
|
+
"CoolingLoop": sheet["{}{}".format(id_col, i_items+6)].value.strip(),
|
|
665
|
+
"AllcompSet": sheet["{}{}".format(id_col, i_items+7)].value.strip(),
|
|
534
666
|
"HoneyCombSet": manufacturing["results"]["HONEYCOMBSET"]
|
|
535
667
|
}
|
|
536
668
|
|
|
537
|
-
return manufacturing, weighing, DESY
|
|
669
|
+
return manufacturing, weighing, DESY, petal_id
|
|
538
670
|
|
|
539
671
|
|
|
540
672
|
if __name__ == "__main__":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: itkdb_gtk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.10.0
|
|
4
4
|
Summary: A collection of Gtk based GUI to access ITkDB.
|
|
5
5
|
Author-email: Carlos Lacasta <carlos.lacasta@cern.ch>
|
|
6
6
|
Project-URL: Homepage, https://gitlab.cern.ch/atlas-itk/sw/db/itk-pdb-gtk-gui-utils
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
itkdb_gtk/CreateShipments.py,sha256=axTG72wA5GsFxgUOgcxOxBKqvP9OV-MrIJLUMkiP0bA,12851
|
|
2
|
+
itkdb_gtk/GetShipments.py,sha256=OzlocRzm1rOl_wnMiLfaK6JT1Zz__yQg9rSemht6zGc,18127
|
|
3
|
+
itkdb_gtk/GlueWeight.py,sha256=ifzb-epiflilvD6B41xMXptVWP9RdcAk8cwHindjvJg,12261
|
|
4
|
+
itkdb_gtk/ITkDB.desktop,sha256=v_K4mHsDxb912J1XGo6mOlbW2TkHvYNGrKmiOnsBQqM,172
|
|
5
|
+
itkdb_gtk/ITkDB.svg,sha256=Ry702zrUkxvG61SqThbUNfXySyiLMqalwYpcM-b_KWo,24242
|
|
6
|
+
itkdb_gtk/ITkDBlogin.py,sha256=ciBGBweCKHv31wcEP5DVfdioq_6BcdIs4FPUC0JNF5k,9916
|
|
7
|
+
itkdb_gtk/ITkDButils.py,sha256=n5Z-A004xvBpkmvZ7_EzQFmoD3TKhtszM2q-LXnreTY,15181
|
|
8
|
+
itkdb_gtk/PanelVisualInspection.py,sha256=WMTYeVUEnSwwkSsQA5afwAYYSwtiJAdbD6LLx0Jx4eA,7087
|
|
9
|
+
itkdb_gtk/PetalReceptionTests.py,sha256=-vnvkE2cvjQCdLvLBF4I22u8WxcGHBCl1jRQuNWCpp8,9278
|
|
10
|
+
itkdb_gtk/SensorUtils.py,sha256=S2Mc-Z1webACisj6waJcMqiqzoGSE7TYScVfxHSD700,15458
|
|
11
|
+
itkdb_gtk/ShowAttachments.py,sha256=Cbvb_N4AxVv5nb8vQLZ4arYRy_06W3Lw9pScOLVo8W4,8407
|
|
12
|
+
itkdb_gtk/ShowComments.py,sha256=e5ywWuK-reFt5bCJ9gqyQdImN8Fue_ch4eWnfjXH3lw,3154
|
|
13
|
+
itkdb_gtk/ShowDefects.py,sha256=tVT5wNe9XI80wnWwUXnKQLHIibgtC8d6C4B4tCDrfJ4,3533
|
|
14
|
+
itkdb_gtk/UploadModuleIV.py,sha256=L5hndmkRf6cho5ZaBVLaczbPm5DzkmLKwI3IpirVv5U,17749
|
|
15
|
+
itkdb_gtk/UploadMultipleTests.py,sha256=PK0G1eWNYQP56WM2GN6-lmLUuS8TARW1pylo1jZweKs,22142
|
|
16
|
+
itkdb_gtk/UploadPetalInformation.py,sha256=Y0WsFJJuxkhr_Z2htMDew5juQnpZmA_13pKaM6ECbDo,24749
|
|
17
|
+
itkdb_gtk/UploadTest.py,sha256=aZ6ARLlMpJse5okBcyGXMgt6KU4jOv00vplrJxcrrXI,16645
|
|
18
|
+
itkdb_gtk/WireBondGui.py,sha256=RM5TrQ3Xvcu18W8DuQJ8oBavau0O7XZOQqExhnoHWCE,25761
|
|
19
|
+
itkdb_gtk/__init__.py,sha256=4QvKCP7L09bx0K2D6lkq3fqXrAwKj53tbRlNKvTqQRw,1151
|
|
20
|
+
itkdb_gtk/dashBoard.py,sha256=Zsood9ObGJUsr-DOa6QvPkqhoskOVjiMtyHYlREn8mM,6536
|
|
21
|
+
itkdb_gtk/dbGtkUtils.py,sha256=i9IUZHiL31LQCmgNMP4SYbYDRi6fOx_H7tS18RaNeJI,27820
|
|
22
|
+
itkdb_gtk/readAVSdata.py,sha256=WlYYzlrTBD0LeKyM_sLP7jW6-38Y1b9-_QpPw8n1sU0,23442
|
|
23
|
+
itkdb_gtk/readGoogleSheet.py,sha256=Lzm_oPWwDqZZzKoBUgsp277F9-wCfr_BA0X4VD2Eolo,2673
|
|
24
|
+
itkdb_gtk/untrash_component.py,sha256=VrN46-f-kF7voOxtoh7OL-bZSWAaIFb7-Xbx6_WT7K8,757
|
|
25
|
+
itkdb_gtk-0.10.0.dist-info/METADATA,sha256=YaOpu9jAXMO1aTsAK7G0gkqz30iYtFshYvCMyjUrjZg,3150
|
|
26
|
+
itkdb_gtk-0.10.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
27
|
+
itkdb_gtk-0.10.0.dist-info/entry_points.txt,sha256=p7hiZPp4EPyRNzRdu6NqYlDmfflZGGDiDjIJGOcwfig,445
|
|
28
|
+
itkdb_gtk-0.10.0.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
|
|
29
|
+
itkdb_gtk-0.10.0.dist-info/RECORD,,
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
createShipments = itkdb_gtk:createShipments
|
|
3
3
|
getShipments = itkdb_gtk:getShipments
|
|
4
4
|
glueWeight = itkdb_gtk:glueWeight
|
|
5
|
-
groundVITests = itkdb_gtk:groundVITests
|
|
6
|
-
iploadPetalInformation = itkdb_gtk:uploadPetalInformation
|
|
7
5
|
itkdb_dashBoard = itkdb_gtk:dash_board
|
|
6
|
+
petalReceptionTests = itkdb_gtk:petalReceptionTests
|
|
8
7
|
uploadModuleIV = itkdb_gtk:uploadModuleIV
|
|
9
8
|
uploadMultipleTests = itkdb_gtk:uploadMultipleTests
|
|
9
|
+
uploadPetalInformation = itkdb_gtk:uploadPetalInformation
|
|
10
10
|
uploadTest = itkdb_gtk:uploadTest
|
|
11
11
|
wirebondTest = itkdb_gtk:wirebondTest
|
itkdb_gtk-0.9.0.dist-info/RECORD
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
itkdb_gtk/CreateShipments.py,sha256=-XG3ayobzVW2pg0hV7cMHTyCjakQOoDTxbCC1YIU43c,13159
|
|
2
|
-
itkdb_gtk/GetShipments.py,sha256=T70xpg1NiZOcPuQbdvSEwht4eLFMmqWHFaq3Ls8NKuI,18739
|
|
3
|
-
itkdb_gtk/GlueWeight.py,sha256=fp5J54frYdZzje0LJ9y1Q22Dscvg5cXBAXbL8CJMUiQ,12247
|
|
4
|
-
itkdb_gtk/GroundVITests.py,sha256=jeIGUHJu3Lul5YcaOOYP_7qwwM738ugpY-Bu_RUfGy0,9214
|
|
5
|
-
itkdb_gtk/ITkDB.desktop,sha256=v_K4mHsDxb912J1XGo6mOlbW2TkHvYNGrKmiOnsBQqM,172
|
|
6
|
-
itkdb_gtk/ITkDB.svg,sha256=Ry702zrUkxvG61SqThbUNfXySyiLMqalwYpcM-b_KWo,24242
|
|
7
|
-
itkdb_gtk/ITkDBlogin.py,sha256=ciBGBweCKHv31wcEP5DVfdioq_6BcdIs4FPUC0JNF5k,9916
|
|
8
|
-
itkdb_gtk/ITkDButils.py,sha256=pvLmfhh6g7ulpEfWVbboYBjD4S3qUXSZongG3SWlqAY,14862
|
|
9
|
-
itkdb_gtk/ShowAttachments.py,sha256=Cbvb_N4AxVv5nb8vQLZ4arYRy_06W3Lw9pScOLVo8W4,8407
|
|
10
|
-
itkdb_gtk/ShowComments.py,sha256=e5ywWuK-reFt5bCJ9gqyQdImN8Fue_ch4eWnfjXH3lw,3154
|
|
11
|
-
itkdb_gtk/ShowDefects.py,sha256=tVT5wNe9XI80wnWwUXnKQLHIibgtC8d6C4B4tCDrfJ4,3533
|
|
12
|
-
itkdb_gtk/UploadModuleIV.py,sha256=EhUaLze9DLFFKSPclXgCPhxOAL6Cezz3N4xvpnZrc4U,28135
|
|
13
|
-
itkdb_gtk/UploadMultipleTests.py,sha256=qvIJzSD7yrIatkOO2_0YrPnL6nPedXtaVoK28H0F18w,22120
|
|
14
|
-
itkdb_gtk/UploadPetalInformation.py,sha256=D2Hq-Kesz9vU3fMi7yDuHNUONMRbpVCyxJ1s_81bI-o,22194
|
|
15
|
-
itkdb_gtk/UploadTest.py,sha256=wVLZ86fo5Kw1sT7vWjttIVkCNFvPiUcgKhfG3zXw7-Y,16511
|
|
16
|
-
itkdb_gtk/WireBondGui.py,sha256=RM5TrQ3Xvcu18W8DuQJ8oBavau0O7XZOQqExhnoHWCE,25761
|
|
17
|
-
itkdb_gtk/__init__.py,sha256=_oyuRq0I6WwU15w1bGm7FppXd4fGM5V9H33jemzTbkw,1106
|
|
18
|
-
itkdb_gtk/dashBoard.py,sha256=Ahkfkh8fQnAE8gEv24jElDWWJuMqq5-r-ppynbMPm08,6321
|
|
19
|
-
itkdb_gtk/dbGtkUtils.py,sha256=vzmYjrmmoRAerELpyWG8XEpjZ5y3L4Oy_or9x70imnQ,25071
|
|
20
|
-
itkdb_gtk/readAVSdata.py,sha256=XJmLpemvOj1B81Jzr-WHZJw4UQphb8LwmZXD82qTWu4,19394
|
|
21
|
-
itkdb_gtk/readGoogleSheet.py,sha256=Lzm_oPWwDqZZzKoBUgsp277F9-wCfr_BA0X4VD2Eolo,2673
|
|
22
|
-
itkdb_gtk/untrash_component.py,sha256=VrN46-f-kF7voOxtoh7OL-bZSWAaIFb7-Xbx6_WT7K8,757
|
|
23
|
-
itkdb_gtk-0.9.0.dist-info/METADATA,sha256=syyqetk9udFKkFEeP5SRb5lGd8Hu8aUwkd8N1KM2h_A,3149
|
|
24
|
-
itkdb_gtk-0.9.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
25
|
-
itkdb_gtk-0.9.0.dist-info/entry_points.txt,sha256=wrcKQkzsIeLscwbSkO7ua2unUWeCnk4z6lu-OhBpMCo,433
|
|
26
|
-
itkdb_gtk-0.9.0.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
|
|
27
|
-
itkdb_gtk-0.9.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|