itkdb-gtk 0.10.9.dev3__py3-none-any.whl → 0.10.10__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 +30 -24
- itkdb_gtk/GetShipments.py +83 -81
- itkdb_gtk/GlueWeight.py +35 -51
- itkdb_gtk/ITkDBlogin.py +6 -2
- itkdb_gtk/ITkDButils.py +138 -19
- itkdb_gtk/PanelVisualInspection.py +258 -73
- itkdb_gtk/PetalReceptionTests.py +20 -11
- itkdb_gtk/SensorUtils.py +16 -14
- itkdb_gtk/ShowAttachments.py +3 -1
- itkdb_gtk/UploadModuleIV.py +8 -8
- itkdb_gtk/UploadMultipleTests.py +174 -109
- itkdb_gtk/UploadTest.py +17 -14
- itkdb_gtk/VisualInspection.py +299 -0
- itkdb_gtk/WireBondGui.py +556 -163
- itkdb_gtk/__init__.py +7 -7
- itkdb_gtk/dashBoard.py +86 -19
- itkdb_gtk/dbGtkUtils.py +79 -25
- {itkdb_gtk-0.10.9.dev3.dist-info → itkdb_gtk-0.10.10.dist-info}/METADATA +1 -1
- itkdb_gtk-0.10.10.dist-info/RECORD +28 -0
- {itkdb_gtk-0.10.9.dev3.dist-info → itkdb_gtk-0.10.10.dist-info}/WHEEL +1 -1
- {itkdb_gtk-0.10.9.dev3.dist-info → itkdb_gtk-0.10.10.dist-info}/entry_points.txt +1 -1
- itkdb_gtk/UploadPetalInformation.py +0 -711
- itkdb_gtk/readAVSdata.py +0 -693
- itkdb_gtk-0.10.9.dev3.dist-info/RECORD +0 -29
- {itkdb_gtk-0.10.9.dev3.dist-info → itkdb_gtk-0.10.10.dist-info}/top_level.txt +0 -0
itkdb_gtk/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
""" itkdb-gtk python module
|
|
2
2
|
"""
|
|
3
|
-
__version__ = "0.10.
|
|
3
|
+
__version__ = "0.10.10"
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def dash_board():
|
|
@@ -53,12 +53,12 @@ def wirebondTest():
|
|
|
53
53
|
from .WireBondGui import main
|
|
54
54
|
main()
|
|
55
55
|
|
|
56
|
-
def uploadPetalInformation():
|
|
57
|
-
"""Read files from AVS nd create Petal core in PDB."""
|
|
58
|
-
from .UploadPetalInformation import main
|
|
59
|
-
main()
|
|
60
|
-
|
|
61
56
|
def panelVisualInspection():
|
|
62
57
|
"""Visual inspection of PWB or HYB panels."""
|
|
63
|
-
from .
|
|
58
|
+
from .PanelVisualInspection import main
|
|
59
|
+
main()
|
|
60
|
+
|
|
61
|
+
def visualInspection():
|
|
62
|
+
"""Visual inspection of Modules/Sensors."""
|
|
63
|
+
from .VisualInspection import main
|
|
64
64
|
main()
|
itkdb_gtk/dashBoard.py
CHANGED
|
@@ -22,6 +22,7 @@ from itkdb_gtk import GlueWeight
|
|
|
22
22
|
from itkdb_gtk import UploadModuleIV
|
|
23
23
|
from itkdb_gtk import WireBondGui
|
|
24
24
|
from itkdb_gtk import PanelVisualInspection
|
|
25
|
+
from itkdb_gtk import VisualInspection
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
HAS_PETALQC=False
|
|
@@ -29,6 +30,7 @@ try:
|
|
|
29
30
|
from petal_qc.metrology.coreMetrology import CoreMetrology, CoreMetrologyOptions
|
|
30
31
|
from petal_qc.thermal.coreThermal import CoreThermal
|
|
31
32
|
from petal_qc.thermal.IRPetalParam import IRPetalParam
|
|
33
|
+
from petal_qc.metrology.uploadPetalInformation import AVSPanel, AVSOptions
|
|
32
34
|
|
|
33
35
|
HAS_PETALQC = True
|
|
34
36
|
except ImportError as E:
|
|
@@ -53,13 +55,14 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
53
55
|
MOD_IV = 7
|
|
54
56
|
WIRE_BOND = 8
|
|
55
57
|
PANEL_VI = 9
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
MODULE_VI = 10
|
|
59
|
+
PETAL_CORE_METRO = 11
|
|
60
|
+
PETAL_CORE_THERMAL = 12
|
|
61
|
+
PETAL_INFORMATION = 13
|
|
59
62
|
|
|
60
63
|
def __init__(self, session):
|
|
61
64
|
"""Initialization."""
|
|
62
|
-
super().__init__(title="ITkDB Dashboard", session=session,
|
|
65
|
+
super().__init__(title="ITkDB Dashboard", session=session, help_link=HELP_LINK)
|
|
63
66
|
self.mask = 0
|
|
64
67
|
|
|
65
68
|
# set border width
|
|
@@ -105,23 +108,30 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
105
108
|
btnWireBond = Gtk.Button(label="Wire Bond")
|
|
106
109
|
btnWireBond.connect("clicked", self.wire_bond)
|
|
107
110
|
grid.attach(btnWireBond, 1, irow, 1, 1)
|
|
108
|
-
|
|
111
|
+
|
|
109
112
|
irow += 1
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
grid.attach(
|
|
113
|
+
btnPanelVI = Gtk.Button(label="Panel Visual Insp.")
|
|
114
|
+
btnPanelVI.connect("clicked", self.panel_VI)
|
|
115
|
+
grid.attach(btnPanelVI, 1, irow, 1, 1)
|
|
113
116
|
|
|
117
|
+
btnModVI = Gtk.Button(label="Module/Sensor Visual Insp.")
|
|
118
|
+
btnModVI.connect("clicked", self.module_VI)
|
|
119
|
+
grid.attach(btnModVI, 0, irow, 1, 1)
|
|
114
120
|
|
|
115
121
|
if HAS_PETALQC:
|
|
122
|
+
irow +=1
|
|
123
|
+
btnPetalInfo = Gtk.Button(label="AVS Petal Info")
|
|
124
|
+
btnPetalInfo.connect("clicked", self.upload_petal_info)
|
|
125
|
+
grid.attach(btnPetalInfo, 0, irow, 1, 1)
|
|
126
|
+
|
|
116
127
|
irow +=1
|
|
117
128
|
btnPetalMetrology = Gtk.Button(label="Petal Core Metrology")
|
|
118
129
|
btnPetalMetrology.connect("clicked", self.petal_metrology)
|
|
119
130
|
grid.attach(btnPetalMetrology, 0, irow, 1, 1)
|
|
120
|
-
|
|
131
|
+
|
|
121
132
|
btnPetalThermal = Gtk.Button(label="Petal Core Thermal")
|
|
122
133
|
btnPetalThermal.connect("clicked", self.petal_thermal)
|
|
123
134
|
grid.attach(btnPetalThermal, 1, irow, 1, 1)
|
|
124
|
-
|
|
125
135
|
|
|
126
136
|
irow += 1
|
|
127
137
|
grid.attach(Gtk.Label(), 0, irow, 1, 1)
|
|
@@ -153,7 +163,10 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
153
163
|
return
|
|
154
164
|
|
|
155
165
|
self.mask |= bt
|
|
156
|
-
W = UploadTest.UploadTest(
|
|
166
|
+
W = UploadTest.UploadTest(
|
|
167
|
+
self.session,
|
|
168
|
+
help_link="{}/uploadSingleTest.html".format(HELP_LINK)
|
|
169
|
+
)
|
|
157
170
|
W.connect("destroy", self.app_closed, bitn)
|
|
158
171
|
|
|
159
172
|
def upload_multiple_tests(self, *args):
|
|
@@ -164,7 +177,10 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
164
177
|
return
|
|
165
178
|
|
|
166
179
|
self.mask |= bt
|
|
167
|
-
W = UploadMultipleTests.UploadMultipleTests(
|
|
180
|
+
W = UploadMultipleTests.UploadMultipleTests(
|
|
181
|
+
self.session,
|
|
182
|
+
help_link="{}/uploadMultipleTests.html".format(HELP_LINK)
|
|
183
|
+
)
|
|
168
184
|
W.connect("destroy", self.app_closed, bitn)
|
|
169
185
|
|
|
170
186
|
def create_shipment(self, *args):
|
|
@@ -175,7 +191,10 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
175
191
|
return
|
|
176
192
|
|
|
177
193
|
self.mask |= bt
|
|
178
|
-
W = CreateShipments.CreateShipments(
|
|
194
|
+
W = CreateShipments.CreateShipments(
|
|
195
|
+
self.session,
|
|
196
|
+
help_link="{}/createShipment.html".format(HELP_LINK)
|
|
197
|
+
)
|
|
179
198
|
W.connect("destroy", self.app_closed, bitn)
|
|
180
199
|
|
|
181
200
|
def receive_shipment(self, *args):
|
|
@@ -186,7 +205,10 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
186
205
|
return
|
|
187
206
|
|
|
188
207
|
self.mask |= bt
|
|
189
|
-
W = GetShipments.ReceiveShipments(
|
|
208
|
+
W = GetShipments.ReceiveShipments(
|
|
209
|
+
self.session,
|
|
210
|
+
help_link="{}/receiveShipments.html".format(HELP_LINK)
|
|
211
|
+
)
|
|
190
212
|
W.connect("destroy", self.app_closed, bitn)
|
|
191
213
|
|
|
192
214
|
def petal_gnd(self, *args):
|
|
@@ -197,7 +219,10 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
197
219
|
return
|
|
198
220
|
|
|
199
221
|
self.mask |= bt
|
|
200
|
-
W = PetalReceptionTests.PetalReceptionTests(
|
|
222
|
+
W = PetalReceptionTests.PetalReceptionTests(
|
|
223
|
+
self.session,
|
|
224
|
+
help_link="{}/petalReceptionTests.html".format(HELP_LINK)
|
|
225
|
+
)
|
|
201
226
|
W.connect("destroy", self.app_closed, bitn)
|
|
202
227
|
|
|
203
228
|
def glue_weight(self, *args):
|
|
@@ -208,7 +233,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
208
233
|
return
|
|
209
234
|
|
|
210
235
|
self.mask |= bt
|
|
211
|
-
W = GlueWeight.GlueWeight(self.session,
|
|
236
|
+
W = GlueWeight.GlueWeight(self.session, help_link=HELP_LINK)
|
|
212
237
|
W.connect("destroy", self.app_closed, bitn)
|
|
213
238
|
|
|
214
239
|
def module_IV(self, *args):
|
|
@@ -219,7 +244,10 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
219
244
|
return
|
|
220
245
|
|
|
221
246
|
self.mask |= bt
|
|
222
|
-
W = UploadModuleIV.IVwindow(
|
|
247
|
+
W = UploadModuleIV.IVwindow(
|
|
248
|
+
self.session,
|
|
249
|
+
help_link="{}/uploadModuleIV.html".format(HELP_LINK)
|
|
250
|
+
)
|
|
223
251
|
W.connect("destroy", self.app_closed, bitn)
|
|
224
252
|
|
|
225
253
|
def wire_bond(self, *args):
|
|
@@ -230,7 +258,11 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
230
258
|
return
|
|
231
259
|
|
|
232
260
|
self.mask |= bt
|
|
233
|
-
W = WireBondGui.WireBond(
|
|
261
|
+
W = WireBondGui.WireBond(
|
|
262
|
+
session=self.session,
|
|
263
|
+
title="Wirebond",
|
|
264
|
+
help_link="{}//wirebondTest.html".format(HELP_LINK),
|
|
265
|
+
)
|
|
234
266
|
W.connect("destroy", self.app_closed, bitn)
|
|
235
267
|
W.show_all()
|
|
236
268
|
|
|
@@ -242,10 +274,44 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
242
274
|
return
|
|
243
275
|
|
|
244
276
|
self.mask |= bt
|
|
245
|
-
W = PanelVisualInspection.PanelVisualInspection(
|
|
277
|
+
W = PanelVisualInspection.PanelVisualInspection(
|
|
278
|
+
session=self.session,
|
|
279
|
+
title="Panel Visual Inspection",
|
|
280
|
+
help_link="{}/panelVisualInspection.html".format(HELP_LINK),
|
|
281
|
+
)
|
|
282
|
+
W.connect("destroy", self.app_closed, bitn)
|
|
283
|
+
W.show_all()
|
|
284
|
+
|
|
285
|
+
def module_VI(self, *args):
|
|
286
|
+
"""Panel VI tests."""
|
|
287
|
+
bitn = DashWindow.MODULE_VI
|
|
288
|
+
bt = 1 << bitn
|
|
289
|
+
if self.mask & bt:
|
|
290
|
+
return
|
|
291
|
+
|
|
292
|
+
self.mask |= bt
|
|
293
|
+
W = VisualInspection.ModuleVisualInspection(
|
|
294
|
+
session=self.session,
|
|
295
|
+
title="Module/Sensor Visual Inspection",
|
|
296
|
+
help_link="{}/moduleVisualInspection.html".format(HELP_LINK),
|
|
297
|
+
)
|
|
246
298
|
W.connect("destroy", self.app_closed, bitn)
|
|
247
299
|
W.show_all()
|
|
248
300
|
|
|
301
|
+
def upload_petal_info(self, *srgs):
|
|
302
|
+
"""Upload petal Info."""
|
|
303
|
+
if not HAS_PETALQC:
|
|
304
|
+
return
|
|
305
|
+
|
|
306
|
+
bitn = DashWindow.PETAL_INFORMATION
|
|
307
|
+
bt = 1 << bitn
|
|
308
|
+
if self.mask & bt:
|
|
309
|
+
return
|
|
310
|
+
|
|
311
|
+
self.mask |= bt
|
|
312
|
+
W = AVSPanel(self.session, AVSOptions())
|
|
313
|
+
W.connect("destroy", self.app_closed, bitn)
|
|
314
|
+
W.show_all()
|
|
249
315
|
|
|
250
316
|
def petal_metrology(self, *args):
|
|
251
317
|
"""Do petal metrology"""
|
|
@@ -291,6 +357,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
291
357
|
|
|
292
358
|
|
|
293
359
|
def main():
|
|
360
|
+
"""main entry."""
|
|
294
361
|
# DB login
|
|
295
362
|
dlg = ITkDBlogin.ITkDBlogin()
|
|
296
363
|
client = dlg.get_client()
|
itkdb_gtk/dbGtkUtils.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""A set of GTK utilities for DB scripts."""
|
|
2
|
+
import sys
|
|
2
3
|
import json
|
|
3
4
|
import time
|
|
4
5
|
import pathlib
|
|
@@ -18,6 +19,16 @@ gi.require_version("Gtk", "3.0")
|
|
|
18
19
|
from gi.repository import Gtk, GObject, Gio, GLib
|
|
19
20
|
|
|
20
21
|
|
|
22
|
+
try:
|
|
23
|
+
import itkdb_gtk
|
|
24
|
+
|
|
25
|
+
except ImportError:
|
|
26
|
+
cwd = pathlib.Path(__file__).parent.parent
|
|
27
|
+
sys.path.append(cwd.as_posix())
|
|
28
|
+
|
|
29
|
+
from itkdb_gtk import ITkDButils
|
|
30
|
+
|
|
31
|
+
|
|
21
32
|
def setup_scanner(callback):
|
|
22
33
|
"""Setup scanner and callback function."""
|
|
23
34
|
for fnam in ["/dev/ttyACM0", "/dev/cu.usbmodemS_N_G19F204881"]:
|
|
@@ -51,9 +62,10 @@ def parse_date(txt):
|
|
|
51
62
|
try:
|
|
52
63
|
return dateutil.parser.parse(txt, fuzzy=False)
|
|
53
64
|
|
|
54
|
-
except
|
|
65
|
+
except dateutil.parser.ParserError:
|
|
55
66
|
return None
|
|
56
67
|
|
|
68
|
+
|
|
57
69
|
def parse_date_as_string(txt):
|
|
58
70
|
"""Parse data and return DB compatible string."""
|
|
59
71
|
D = parse_date(txt)
|
|
@@ -76,7 +88,7 @@ def is_a_date(txt):
|
|
|
76
88
|
dateutil.parser.parse(txt, fuzzy=False)
|
|
77
89
|
return True
|
|
78
90
|
|
|
79
|
-
except
|
|
91
|
+
except (dateutil.parser.ParserError, OverflowError):
|
|
80
92
|
return False
|
|
81
93
|
|
|
82
94
|
def new_small_text_entry():
|
|
@@ -111,14 +123,14 @@ def set_button_color(btn, bg_color, fg_color="white"):
|
|
|
111
123
|
def set_combo_iter(combo, txt, col=0):
|
|
112
124
|
"""Set scombo active iter to that containing txt in column col."""
|
|
113
125
|
model = combo.get_model()
|
|
114
|
-
|
|
115
|
-
while
|
|
116
|
-
val = model.get_value(
|
|
126
|
+
lv_iter = model.get_iter_first()
|
|
127
|
+
while lv_iter:
|
|
128
|
+
val = model.get_value(lv_iter, col)
|
|
117
129
|
if val == txt:
|
|
118
|
-
combo.set_active_iter(
|
|
130
|
+
combo.set_active_iter(lv_iter)
|
|
119
131
|
break
|
|
120
132
|
|
|
121
|
-
|
|
133
|
+
lv_iter = model.iter_next(lv_iter)
|
|
122
134
|
|
|
123
135
|
|
|
124
136
|
def is_iterable(obj):
|
|
@@ -223,7 +235,6 @@ def ask_for_confirmation(main_title, second_text, parent=None):
|
|
|
223
235
|
dialog.destroy()
|
|
224
236
|
return (out == Gtk.ResponseType.OK)
|
|
225
237
|
|
|
226
|
-
|
|
227
238
|
class TextEntry(GObject.GObject):
|
|
228
239
|
"""Create a Gtk text entry/view object."""
|
|
229
240
|
__gsignals__ = {
|
|
@@ -235,6 +246,7 @@ class TextEntry(GObject.GObject):
|
|
|
235
246
|
GObject.GObject.__init__(self)
|
|
236
247
|
self.tmp_txt = ""
|
|
237
248
|
self.nlines = n_lines
|
|
249
|
+
self.do_emit = True
|
|
238
250
|
if self.nlines > 1:
|
|
239
251
|
self.widget = Gtk.Frame()
|
|
240
252
|
scrolled = Gtk.ScrolledWindow()
|
|
@@ -254,12 +266,11 @@ class TextEntry(GObject.GObject):
|
|
|
254
266
|
|
|
255
267
|
self.widget.connect("focus-in-event", self.on_enter)
|
|
256
268
|
self.widget.connect("focus-out-event", self.on_leave)
|
|
257
|
-
|
|
258
269
|
self.entry = self.widget
|
|
259
270
|
|
|
260
271
|
def do_my_signal(self, *args):
|
|
261
272
|
"""Signal handler."""
|
|
262
|
-
|
|
273
|
+
return
|
|
263
274
|
|
|
264
275
|
def on_enter(self, *args):
|
|
265
276
|
"""On enter."""
|
|
@@ -270,7 +281,9 @@ class TextEntry(GObject.GObject):
|
|
|
270
281
|
"""On leave."""
|
|
271
282
|
val = self.widget.get_text().strip()
|
|
272
283
|
if val != self.tmp_txt:
|
|
284
|
+
self.do_emit = False
|
|
273
285
|
self.emit("text_changed", val)
|
|
286
|
+
self.do_emit = True
|
|
274
287
|
|
|
275
288
|
def get_text(self):
|
|
276
289
|
"""Return the text."""
|
|
@@ -285,11 +298,17 @@ class TextEntry(GObject.GObject):
|
|
|
285
298
|
|
|
286
299
|
def set_text(self, text):
|
|
287
300
|
"""Sets text."""
|
|
301
|
+
if text is None:
|
|
302
|
+
return
|
|
303
|
+
|
|
288
304
|
if self.nlines > 1:
|
|
289
305
|
self.entry.get_buffer().set_text(text)
|
|
290
306
|
else:
|
|
291
307
|
self.entry.set_text(text)
|
|
292
|
-
|
|
308
|
+
if self.do_emit:
|
|
309
|
+
self.do_emit = False
|
|
310
|
+
self.emit("text_changed", text)
|
|
311
|
+
self.do_emit = True
|
|
293
312
|
|
|
294
313
|
def get_a_value(main_title, second_text=None, is_tv=False, parent=None):
|
|
295
314
|
"""Open a dialog to get a value.
|
|
@@ -304,7 +323,7 @@ def get_a_value(main_title, second_text=None, is_tv=False, parent=None):
|
|
|
304
323
|
value: The value in the entry
|
|
305
324
|
|
|
306
325
|
"""
|
|
307
|
-
dlg = Gtk.Dialog(title="
|
|
326
|
+
dlg = Gtk.Dialog(title="Get a Value",
|
|
308
327
|
transient_for=parent,
|
|
309
328
|
flags=0)
|
|
310
329
|
dlg.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
|
|
@@ -385,7 +404,8 @@ def get_a_list_of_values(main_title, labels, defaults=None, second_text=None, pa
|
|
|
385
404
|
entry = TextEntry(3 if use_tv else -1)
|
|
386
405
|
try:
|
|
387
406
|
entry.set_text(defaults[i])
|
|
388
|
-
|
|
407
|
+
|
|
408
|
+
except (TypeError, IndexError):
|
|
389
409
|
pass
|
|
390
410
|
|
|
391
411
|
vbox.pack_start(entry.widget, False, False, 0)
|
|
@@ -493,7 +513,7 @@ class MessagePanel(object):
|
|
|
493
513
|
class ITkDBWindow(Gtk.Window):
|
|
494
514
|
"""Base class for GUI main windows."""
|
|
495
515
|
|
|
496
|
-
def __init__(self, title="", session=None, show_search=None,
|
|
516
|
+
def __init__(self, title="", session=None, show_search=None, help_link=None, gtk_runs=True, panel_size=100):
|
|
497
517
|
"""Initialization.
|
|
498
518
|
|
|
499
519
|
Args:
|
|
@@ -509,13 +529,14 @@ class ITkDBWindow(Gtk.Window):
|
|
|
509
529
|
self.inst2code = {}
|
|
510
530
|
self.code2inst = {}
|
|
511
531
|
self.message_panel = None
|
|
512
|
-
self.help =
|
|
532
|
+
self.help = help_link
|
|
533
|
+
self.pdb_user = ITkDButils.get_db_user(self.session)
|
|
513
534
|
|
|
514
535
|
if gtk_runs:
|
|
515
536
|
super().__init__(title=title)
|
|
516
|
-
self.prepare_window(show_search, panel_size)
|
|
537
|
+
self.prepare_window(title, show_search, panel_size)
|
|
517
538
|
|
|
518
|
-
def prepare_window(self, show_search, panel_size):
|
|
539
|
+
def prepare_window(self, title, show_search, panel_size):
|
|
519
540
|
"""Inititalizes GUI."""
|
|
520
541
|
# Prepare HeaderBar
|
|
521
542
|
self.hb = Gtk.HeaderBar()
|
|
@@ -552,6 +573,14 @@ class ITkDBWindow(Gtk.Window):
|
|
|
552
573
|
self.mainBox.set_property("margin-left", 6)
|
|
553
574
|
self.mainBox.set_property("margin-right", 6)
|
|
554
575
|
|
|
576
|
+
self.title_label = None
|
|
577
|
+
if len(title)>0:
|
|
578
|
+
lbl = Gtk.Label()
|
|
579
|
+
lbl.set_markup("<big><b>{}\n</b></big>".format(title))
|
|
580
|
+
lbl.set_xalign(0.5)
|
|
581
|
+
self.mainBox.pack_start(lbl, False, False, 2)
|
|
582
|
+
self.title_label = lbl
|
|
583
|
+
|
|
555
584
|
self.add(self.mainBox)
|
|
556
585
|
|
|
557
586
|
# The text view and buffer
|
|
@@ -566,6 +595,13 @@ class ITkDBWindow(Gtk.Window):
|
|
|
566
595
|
|
|
567
596
|
self.mainBox.pack_end(btnBox, False, True, 0)
|
|
568
597
|
|
|
598
|
+
def set_window_title(self, title):
|
|
599
|
+
"""Set window title."""
|
|
600
|
+
hb = self.get_titlebar()
|
|
601
|
+
hb.props.title = title
|
|
602
|
+
if self.title_label:
|
|
603
|
+
self.title_label.set_markup("<big><b>{}\n</b></big>".format(title))
|
|
604
|
+
|
|
569
605
|
def quit(self, *args):
|
|
570
606
|
"""Quits the application."""
|
|
571
607
|
self.hide()
|
|
@@ -577,7 +613,7 @@ class ITkDBWindow(Gtk.Window):
|
|
|
577
613
|
|
|
578
614
|
def query_db(self, *args):
|
|
579
615
|
"""Search button clicked."""
|
|
580
|
-
|
|
616
|
+
return
|
|
581
617
|
|
|
582
618
|
def new_login(self, obj, msg):
|
|
583
619
|
"""A new user logged in."""
|
|
@@ -596,18 +632,32 @@ class ITkDBWindow(Gtk.Window):
|
|
|
596
632
|
if hasattr(self.session, "user_gui"):
|
|
597
633
|
self.session.user_gui.reconnect(force=True)
|
|
598
634
|
|
|
599
|
-
def create_institute_combo(self):
|
|
600
|
-
"""Create a combe with all institutes.
|
|
601
|
-
|
|
635
|
+
def create_institute_combo(self, only_user=False):
|
|
636
|
+
"""Create a combe with all institutes.
|
|
637
|
+
|
|
638
|
+
Args:
|
|
639
|
+
only_user: if True, add only institutes the user belongs to.
|
|
640
|
+
|
|
641
|
+
"""
|
|
642
|
+
compltn = self.get_institute_list(only_user)
|
|
602
643
|
combo = Gtk.ComboBox.new_with_model_and_entry(compltn.get_model())
|
|
603
644
|
combo.set_entry_text_column(0)
|
|
604
645
|
combo.get_child().set_completion(compltn)
|
|
605
646
|
|
|
606
647
|
return combo
|
|
607
648
|
|
|
608
|
-
def get_institute_list(self):
|
|
609
|
-
"""Get the institute list.
|
|
610
|
-
|
|
649
|
+
def get_institute_list(self, only_user=False):
|
|
650
|
+
"""Get the institute list.
|
|
651
|
+
|
|
652
|
+
Args:
|
|
653
|
+
only_user: if True, add only institutes the user belongs to.
|
|
654
|
+
|
|
655
|
+
"""
|
|
656
|
+
if only_user and self.pdb_user:
|
|
657
|
+
sites = self.pdb_user["institutions"]
|
|
658
|
+
else:
|
|
659
|
+
sites = self.session.get("listInstitutions", json={})
|
|
660
|
+
|
|
611
661
|
liststore = Gtk.ListStore(str, str)
|
|
612
662
|
for site in sites:
|
|
613
663
|
self.code2inst[site['code']] = site['name']
|
|
@@ -884,7 +934,8 @@ def create_scrolled_dictdialog(the_dict, hidden=("component", "testType")):
|
|
|
884
934
|
return scrolled, gM
|
|
885
935
|
|
|
886
936
|
|
|
887
|
-
|
|
937
|
+
def main():
|
|
938
|
+
"""Main entry."""
|
|
888
939
|
result = {
|
|
889
940
|
"component": "the_serial_nukber",
|
|
890
941
|
"testType": "METROLOGY_AVS",
|
|
@@ -946,3 +997,6 @@ if __name__ == "__main__":
|
|
|
946
997
|
|
|
947
998
|
win.show_all()
|
|
948
999
|
Gtk.main()
|
|
1000
|
+
|
|
1001
|
+
if __name__ == "__main__":
|
|
1002
|
+
main()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: itkdb_gtk
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.10
|
|
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,28 @@
|
|
|
1
|
+
itkdb_gtk/CreateShipments.py,sha256=eiVjw7zGLGAoqWxThBc6IVvXLUFXmtQ-_hpZzfDOKx0,13249
|
|
2
|
+
itkdb_gtk/GetShipments.py,sha256=b3TECQhHlK0kGXH6KjQs06yuzIfTN5tjtiu6wnEOuJ8,19172
|
|
3
|
+
itkdb_gtk/GlueWeight.py,sha256=IHgvbN2DlT8Ou-DMi-n3Z-3xSrPr0tlrkkEH10AshrA,11587
|
|
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=40tipm_j5eUS4dnZnBT8VyL6Bu_8csuqS9TPWKxvKSY,10038
|
|
7
|
+
itkdb_gtk/ITkDButils.py,sha256=p1r1HqY0hP47Y0fRRweLPNR6rbPRebWS8d9y_vdj_lk,19586
|
|
8
|
+
itkdb_gtk/PanelVisualInspection.py,sha256=ktAcYbdLBS7Zbxq9XsxB_AWTgAfFLa42NFTEsxnBn98,20531
|
|
9
|
+
itkdb_gtk/PetalReceptionTests.py,sha256=N9_lBvao-HeHPwccjycUL7p3R3V_nPur1WibXbcqjgI,9992
|
|
10
|
+
itkdb_gtk/SensorUtils.py,sha256=fYWF9TeutAbore53dLWNlZnVn9P3OsKYcFLNGOs8cnI,15426
|
|
11
|
+
itkdb_gtk/ShowAttachments.py,sha256=KExxPCdbcb04XS8JSUkg5xF1McvlB8e9btwctDCKNXU,8498
|
|
12
|
+
itkdb_gtk/ShowComments.py,sha256=OiMTFLnhGbbKRj5x61D517BYHAt-qY5Y1lvR3EQz3c0,3151
|
|
13
|
+
itkdb_gtk/ShowDefects.py,sha256=aVAHeaE5IztmAPEuHwhi06KWo_pi9xX2J1fTLhKyAPI,3530
|
|
14
|
+
itkdb_gtk/UploadModuleIV.py,sha256=sqh52bSxANBwlmVWZlDqFXpqRGf0rV0QsjJWC-tY_qI,17792
|
|
15
|
+
itkdb_gtk/UploadMultipleTests.py,sha256=TFEqcRd2ZZAVhK3P3Qn2vg81NouOCjkjqn9PhoHYhPM,24125
|
|
16
|
+
itkdb_gtk/UploadTest.py,sha256=ukgJ5-IG12bqa1QIp3bXIV8hkdXCv5UDxh1lQswN_ko,16832
|
|
17
|
+
itkdb_gtk/VisualInspection.py,sha256=i2i_9ttetMzGFRcBFm_ow7aziksTgvZzVLUxZhwiyBg,9850
|
|
18
|
+
itkdb_gtk/WireBondGui.py,sha256=WFTLOw4l5JxSbvh4vZMxcF65fqlwvNw0fOyEru9ijqQ,39850
|
|
19
|
+
itkdb_gtk/__init__.py,sha256=UNLzUFGuEpXgDEMIW1t42Du1f-ADQ-yP9ILqcXR2ov4,1264
|
|
20
|
+
itkdb_gtk/dashBoard.py,sha256=b2QmPUtjo_gAxf3u5t5_V35J580i9V-4FLr2NvmDzAw,10999
|
|
21
|
+
itkdb_gtk/dbGtkUtils.py,sha256=THW-IT5UJB1YluvUVIfpy6oIY2faSHChNKGTpY5qzag,30480
|
|
22
|
+
itkdb_gtk/readGoogleSheet.py,sha256=Lzm_oPWwDqZZzKoBUgsp277F9-wCfr_BA0X4VD2Eolo,2673
|
|
23
|
+
itkdb_gtk/untrash_component.py,sha256=VrN46-f-kF7voOxtoh7OL-bZSWAaIFb7-Xbx6_WT7K8,757
|
|
24
|
+
itkdb_gtk-0.10.10.dist-info/METADATA,sha256=Dec0GDsuDJ8KGENdaq72SDjfZFKdE3VpcQ3SuQjyUYg,3151
|
|
25
|
+
itkdb_gtk-0.10.10.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
26
|
+
itkdb_gtk-0.10.10.dist-info/entry_points.txt,sha256=51wi4BRW1vYuLNySWC6bsmQPo7XPI7cvPFAaBD49Ib0,489
|
|
27
|
+
itkdb_gtk-0.10.10.dist-info/top_level.txt,sha256=KVRrH4OS8ovzNR9bvADE0ABn5bNpSk987tuH0jCfkbU,10
|
|
28
|
+
itkdb_gtk-0.10.10.dist-info/RECORD,,
|
|
@@ -7,6 +7,6 @@ panelVisualInspection = itkdb_gtk:panelVisualInspection
|
|
|
7
7
|
petalReceptionTests = itkdb_gtk:petalReceptionTests
|
|
8
8
|
uploadModuleIV = itkdb_gtk:uploadModuleIV
|
|
9
9
|
uploadMultipleTests = itkdb_gtk:uploadMultipleTests
|
|
10
|
-
uploadPetalInformation = itkdb_gtk:uploadPetalInformation
|
|
11
10
|
uploadTest = itkdb_gtk:uploadTest
|
|
11
|
+
visualInspection = itkdb_gtk:visualInspection
|
|
12
12
|
wirebondTest = itkdb_gtk:wirebondTest
|