-
Notifications
You must be signed in to change notification settings - Fork 140
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
Switch interface rework #623
Conversation
…ui via logic to hardware.
…work # Conflicts: # documentation/changelog.md
introduced the possibility to also access the states by name in set_state, get_state
…nectors, also reworked the gui accordingly
@alrik-durand I think the Thorlabs ows12 module was originally from you. As I don't have any of these, could you please test it with your hardware. Also it would be perfect if you adapted PR #620 to the new interface, once this PR is through. |
Hi Kay, thank you for this rework, this is a big improvement ! I will test the OSW12 asap ! Also my PR #603 will need rework, I'll rework both PR as soon as I can. Can I make a suggestion about switch logic ? Some devices have a physical button to change the state of the switch. For them the value can change without the logic being aware of. What do you think about having an optional (via config option) loop that check periodically (also via config) the state of the hardware ? |
My GUI tweaks were still missing but are now merged into this branch. Testing can commence... |
@kay-jahnke Thank you for the consideration, indeed I think this is an improvement. I'll try to finish what I've started in the next few days. |
@alrik-durand Well, I really do not share the opinion that the names should be defined by the logic. In Python it makes no difference (in most cases) if you address something by name or by index. We just chose "by name" because it makes it more verbose and easy to understand/read (which is a pillar of qudi and Python in general). Also you do not need to keep both the name and index information (lesser complexity). |
…y way inferior to the ToggleSwitch regarding the SwitchGui.
# Conflicts: # documentation/changelog.md
@Neverhorst
|
Ok, that's weird. |
The issue of saving enums will be generally addressed in the new qudi core.
…between qudi sessions.
@kay-jahnke |
@Neverhorst thanks for the fix. I tested and it works for me now. |
@Neverhorst As I've proposed on my demo, the hardware should use names as indeed it is more explicit than index. With that said, I let you decide what is best. |
Edit: I restarted QuDi and now it works, sorry! I tried running the SwitchGUI from the "qudi: Manager" on my office Computer (Win 10) with the default config. Error during activation File "C:\Program Files\Anaconda3\Lib\site-packages\qudi\core\module.py", line 98, in wrap_event File "C:\Program Files\Anaconda3\envs\qudi\lib\site-packages\fysom_init_.py", line 311, in fn File "C:\Program Files\Anaconda3\envs\qudi\lib\site-packages\fysom_init_.py", line 306, in _tran File "C:\Program Files\Anaconda3\envs\qudi\lib\site-packages\fysom_init_.py", line 338, in _after_event File "C:\Program Files\Anaconda3\envs\qudi\lib\site-packages\fysom_init_.py", line 95, in _callback File "C:\Program Files\Anaconda3\Lib\site-packages\qudi\core\module.py", line 223, in __load_status_vars_activate File "C:\Program Files\Anaconda3\Lib\site-packages\qudi\gui\switch\switch_gui.py", line 149, in on_activate File "C:\Program Files\Anaconda3\Lib\site-packages\qudi\gui\switch\switch_gui.py", line 237, in _switches_updated File "C:\Program Files\Anaconda3\Lib\site-packages\qudi\gui\switch\switch_state_widgets.py", line 73, in set_state Perhaps I messed up somewhere? |
I think this is just a minor detail, but upon reopening, the module remembers all the view settings for the Toggle bars (whether one had toggle bars or not). |
…based on the current Qt palette of the switch main window.
This should be fixed now. |
Checked the GUI again on Windows 10 OS with dummy hardware. |
…ing process (moved _switching_time to the query comand instead of time sleep afterwards)
Tested flip-mirror (radiant dyes box) which is now working after small changes on the flip-mirror hardware file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with an Radiant dyes flippmirror, which worked so far
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed ask to querry (not add)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it on two different setups and works as intended.
The whole tool chains for simple switches has been reworked. The hardware controlled by this can simply be switched between any two or more different states without the need for any timing (software timed).
Attention: This is a change to an interface, so it is a breaking change for old switch hardware wrappers not included in qudi that use the SwitchInterface!
Description
The old tool chain was quite old and did not conform to the qudi guidelines by using camel-case, old connector types and not making use of signal. The new logic now conforms to the guidelines and make excessive use of pythonic properties and setters.
The GUI has changed to Radio Buttons to reflect the option to set more than 2 states:
Coloured radio buttons are optimized for better readability when wearing laser protection goggles in the lab:
How Has This Been Tested?
Tested on Linux 5.8.11-1-MANJARO with dummy config.
Please additionally test with the hardware when you have it available.
Types of changes
Checklist:
documentation/changelog.md
)