Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
DataActuator, DataActuatorType)

from pymodaq_utils.utils import ThreadCommand, getLineInfo, is_64bits, find_keys_from_val
from pymodaq_gui.parameter.utils import iter_children


from pymodaq_plugins_physik_instrumente.utils import Config, get_devices_and_dlls
Expand Down Expand Up @@ -44,7 +43,7 @@ class DAQ_Move_PI(DAQ_Move_base):

data_actuator_type = DataActuatorType.DataActuator
is_multiaxes = True
stage_names = ['']
_axis_names = config['axis_names'] or [''] # from the configuration, or known only once connected

_epsilon = 0.01

Expand All @@ -65,7 +64,7 @@ class DAQ_Move_PI(DAQ_Move_base):
{'title': 'Min:', 'name': 'min', 'type': 'float'},
{'title': 'Max:', 'name': 'max', 'type': 'float'},
]},
] + comon_parameters_fun(is_multiaxes, axis_names=stage_names, epsilon=_epsilon)
] + comon_parameters_fun(is_multiaxes, axis_names=_axis_names, epsilon=_epsilon)

def ini_attributes(self):
self.controller: PIWrapper = None
Expand All @@ -79,9 +78,8 @@ def commit_settings(self, param):
if param.name() == 'use_joystick':
self.controller.use_joystick(param.value())

elif param.name() == 'axis' and param.name() in iter_children(self.settings.child('multiaxes')):
self.settings.child('closed_loop').setValue(self.controller.get_servo(param.value()))
self.controller.set_referencing(self.axis_name)
elif param.name() == 'axis':
self.settings.child('closed_loop').setValue(self.controller.get_servo(self.axis_name))
self.set_axis_limits(self.controller.get_axis_limits(self.axis_name))

elif param.name() == 'closed_loop':
Expand All @@ -107,7 +105,7 @@ def ini_stage(self, controller=None):

self.settings.child('controller_id').setValue(self.controller.identify())
self.axis_names = self.controller.axis_names
self.axis_units = self.controller.get_axis_units()
self.axis_units = self.controller.get_axis_units(default=config['default_units'])
self.epsilons = [self._epsilon for _ in range(len(self.axis_names))]

# self.controller.set_referencing(self.axis_name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def is_referenced(self, axis_name: str):

def stop(self):
""" Stop the motion of the connected device"""
self.device.StopAll()
self.device.StopAll(noraise=True) # the controller then reports error 10 (stopped by command), expected

def get_axis_position(self, axis_name: str) -> float:
""" Get the specified axis position
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ dll_names = ['PI_GCS2_DLL', 'E816_DLL', 'C7XX_GCS_DLL'] # dll to use in order t
# 'HEX_GCS_DLL': ['HEXAPOD', 'HEXAPOD_GCS1', ],
# 'PI_G_GCS2_DLL': ['UNKNOWN', ],

default_units = 'mm' # units of the axes when the controller cannot give them, e.g. 'um' for an E-517 piezo controller
axis_names = [] # axes offered before connection (Dashboard experiments), e.g. ['A', 'B', 'C'] for an E-517

[mmc]
com_port = 'COM13'
Loading