<?xml version="1.0"?>
<!--
###################################################
##QT GUI Sink
###################################################
 -->
<block>
  <name>QT GUI Time Raster Sink</name>
  <key>qtgui_time_raster_sink_x</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.$(type.fcn)(
	$samp_rate,
	$nrows,
	$ncols,
	$mult,
	$offset,
	$name,
	#if $type.t == 'message' then 0 else $nconnections#,
	)

self.$(id).set_update_time($update_time)
self.$(id).set_intensity_range($zmin, $zmax)
self.$(id).enable_grid($grid)
self.$(id).enable_axis_labels($axislabels)

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 xrange(#if $type.t == 'message' then 1 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)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget)
$(gui_hint() % $win)</make>

  <callback>set_num_rows($nrows)</callback>
  <callback>set_num_cols($ncols)</callback>
  <callback>set_multiplier($mult)</callback>
  <callback>set_offset($offset)</callback>
  <callback>set_update_time($update_time)</callback>
  <callback>set_title($which, $title)</callback>
  <callback>set_color($which, $color)</callback>

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

  <param>
    <name>Type</name>
    <key>type</key>
    <value>complex</value>
    <type>enum</type>
    <option>
      <name>Byte</name>
      <key>byte</key>
      <opt>fcn:time_raster_sink_b</opt>
      <opt>t:byte</opt>
    </option>
    <option>
      <name>Float</name>
      <key>float</key>
      <opt>fcn:time_raster_sink_f</opt>
      <opt>t:float</opt>
    </option>
    <option>
      <name>Byte Message</name>
      <key>msg_byte</key>
      <opt>fcn:time_raster_sink_b</opt>
      <opt>t:message</opt>
    </option>
    <option>
      <name>Float Message</name>
      <key>msg_float</key>
      <opt>fcn:time_raster_sink_f</opt>
      <opt>t:message</opt>
    </option>
  </param>

  <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>Sample Rate</name>
    <key>samp_rate</key>
    <value>samp_rate</value>
    <type>real</type>
  </param>

  <param>
    <name>Num. Rows</name>
    <key>nrows</key>
    <type>int</type>
    <hide>#if $type.t == 'message' then 'all' else 'none'#</hide>
  </param>

  <param>
    <name>Num. Cols</name>
    <key>ncols</key>
    <type>int</type>
  </param>

  <param>
    <name>Grid</name>
    <key>grid</key>
    <value>False</value>
    <type>enum</type>
    <hide>part</hide>
    <option>
      <name>Yes</name>
      <key>True</key>
    </option>
    <option>
      <name>No</name>
      <key>False</key>
    </option>
  </param>

  <param>
    <name>Int. min</name>
    <key>zmin</key>
    <value>-1</value>
    <type>real</type>
    <hide>part</hide>
  </param>

  <param>
    <name>Int. max</name>
    <key>zmax</key>
    <value>1</value>
    <type>real</type>
    <hide>part</hide>
  </param>

  <param>
    <name>Multiplier</name>
    <key>mult</key>
    <value>[]</value>
    <type>real_vector</type>
    <hide>part</hide>
  </param>

  <param>
    <name>Offset</name>
    <key>offset</key>
    <value>[]</value>
    <type>real_vector</type>
    <hide>part</hide>
  </param>

  <param>
    <name>Number of Inputs</name>
    <key>nconnections</key>
    <value>1</value>
    <type>int</type>
    <hide>#if $type.t == 'message' then 'all' else 'part'#</hide>
  </param>

  <param>
    <name>Update Period</name>
    <key>update_time</key>
    <value>0.10</value>
    <type>real</type>
    <hide>part</hide>
  </param>

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

  <param>
    <name>Axis Labels</name>
    <key>axislabels</key>
    <value>True</value>
    <type>enum</type>
    <hide>part</hide>
    <option>
      <name>Yes</name>
      <key>True</key>
    </option>
    <option>
      <name>No</name>
      <key>False</key>
    </option>
    <tab>Config</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 Color</name>
    <key>color1</key>
    <type>enum</type>
    <hide>#if int($nconnections()) >= 1 then 'part' else 'all'#</hide>
    <option>
      <name>Multi Color</name>
      <key>0</key>
    </option>
    <option>
      <name>White Hot</name>
      <key>1</key>
    </option>
    <option>
      <name>Black Hot</name>
      <key>2</key>
    </option>
    <option>
      <name>Incandescent</name>
      <key>3</key>
    </option>
    <option>
      <name>Sunset</name>
      <key>5</key>
    </option>
    <option>
      <name>Cool</name>
      <key>6</key>
    </option>
    <tab>Config</tab>
  </param>

  <param>
    <name>Line 1 Alpha</name>
    <key>alpha1</key>
    <value>1.0</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>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>alpha1</base_key>
    <name>Line 2 Alpha</name>
    <key>alpha2</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>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>alpha1</base_key>
    <name>Line 3 Alpha</name>
    <key>alpha3</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>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>alpha1</base_key>
    <name>Line 4 Alpha</name>
    <key>alpha4</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>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>alpha1</base_key>
    <name>Line 5 Alpha</name>
    <key>alpha5</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>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>alpha1</base_key>
    <name>Line 6 Alpha</name>
    <key>alpha6</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>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>alpha1</base_key>
    <name>Line 7 Alpha</name>
    <key>alpha7</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>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>alpha1</base_key>
    <name>Line 8 Alpha</name>
    <key>alpha8</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>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>alpha1</base_key>
    <name>Line 9 Alpha</name>
    <key>alpha9</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>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>alpha1</base_key>
    <name>Line 10 Alpha</name>
    <key>alpha10</key>
    <hide>#if int($nconnections()) >= 10 then 'part' else 'all'#</hide>
  </param>


  <sink>
    <name>in</name>
    <type>$type.t</type>
    <nports>#if $type.t == 'message' then 0 else $nconnections#</nports>
    <optional>1</optional>
  </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>
