Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, serialNumber=None, connect=True):
"""Load DLL etc."""
if platform.system() == 'Linux':
from ctypes import cdll
self.lib = cdll.LoadLibrary("lib" + self.LIBNAME + ".so")
elif platform.system() == 'Darwin':
from picoscope.darwin_utils import LoadLibraryDarwin
self.lib = LoadLibraryDarwin("lib" + self.LIBNAME + ".dylib")
else:
from ctypes import windll
self.lib = windll.LoadLibrary(str(self.LIBNAME + ".dll"))
self.resolution = self.ADC_RESOLUTIONS["8"]
super(PS5000a, self).__init__(serialNumber, connect)
def __init__(self, serialNumber=None, connect=True):
"""Load DLLs."""
self.handle = None
if platform.system() == 'Linux':
from ctypes import cdll
# ok I don't know what is wrong with my installer,
# but I need to include .so.2
self.lib = cdll.LoadLibrary("lib" + self.LIBNAME + ".so.2")
elif platform.system() == 'Darwin':
from picoscope.darwin_utils import LoadLibraryDarwin
self.lib = LoadLibraryDarwin("lib" + self.LIBNAME + ".dylib")
else:
from ctypes import windll
self.lib = windll.LoadLibrary(str(self.LIBNAME + ".dll"))
super(PS4000, self).__init__(serialNumber, connect)
# check to see which model we have and use special functions if needed
unit_number = self.getUnitInfo('VariantInfo')
if unit_number == '4262':
self.getTimestepFromTimebase = self._getTimestepFromTimebase4262
self.getTimeBaseNum = self._getTimeBaseNum4262
elif unit_number in {'4223', '4224', '4423', '4424'}:
self.getTimestepFromTimebase = self._getTimestepFromTimebase4223
self.getTimeBaseNum = self._getTimeBaseNum4223
else:
raise NotImplementedError('Timebase functions have not been '
def __init__(self, serialNumber=None, connect=True):
"""Load DLL etc."""
if platform.system() == 'Linux':
from ctypes import cdll
self.lib = cdll.LoadLibrary("lib" + self.LIBNAME + ".so")
elif platform.system() == 'Darwin':
from picoscope.darwin_utils import LoadLibraryDarwin
self.lib = LoadLibraryDarwin("lib" + self.LIBNAME + ".dylib")
else:
from ctypes import windll
self.lib = windll.LoadLibrary(str(self.LIBNAME + ".dll"))
self.resolution = self.ADC_RESOLUTIONS["8"]
super(PS3000a, self).__init__(serialNumber, connect)
def __init__(self, serialNumber=None, connect=True):
"""Load DLL etc."""
if platform.system() == 'Linux':
from ctypes import cdll
self.lib = cdll.LoadLibrary("lib" + self.LIBNAME + ".so")
elif platform.system() == 'Darwin':
from picoscope.darwin_utils import LoadLibraryDarwin
self.lib = LoadLibraryDarwin("lib" + self.LIBNAME + ".dylib")
else:
from ctypes import windll
self.lib = windll.LoadLibrary(str(self.LIBNAME + ".dll"))
super(PS2000, self).__init__(serialNumber, connect)
def __init__(self, serialNumber=None, connect=True):
"""Load DLLs."""
if platform.system() == 'Linux':
from ctypes import cdll
# ok I don't know what is wrong with my installer,
# but I need to include .so.2
self.lib = cdll.LoadLibrary("lib" + self.LIBNAME + ".so.2")
elif platform.system() == 'Darwin':
from picoscope.darwin_utils import LoadLibraryDarwin
self.lib = LoadLibraryDarwin("lib" + self.LIBNAME + ".dylib")
else:
from ctypes import windll
self.lib = windll.LoadLibrary(str(self.LIBNAME + ".dll"))
super(PS6000, self).__init__(serialNumber, connect)
def __init__(self, serialNumber=None, connect=True):
"""Load DLLs."""
self.handle = None
if platform.system() == 'Linux':
from ctypes import cdll
# ok I don't know what is wrong with my installer,
# but I need to include .so.2
self.lib = cdll.LoadLibrary("lib" + self.LIBNAME + ".so.2")
elif platform.system() == 'Darwin':
from picoscope.darwin_utils import LoadLibraryDarwin
self.lib = LoadLibraryDarwin("lib" + self.LIBNAME + ".dylib")
else:
from ctypes import windll
self.lib = windll.LoadLibrary(str(self.LIBNAME + ".dll"))
self.resolution = self.ADC_RESOLUTIONS["12"]
super(PS4000a, self).__init__(serialNumber, connect)