gr-fosphor/grc: Convert GRC blocks to YAML for 3.8

Part of GNURadio 3.8 migration

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
Sylvain Munaut 2018-09-21 22:30:21 -07:00
parent d7c472ec47
commit f9aa89ce7f
6 changed files with 118 additions and 166 deletions

View File

@ -17,10 +17,10 @@
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
list_cond_append(ENABLE_GLFW fosphor_grc fosphor_glfw_sink_c.xml)
list_cond_append(ENABLE_QT fosphor_grc fosphor_qt_sink_c.xml)
list_cond_append(ENABLE_GLFW fosphor_grc fosphor_glfw_sink_c.block.yml)
list_cond_append(ENABLE_QT fosphor_grc fosphor_qt_sink_c.block.yml)
install(FILES
${fosphor_grc}
fosphor.tree.yml ${fosphor_grc}
DESTINATION share/gnuradio/grc/blocks
)

6
grc/fosphor.tree.yml Normal file
View File

@ -0,0 +1,6 @@
'[Core]':
- Instrumentation:
- QT:
- fosphor_qt_sink_c
- GLFW:
- fosphor_glfw_sink_c

View File

@ -0,0 +1,49 @@
id: fosphor_glfw_sink_c
label: fosphor sink (GLFW)
parameters:
- 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: freq_center
label: Center Frequency (Hz)
dtype: real
default: '0'
- id: freq_span
label: span (Hz)
dtype: real
default: samp_rate
inputs:
- domain: stream
dtype: complex
templates:
imports: |-
from gnuradio import fosphor
from gnuradio.fft import window
make: |-
fosphor.glfw_sink_c()
self.${id}.set_fft_window(${wintype})
self.${id}.set_frequency_range(${freq_center}, ${freq_span})
callbacks:
- set_fft_window(${wintype})
- set_frequency_range(${freq_center}, ${freq_span})
documentation: |-
Key Bindings
============
z: toggle zoom mode
a/d: move zoom frequency down/up
s/w: adjust zoom width
q/e: adjust screen split between waterfall and fft
space: pause display
(left)/(right) adjust dB/div
(up)/(down) adjust reference level
file_format: 1

View File

@ -1,74 +0,0 @@
<?xml version="1.0"?>
<block>
<name>fosphor sink (GLFW)</name>
<key>fosphor_glfw_sink_c</key>
<category>Instrumentation</category>
<import>from gnuradio import fosphor</import>
<import>from gnuradio.fft import window</import>
<make>fosphor.glfw_sink_c()
self.$(id).set_fft_window($wintype)
self.$(id).set_frequency_range($freq_center, $freq_span)
</make>
<callback>set_fft_window($wintype)</callback>
<callback>set_frequency_range($freq_center, $freq_span)</callback>
<param>
<name>Window Type</name>
<key>wintype</key>
<value>window.WIN_BLACKMAN_hARRIS</value>
<type>int</type>
<hide>part</hide>
<option>
<name>Blackman-harris</name>
<key>window.WIN_BLACKMAN_hARRIS</key>
</option>
<option>
<name>Hamming</name>
<key>window.WIN_HAMMING</key>
</option>
<option>
<name>Hann</name>
<key>window.WIN_HANN</key>
</option>
<option>
<name>Blackman</name>
<key>window.WIN_BLACKMAN</key>
</option>
<option>
<name>Rectangular</name>
<key>window.WIN_RECTANGULAR</key>
</option>
<option>
<name>Kaiser</name>
<key>window.WIN_KAISER</key>
</option>
</param>
<param>
<name>Center Frequency (Hz)</name>
<key>freq_center</key>
<value>0</value>
<type>real</type>
</param>
<param>
<name>Span (Hz)</name>
<key>freq_span</key>
<value>samp_rate</value>
<type>real</type>
</param>
<sink>
<name>in</name>
<type>complex</type>
</sink>
<doc>
Key Bindings
============
z: toggle zoom mode
a/d: move zoom frequency down/up
s/w: adjust zoom width
q/e: adjust screen split between waterfall and fft
space: pause display
(left)/(right) adjust dB/div
(up)/(down) adjust reference level
</doc>
</block>

View File

@ -0,0 +1,60 @@
id: fosphor_qt_sink_c
label: fosphor sink (Qt)
parameters:
- 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: freq_center
label: Center Frequency (Hz)
dtype: real
default: '0'
- id: freq_span
label: span (Hz)
dtype: real
default: samp_rate
- id: gui_hint
label: GUI Hint
dtype: gui_hint
hide: part
inputs:
- domain: stream
dtype: complex
templates:
imports: |-
from PyQt5 import Qt
import sip
from gnuradio import fosphor
from gnuradio.fft import window
make: |-
<%
win = 'self._%s_win' % id
%>\
fosphor.qt_sink_c()
self.${id}.set_fft_window(${wintype})
self.${id}.set_frequency_range(${freq_center}, ${freq_span})
${win} = sip.wrapinstance(self.${id}.pyqwidget(), Qt.QWidget)
${gui_hint() % win}
callbacks:
- set_fft_window(${wintype})
- set_frequency_range(${freq_center}, ${freq_span})
documentation: |-
Key Bindings
============
z: toggle zoom mode
a/d: move zoom frequency down/up
s/w: adjust zoom width
q/e: adjust screen split between waterfall and fft
space: pause display
(left)/(right) adjust dB/div
(up)/(down) adjust reference level
file_format: 1

View File

@ -1,89 +0,0 @@
<?xml version="1.0"?>
<block>
<name>QT fosphor sink</name>
<key>fosphor_qt_sink_c</key>
<category>Instrumentation/QT</category>
<import>from PyQt5 import Qt</import>
<import>import sip</import>
<import>from gnuradio import fosphor</import>
<import>from gnuradio.fft import window</import>
<make>#set $win = 'self._%s_win'%$id
fosphor.qt_sink_c()
self.$(id).set_fft_window($wintype)
self.$(id).set_frequency_range($freq_center, $freq_span)
self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget)
$(gui_hint()($win))</make>
<callback>set_fft_window($wintype)</callback>
<callback>set_frequency_range($freq_center, $freq_span)</callback>
<param>
<name>Window Type</name>
<key>wintype</key>
<value>window.WIN_BLACKMAN_hARRIS</value>
<type>int</type>
<hide>part</hide>
<option>
<name>Blackman-harris</name>
<key>window.WIN_BLACKMAN_hARRIS</key>
</option>
<option>
<name>Hamming</name>
<key>window.WIN_HAMMING</key>
</option>
<option>
<name>Hann</name>
<key>window.WIN_HANN</key>
</option>
<option>
<name>Blackman</name>
<key>window.WIN_BLACKMAN</key>
</option>
<option>
<name>Rectangular</name>
<key>window.WIN_RECTANGULAR</key>
</option>
<option>
<name>Kaiser</name>
<key>window.WIN_KAISER</key>
</option>
</param>
<param>
<name>Center Frequency (Hz)</name>
<key>freq_center</key>
<value>0</value>
<type>real</type>
</param>
<param>
<name>Span (Hz)</name>
<key>freq_span</key>
<value>samp_rate</value>
<type>real</type>
</param>
<param>
<name>GUI Hint</name>
<key>gui_hint</key>
<value></value>
<type>gui_hint</type>
<hide>part</hide>
</param>
<sink>
<name>in</name>
<type>complex</type>
</sink>
<doc>
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.
Key Bindings
============
z: toggle zoom mode
a/d: move zoom frequency down/up
s/w: adjust zoom width
q/e: adjust screen split between waterfall and fft
space: pause display
(left)/(right) adjust dB/div
(up)/(down) adjust reference level
</doc>
</block>