Variable Sinkvariable_sinkfrom gnuradio import grimport threadingimport timegr.vector_sink_$(type.fcn)()
def _$(id)_run():
while True:
time.sleep(1.0/$samp_rate)
data = self.$(id).data()
#if $vlen.eval == 0
if data:
self.set_$(variable.eval)(data[-1])
self.$(id).clear()
#else
if len(data) >= $vlen:
self.set_$(variable.eval)(data[-($vlen):])
self.$(id).clear()
#end if
threading.Thread(target=_$(id)_run).start()TypetypeenumVariablevariablestringSample Ratesamp_rate10realVec Lengthvlen0int$vlen >= 0in$type
Read samples at from the input stream and write each sample to the variable.
The variable must be the id of an existing variable block.
When the vector length is 0, the variable will be set to numbers. \
When the vector length is > 0, the variable will be set to vectors.