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

Add enabledisable joystick button #539

Merged
merged 11 commits into from
Jul 24, 2023
Merged

Conversation

3vwylie
Copy link
Collaborator

@3vwylie 3vwylie commented Jul 21, 2023

Joystick mode button implemented. It should appear only if joystick axes are specified in the configuration file. When pressed, it should disable the position entries and buttons corresponding to the specified joystick axes. Pressing the button should also update several visuals and hover texts corresponding to the joystick axes. Control + J should do the same thing as the button upon release. Switching microscopes should re-enable all buttons and turn "joystick mode" off, unless the joystick axes for both the current and former microscopes are the same, and joystick mode was on while the microscope switch was performed, in which case joystick mode will remain on. If switching from a microscope that has joystick axes and a microscope that does not, the button should disappear. The configuration file that comes with ASLM (C:...\ASLM\src\aslm\config\configuration.yaml) has the default joystick axes (joystick_axes) set to x, y, and z, for both the meso- and nanoscale microscopes.

That is all it does, so far.
> Added joystick button as part of stop frame (maybe rename to stop_and_joystick_frm ?)
> Joystick button disables up and down buttons using boolean attribute of StageController
…oxes untouched.... can't find them

All arrow buttons in stagecontrol tab will change image and deactivate when the  button is pressed... need to make ctrl + j also call joystick button handler, or else define a new function and make joystick button handler call that.
In preparation for having "button disabled in joystick mode" hover for the arrow keys, arrow keys given hover events and converted to hover buttons.

A similar tactic will be employed for the "set position to these coordinates " hoverentries (xyz0f) once I figure out how to flip-flop the ability to type into these fields.
Needs formatting changes + description, but the skeleton has been created.
> Joystick mode button does the following:
- When button pressed:
--- disables buttons corresponding to joystick axes specified in configuration.yml
--- disables entries corresponding ^^^
--- disabled widgets have a pinkish outline
--- updates its text
--- updates hover text of altered buttons

- When microscope is changed:
--- updates joystick axes.
--- If joystick is enabled and microscope is changed, joystick mode will be disabled... unless the axes are the same, in which case it will stay enabled.
--- if changed to a microscope with no joystick axes, joystick button will be hidden

I think that that is it
@3vwylie 3vwylie linked an issue Jul 21, 2023 that may be closed by this pull request
@AdvancedImagingUTSW
Copy link
Collaborator

@3vwylie - We had a test fail when we made the PR. You can see where the problem arose by clicking details above in the tests section... We will need to fix these before we can properly review everything...

================================== FAILURES ===================================
__________________ TestConfiguration.test_microscope_section __________________

self = <test_configuration.TestConfiguration testMethod=test_microscope_section>

    def test_microscope_section(self):
        expected_hardware = [
            "daq",
            "camera",
            "remote_focus_device",
            "galvo",
            "shutter",
            "lasers",
            "filter_wheel",
            "stage",
            "zoom",
        ]

@codecov
Copy link

codecov bot commented Jul 24, 2023

Codecov Report

Merging #539 (f92dd34) into develop (845c19a) will increase coverage by 0.17%.
The diff coverage is 55.00%.

@@             Coverage Diff             @@
##           develop     #539      +/-   ##
===========================================
+ Coverage    46.23%   46.40%   +0.17%     
===========================================
  Files          162      162              
  Lines        15730    15838     +108     
===========================================
+ Hits          7272     7350      +78     
- Misses        8458     8488      +30     
Flag Coverage Δ
unittests 46.40% <55.00%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/aslm/controller/controller.py 0.00% <0.00%> (ø)
...controller/sub_controllers/keystroke_controller.py 22.03% <0.00%> (-0.38%) ⬇️
src/aslm/model/microscope.py 86.97% <ø> (ø)
src/aslm/model/model.py 58.56% <50.00%> (ø)
src/aslm/view/main_window_content/stage_tab.py 74.81% <50.86%> (-18.98%) ⬇️
...slm/controller/sub_controllers/stage_controller.py 78.84% <65.78%> (-4.03%) ⬇️
...ntroller/sub_controllers/camera_view_controller.py 68.42% <66.66%> (-0.30%) ⬇️
src/aslm/tools/common_functions.py 100.00% <100.00%> (ø)
src/aslm/view/custom_widgets/hover.py 50.81% <100.00%> (-0.03%) ⬇️

... and 5 files with indirect coverage changes

@3vwylie 3vwylie merged commit f5b4f9d into develop Jul 24, 2023
@AdvancedImagingUTSW AdvancedImagingUTSW deleted the add-enabledisable-joystick-button branch December 15, 2023 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add enable/disable joystick button
3 participants