diff --git a/plugin_info.toml b/plugin_info.toml index 494300c..20de9bc 100644 --- a/plugin_info.toml +++ b/plugin_info.toml @@ -13,7 +13,7 @@ license = 'MIT' [plugin-install] #packages required for your plugin: -packages-required = ['pymodaq>=4.3.0'] +packages-required = ['pymodaq>=4.3.6'] [features] # defines the plugin features contained into this plugin instruments = true # true if plugin contains instrument classes (else false, notice the lowercase for toml files) diff --git a/src/pymodaq_plugins_template/daq_move_plugins/daq_move_Template.py b/src/pymodaq_plugins_template/daq_move_plugins/daq_move_Template.py index 8ec7754..0625a2a 100644 --- a/src/pymodaq_plugins_template/daq_move_plugins/daq_move_Template.py +++ b/src/pymodaq_plugins_template/daq_move_plugins/daq_move_Template.py @@ -1,3 +1,5 @@ +from typing import Union, List, Dict + from pymodaq.control_modules.move_utility_classes import DAQ_Move_base, comon_parameters_fun, main, DataActuatorType,\ DataActuator # common set of parameters for all actuators from pymodaq.utils.daq_utils import ThreadCommand # object used to send info back to the main thread @@ -36,12 +38,14 @@ class DAQ_Move_Template(DAQ_Move_base): # TODO add your particular attributes here if any """ - _controller_units = 'whatever' # TODO for your plugin: put the correct unit here is_multiaxes = False # TODO for your plugin set to True if this plugin is controlled for a multiaxis controller - _axis_names = ['Axis1', 'Axis2'] # TODO for your plugin: complete the list - _epsilon = 0.1 # TODO replace this by a value that is correct depending on your controller - data_actuator_type = DataActuatorType['DataActuator'] # wether you use the new data style for actuator otherwise set this - # as DataActuatorType['float'] (or entirely remove the line) + _axis_names: Union[List[str], Dict[str, int]] = ['Axis1', 'Axis2'] # TODO for your plugin: complete the list + _controller_units: Union[str, List[str]] = 'mm' # TODO for your plugin: put the correct unit here, it could be + # TODO a single str (the same one is applied to all axes) or a list of str (as much as the number of axes) + _epsilon: Union[float, List[float]] = 0.1 # TODO replace this by a value that is correct depending on your controller + # TODO it could be a single float of a list of float (as much as the number of axes) + data_actuator_type = DataActuatorType.DataActuator # wether you use the new data style for actuator otherwise set this + # as DataActuatorType.float (or entirely remove the line) params = [ # TODO for your custom plugin: elements to be added here as dicts in order to control your custom stage ] + comon_parameters_fun(is_multiaxes, axis_names=_axis_names, epsilon=_epsilon) @@ -84,7 +88,13 @@ def commit_settings(self, param: Parameter): A given parameter (within detector_settings) whose value has been changed by the user """ ## TODO for your custom plugin - if param.name() == "a_parameter_you've_added_in_self.params": + if param.name() == 'axis': + self.axis_unit = self.controller.your_method_to_get_correct_axis_unit() + # do this only if you can and if the units are not known beforehand, for instance + # if the motors connected to the controller are of different type (mm, µm, nm, , etc...) + # see BrushlessDCMotor from the thorlabs plugin for an exemple + + elif param.name() == "a_parameter_you've_added_in_self.params": self.controller.your_method_to_apply_this_param_change() else: pass