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

TekScope2K - turn on HEADER and VERBOSE options to query available data sources correctly #327

Merged
merged 9 commits into from
Oct 24, 2024
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,23 @@ repos:
- id: remove-tabs
- id: forbid-tabs
- repo: https://github.com/python-jsonschema/check-jsonschema
<<<<<<< HEAD
RoaCode marked this conversation as resolved.
Show resolved Hide resolved
rev: aa1acdb72677dfbc5f507d2dfd45d8380bbcc2e0 # frozen: 0.29.3
=======
rev: 5c70e3d884fdbe99af42f2714a444e39f321498d # frozen: 0.29.2
>>>>>>> 409230f (feat(mso2kb.py): added support for mso2024b oscilloscope)
hooks:
- id: check-readthedocs
- id: check-dependabot
- id: check-github-actions
- id: check-github-workflows
args: [--verbose]
- repo: https://github.com/Mateusz-Grzelinski/actionlint-py
<<<<<<< HEAD
rev: 27445053da613c660ed5895d9616662059a53ca7 # frozen: v1.7.3.17
=======
rev: c01fb5723b54075325cd9b5e5665a9ae84baf950 # frozen: v1.7.1.15
>>>>>>> 409230f (feat(mso2kb.py): added support for mso2024b oscilloscope)
hooks:
- id: actionlint
additional_dependencies: [pyflakes, shellcheck-py]
Expand Down
5 changes: 2 additions & 3 deletions CHANGELOG.md
RoaCode marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ Valid subsections within a version are:

Things to be included in the next release go here.

### Added
### Fixed

- `collectgarbage()` is now called during cleanup of `TSPDevice` children.
RoaCode marked this conversation as resolved.
Show resolved Hide resolved
- Added USB Support for AFG31K and MDO3 models.
- fix: TekScope2K active channel query needs VERBOSE and HEADER options enabled to function properly
RoaCode marked this conversation as resolved.
Show resolved Hide resolved

---

Expand Down
4 changes: 4 additions & 0 deletions src/tm_devices/drivers/pi/scopes/tekscope_2k/tekscope_2k.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ def get_available_data_sources(self) -> List[str]:
Returns:
The list of available data sources as strings.
"""
previous_header_state = self.query("HEADER?").split(" ")[-1] # Read previous header state
self.write("HEADER 1") # Turn on header state so SELECT query works correctly
source_string = self.query("SELECT?")
self.write(f"HEADER {previous_header_state}") # Return header state back to original

source_string = source_string.split(":")[-1] # Remove :SELECT: from beginning
source_list = source_string.split(";")
available_source_list: List[str] = []
Expand Down
11 changes: 9 additions & 2 deletions tests/sim_devices/scope/mso2kb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,17 @@ devices:
verbosity:
default: 0
getter:
q: :VERBose?
q: VERBOSE?
r: '{:s}'
setter:
q: :VERBose {:s}
q: VERBOSE {:s}
header:
default: 0
getter:
q: HEADER?
r: '{:s}'
setter:
q: HEADER {:s}
channel_select:
default: :SELECT:BUS1 0;BUS2 0;CH1 1;CH2 0;CH3 0;CH4 0;MATH 0;REF1 0;REF2
0;D0 1;D1 0;D2 0;D3 0;D4 0;D5 0;D6 0;D7 0;D8 0;D9 0;D10 0;D11 0;D12 0;D13
Expand Down