Commit d55fec9f authored by Jibril Mammeri's avatar Jibril Mammeri
Browse files

Merge branch '43-optic-steps-per-unit' into 'master'

Resolve "Optic steps per unit"

Closes #43

See merge request !5
parents 914c0ed3 ecd54353
Pipeline #46253 passed with stages
in 4 minutes and 38 seconds
......@@ -60,15 +60,14 @@ class TomoOptic(TomoParameters):
self.__name = name
self.__config = config
param_defaults["manual_pixel_size"] = False
param_defaults["unbinned_pixel_size"] = 0
param_defaults["image_pixel_size"] = 0
param_defaults["scintillator"] = 'None'
param_defaults["scintillator"] = "None"
# Initialise the TomoParameters class
super().__init__(param_name, param_defaults)
try:
self.__scintillators = config["scintillator"]
......@@ -118,10 +117,10 @@ class TomoOptic(TomoParameters):
self.__scintillator = config["scintillator"]
except:
self.__scintillator = None
self.__manual_pixel_size = self.parameters.manual_pixel_size
self.__unbinned_pixel_size = self.parameters.unbinned_pixel_size
self.__image_pixel_size = self.parameters.image_pixel_size
try:
self.__focus_steps_per_unit = config["focus_steps_per_unit"]
except:
self.__focus_steps_per_unit = 0
log_info(self, "__init__() leaving")
......@@ -132,7 +131,7 @@ class TomoOptic(TomoParameters):
dlg1 = UserYesNo(label="Do you want to set pixel size manually?")
ret = display(dlg1, title="Manual Pixel Size")
if ret is True:
if ret is True:
self.manual_pixel_size = True
dlg1 = UserFloatInput(
label="Unbinned pixel size in um", defval=self.unbinned_pixel_size
......@@ -269,6 +268,20 @@ class TomoOptic(TomoParameters):
self.__scintillator = value
self.parameters.scintillator = value
@property
def focus_steps_per_unit(self):
"""
Returns the value of the focus steps per unit
"""
return self.__focus_steps_per_unit
@focus_steps_per_unit.setter
def focus_steps_per_unit(self, value):
"""
Sets the value of the focus steps per unit
"""
self.__focus_steps_per_unit = value
@property
def manual_pixel_size(self):
"""
......@@ -411,6 +424,12 @@ class TomoOptic(TomoParameters):
return scan_params
def focus_config_apply(self):
"""
Update focus motor steps per unit
"""
self.__focus_mot.steps_per_unit = self.__focus_steps_per_unit
def __info__(self):
info_str = f"{self.name} optic info:\n"
info_str += f" description = {self.description}\n"
......@@ -424,6 +443,12 @@ class TomoOptic(TomoParameters):
info_str += f" focus motor = None \n"
else:
info_str += f" focus motor = {self.focus_motor().name} \n"
if self.focus_steps_per_unit == 0:
info_str += f" focus steps per unit = {self.focus_motor().steps_per_unit}\n"
else:
info_str += f" focus motor steps per unit = {self.focus_motor().steps_per_unit}\n"
info_str += f" focus config steps per unit = {self.__focus_steps_per_unit} \n"
info_str += f" focus scan = {self.focus_scan_parameters()} \n"
return info_str
......@@ -17,4 +17,4 @@
focus_scan_steps: 10
focus_lim_pos: 1000
focus_lim_neg: -1000
steps_per_unit: 600
focus_steps_per_unit: 600
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment