Skip to content

Commit

Permalink
Andor cooler and dll loading bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexShkarin committed Dec 27, 2023
1 parent e3f4d9d commit 17cec78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions pylablib/devices/Andor/AndorSDK2.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,18 @@ def set_temperature(self, temperature, enable_cooler=True):
"""
Change the temperature setpoint (in C).
If ``enable_cooler==True``, turn the cooler on automatically.
If ``enable_cooler==True``, turn the cooler on automatically if present.
"""
rng=lib.GetTemperatureRange()
temperature=max(temperature,rng[0])
temperature=min(temperature,rng[1])
temperature=int(temperature)
lib.SetTemperature(temperature)
if enable_cooler:
self.set_cooler(True)
try:
self.set_cooler(True)
except AndorSDK2LibError:
pass
return temperature
@_camfunc(getpar="temperature_setpoint",option=[("set",AC_SETFUNC.AC_SETFUNCTION_TEMPERATURE)])
def get_temperature_setpoint(self):
Expand Down
3 changes: 2 additions & 1 deletion pylablib/devices/utils/load_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import collections


library_parameters.library_parameters.update({"devices/only_windows_dlls":True},overwrite=False)
_store_loaded_dlls=False
_loaded_dlls=[]

Expand Down Expand Up @@ -119,7 +120,7 @@ def load_lib(name, locations=("global",), call_conv="cdecl", locally=False, depe
(in the latter case, `name` and `location` arguments are ignored, except for generating error message).
return_location(bool): if ``True``, return a tuple ``(dll, location, folder)`` instead of a single dll.
"""
if platform.system()!="Windows":
if platform.system()!="Windows" and not library_parameters.library_parameters["devices/only_windows_dlls"]:
raise OSError("DLLs are not available on non-Windows platform")
if not isinstance(name,(list,tuple)):
name=[name]
Expand Down

0 comments on commit 17cec78

Please sign in to comment.