diff --git a/update/beta/Arducam.py b/update/beta/Arducam.py index 941e07b..d20c40e 100644 --- a/update/beta/Arducam.py +++ b/update/beta/Arducam.py @@ -150,9 +150,12 @@ def __init__(self, dev=0): self.hasFocus = True self.opts[Focuser.OPT_FOCUS]["MIN_VALUE"] = ctrl['minimum'] self.opts[Focuser.OPT_FOCUS]["MAX_VALUE"] = ctrl['maximum'] - self.opts[Focuser.OPT_FOCUS]["DEF_VALUE"] = ctrl['default'] + if hasattr(ctrl,'default'): + self.opts[Focuser.OPT_FOCUS]["DEF_VALUE"] = ctrl['default'] + if hasattr(ctrl,'default_value'): + self.opts[Focuser.OPT_FOCUS]["DEF_VALUE"] = ctrl['default_value'] self.focus_value = get_ctrl(self.fd, Focuser.FOCUS_ID) - + if not self.hasFocus: raise RuntimeError("Device {} has no focus_absolute control.".format(self.dev)) @@ -199,4 +202,4 @@ def set(self,opt,value,flag = 1): def __del__(self): self.fd.close() -pass +pass diff --git a/update/main/Arducam.py b/update/main/Arducam.py index 941e07b..d20c40e 100644 --- a/update/main/Arducam.py +++ b/update/main/Arducam.py @@ -150,9 +150,12 @@ def __init__(self, dev=0): self.hasFocus = True self.opts[Focuser.OPT_FOCUS]["MIN_VALUE"] = ctrl['minimum'] self.opts[Focuser.OPT_FOCUS]["MAX_VALUE"] = ctrl['maximum'] - self.opts[Focuser.OPT_FOCUS]["DEF_VALUE"] = ctrl['default'] + if hasattr(ctrl,'default'): + self.opts[Focuser.OPT_FOCUS]["DEF_VALUE"] = ctrl['default'] + if hasattr(ctrl,'default_value'): + self.opts[Focuser.OPT_FOCUS]["DEF_VALUE"] = ctrl['default_value'] self.focus_value = get_ctrl(self.fd, Focuser.FOCUS_ID) - + if not self.hasFocus: raise RuntimeError("Device {} has no focus_absolute control.".format(self.dev)) @@ -199,4 +202,4 @@ def set(self,opt,value,flag = 1): def __del__(self): self.fd.close() -pass +pass diff --git a/update/mini/Arducam.py b/update/mini/Arducam.py index 941e07b..d20c40e 100644 --- a/update/mini/Arducam.py +++ b/update/mini/Arducam.py @@ -150,9 +150,12 @@ def __init__(self, dev=0): self.hasFocus = True self.opts[Focuser.OPT_FOCUS]["MIN_VALUE"] = ctrl['minimum'] self.opts[Focuser.OPT_FOCUS]["MAX_VALUE"] = ctrl['maximum'] - self.opts[Focuser.OPT_FOCUS]["DEF_VALUE"] = ctrl['default'] + if hasattr(ctrl,'default'): + self.opts[Focuser.OPT_FOCUS]["DEF_VALUE"] = ctrl['default'] + if hasattr(ctrl,'default_value'): + self.opts[Focuser.OPT_FOCUS]["DEF_VALUE"] = ctrl['default_value'] self.focus_value = get_ctrl(self.fd, Focuser.FOCUS_ID) - + if not self.hasFocus: raise RuntimeError("Device {} has no focus_absolute control.".format(self.dev)) @@ -199,4 +202,4 @@ def set(self,opt,value,flag = 1): def __del__(self): self.fd.close() -pass +pass