itkdb-gtk 0.11.0__tar.gz → 0.12.0__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.
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/PKG-INFO +1 -1
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/__init__.py +1 -8
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/dashBoard.py +44 -31
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk.egg-info/PKG-INFO +1 -1
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk.egg-info/SOURCES.txt +0 -1
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk.egg-info/entry_points.txt +0 -1
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/pyproject.toml +1 -2
- itkdb_gtk-0.11.0/itkdb_gtk/PetalReceptionTests.py +0 -308
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/README.md +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/CreateShipments.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/GetShipments.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/GlueWeight.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/ITkDB.desktop +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/ITkDB.svg +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/ITkDBlogin.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/ITkDButils.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/PanelVisualInspection.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/SensorUtils.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/ShowAttachments.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/ShowComments.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/ShowDefects.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/UploadModuleIV.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/UploadMultipleTests.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/UploadTest.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/VisualInspection.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/WireBondGui.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/dbGtkUtils.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/readGoogleSheet.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk/untrash_component.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk.egg-info/dependency_links.txt +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk.egg-info/requires.txt +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/itkdb_gtk.egg-info/top_level.txt +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/setup.cfg +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/test/testAnimated.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/test/testBatch.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/test/testComponent.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/test/testRange.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/test/testThread.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/test/test_attachment.py +0 -0
- {itkdb_gtk-0.11.0 → itkdb_gtk-0.12.0}/test/test_holes.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: itkdb_gtk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.12.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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
""" itkdb-gtk python module
|
|
2
2
|
"""
|
|
3
|
-
__version__ = "0.
|
|
3
|
+
__version__ = "0.12.0"
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def dash_board():
|
|
@@ -20,13 +20,6 @@ def glueWeight():
|
|
|
20
20
|
from .GlueWeight import main
|
|
21
21
|
main()
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
def petalReceptionTests():
|
|
25
|
-
"""GND/VI tests."""
|
|
26
|
-
from .PetalReceptionTests import main
|
|
27
|
-
main()
|
|
28
|
-
|
|
29
|
-
|
|
30
23
|
def createShipments():
|
|
31
24
|
"""Send items."""
|
|
32
25
|
from .CreateShipments import main
|
|
@@ -13,7 +13,6 @@ except ImportError:
|
|
|
13
13
|
|
|
14
14
|
from itkdb_gtk import dbGtkUtils
|
|
15
15
|
from itkdb_gtk import GetShipments
|
|
16
|
-
from itkdb_gtk import PetalReceptionTests
|
|
17
16
|
from itkdb_gtk import ITkDBlogin
|
|
18
17
|
from itkdb_gtk import CreateShipments
|
|
19
18
|
from itkdb_gtk import UploadTest
|
|
@@ -31,6 +30,7 @@ try:
|
|
|
31
30
|
from petal_qc.thermal.coreThermal import CoreThermal
|
|
32
31
|
from petal_qc.thermal.IRPetalParam import IRPetalParam
|
|
33
32
|
from petal_qc.metrology.uploadPetalInformation import AVSPanel, AVSOptions
|
|
33
|
+
from petal_qc import PetalReceptionTests
|
|
34
34
|
|
|
35
35
|
HAS_PETALQC = True
|
|
36
36
|
except ImportError as E:
|
|
@@ -50,7 +50,7 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
50
50
|
UPLOAD_MANY_TESTS = 2
|
|
51
51
|
CREATE_SHIPMNT = 3
|
|
52
52
|
RECV_SHIPMNT = 4
|
|
53
|
-
|
|
53
|
+
PETAL_RECEPTION = 5
|
|
54
54
|
GLUE_WEIGHT = 6
|
|
55
55
|
MOD_IV = 7
|
|
56
56
|
WIRE_BOND = 8
|
|
@@ -69,9 +69,9 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
69
69
|
self.set_border_width(10)
|
|
70
70
|
|
|
71
71
|
# Prepare dashboard
|
|
72
|
-
lbl = Gtk.Label()
|
|
73
|
-
lbl.set_markup("<big><b>ITkDB available commands.</b></big>")
|
|
74
|
-
self.mainBox.pack_start(lbl, True, True, 0)
|
|
72
|
+
#lbl = Gtk.Label()
|
|
73
|
+
#lbl.set_markup("<big><b>ITkDB available commands.</b></big>")
|
|
74
|
+
#self.mainBox.pack_start(lbl, True, True, 0)
|
|
75
75
|
|
|
76
76
|
grid = Gtk.Grid(column_spacing=5, row_spacing=5)
|
|
77
77
|
self.mainBox.pack_start(grid, False, True, 5)
|
|
@@ -91,15 +91,20 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
91
91
|
btnTest.connect("clicked", self.upload_multiple_tests)
|
|
92
92
|
grid.attach(btnTest, 1, irow, 1, 1)
|
|
93
93
|
|
|
94
|
-
irow +=
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
grid.attach(btnGnd, 0, irow, 1, 1)
|
|
94
|
+
irow +=1
|
|
95
|
+
separator = Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL)
|
|
96
|
+
grid.attach(separator, 0, irow, 2, 1)
|
|
98
97
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
irow += 1
|
|
99
|
+
btnModVI = Gtk.Button(label="Module/Sensor Visual Insp.")
|
|
100
|
+
btnModVI.connect("clicked", self.module_VI)
|
|
101
|
+
grid.attach(btnModVI, 0, irow, 1, 1)
|
|
102
|
+
|
|
102
103
|
|
|
104
|
+
btnPanelVI = Gtk.Button(label="Panel Visual Insp.")
|
|
105
|
+
btnPanelVI.connect("clicked", self.panel_VI)
|
|
106
|
+
grid.attach(btnPanelVI, 1, irow, 1, 1)
|
|
107
|
+
|
|
103
108
|
irow += 1
|
|
104
109
|
btnModIV = Gtk.Button(label="Sensor/Module IV")
|
|
105
110
|
btnModIV.connect("clicked", self.module_IV)
|
|
@@ -110,20 +115,26 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
110
115
|
grid.attach(btnWireBond, 1, irow, 1, 1)
|
|
111
116
|
|
|
112
117
|
irow += 1
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
grid.attach(
|
|
118
|
+
btnWeight = Gtk.Button(label="GlueWeight")
|
|
119
|
+
btnWeight.connect("clicked", self.glue_weight)
|
|
120
|
+
grid.attach(btnWeight, 0, irow, 1, 1)
|
|
121
|
+
|
|
116
122
|
|
|
117
|
-
btnModVI = Gtk.Button(label="Module/Sensor Visual Insp.")
|
|
118
|
-
btnModVI.connect("clicked", self.module_VI)
|
|
119
|
-
grid.attach(btnModVI, 0, irow, 1, 1)
|
|
120
123
|
|
|
121
124
|
if HAS_PETALQC:
|
|
125
|
+
irow +=1
|
|
126
|
+
separator = Gtk.Separator(orientation=Gtk.Orientation.HORIZONTAL)
|
|
127
|
+
grid.attach(separator, 0, irow, 2, 1)
|
|
128
|
+
|
|
122
129
|
irow +=1
|
|
123
130
|
btnPetalInfo = Gtk.Button(label="AVS Petal Info")
|
|
124
131
|
btnPetalInfo.connect("clicked", self.upload_petal_info)
|
|
125
132
|
grid.attach(btnPetalInfo, 0, irow, 1, 1)
|
|
126
133
|
|
|
134
|
+
btnGnd = Gtk.Button(label="Petal Reception")
|
|
135
|
+
btnGnd.connect("clicked", self.petal_reception)
|
|
136
|
+
grid.attach(btnGnd, 1, irow, 1, 1)
|
|
137
|
+
|
|
127
138
|
irow +=1
|
|
128
139
|
btnPetalMetrology = Gtk.Button(label="Petal Core Metrology")
|
|
129
140
|
btnPetalMetrology.connect("clicked", self.petal_metrology)
|
|
@@ -211,19 +222,6 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
211
222
|
)
|
|
212
223
|
W.connect("destroy", self.app_closed, bitn)
|
|
213
224
|
|
|
214
|
-
def petal_gnd(self, *args):
|
|
215
|
-
"""Petal GND/VI test."""
|
|
216
|
-
bitn = DashWindow.PETAL_GND
|
|
217
|
-
bt = 1 << bitn
|
|
218
|
-
if self.mask & bt:
|
|
219
|
-
return
|
|
220
|
-
|
|
221
|
-
self.mask |= bt
|
|
222
|
-
W = PetalReceptionTests.PetalReceptionTests(
|
|
223
|
-
self.session,
|
|
224
|
-
help_link="{}/petalReceptionTests.html".format(HELP_LINK)
|
|
225
|
-
)
|
|
226
|
-
W.connect("destroy", self.app_closed, bitn)
|
|
227
225
|
|
|
228
226
|
def glue_weight(self, *args):
|
|
229
227
|
"""Glue Weight test."""
|
|
@@ -297,6 +295,21 @@ class DashWindow(dbGtkUtils.ITkDBWindow):
|
|
|
297
295
|
)
|
|
298
296
|
W.connect("destroy", self.app_closed, bitn)
|
|
299
297
|
W.show_all()
|
|
298
|
+
|
|
299
|
+
def petal_reception(self, *args):
|
|
300
|
+
"""Petal GND/VI test."""
|
|
301
|
+
bitn = DashWindow.PETAL_RECEPTION
|
|
302
|
+
bt = 1 << bitn
|
|
303
|
+
if self.mask & bt:
|
|
304
|
+
return
|
|
305
|
+
|
|
306
|
+
self.mask |= bt
|
|
307
|
+
W = PetalReceptionTests.PetalReceptionTests(
|
|
308
|
+
self.session,
|
|
309
|
+
help_link="{}/petalReceptionTests.html".format(HELP_LINK)
|
|
310
|
+
)
|
|
311
|
+
W.connect("destroy", self.app_closed, bitn)
|
|
312
|
+
|
|
300
313
|
|
|
301
314
|
def upload_petal_info(self, *srgs):
|
|
302
315
|
"""Upload petal Info."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: itkdb_gtk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.12.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
|
|
@@ -4,7 +4,6 @@ getShipments = itkdb_gtk:getShipments
|
|
|
4
4
|
glueWeight = itkdb_gtk:glueWeight
|
|
5
5
|
itkdb_dashBoard = itkdb_gtk:dash_board
|
|
6
6
|
panelVisualInspection = itkdb_gtk:panelVisualInspection
|
|
7
|
-
petalReceptionTests = itkdb_gtk:petalReceptionTests
|
|
8
7
|
uploadModuleIV = itkdb_gtk:uploadModuleIV
|
|
9
8
|
uploadMultipleTests = itkdb_gtk:uploadMultipleTests
|
|
10
9
|
uploadTest = itkdb_gtk:uploadTest
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "itkdb_gtk"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.12.0"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Carlos Lacasta", email="carlos.lacasta@cern.ch" },
|
|
10
10
|
]
|
|
@@ -30,7 +30,6 @@ classifiers = [
|
|
|
30
30
|
itkdb_dashBoard = "itkdb_gtk:dash_board"
|
|
31
31
|
getShipments = "itkdb_gtk:getShipments"
|
|
32
32
|
glueWeight = "itkdb_gtk:glueWeight"
|
|
33
|
-
petalReceptionTests = "itkdb_gtk:petalReceptionTests"
|
|
34
33
|
createShipments = "itkdb_gtk:createShipments"
|
|
35
34
|
uploadTest = "itkdb_gtk:uploadTest"
|
|
36
35
|
uploadMultipleTests = "itkdb_gtk:uploadMultipleTests"
|
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Test dashboard."""
|
|
3
|
-
import sys
|
|
4
|
-
import copy
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
|
|
7
|
-
try:
|
|
8
|
-
import itkdb_gtk
|
|
9
|
-
|
|
10
|
-
except ImportError:
|
|
11
|
-
cwd = Path(__file__).parent.parent
|
|
12
|
-
sys.path.append(cwd.as_posix())
|
|
13
|
-
import itkdb_gtk
|
|
14
|
-
|
|
15
|
-
from itkdb_gtk import dbGtkUtils, ITkDBlogin, ITkDButils
|
|
16
|
-
|
|
17
|
-
import gi
|
|
18
|
-
gi.require_version("Gtk", "3.0")
|
|
19
|
-
from gi.repository import Gtk, Gio
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def find_children(W):
|
|
23
|
-
"""Find DictDialog among the children."""
|
|
24
|
-
try:
|
|
25
|
-
for c in W.get_children():
|
|
26
|
-
if "DictDialog" in c.get_name():
|
|
27
|
-
return c
|
|
28
|
-
|
|
29
|
-
else:
|
|
30
|
-
return find_children(c)
|
|
31
|
-
|
|
32
|
-
except Exception:
|
|
33
|
-
return None
|
|
34
|
-
|
|
35
|
-
return None
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
class PetalReceptionTests(dbGtkUtils.ITkDBWindow):
|
|
39
|
-
"""Petl Reception Test GUI."""
|
|
40
|
-
|
|
41
|
-
def __init__(self, session, help_link=None):
|
|
42
|
-
"""Initialization."""
|
|
43
|
-
super().__init__(title="Petal Reception Tests",
|
|
44
|
-
session=session,
|
|
45
|
-
show_search="Find object with given SN.",
|
|
46
|
-
help_link=help_link)
|
|
47
|
-
|
|
48
|
-
# Members
|
|
49
|
-
self.dbObject = None
|
|
50
|
-
|
|
51
|
-
# action button in header
|
|
52
|
-
button = Gtk.Button()
|
|
53
|
-
icon = Gio.ThemedIcon(name="document-send-symbolic")
|
|
54
|
-
image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON)
|
|
55
|
-
button.add(image)
|
|
56
|
-
button.set_tooltip_text("Click to upload ALL tests.")
|
|
57
|
-
button.connect("clicked", self.upload_tests)
|
|
58
|
-
self.hb.pack_end(button)
|
|
59
|
-
|
|
60
|
-
grid = Gtk.Grid(column_spacing=5, row_spacing=1)
|
|
61
|
-
self.mainBox.pack_start(grid, False, False, 5)
|
|
62
|
-
|
|
63
|
-
lbl = Gtk.Label(label="Serial Number")
|
|
64
|
-
lbl.set_xalign(0)
|
|
65
|
-
grid.attach(lbl, 0, 0, 1, 1)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
self.SN = itkdb_gtk.dbGtkUtils.TextEntry()
|
|
69
|
-
self.SN.connect("text-changed", self.on_SN_changed)
|
|
70
|
-
|
|
71
|
-
#self.SN = Gtk.Entry()
|
|
72
|
-
#self.SN.connect("focus-in-event", self.on_sn_enter)
|
|
73
|
-
#self.SN.connect("focus-out-event", self.on_sn_leave)
|
|
74
|
-
grid.attach(self.SN.entry, 1, 0, 1, 1)
|
|
75
|
-
|
|
76
|
-
self.alias = Gtk.Label(label="")
|
|
77
|
-
grid.attach(self.alias, 2, 0, 1, 1)
|
|
78
|
-
|
|
79
|
-
self.stage = Gtk.Label(label="")
|
|
80
|
-
grid.attach(self.stage, 3, 0, 1, 1)
|
|
81
|
-
|
|
82
|
-
lbl = Gtk.Label(label="Institute")
|
|
83
|
-
lbl.set_xalign(0)
|
|
84
|
-
grid.attach(lbl, 0, 1, 1, 1)
|
|
85
|
-
|
|
86
|
-
self.institute = self.pdb_user["institutions"][0]["code"]
|
|
87
|
-
inst = self.create_institute_combo(only_user=True)
|
|
88
|
-
inst.connect("changed", self.new_institute)
|
|
89
|
-
inst.set_tooltip_text("Select the Institute.")
|
|
90
|
-
grid.attach(inst, 1, 1, 1, 1)
|
|
91
|
-
self.inst_cmb = inst
|
|
92
|
-
|
|
93
|
-
# The "Add/Remove/Send Item" buttons.
|
|
94
|
-
box = Gtk.ButtonBox(orientation=Gtk.Orientation.HORIZONTAL)
|
|
95
|
-
box.set_layout(Gtk.ButtonBoxStyle.END)
|
|
96
|
-
self.mainBox.pack_start(box, False, False, 0)
|
|
97
|
-
dbGtkUtils.add_button_to_container(box, "Upload test", "Upload this test", self.upload_single_test)
|
|
98
|
-
dbGtkUtils.add_button_to_container(box, "Add Defect", "Click to add a defect", self.add_defect)
|
|
99
|
-
dbGtkUtils.add_button_to_container(box, "Add Comment", "Click to add a comment", self.add_comment)
|
|
100
|
-
|
|
101
|
-
# The notebook
|
|
102
|
-
self.notebook = Gtk.Notebook()
|
|
103
|
-
self.notebook.set_tab_pos(Gtk.PositionType.LEFT)
|
|
104
|
-
self.notebook.set_size_request(-1, 250)
|
|
105
|
-
self.mainBox.pack_start(self.notebook, True, True, 0)
|
|
106
|
-
|
|
107
|
-
# Create the Notebook pages
|
|
108
|
-
self.create_test_box("Visual Inspection", "VISUAL_INSPECTION")
|
|
109
|
-
self.create_test_box("Grounding", "GROUNDING_CHECK")
|
|
110
|
-
self.create_test_box("Pipe bending", "BENDING120")
|
|
111
|
-
self.create_test_box("X-rays", "XRAYIMAGING")
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
# The text view
|
|
115
|
-
self.mainBox.pack_end(self.message_panel.frame, True, True, 5)
|
|
116
|
-
|
|
117
|
-
# Set the default institute
|
|
118
|
-
dbGtkUtils.set_combo_iter(inst, self.institute)
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
self.show_all()
|
|
122
|
-
|
|
123
|
-
def on_SN_changed(self, entry, value):
|
|
124
|
-
"""New SN given. Ask in PDB,"""
|
|
125
|
-
if len(value) <= 0:
|
|
126
|
-
return None
|
|
127
|
-
|
|
128
|
-
self.query_db()
|
|
129
|
-
current_location = self.dbObject["currentLocation"]["code"]
|
|
130
|
-
dbGtkUtils.set_combo_iter(self.inst_cmb, current_location, 0)
|
|
131
|
-
|
|
132
|
-
stg = self.dbObject["currentStage"]["name"]
|
|
133
|
-
self.stage.set_text(stg)
|
|
134
|
-
|
|
135
|
-
entry.set_text(self.dbObject["serialNumber"])
|
|
136
|
-
|
|
137
|
-
alias = self.dbObject["alternativeIdentifier"]
|
|
138
|
-
self.alias.set_text(alias)
|
|
139
|
-
|
|
140
|
-
npages = self.notebook.get_n_pages()
|
|
141
|
-
for i in range(npages):
|
|
142
|
-
page = self.notebook.get_nth_page(i)
|
|
143
|
-
page.dict_dialog.factory_reset()
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
def create_test_box(self, label, test_name, institute=None):
|
|
147
|
-
"""Create and add to notebook a test dialog.
|
|
148
|
-
|
|
149
|
-
Args:
|
|
150
|
-
label: The label for the Notebook
|
|
151
|
-
test_name: The DB name of the test
|
|
152
|
-
institute: The institute.
|
|
153
|
-
|
|
154
|
-
"""
|
|
155
|
-
if institute is None:
|
|
156
|
-
institute = self.institute
|
|
157
|
-
|
|
158
|
-
defaults = {
|
|
159
|
-
"institution": institute,
|
|
160
|
-
"runNumber": "1",
|
|
161
|
-
}
|
|
162
|
-
dto = ITkDButils.get_test_skeleton(self.session, "CORE_PETAL", test_name, defaults)
|
|
163
|
-
if test_name == "VISUAL_INSPECTION":
|
|
164
|
-
scrolled, gM = dbGtkUtils.create_scrolled_dictdialog(dto, ("component", "testType", "results"))
|
|
165
|
-
else:
|
|
166
|
-
scrolled, gM = dbGtkUtils.create_scrolled_dictdialog(dto)
|
|
167
|
-
|
|
168
|
-
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
|
169
|
-
box.set_border_width(5)
|
|
170
|
-
box.pack_end(scrolled, True, True, 0)
|
|
171
|
-
box.dict_dialog = gM
|
|
172
|
-
gM.box = box
|
|
173
|
-
|
|
174
|
-
self.notebook.append_page(box, Gtk.Label(label=label))
|
|
175
|
-
|
|
176
|
-
return gM
|
|
177
|
-
|
|
178
|
-
def query_db(self, *args):
|
|
179
|
-
"""Search button clicked."""
|
|
180
|
-
SN = self.SN.get_text()
|
|
181
|
-
if len(SN) == 0:
|
|
182
|
-
dbGtkUtils.complain("Empty Serial number",
|
|
183
|
-
"You should enter a valid Serial number for the petal core.",
|
|
184
|
-
parent=self)
|
|
185
|
-
|
|
186
|
-
try:
|
|
187
|
-
self.dbObject = ITkDButils.get_DB_component(self.session, SN)
|
|
188
|
-
|
|
189
|
-
except Exception as E:
|
|
190
|
-
self.write_message(str(E)+'\n')
|
|
191
|
-
dbGtkUtils.complain("Could not find object in DB", str(E))
|
|
192
|
-
self.dbObject = None
|
|
193
|
-
return
|
|
194
|
-
|
|
195
|
-
#print(json.dumps(self.dbObject, indent=3))
|
|
196
|
-
|
|
197
|
-
def add_defect(self, btn):
|
|
198
|
-
"""Add a new defect."""
|
|
199
|
-
page = self.notebook.get_nth_page(self.notebook.get_current_page())
|
|
200
|
-
values = dbGtkUtils.get_a_list_of_values("Insert new defect", ("Type", "Description/v"))
|
|
201
|
-
if len(values)>0:
|
|
202
|
-
defect = {"name": values[0], "description": values[1]}
|
|
203
|
-
page.dict_dialog.values["defects"].append(defect)
|
|
204
|
-
page.dict_dialog.refresh()
|
|
205
|
-
|
|
206
|
-
def add_comment(self, btn):
|
|
207
|
-
"""Add a new comment."""
|
|
208
|
-
page = self.notebook.get_nth_page(self.notebook.get_current_page())
|
|
209
|
-
comment = dbGtkUtils.get_a_value("Insert new comment", is_tv=True)
|
|
210
|
-
if comment:
|
|
211
|
-
page.dict_dialog.values["comments"].append(comment)
|
|
212
|
-
page.dict_dialog.refresh()
|
|
213
|
-
|
|
214
|
-
def new_institute(self, combo):
|
|
215
|
-
"""A new institute has been selected."""
|
|
216
|
-
inst = self.get_institute_from_combo(combo)
|
|
217
|
-
if inst:
|
|
218
|
-
self.institute = inst
|
|
219
|
-
|
|
220
|
-
npages = self.notebook.get_n_pages()
|
|
221
|
-
for i in range(npages):
|
|
222
|
-
page = self.notebook.get_nth_page(i)
|
|
223
|
-
page.dict_dialog.values["institution"] = self.institute
|
|
224
|
-
page.dict_dialog.refresh()
|
|
225
|
-
|
|
226
|
-
def upload_this_test(self, values):
|
|
227
|
-
"""Upload a single test."""
|
|
228
|
-
# print(json.dumps(values, indent=2))
|
|
229
|
-
|
|
230
|
-
attachments = []
|
|
231
|
-
if values["testType"] == "XRAYIMAGING":
|
|
232
|
-
fnam = values["results"]["IMAGELINK"]
|
|
233
|
-
if fnam is not None and len(fnam)>0:
|
|
234
|
-
P = Path(fnam).expanduser().resolve()
|
|
235
|
-
if P.exists():
|
|
236
|
-
A = ITkDButils.Attachment(path=P.as_posix(), title=P.name, desc="X-ray image")
|
|
237
|
-
values["results"]["IMAGELINK"] = P.name
|
|
238
|
-
attachments.append(A)
|
|
239
|
-
|
|
240
|
-
rc = ITkDButils.upload_test(self.session, values, attachments=attachments, check_runNumber=True)
|
|
241
|
-
if rc is not None:
|
|
242
|
-
dbGtkUtils.complain("Could not upload test", rc)
|
|
243
|
-
|
|
244
|
-
else:
|
|
245
|
-
self.write_message("Test uploaded. {} - {}\n".format(values["component"], values["testType"]))
|
|
246
|
-
|
|
247
|
-
def upload_single_test(self, *args):
|
|
248
|
-
"""Upload the current test."""
|
|
249
|
-
SN = self.SN.get_text()
|
|
250
|
-
if len(SN) == 0:
|
|
251
|
-
dbGtkUtils.complain("Petal SN is empty")
|
|
252
|
-
return
|
|
253
|
-
|
|
254
|
-
page = self.notebook.get_nth_page(self.notebook.get_current_page())
|
|
255
|
-
dctD = find_children(page)
|
|
256
|
-
if dctD is None:
|
|
257
|
-
return
|
|
258
|
-
|
|
259
|
-
values = copy.deepcopy(dctD.values)
|
|
260
|
-
values["component"] = SN
|
|
261
|
-
self.upload_this_test(values)
|
|
262
|
-
|
|
263
|
-
def upload_tests(self, *args):
|
|
264
|
-
"""Upload the current test."""
|
|
265
|
-
SN = self.SN.get_text()
|
|
266
|
-
if len(SN) == 0:
|
|
267
|
-
dbGtkUtils.complain("Petal SN is empty")
|
|
268
|
-
return
|
|
269
|
-
|
|
270
|
-
for ipage in range(self.notebook.get_n_pages()):
|
|
271
|
-
page = self.notebook.get_nth_page(ipage)
|
|
272
|
-
dctD = find_children(page)
|
|
273
|
-
if dctD is None:
|
|
274
|
-
continue
|
|
275
|
-
|
|
276
|
-
values = dctD.values
|
|
277
|
-
values["component"] = SN
|
|
278
|
-
self.upload_this_test(values)
|
|
279
|
-
|
|
280
|
-
def main():
|
|
281
|
-
"""Main entry."""
|
|
282
|
-
# DB login
|
|
283
|
-
HELP_LINK="https://itkdb-gtk.docs.cern.ch/petalReceptionTests.html"
|
|
284
|
-
|
|
285
|
-
dlg = ITkDBlogin.ITkDBlogin()
|
|
286
|
-
client = dlg.get_client()
|
|
287
|
-
if client is None:
|
|
288
|
-
print("Could not connect to DB with provided credentials.")
|
|
289
|
-
dlg.die()
|
|
290
|
-
sys.exit()
|
|
291
|
-
|
|
292
|
-
client.user_gui = dlg
|
|
293
|
-
|
|
294
|
-
gTest = PetalReceptionTests(client, help_link=HELP_LINK)
|
|
295
|
-
|
|
296
|
-
gTest.present()
|
|
297
|
-
gTest.connect("destroy", Gtk.main_quit)
|
|
298
|
-
try:
|
|
299
|
-
Gtk.main()
|
|
300
|
-
|
|
301
|
-
except KeyboardInterrupt:
|
|
302
|
-
print("Arrrgggg!!!")
|
|
303
|
-
|
|
304
|
-
dlg.die()
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
if __name__ == "__main__":
|
|
308
|
-
main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|