1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 """The Bruker Dynamics Center user function GUI elements."""
25
26
27 from string import split
28 import wx
29
30
31 from generic_fns import pipes
32
33
34 from base import UF_base, UF_page
35 from gui.paths import WIZARD_IMAGE_PATH
36 from gui.misc import gui_to_float, gui_to_int, gui_to_str, str_to_gui
37
38
39
41 """The container class for holding all GUI elements."""
42
49
50
51
52 -class Read_page(UF_page):
53 """The bruker.read() user function page."""
54
55
56 height_desc = 140
57 image_path = WIZARD_IMAGE_PATH + 'bruker.png'
58 uf_path = ['bruker', 'read']
59
60 - def add_contents(self, sizer):
61 """Add the Bruker Dynamics Center reading specific GUI elements.
62
63 @param sizer: A sizer object.
64 @type sizer: wx.Sizer instance
65 """
66
67
68 self.file = self.file_selection(sizer, "The Bruker Dynamics Center file:", message="Bruker Dynamics Center file selection", style=wx.FD_OPEN, tooltip=self.uf._doc_args_dict['file'])
69
70
71 self.ri_id = self.input_field(sizer, "The relaxation data ID:", tooltip=self.uf._doc_args_dict['ri_id'])
72
73
74 - def on_execute(self):
75 """Execute the user function."""
76
77
78 ri_id = gui_to_str(self.ri_id.GetValue())
79
80
81 file = gui_to_str(self.file.GetValue())
82
83
84 if not file:
85 return
86
87
88 self.execute('bruker.read', ri_id=ri_id, file=file)
89