class_docstr: Thread which runs soapy_power process
docstr: Start soapy_power process
docstr_tok: ["Start","soapy_power","process"]
code: def process_start(self):
      """Start soapy_power process"""
      if not self.process and self.params:
          # Create pipe used for communication with soapy_power process
          self.pipe_read_fd, self.pipe_write_fd = os.pipe()
          self.pipe_read = open(self.pipe_read_fd, "rb")
          os.set_inheritable(self.pipe_write_fd, True)
  
          if sys.platform == "win32":
              self.pipe_write_handle = (
                  subprocess.make_inheritable_handle(self.pipe_write_fd)
              )
  
          # Prepare soapy_power cmdline parameters
          settings = QtCore.QSettings()
          cmdline = shlex.split(
              settings.value("executable", "soapy_power")
          )
          cmdline.extend(
              [
                  "-f",
                  "{}M:{}M".format(
                      self.params["start_freq"],
                      self.params["stop_freq"],
                  ),
                  "-B",
                  "{}k".format(self.params["bin_size"]),
                  "-T",
                  "{}".format(self.params["interval"]),
                  "-d",
                  "{}".format(self.params["device"]),
                  "-r",
                  "{}".format(self.params["sample_rate"]),
                  "-p",
                  "{}".format(self.params["ppm"]),
                  "-F",
                  "soapy_power_bin",
                  "--output-fd",
                  "{}".format(
                      int(self.pipe_write_handle)
                      if sys.platform == "win32"
                      else self.pipe_write_fd
                  ),
              ]
          )
  
          if self.lnb_lo != 0:
              cmdline.extend(["--lnb-lo", "{}".format(self.lnb_lo)])
          if self.params["bandwidth"] > 0:
              cmdline.extend(
                  ["-w", "{}".format(self.params["bandwidth"])]
              )
          if self.params["gain"] >= 0:
              cmdline.extend(["-g", "{}".format(self.params["gain"])])
          if self.params["crop"] > 0:
              cmdline.extend(["-k", "{}".format(self.params["crop"])])
          if not self.params["single_shot"]:
              cmdline.append("-c")
  
          additional_params = settings.value(
              "params", Info.additional_params
          )
          if additional_params:
              cmdline.extend(shlex.split(additional_params))
  
          # Start soapy_power process and close write part of pipe
          if sys.platform == "win32":
              creationflags = subprocess.CREATE_NEW_PROCESS_GROUP
          else:
              creationflags = 0
  
          print("Starting backend:")
          print(" ".join(cmdline))
          print()
          self.process = subprocess.Popen(
              cmdline,
              close_fds=False,
              universal_newlines=False,
              creationflags=creationflags,
              console=False,
          )
  
          os.close(self.pipe_write_fd)
          if sys.platform == "win32":
              self.pipe_write_handle.Close()
  
file_path: qspectrumanalyzer/qspectrumanalyzer/backends/soapy_power.py
imports: import os, sys, shlex, signal
  import numpy
  from Qt import QtCore
  from qspectrumanalyzer import subprocess
  from qspectrumanalyzer.backends import BaseInfo, BasePowerThread
label_desc: Use image node_id 2 for calling the PowerThread obj's underlying member method code with example usage: obj.process_start() without return types