Skip to content

Commit 14ab23c

Browse files
committed
axis units and epsilons
1 parent 5229f9b commit 14ab23c

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

plugin_info.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ license = 'MIT'
1313

1414
[plugin-install]
1515
#packages required for your plugin:
16+
1617
packages-required = ['pymodaq>=5.0.1']
1718

19+
1820
[features] # defines the plugin features contained into this plugin
1921
instruments = true # true if plugin contains instrument classes (else false, notice the lowercase for toml files)
2022
extensions = false # true if plugins contains dashboard extensions

src/pymodaq_plugins_template/daq_move_plugins/daq_move_Template.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
from typing import Union, List, Dict
13
from pymodaq.control_modules.move_utility_classes import (DAQ_Move_base, comon_parameters_fun,
24
main, DataActuatorType, DataActuator)
35

@@ -37,12 +39,14 @@ class DAQ_Move_Template(DAQ_Move_base):
3739
# TODO add your particular attributes here if any
3840
3941
"""
40-
_controller_units = 'whatever' # TODO for your plugin: put the correct unit here
4142
is_multiaxes = False # TODO for your plugin set to True if this plugin is controlled for a multiaxis controller
42-
_axis_names = ['Axis1', 'Axis2'] # TODO for your plugin: complete the list
43-
_epsilon = 0.1 # TODO replace this by a value that is correct depending on your controller
43+
_axis_names: Union[List[str], Dict[str, int]] = ['Axis1', 'Axis2'] # TODO for your plugin: complete the list
44+
_controller_units: Union[str, List[str]] = 'mm' # TODO for your plugin: put the correct unit here, it could be
45+
# TODO a single str (the same one is applied to all axes) or a list of str (as much as the number of axes)
46+
_epsilon: Union[float, List[float]] = 0.1 # TODO replace this by a value that is correct depending on your controller
47+
# TODO it could be a single float of a list of float (as much as the number of axes)
4448
data_actuator_type = DataActuatorType.DataActuator # wether you use the new data style for actuator otherwise set this
45-
# as DataActuatorType['float'] (or entirely remove the line)
49+
# as DataActuatorType.float (or entirely remove the line)
4650

4751
params = [ # TODO for your custom plugin: elements to be added here as dicts in order to control your custom stage
4852
] + comon_parameters_fun(is_multiaxes, axis_names=_axis_names, epsilon=_epsilon)
@@ -85,7 +89,13 @@ def commit_settings(self, param: Parameter):
8589
A given parameter (within detector_settings) whose value has been changed by the user
8690
"""
8791
## TODO for your custom plugin
88-
if param.name() == "a_parameter_you've_added_in_self.params":
92+
if param.name() == 'axis':
93+
self.axis_unit = self.controller.your_method_to_get_correct_axis_unit()
94+
# do this only if you can and if the units are not known beforehand, for instance
95+
# if the motors connected to the controller are of different type (mm, µm, nm, , etc...)
96+
# see BrushlessDCMotor from the thorlabs plugin for an exemple
97+
98+
elif param.name() == "a_parameter_you've_added_in_self.params":
8999
self.controller.your_method_to_apply_this_param_change()
90100
else:
91101
pass

0 commit comments

Comments
 (0)