Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process control switch mixin #35

Closed
wants to merge 5 commits into from
Closed

Conversation

Neverhorst
Copy link
Member

Description

Added new mixin abstract class qudi.interface.mixins.process_control_switch.ProcessControlSwitchMixin for hardware modules implementing ProcessControlInterface, ProcessSetpointInterface or ProcessValueInterface.
Provides default implementations satisfying the SwitchInterface when mixed into an implementation of the above mentioned process control interfaces so it can be accessed as process control device and as switch to toggle the device on/off.

Usage is simple... just inherit the mixin alongside ProcessControlInterface, ProcessSetpointInterface or ProcessValueInterface:

class MyHardwareModule(ProcessControlSwitchMixin, ProcessControlInterface):
    ...

An implementation example is showcased using the dummy.cfg and loading the switch GUI. The dummy module qudi.hardware.dummy.process_control_dummy.ProcessControlDummy has been expanded using the new mixin to additionally satisfy the SwitchInterface.

⚠️ Switching individual channels is not possible. Only enabling/disabling the entire device/all channels

Motivation and Context

The interfaces contained in qudi.interface.process_control_interface provide the ability to enable and disable the hardware device via

set_activity_state(self, active: bool) -> None

Using the new mixin, this functionality can be accessed by the switch toolchain of qudi without additional implementation efforts for each hardware module.

Addresses part of the discussion in PR #31

How Has This Been Tested?

On Win 10 pro 21H2 using the qudi-iqo-modules default.cfg

Screenshots:

image

Types of changes

  • Bug fix
  • New feature
  • Breaking change (Causes existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • I have documented my changes in /docs/changelog.md.
  • My change requires additional/updated documentation.
  • I have updated the documentation accordingly.
  • I have added/updated the config example for any module docstrings as necessary.
  • I have checked that the change does not contain obvious errors
    (syntax, indentation, mutable default values, etc.).
  • I have tested my changes using 'Load all modules' on the default dummy configuration.
  • All changed Jupyter notebooks have been stripped of their output cells.

- Added Mixin to automatically implement SwitchInterface for hardware modules implementing interfaces from process_control_interface.py
- Changed default config to use ProcessControlDummy in switch example
@Neverhorst Neverhorst added the enhancement New feature or request label Sep 23, 2022
@Neverhorst
Copy link
Member Author

Closed for now because we want to include per-channel switching in ProcessControlInterface

@Neverhorst Neverhorst closed this Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant