itkdb-gtk 0.17.0__py3-none-any.whl → 0.18.0.dev1__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/__init__.py +1 -1
- itkdb_gtk/dashBoard.py +30 -0
- itkdb_gtk/findComponent.py +141 -0
- {itkdb_gtk-0.17.0.dist-info → itkdb_gtk-0.18.0.dev1.dist-info}/METADATA +1 -1
- {itkdb_gtk-0.17.0.dist-info → itkdb_gtk-0.18.0.dev1.dist-info}/RECORD +8 -7
- {itkdb_gtk-0.17.0.dist-info → itkdb_gtk-0.18.0.dev1.dist-info}/WHEEL +0 -0
- {itkdb_gtk-0.17.0.dist-info → itkdb_gtk-0.18.0.dev1.dist-info}/entry_points.txt +0 -0
- {itkdb_gtk-0.17.0.dist-info → itkdb_gtk-0.18.0.dev1.dist-info}/top_level.txt +0 -0
itkdb_gtk/__init__.py
CHANGED
itkdb_gtk/dashBoard.py
CHANGED
|
@@ -22,6 +22,7 @@ from itkdb_gtk import UploadModuleIV
|
|
|
22
22
|
from itkdb_gtk import WireBondGui
|
|
23
23
|
from itkdb_gtk import PanelVisualInspection
|
|
24
24
|
from itkdb_gtk import VisualInspection
|
|
25
|
+
from itkdb_gtk import findComponent
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
HAS_PETALQC=False
|
|
@@ -59,6 +60,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
59
60
|
PETAL_CORE_METRO = 11
|
|
60
61
|
PETAL_CORE_THERMAL = 12
|
|
61
62
|
PETAL_INFORMATION = 13
|
|
63
|
+
FIND_COMPONENT = 14
|
|
62
64
|
|
|
63
65
|
def __init__(self, session):
|
|
64
66
|
"""Initialization."""
|
|
@@ -162,6 +164,19 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
162
164
|
recS.connect("clicked", self.receive_shipment)
|
|
163
165
|
grid.attach(recS, 1, irow, 1, 1,)
|
|
164
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
|
+
|
|
165
180
|
self.mainBox.pack_start(Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL), False, True, 5)
|
|
166
181
|
|
|
167
182
|
self.show_all()
|
|
@@ -296,6 +311,21 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
296
311
|
W.connect("destroy", self.app_closed, bitn)
|
|
297
312
|
W.show_all()
|
|
298
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
|
+
|
|
299
329
|
def petal_reception(self, *args):
|
|
300
330
|
"""Petal GND/VI test."""
|
|
301
331
|
bitn = DashWindow.PETAL_RECEPTION
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""GUI to upload tests."""
|
|
3
|
+
import argparse
|
|
4
|
+
import json
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
try:
|
|
9
|
+
import itkdb_gtk
|
|
10
|
+
|
|
11
|
+
except ImportError:
|
|
12
|
+
cwd = Path(__file__).parent.parent
|
|
13
|
+
sys.path.append(cwd.as_posix())
|
|
14
|
+
|
|
15
|
+
from itkdb_gtk import dbGtkUtils, ITkDBlogin, ITkDButils
|
|
16
|
+
from itkdb_gtk.GetShipments import find_vtrx
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
import gi
|
|
20
|
+
gi.require_version("Gtk", "3.0")
|
|
21
|
+
from gi.repository import Gtk, Gio
|
|
22
|
+
|
|
23
|
+
class FindComponent(dbGtkUtils.ITkDBWindow):
|
|
24
|
+
"""Read QR of bar code and retrieve information about component."""
|
|
25
|
+
|
|
26
|
+
def __init__(self, session, help_link=None):
|
|
27
|
+
"""Initialization.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
session: ITkDB session
|
|
31
|
+
help_link: link to help page.
|
|
32
|
+
|
|
33
|
+
"""
|
|
34
|
+
super().__init__(session=session, title="Find Component", help_link=help_link)
|
|
35
|
+
self.init_window()
|
|
36
|
+
|
|
37
|
+
def init_window(self):
|
|
38
|
+
"""Create the Gtk window."""
|
|
39
|
+
# Initial tweaks
|
|
40
|
+
self.set_border_width(10)
|
|
41
|
+
|
|
42
|
+
# Prepare HeaderBar
|
|
43
|
+
self.hb.props.title = "Find Component"
|
|
44
|
+
|
|
45
|
+
# Object Data
|
|
46
|
+
lbl = Gtk.Label(label="Scan your QR or bar code. Information will appear below.")
|
|
47
|
+
self.mainBox.pack_start(lbl, True, True, 0)
|
|
48
|
+
|
|
49
|
+
#btn = Gtk.Button(label="Test Button")
|
|
50
|
+
#btn.connect("clicked", self.test_qrcode)
|
|
51
|
+
#self.mainBox.pack_start(btn, True, True, 0)
|
|
52
|
+
|
|
53
|
+
# The text view
|
|
54
|
+
self.mainBox.pack_start(self.message_panel.frame, True, True, 0)
|
|
55
|
+
|
|
56
|
+
self.show_all()
|
|
57
|
+
|
|
58
|
+
def get_qrcode(self, fd, state, reader):
|
|
59
|
+
"""Gets data from QR scanner."""
|
|
60
|
+
txt = dbGtkUtils.scanner_get_line(reader)
|
|
61
|
+
self.write_message("{}\n".format(txt))
|
|
62
|
+
|
|
63
|
+
if txt.find("J-SD") == 0:
|
|
64
|
+
try:
|
|
65
|
+
SN = find_vtrx(self.session, txt)
|
|
66
|
+
except ValueError as e:
|
|
67
|
+
self.write_message("Error: {}\n".format(e))
|
|
68
|
+
return
|
|
69
|
+
else:
|
|
70
|
+
SN = txt
|
|
71
|
+
|
|
72
|
+
obj = ITkDButils.get_DB_component(self.session, SN)
|
|
73
|
+
if obj is None:
|
|
74
|
+
self.write_message("Object not found in DB\n")
|
|
75
|
+
return
|
|
76
|
+
|
|
77
|
+
msg = "\nObject SN: {}\nObject Alt. ID: {}\nObject Type: {}\nObject Loc. {}\nObject stage: {} - {}".format(
|
|
78
|
+
obj["serialNumber"],
|
|
79
|
+
obj["alternativeIdentifier"],
|
|
80
|
+
obj["componentType"]["name"],
|
|
81
|
+
obj["currentLocation"]["name"],
|
|
82
|
+
obj["currentStage"]["code"],
|
|
83
|
+
obj["currentStage"]["name"])
|
|
84
|
+
|
|
85
|
+
self.write_message(msg)
|
|
86
|
+
|
|
87
|
+
def test_qrcode(self, *args):
|
|
88
|
+
"""Gets data from QR scanner."""
|
|
89
|
+
txt = "a3c671bf38d3957dc053c6e5471aa27e"
|
|
90
|
+
self.write_message("{}\n".format(txt))
|
|
91
|
+
|
|
92
|
+
if txt.find("J-SD") == 0:
|
|
93
|
+
try:
|
|
94
|
+
SN = find_vtrx(self.session, txt)
|
|
95
|
+
except ValueError as e:
|
|
96
|
+
self.write_message("Error: {}\n".format(e))
|
|
97
|
+
return
|
|
98
|
+
else:
|
|
99
|
+
SN = txt
|
|
100
|
+
|
|
101
|
+
obj = ITkDButils.get_DB_component(self.session, SN)
|
|
102
|
+
if obj is None:
|
|
103
|
+
self.write_message("Object not found in DB\n")
|
|
104
|
+
return
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
msg = "\n\nObject SN: {}\nObject Alt. ID: {}\nObject Type: {}\nObject Loc.: {}\nObject stage: {} - {}\n".format(
|
|
108
|
+
obj["serialNumber"],
|
|
109
|
+
obj["alternativeIdentifier"],
|
|
110
|
+
obj["componentType"]["name"],
|
|
111
|
+
obj["currentLocation"]["name"],
|
|
112
|
+
obj["currentStage"]["code"],
|
|
113
|
+
obj["currentStage"]["name"])
|
|
114
|
+
|
|
115
|
+
self.write_message(msg)
|
|
116
|
+
|
|
117
|
+
def main():
|
|
118
|
+
"""Main entry."""
|
|
119
|
+
HELP_LINK="https://itkdb-gtk.docs.cern.ch/uploadSingleTest.html"
|
|
120
|
+
|
|
121
|
+
# DB login
|
|
122
|
+
dlg = ITkDBlogin.ITkDBlogin()
|
|
123
|
+
client = dlg.get_client()
|
|
124
|
+
if client is None:
|
|
125
|
+
print("Could not connect to DB with provided credentials.")
|
|
126
|
+
dlg.die()
|
|
127
|
+
sys.exit()
|
|
128
|
+
|
|
129
|
+
client.user_gui = dlg
|
|
130
|
+
|
|
131
|
+
window = FindComponent(client, help_link=HELP_LINK)
|
|
132
|
+
try:
|
|
133
|
+
Gtk.main()
|
|
134
|
+
|
|
135
|
+
except KeyboardInterrupt:
|
|
136
|
+
print("Arrrgggg!!!")
|
|
137
|
+
|
|
138
|
+
dlg.die()
|
|
139
|
+
|
|
140
|
+
if __name__ == "__main__":
|
|
141
|
+
main()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: itkdb_gtk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.18.0.dev1
|
|
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
|
|
@@ -15,13 +15,14 @@ itkdb_gtk/UploadMultipleTests.py,sha256=ZT5aStkBL62_VUj41dGKN0eN95cGizYS_CLOEEFR
|
|
|
15
15
|
itkdb_gtk/UploadTest.py,sha256=ukgJ5-IG12bqa1QIp3bXIV8hkdXCv5UDxh1lQswN_ko,16832
|
|
16
16
|
itkdb_gtk/VisualInspection.py,sha256=akKPWGbE9DxqTM1csCbov9SqnlTvW_RRKtpqWV64zG4,9841
|
|
17
17
|
itkdb_gtk/WireBondGui.py,sha256=WFTLOw4l5JxSbvh4vZMxcF65fqlwvNw0fOyEru9ijqQ,39850
|
|
18
|
-
itkdb_gtk/__init__.py,sha256=
|
|
19
|
-
itkdb_gtk/dashBoard.py,sha256=
|
|
18
|
+
itkdb_gtk/__init__.py,sha256=SWwbFt4upvQvXxPdUjwq1nSAmLT7BCmSnEK8hcDNODU,1161
|
|
19
|
+
itkdb_gtk/dashBoard.py,sha256=1kNSJn-iJ-ME6Nhtz-TfjFQsdKIlBooExrD8U_LgyEA,12293
|
|
20
20
|
itkdb_gtk/dbGtkUtils.py,sha256=THW-IT5UJB1YluvUVIfpy6oIY2faSHChNKGTpY5qzag,30480
|
|
21
|
+
itkdb_gtk/findComponent.py,sha256=6ZKh9Uz1LdvN8AchSK-LV3qRQmzihBGiTajDJrrBWac,4078
|
|
21
22
|
itkdb_gtk/readGoogleSheet.py,sha256=Lzm_oPWwDqZZzKoBUgsp277F9-wCfr_BA0X4VD2Eolo,2673
|
|
22
23
|
itkdb_gtk/untrash_component.py,sha256=VrN46-f-kF7voOxtoh7OL-bZSWAaIFb7-Xbx6_WT7K8,757
|
|
23
|
-
itkdb_gtk-0.
|
|
24
|
-
itkdb_gtk-0.
|
|
25
|
-
itkdb_gtk-0.
|
|
26
|
-
itkdb_gtk-0.
|
|
27
|
-
itkdb_gtk-0.
|
|
24
|
+
itkdb_gtk-0.18.0.dev1.dist-info/METADATA,sha256=DxXRq0I9b5nqgmnafEvx6Zm0l409dD5GaRBc8OHZeFo,3154
|
|
25
|
+
itkdb_gtk-0.18.0.dev1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
26
|
+
itkdb_gtk-0.18.0.dev1.dist-info/entry_points.txt,sha256=pKg7qpsrZh1GUQ-n3aFsSxmTVm0h4Qdb_6nsNO_PsFw,437
|
|
27
|
+
itkdb_gtk-0.18.0.dev1.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
|
|
28
|
+
itkdb_gtk-0.18.0.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|