Commit eb3686c7 authored by Martin Drechsler's avatar Martin Drechsler
Browse files

added some changes so that it works in Linux, but in that case the uldaq...

added some changes so that it works in Linux, but in that case the uldaq package should be installed
parent eea0f234
Loading
Loading
Loading
Loading
+14 −2
Changes for ADoutputs.py: 14 added lines, 2 removed lines.
Original line number Original line Diff line number Diff line
@@ -14,17 +14,29 @@ If the daq is not found, whenever trying to send signals, the command will be pr


import warnings
import warnings


try:
    from mcculw import ul
    from mcculw import ul
    from mcculw.enums import InterfaceType, ULRange, InfoType, BoardInfo, DigitalIODirection
    from mcculw.enums import InterfaceType, ULRange, InfoType, BoardInfo, DigitalIODirection
    from mcculw.ul import ULError
    from mcculw.ul import ULError

    from props.digital import DigitalProps
    from props.digital import DigitalProps
    from props.ao import AnalogOutputProps    
    from props.ao import AnalogOutputProps    


except ValueError:
    warnings.warn('Problem importing ul from mcculw, Thus might happen in Linux')
    import uldaq as ul
    from uldaq import InterfaceType
    from uldaq import Range as ULRange



ul.ignore_instacal() #instacal will be ignored




try:
    ul.ignore_instacal() #instacal will be ignored
except NameError:
    print('Instacall not ignored because mcculw not imported')
except AttributeError:
    print('Instacall not ignored because you imported uldaq and there is no instacal in that case')

# First of all, I check which daqs are available and print it. 
# First of all, I check which daqs are available and print it. 
devices = ul.get_daq_device_inventory(interface_type=InterfaceType.USB)
devices = ul.get_daq_device_inventory(interface_type=InterfaceType.USB)
if len(devices) == 1 :
if len(devices) == 1 :