How to use the niswitch._visatype.ViInt64 function in niswitch

To help you get started, we’ve selected a few niswitch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ni / nimi-python / generated / niswitch / unit_tests / _matchers.py View on Github external
def __init__(self, expected_size_or_value):
        _BufferMatcher.__init__(self, _visatype.ViInt64, expected_size_or_value)
github ni / nimi-python / generated / niswitch / niswitch / unit_tests / _matchers.py View on Github external
def __init__(self, expected_value):
        _ScalarMatcher.__init__(self, _visatype.ViInt64, expected_value)
github ni / nimi-python / generated / niswitch / unit_tests / _matchers.py View on Github external
def __init__(self):
        _PointerMatcher.__init__(self, _visatype.ViInt64)
github ni / nimi-python / generated / niswitch / niswitch / unit_tests / _matchers.py View on Github external
def __init__(self, expected_size_or_value):
        _BufferMatcher.__init__(self, _visatype.ViInt64, expected_size_or_value)
github ni / nimi-python / generated / niswitch / unit_tests / _matchers.py View on Github external
def __init__(self, expected_value):
        _ScalarMatcher.__init__(self, _visatype.ViInt64, expected_value)
github ni / nimi-python / generated / niswitch / niswitch / unit_tests / _matchers.py View on Github external
def __init__(self):
        _PointerMatcher.__init__(self, _visatype.ViInt64)
github ni / nimi-python / generated / niswitch / niswitch / _converters.py View on Github external
def _convert_timedelta(value, library_type, scaling):
    try:
        # We first assume it is a timedelta object
        scaled_value = value.total_seconds() * scaling
    except AttributeError:
        # If that doesn't work, assume it is a value in seconds
        # cast to float so scaled_value is always a float. This allows `timeout=10` to work as expected
        scaled_value = float(value) * scaling

    # ctype integer types don't convert to int from float so we need to
    if library_type in [_visatype.ViInt64, _visatype.ViInt32, _visatype.ViUInt32, _visatype.ViInt16, _visatype.ViUInt16, _visatype.ViInt8]:
        scaled_value = int(scaled_value)

    return library_type(scaled_value)