(info_pipe, monitor)
Monitor leandvb's demodulator information

    Continuously read the demodulator information printed by leandvb into the
    descriptor pointed by --fd-info, which is tied to an unnamed pipe
    file. Then, feed the information into the monitor object.

    Args:
        info_pipe : Pipe object pointing to the pipe file that is used as
                    leandvb's --fd-info descriptor
        monitor   : Object of the Monitor class used to handle receiver
                    monitoring and logging
Monitor leandvb's demodulator information
Monitor leandvb s demodulator information
def _monitor_demod_info(info_pipe, monitor):
    """Monitor leandvb's demodulator information

    Continuously read the demodulator information printed by leandvb into the
    descriptor pointed by --fd-info, which is tied to an unnamed pipe
    file. Then, feed the information into the monitor object.

    Args:
        info_pipe : Pipe object pointing to the pipe file that is used as
                    leandvb's --fd-info descriptor
        monitor   : Object of the Monitor class used to handle receiver
                    monitoring and logging

    """
    assert (isinstance(info_pipe, util.Pipe))

    # "Standard" status format accepted by the Monitor class
    status = {'lock': (False, None), 'level': None, 'snr': None, 'ber': None}

    while True:
        line = info_pipe.readline()

        if "FRAMELOCK" in line:
            status['lock'] = (line.split()[-1] == "1", None)

        for metric in rx_stat_map:
            if metric in line:
                val = float(line.split()[-1])
                unit = rx_stat_map[metric]['unit']
                key = rx_stat_map[metric]['key']
                status[key] = (val, unit)

        # If unlocked, clear the status metrics that depend on receiver locking
        # (they will show garbage if unlocked). If locked, just make sure that
        # all the required metrics are filled in the status dictionary.
        ready = True
        for metric in rx_stat_map:
            key = rx_stat_map[metric]['key']
            if status['lock'][0]:
                if key not in status or status[key] is None:
                    ready = False
            else:
                if (key in status):
                    del status[key]

        if (not ready):
            continue

        monitor.update(status)
def _monitor_demod_info ( info_pipe , monitor ) : assert ( isinstance ( info_pipe , util . Pipe ) ) # "Standard" status format accepted by the Monitor class status = { 'lock' : ( False , None ) , 'level' : None , 'snr' : None , 'ber' : None } while True : line = info_pipe . readline ( ) if "FRAMELOCK" in line : status [ 'lock' ] = ( line . split ( ) [ - 1 ] == "1" , None ) for metric in rx_stat_map : if metric in line : val = float ( line . split ( ) [ - 1 ] ) unit = rx_stat_map [ metric ] [ 'unit' ] key = rx_stat_map [ metric ] [ 'key' ] status [ key ] = ( val , unit ) # If unlocked, clear the status metrics that depend on receiver locking # (they will show garbage if unlocked). If locked, just make sure that # all the required metrics are filled in the status dictionary. ready = True for metric in rx_stat_map : key = rx_stat_map [ metric ] [ 'key' ] if status [ 'lock' ] [ 0 ] : if key not in status or status [ key ] is None : ready = False else : if ( key in status ) : del status [ key ] if ( not ready ) : continue monitor . update ( status )