itkdb-gtk 0.0.3__py3-none-any.whl → 0.20.1__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.
Files changed (37) hide show
  1. itkdb_gtk/{sendShipments.py → CreateShipments.py} +74 -78
  2. itkdb_gtk/{getShipments.py → GetShipments.py} +99 -106
  3. itkdb_gtk/GlueWeight.py +45 -66
  4. itkdb_gtk/ITkDB.desktop +8 -0
  5. itkdb_gtk/ITkDB.svg +380 -0
  6. itkdb_gtk/ITkDBlogin.py +10 -6
  7. itkdb_gtk/ITkDButils.py +295 -57
  8. itkdb_gtk/PanelVisualInspection.py +590 -0
  9. itkdb_gtk/QRScanner.py +120 -0
  10. itkdb_gtk/SensorUtils.py +492 -0
  11. itkdb_gtk/ShowAttachments.py +267 -0
  12. itkdb_gtk/ShowComments.py +94 -0
  13. itkdb_gtk/ShowDefects.py +103 -0
  14. itkdb_gtk/UploadModuleIV.py +566 -0
  15. itkdb_gtk/UploadMultipleTests.py +746 -0
  16. itkdb_gtk/UploadTest.py +509 -0
  17. itkdb_gtk/VisualInspection.py +297 -0
  18. itkdb_gtk/WireBondGui.py +1304 -0
  19. itkdb_gtk/__init__.py +38 -12
  20. itkdb_gtk/dashBoard.py +292 -33
  21. itkdb_gtk/dbGtkUtils.py +356 -75
  22. itkdb_gtk/findComponent.py +242 -0
  23. itkdb_gtk/findVTRx.py +36 -0
  24. itkdb_gtk/readGoogleSheet.py +1 -2
  25. itkdb_gtk/untrash_component.py +35 -0
  26. {itkdb_gtk-0.0.3.dist-info → itkdb_gtk-0.20.1.dist-info}/METADATA +21 -12
  27. itkdb_gtk-0.20.1.dist-info/RECORD +30 -0
  28. {itkdb_gtk-0.0.3.dist-info → itkdb_gtk-0.20.1.dist-info}/WHEEL +1 -1
  29. itkdb_gtk-0.20.1.dist-info/entry_points.txt +12 -0
  30. itkdb_gtk/checkComponent.py +0 -131
  31. itkdb_gtk/groundingTest.py +0 -225
  32. itkdb_gtk/readAVSdata.py +0 -565
  33. itkdb_gtk/uploadPetalInformation.py +0 -604
  34. itkdb_gtk/uploadTest.py +0 -384
  35. itkdb_gtk-0.0.3.dist-info/RECORD +0 -19
  36. itkdb_gtk-0.0.3.dist-info/entry_points.txt +0 -7
  37. {itkdb_gtk-0.0.3.dist-info → itkdb_gtk-0.20.1.dist-info}/top_level.txt +0 -0
itkdb_gtk/__init__.py CHANGED
@@ -1,14 +1,17 @@
1
- from . import dashBoard
1
+ """ itkdb-gtk python module
2
+ """
3
+ __version__ = "0.20.1"
2
4
 
3
5
 
4
6
  def dash_board():
5
7
  """Launches the dash board."""
8
+ from .dashBoard import main
6
9
  dashBoard.main()
7
10
 
8
11
 
9
12
  def getShipments():
10
13
  """getShipments."""
11
- from .getShipments import main
14
+ from .GetShipments import main
12
15
  main()
13
16
 
14
17
 
@@ -17,20 +20,43 @@ def glueWeight():
17
20
  from .GlueWeight import main
18
21
  main()
19
22
 
23
+ def createShipments():
24
+ """Send items."""
25
+ from .CreateShipments import main
26
+ main()
20
27
 
21
- def groundingTest():
22
- """GND/VI tests."""
23
- from .groundingTest import main
28
+ def uploadTest():
29
+ """Upload a single tests."""
30
+ from .UploadTest import main
24
31
  main()
25
32
 
26
33
 
27
- def sendShipments():
28
- """Send items."""
29
- from .sendShipments import main
34
+ def uploadMultipleTests():
35
+ """Upload multiple tests."""
36
+ from .UploadMultipleTests import main
30
37
  main()
31
38
 
39
+ def uploadModuleIV():
40
+ """Upload IV files of single and double modules"""
41
+ from .UploadModuleIV import main
42
+ main()
32
43
 
33
- def uploadTest():
34
- """Upload tests."""
35
- from .uploadTest import main
36
- main()
44
+ def wirebondTest():
45
+ """Inputs data and eventually upload wirebod test."""
46
+ from .WireBondGui import main
47
+ main()
48
+
49
+ def panelVisualInspection():
50
+ """Visual inspection of PWB or HYB panels."""
51
+ from .PanelVisualInspection import main
52
+ main()
53
+
54
+ def visualInspection():
55
+ """Visual inspection of Modules/Sensors."""
56
+ from .VisualInspection import main
57
+ main()
58
+
59
+ def findDBComponent():
60
+ """Find object from QR or bar code"""
61
+ from .findComponent import main
62
+ main()
itkdb_gtk/dashBoard.py CHANGED
@@ -3,38 +3,77 @@
3
3
  import sys
4
4
 
5
5
  try:
6
- import dbGtkUtils
7
- import getShipments
8
- import groundingTest
9
- import ITkDBlogin
10
- import sendShipments
11
- import uploadTest
12
- import GlueWeight
6
+ import itkdb_gtk
7
+
8
+ except ImportError:
9
+ from pathlib import Path
10
+ cwd = Path(__file__).parent.parent
11
+ sys.path.append(cwd.as_posix())
12
+
13
+
14
+ from itkdb_gtk import dbGtkUtils
15
+ from itkdb_gtk import GetShipments
16
+ from itkdb_gtk import ITkDBlogin
17
+ from itkdb_gtk import CreateShipments
18
+ from itkdb_gtk import UploadTest
19
+ from itkdb_gtk import UploadMultipleTests
20
+ from itkdb_gtk import GlueWeight
21
+ from itkdb_gtk import UploadModuleIV
22
+ from itkdb_gtk import WireBondGui
23
+ from itkdb_gtk import PanelVisualInspection
24
+ from itkdb_gtk import VisualInspection
25
+ from itkdb_gtk import findComponent
26
+
27
+
28
+ HAS_PETALQC=False
29
+ try:
30
+ from petal_qc.metrology.coreMetrology import CoreMetrology, CoreMetrologyOptions
31
+ from petal_qc.thermal.coreThermal import CoreThermal
32
+ from petal_qc.thermal.IRPetalParam import IRPetalParam
33
+ from petal_qc.metrology.uploadPetalInformation import AVSPanel, AVSOptions
34
+ from petal_qc import PetalReceptionTests
35
+
36
+ HAS_PETALQC = True
37
+ except ImportError as E:
38
+ HAS_PETALQC = False
13
39
 
14
- except Exception:
15
- from itkdb_gtk import dbGtkUtils, getShipments, groundingTest, ITkDBlogin, sendShipments, uploadTest, GlueWeight
16
40
 
17
41
  import gi
18
42
 
19
43
  gi.require_version("Gtk", "3.0")
20
44
  from gi.repository import Gtk
21
45
 
46
+ HELP_LINK="https://itkdb-gtk.docs.cern.ch"
22
47
 
23
48
  class DashWindow(dbGtkUtils.ITkDBWindow):
24
49
  """Dashboard class."""
50
+ UPLOAD_TEST = 1
51
+ UPLOAD_MANY_TESTS = 2
52
+ CREATE_SHIPMNT = 3
53
+ RECV_SHIPMNT = 4
54
+ PETAL_RECEPTION = 5
55
+ GLUE_WEIGHT = 6
56
+ MOD_IV = 7
57
+ WIRE_BOND = 8
58
+ PANEL_VI = 9
59
+ MODULE_VI = 10
60
+ PETAL_CORE_METRO = 11
61
+ PETAL_CORE_THERMAL = 12
62
+ PETAL_INFORMATION = 13
63
+ FIND_COMPONENT = 14
25
64
 
26
65
  def __init__(self, session):
27
66
  """Initialization."""
28
- super().__init__(title="ITkDB Dashboard", session=session)
67
+ super().__init__(title="ITkDB Dashboard", session=session, help_link=HELP_LINK)
29
68
  self.mask = 0
30
69
 
31
70
  # set border width
32
71
  self.set_border_width(10)
33
72
 
34
73
  # Prepare dashboard
35
- lbl = Gtk.Label()
36
- lbl.set_markup("<big><b>ITkDB available commands.</b></big>")
37
- self.mainBox.pack_start(lbl, True, True, 0)
74
+ #lbl = Gtk.Label()
75
+ #lbl.set_markup("<big><b>ITkDB available commands.</b></big>")
76
+ #self.mainBox.pack_start(lbl, True, True, 0)
38
77
 
39
78
  grid = Gtk.Grid(column_spacing=5, row_spacing=5)
40
79
  self.mainBox.pack_start(grid, False, True, 5)
@@ -46,19 +85,67 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
46
85
  grid.attach(lbl, 0, irow, 1, 1)
47
86
 
48
87
  irow += 1
49
- btnTest = Gtk.Button(label="Upload Test (json)")
88
+ btnTest = Gtk.Button(label="Upload Single Test")
50
89
  btnTest.connect("clicked", self.upload_test)
51
90
  grid.attach(btnTest, 0, irow, 1, 1)
52
91
 
53
- btnGnd = Gtk.Button(label="Petal VI/GND")
54
- btnGnd.connect("clicked", self.petal_gnd)
55
- grid.attach(btnGnd, 1, irow, 1, 1)
92
+ btnTest = Gtk.Button(label="Upload Multiple Tests")
93
+ btnTest.connect("clicked", self.upload_multiple_tests)
94
+ grid.attach(btnTest, 1, irow, 1, 1)
95
+
96
+ irow +=1
97
+ separator = Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL)
98
+ grid.attach(separator, 0, irow, 2, 1)
99
+
100
+ irow += 1
101
+ btnModVI = Gtk.Button(label="Module/Sensor Visual Insp.")
102
+ btnModVI.connect("clicked", self.module_VI)
103
+ grid.attach(btnModVI, 0, irow, 1, 1)
104
+
105
+
106
+ btnPanelVI = Gtk.Button(label="Panel Visual Insp.")
107
+ btnPanelVI.connect("clicked", self.panel_VI)
108
+ grid.attach(btnPanelVI, 1, irow, 1, 1)
109
+
110
+ irow += 1
111
+ btnModIV = Gtk.Button(label="Sensor/Module IV")
112
+ btnModIV.connect("clicked", self.module_IV)
113
+ grid.attach(btnModIV, 0, irow, 1, 1)
114
+
115
+ btnWireBond = Gtk.Button(label="Wire Bond")
116
+ btnWireBond.connect("clicked", self.wire_bond)
117
+ grid.attach(btnWireBond, 1, irow, 1, 1)
56
118
 
57
119
  irow += 1
58
120
  btnWeight = Gtk.Button(label="GlueWeight")
59
121
  btnWeight.connect("clicked", self.glue_weight)
60
122
  grid.attach(btnWeight, 0, irow, 1, 1)
61
123
 
124
+
125
+
126
+ if HAS_PETALQC:
127
+ irow +=1
128
+ separator = Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL)
129
+ grid.attach(separator, 0, irow, 2, 1)
130
+
131
+ irow +=1
132
+ btnPetalInfo = Gtk.Button(label="AVS Petal Info")
133
+ btnPetalInfo.connect("clicked", self.upload_petal_info)
134
+ grid.attach(btnPetalInfo, 0, irow, 1, 1)
135
+
136
+ btnGnd = Gtk.Button(label="Petal Reception")
137
+ btnGnd.connect("clicked", self.petal_reception)
138
+ grid.attach(btnGnd, 1, irow, 1, 1)
139
+
140
+ irow +=1
141
+ btnPetalMetrology = Gtk.Button(label="Petal Core Metrology")
142
+ btnPetalMetrology.connect("clicked", self.petal_metrology)
143
+ grid.attach(btnPetalMetrology, 0, irow, 1, 1)
144
+
145
+ btnPetalThermal = Gtk.Button(label="Petal Core Thermal")
146
+ btnPetalThermal.connect("clicked", self.petal_thermal)
147
+ grid.attach(btnPetalThermal, 1, irow, 1, 1)
148
+
62
149
  irow += 1
63
150
  grid.attach(Gtk.Label(), 0, irow, 1, 1)
64
151
 
@@ -77,74 +164,246 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
77
164
  recS.connect("clicked", self.receive_shipment)
78
165
  grid.attach(recS, 1, irow, 1, 1,)
79
166
 
167
+ irow += 1
168
+ lbl = Gtk.Label()
169
+ lbl.set_markup("<b>Utils</b>")
170
+ lbl.set_xalign(0)
171
+ grid.attach(lbl, 0, irow, 1, 1)
172
+
173
+ irow += 1
174
+ findC = Gtk.Button(label="Find Component")
175
+ findC.connect("clicked", self.find_component)
176
+ findC.set_tooltip_text("Scan your QR or bar code and get info from DB.")
177
+ grid.attach(findC, 0, irow, 1, 1,)
178
+
179
+
80
180
  self.mainBox.pack_start(Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL), False, True, 5)
81
181
 
82
182
  self.show_all()
83
183
 
84
-
85
184
  def upload_test(self, *args):
86
185
  """Launch upload test."""
87
- bitn = 1
186
+ bitn = DashWindow.UPLOAD_TEST
88
187
  bt = 1 << bitn
89
188
  if self.mask & bt:
90
189
  return
91
190
 
92
191
  self.mask |= bt
93
- W = uploadTest.UploadTest(self.session)
192
+ W = UploadTest.UploadTest(
193
+ self.session,
194
+ help_link="{}/uploadSingleTest.html".format(HELP_LINK)
195
+ )
196
+ W.connect("destroy", self.app_closed, bitn)
197
+
198
+ def upload_multiple_tests(self, *args):
199
+ """Launch upload multiple test."""
200
+ bitn = DashWindow.UPLOAD_MANY_TESTS
201
+ bt = 1 << bitn
202
+ if self.mask & bt:
203
+ return
204
+
205
+ self.mask |= bt
206
+ W = UploadMultipleTests.UploadMultipleTests(
207
+ self.session,
208
+ help_link="{}/uploadMultipleTests.html".format(HELP_LINK)
209
+ )
94
210
  W.connect("destroy", self.app_closed, bitn)
95
211
 
96
212
  def create_shipment(self, *args):
97
- """Launch sendShipment."""
98
- bitn = 2
213
+ """Launch createShipment."""
214
+ bitn = DashWindow.CREATE_SHIPMNT
99
215
  bt = 1 << bitn
100
216
  if self.mask & bt:
101
217
  return
102
218
 
103
219
  self.mask |= bt
104
- W = sendShipments.SendShipments(self.session)
220
+ W = CreateShipments.CreateShipments(
221
+ self.session,
222
+ help_link="{}/createShipment.html".format(HELP_LINK)
223
+ )
105
224
  W.connect("destroy", self.app_closed, bitn)
106
225
 
107
226
  def receive_shipment(self, *args):
108
227
  """Launch getShipments."""
109
- bitn = 3
228
+ bitn = DashWindow.RECV_SHIPMNT
110
229
  bt = 1 << bitn
111
230
  if self.mask & bt:
112
231
  return
113
232
 
114
233
  self.mask |= bt
115
- W = getShipments.ReceiveShipments(self.session)
234
+ W = GetShipments.ReceiveShipments(
235
+ self.session,
236
+ help_link="{}/receiveShipments.html".format(HELP_LINK)
237
+ )
116
238
  W.connect("destroy", self.app_closed, bitn)
117
239
 
118
- def petal_gnd(self, *args):
240
+
241
+ def glue_weight(self, *args):
242
+ """Glue Weight test."""
243
+ bitn = DashWindow.GLUE_WEIGHT
244
+ bt = 1 << bitn
245
+ if self.mask & bt:
246
+ return
247
+
248
+ self.mask |= bt
249
+ W = GlueWeight.GlueWeight(self.session, help_link=HELP_LINK)
250
+ W.connect("destroy", self.app_closed, bitn)
251
+
252
+ def module_IV(self, *args):
253
+ """Module IV tests."""
254
+ bitn = DashWindow.MOD_IV
255
+ bt = 1 << bitn
256
+ if self.mask & bt:
257
+ return
258
+
259
+ self.mask |= bt
260
+ W = UploadModuleIV.IVwindow(
261
+ self.session,
262
+ help_link="{}/uploadModuleIV.html".format(HELP_LINK)
263
+ )
264
+ W.connect("destroy", self.app_closed, bitn)
265
+
266
+ def wire_bond(self, *args):
267
+ """Module IV tests."""
268
+ bitn = DashWindow.WIRE_BOND
269
+ bt = 1 << bitn
270
+ if self.mask & bt:
271
+ return
272
+
273
+ self.mask |= bt
274
+ W = WireBondGui.WireBond(
275
+ session=self.session,
276
+ title="Wirebond",
277
+ help_link="{}//wirebondTest.html".format(HELP_LINK),
278
+ )
279
+ W.connect("destroy", self.app_closed, bitn)
280
+ W.show_all()
281
+
282
+ def panel_VI(self, *args):
283
+ """Panel VI tests."""
284
+ bitn = DashWindow.PANEL_VI
285
+ bt = 1 << bitn
286
+ if self.mask & bt:
287
+ return
288
+
289
+ self.mask |= bt
290
+ W = PanelVisualInspection.PanelVisualInspection(
291
+ session=self.session,
292
+ title="Panel Visual Inspection",
293
+ help_link="{}/panelVisualInspection.html".format(HELP_LINK),
294
+ )
295
+ W.connect("destroy", self.app_closed, bitn)
296
+ W.show_all()
297
+
298
+ def module_VI(self, *args):
299
+ """Panel VI tests."""
300
+ bitn = DashWindow.MODULE_VI
301
+ bt = 1 << bitn
302
+ if self.mask & bt:
303
+ return
304
+
305
+ self.mask |= bt
306
+ W = VisualInspection.ModuleVisualInspection(
307
+ session=self.session,
308
+ title="Module/Sensor Visual Inspection",
309
+ help_link="{}/moduleVisualInspection.html".format(HELP_LINK),
310
+ )
311
+ W.connect("destroy", self.app_closed, bitn)
312
+ W.show_all()
313
+
314
+
315
+ def find_component(self, *args):
316
+ """Find Component."""
317
+ bitn = DashWindow.FIND_COMPONENT
318
+ bt = 1 << bitn
319
+ if self.mask & bt:
320
+ return
321
+
322
+ W = findComponent.FindComponent(
323
+ self.session,
324
+ help_link="{}/findComponent.html".format(HELP_LINK)
325
+ )
326
+
327
+ W.connect("destroy", self.app_closed, bitn)
328
+
329
+ def petal_reception(self, *args):
119
330
  """Petal GND/VI test."""
120
- bitn = 4
331
+ bitn = DashWindow.PETAL_RECEPTION
121
332
  bt = 1 << bitn
122
333
  if self.mask & bt:
123
334
  return
124
335
 
125
336
  self.mask |= bt
126
- W = groundingTest.GroundingTest(self.session)
337
+ W = PetalReceptionTests.PetalReceptionTests(
338
+ self.session,
339
+ help_link="{}/petalReceptionTests.html".format(HELP_LINK)
340
+ )
127
341
  W.connect("destroy", self.app_closed, bitn)
128
342
 
129
- def glue_weight(self, *args):
130
- """Glue Weight test."""
131
- bitn = 5
343
+
344
+ def upload_petal_info(self, *srgs):
345
+ """Upload petal Info."""
346
+ if not HAS_PETALQC:
347
+ return
348
+
349
+ bitn = DashWindow.PETAL_INFORMATION
350
+ bt = 1 << bitn
351
+ if self.mask & bt:
352
+ return
353
+
354
+ self.mask |= bt
355
+ W = AVSPanel(self.session, AVSOptions())
356
+ W.connect("destroy", self.app_closed, bitn)
357
+ W.show_all()
358
+
359
+ def petal_metrology(self, *args):
360
+ """Do petal metrology"""
361
+ if not HAS_PETALQC:
362
+ return
363
+
364
+ bitn = DashWindow.PETAL_CORE_METRO
365
+ bt = 1 << bitn
366
+ if self.mask & bt:
367
+ return
368
+
369
+ self.mask |= bt
370
+ opts = CoreMetrologyOptions()
371
+ W = CoreMetrology(opts, session=self.session, title="Petal Core Metrology")
372
+ W.connect("destroy", self.app_closed, bitn)
373
+ W.show_all()
374
+
375
+ def petal_thermal(self, *args):
376
+ """Do petal thermal."""
377
+ if not HAS_PETALQC:
378
+ return
379
+
380
+ bitn = DashWindow.PETAL_CORE_THERMAL
132
381
  bt = 1 << bitn
133
382
  if self.mask & bt:
134
383
  return
135
384
 
136
385
  self.mask |= bt
137
- W = GlueWeight.GlueWeight(self.session)
386
+ opt = IRPetalParam()
387
+ opt.files = []
388
+ opt.golden = None
389
+ opt.folder = None
390
+ opt.out = None
391
+ opt.alias = None
392
+ opt.SN = None
393
+ opt.desy = False
394
+ W = CoreThermal(opt, self.session, title="Petal Thermal Test.")
138
395
  W.connect("destroy", self.app_closed, bitn)
396
+ W.show_all()
139
397
 
140
398
  def app_closed(self, *args):
141
399
  """Application window closed. Clear mask."""
142
400
  bt = 1 << args[1]
143
401
  self.mask &= ~bt
144
- print(bt, self.mask)
402
+ # print(bt, self.mask)
145
403
 
146
404
 
147
405
  def main():
406
+ """main entry."""
148
407
  # DB login
149
408
  dlg = ITkDBlogin.ITkDBlogin()
150
409
  client = dlg.get_client()