itkdb-gtk 0.10.0.dev2__tar.gz → 0.10.2__tar.gz

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.

Files changed (37) hide show
  1. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/PKG-INFO +1 -1
  2. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/GetShipments.py +1 -1
  3. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/UploadTest.py +5 -5
  4. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/WireBondGui.py +87 -45
  5. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/__init__.py +1 -1
  6. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/dashBoard.py +36 -2
  7. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk.egg-info/PKG-INFO +1 -1
  8. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/pyproject.toml +1 -1
  9. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/README.md +0 -0
  10. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/CreateShipments.py +0 -0
  11. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/GlueWeight.py +0 -0
  12. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/ITkDB.desktop +0 -0
  13. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/ITkDB.svg +0 -0
  14. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/ITkDBlogin.py +0 -0
  15. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/ITkDButils.py +0 -0
  16. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/PanelVisualInspection.py +0 -0
  17. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/PetalReceptionTests.py +0 -0
  18. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/SensorUtils.py +0 -0
  19. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/ShowAttachments.py +0 -0
  20. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/ShowComments.py +0 -0
  21. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/ShowDefects.py +0 -0
  22. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/UploadModuleIV.py +0 -0
  23. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/UploadMultipleTests.py +0 -0
  24. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/UploadPetalInformation.py +0 -0
  25. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/dbGtkUtils.py +0 -0
  26. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/readAVSdata.py +0 -0
  27. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/readGoogleSheet.py +0 -0
  28. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk/untrash_component.py +0 -0
  29. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk.egg-info/SOURCES.txt +0 -0
  30. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk.egg-info/dependency_links.txt +0 -0
  31. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk.egg-info/entry_points.txt +0 -0
  32. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk.egg-info/requires.txt +0 -0
  33. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/itkdb_gtk.egg-info/top_level.txt +0 -0
  34. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/setup.cfg +0 -0
  35. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/test/testAnimated.py +0 -0
  36. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/test/testComponent.py +0 -0
  37. {itkdb_gtk-0.10.0.dev2 → itkdb_gtk-0.10.2}/test/test_holes.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: itkdb_gtk
3
- Version: 0.10.0.dev2
3
+ Version: 0.10.2
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
@@ -43,7 +43,7 @@ class ReceiveShipments(dbGtkUtils.ITkDBWindow):
43
43
  global gtk_runs
44
44
  if gtk_runs:
45
45
  super().__init__(session=session, title="Upload AVS Data",
46
- show_search="Cliick to search shipments",
46
+ show_search="Click to search shipments",
47
47
  gtk_runs=gtk_runs, help=help)
48
48
 
49
49
  self.init_window()
@@ -331,7 +331,7 @@ class UploadTest(dbGtkUtils.ITkDBWindow):
331
331
  self.find_attachments()
332
332
  self.find_comments()
333
333
  self.find_defects()
334
-
334
+
335
335
  self.entrySN.set_text(self.data["component"] if self.data["component"] else "")
336
336
  self.entryTest.set_text(self.data["testType"])
337
337
  self.comments = self.data.get("comments", [])
@@ -365,7 +365,7 @@ class UploadTest(dbGtkUtils.ITkDBWindow):
365
365
  continue
366
366
  else:
367
367
  the_path = Path(A["path"]).expanduser().resolve()
368
-
368
+
369
369
  self.attachments.append(ITkDButils.Attachment(the_path, A["title"], A["description"]))
370
370
 
371
371
  if len(self.attachments) > 0:
@@ -390,7 +390,7 @@ class UploadTest(dbGtkUtils.ITkDBWindow):
390
390
  if "comments" in self.data:
391
391
  for C in self.data["comments"]:
392
392
  self.comments.append(C)
393
-
393
+
394
394
  if len(self.comments) > 0:
395
395
  self.btn_comments.set_label("Comments ({})".format(len(self.comments)))
396
396
 
@@ -414,7 +414,7 @@ class UploadTest(dbGtkUtils.ITkDBWindow):
414
414
  if "defects" in self.data:
415
415
  for D in self.data["defects"]:
416
416
  self.defects.append(D)
417
-
417
+
418
418
  if len(self.defects) > 0:
419
419
  self.btn_defects.set_label("Defects ({})".format(len(self.defects)))
420
420
 
@@ -443,7 +443,7 @@ class UploadTest(dbGtkUtils.ITkDBWindow):
443
443
 
444
444
  self.data["comments"] = self.comments
445
445
  self.data["defects"] = self.defects
446
-
446
+
447
447
  rc = ITkDButils.upload_test(self.session, self.data, self.attachments)
448
448
  if rc:
449
449
  ipos = rc.find("The following details may help:")
@@ -13,8 +13,11 @@ try:
13
13
 
14
14
  except ImportError:
15
15
  from pathlib import Path
16
- cwd = Path(sys.argv[0]).parent.parent
16
+ cwd = Path(__file__).parent.parent
17
17
  sys.path.append(cwd.as_posix())
18
+ import itkdb_gtk
19
+
20
+ __HELP_LINK__="https://itkdb-gtk.docs.cern.ch/wirebondTest.html"
18
21
 
19
22
  from itkdb_gtk import dbGtkUtils
20
23
  from itkdb_gtk import ITkDBlogin, ITkDButils, UploadTest
@@ -410,24 +413,24 @@ def get_module_param(SN):
410
413
  return param
411
414
 
412
415
 
413
- class WireBond(Gtk.Window):
416
+ class WireBond(dbGtkUtils.ITkDBWindow):
414
417
  """Main window."""
415
418
 
416
- def __init__(self, session=None, title=""):
419
+ def __init__(self, session, title="", help=__HELP_LINK__):
417
420
  """Initialization."""
418
- super().__init__(title=title)
421
+ super().__init__(title=title, session=session, help=help)
419
422
  self.pdb = None
420
- self.session = session
421
423
  self.models = {}
422
424
  self.holes = {}
423
- self.prepare_window()
425
+ self.institute = "IFIC"
426
+ self.inst_combo = None
427
+ self.module_SN = None
428
+ self.alternativeID = None
429
+ self.init_window()
424
430
 
425
- def prepare_window(self):
431
+ def init_window(self):
426
432
  """Creates the GUI."""
427
- self.hb = Gtk.HeaderBar()
428
- self.hb.set_show_close_button(True)
429
433
  self.hb.props.title = "Wire Bond"
430
- self.set_titlebar(self.hb)
431
434
 
432
435
  # Button to upload
433
436
  button = Gtk.Button()
@@ -455,31 +458,41 @@ class WireBond(Gtk.Window):
455
458
  button.connect("clicked", self.read_file)
456
459
  self.hb.pack_end(button)
457
460
 
458
- # Create the main box and add it to the window
459
- self.mainBox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
460
- self.mainBox.set_property("margin-left", 6)
461
- self.mainBox.set_property("margin-right", 6)
462
- self.add(self.mainBox)
463
-
464
461
  # Data panel
465
462
  grid = Gtk.Grid(column_spacing=5, row_spacing=1)
463
+
464
+ # The shipment receiver
465
+ institute = self.create_institute_combo()
466
+ institute.connect("changed", self.on_institute)
467
+ institute.set_tooltip_text("Select the Institute.")
468
+ dbGtkUtils.set_combo_iter(institute, self.institute)
469
+ grid.attach(Gtk.Label(label="Institute"), 0, 0, 1, 1)
470
+ grid.attach(institute, 1, 0, 1, 1)
471
+ self.inst_combo = institute
472
+
473
+
466
474
  for i, tit in enumerate(["Operator", "Bond Machine", "Wire Batch", "SN", "Date"]):
467
475
  lbl = Gtk.Label(label=tit)
468
476
  lbl.set_xalign(0)
469
- grid.attach(lbl, 0, i, 1, 1)
477
+ grid.attach(lbl, 0, i+1, 1, 1)
470
478
 
471
479
  self.operator = dbGtkUtils.new_small_text_entry()
472
480
  self.machine = dbGtkUtils.new_small_text_entry()
473
481
  self.batch = dbGtkUtils.new_small_text_entry()
474
- self.SN = dbGtkUtils.new_small_text_entry()
482
+ #self.SN = dbGtkUtils.new_small_text_entry()
483
+
484
+ self.SN = itkdb_gtk.dbGtkUtils.TextEntry(small=True)
485
+ self.SN.connect("text-changed", self.on_SN_changed)
486
+
487
+
475
488
  self.date = dbGtkUtils.TextEntry(small=True)
476
489
  self.date.connect("text_changed", self.new_date)
477
490
 
478
- grid.attach(self.operator, 1, 0, 1, 1)
479
- grid.attach(self.machine, 1, 1, 1, 1)
480
- grid.attach(self.batch, 1, 2, 1, 1)
481
- grid.attach(self.SN, 1, 3, 1, 1)
482
- grid.attach(self.date.widget, 1, 4, 1, 1)
491
+ grid.attach(self.operator, 1, 1, 1, 1)
492
+ grid.attach(self.machine, 1, 2, 1, 1)
493
+ grid.attach(self.batch, 1, 3, 1, 1)
494
+ grid.attach(self.SN.entry, 1, 4, 1, 1)
495
+ grid.attach(self.date.widget, 1, 5, 1, 1)
483
496
 
484
497
  self.mainBox.pack_start(grid, True, True, 0)
485
498
 
@@ -504,19 +517,28 @@ class WireBond(Gtk.Window):
504
517
  #
505
518
  # The text view and buffer
506
519
  #
507
- self.message_panel = dbGtkUtils.MessagePanel(size=100)
508
520
  self.mainBox.pack_start(self.message_panel.frame, True, True, 0)
509
521
  self.write_message("wirebond GUI\n")
510
522
 
511
- # The button box
512
- btnBox = Gtk.ButtonBox(orientation=Gtk.Orientation.HORIZONTAL)
523
+ def on_institute(self, combo):
524
+ """Institute changed."""
525
+ name = self.get_institute_from_combo(combo)
526
+ if name:
527
+ self.institute = name
528
+
529
+ def on_SN_changed(self, entry, value):
530
+ """New SN given. Ask in PDB,"""
531
+ if len(value) <= 0:
532
+ return None
533
+
513
534
 
514
- btn = Gtk.Button(label="Quit")
515
- btn.connect("clicked", self.quit)
516
- btnBox.add(btn)
535
+ obj = itkdb_gtk.ITkDButils.get_DB_component(self.session, value)
536
+ if obj is not None:
537
+ entry.set_text(obj["serialNumber"])
538
+ self.alternativeID = obj["alternativeIdentifier"]
517
539
 
518
- self.mainBox.pack_end(btnBox, False, True, 0)
519
- self.show_all()
540
+ else:
541
+ itkdb_gtk.dbGtkUtils.complain("Invalid SN", value)
520
542
 
521
543
  def on_name_combo_changed(self, combo):
522
544
  """Change model in TreeView."""
@@ -627,13 +649,13 @@ class WireBond(Gtk.Window):
627
649
  self.hide()
628
650
  self.destroy()
629
651
 
630
- def write_message(self, text):
631
- """Writes text to Text Viewer."""
632
- self.message_panel.write_message(text)
633
-
634
652
  def compute_unconnected(self):
635
653
  """Compute number of unconnected."""
636
- param = get_module_param(self.SN.get_text())
654
+ try:
655
+ param = get_module_param(self.SN.get_text())
656
+ except ValueError as E:
657
+ dbGtkUtils.complain("Wrong SN number", str(E))
658
+
637
659
  M = ModuleHoles(param=param)
638
660
 
639
661
  for test in test_parameters.values():
@@ -728,6 +750,7 @@ class WireBond(Gtk.Window):
728
750
 
729
751
  def parse(self, data):
730
752
  """Parses a JSon dictionary."""
753
+ dbGtkUtils.set_combo_iter(self.inst_combo, data["institution"])
731
754
  self.operator.set_text(data["properties"]["OPERATOR"])
732
755
  self.machine.set_text(data["properties"]["BOND_MACHINE"])
733
756
  self.batch.set_text(data["properties"]["BONDWIRE_BATCH"])
@@ -775,7 +798,7 @@ class WireBond(Gtk.Window):
775
798
  if response == Gtk.ResponseType.OK:
776
799
  ofile = dialog.get_filename()
777
800
  data = self.get_test_data()
778
- with open(ofile, 'w') as of:
801
+ with open(ofile, 'w', encoding="UTF-8") as of:
779
802
  json.dump(data, of, indent=3)
780
803
 
781
804
  dialog.hide()
@@ -784,6 +807,7 @@ class WireBond(Gtk.Window):
784
807
  def get_test_data(self):
785
808
  """Get the test data."""
786
809
  data = {
810
+ "institution": self.institute,
787
811
  "date": ITkDButils.get_db_date(),
788
812
  "properties": {},
789
813
  "results": {},
@@ -805,21 +829,27 @@ class WireBond(Gtk.Window):
805
829
  SN = dbGtkUtils.get_a_value("Module Serial Number",
806
830
  "Module serial Number is missing")
807
831
 
808
- if len(operator) == 0 or len(machine) == 0 or len(batch) == 0:
832
+ if len(operator) == 0 or len(machine) == 0:
809
833
  values = dbGtkUtils.get_a_list_of_values(
810
834
  "Missing Values",
811
- ["SN", "Operator", "Wire Bonder", "Wire Batch"],
812
- defaults=[SN, operator, machine, batch],
835
+ ["SN", "Operator", "Wire Bonder"],
836
+ defaults=[SN, operator, machine],
813
837
  )
814
838
  if len(values) == 4:
815
- SN, operator, machine, batch = values
839
+ SN, operator, machine = values
816
840
  else:
817
- self.write_message("Something went wrong whilerequesting missing information.")
841
+ self.write_message("Something went wrong while requesting missing information.")
818
842
 
819
843
  data["component"] = SN
820
844
  data["properties"]["OPERATOR"] = operator
821
845
  data["properties"]["BOND_MACHINE"] = machine
822
846
  data["properties"]["BONDWIRE_BATCH"] = batch
847
+ data["institution"] = self.institute
848
+ if data["runNumber"] == "-1":
849
+ data["runNumber"] = "1"
850
+
851
+ data["date"] = self.date.get_text()
852
+
823
853
 
824
854
 
825
855
  def upload_test(self, *args):
@@ -835,7 +865,7 @@ class WireBond(Gtk.Window):
835
865
  self.session = client
836
866
 
837
867
  defaults = {
838
- "institution": "IFIC",
868
+ "institution": self.institute,
839
869
  "runNumber": "1",
840
870
  "date": ITkDButils.get_db_date()
841
871
  }
@@ -851,14 +881,26 @@ class WireBond(Gtk.Window):
851
881
 
852
882
  def main():
853
883
  """Main entry."""
854
- win = WireBond(title="WireBond")
884
+ dlg = ITkDBlogin.ITkDBlogin()
885
+ client = dlg.get_client()
886
+ if client is None:
887
+ print("Could not connect to DB with provided credentials.")
888
+ dlg.die()
889
+ sys.exit()
890
+
891
+ client.user_gui = dlg
892
+
893
+
894
+ win = WireBond(client, title="WireBond")
855
895
  win.connect("destroy", Gtk.main_quit)
896
+ win.show_all()
856
897
  try:
857
898
  Gtk.main()
858
899
 
859
900
  except KeyboardInterrupt:
860
901
  print("Arrrgggg!!!")
861
902
 
862
-
903
+ dlg.die()
904
+
863
905
  if __name__ == "__main__":
864
906
  main()
@@ -1,6 +1,6 @@
1
1
  """ itkdb-gtk python module
2
2
  """
3
- __version__ = "0.10.0.dev2"
3
+ __version__ = "0.10.2"
4
4
 
5
5
 
6
6
  def dash_board():
@@ -7,7 +7,7 @@ try:
7
7
 
8
8
  except ImportError:
9
9
  from pathlib import Path
10
- cwd = Path(sys.argv[0]).parent.parent
10
+ cwd = Path(__file__).parent.parent
11
11
  sys.path.append(cwd.as_posix())
12
12
 
13
13
 
@@ -22,6 +22,15 @@ from itkdb_gtk import GlueWeight
22
22
  from itkdb_gtk import UploadModuleIV
23
23
  from itkdb_gtk import WireBondGui
24
24
 
25
+
26
+ HAS_PETALQC=False
27
+ try:
28
+ from petal_qc.metrology.coreMetrology import CoreMetrology, CoreMetrologyOptions
29
+ HAS_PETALQC = True
30
+ except ImportError as E:
31
+ HAS_PETALQC = False
32
+
33
+
25
34
  import gi
26
35
 
27
36
  gi.require_version("Gtk", "3.0")
@@ -39,6 +48,8 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
39
48
  GLUE_WEIGHT = 6
40
49
  MOD_IV = 7
41
50
  WIRE_BOND = 8
51
+ PETAL_CORE_METRO=9
52
+ PETAL_CORE_THERMAL=10
42
53
 
43
54
  def __init__(self, session):
44
55
  """Initialization."""
@@ -88,7 +99,12 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
88
99
  btnWireBond = Gtk.Button(label="Wire Bond")
89
100
  btnWireBond.connect("clicked", self.wire_bond)
90
101
  grid.attach(btnWireBond, 1, irow, 1, 1)
91
-
102
+
103
+ if HAS_PETALQC:
104
+ irow +=1
105
+ btnPetalMetrology = Gtk.Button(label="Petal Core Metrology")
106
+ btnPetalMetrology.connect("clicked", self.petal_metrology)
107
+ grid.attach(btnPetalMetrology, 0, irow, 1, 1)
92
108
 
93
109
 
94
110
  irow += 1
@@ -200,6 +216,24 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
200
216
  self.mask |= bt
201
217
  W = WireBondGui.WireBond(session=self.session, title="Wirebond", help=HELP_LINK)
202
218
  W.connect("destroy", self.app_closed, bitn)
219
+ W.show_all()
220
+
221
+ def petal_metrology(self, *args):
222
+ """Do petal metrology"""
223
+ if not HAS_PETALQC:
224
+ return
225
+
226
+ bitn = DashWindow.PETAL_CORE_METRO
227
+ bt = 1 << bitn
228
+ if self.mask & bt:
229
+ return
230
+
231
+ self.mask |= bt
232
+ opts = CoreMetrologyOptions()
233
+ W = CoreMetrology(opts, session=self.session, title="Petal Core Metrology")
234
+ W.connect("destroy", self.app_closed, bitn)
235
+ W.show_all()
236
+
203
237
 
204
238
  def app_closed(self, *args):
205
239
  """Application window closed. Clear mask."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: itkdb_gtk
3
- Version: 0.10.0.dev2
3
+ Version: 0.10.2
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "itkdb_gtk"
7
- version = "0.10.0.dev2"
7
+ version = "0.10.2"
8
8
  authors = [
9
9
  { name="Carlos Lacasta", email="carlos.lacasta@cern.ch" },
10
10
  ]
File without changes
File without changes