(self,
                 cfg_dir,
                 logfile=False,
                 scroll=False,
                 echo=True,
                 min_interval=1.0,
                 server=False,
                 port=defs.monitor_port,
                 report=False,
                 report_opts={},
                 utc=True)
Monitor Constructor

        Args:
            cfg_dir      : Configuration directory where logs are saved
            logfile      : Whether to dump logs into a file
            scroll       : Whether to print logs with scrolling or continuously
                           overwrite the same line
            echo         : Whether to echo (print) every update to receiver
                           metrics to stdout.
            min_interval : Minimum interval in seconds between logs echoed or
                           saved.
            server       : Launch server to reply the receiver status via HTTP.
            port         : Server's HTTP port, if enabled.
            report       : Whether to report the receiver status over HTTP to
                           a remote address.
            report_opts  : Reporter options.
            utc          : Whether to print logs in UTC time.
Monitor Constructor
Monitor Constructor
def __init__(self,
                 cfg_dir,
                 logfile=False,
                 scroll=False,
                 echo=True,
                 min_interval=1.0,
                 server=False,
                 port=defs.monitor_port,
                 report=False,
                 report_opts={},
                 utc=True):
        """Monitor Constructor

        Args:
            cfg_dir      : Configuration directory where logs are saved
            logfile      : Whether to dump logs into a file
            scroll       : Whether to print logs with scrolling or continuously
                           overwrite the same line
            echo         : Whether to echo (print) every update to receiver
                           metrics to stdout.
            min_interval : Minimum interval in seconds between logs echoed or
                           saved.
            server       : Launch server to reply the receiver status via HTTP.
            port         : Server's HTTP port, if enabled.
            report       : Whether to report the receiver status over HTTP to
                           a remote address.
            report_opts  : Reporter options.
            utc          : Whether to print logs in UTC time.

        """
        self.cfg_dir = cfg_dir
        self.logfile = None
        self.scroll = scroll
        self.echo = echo
        self.min_interval = min_interval
        self.report = report
        self.utc = utc
        if (logfile):
            self._setup_logfile()

        # Supported receiver metrics, with their labels and printing formats
        self._metrics = {
            'lock': {
                'label': 'Lock',
                'format_str': ''
            },
            'level': {
                'label': 'Level',
                'format_str': '.2f'
            },
            'snr': {
                'label': 'SNR',
                'format_str': '.2f'
            },
            'ber': {
                'label': 'BER',
                'format_str': '.2e'
            },
            'quality': {
                'label': 'Signal Quality',
                'format_str': '.1f'
            },
            'pkt_err': {
                'label': 'Packet Errors',
                'format_str': 'd'
            }
        }
        self.stats = {}

        # Reporter sessions
        if (report):
            self.reporter = Reporter(**report_opts)

        # State
        self.t_last_print = time.time()

        # Launch HTTP server on a daemon thread
        if (server):
            self.sever_thread = threading.Thread(target=self._run_server,
                                                 args=(port, ),
                                                 daemon=True)
            self.sever_thread.start()
def __init__ ( self , cfg_dir , logfile = False , scroll = False , echo = True , min_interval = 1.0 , server = False , port = defs . monitor_port , report = False , report_opts = { } , utc = True ) : self . cfg_dir = cfg_dir self . logfile = None self . scroll = scroll self . echo = echo self . min_interval = min_interval self . report = report self . utc = utc if ( logfile ) : self . _setup_logfile ( ) # Supported receiver metrics, with their labels and printing formats self . _metrics = { 'lock' : { 'label' : 'Lock' , 'format_str' : '' } , 'level' : { 'label' : 'Level' , 'format_str' : '.2f' } , 'snr' : { 'label' : 'SNR' , 'format_str' : '.2f' } , 'ber' : { 'label' : 'BER' , 'format_str' : '.2e' } , 'quality' : { 'label' : 'Signal Quality' , 'format_str' : '.1f' } , 'pkt_err' : { 'label' : 'Packet Errors' , 'format_str' : 'd' } } self . stats = { } # Reporter sessions if ( report ) : self . reporter = Reporter ( * * report_opts ) # State self . t_last_print = time . time ( ) # Launch HTTP server on a daemon thread if ( server ) : self . sever_thread = threading . Thread ( target = self . _run_server , args = ( port , ) , daemon = True ) self . sever_thread . start ( )