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: Automatic finding of USB binds based on instrument IDN #210

Merged
merged 24 commits into from Apr 30, 2024

Conversation

mjmucha
Copy link
Member

@mjmucha mjmucha commented Jan 15, 2024

Implemented findUSBBinds() to find the Linux USB binds based on given IDN in the configuration file. With modify_basil_config() one can then automatically update the ports/resource_names of the transfer layers (serial/visa).

For this to work the transfer layer needs an additional init parameter (identification). Like in this example, where resource_name is automatically updated to the current USB bind after executing modify_basil_config().

transfer_layer:
  - name     : HMP4040
    type     : Visa
    init     :
        resource_name : ASRL/dev/ttyUSB0::INSTR
        read_termination : "\r\n"
        identification: HAMEG,HMP4040,105820,HW50020001/SW2.51
        baud_rate : 38400
        backend : "@py"

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

Attention: Patch coverage is 0% with 73 lines in your changes are missing coverage. Please review.

Project coverage is 32.23%. Comparing base (d3cd239) to head (5b3fad9).
Report is 13 commits behind head on master.

❗ Current head 5b3fad9 differs from pull request most recent head 06c4761. Consider uploading reports for the commit 06c4761 to get more accurate results

Files Patch % Lines
basil/utils/USBBinds.py 0.00% 73 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #210      +/-   ##
==========================================
- Coverage   32.67%   32.23%   -0.45%     
==========================================
  Files          85       86       +1     
  Lines        5800     5873      +73     
==========================================
- Hits         1895     1893       -2     
- Misses       3905     3980      +75     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@YannickDieter
Copy link
Contributor

Please rebase to check if pipeline is now working.

konstantinmauer and others added 9 commits April 24, 2024 17:52
* PRJ: Update workflow (verilog version, python version)

---------

Co-authored-by: Yannick Dieter <yannick.manuel.dieter@cern.ch>
Co-authored-by: Christian Bespin <11457592+cbespin@users.noreply.github.com>
Co-authored-by: Christian Bespin <silab@debian-BULLSEYE-live-builder-AMD64>
@mjmucha mjmucha requested a review from cbespin April 29, 2024 11:56
Copy link
Contributor

@cbespin cbespin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature will be very useful! I like to keep the amount of required packages as low as possible, but I see no alternative to ruamel.yaml here.
When the function names are changed to something more pythonic, I will approve

requirements.txt Outdated Show resolved Hide resolved
basil/utils/USBBinds.py Outdated Show resolved Hide resolved
basil/utils/USBBinds.py Outdated Show resolved Hide resolved
basil/utils/USBBinds.py Outdated Show resolved Hide resolved
Copy link
Contributor

@cbespin cbespin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now, thanks! The discussion about required packages will be moved to #188

@cbespin cbespin merged commit b94290a into master Apr 30, 2024
5 checks passed
@cbespin cbespin deleted the find_usb_binds branch April 30, 2024 18:53
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.

None yet

7 participants