Fixed microscope.plugins references

This commit is contained in:
Joel Collins 2019-11-21 15:10:00 +00:00
parent 7cc595d92f
commit de73ae4e0a

View file

@ -165,7 +165,7 @@ class ScanPlugin(MicroscopePlugin):
# Check if autofocus is enabled # Check if autofocus is enabled
if ( if (
autofocus_dz autofocus_dz
and hasattr(self.microscope.plugin, "default_autofocus") and hasattr(self.microscope.plugins, "default_autofocus")
and self.microscope.has_real_stage() and self.microscope.has_real_stage()
and self.microscope.has_real_camera() and self.microscope.has_real_camera()
): ):
@ -174,7 +174,7 @@ class ScanPlugin(MicroscopePlugin):
autofocus_enabled = False autofocus_enabled = False
if fast_autofocus and not hasattr( if fast_autofocus and not hasattr(
self.microscope.plugin.default_autofocus, "monitor_sharpness" self.microscope.plugins.default_autofocus, "monitor_sharpness"
): ):
logging.warning( logging.warning(
"Can't use fast autofocus in the scan - the default plugin doesn't support monitor_sharpness; maybe it is too old?" "Can't use fast autofocus in the scan - the default plugin doesn't support monitor_sharpness; maybe it is too old?"
@ -213,7 +213,7 @@ class ScanPlugin(MicroscopePlugin):
# Refocus # Refocus
if autofocus_enabled: if autofocus_enabled:
if fast_autofocus: if fast_autofocus:
self.microscope.plugin.default_autofocus.fast_up_down_up_autofocus( self.microscope.plugins.default_autofocus.fast_up_down_up_autofocus(
dz=autofocus_dz, dz=autofocus_dz,
target_z=-z_stack_dz / 2.0, # Finish below the focus target_z=-z_stack_dz / 2.0, # Finish below the focus
initial_move_up=False, # We're already at the top of the scan initial_move_up=False, # We're already at the top of the scan
@ -221,7 +221,7 @@ class ScanPlugin(MicroscopePlugin):
# TODO: save the focus data for future reference? Use it for diagnostics? # TODO: save the focus data for future reference? Use it for diagnostics?
else: else:
logging.debug("Running autofocus") logging.debug("Running autofocus")
self.microscope.plugin.default_autofocus.autofocus( self.microscope.plugins.default_autofocus.autofocus(
range(-3 * autofocus_dz, 4 * autofocus_dz, autofocus_dz) range(-3 * autofocus_dz, 4 * autofocus_dz, autofocus_dz)
) )
logging.debug("Finished autofocus") logging.debug("Finished autofocus")