Skip to content
Merged
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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies = [
"pymodaq_utils>=5.3.1",
"pymodaq_gui>=5.3.0",
"pymodaq_data>=5.3.0",
"pymodaq_plugins_utils>=5.3.4",
#todo: list here all dependencies your package may have
]

Expand Down
2 changes: 2 additions & 0 deletions src/pymodaq_plugins_holoeye/hardware/mock_holoeye.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def open(self):
def errorString(self, error_code):
return ErrorCode(error_code).name

pixelsize_um = 8.

@property
def width_px(self) -> int:
return 1024
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from pymodaq_utils.logger import set_logger, get_module_name
from pymodaq_utils.math_utils import wrap

from pymodaq_plugins_utils.hardware.shaper import ModulatorType, shaper_params, fill_shaper_settings
from pymodaq_plugins_holoeye.hardware.sdk import SDK_CHOICES, NO_ERROR, get_slm_class

logger = set_logger(get_module_name(__file__))
Expand Down Expand Up @@ -46,7 +47,7 @@ class DAQ_Move_HoloeyeBase(DAQ_Move_base):
{'title': 'shaping options:', 'name': 'options', 'type': 'group', 'visible': True,
'children': []},
{'title': 'Input as grey:', 'name': 'input_as_grey_levels', 'type': 'bool', 'value': False},
]
] + shaper_params()
params = comon_shaping_params + comon_parameters_fun(is_multiaxes, _axis_names, epsilon=_epsilon)

def ini_attributes(self):
Expand Down Expand Up @@ -98,6 +99,10 @@ def ini_stage(self, controller=None):

self.settings.child('info', 'width').setValue(data_width)
self.settings.child('info', 'height').setValue(data_height)
pixel_size = float(self.controller.pixelsize_um)
# showPhasevalues / showPhaseData convert phase to grey levels inside the SDK
fill_shaper_settings(self.settings, 'Holoeye', data_width, data_height, pixel_size,
modulator_type=ModulatorType.PHASE, has_internal_calibration=True)

self.current_position = DataActuator(data=[np.zeros(self.shape)])

Expand Down
23 changes: 23 additions & 0 deletions tests/test_sdk_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,29 @@ def test_mock_plugin_still_works(qapp):
plugin.close()


def _shaper(plugin):
from pymodaq_plugins_utils.hardware.shaper import Shaper, GEOMETRY_NAME, PROPERTIES_NAME
return Shaper.from_settings(plugin.settings.child(GEOMETRY_NAME), plugin.settings.child(PROPERTIES_NAME))


def test_shaper_sdk4(qapp, fake_sdk4):
plugin = make_actuator(DAQ_Move_Holoeye, sdk='4')
shaper = _shaper(plugin)
assert shaper.shape == (6, 8)
assert shaper.pixel_size == 8.
assert shaper.has_internal_calibration and shaper.use_internal_calibration
plugin.close()


def test_shaper_mock(qapp):
plugin = make_actuator(DAQ_Move_HoloeyeMock)
shaper = _shaper(plugin)
assert shaper.shape == (768, 1024)
assert shaper.pixel_size == 8.
assert shaper.has_internal_calibration
plugin.close()


def test_sdk4_folder_from_the_most_recent_variable(tmp_path):
import json
import os
Expand Down
Loading