-
Notifications
You must be signed in to change notification settings - Fork 34
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
MotorSpinBoxBrick: move motor while button pressed #394
Comments
I do not see a problem to keep a simple logic without artifices, or maybe I am being too simplistic Is there anything wrong with the following? logic (for move_while_pressed)
implementation of the logicdef state_changed(motor_ready)
def button_pressed() def button_released()
|
Kaixo Bixente, and thanks for your reply! Correct me if I'm wrong, but I guess there's a typo in point 2:
So, my concerns where about the point 7. Following your explanation, if button remains enabled when motor moving and button pressed, then my issue is gone :) Concerning your question on point 3: Thanks! |
Natxo ! Yes. You're right. That was a typo on case 2. If if was my choice, on point 7, I would rather let the movement finish on "release". I do not think there should be any danger in that. Still, if the idea of the feature is to use "press/release" to help in searching some kind of event to happen (visual aligning, maximum counts...) the "stop" should then be as close as possible in time and distance to the "release" of the button. If the step-size is relatively small that will still be fine but... discuss with your scientists, you may consider to call "stop" on "release" after all. Remember too that for a precise aligning they should use a fine "scan" anyway. ez horregatik ;-) |
Hi all,
I'm trying to make MSBB's left and right arrow buttons work as 'press' buttons ( make motor move while button is pressed).
Following Qt documentation ( https://doc.qt.io/qt-5/qabstractbutton.html#autoRepeat-prop ) I added some properties to buttons and with 'oneClickPressButton' property I change their autoRepeat property:
self.move_left_button.setAutoRepeat(new_state)
The problem comes from the fact that buttons are disabled and enabled with the HWRObject's state changing: buttons are disabled while the motor is BUSY/MOVING. And it seems that when the button gets disabled, then it 'looses' the "pressed(), released(), and clicked() signals that are emitted at regular intervals when the button is down.
If someone knows how to avoid this signal disconnection, I'll be glad to hear the solution.
So far I've found two 'solution' ( I not sure if they deserve that name ):
A minor problem, no urgent at all. Maybe I just wanted to open my first issue on the project.
Maybe it would be easier to change the Tool tip of buttons, as they announce this functionality that is not (still) working :)
The text was updated successfully, but these errors were encountered: