summaryrefslogtreecommitdiff
path: root/gr-qtgui/grc/qtgui_range.xml.cmakein
blob: 71b614cc5e1549a9734fe67915d01f86b45c792d (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
<?xml version="1.0"?>
<!--
###################################################
##Variable Range:
##	ranged widgets like a slider or a knob
###################################################
 -->
<block>
  <name>QT GUI Range</name>
  <key>variable_qtgui_range</key>
  <import>from gnuradio.qtgui import Range, RangeWidget</import>
  <var_make>self.$(id) = $(id) = $value</var_make>
  <make>#set $win = 'self._%s_win'%$id
		#set $range = 'self._%s_range'%$id
#if not $label()
	#set $label = '"%s"'%$id
#end if
$(range) = Range($start, $stop, $step, $value, $min_len)
$(win) = RangeWidget($range, self.set_$(id), $label, "$widget", $rangeType)
$(gui_hint()($win))</make>
  <callback>self.set_$(id)($value)</callback>

  <param>
    <name>Label</name>
    <key>label</key>
    <value></value>
    <type>string</type>
    <hide>#if $label() then 'none' else 'part'#</hide>
  </param>

  <param>
    <name>Type</name>
    <key>rangeType</key>
    <value>"float"</value>
    <type>enum</type>
    <hide>part</hide>
    <option><name>Float</name><key>float</key><opt>type:float</opt></option>
    <option><name>Int</name><key>int</key><opt>type:int</opt></option>
  </param>

  <param>
    <name>Default Value</name>
    <key>value</key>
    <value>50</value>
    <type>$rangeType.type</type>
  </param>

  <param>
    <name>Start</name>
    <key>start</key>
    <value>0</value>
    <type>$rangeType.type</type>
  </param>

  <param>
    <name>Stop</name>
    <key>stop</key>
    <value>100</value>
    <type>$rangeType.type</type>
  </param>

  <param>
    <name>Step</name>
    <key>step</key>
    <value>1</value>
    <type>$rangeType.type</type>
  </param>

  <param>
    <name>Widget</name>
    <key>widget</key>
    <value>counter_slider</value>
    <type>enum</type>
    <hide>part</hide>
    <option><name>Counter + Slider</name><key>counter_slider</key></option>
    <option><name>Counter</name><key>counter</key></option>
    <option><name>Slider</name><key>slider</key></option>
    <option><name>Knob</name><key>dial</key></option>
  </param>

  <param>
    <name>Orientation</name>
    <key>orient</key>
    <value>Qt.Horizontal</value>
    <type>enum</type>
    <hide>#if $widget() == "slider" then 'part' else 'all'#</hide>
    <option>
      <name>Horizontal</name>
      <key>Qt.Horizontal</key>
      <opt>scalepos:BottomScale</opt>
      <opt>minfcn:setMinimumWidth</opt>
    </option>
    <option>
      <name>Vertical</name>
      <key>Qt.Vertical</key>
      <opt>scalepos:LeftScale</opt>
      <opt>minfcn:setMinimumHeight</opt>
    </option>
  </param>

  <param>
    <name>Minimum Length</name>
    <key>min_len</key>
    <value>200</value>
    <type>int</type>
    <hide>part</hide>
  </param>
  <!--	from min_len	<hide>#if $widget().split('_')[0] in ("slider", "counter") then 'part' else 'all'#</hide>-->

  <param>
    <name>GUI Hint</name>
    <key>gui_hint</key>
    <value></value>
    <type>gui_hint</type>
    <hide>part</hide>
  </param>

  <check>$start &lt;= $value &lt;= $stop</check>
  <check>$start &lt; $stop</check>

  <doc>
    This block creates a variable with a slider. \
    Leave the label blank to use the variable id as the label. \
    The value must be a real number. \
    The value must be between the start and the stop.

    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.
  </doc>
</block>