class_docstr: Thread which runs hackrf_sweep process
class_docstr_tok: ["Thread","which","runs","hackrf_sweep","process"]
docstr: hackrf_sweep thread main loop
docstr_tok: ["hackrf_sweep","thread","main","loop"]
code: def run(self):
      """hackrf_sweep thread main loop"""
      self.process_start()
      self.alive = True
      self.powerThreadStarted.emit()
  
      while self.alive:
          try:
              buf = self.process.stdout.read(4)
          except AttributeError as e:
              print(e, file=sys.stderr)
              continue
  
          if buf:
              (record_length,) = struct.unpack("I", buf)
              try:
                  buf = self.process.stdout.read(record_length)
              except AttributeError as e:
                  print(e, file=sys.stderr)
                  continue
  
              if buf:
                  self.parse_output(buf)
              else:
                  break
          else:
              break
  
      self.process_stop()
      self.alive = False
      self.powerThreadStopped.emit()
  
file_path: qspectrumanalyzer/qspectrumanalyzer/backends/hackrf_sweep.py
imports: import struct, shlex, sys, time
  import numpy
  from Qt import QtCore
  from qspectrumanalyzer import subprocess
  from qspectrumanalyzer.backends import BaseInfo, BasePowerThread
label_desc: Use image node_id 4 for calling the PowerThread obj's underlying member method code with example usage: obj.run() without return types