summaryrefslogtreecommitdiff
path: root/gnuradio-examples/python/apps/hf_radio/ui.py
blob: 71b73c128ee23d99f1ef0b0c65f2ccf97ec05b1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# generated by wxGlade 0.4 on Mon Jan  2 19:02:03 2006

import wx

class ui_frame(wx.Frame):
    def __init__(self, *args, **kwds):
        # begin wxGlade: ui_frame.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.sizer_1_staticbox = wx.StaticBox(self, -1, "sizer_1")
        self.freq_disp = wx.SpinCtrl(self, -1, "", min=0, max=100)
        self.spin_e6 = wx.SpinButton(self, -1 )
        self.spin_e5 = wx.SpinButton(self, -1 )
        self.spin_e4 = wx.SpinButton(self, -1 )
        self.spin_e3 = wx.SpinButton(self, -1 )
        self.spin_e2 = wx.SpinButton(self, -1 )
        self.spin_e1 = wx.SpinButton(self, -1 )
        self.spin_e0 = wx.SpinButton(self, -1 )
        self.panel_1 = wx.Panel(self, -1)
        self.panel_2 = wx.Panel(self, -1)
        self.button_lsb = wx.Button(self, -1, "LSB")
        self.button_usb = wx.Button(self, -1, "USB")
        self.button_am = wx.Button(self, -1, "AM")
        self.label_1 = wx.StaticText(self, -1, "VOLUME")
        self.label_2 = wx.StaticText(self, -1, "PGA")
        self.agc_level = wx.TextCtrl(self, -1, "")
        self.label_6 = wx.StaticText(self, -1, "")
        self.volume = wx.SpinCtrl(self, -1, "", min=0, max=100)
        self.pga = wx.SpinCtrl(self, -1, "", min=0, max=100)
        self.agc_max = wx.TextCtrl(self, -1, "")
        self.label_7 = wx.StaticText(self, -1, "")
        self.label_4 = wx.StaticText(self, -1, "AGC AUTHORITY")
        self.label_5 = wx.StaticText(self, -1, "AGC REF LVL")
        self.label_3 = wx.StaticText(self, -1, "BANDWIDTH")
        self.label_8 = wx.StaticText(self, -1, "")
        self.agc_gain = wx.TextCtrl(self, -1, "")
        self.agc_gain_s = wx.SpinButton(self, -1 )
        self.agc_ref = wx.TextCtrl(self, -1, "")
        self.agc_ref_s = wx.SpinButton(self, -1 )
        self.bandwidth = wx.TextCtrl(self, -1, "")
        self.bw_spin = wx.SpinButton(self, -1 )
        self.label_9 = wx.StaticText(self, -1, "")
        self.rssi = wx.Gauge(self, -1, 10, style=wx.GA_HORIZONTAL|wx.GA_SMOOTH)
        self.fe_panel = wx.Panel(self, -1)
        self.if_panel = wx.Panel(self, -1)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_SPINCTRL, self.tune_evt, self.freq_disp)
        self.Bind(wx.EVT_SPIN_DOWN, self.down_e6, self.spin_e6)
        self.Bind(wx.EVT_SPIN_UP, self.up_e6, self.spin_e6)
        self.Bind(wx.EVT_SPIN_DOWN, self.down_e5, self.spin_e5)
        self.Bind(wx.EVT_SPIN_UP, self.up_e5, self.spin_e5)
        self.Bind(wx.EVT_SPIN_DOWN, self.down_e4, self.spin_e4)
        self.Bind(wx.EVT_SPIN_UP, self.up_e4, self.spin_e4)
        self.Bind(wx.EVT_SPIN_DOWN, self.down_e3, self.spin_e3)
        self.Bind(wx.EVT_SPIN_UP, self.up_e3, self.spin_e3)
        self.Bind(wx.EVT_SPIN_DOWN, self.down_e2, self.spin_e2)
        self.Bind(wx.EVT_SPIN_UP, self.up_e2, self.spin_e2)
        self.Bind(wx.EVT_SPIN_DOWN, self.down_e1, self.spin_e1)
        self.Bind(wx.EVT_SPIN_UP, self.up_e1, self.spin_e1)
        self.Bind(wx.EVT_SPIN_DOWN, self.down_e0, self.spin_e0)
        self.Bind(wx.EVT_SPIN_UP, self.up_e0, self.spin_e0)
        self.Bind(wx.EVT_BUTTON, self.set_lsb, self.button_lsb)
        self.Bind(wx.EVT_BUTTON, self.set_usb, self.button_usb)
        self.Bind(wx.EVT_BUTTON, self.set_am, self.button_am)
        self.Bind(wx.EVT_SPINCTRL, self.event_vol, self.volume)
        self.Bind(wx.EVT_SPINCTRL, self.event_pga, self.pga)
        self.Bind(wx.EVT_SPIN_DOWN, self.agc_gain_down, self.agc_gain_s)
        self.Bind(wx.EVT_SPIN_UP, self.agc_gain_up, self.agc_gain_s)
        self.Bind(wx.EVT_SPIN_DOWN, self.agc_ref_down, self.agc_ref_s)
        self.Bind(wx.EVT_SPIN_UP, self.agc_ref_up, self.agc_ref_s)
        self.Bind(wx.EVT_SPIN_DOWN, self.bw_down, self.bw_spin)
        self.Bind(wx.EVT_SPIN_UP, self.bw_up, self.bw_spin)
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: ui_frame.__set_properties
        self.SetTitle("frame_1")
        self.freq_disp.SetFont(wx.Font(32, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
        self.rssi.SetMinSize((315, 10))
        self.rssi.SetForegroundColour(wx.Colour(255, 0, 0))
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: ui_frame.__do_layout
        sizer_1 = wx.StaticBoxSizer(self.sizer_1_staticbox, wx.VERTICAL)
        sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_4 = wx.BoxSizer(wx.VERTICAL)
        grid_sizer_4 = wx.GridSizer(2, 4, 0, 0)
        sizer_5 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_7 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_6 = wx.BoxSizer(wx.HORIZONTAL)
        grid_sizer_3 = wx.GridSizer(2, 4, 0, 0)
        sizer_3 = wx.BoxSizer(wx.VERTICAL)
        grid_sizer_1 = wx.GridSizer(2, 3, 0, 0)
        grid_sizer_2 = wx.GridSizer(1, 7, 0, 0)
        sizer_3.Add(self.freq_disp, 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
        grid_sizer_2.Add(self.spin_e6, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_2.Add(self.spin_e5, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_2.Add(self.spin_e4, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_2.Add(self.spin_e3, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_2.Add(self.spin_e2, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_2.Add(self.spin_e1, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_2.Add(self.spin_e0, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_1.Add(grid_sizer_2, 1, wx.EXPAND, 0)
        grid_sizer_1.Add(self.panel_1, 1, wx.EXPAND, 0)
        grid_sizer_1.Add(self.panel_2, 1, wx.EXPAND, 0)
        grid_sizer_1.Add(self.button_lsb, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_1.Add(self.button_usb, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_1.Add(self.button_am, 0, wx.ADJUST_MINSIZE, 0)
        sizer_3.Add(grid_sizer_1, 1, wx.EXPAND, 0)
        sizer_2.Add(sizer_3, 1, wx.EXPAND, 0)
        grid_sizer_3.Add(self.label_1, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_3.Add(self.label_2, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_3.Add(self.agc_level, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_3.Add(self.label_6, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_3.Add(self.volume, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_3.Add(self.pga, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_3.Add(self.agc_max, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_3.Add(self.label_7, 0, wx.ADJUST_MINSIZE, 0)
        sizer_4.Add(grid_sizer_3, 1, wx.EXPAND, 0)
        grid_sizer_4.Add(self.label_4, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_4.Add(self.label_5, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_4.Add(self.label_3, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_4.Add(self.label_8, 0, wx.ADJUST_MINSIZE, 0)
        sizer_6.Add(self.agc_gain, 0, wx.ADJUST_MINSIZE, 0)
        sizer_6.Add(self.agc_gain_s, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_4.Add(sizer_6, 1, wx.EXPAND, 0)
        sizer_7.Add(self.agc_ref, 0, wx.ADJUST_MINSIZE, 0)
        sizer_7.Add(self.agc_ref_s, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_4.Add(sizer_7, 1, wx.EXPAND, 0)
        sizer_5.Add(self.bandwidth, 0, wx.ADJUST_MINSIZE, 0)
        sizer_5.Add(self.bw_spin, 0, wx.ADJUST_MINSIZE, 0)
        grid_sizer_4.Add(sizer_5, 1, wx.EXPAND, 0)
        grid_sizer_4.Add(self.label_9, 0, wx.ADJUST_MINSIZE, 0)
        sizer_4.Add(grid_sizer_4, 1, wx.EXPAND, 0)
        sizer_4.Add(self.rssi, 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
        sizer_2.Add(sizer_4, 1, wx.EXPAND, 0)
        sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
        sizer_1.Add(self.fe_panel, 1, wx.EXPAND, 0)
        sizer_1.Add(self.if_panel, 1, wx.EXPAND, 0)
        self.SetAutoLayout(True)
        self.SetSizer(sizer_1)
        sizer_1.Fit(self)
        sizer_1.SetSizeHints(self)
        self.Layout()
        # end wxGlade

    def down_e6(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `down_e6' not implemented"
        event.Skip()

    def up_e6(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `up_e6' not implemented"
        event.Skip()

    def down_e5(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `down_e5' not implemented"
        event.Skip()

    def up_e5(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `up_e5' not implemented"
        event.Skip()

    def down_e4(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `down_e4' not implemented"
        event.Skip()

    def up_e4(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `up_e4' not implemented"
        event.Skip()

    def down_e3(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `down_e3' not implemented"
        event.Skip()

    def up_e3(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `up_e3' not implemented"
        event.Skip()

    def down_e2(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `down_e2' not implemented"
        event.Skip()

    def up_e2(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `up_e2' not implemented"
        event.Skip()

    def down_e1(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `down_e1' not implemented"
        event.Skip()

    def up_e1(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `up_e1' not implemented"
        event.Skip()

    def down_e0(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `down_e0' not implemented"
        event.Skip()

    def up_e0(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `up_e0' not implemented"
        event.Skip()

    def event_vol(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `event_vol' not implemented"
        event.Skip()

    def event_pga(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `event_pga' not implemented"
        event.Skip()

    def set_lsb(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `set_lsb' not implemented"
        event.Skip()

    def set_usb(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `set_usb' not implemented"
        event.Skip()

    def set_am(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `set_am' not implemented"
        event.Skip()

    def set_bw(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `set_bw' not implemented"
        event.Skip()

    def tune_evt(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `tune_evt' not implemented"
        event.Skip()

    def bw_down(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `bw_down' not implemented"
        event.Skip()

    def bw_up(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `bw_up' not implemented"
        event.Skip()

    def agc_gain_down(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `agc_gain_down' not implemented"
        event.Skip()

    def agc_gain_up(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `agc_gain_up' not implemented"
        event.Skip()

    def agc_ref_down(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `agc_ref_down' not implemented"
        event.Skip()

    def agc_ref_up(self, event): # wxGlade: ui_frame.<event_handler>
        print "Event handler `agc_ref_up' not implemented"
        event.Skip()

# end of class ui_frame


class RadioFrame(wx.Frame):
    def __init__(self, *args, **kwds):
        # content of this block not found: did you rename this class?
        pass

    def __set_properties(self):
        # content of this block not found: did you rename this class?
        pass

    def __do_layout(self):
        # content of this block not found: did you rename this class?
        pass

# end of class RadioFrame


class MyFrame(wx.Frame):
    def __init__(self, *args, **kwds):
        # content of this block not found: did you rename this class?
        pass

    def __set_properties(self):
        # content of this block not found: did you rename this class?
        pass

    def __do_layout(self):
        # content of this block not found: did you rename this class?
        pass

# end of class MyFrame