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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
|
id: qtgui_waterfall_sink_x
label: QT GUI Waterfall Sink
flags: [ python, cpp ]
parameters:
- id: type
label: Type
dtype: enum
default: complex
options: [complex, float, msg_complex, msg_float]
option_labels: [Complex, Float, Complex Message, Float Message]
option_attributes:
fcn: [waterfall_sink_c, waterfall_sink_f, waterfall_sink_c, waterfall_sink_f]
t: [complex, float, message, message]
hide: part
- id: name
label: Name
dtype: string
default: '""'
hide: ${ ('none' if len(name) > 0 else 'part') }
- id: fftsize
label: FFT Size
dtype: int
default: '1024'
hide: ${ ('all' if type.startswith('msg') else 'none') }
- id: freqhalf
label: Spectrum Width
dtype: enum
default: 'True'
options: ['True', 'False']
option_labels: [Full, Half]
hide: ${ ('part' if type == "float" or type == "msg_float" else 'all') }
- id: wintype
label: Window Type
dtype: int
default: firdes.WIN_BLACKMAN_hARRIS
options: [firdes.WIN_BLACKMAN_hARRIS, firdes.WIN_HAMMING, firdes.WIN_HANN, firdes.WIN_BLACKMAN,
firdes.WIN_RECTANGULAR, firdes.WIN_KAISER, firdes.WIN_FLATTOP]
option_labels: [Blackman-harris, Hamming, Hann, Blackman, Rectangular, Kaiser,
Flat-top]
hide: part
- id: fc
label: Center Frequency (Hz)
dtype: real
default: '0'
- id: bw
label: Bandwidth (Hz)
dtype: real
default: samp_rate
- id: int_min
label: Intensity Min
dtype: float
default: '-140'
hide: part
- id: int_max
label: Intensity Max
dtype: float
default: '10'
hide: part
- id: grid
label: Grid
dtype: enum
default: 'False'
options: ['True', 'False']
option_labels: ['Yes', 'No']
hide: part
- id: nconnections
label: Number of Inputs
dtype: int
default: '1'
hide: ${ ('all' if type.startswith('msg') else 'part') }
- id: update_time
label: Update Period
dtype: real
default: '0.10'
hide: part
- id: gui_hint
label: GUI Hint
dtype: gui_hint
hide: part
- id: showports
label: Show Msg Ports
dtype: bool
default: 'False'
hide: part
- id: legend
label: Legend
category: Config
dtype: enum
default: 'True'
options: ['True', 'False']
option_labels: ['Yes', 'No']
hide: part
- id: label1
label: Line 1 Label
category: Config
dtype: string
hide: ${ ('part' if int(nconnections) >= 1 else 'all') }
- id: axislabels
label: Axis Labels
category: Config
dtype: enum
default: 'True'
options: ['True', 'False']
option_labels: ['Yes', 'No']
hide: part
- id: color1
label: Line 1 Color
category: Config
dtype: enum
options: ['0', '1', '2', '3', '5', '6']
option_labels: [Multi Color, White Hot, Black Hot, Incandescent, Sunset, Cool]
hide: ${ ('part' if int(nconnections) >= 1 else 'all') }
- id: alpha1
label: Line 1 Alpha
category: Config
dtype: float
default: '1.0'
hide: ${ ('part' if int(nconnections) >= 1 else 'all') }
- id: label2
label: Line 2 Label
base_key: label1
hide: ${ ('part' if int(nconnections) >= 2 else 'all') }
- id: color2
label: Line 2 Color
base_key: color1
hide: ${ ('part' if int(nconnections) >= 2 else 'all') }
- id: alpha2
label: Line 2 Alpha
base_key: alpha1
hide: ${ ('part' if int(nconnections) >= 2 else 'all') }
- id: label3
label: Line 3 Label
base_key: label1
hide: ${ ('part' if int(nconnections) >= 3 else 'all') }
- id: color3
label: Line 3 Color
base_key: color1
hide: ${ ('part' if int(nconnections) >= 3 else 'all') }
- id: alpha3
label: Line 3 Alpha
base_key: alpha1
hide: ${ ('part' if int(nconnections) >= 3 else 'all') }
- id: label4
label: Line 4 Label
base_key: label1
hide: ${ ('part' if int(nconnections) >= 4 else 'all') }
- id: color4
label: Line 4 Color
base_key: color1
hide: ${ ('part' if int(nconnections) >= 4 else 'all') }
- id: alpha4
label: Line 4 Alpha
base_key: alpha1
hide: ${ ('part' if int(nconnections) >= 4 else 'all') }
- id: label5
label: Line 5 Label
base_key: label1
hide: ${ ('part' if int(nconnections) >= 5 else 'all') }
- id: color5
label: Line 5 Color
base_key: color1
hide: ${ ('part' if int(nconnections) >= 5 else 'all') }
- id: alpha5
label: Line 5 Alpha
base_key: alpha1
hide: ${ ('part' if int(nconnections) >= 5 else 'all') }
- id: label6
label: Line 6 Label
base_key: label1
hide: ${ ('part' if int(nconnections) >= 6 else 'all') }
- id: color6
label: Line 6 Color
base_key: color1
hide: ${ ('part' if int(nconnections) >= 6 else 'all') }
- id: alpha6
label: Line 6 Alpha
base_key: alpha1
hide: ${ ('part' if int(nconnections) >= 6 else 'all') }
- id: label7
label: Line 7 Label
base_key: label1
hide: ${ ('part' if int(nconnections) >= 7 else 'all') }
- id: color7
label: Line 7 Color
base_key: color1
hide: ${ ('part' if int(nconnections) >= 7 else 'all') }
- id: alpha7
label: Line 7 Alpha
base_key: alpha1
hide: ${ ('part' if int(nconnections) >= 7 else 'all') }
- id: label8
label: Line 8 Label
base_key: label1
hide: ${ ('part' if int(nconnections) >= 8 else 'all') }
- id: color8
label: Line 8 Color
base_key: color1
hide: ${ ('part' if int(nconnections) >= 8 else 'all') }
- id: alpha8
label: Line 8 Alpha
base_key: alpha1
hide: ${ ('part' if int(nconnections) >= 8 else 'all') }
- id: label9
label: Line 9 Label
base_key: label1
hide: ${ ('part' if int(nconnections) >= 9 else 'all') }
- id: color9
label: Line 9 Color
base_key: color1
hide: ${ ('part' if int(nconnections) >= 9 else 'all') }
- id: alpha9
label: Line 9 Alpha
base_key: alpha1
hide: ${ ('part' if int(nconnections) >= 9 else 'all') }
- id: label10
label: Line 10 Label
base_key: label1
hide: ${ ('part' if int(nconnections) >= 10 else 'all') }
- id: color10
label: Line 10 Color
base_key: color1
hide: ${ ('part' if int(nconnections) >= 10 else 'all') }
- id: alpha10
label: Line 10 Alpha
base_key: alpha1
hide: ${ ('part' if int(nconnections) >= 10 else 'all') }
inputs:
- domain: stream
dtype: ${ type.t }
multiplicity: ${ (0 if type.startswith('msg') else nconnections) }
optional: true
- domain: message
id: freq
optional: true
hide: ${ not showports }
- domain: message
id: bw
optional: true
hide: ${ not showports }
outputs:
- domain: message
id: freq
optional: true
hide: ${ not showports }
templates:
imports: |-
from PyQt5 import Qt
from gnuradio import qtgui
from gnuradio.filter import firdes
import sip
callbacks:
- set_frequency_range(${fc}, ${bw})
- set_update_time(${update_time})
- set_intensity_range(${int_min}, ${int_max})
make: |-
<%
win = 'self._%s_win'%id
%>\
qtgui.${type.fcn}(
${fftsize}, #size
${wintype}, #wintype
${fc}, #fc
${bw}, #bw
${name}, #name
${ (0 if type.startswith('msg') else nconnections) } #number of inputs
)
self.${id}.set_update_time(${update_time})
self.${id}.enable_grid(${grid})
self.${id}.enable_axis_labels(${axislabels})
% if legend == "False":
self.${id}.disable_legend()
% endif
% if type == "float" or type == "msg_float":
self.${id}.set_plot_pos_half(not ${freqhalf})
% endif
labels = [${label1}, ${label2}, ${label3}, ${label4}, ${label5},
${label6}, ${label7}, ${label8}, ${label9}, ${label10}]
colors = [${color1}, ${color2}, ${color3}, ${color4}, ${color5},
${color6}, ${color7}, ${color8}, ${color9}, ${color10}]
alphas = [${alpha1}, ${alpha2}, ${alpha3}, ${alpha4}, ${alpha5},
${alpha6}, ${alpha7}, ${alpha8}, ${alpha9}, ${alpha10}]
for i in range(${1 if type.startswith('msg') else nconnections}):
if len(labels[i]) == 0:
self.${id}.set_line_label(i, "Data {0}".format(i))
else:
self.${id}.set_line_label(i, labels[i])
self.${id}.set_color_map(i, colors[i])
self.${id}.set_line_alpha(i, alphas[i])
self.${id}.set_intensity_range(${int_min}, ${int_max})
${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget)
${gui_hint() % win}
cpp_templates:
includes: ['#include <gnuradio/qtgui/${type.fcn}.h>', '#include <gnuradio/filter/firdes.h>']
declarations: 'qtgui::${type.fcn}::sptr ${id};'
callbacks:
- set_frequency_range(${fc}, ${bw})
- set_update_time(${update_time})
link: ['gnuradio-qtgui', 'Qt5::Widgets']
make: |-
this->${id} = qtgui::${type.fcn}::make(
${fftsize}, // size
${wintype}, // wintype
${fc}, // fc
${bw}, // bw
${name}, // name
${ (0 if type.startswith('msg') else nconnections) } // number of inputs
);
std::string labels[10] = {"${label1.strip("'")}", "${label2.strip("'")}", "${label3.strip("'")}", "${label4.strip("'")}", "${label5.strip("'")}",
"${label6.strip("'")}", "${label7.strip("'")}", "${label8.strip("'")}", "${label9.strip("'")}", "${label10.strip("'")}"};
int colors[10] = {${color1 or 0}, ${color2 or 0}, ${color3 or 0}, ${color4 or 0}, ${color5 or 0},
${color6 or 0}, ${color7 or 0}, ${color8 or 0}, ${color9 or 0}, ${color10 or 0}};
double alphas[10] = {${alpha1 or 1.0}, ${alpha2 or 1.0}, ${alpha3 or 1.0}, ${alpha4 or 1.0}, ${alpha5 or 1.0},
${alpha6 or 1.0}, ${alpha7 or 1.0}, ${alpha8 or 1.0}, ${alpha9 or 1.0}, ${alpha10 or 1.0}};
QWidget* _${id}_win;
this->${id}->set_update_time(${update_time});
this->${id}->enable_grid(${grid});
this->${id}->enable_axis_labels(${axislabels});
if (!${legend}) {
this->${id}->disable_legend(); // if (!legend)
}
/* C++ doesn't have this
if ("${type}" == "float" or "${type}" == "msg_float") {
this->${id}->set_plot_pos_half(not ${freqhalf});
}*/
for (int i = 0; i < ${ 1 if (type == 'msg_complex' or type == 'msg_float') else nconnections }; i++) {
if (sizeof(labels[i]) == 0) {
this->${id}->set_line_label(i, "Data " + std::to_string(i));
} else {
this->${id}->set_line_label(i, labels[i]);
}
this->${id}->set_color_map(i, colors[i]);
this->${id}->set_line_alpha(i, alphas[i]);
}
this->${id}->set_intensity_range(${int_min}, ${int_max});
_${id}_win = this->${id}->qwidget();
this->top_layout->addWidget(_${id}_win);
translations:
firdes.: 'filter::firdes::'
'True': 'true'
'False': 'false'
documentation: |-
The GUI hint can be used to position the widget within the application. The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. Both the tab specification and the grid position are optional.
file_format: 1
|