<?xml version="1.0"?>
<!--
###################################################
##QT GUI Number Sink
###################################################
 -->
<block>
  <name>QT GUI Number Sink</name>
  <key>qtgui_number_sink</key>
  <import>from PyQt4 import Qt</import>
  <import>from gnuradio import qtgui</import>
  <import>import sip</import>
  <make>#set $win = 'self._%s_win'%$id
qtgui.number_sink(
    $type.size,
    $avg,
    $graph_type,
    $nconnections
)
self.$(id).set_update_time($update_time)
self.$(id).set_title($name)

labels = [$label1, $label2, $label3, $label4, $label5,
          $label6, $label7, $label8, $label9, $label10]
units = [$unit1, $unit2, $unit3, $unit4, $unit5,
         $unit6, $unit7, $unit8, $unit9, $unit10]
colors = [$color1, $color2, $color3, $color4, $color5,
          $color6, $color7, $color8, $color9, $color10]
factor = [$factor1, $factor2, $factor3, $factor4, $factor5,
          $factor6, $factor7, $factor8, $factor9, $factor10]
for i in xrange($nconnections):
    self.$(id).set_min(i, $min)
    self.$(id).set_max(i, $max)
    self.$(id).set_color(i, colors[i][0], colors[i][1])
    if len(labels[i]) == 0:
        self.$(id).set_label(i, "Data {0}".format(i))
    else:
        self.$(id).set_label(i, labels[i])
    self.$(id).set_unit(i, units[i])
    self.$(id).set_factor(i, factor[i])

self.$(id).enable_autoscale($autoscale)
self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget)
$(gui_hint() % $win)</make>

  <callback>set_update_time($update_time)</callback>

  <param_tab_order>
    <tab>General</tab>
    <tab>Config</tab>
  </param_tab_order>

  <param>
    <name>Name</name>
    <key>name</key>
    <value>""</value>
    <type>string</type>
    <hide>#if len($name()) > 0 then 'none' else 'part'#</hide>
  </param>

  <param>
    <name>Input Type</name>
    <key>type</key>
    <type>enum</type>
    <option>
      <name>Float</name>
      <key>float</key>
      <opt>size:gr.sizeof_float</opt>
    </option>
    <option>
      <name>Int</name>
      <key>int</key>
      <opt>size:gr.sizeof_int</opt>
    </option>
    <option>
      <name>Short</name>
      <key>short</key>
      <opt>size:gr.sizeof_short</opt>
    </option>
    <option>
      <name>Byte</name>
      <key>byte</key>
      <opt>size:gr.sizeof_char</opt>
    </option>
    <tab>General</tab>
  </param>

  <param>
    <name>Autoscale</name>
    <key>autoscale</key>
    <value>False</value>
    <type>enum</type>
    <option>
      <name>Yes</name>
      <key>True</key>
    </option>
    <option>
      <name>No</name>
      <key>False</key>
    </option>
  </param>

  <param>
    <name>Average</name>
    <key>avg</key>
    <value>0</value>
    <type>float</type>
    <tab>General</tab>
  </param>

  <param>
    <name>Graph Type</name>
    <key>graph_type</key>
    <type>enum</type>
    <option>
      <name>Horizontal</name>
      <key>qtgui.NUM_GRAPH_HORIZ</key>
    </option>
    <option>
      <name>Vertical</name>
      <key>qtgui.NUM_GRAPH_VERT</key>
    </option>
    <option>
      <name>None</name>
      <key>qtgui.NUM_GRAPH_NONE</key>
    </option>
    <tab>General</tab>
  </param>

  <param>
    <name>Number of Inputs</name>
    <key>nconnections</key>
    <value>1</value>
    <type>int</type>
    <hide>part</hide>
    <tab>General</tab>
  </param>

  <param>
    <name>Min</name>
    <key>min</key>
    <value>-1</value>
    <type>float</type>
    <hide>part</hide>
  </param>
  <param>
    <name>Max</name>
    <key>max</key>
    <value>1</value>
    <type>float</type>
    <hide>part</hide>
  </param>

  <param>
    <name>Update Period</name>
    <key>update_time</key>
    <value>0.10</value>
    <type>float</type>
    <hide>part</hide>
    <tab>General</tab>
  </param>

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

  <param>
    <name>Line 1 Label</name>
    <key>label1</key>
    <type>string</type>
    <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide>
    <tab>Config</tab>
  </param>

  <param>
    <name>Line 1 Unit</name>
    <key>unit1</key>
    <type>string</type>
    <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide>
    <tab>Config</tab>
  </param>

  <param>
    <name>Line 1 Color</name>
    <key>color1</key>
    <type>enum</type>
    <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide>
    <option>
      <name>Black</name>
      <key>("black", "black")</key>
    </option>
    <option>
      <name>Blue-Red</name>
      <key>("blue", "red")</key>
    </option>
    <option>
      <name>White Hot</name>
      <key>("black", "white")</key>
    </option>
    <option>
      <name>Black Hot</name>
      <key>("white", "black")</key>
    </option>
    <option>
      <name>Black-Red</name>
      <key>("black", "red")</key>
    </option>
    <tab>Config</tab>
  </param>

  <param>
    <name>Line 1 Factor</name>
    <key>factor1</key>
    <value>1</value>
    <type>float</type>
    <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide>
    <tab>Config</tab>
  </param>


  <param>
    <base_key>label1</base_key>
    <name>Line 2 Label</name>
    <key>label2</key>
    <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>unit1</base_key>
    <name>Line 2 Unit</name>
    <key>unit2</key>
    <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>color1</base_key>
    <name>Line 2 Color</name>
    <key>color2</key>
    <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>factor1</base_key>
    <name>Line 2 Factor</name>
    <key>factor2</key>
    <hide>#if int($nconnections()) >= 2 then 'part' else 'all'#</hide>
  </param>


  <param>
    <base_key>label1</base_key>
    <name>Line 3 Label</name>
    <key>label3</key>
    <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>unit1</base_key>
    <name>Line 3 Unit</name>
    <key>unit3</key>
    <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>color1</base_key>
    <name>Line 3 Color</name>
    <key>color3</key>
    <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>factor1</base_key>
    <name>Line 3 Factor</name>
    <key>factor3</key>
    <hide>#if int($nconnections()) >= 3 then 'part' else 'all'#</hide>
  </param>


  <param>
    <base_key>label1</base_key>
    <name>Line 4 Label</name>
    <key>label4</key>
    <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>unit1</base_key>
    <name>Line 4 Unit</name>
    <key>unit4</key>
    <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>color1</base_key>
    <name>Line 4 Color</name>
    <key>color4</key>
    <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>factor1</base_key>
    <name>Line 4 Factor</name>
    <key>factor4</key>
    <hide>#if int($nconnections()) >= 4 then 'part' else 'all'#</hide>
  </param>


  <param>
    <base_key>label1</base_key>
    <name>Line 5 Label</name>
    <key>label5</key>
    <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>unit1</base_key>
    <name>Line 5 Unit</name>
    <key>unit5</key>
    <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>color1</base_key>
    <name>Line 5 Color</name>
    <key>color5</key>
    <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>factor1</base_key>
    <name>Line 5 Factor</name>
    <key>factor5</key>
    <hide>#if int($nconnections()) >= 5 then 'part' else 'all'#</hide>
  </param>


  <param>
    <base_key>label1</base_key>
    <name>Line 6 Label</name>
    <key>label6</key>
    <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>unit1</base_key>
    <name>Line 6 Unit</name>
    <key>unit6</key>
    <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>color1</base_key>
    <name>Line 6 Color</name>
    <key>color6</key>
    <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>factor1</base_key>
    <name>Line 6 Factor</name>
    <key>factor6</key>
    <hide>#if int($nconnections()) >= 6 then 'part' else 'all'#</hide>
  </param>


  <param>
    <base_key>label1</base_key>
    <name>Line 7 Label</name>
    <key>label7</key>
    <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>unit1</base_key>
    <name>Line 7 Unit</name>
    <key>unit7</key>
    <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>color1</base_key>
    <name>Line 7 Color</name>
    <key>color7</key>
    <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>factor1</base_key>
    <name>Line 7 Factor</name>
    <key>factor7</key>
    <hide>#if int($nconnections()) >= 7 then 'part' else 'all'#</hide>
  </param>


  <param>
    <base_key>label1</base_key>
    <name>Line 8 Label</name>
    <key>label8</key>
    <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>unit1</base_key>
    <name>Line 8 Unit</name>
    <key>unit8</key>
    <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>color1</base_key>
    <name>Line 8 Color</name>
    <key>color8</key>
    <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>factor1</base_key>
    <name>Line 8 Factor</name>
    <key>factor8</key>
    <hide>#if int($nconnections()) >= 8 then 'part' else 'all'#</hide>
  </param>


  <param>
    <base_key>label1</base_key>
    <name>Line 9 Label</name>
    <key>label9</key>
    <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>unit1</base_key>
    <name>Line 9 Unit</name>
    <key>unit9</key>
    <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>color1</base_key>
    <name>Line 9 Color</name>
    <key>color9</key>
    <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>factor1</base_key>
    <name>Line 9 Factor</name>
    <key>factor9</key>
    <hide>#if int($nconnections()) >= 9 then 'part' else 'all'#</hide>
  </param>


  <param>
    <base_key>label1</base_key>
    <name>Line 10 Label</name>
    <key>label10</key>
    <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>unit1</base_key>
    <name>Line 10 Unit</name>
    <key>unit10</key>
    <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>color1</base_key>
    <name>Line 10 Color</name>
    <key>color10</key>
    <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide>
  </param>

  <param>
    <base_key>factor1</base_key>
    <name>Line 10 Factor</name>
    <key>factor10</key>
    <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide>
  </param>


  <sink>
    <name>in</name>
    <type>$type</type>
    <nports>$nconnections</nports>
  </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.
  </doc>
</block>
