Source code for nirfmxvna.integrated_power_results

"""Provides methods to fetch and read the IntegratedPower measurement results."""

import functools


def _raise_if_disposed(f):
    """From https://stackoverflow.com/questions/5929107/decorators-with-parameters."""

    @functools.wraps(f)
    def aux(*xs, **kws):
        meas_obj = xs[0]  # parameter 0 is 'self' which is the measurement object
        if meas_obj._signal_obj.is_disposed:
            raise Exception("Cannot access a disposed Vna signal configuration")
        return f(*xs, **kws)

    return aux


[docs] class IntegratedPowerResults(object): """Provides methods to fetch and read the IntegratedPower measurement results.""" def __init__(self, signal_obj): """Provides methods to fetch and read the IntegratedPower measurement results.""" self._signal_obj = signal_obj self._session_function_lock = signal_obj._session_function_lock self._interpreter = signal_obj._interpreter