diff --git a/.github/workflows/tek-repo-lint.yml b/.github/workflows/tek-repo-lint.yml new file mode 100644 index 00000000..3f121da4 --- /dev/null +++ b/.github/workflows/tek-repo-lint.yml @@ -0,0 +1,47 @@ +--- +name: tek-repo-lint +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + workflow_call: +# IMPORTANT: Any new jobs need to be added to the check-repo-lint-passed job to ensure they correctly gate code changes +jobs: + enforce-community-standards: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + filename: + - .github/CODEOWNERS + - README.@(md|rst) + - CODE_OF_CONDUCT.@(md|rst) + - CONTRIBUTING.@(md|rst) + - LICENSE.@(md|rst) + - SECURITY.@(md|rst) + - .github/ISSUE_TEMPLATE/bug_report.yml + - .github/ISSUE_TEMPLATE/feature_request.yml + - .github/PULL_REQUEST_TEMPLATE.md + - .github/dependabot.yml + - .github/workflows/codeql-analysis.yml + steps: + - uses: actions/checkout@v4 + - name: Ensure ${{ matrix.filename }} exists + uses: andstor/file-existence-action@v3 + with: + files: ${{ matrix.filename }} + ignore_case: false + follow_symbolic_links: false + fail: true # Set the step to fail if the file doesn't exist + # Check that all jobs passed + check-repo-lint-passed: + if: ${{ !cancelled() }} + needs: [enforce-community-standards] + runs-on: ubuntu-latest + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} diff --git a/scripts/check_unreleased_changelog_items.py b/scripts/check_unreleased_changelog_items.py new file mode 100644 index 00000000..e69d7617 --- /dev/null +++ b/scripts/check_unreleased_changelog_items.py @@ -0,0 +1,70 @@ +"""This script will check for unreleased entries in the CHANGELOG.md file. + +It will exit with a non-zero exit code if there are no unreleased entries. + +It will also copy the necessary files into the template directory to properly render the CHANGELOG +and Release Notes. +""" + +import pathlib +import re +import shutil + +CHANGELOG_FILEPATH = pathlib.Path(__file__).parent.parent / "CHANGELOG.md" +TEMPLATE_CHANGELOG_FILEPATH = ( + pathlib.Path(__file__).parent.parent + / "python_semantic_release_templates" + / ".previous_changelog_for_template.md" +) +TEMPLATE_RELEASE_NOTES_FILEPATH = ( + pathlib.Path(__file__).parent.parent + / "python_semantic_release_templates" + / ".previous_release_notes_for_template.md" +) + + +def main() -> None: + """Check for entries in the Unreleased section of the CHANGELOG.md file. + + Raises: + SystemExit: Indicates no new entries were found. + """ + release_notes_content = "" + found_entries = False + with CHANGELOG_FILEPATH.open(mode="r", encoding="utf-8") as changelog_file: + tracking_unreleased = False + tracking_entries = False + for line in changelog_file: + if line.startswith(("___", "---")): + tracking_unreleased = False + tracking_entries = False + if tracking_unreleased: + release_notes_content += line + if line.startswith("## Unreleased"): + tracking_unreleased = True + if tracking_unreleased and line.startswith( + ( + "### Added\n", + "### Changed\n", + "### Deprecated\n", + "### Removed\n", + "### Fixed\n", + "### Security\n", + ) + ): + tracking_entries = True + if tracking_entries and not found_entries: + found_entries = bool(re.match(r"^- \w+", line)) + + if not found_entries: + msg = f"No unreleased entries were found in {CHANGELOG_FILEPATH}." + raise SystemExit(msg) + + # Copy the files to the correct location + shutil.copy(CHANGELOG_FILEPATH, TEMPLATE_CHANGELOG_FILEPATH) + with TEMPLATE_RELEASE_NOTES_FILEPATH.open("w", encoding="utf-8") as template_release_notes: + template_release_notes.write(release_notes_content.strip() + "\n") + + +if __name__ == "__main__": + main() diff --git a/scripts/create_post_version_for_testpypi.py b/scripts/create_post_version_for_testpypi.py new file mode 100644 index 00000000..3c3f530d --- /dev/null +++ b/scripts/create_post_version_for_testpypi.py @@ -0,0 +1,40 @@ +"""Create a post-release version for test.pypi.org.""" + +import argparse + +from poetry.core.constraints.version import Version + + +def parse_arguments() -> argparse.Namespace: + """Parse the command line arguments. + + Returns: + The parsed Namespace. + """ + parser = argparse.ArgumentParser() + parser.add_argument( + "--version", + required=True, + type=Version.parse, + action="store", + dest="version", + help="Provide the current, latest version of the package", + ) + + return parser.parse_args() + + +def main() -> None: + """Create and print a post-release version string for test.pypi.org.""" + args = parse_arguments() + version: Version = args.version + + new_post_release_num = 1 + if version.post: + new_post_release_num += version.post.number + + print(f"{'.'.join(str(x) for x in version.parts)}.post{new_post_release_num}") + + +if __name__ == "__main__": + main() diff --git a/scripts/project_version.py b/scripts/project_version.py new file mode 100644 index 00000000..4bf7a17d --- /dev/null +++ b/scripts/project_version.py @@ -0,0 +1,54 @@ +"""This script modifies or gets the current project version in the pyproject.toml file.""" + +import argparse +import pathlib + +import tomli +import tomli_w + +from poetry.core.constraints.version import Version + +PYPROJECT_FILE = pathlib.Path(f"{pathlib.Path(__file__).parent}/../pyproject.toml") + + +def parse_arguments() -> argparse.Namespace: + """Parse the command line arguments. + + Returns: + The parsed Namespace. + """ + parser = argparse.ArgumentParser() + parser.add_argument( + "--set-version", + required=False, + type=Version.parse, + action="store", + dest="set_version", + help="Provide the version to write to the pyproject.toml file", + ) + + return parser.parse_args() + + +def main() -> None: + """Modify or get the project version.""" + args = parse_arguments() + new_version: Version = args.set_version + + # Read in the current data + with open(PYPROJECT_FILE, "rb") as file_handle: + pyproject_data = tomli.load(file_handle) + + if new_version: + # Modify the version value + pyproject_data["tool"]["poetry"]["version"] = new_version.to_string() + + # Write back the data to the file + with open(PYPROJECT_FILE, "wb") as file_handle: + tomli_w.dump(pyproject_data, file_handle) + else: + print(pyproject_data["tool"]["poetry"]["version"]) + + +if __name__ == "__main__": + main() diff --git a/scripts/pypi_latest_version.py b/scripts/pypi_latest_version.py new file mode 100644 index 00000000..907743f5 --- /dev/null +++ b/scripts/pypi_latest_version.py @@ -0,0 +1,76 @@ +"""Get the latest version from the index server.""" + +import argparse +import json + +import requests + +from poetry.core.constraints.version import Version + + +def parse_arguments() -> argparse.Namespace: + """Parse the command line arguments. + + Returns: + The parsed Namespace. + """ + parser = argparse.ArgumentParser() + parser.add_argument( + "--package", + required=True, + action="store", + dest="package", + help="Provide the package to get the latest version for", + ) + parser.add_argument( + "--index", + action="store", + dest="index", + choices=["pypi", "test.pypi"], + default="pypi", + help="Provide the index to query for the latest version, one of (pypi|test.pypi)", + ) + + return parser.parse_args() + + +def get_latest_version(package_name: str, index: str) -> str: + """Get the latest version of the provided package. + + Args: + package_name: The name of the package to get the latest version of. + index: The index to check for the package, one of (pypi|test.pypi). + + Returns: + A string containing the latest version of the package from the given index. + + Raises: + SystemExit: Indicates there were no versions for the package. + """ + # This code mirrors code found in src/tm_devices/helpers/functions.py, + # in the check_for_update() function. + # If this code is updated, the helper function should be updated too. + url = f"https://{index}.org/pypi/{package_name}/json" + try: + response = requests.get(url, timeout=10) + releases = json.loads(response.text)["releases"] + version_list = sorted(releases, key=Version.parse, reverse=True) + latest_version = version_list[0] + except (IndexError, json.decoder.JSONDecodeError) as error: + msg = f"There were no versions found for the {package_name} package." + raise SystemExit(msg) from error + + return latest_version + + +def main() -> None: + """Get the latest version of the provided package.""" + args = parse_arguments() + package = args.package + index = args.index + latest_version = get_latest_version(package, index) + print(latest_version) + + +if __name__ == "__main__": + main() diff --git a/scripts/requirements.txt b/scripts/requirements.txt new file mode 100644 index 00000000..ef3ea208 --- /dev/null +++ b/scripts/requirements.txt @@ -0,0 +1,10 @@ +maison<2.0.0 +poetry +poetry-core +poetry-plugin-export +pre-commit +requests +toml-sort +tomli +tomli_w +yamlfix diff --git a/scripts/update_development_dependencies.py b/scripts/update_development_dependencies.py new file mode 100644 index 00000000..3a714492 --- /dev/null +++ b/scripts/update_development_dependencies.py @@ -0,0 +1,124 @@ +"""Update the development dependencies. + +This script will update the development dependencies that are pinned in the pyproject.toml and .pre- +commit-config.yaml files. +""" + +import argparse +import contextlib +import shlex +import subprocess +import sys +import warnings + +from pathlib import Path +from typing import List + +from yamlfix import fix_files # pyright: ignore[reportUnknownVariableType] + +from pypi_latest_version import get_latest_version + +DEPENDENCIES_TO_UPDATE = { + "dev": ( + "docformatter[tomli]", + "pylint", + "pyright", + "ruff", + ), + "tests": ("ruff",), +} + + +def parse_arguments() -> argparse.Namespace: + """Parse the command line arguments. + + Returns: + The parsed Namespace. + """ + parser = argparse.ArgumentParser() + parser.add_argument( + "--no-install", + action="store_true", + dest="no_install", + help="Indicate if packages should not be installed via poetry (Primarily used in CI).", + ) + + return parser.parse_args() + + +def _run_cmd_in_subprocess(command: str) -> None: + """Run the given command in a subprocess. + + Args: + command: The command string to send. + """ + command = command.replace("\\", "/") + print(f"\nExecuting command: {command}") + subprocess.check_call(shlex.split(command)) # noqa: S603 + + +def main() -> None: + """Run the script to update the development dependencies.""" + script_location = Path(__file__) + python_executable = sys.executable + python_script_location = Path(python_executable).parent + repository_root_directory = script_location.parent.parent + + args = parse_arguments() + lock_only = args.no_install + + # Remove the dependencies from poetry to avoid issues if they are in multiple groups + for group, dependencies_list in DEPENDENCIES_TO_UPDATE.items(): + dependencies = " ".join(f'"{x.split("[", maxsplit=1)[0]}"' for x in dependencies_list) + _run_cmd_in_subprocess( + f'"{python_executable}" -m poetry remove --lock --group={group} {dependencies}' + ) + + # Get the latest versions for each of the dependencies to update + for group, dependencies_list in DEPENDENCIES_TO_UPDATE.items(): + latest_dependency_versions: List[str] = [] + for dependency in dependencies_list: + latest_dep_version = get_latest_version(dependency.split("[", maxsplit=1)[0], "pypi") + latest_dependency_versions.append(dependency + f"=={latest_dep_version}") + + # Update dependencies in pyproject.toml using poetry + dependencies = " ".join(f'"{x}"' for x in latest_dependency_versions) + poetry_add_cmd = f'"{python_executable}" -m poetry add --group={group} {dependencies}' + if lock_only: + poetry_add_cmd += " --lock" + _run_cmd_in_subprocess(poetry_add_cmd) + + # Run poetry update + poetry_update_cmd = f'"{python_executable}" -m poetry update' + if lock_only: + poetry_update_cmd += " --lock" + _run_cmd_in_subprocess(poetry_update_cmd) + + # Update pre-commit config file + _run_cmd_in_subprocess(f'"{python_executable}" -m pre_commit autoupdate --freeze') + + # Fix the formatting of the pre-commit config file + with warnings.catch_warnings(): + warnings.simplefilter("ignore", UserWarning) + fix_files([f"{repository_root_directory}/.pre-commit-config.yaml"]) + + # Fix the formatting of the pyproject.toml file + _run_cmd_in_subprocess( + f'"{python_script_location}/toml-sort" "{repository_root_directory}/pyproject.toml"' + ) + + # Update the docs and tests dependency files + for group in ("docs", "tests"): + _run_cmd_in_subprocess( + f'"{python_executable}" -m poetry export --only {group} ' + f"--without-hashes --output {group}/requirements.txt" + ) + # Sort the requirements files (ignore failures due to changed files + with contextlib.suppress(subprocess.CalledProcessError): + _run_cmd_in_subprocess( + f'"{python_executable}" -m pre_commit run --all requirements-txt-fixer' + ) + + +if __name__ == "__main__": + main() diff --git a/src/tm_devices/commands/gen_1nmc1o_msodpomdo/header.py b/src/tm_devices/commands/gen_1nmc1o_msodpomdo/header.py new file mode 100644 index 00000000..23158f4a --- /dev/null +++ b/src/tm_devices/commands/gen_1nmc1o_msodpomdo/header.py @@ -0,0 +1,55 @@ +"""The header commands module. + +These commands are used in the following models: +DPO2K, DPO2KB, DPO4K, DPO4KB, MDO3, MDO3K, MDO4K, MDO4KB, MDO4KC, MSO2K, MSO2KB, MSO4K, MSO4KB + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - HEADer {OFF|ON|} + - HEADer? + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead, SCPICmdWrite + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class Header(SCPICmdWrite, SCPICmdRead): + """The ``HEADer`` command. + + Description: + - This command specifies the Response Header Enable State that causes the oscilloscope to + either include or omit headers on query responses. + + Usage: + - Using the ``.query()`` method will send the ``HEADer?`` query. + - Using the ``.verify(value)`` method will send the ``HEADer?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``HEADer value`` command. + + SCPI Syntax: + ``` + - HEADer {OFF|ON|} + - HEADer? + ``` + + Info: + - ``OFF`` sets the Response Header Enable State to false. This causes the oscilloscope to + omit headers on query responses, so that only the argument is returned. + - ``ON`` sets the Response Header Enable State to true. This causes the oscilloscope to + include headers on applicable query responses. You can then use the query response as a + command. + - ```` = 0 sets the Response Header Enable State to false; any other value sets this + state to true. + """ + + def __init__(self, device: Optional["PIDevice"] = None, cmd_syntax: str = "HEADer") -> None: + super().__init__(device, cmd_syntax) diff --git a/src/tm_devices/commands/gen_1nmc1o_msodpomdo/verbose.py b/src/tm_devices/commands/gen_1nmc1o_msodpomdo/verbose.py new file mode 100644 index 00000000..bd589448 --- /dev/null +++ b/src/tm_devices/commands/gen_1nmc1o_msodpomdo/verbose.py @@ -0,0 +1,49 @@ +"""The verbose commands module. + +These commands are used in the following models: +DPO2K, DPO2KB, DPO4K, DPO4KB, MDO3, MDO3K, MDO4K, MDO4KB, MDO4KC, MSO2K, MSO2KB, MSO4K, MSO4KB + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - VERBose {OFF|ON|} + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdWrite + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class Verbose(SCPICmdWrite): + """The ``VERBose`` command. + + Description: + - This command specifies the Verbose state that controls the length of keywords on query + responses. Keywords can be both headers and arguments. + + Usage: + - Using the ``.write(value)`` method will send the ``VERBose value`` command. + + SCPI Syntax: + ``` + - VERBose {OFF|ON|} + ``` + + Info: + - ``OFF`` sets the Verbose state to false, which returns minimum-length keywords for + applicable setting queries. + - ``ON`` sets the Verbose state to true, which returns full-length keywords for applicable + setting queries. + - ```` a 0 returns minimum-length keywords for applicable setting queries; any other + value returns full-length keywords. + """ + + def __init__(self, device: Optional["PIDevice"] = None, cmd_syntax: str = "VERBose") -> None: + super().__init__(device, cmd_syntax) diff --git a/src/tm_devices/commands/gen_1zn03_mso/lic.py b/src/tm_devices/commands/gen_1zn03_mso/lic.py new file mode 100644 index 00000000..3bf0a7a0 --- /dev/null +++ b/src/tm_devices/commands/gen_1zn03_mso/lic.py @@ -0,0 +1,90 @@ +"""The lic commands module. + +These commands are used in the following models: +MSO2 + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - LIC:UNINSTALL? + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead, SCPICmdReadWithArguments + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class LicUninstall(SCPICmdReadWithArguments): + """The ``LIC:UNINSTALL`` command. + + Description: + - Returns the exit license indicated for the user to return to their TekAMS account. Active + licenses can be specified by their nomenclature. TransactionIDs can be used to specify an + active license or a previously uninstalled license. In either case, the exit-license is + returned as block-data. + + Usage: + - Using the ``.query(argument)`` method will send the ``LIC:UNINSTALL? argument`` query. + - Using the ``.verify(argument, value)`` method will send the ``LIC:UNINSTALL? argument`` + query and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LIC:UNINSTALL? + ``` + + Info: + - ```` is the nomenclature of an active license or a TransactionIDs to specify an + active license or a previously uninstalled license. + """ + + +class Lic(SCPICmdRead): + """The ``LIC`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``LIC?`` query. + - Using the ``.verify(value)`` method will send the ``LIC?`` query and raise an + AssertionError if the returned value does not match ``value``. + + Properties: + - ``.uninstall``: The ``LIC:UNINSTALL`` command. + """ + + def __init__(self, device: Optional["PIDevice"] = None, cmd_syntax: str = "LIC") -> None: + super().__init__(device, cmd_syntax) + self._uninstall = LicUninstall(device, f"{self._cmd_syntax}:UNINSTALL") + + @property + def uninstall(self) -> LicUninstall: + """Return the ``LIC:UNINSTALL`` command. + + Description: + - Returns the exit license indicated for the user to return to their TekAMS account. + Active licenses can be specified by their nomenclature. TransactionIDs can be used to + specify an active license or a previously uninstalled license. In either case, the + exit-license is returned as block-data. + + Usage: + - Using the ``.query(argument)`` method will send the ``LIC:UNINSTALL? argument`` query. + - Using the ``.verify(argument, value)`` method will send the + ``LIC:UNINSTALL? argument`` query and raise an AssertionError if the returned value + does not match ``value``. + + SCPI Syntax: + ``` + - LIC:UNINSTALL? + ``` + + Info: + - ```` is the nomenclature of an active license or a TransactionIDs to specify + an active license or a previously uninstalled license. + """ + return self._uninstall diff --git a/src/tm_devices/commands/gen_1zn03_mso/license.py b/src/tm_devices/commands/gen_1zn03_mso/license.py new file mode 100644 index 00000000..29523f53 --- /dev/null +++ b/src/tm_devices/commands/gen_1zn03_mso/license.py @@ -0,0 +1,439 @@ +"""The license commands module. + +These commands are used in the following models: +MSO2 + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - LICense:APPID? {} + - LICense:COUNt? + - LICense:ERRor? + - LICense:GMT? + - LICense:HID? + - LICense:INSTall + - LICense:ITEM? + - LICense:LIST? + - LICense:VALidate? + - LICense? + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead, SCPICmdReadWithArguments, SCPICmdWrite + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class LicenseValidate(SCPICmdReadWithArguments): + """The ``LICense:VALidate`` command. + + Description: + - This query accepts a license nomenclature as an argument and returns True (1) if that + nomenclature is active and any required hardware is installed, or False (0) if either the + nomenclature is not active or required hardware is not installed. + + Usage: + - Using the ``.query(argument)`` method will send the ``LICense:VALidate? argument`` query. + - Using the ``.verify(argument, value)`` method will send the ``LICense:VALidate? argument`` + query and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense:VALidate? + ``` + + Info: + - ```` is the license nomenclature. + """ + + +class LicenseList(SCPICmdRead): + """The ``LICense:LIST`` command. + + Description: + - This query returns the active license nomenclatures as a comma-separated list of strings. + Duplicate nomenclatures, that is, the same license but with different expiration dates, + are included. + + Usage: + - Using the ``.query()`` method will send the ``LICense:LIST?`` query. + - Using the ``.verify(value)`` method will send the ``LICense:LIST?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense:LIST? + ``` + """ + + +class LicenseItem(SCPICmdReadWithArguments): + """The ``LICense:ITEM`` command. + + Description: + - This query returns the details pertaining to a specific license. The NR1 argument is + zero-indexed. If no argument is provided, zero is assumed. + + Usage: + - Using the ``.query(argument)`` method will send the ``LICense:ITEM? argument`` query. + - Using the ``.verify(argument, value)`` method will send the ``LICense:ITEM? argument`` + query and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense:ITEM? + ``` + """ + + +class LicenseInstall(SCPICmdWrite): + """The ``LICense:INSTall`` command. + + Description: + - This command accepts a ```` license and installs it on the instrument. + Restarting the instrument may be necessary to fully activate the additional capabilities. + + Usage: + - Using the ``.write(value)`` method will send the ``LICense:INSTall value`` command. + + SCPI Syntax: + ``` + - LICense:INSTall + ``` + + Info: + - ```` is the license in block data format. + """ + + +class LicenseHid(SCPICmdRead): + """The ``LICense:HID`` command. + + Description: + - This query returns the instrument HostID unique identifier. + + Usage: + - Using the ``.query()`` method will send the ``LICense:HID?`` query. + - Using the ``.verify(value)`` method will send the ``LICense:HID?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense:HID? + ``` + """ + + +class LicenseGmt(SCPICmdRead): + """The ``LICense:GMT`` command. + + Description: + - This query returns the GMT time in ISO 8601 format, the local date, 24 hour time and + time-zone offset. + + Usage: + - Using the ``.query()`` method will send the ``LICense:GMT?`` query. + - Using the ``.verify(value)`` method will send the ``LICense:GMT?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense:GMT? + ``` + """ + + +class LicenseError(SCPICmdRead): + """The ``LICense:ERRor`` command. + + Description: + - This query-only command prompts the instrument to return all events and their messages + (delimited by commas), and removes the returned events from the Event Queue. This command + is an alias for ALLEV?. + + Usage: + - Using the ``.query()`` method will send the ``LICense:ERRor?`` query. + - Using the ``.verify(value)`` method will send the ``LICense:ERRor?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense:ERRor? + ``` + """ + + +class LicenseCount(SCPICmdRead): + """The ``LICense:COUNt`` command. + + Description: + - This query returns a count of the number of active licenses installed. + + Usage: + - Using the ``.query()`` method will send the ``LICense:COUNt?`` query. + - Using the ``.verify(value)`` method will send the ``LICense:COUNt?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense:COUNt? + ``` + """ + + +class LicenseAppid(SCPICmdReadWithArguments): + """The ``LICense:APPID`` command. + + Description: + - This query returns a comma-separated list of the active application IDs. If a string + argument is provided, a '0' or '1' is returned, according to whether the string matches an + active application ID. + + Usage: + - Using the ``.query(argument)`` method will send the ``LICense:APPID? argument`` query. + - Using the ``.verify(argument, value)`` method will send the ``LICense:APPID? argument`` + query and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense:APPID? {} + ``` + """ + + +# pylint: disable=too-many-instance-attributes +class License(SCPICmdRead): + """The ``LICense`` command. + + Description: + - This query-only command returns all license parameters. + + Usage: + - Using the ``.query()`` method will send the ``LICense?`` query. + - Using the ``.verify(value)`` method will send the ``LICense?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense? + ``` + + Properties: + - ``.appid``: The ``LICense:APPID`` command. + - ``.count``: The ``LICense:COUNt`` command. + - ``.error``: The ``LICense:ERRor`` command. + - ``.gmt``: The ``LICense:GMT`` command. + - ``.hid``: The ``LICense:HID`` command. + - ``.install``: The ``LICense:INSTall`` command. + - ``.item``: The ``LICense:ITEM`` command. + - ``.list``: The ``LICense:LIST`` command. + - ``.validate``: The ``LICense:VALidate`` command. + """ + + def __init__(self, device: Optional["PIDevice"] = None, cmd_syntax: str = "LICense") -> None: + super().__init__(device, cmd_syntax) + self._appid = LicenseAppid(device, f"{self._cmd_syntax}:APPID") + self._count = LicenseCount(device, f"{self._cmd_syntax}:COUNt") + self._error = LicenseError(device, f"{self._cmd_syntax}:ERRor") + self._gmt = LicenseGmt(device, f"{self._cmd_syntax}:GMT") + self._hid = LicenseHid(device, f"{self._cmd_syntax}:HID") + self._install = LicenseInstall(device, f"{self._cmd_syntax}:INSTall") + self._item = LicenseItem(device, f"{self._cmd_syntax}:ITEM") + self._list = LicenseList(device, f"{self._cmd_syntax}:LIST") + self._validate = LicenseValidate(device, f"{self._cmd_syntax}:VALidate") + + @property + def appid(self) -> LicenseAppid: + """Return the ``LICense:APPID`` command. + + Description: + - This query returns a comma-separated list of the active application IDs. If a string + argument is provided, a '0' or '1' is returned, according to whether the string + matches an active application ID. + + Usage: + - Using the ``.query(argument)`` method will send the ``LICense:APPID? argument`` query. + - Using the ``.verify(argument, value)`` method will send the + ``LICense:APPID? argument`` query and raise an AssertionError if the returned value + does not match ``value``. + + SCPI Syntax: + ``` + - LICense:APPID? {} + ``` + """ + return self._appid + + @property + def count(self) -> LicenseCount: + """Return the ``LICense:COUNt`` command. + + Description: + - This query returns a count of the number of active licenses installed. + + Usage: + - Using the ``.query()`` method will send the ``LICense:COUNt?`` query. + - Using the ``.verify(value)`` method will send the ``LICense:COUNt?`` query and raise + an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense:COUNt? + ``` + """ + return self._count + + @property + def error(self) -> LicenseError: + """Return the ``LICense:ERRor`` command. + + Description: + - This query-only command prompts the instrument to return all events and their messages + (delimited by commas), and removes the returned events from the Event Queue. This + command is an alias for ALLEV?. + + Usage: + - Using the ``.query()`` method will send the ``LICense:ERRor?`` query. + - Using the ``.verify(value)`` method will send the ``LICense:ERRor?`` query and raise + an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense:ERRor? + ``` + """ + return self._error + + @property + def gmt(self) -> LicenseGmt: + """Return the ``LICense:GMT`` command. + + Description: + - This query returns the GMT time in ISO 8601 format, the local date, 24 hour time and + time-zone offset. + + Usage: + - Using the ``.query()`` method will send the ``LICense:GMT?`` query. + - Using the ``.verify(value)`` method will send the ``LICense:GMT?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense:GMT? + ``` + """ + return self._gmt + + @property + def hid(self) -> LicenseHid: + """Return the ``LICense:HID`` command. + + Description: + - This query returns the instrument HostID unique identifier. + + Usage: + - Using the ``.query()`` method will send the ``LICense:HID?`` query. + - Using the ``.verify(value)`` method will send the ``LICense:HID?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense:HID? + ``` + """ + return self._hid + + @property + def install(self) -> LicenseInstall: + """Return the ``LICense:INSTall`` command. + + Description: + - This command accepts a ```` license and installs it on the instrument. + Restarting the instrument may be necessary to fully activate the additional + capabilities. + + Usage: + - Using the ``.write(value)`` method will send the ``LICense:INSTall value`` command. + + SCPI Syntax: + ``` + - LICense:INSTall + ``` + + Info: + - ```` is the license in block data format. + """ + return self._install + + @property + def item(self) -> LicenseItem: + """Return the ``LICense:ITEM`` command. + + Description: + - This query returns the details pertaining to a specific license. The NR1 argument is + zero-indexed. If no argument is provided, zero is assumed. + + Usage: + - Using the ``.query(argument)`` method will send the ``LICense:ITEM? argument`` query. + - Using the ``.verify(argument, value)`` method will send the ``LICense:ITEM? argument`` + query and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense:ITEM? + ``` + """ + return self._item + + @property + def list(self) -> LicenseList: + """Return the ``LICense:LIST`` command. + + Description: + - This query returns the active license nomenclatures as a comma-separated list of + strings. Duplicate nomenclatures, that is, the same license but with different + expiration dates, are included. + + Usage: + - Using the ``.query()`` method will send the ``LICense:LIST?`` query. + - Using the ``.verify(value)`` method will send the ``LICense:LIST?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - LICense:LIST? + ``` + """ + return self._list + + @property + def validate(self) -> LicenseValidate: + """Return the ``LICense:VALidate`` command. + + Description: + - This query accepts a license nomenclature as an argument and returns True (1) if that + nomenclature is active and any required hardware is installed, or False (0) if either + the nomenclature is not active or required hardware is not installed. + + Usage: + - Using the ``.query(argument)`` method will send the ``LICense:VALidate? argument`` + query. + - Using the ``.verify(argument, value)`` method will send the + ``LICense:VALidate? argument`` query and raise an AssertionError if the returned value + does not match ``value``. + + SCPI Syntax: + ``` + - LICense:VALidate? + ``` + + Info: + - ```` is the license nomenclature. + """ + return self._validate diff --git a/src/tm_devices/commands/gen_3n9auv_awg/diagnostic.py b/src/tm_devices/commands/gen_3n9auv_awg/diagnostic.py new file mode 100644 index 00000000..492dc785 --- /dev/null +++ b/src/tm_devices/commands/gen_3n9auv_awg/diagnostic.py @@ -0,0 +1,1234 @@ +"""The diagnostic commands module. + +These commands are used in the following models: +AWG5200, AWG70KA, AWG70KB + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - DIAGnostic:ABORt + - DIAGnostic:CATalog? [{ALL|}[,{ALL|}]] + - DIAGnostic:CONTrol:COUNt + - DIAGnostic:CONTrol:COUNt? + - DIAGnostic:CONTrol:HALT {0|1|OFF|ON} + - DIAGnostic:CONTrol:LOOP {ONCE|CONTinuous|COUNt} + - DIAGnostic:CONTrol:LOOP? + - DIAGnostic:DATA? + - DIAGnostic:IMMediate + - DIAGnostic:IMMediate? + - DIAGnostic:LOG:CLEar + - DIAGnostic:LOG:FAILuresonly {0|1|OFF|ON} + - DIAGnostic:LOG:FAILuresonly? + - DIAGnostic:LOG? + - DIAGnostic:LOOPs? + - DIAGnostic:RESult:TEMPerature? ''[,''[,'']] + - DIAGnostic:RESult:TIME? ''[,''[,'']] + - DIAGnostic:RESult? [{ALL|}] + - DIAGnostic:RUNNing? + - DIAGnostic:SELect {ALL|} + - DIAGnostic:SELect:VERify? ,, + - DIAGnostic:STARt + - DIAGnostic:STOP + - DIAGnostic:STOP:STATe? + - DIAGnostic:TYPE {NORMal|POST} + - DIAGnostic:TYPE:CATalog? + - DIAGnostic:TYPE? + - DIAGnostic:UNSelect {ALL|<'subsystem'>,<'area'>,<'test'>} + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead, SCPICmdReadWithArguments, SCPICmdWrite, SCPICmdWriteNoArguments + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class DiagnosticUnselect(SCPICmdWrite): + """The ``DIAGnostic:UNSelect`` command. + + Description: + - This command unselects one or more tests of the current test list. Tests can be unselected + by the keyword ALL, by 'subsystem', by 'area', or by 'test'. To unselect an 'area', the + 'subsystem' is required. To unselect a 'test' requires both the 'subsystem' and 'area'. + + Usage: + - Using the ``.write(value)`` method will send the ``DIAGnostic:UNSelect value`` command. + + SCPI Syntax: + ``` + - DIAGnostic:UNSelect {ALL|<'subsystem'>,<'area'>,<'test'>} + ``` + """ + + +class DiagnosticTypeCatalog(SCPICmdRead): + """The ``DIAGnostic:TYPE:CATalog`` command. + + Description: + - This command returns a list of diagnostic types available. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:TYPE:CATalog?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:TYPE:CATalog?`` query and + raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:TYPE:CATalog? + ``` + """ + + +class DiagnosticType(SCPICmdWrite, SCPICmdRead): + """The ``DIAGnostic:TYPE`` command. + + Description: + - This command sets or returns the diagnostic type. The diagnostics work on a list of tests + that support different types of testing. This sets the context for other commands such as + selecting a test to run. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:TYPE?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:TYPE?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DIAGnostic:TYPE value`` command. + + SCPI Syntax: + ``` + - DIAGnostic:TYPE {NORMal|POST} + - DIAGnostic:TYPE? + ``` + + Info: + - ``NORMal`` - Normal operating mode POST - Power On Self Test. + - ``*RST`` sets this to NORM. + + Properties: + - ``.catalog``: The ``DIAGnostic:TYPE:CATalog`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._catalog = DiagnosticTypeCatalog(device, f"{self._cmd_syntax}:CATalog") + + @property + def catalog(self) -> DiagnosticTypeCatalog: + """Return the ``DIAGnostic:TYPE:CATalog`` command. + + Description: + - This command returns a list of diagnostic types available. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:TYPE:CATalog?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:TYPE:CATalog?`` query + and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:TYPE:CATalog? + ``` + """ + return self._catalog + + +class DiagnosticStopState(SCPICmdRead): + """The ``DIAGnostic:STOP:STATe`` command. + + Description: + - This command returns the current state of diagnostic testing. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:STOP:STATe?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:STOP:STATe?`` query and + raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:STOP:STATe? + ``` + """ + + +class DiagnosticStop(SCPICmdWriteNoArguments, SCPICmdRead): + """The ``DIAGnostic:STOP`` command. + + Description: + - This command stops the diagnostic tests from running, after the diagnostic test currently + in progress completes. This also terminates diagnostic test looping. + + Usage: + - Using the ``.write()`` method will send the ``DIAGnostic:STOP`` command. + + SCPI Syntax: + ``` + - DIAGnostic:STOP + ``` + + Properties: + - ``.state``: The ``DIAGnostic:STOP:STATe`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._state = DiagnosticStopState(device, f"{self._cmd_syntax}:STATe") + + @property + def state(self) -> DiagnosticStopState: + """Return the ``DIAGnostic:STOP:STATe`` command. + + Description: + - This command returns the current state of diagnostic testing. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:STOP:STATe?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:STOP:STATe?`` query and + raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:STOP:STATe? + ``` + """ + return self._state + + +class DiagnosticStart(SCPICmdWriteNoArguments): + """The ``DIAGnostic:STARt`` command. + + Description: + - This command starts the execution of the selected set of diagnostic tests. + + Usage: + - Using the ``.write()`` method will send the ``DIAGnostic:STARt`` command. + + SCPI Syntax: + ``` + - DIAGnostic:STARt + ``` + """ + + +class DiagnosticSelectVerify(SCPICmdReadWithArguments): + """The ``DIAGnostic:SELect:VERify`` command. + + Description: + - This command returns selection status of one specific test. A specific test requires the + 'subsystem', 'area', and 'test'. This is context sensitive and is dependent on the type as + set with the command ``DIAGNOSTIC:TYPE``. + + Usage: + - Using the ``.query(argument)`` method will send the ``DIAGnostic:SELect:VERify? argument`` + query. + - Using the ``.verify(argument, value)`` method will send the + ``DIAGnostic:SELect:VERify? argument`` query and raise an AssertionError if the returned + value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:SELect:VERify? ,, + ``` + """ + + +class DiagnosticSelect(SCPICmdWrite, SCPICmdRead): + """The ``DIAGnostic:SELect`` command. + + Description: + - This command (no query form) selects one or more tests of the current test list. Tests can + be selected by the keyword ALL, by 'subsystem', by 'area', or by 'test'. The selection by + 'area' requires 'subsystem' and a 'test' requires both the 'subsystem' and 'area'. This + command requires that ``ACTIVE:MODE`` is set to DIAGnostic. If not, the following error is + generated: -300,'Device-specific error; Not in Diagnostics mode - ``diag:sel`` + ''Channel1''' If in the proper active of DIAGnostic, then an invalid string generates the + following error: -220,'Parameter error; Invalid subsystem - ``diag:sel`` ''Channel2''' + + Usage: + - Using the ``.write(value)`` method will send the ``DIAGnostic:SELect value`` command. + + SCPI Syntax: + ``` + - DIAGnostic:SELect {ALL|} + ``` + + Properties: + - ``.verify``: The ``DIAGnostic:SELect:VERify`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._verify = DiagnosticSelectVerify(device, f"{self._cmd_syntax}:VERify") + + @property + def verify_(self) -> DiagnosticSelectVerify: + """Return the ``DIAGnostic:SELect:VERify`` command. + + Description: + - This command returns selection status of one specific test. A specific test requires + the 'subsystem', 'area', and 'test'. This is context sensitive and is dependent on the + type as set with the command ``DIAGNOSTIC:TYPE``. + + Usage: + - Using the ``.query(argument)`` method will send the + ``DIAGnostic:SELect:VERify? argument`` query. + - Using the ``.verify(argument, value)`` method will send the + ``DIAGnostic:SELect:VERify? argument`` query and raise an AssertionError if the + returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:SELect:VERify? ,, + ``` + """ + return self._verify + + +class DiagnosticRunning(SCPICmdRead): + """The ``DIAGnostic:RUNNing`` command. + + Description: + - This command returns the name of the subsystem, area, and test of the current diagnostic + test. This command can be issued at any time. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:RUNNing?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:RUNNing?`` query and raise + an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:RUNNing? + ``` + """ + + +class DiagnosticResultTime(SCPICmdReadWithArguments): + """The ``DIAGnostic:RESult:TIME`` command. + + Description: + - This command returns the time from the results of the last start of a set of selected + tests. Time is returned as a date time string as in the following example of '3/14/2013 + ``10:19 AM``'. Time for an area or subsystem have the following requirements: The time + only reflects the 'selected' tests. The 'selected' tests must have results of pass or + fail. As an example, if 3 of the 4 tests in an area has been selected, then only those 3 + contribute to the 'area' result. If only 2 of the selected 3 have run and completed (a + stop event occurred) then only those 2 contribute to the result. The time returned, which + is associated with the highest temperature of any selected test, is returned when the + results for more than one test is requested as in an area. + + Usage: + - Using the ``.query(argument)`` method will send the ``DIAGnostic:RESult:TIME? argument`` + query. + - Using the ``.verify(argument, value)`` method will send the + ``DIAGnostic:RESult:TIME? argument`` query and raise an AssertionError if the returned + value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:RESult:TIME? ''[,''[,'']] + ``` + """ + + +class DiagnosticResultTemperature(SCPICmdReadWithArguments): + """The ``DIAGnostic:RESult:TEMPerature`` command. + + Description: + - This command returns the temperature from the results of the last start of a set of + selected tests. All temperatures will be in °C. Temperature for an area or subsystem have + the following requirements. The temperature only reflects the 'selected' tests. The + 'selected' tests must have results of pass or fail. As an example, if 3 of the 4 tests in + an area has been selected, then only those 3 contribute to the 'area' result. If only 2 of + the selected 3 have run and completed (a stop event occurred) then only those 2 contribute + to the result. The highest temperature is returned when the results for more than one test + is requested (as in an area). The time will also be recorded for the highest temperature + and may be found with the ``Diag:Result:Time?`` query. + + Usage: + - Using the ``.query(argument)`` method will send the + ``DIAGnostic:RESult:TEMPerature? argument`` query. + - Using the ``.verify(argument, value)`` method will send the + ``DIAGnostic:RESult:TEMPerature? argument`` query and raise an AssertionError if the + returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:RESult:TEMPerature? ''[,''[,'']] + ``` + """ + + +class DiagnosticResult(SCPICmdReadWithArguments): + """The ``DIAGnostic:RESult`` command. + + Description: + - This command returns the status about the results of the last start of a set of selected + tests. An individual test result can have a status of Pass, Fail or Running. Status for an + area or a subsystem have the following requirements: The results only reflect the + 'selected' tests. The selected tests have to have results of pass or fail or be in the + running state. Only selected tests in an area or subsystem contribute to the result. As an + example, if 3 of the 4 tests in an area has been selected, then only those 3 contribute to + the 'area' result. If only 2 of the selected 3 have run and completed (a stop event + occurred) then only those 2 contribute to the result. If all contributors have passed, + then the result is passed. If any contributor has failed, then the result is failed. If + any contributor is running, then the result is running. + + Usage: + - Using the ``.query(argument)`` method will send the ``DIAGnostic:RESult? argument`` query. + - Using the ``.verify(argument, value)`` method will send the + ``DIAGnostic:RESult? argument`` query and raise an AssertionError if the returned value + does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:RESult? [{ALL|}] + ``` + + Properties: + - ``.temperature``: The ``DIAGnostic:RESult:TEMPerature`` command. + - ``.time``: The ``DIAGnostic:RESult:TIME`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._temperature = DiagnosticResultTemperature(device, f"{self._cmd_syntax}:TEMPerature") + self._time = DiagnosticResultTime(device, f"{self._cmd_syntax}:TIME") + + @property + def temperature(self) -> DiagnosticResultTemperature: + """Return the ``DIAGnostic:RESult:TEMPerature`` command. + + Description: + - This command returns the temperature from the results of the last start of a set of + selected tests. All temperatures will be in °C. Temperature for an area or subsystem + have the following requirements. The temperature only reflects the 'selected' tests. + The 'selected' tests must have results of pass or fail. As an example, if 3 of the 4 + tests in an area has been selected, then only those 3 contribute to the 'area' result. + If only 2 of the selected 3 have run and completed (a stop event occurred) then only + those 2 contribute to the result. The highest temperature is returned when the results + for more than one test is requested (as in an area). The time will also be recorded + for the highest temperature and may be found with the ``Diag:Result:Time?`` query. + + Usage: + - Using the ``.query(argument)`` method will send the + ``DIAGnostic:RESult:TEMPerature? argument`` query. + - Using the ``.verify(argument, value)`` method will send the + ``DIAGnostic:RESult:TEMPerature? argument`` query and raise an AssertionError if the + returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:RESult:TEMPerature? ''[,''[,'']] + ``` + """ + return self._temperature + + @property + def time(self) -> DiagnosticResultTime: + """Return the ``DIAGnostic:RESult:TIME`` command. + + Description: + - This command returns the time from the results of the last start of a set of selected + tests. Time is returned as a date time string as in the following example of + '3/14/2013 ``10:19 AM``'. Time for an area or subsystem have the following + requirements: The time only reflects the 'selected' tests. The 'selected' tests must + have results of pass or fail. As an example, if 3 of the 4 tests in an area has been + selected, then only those 3 contribute to the 'area' result. If only 2 of the selected + 3 have run and completed (a stop event occurred) then only those 2 contribute to the + result. The time returned, which is associated with the highest temperature of any + selected test, is returned when the results for more than one test is requested as in + an area. + + Usage: + - Using the ``.query(argument)`` method will send the + ``DIAGnostic:RESult:TIME? argument`` query. + - Using the ``.verify(argument, value)`` method will send the + ``DIAGnostic:RESult:TIME? argument`` query and raise an AssertionError if the returned + value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:RESult:TIME? ''[,''[,'']] + ``` + """ + return self._time + + +class DiagnosticLoops(SCPICmdRead): + """The ``DIAGnostic:LOOPs`` command. + + Description: + - This command returns the number of times that the selected diagnostics set was completed + during the current running or the last diagnostic running of the set. The current loop is + reset after every start. This command can be issued while diagnostics are still in + progress. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:LOOPs?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:LOOPs?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:LOOPs? + ``` + """ + + +class DiagnosticLogFailuresonly(SCPICmdWrite, SCPICmdRead): + """The ``DIAGnostic:LOG:FAILuresonly`` command. + + Description: + - This command sets or returns the flag that controls the amount of result information saved + into the diagnostic log. This controls all tests that pass or fail or only tests that + fail. The flag must be set before starting the diagnostic tests to obtain the expected + data. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:LOG:FAILuresonly?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:LOG:FAILuresonly?`` query + and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DIAGnostic:LOG:FAILuresonly value`` + command. + + SCPI Syntax: + ``` + - DIAGnostic:LOG:FAILuresonly {0|1|OFF|ON} + - DIAGnostic:LOG:FAILuresonly? + ``` + + Info: + - ``*RST`` sets this to 0. + """ + + +class DiagnosticLogClear(SCPICmdWriteNoArguments): + """The ``DIAGnostic:LOG:CLEar`` command. + + Description: + - This command clears the diagnostics results log. + + Usage: + - Using the ``.write()`` method will send the ``DIAGnostic:LOG:CLEar`` command. + + SCPI Syntax: + ``` + - DIAGnostic:LOG:CLEar + ``` + """ + + +class DiagnosticLog(SCPICmdRead): + """The ``DIAGnostic:LOG`` command. + + Description: + - This command returns a string of continuous concatenated test results. The start time is + recorded for each of the selected tests. This command can be issued at any time including + while diagnostics are in progress. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:LOG?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:LOG?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:LOG? + ``` + + Properties: + - ``.clear``: The ``DIAGnostic:LOG:CLEar`` command. + - ``.failuresonly``: The ``DIAGnostic:LOG:FAILuresonly`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._clear = DiagnosticLogClear(device, f"{self._cmd_syntax}:CLEar") + self._failuresonly = DiagnosticLogFailuresonly(device, f"{self._cmd_syntax}:FAILuresonly") + + @property + def clear(self) -> DiagnosticLogClear: + """Return the ``DIAGnostic:LOG:CLEar`` command. + + Description: + - This command clears the diagnostics results log. + + Usage: + - Using the ``.write()`` method will send the ``DIAGnostic:LOG:CLEar`` command. + + SCPI Syntax: + ``` + - DIAGnostic:LOG:CLEar + ``` + """ + return self._clear + + @property + def failuresonly(self) -> DiagnosticLogFailuresonly: + """Return the ``DIAGnostic:LOG:FAILuresonly`` command. + + Description: + - This command sets or returns the flag that controls the amount of result information + saved into the diagnostic log. This controls all tests that pass or fail or only tests + that fail. The flag must be set before starting the diagnostic tests to obtain the + expected data. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:LOG:FAILuresonly?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:LOG:FAILuresonly?`` + query and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DIAGnostic:LOG:FAILuresonly value`` + command. + + SCPI Syntax: + ``` + - DIAGnostic:LOG:FAILuresonly {0|1|OFF|ON} + - DIAGnostic:LOG:FAILuresonly? + ``` + + Info: + - ``*RST`` sets this to 0. + """ + return self._failuresonly + + +class DiagnosticImmediate(SCPICmdWriteNoArguments, SCPICmdRead): + """The ``DIAGnostic:IMMediate`` command. + + Description: + - This command executes all of the NORMal diagnostic tests. The query form of this command + executes all of the NORMal diagnostics and returns the results in the form of numeric of + values of 0 for no errors or -330 for one or more tests failed. This changes the active + mode to DIAGnostic, if necessary, and returns back to the original active mode when done. + This makes a single pass of all of the NORMal diagnostics. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:IMMediate?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:IMMediate?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write()`` method will send the ``DIAGnostic:IMMediate`` command. + + SCPI Syntax: + ``` + - DIAGnostic:IMMediate + - DIAGnostic:IMMediate? + ``` + """ + + +class DiagnosticData(SCPICmdRead): + """The ``DIAGnostic:DATA`` command. + + Description: + - This command returns the results of last executed tests for the NORMal diagnostic type in + the form of a numeric value of 0 for no errors or -330 for one or more tests failed. + Additional error details can be found by using the subsystem, area, and test queries such + as ``DIAGnostic:RESult?`` [,[,]]. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:DATA?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:DATA?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:DATA? + ``` + """ + + +class DiagnosticControlLoop(SCPICmdWrite, SCPICmdRead): + """The ``DIAGnostic:CONTrol:LOOP`` command. + + Description: + - This command sets or returns whether the next start of diagnostics runs once, runs + continuous loops, or loops for a number times for the selected set of tests. All loops may + be affected by the ``DIAGNOSTIC:CONTROL:HALT`` command which determines what happens if an + error occurs. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:CONTrol:LOOP?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:CONTrol:LOOP?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DIAGnostic:CONTrol:LOOP value`` + command. + + SCPI Syntax: + ``` + - DIAGnostic:CONTrol:LOOP {ONCE|CONTinuous|COUNt} + - DIAGnostic:CONTrol:LOOP? + ``` + + Info: + - ``ONCE`` disables the loop function, causes the execution of selected test(s), which may + be one or more, of diagnostics once and then halt. + - ``CONTinuous`` enables the loop function, causing the execution of diagnostics to + continuously loop. + - ``COUNt`` enables the loop function, causing the execution of diagnostics to loop for a + predefined count. Exit of the loop happens when the predefined loop count occurs. + - ``*RST`` sets this to ONCE. + """ + + +class DiagnosticControlHalt(SCPICmdWrite): + """The ``DIAGnostic:CONTrol:HALT`` command. + + Description: + - This command sets or returns whether the next execution of diagnostics looping stops on + the first diagnostic failure that occurs or continues to loop on the selected set of + diagnostic functions. + + Usage: + - Using the ``.write(value)`` method will send the ``DIAGnostic:CONTrol:HALT value`` + command. + + SCPI Syntax: + ``` + - DIAGnostic:CONTrol:HALT {0|1|OFF|ON} + ``` + + Info: + - ``*RST`` sets this to 0. + """ + + +class DiagnosticControlCount(SCPICmdWrite, SCPICmdRead): + """The ``DIAGnostic:CONTrol:COUNt`` command. + + Description: + - This command sets or returns the number of loop counts used when the loop mode is set to + COUNt. See ``DIAGNOSTIC:CONTROL:LOOP``. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:CONTrol:COUNt?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:CONTrol:COUNt?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DIAGnostic:CONTrol:COUNt value`` + command. + + SCPI Syntax: + ``` + - DIAGnostic:CONTrol:COUNt + - DIAGnostic:CONTrol:COUNt? + ``` + + Info: + - ``*RST`` sets this to 0. + """ + + +class DiagnosticControl(SCPICmdRead): + """The ``DIAGnostic:CONTrol`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:CONTrol?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:CONTrol?`` query and raise + an AssertionError if the returned value does not match ``value``. + + Properties: + - ``.count``: The ``DIAGnostic:CONTrol:COUNt`` command. + - ``.halt``: The ``DIAGnostic:CONTrol:HALT`` command. + - ``.loop``: The ``DIAGnostic:CONTrol:LOOP`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._count = DiagnosticControlCount(device, f"{self._cmd_syntax}:COUNt") + self._halt = DiagnosticControlHalt(device, f"{self._cmd_syntax}:HALT") + self._loop = DiagnosticControlLoop(device, f"{self._cmd_syntax}:LOOP") + + @property + def count(self) -> DiagnosticControlCount: + """Return the ``DIAGnostic:CONTrol:COUNt`` command. + + Description: + - This command sets or returns the number of loop counts used when the loop mode is set + to COUNt. See ``DIAGNOSTIC:CONTROL:LOOP``. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:CONTrol:COUNt?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:CONTrol:COUNt?`` query + and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DIAGnostic:CONTrol:COUNt value`` + command. + + SCPI Syntax: + ``` + - DIAGnostic:CONTrol:COUNt + - DIAGnostic:CONTrol:COUNt? + ``` + + Info: + - ``*RST`` sets this to 0. + """ + return self._count + + @property + def halt(self) -> DiagnosticControlHalt: + """Return the ``DIAGnostic:CONTrol:HALT`` command. + + Description: + - This command sets or returns whether the next execution of diagnostics looping stops + on the first diagnostic failure that occurs or continues to loop on the selected set + of diagnostic functions. + + Usage: + - Using the ``.write(value)`` method will send the ``DIAGnostic:CONTrol:HALT value`` + command. + + SCPI Syntax: + ``` + - DIAGnostic:CONTrol:HALT {0|1|OFF|ON} + ``` + + Info: + - ``*RST`` sets this to 0. + """ + return self._halt + + @property + def loop(self) -> DiagnosticControlLoop: + """Return the ``DIAGnostic:CONTrol:LOOP`` command. + + Description: + - This command sets or returns whether the next start of diagnostics runs once, runs + continuous loops, or loops for a number times for the selected set of tests. All loops + may be affected by the ``DIAGNOSTIC:CONTROL:HALT`` command which determines what + happens if an error occurs. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:CONTrol:LOOP?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:CONTrol:LOOP?`` query + and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DIAGnostic:CONTrol:LOOP value`` + command. + + SCPI Syntax: + ``` + - DIAGnostic:CONTrol:LOOP {ONCE|CONTinuous|COUNt} + - DIAGnostic:CONTrol:LOOP? + ``` + + Info: + - ``ONCE`` disables the loop function, causes the execution of selected test(s), which + may be one or more, of diagnostics once and then halt. + - ``CONTinuous`` enables the loop function, causing the execution of diagnostics to + continuously loop. + - ``COUNt`` enables the loop function, causing the execution of diagnostics to loop for + a predefined count. Exit of the loop happens when the predefined loop count occurs. + - ``*RST`` sets this to ONCE. + """ + return self._loop + + +class DiagnosticCatalog(SCPICmdReadWithArguments): + """The ``DIAGnostic:CATalog`` command. + + Description: + - This command returns the list of all diagnostic tests per selected type per subsystems, + areas, or ALL. All tests are grouped by areas. All areas are grouped by subsystems. The + available subsystems, areas, and tests depend on the type of testing (such as POST only or + Full diagnostics). The selected type is set with the command ``DIAGNOSTIC:TYPE``. + + Usage: + - Using the ``.query(argument)`` method will send the ``DIAGnostic:CATalog? argument`` + query. + - Using the ``.verify(argument, value)`` method will send the + ``DIAGnostic:CATalog? argument`` query and raise an AssertionError if the returned value + does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:CATalog? [{ALL|}[,{ALL|}]] + ``` + """ + + +class DiagnosticAbort(SCPICmdWriteNoArguments): + """The ``DIAGnostic:ABORt`` command. + + Description: + - This command attempts to stop the current diagnostic test and stops the execution of any + additional selected tests. This may result in loss of logging information collected for + the current test that responds to the abort event. + + Usage: + - Using the ``.write()`` method will send the ``DIAGnostic:ABORt`` command. + + SCPI Syntax: + ``` + - DIAGnostic:ABORt + ``` + """ + + +# pylint: disable=too-many-instance-attributes +class Diagnostic(SCPICmdRead): + """The ``DIAGnostic`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic?`` query and raise an + AssertionError if the returned value does not match ``value``. + + Properties: + - ``.abort``: The ``DIAGnostic:ABORt`` command. + - ``.catalog``: The ``DIAGnostic:CATalog`` command. + - ``.control``: The ``DIAGnostic:CONTrol`` command tree. + - ``.data``: The ``DIAGnostic:DATA`` command. + - ``.log``: The ``DIAGnostic:LOG`` command. + - ``.loops``: The ``DIAGnostic:LOOPs`` command. + - ``.result``: The ``DIAGnostic:RESult`` command. + - ``.running``: The ``DIAGnostic:RUNNing`` command. + - ``.select``: The ``DIAGnostic:SELect`` command. + - ``.start``: The ``DIAGnostic:STARt`` command. + - ``.stop``: The ``DIAGnostic:STOP`` command. + - ``.type``: The ``DIAGnostic:TYPE`` command. + - ``.unselect``: The ``DIAGnostic:UNSelect`` command. + - ``.immediate``: The ``DIAGnostic:IMMediate`` command. + """ + + def __init__(self, device: Optional["PIDevice"] = None, cmd_syntax: str = "DIAGnostic") -> None: + super().__init__(device, cmd_syntax) + self._abort = DiagnosticAbort(device, f"{self._cmd_syntax}:ABORt") + self._catalog = DiagnosticCatalog(device, f"{self._cmd_syntax}:CATalog") + self._control = DiagnosticControl(device, f"{self._cmd_syntax}:CONTrol") + self._data = DiagnosticData(device, f"{self._cmd_syntax}:DATA") + self._log = DiagnosticLog(device, f"{self._cmd_syntax}:LOG") + self._loops = DiagnosticLoops(device, f"{self._cmd_syntax}:LOOPs") + self._result = DiagnosticResult(device, f"{self._cmd_syntax}:RESult") + self._running = DiagnosticRunning(device, f"{self._cmd_syntax}:RUNNing") + self._select = DiagnosticSelect(device, f"{self._cmd_syntax}:SELect") + self._start = DiagnosticStart(device, f"{self._cmd_syntax}:STARt") + self._stop = DiagnosticStop(device, f"{self._cmd_syntax}:STOP") + self._type = DiagnosticType(device, f"{self._cmd_syntax}:TYPE") + self._unselect = DiagnosticUnselect(device, f"{self._cmd_syntax}:UNSelect") + self._immediate = DiagnosticImmediate(device, f"{self._cmd_syntax}:IMMediate") + + @property + def abort(self) -> DiagnosticAbort: + """Return the ``DIAGnostic:ABORt`` command. + + Description: + - This command attempts to stop the current diagnostic test and stops the execution of + any additional selected tests. This may result in loss of logging information + collected for the current test that responds to the abort event. + + Usage: + - Using the ``.write()`` method will send the ``DIAGnostic:ABORt`` command. + + SCPI Syntax: + ``` + - DIAGnostic:ABORt + ``` + """ + return self._abort + + @property + def catalog(self) -> DiagnosticCatalog: + """Return the ``DIAGnostic:CATalog`` command. + + Description: + - This command returns the list of all diagnostic tests per selected type per + subsystems, areas, or ALL. All tests are grouped by areas. All areas are grouped by + subsystems. The available subsystems, areas, and tests depend on the type of testing + (such as POST only or Full diagnostics). The selected type is set with the command + ``DIAGNOSTIC:TYPE``. + + Usage: + - Using the ``.query(argument)`` method will send the ``DIAGnostic:CATalog? argument`` + query. + - Using the ``.verify(argument, value)`` method will send the + ``DIAGnostic:CATalog? argument`` query and raise an AssertionError if the returned + value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:CATalog? [{ALL|}[,{ALL|}]] + ``` + """ + return self._catalog + + @property + def control(self) -> DiagnosticControl: + """Return the ``DIAGnostic:CONTrol`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:CONTrol?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:CONTrol?`` query and + raise an AssertionError if the returned value does not match ``value``. + + Sub-properties: + - ``.count``: The ``DIAGnostic:CONTrol:COUNt`` command. + - ``.halt``: The ``DIAGnostic:CONTrol:HALT`` command. + - ``.loop``: The ``DIAGnostic:CONTrol:LOOP`` command. + """ + return self._control + + @property + def data(self) -> DiagnosticData: + """Return the ``DIAGnostic:DATA`` command. + + Description: + - This command returns the results of last executed tests for the NORMal diagnostic type + in the form of a numeric value of 0 for no errors or -330 for one or more tests + failed. Additional error details can be found by using the subsystem, area, and test + queries such as ``DIAGnostic:RESult?`` [,[,]]. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:DATA?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:DATA?`` query and raise + an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:DATA? + ``` + """ + return self._data + + @property + def log(self) -> DiagnosticLog: + """Return the ``DIAGnostic:LOG`` command. + + Description: + - This command returns a string of continuous concatenated test results. The start time + is recorded for each of the selected tests. This command can be issued at any time + including while diagnostics are in progress. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:LOG?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:LOG?`` query and raise + an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:LOG? + ``` + + Sub-properties: + - ``.clear``: The ``DIAGnostic:LOG:CLEar`` command. + - ``.failuresonly``: The ``DIAGnostic:LOG:FAILuresonly`` command. + """ + return self._log + + @property + def loops(self) -> DiagnosticLoops: + """Return the ``DIAGnostic:LOOPs`` command. + + Description: + - This command returns the number of times that the selected diagnostics set was + completed during the current running or the last diagnostic running of the set. The + current loop is reset after every start. This command can be issued while diagnostics + are still in progress. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:LOOPs?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:LOOPs?`` query and + raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:LOOPs? + ``` + """ + return self._loops + + @property + def result(self) -> DiagnosticResult: + """Return the ``DIAGnostic:RESult`` command. + + Description: + - This command returns the status about the results of the last start of a set of + selected tests. An individual test result can have a status of Pass, Fail or Running. + Status for an area or a subsystem have the following requirements: The results only + reflect the 'selected' tests. The selected tests have to have results of pass or fail + or be in the running state. Only selected tests in an area or subsystem contribute to + the result. As an example, if 3 of the 4 tests in an area has been selected, then only + those 3 contribute to the 'area' result. If only 2 of the selected 3 have run and + completed (a stop event occurred) then only those 2 contribute to the result. If all + contributors have passed, then the result is passed. If any contributor has failed, + then the result is failed. If any contributor is running, then the result is running. + + Usage: + - Using the ``.query(argument)`` method will send the ``DIAGnostic:RESult? argument`` + query. + - Using the ``.verify(argument, value)`` method will send the + ``DIAGnostic:RESult? argument`` query and raise an AssertionError if the returned + value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:RESult? [{ALL|}] + ``` + + Sub-properties: + - ``.temperature``: The ``DIAGnostic:RESult:TEMPerature`` command. + - ``.time``: The ``DIAGnostic:RESult:TIME`` command. + """ + return self._result + + @property + def running(self) -> DiagnosticRunning: + """Return the ``DIAGnostic:RUNNing`` command. + + Description: + - This command returns the name of the subsystem, area, and test of the current + diagnostic test. This command can be issued at any time. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:RUNNing?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:RUNNing?`` query and + raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DIAGnostic:RUNNing? + ``` + """ + return self._running + + @property + def select(self) -> DiagnosticSelect: + """Return the ``DIAGnostic:SELect`` command. + + Description: + - This command (no query form) selects one or more tests of the current test list. Tests + can be selected by the keyword ALL, by 'subsystem', by 'area', or by 'test'. The + selection by 'area' requires 'subsystem' and a 'test' requires both the 'subsystem' + and 'area'. This command requires that ``ACTIVE:MODE`` is set to DIAGnostic. If not, + the following error is generated: -300,'Device-specific error; Not in Diagnostics mode + - ``diag:sel`` ''Channel1''' If in the proper active of DIAGnostic, then an invalid + string generates the following error: -220,'Parameter error; Invalid subsystem - + ``diag:sel`` ''Channel2''' + + Usage: + - Using the ``.write(value)`` method will send the ``DIAGnostic:SELect value`` command. + + SCPI Syntax: + ``` + - DIAGnostic:SELect {ALL|} + ``` + + Sub-properties: + - ``.verify``: The ``DIAGnostic:SELect:VERify`` command. + """ + return self._select + + @property + def start(self) -> DiagnosticStart: + """Return the ``DIAGnostic:STARt`` command. + + Description: + - This command starts the execution of the selected set of diagnostic tests. + + Usage: + - Using the ``.write()`` method will send the ``DIAGnostic:STARt`` command. + + SCPI Syntax: + ``` + - DIAGnostic:STARt + ``` + """ + return self._start + + @property + def stop(self) -> DiagnosticStop: + """Return the ``DIAGnostic:STOP`` command. + + Description: + - This command stops the diagnostic tests from running, after the diagnostic test + currently in progress completes. This also terminates diagnostic test looping. + + Usage: + - Using the ``.write()`` method will send the ``DIAGnostic:STOP`` command. + + SCPI Syntax: + ``` + - DIAGnostic:STOP + ``` + + Sub-properties: + - ``.state``: The ``DIAGnostic:STOP:STATe`` command. + """ + return self._stop + + @property + def type(self) -> DiagnosticType: + """Return the ``DIAGnostic:TYPE`` command. + + Description: + - This command sets or returns the diagnostic type. The diagnostics work on a list of + tests that support different types of testing. This sets the context for other + commands such as selecting a test to run. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:TYPE?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:TYPE?`` query and raise + an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DIAGnostic:TYPE value`` command. + + SCPI Syntax: + ``` + - DIAGnostic:TYPE {NORMal|POST} + - DIAGnostic:TYPE? + ``` + + Info: + - ``NORMal`` - Normal operating mode POST - Power On Self Test. + - ``*RST`` sets this to NORM. + + Sub-properties: + - ``.catalog``: The ``DIAGnostic:TYPE:CATalog`` command. + """ + return self._type + + @property + def unselect(self) -> DiagnosticUnselect: + """Return the ``DIAGnostic:UNSelect`` command. + + Description: + - This command unselects one or more tests of the current test list. Tests can be + unselected by the keyword ALL, by 'subsystem', by 'area', or by 'test'. To unselect an + 'area', the 'subsystem' is required. To unselect a 'test' requires both the + 'subsystem' and 'area'. + + Usage: + - Using the ``.write(value)`` method will send the ``DIAGnostic:UNSelect value`` + command. + + SCPI Syntax: + ``` + - DIAGnostic:UNSelect {ALL|<'subsystem'>,<'area'>,<'test'>} + ``` + """ + return self._unselect + + @property + def immediate(self) -> DiagnosticImmediate: + """Return the ``DIAGnostic:IMMediate`` command. + + Description: + - This command executes all of the NORMal diagnostic tests. The query form of this + command executes all of the NORMal diagnostics and returns the results in the form of + numeric of values of 0 for no errors or -330 for one or more tests failed. This + changes the active mode to DIAGnostic, if necessary, and returns back to the original + active mode when done. This makes a single pass of all of the NORMal diagnostics. + + Usage: + - Using the ``.query()`` method will send the ``DIAGnostic:IMMediate?`` query. + - Using the ``.verify(value)`` method will send the ``DIAGnostic:IMMediate?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write()`` method will send the ``DIAGnostic:IMMediate`` command. + + SCPI Syntax: + ``` + - DIAGnostic:IMMediate + - DIAGnostic:IMMediate? + ``` + """ + return self._immediate diff --git a/src/tm_devices/commands/gen_e3e9uu_lpdmso/data.py b/src/tm_devices/commands/gen_e3e9uu_lpdmso/data.py new file mode 100644 index 00000000..bf963d1a --- /dev/null +++ b/src/tm_devices/commands/gen_e3e9uu_lpdmso/data.py @@ -0,0 +1,776 @@ +"""The data commands module. + +These commands are used in the following models: +LPD6, MSO4, MSO4B, MSO5, MSO5B, MSO5LP, MSO6, MSO6B + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - DATa {INIT|SNAp} + - DATa:ENCdg {ASCIi|RIBinary|RPBinary|FPBinary|SRIbinary|SRPbinary|SFPbinary} + - DATa:ENCdg? + - DATa:FRAMESTARt + - DATa:FRAMESTARt? + - DATa:FRAMESTOP {|MAX} + - DATa:FRAMESTOP? + - DATa:MODe {VECtor|PIXmap} + - DATa:MODe? + - DATa:RESample + - DATa:RESample? + - DATa:SOUrce [<,>] + - DATa:SOUrce:AVAILable? + - DATa:SOUrce? + - DATa:STARt + - DATa:STARt? + - DATa:STOP + - DATa:STOP? + - DATa:WIDth + - DATa:WIDth? + - DATa? + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead, SCPICmdWrite + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class DataWidth(SCPICmdWrite, SCPICmdRead): + """The ``DATa:WIDth`` command. + + Description: + - This command specifies the width, in bytes per point, for waveform data transferred from + the instrument via the CURVe? query. (This command is synonymous with + ``WFMOutpre:BYT_Nr``.) + + Usage: + - Using the ``.query()`` method will send the ``DATa:WIDth?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:WIDth?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:WIDth value`` command. + + SCPI Syntax: + ``` + - DATa:WIDth + - DATa:WIDth? + ``` + + Info: + - ```` is an integer that indicates the number of bytes per point for the outgoing + waveform data when queried using the CURVe? command. + """ + + +class DataStop(SCPICmdWrite, SCPICmdRead): + """The ``DATa:STOP`` command. + + Description: + - This command sets or queries the last data point that will be transferred when using the + CURVE? query. When using the CURVE command, ``DATa:STOP`` is ignored. This command allows + for the transfer of partial waveforms to the controller. If is greater than the + record length, then data will be transferred up to the record length. If both + ``DATa:STARt`` and ``DATa:STOP`` are greater than the record length, the last data point + in the record is returned. ``DATa:STARt`` and ``DATa:STOP`` are order independent. When + ``DATa:STOP`` is less than ``DATa:STARt``, the values will be swapped internally for the + CURVE? query. If you always want to transfer complete waveforms, set ``DATa:STARt`` to 1 + and ``DATa:STOP`` to the maximum record length, or larger. Changes to the record length + value are not automatically reflected in the ``DATa:STOP`` value. As record length is + varied, the ``DATa:STOP`` value must be explicitly changed to ensure the entire record is + transmitted. In other words, curve results will not automatically and correctly reflect + increases in record length if the distance from ``DATa:STARt`` to ``DATa:STOP`` stays + smaller than the increased record length. + + Usage: + - Using the ``.query()`` method will send the ``DATa:STOP?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:STOP?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:STOP value`` command. + + SCPI Syntax: + ``` + - DATa:STOP + - DATa:STOP? + ``` + + Info: + - ```` is the last data point that will be transferred, which ranges from 1 to the + record length. + """ + + +class DataStart(SCPICmdWrite, SCPICmdRead): + """The ``DATa:STARt`` command. + + Description: + - This command sets or queries the starting data point for waveform transfer. This command + allows for the transfer of partial waveforms to and from the instrument. Data will be + transferred from to ``DATa:STOP`` or the record length, whichever is less. If + is greater than the record length, the last data point in the record is transferred. + ``DATa:STARt`` and ``DATa:STOP`` are order independent. When ``DATa:STOP`` is greater than + ``DATa:STARt``, the values will be swapped internally for the CURVE? query. + + Usage: + - Using the ``.query()`` method will send the ``DATa:STARt?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:STARt?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:STARt value`` command. + + SCPI Syntax: + ``` + - DATa:STARt + - DATa:STARt? + ``` + + Info: + - ```` is the first data point that will be transferred, which ranges from 1 to the + record length. + """ + + +class DataSourceAvailable(SCPICmdRead): + """The ``DATa:SOUrce:AVAILable`` command. + + Description: + - This query returns a list of enumerations representing the source waveforms that are + currently available for ``:CURVe?`` queries. This means that the waveforms have been + acquired. If there are none, NONE is returned. + + Usage: + - Using the ``.query()`` method will send the ``DATa:SOUrce:AVAILable?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:SOUrce:AVAILable?`` query and + raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DATa:SOUrce:AVAILable? + ``` + """ + + +class DataSource(SCPICmdWrite, SCPICmdRead): + """The ``DATa:SOUrce`` command. + + Description: + - This command sets or queries the location of waveform data that is transferred from the + instrument by the CURVE Query. + + Usage: + - Using the ``.query()`` method will send the ``DATa:SOUrce?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:SOUrce?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:SOUrce value`` command. + + SCPI Syntax: + ``` + - DATa:SOUrce [<,>] + - DATa:SOUrce? + ``` + + Info: + - ```` is the location of the waveform data that will be transferred from the + instrument to the controller. It can consist of CH, MATH, REF, DIGITALALL. Note + that digital data is transferred as 16-bit data, with the least-significant bit + representing D0, and the most-significant bit representing D15. + - ```` can consist of the following. + - ``CH`` selects the specified analog channel as the source. + - ``MATH`` selects the specified reference waveform as the source. The reference number + is specified by x, which ranges from 1 through 4. + - ``REF`` selects the specified reference waveform as the source. The reference number is + specified by x, which ranges from 1 through 8. + - ``CH_D`` selects the specified digital channel. + - ``CH_DAll`` selects the specified channel group of digital channels. + - ``DIGITALALL`` selects digital waveforms as the source. The Digital data is transferred as + 16-bit data, with the least-significant bit representing D0, and the most-significant bit + representing D15. The LSB always contains D0-D7 and MSB always contains D8-D15 data. + - ``CH_SV_NORMal`` , ``CH_SV_AVErage``, ``CH_SV_MAX_Hold``, ``CH_SV_MIN_Hold`` + selects the specified Spectrum View waveform. + - ``CH_MAG_VS_TIME`` , ``CH_FREQ_VS_TIME``, ``CH_PHASE_VS_TIME`` selects the + specified RF vs. Time waveform. + - ``CH_SV_BASEBAND_IQ`` selects the specified RF baseband IQ data. + + Properties: + - ``.available``: The ``DATa:SOUrce:AVAILable`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._available = DataSourceAvailable(device, f"{self._cmd_syntax}:AVAILable") + + @property + def available(self) -> DataSourceAvailable: + """Return the ``DATa:SOUrce:AVAILable`` command. + + Description: + - This query returns a list of enumerations representing the source waveforms that are + currently available for ``:CURVe?`` queries. This means that the waveforms have been + acquired. If there are none, NONE is returned. + + Usage: + - Using the ``.query()`` method will send the ``DATa:SOUrce:AVAILable?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:SOUrce:AVAILable?`` query and + raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DATa:SOUrce:AVAILable? + ``` + """ + return self._available + + +class DataResample(SCPICmdWrite, SCPICmdRead): + """The ``DATa:RESample`` command. + + Description: + - This command sets or queries the resampling of outgoing waveform data. This command is + equivalent to setting ``WFMOutpre:RESample``. Setting the ``DATa:RESample`` value causes + the corresponding WFMOutpre value to be updated and vice versa. + + Usage: + - Using the ``.query()`` method will send the ``DATa:RESample?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:RESample?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:RESample value`` command. + + SCPI Syntax: + ``` + - DATa:RESample + - DATa:RESample? + ``` + + Info: + - ```` is the resampling rate. The default value is 1, which means every sample is + returned. A value of 2 returns every other sample, while a value of 3 returns every third + sample, and so on. + """ + + +class DataMode(SCPICmdWrite, SCPICmdRead): + """The ``DATa:MODe`` command. + + Description: + - This command sets or queries the mode for waveform data sent to returned by CURVe?. When + FastAcq mode is ON, and the value is PIXmap, it returns Fast Acquisition pixmap data or + the vector data is returned. When the data mode is set as VECtor then you get the waveform + sampled data. The Data width is reset to 1 or 2 instead of 4. + + Usage: + - Using the ``.query()`` method will send the ``DATa:MODe?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:MODe?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:MODe value`` command. + + SCPI Syntax: + ``` + - DATa:MODe {VECtor|PIXmap} + - DATa:MODe? + ``` + + Info: + - ``VECtor`` sets the mode for waveform data to vector. + - ``PIXmap`` sets the mode for waveform data to pixmap. + """ + + +class DataFramestop(SCPICmdWrite, SCPICmdRead): + """The ``DATa:FRAMESTOP`` command. + + Description: + - This command sets or queries the last acquisition for waveform transfer using the CURVE? + query. This is only relevant when History or FastFrame acquisition modes are enabled. + + Usage: + - Using the ``.query()`` method will send the ``DATa:FRAMESTOP?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:FRAMESTOP?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:FRAMESTOP value`` command. + + SCPI Syntax: + ``` + - DATa:FRAMESTOP {|MAX} + - DATa:FRAMESTOP? + ``` + + Info: + - ```` is the last acquisition that will be transferred, which ranges from 1 to the + number of History or FastFrame acquisitions. Results will be transferred from acquisitions + ``DATa:FRAMESTARt`` to . If is greater than the number of acquisitions, then + data will be transferred up to the last acquisition. If ``DATa:FRAMESTOP`` is less than + ``DATa:FRAMESTARt``, then only a single acquisition at ``DATa:FRAMESTARt`` is transferred. + - ``MAX`` indicates that data is always transferred up to the last acquisition. + """ + + +class DataFramestart(SCPICmdWrite, SCPICmdRead): + """The ``DATa:FRAMESTARt`` command. + + Description: + - This command sets or queries the starting acquisition for waveform transfer using the + CURVE? query. This is only relevant when History or FastFrame acquisition modes are + enabled. + + Usage: + - Using the ``.query()`` method will send the ``DATa:FRAMESTARt?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:FRAMESTARt?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:FRAMESTARt value`` command. + + SCPI Syntax: + ``` + - DATa:FRAMESTARt + - DATa:FRAMESTARt? + ``` + + Info: + - ```` is the first acquisition that will be transferred, which ranges from 1 to the + number of History or FastFrame acquisitions. Results are transferred from acquisition + to ``DATa:FRAMESTOP`` or the total number of acquisitions, whichever is less. If + is greater than the number of acquisitions, then only the last acquisition is + transferred. If ``DATa:FRAMESTARt`` is greater than ``DATa:FRAMESTOP``, then only a single + acquisition at is transferred. + """ + + +class DataEncdg(SCPICmdWrite, SCPICmdRead): + """The ``DATa:ENCdg`` command. + + Description: + - This command sets or queries the format of outgoing waveform data. This command is + equivalent to setting ``WFMOUTPRE:ENCDG``, ``WFMOUTPRE:BN_FMT``, and ``WFMOUTPRE:BYT_OR``. + Setting the ``DATa:ENGdg`` value causes the corresponding WFMOutpre values to be updated + and vice versa. + + Usage: + - Using the ``.query()`` method will send the ``DATa:ENCdg?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:ENCdg?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:ENCdg value`` command. + + SCPI Syntax: + ``` + - DATa:ENCdg {ASCIi|RIBinary|RPBinary|FPBinary|SRIbinary|SRPbinary|SFPbinary} + - DATa:ENCdg? + ``` + + Info: + - ``ASCIi`` specifies the ASCII representation of signed INT, FLOAT. If ASCII is the value, + then ``:BN_Fmt`` and ``:BYT_Or`` are ignored. The following are the DATa and WFMOutpre + parameter settings (separated by semicolons): ``:ENCdg`` = ASC ; ``:BN_Fmt`` = N/A ; + ``:BYT_Or`` = N/A ; ``:BYT_NR`` = 1,2,4. + - ``RIBinary`` specifies the positive integer data-point representation, with the most + significant byte transferred first. When ``:BYT_Nr`` is 1, the range from 0 through 255. + When ``:BYT_Nr`` is 2,the range is from 0 to 65,535. When ``:BYT_Nr`` is 4, then the + waveform being queried would return Fast Acquisition Pixmap data (if fast acq is turned on + and data mode is set to pixmap). The following are the DATa and WFMOutpre parameter + settings (separated by semicolons): ``:ENCdg`` = BIN ; ``:BN_Fmt`` = RI ; ``:BYT_Or`` = + MSB ; ``:BYT_NR`` = 1,2. + - ``RPBinary`` specifies the positive integer data-point representation, with the most + significant byte transferred first. When ``:BYT_Nr`` is 1, the range from 0 through 255. + When ``:BYT_Nr`` is 2, the range is from 0 to 65,535. The following are the DATa and + WFMOutpre parameter settings (separated by semicolons): ``:ENCdg`` = ASC ; ``:BN_Fmt`` = + RP ; ``:BYT_Or`` = MSB ; ``:BYT_NR`` = 1,2. + - ``FPBinary`` specifies the floating point (width = 4) data. The range is from -3.4 × 1038 + to 3.4 × 1038. The center of the screen is 0. The upper limit is the top of the screen and + the lower limit is the bottom of the screen. The FPBinary argument is only applicable to + math waveforms or ref waveforms saved from math waveforms. The following are the DATa and + WFMOutpre parameter settings (separated by semicolons): ``:ENCdg`` = BIN ; ``:BN_Fmt`` = + FP ; ``:BYT_Or`` = MSB ; ``:BYT_NR`` = 4. + - ``SRIbinary`` is the same as RIBinary except that the byte order is swapped, meaning that + the least significant byte is transferred first. This format is useful when transferring + data to IBM compatible PCs. The following are the DATa and WFMOutpre parameter settings + (separated by semicolons): ``:ENCdg`` = BIN ; ``:BN_Fmt`` = RI ; ``:BYT_Or`` = LSB ; + ``:BYT_NR`` = 1,2. + - ``SRPbinary`` is the same as RPBinary except that the byte order is swapped, meaning that + the least significant byte is transferred first. This format is useful when transferring + data to PCs. The following are the DATa and WFMOutpre parameter settings (separated by + semicolons): ``:ENCdg`` = BIN ; ``:BN_Fmt`` = RP ; ``:BYT_Or`` = LSB ; ``:BYT_NR`` = 1,2. + - ``SFPbinary`` specifies floating point data in IBM PC format. The SFPbinary argument only + works on math waveforms or ref waveforms saved from math waveforms. The following are the + DATa and WFMOutpre parameter settings (separated by semicolons): ``:ENCdg`` = BIN ; + ``:BN_Fmt`` = FP ; ``:BYT_Or`` = LSB ; ``:BYT_NR`` = 4. + """ + + +# pylint: disable=too-many-instance-attributes +class Data(SCPICmdWrite, SCPICmdRead): + """The ``DATa`` command. + + Description: + - This command sets or queries the format and location of the waveform data that is + transferred with the CURVE command. + + Usage: + - Using the ``.query()`` method will send the ``DATa?`` query. + - Using the ``.verify(value)`` method will send the ``DATa?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa value`` command. + + SCPI Syntax: + ``` + - DATa {INIT|SNAp} + - DATa? + ``` + + Info: + - ``INIT`` initializes the waveform data parameters to their factory defaults except for + ``DATa:STOP``, which isset to the current acquisition record length. + - ``SNAp`` Sets ``DATa:STARt`` and ``DATa:STOP`` to match the current waveform cursor + positions of WAVEVIEW1 CURSOR1 if these waveform cursors are currently on. If these + waveform cursors are not on when the ``DATa SNAp`` command is sent, it is silently ignored + and ``DATa:STARt`` and ``:STOP`` remain unchanged. + + Properties: + - ``.encdg``: The ``DATa:ENCdg`` command. + - ``.framestart``: The ``DATa:FRAMESTARt`` command. + - ``.framestop``: The ``DATa:FRAMESTOP`` command. + - ``.mode``: The ``DATa:MODe`` command. + - ``.resample``: The ``DATa:RESample`` command. + - ``.source``: The ``DATa:SOUrce`` command. + - ``.start``: The ``DATa:STARt`` command. + - ``.stop``: The ``DATa:STOP`` command. + - ``.width``: The ``DATa:WIDth`` command. + """ + + def __init__(self, device: Optional["PIDevice"] = None, cmd_syntax: str = "DATa") -> None: + super().__init__(device, cmd_syntax) + self._encdg = DataEncdg(device, f"{self._cmd_syntax}:ENCdg") + self._framestart = DataFramestart(device, f"{self._cmd_syntax}:FRAMESTARt") + self._framestop = DataFramestop(device, f"{self._cmd_syntax}:FRAMESTOP") + self._mode = DataMode(device, f"{self._cmd_syntax}:MODe") + self._resample = DataResample(device, f"{self._cmd_syntax}:RESample") + self._source = DataSource(device, f"{self._cmd_syntax}:SOUrce") + self._start = DataStart(device, f"{self._cmd_syntax}:STARt") + self._stop = DataStop(device, f"{self._cmd_syntax}:STOP") + self._width = DataWidth(device, f"{self._cmd_syntax}:WIDth") + + @property + def encdg(self) -> DataEncdg: + """Return the ``DATa:ENCdg`` command. + + Description: + - This command sets or queries the format of outgoing waveform data. This command is + equivalent to setting ``WFMOUTPRE:ENCDG``, ``WFMOUTPRE:BN_FMT``, and + ``WFMOUTPRE:BYT_OR``. Setting the ``DATa:ENGdg`` value causes the corresponding + WFMOutpre values to be updated and vice versa. + + Usage: + - Using the ``.query()`` method will send the ``DATa:ENCdg?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:ENCdg?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:ENCdg value`` command. + + SCPI Syntax: + ``` + - DATa:ENCdg {ASCIi|RIBinary|RPBinary|FPBinary|SRIbinary|SRPbinary|SFPbinary} + - DATa:ENCdg? + ``` + + Info: + - ``ASCIi`` specifies the ASCII representation of signed INT, FLOAT. If ASCII is the + value, then ``:BN_Fmt`` and ``:BYT_Or`` are ignored. The following are the DATa and + WFMOutpre parameter settings (separated by semicolons): ``:ENCdg`` = ASC ; ``:BN_Fmt`` + = N/A ; ``:BYT_Or`` = N/A ; ``:BYT_NR`` = 1,2,4. + - ``RIBinary`` specifies the positive integer data-point representation, with the most + significant byte transferred first. When ``:BYT_Nr`` is 1, the range from 0 through + 255. When ``:BYT_Nr`` is 2,the range is from 0 to 65,535. When ``:BYT_Nr`` is 4, then + the waveform being queried would return Fast Acquisition Pixmap data (if fast acq is + turned on and data mode is set to pixmap). The following are the DATa and WFMOutpre + parameter settings (separated by semicolons): ``:ENCdg`` = BIN ; ``:BN_Fmt`` = RI ; + ``:BYT_Or`` = MSB ; ``:BYT_NR`` = 1,2. + - ``RPBinary`` specifies the positive integer data-point representation, with the most + significant byte transferred first. When ``:BYT_Nr`` is 1, the range from 0 through + 255. When ``:BYT_Nr`` is 2, the range is from 0 to 65,535. The following are the DATa + and WFMOutpre parameter settings (separated by semicolons): ``:ENCdg`` = ASC ; + ``:BN_Fmt`` = RP ; ``:BYT_Or`` = MSB ; ``:BYT_NR`` = 1,2. + - ``FPBinary`` specifies the floating point (width = 4) data. The range is from -3.4 × + 1038 to 3.4 × 1038. The center of the screen is 0. The upper limit is the top of the + screen and the lower limit is the bottom of the screen. The FPBinary argument is only + applicable to math waveforms or ref waveforms saved from math waveforms. The following + are the DATa and WFMOutpre parameter settings (separated by semicolons): ``:ENCdg`` = + BIN ; ``:BN_Fmt`` = FP ; ``:BYT_Or`` = MSB ; ``:BYT_NR`` = 4. + - ``SRIbinary`` is the same as RIBinary except that the byte order is swapped, meaning + that the least significant byte is transferred first. This format is useful when + transferring data to IBM compatible PCs. The following are the DATa and WFMOutpre + parameter settings (separated by semicolons): ``:ENCdg`` = BIN ; ``:BN_Fmt`` = RI ; + ``:BYT_Or`` = LSB ; ``:BYT_NR`` = 1,2. + - ``SRPbinary`` is the same as RPBinary except that the byte order is swapped, meaning + that the least significant byte is transferred first. This format is useful when + transferring data to PCs. The following are the DATa and WFMOutpre parameter settings + (separated by semicolons): ``:ENCdg`` = BIN ; ``:BN_Fmt`` = RP ; ``:BYT_Or`` = LSB ; + ``:BYT_NR`` = 1,2. + - ``SFPbinary`` specifies floating point data in IBM PC format. The SFPbinary argument + only works on math waveforms or ref waveforms saved from math waveforms. The following + are the DATa and WFMOutpre parameter settings (separated by semicolons): ``:ENCdg`` = + BIN ; ``:BN_Fmt`` = FP ; ``:BYT_Or`` = LSB ; ``:BYT_NR`` = 4. + """ + return self._encdg + + @property + def framestart(self) -> DataFramestart: + """Return the ``DATa:FRAMESTARt`` command. + + Description: + - This command sets or queries the starting acquisition for waveform transfer using the + CURVE? query. This is only relevant when History or FastFrame acquisition modes are + enabled. + + Usage: + - Using the ``.query()`` method will send the ``DATa:FRAMESTARt?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:FRAMESTARt?`` query and raise + an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:FRAMESTARt value`` command. + + SCPI Syntax: + ``` + - DATa:FRAMESTARt + - DATa:FRAMESTARt? + ``` + + Info: + - ```` is the first acquisition that will be transferred, which ranges from 1 to + the number of History or FastFrame acquisitions. Results are transferred from + acquisition to ``DATa:FRAMESTOP`` or the total number of acquisitions, whichever + is less. If is greater than the number of acquisitions, then only the last + acquisition is transferred. If ``DATa:FRAMESTARt`` is greater than ``DATa:FRAMESTOP``, + then only a single acquisition at is transferred. + """ + return self._framestart + + @property + def framestop(self) -> DataFramestop: + """Return the ``DATa:FRAMESTOP`` command. + + Description: + - This command sets or queries the last acquisition for waveform transfer using the + CURVE? query. This is only relevant when History or FastFrame acquisition modes are + enabled. + + Usage: + - Using the ``.query()`` method will send the ``DATa:FRAMESTOP?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:FRAMESTOP?`` query and raise + an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:FRAMESTOP value`` command. + + SCPI Syntax: + ``` + - DATa:FRAMESTOP {|MAX} + - DATa:FRAMESTOP? + ``` + + Info: + - ```` is the last acquisition that will be transferred, which ranges from 1 to the + number of History or FastFrame acquisitions. Results will be transferred from + acquisitions ``DATa:FRAMESTARt`` to . If is greater than the number of + acquisitions, then data will be transferred up to the last acquisition. If + ``DATa:FRAMESTOP`` is less than ``DATa:FRAMESTARt``, then only a single acquisition at + ``DATa:FRAMESTARt`` is transferred. + - ``MAX`` indicates that data is always transferred up to the last acquisition. + """ + return self._framestop + + @property + def mode(self) -> DataMode: + """Return the ``DATa:MODe`` command. + + Description: + - This command sets or queries the mode for waveform data sent to returned by CURVe?. + When FastAcq mode is ON, and the value is PIXmap, it returns Fast Acquisition pixmap + data or the vector data is returned. When the data mode is set as VECtor then you get + the waveform sampled data. The Data width is reset to 1 or 2 instead of 4. + + Usage: + - Using the ``.query()`` method will send the ``DATa:MODe?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:MODe?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:MODe value`` command. + + SCPI Syntax: + ``` + - DATa:MODe {VECtor|PIXmap} + - DATa:MODe? + ``` + + Info: + - ``VECtor`` sets the mode for waveform data to vector. + - ``PIXmap`` sets the mode for waveform data to pixmap. + """ + return self._mode + + @property + def resample(self) -> DataResample: + """Return the ``DATa:RESample`` command. + + Description: + - This command sets or queries the resampling of outgoing waveform data. This command is + equivalent to setting ``WFMOutpre:RESample``. Setting the ``DATa:RESample`` value + causes the corresponding WFMOutpre value to be updated and vice versa. + + Usage: + - Using the ``.query()`` method will send the ``DATa:RESample?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:RESample?`` query and raise + an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:RESample value`` command. + + SCPI Syntax: + ``` + - DATa:RESample + - DATa:RESample? + ``` + + Info: + - ```` is the resampling rate. The default value is 1, which means every sample is + returned. A value of 2 returns every other sample, while a value of 3 returns every + third sample, and so on. + """ + return self._resample + + @property + def source(self) -> DataSource: + """Return the ``DATa:SOUrce`` command. + + Description: + - This command sets or queries the location of waveform data that is transferred from + the instrument by the CURVE Query. + + Usage: + - Using the ``.query()`` method will send the ``DATa:SOUrce?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:SOUrce?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:SOUrce value`` command. + + SCPI Syntax: + ``` + - DATa:SOUrce [<,>] + - DATa:SOUrce? + ``` + + Info: + - ```` is the location of the waveform data that will be transferred from the + instrument to the controller. It can consist of CH, MATH, REF, DIGITALALL. + Note that digital data is transferred as 16-bit data, with the least-significant bit + representing D0, and the most-significant bit representing D15. + - ```` can consist of the following. + - ``CH`` selects the specified analog channel as the source. + - ``MATH`` selects the specified reference waveform as the source. The reference + number is specified by x, which ranges from 1 through 4. + - ``REF`` selects the specified reference waveform as the source. The reference + number is specified by x, which ranges from 1 through 8. + - ``CH_D`` selects the specified digital channel. + - ``CH_DAll`` selects the specified channel group of digital channels. + - ``DIGITALALL`` selects digital waveforms as the source. The Digital data is + transferred as 16-bit data, with the least-significant bit representing D0, and the + most-significant bit representing D15. The LSB always contains D0-D7 and MSB always + contains D8-D15 data. + - ``CH_SV_NORMal`` , ``CH_SV_AVErage``, ``CH_SV_MAX_Hold``, + ``CH_SV_MIN_Hold`` selects the specified Spectrum View waveform. + - ``CH_MAG_VS_TIME`` , ``CH_FREQ_VS_TIME``, ``CH_PHASE_VS_TIME`` selects the + specified RF vs. Time waveform. + - ``CH_SV_BASEBAND_IQ`` selects the specified RF baseband IQ data. + + Sub-properties: + - ``.available``: The ``DATa:SOUrce:AVAILable`` command. + """ + return self._source + + @property + def start(self) -> DataStart: + """Return the ``DATa:STARt`` command. + + Description: + - This command sets or queries the starting data point for waveform transfer. This + command allows for the transfer of partial waveforms to and from the instrument. Data + will be transferred from to ``DATa:STOP`` or the record length, whichever is + less. If is greater than the record length, the last data point in the record is + transferred. ``DATa:STARt`` and ``DATa:STOP`` are order independent. When + ``DATa:STOP`` is greater than ``DATa:STARt``, the values will be swapped internally + for the CURVE? query. + + Usage: + - Using the ``.query()`` method will send the ``DATa:STARt?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:STARt?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:STARt value`` command. + + SCPI Syntax: + ``` + - DATa:STARt + - DATa:STARt? + ``` + + Info: + - ```` is the first data point that will be transferred, which ranges from 1 to the + record length. + """ + return self._start + + @property + def stop(self) -> DataStop: + """Return the ``DATa:STOP`` command. + + Description: + - This command sets or queries the last data point that will be transferred when using + the CURVE? query. When using the CURVE command, ``DATa:STOP`` is ignored. This command + allows for the transfer of partial waveforms to the controller. If is greater + than the record length, then data will be transferred up to the record length. If both + ``DATa:STARt`` and ``DATa:STOP`` are greater than the record length, the last data + point in the record is returned. ``DATa:STARt`` and ``DATa:STOP`` are order + independent. When ``DATa:STOP`` is less than ``DATa:STARt``, the values will be + swapped internally for the CURVE? query. If you always want to transfer complete + waveforms, set ``DATa:STARt`` to 1 and ``DATa:STOP`` to the maximum record length, or + larger. Changes to the record length value are not automatically reflected in the + ``DATa:STOP`` value. As record length is varied, the ``DATa:STOP`` value must be + explicitly changed to ensure the entire record is transmitted. In other words, curve + results will not automatically and correctly reflect increases in record length if the + distance from ``DATa:STARt`` to ``DATa:STOP`` stays smaller than the increased record + length. + + Usage: + - Using the ``.query()`` method will send the ``DATa:STOP?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:STOP?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:STOP value`` command. + + SCPI Syntax: + ``` + - DATa:STOP + - DATa:STOP? + ``` + + Info: + - ```` is the last data point that will be transferred, which ranges from 1 to the + record length. + """ + return self._stop + + @property + def width(self) -> DataWidth: + """Return the ``DATa:WIDth`` command. + + Description: + - This command specifies the width, in bytes per point, for waveform data transferred + from the instrument via the CURVe? query. (This command is synonymous with + ``WFMOutpre:BYT_Nr``.) + + Usage: + - Using the ``.query()`` method will send the ``DATa:WIDth?`` query. + - Using the ``.verify(value)`` method will send the ``DATa:WIDth?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``DATa:WIDth value`` command. + + SCPI Syntax: + ``` + - DATa:WIDth + - DATa:WIDth? + ``` + + Info: + - ```` is an integer that indicates the number of bytes per point for the outgoing + waveform data when queried using the CURVe? command. + """ + return self._width diff --git a/src/tm_devices/commands/gen_e3e9uu_lpdmso/eyemask.py b/src/tm_devices/commands/gen_e3e9uu_lpdmso/eyemask.py new file mode 100644 index 00000000..7eb9331e --- /dev/null +++ b/src/tm_devices/commands/gen_e3e9uu_lpdmso/eyemask.py @@ -0,0 +1,726 @@ +"""The eyemask commands module. + +These commands are used in the following models: +LPD6, MSO4, MSO4B, MSO5, MSO5B, MSO5LP, MSO6, MSO6B + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - EYEMASK:MASK:COUNt:HITS? + - EYEMASK:MASK:COUNt:SEG:HITS? + - EYEMASK:MASK:CREATor? + - EYEMASK:MASK:ENAbled {ON|OFF} + - EYEMASK:MASK:ENAbled? + - EYEMASK:MASK:MASKOffset:HORizontal:AUTOfit? + - EYEMASK:MASK:MASKfile + - EYEMASK:MASK:MASKfile? + - EYEMASK:MASK:TESt:SAMple:THReshold + - EYEMASK:MASK:TESt:SAMple:THReshold? + - EYEMASK:MASK:TESt:STATUS? + ``` +""" + +from typing import Dict, Optional, TYPE_CHECKING + +from ..helpers import ( + DefaultDictPassKeyToFactory, + SCPICmdRead, + SCPICmdWrite, + ValidatedDynamicNumberCmd, +) + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class EyemaskMaskItemTestStatus(SCPICmdRead): + """The ``EYEMASK:MASK:TESt:STATUS`` command. + + Description: + - This query-only command returns the mask hit test status. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:TESt:STATUS?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:TESt:STATUS?`` query + and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - EYEMASK:MASK:TESt:STATUS? + ``` + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + """ + + +class EyemaskMaskItemTestSampleThreshold(SCPICmdWrite, SCPICmdRead): + """The ``EYEMASK:MASK:TESt:SAMple:THReshold`` command. + + Description: + - This command sets or queries the total number of hit violations that will cause a mask + test failure. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:TESt:SAMple:THReshold?`` + query. + - Using the ``.verify(value)`` method will send the + ``EYEMASK:MASK:TESt:SAMple:THReshold?`` query and raise an AssertionError if the + returned value does not match ``value``. + - Using the ``.write(value)`` method will send the + ``EYEMASK:MASK:TESt:SAMple:THReshold value`` command. + + SCPI Syntax: + ``` + - EYEMASK:MASK:TESt:SAMple:THReshold + - EYEMASK:MASK:TESt:SAMple:THReshold? + ``` + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + - ```` is a positive integer indicating the number of mask hits required to cause a + fail condition for that mask test. + """ + + +class EyemaskMaskItemTestSample(SCPICmdRead): + """The ``EYEMASK:MASK:TESt:SAMple`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:TESt:SAMple?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:TESt:SAMple?`` query + and raise an AssertionError if the returned value does not match ``value``. + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + + Properties: + - ``.threshold``: The ``EYEMASK:MASK:TESt:SAMple:THReshold`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._threshold = EyemaskMaskItemTestSampleThreshold( + device, f"{self._cmd_syntax}:THReshold" + ) + + @property + def threshold(self) -> EyemaskMaskItemTestSampleThreshold: + """Return the ``EYEMASK:MASK:TESt:SAMple:THReshold`` command. + + Description: + - This command sets or queries the total number of hit violations that will cause a mask + test failure. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:TESt:SAMple:THReshold?`` + query. + - Using the ``.verify(value)`` method will send the + ``EYEMASK:MASK:TESt:SAMple:THReshold?`` query and raise an AssertionError if the + returned value does not match ``value``. + - Using the ``.write(value)`` method will send the + ``EYEMASK:MASK:TESt:SAMple:THReshold value`` command. + + SCPI Syntax: + ``` + - EYEMASK:MASK:TESt:SAMple:THReshold + - EYEMASK:MASK:TESt:SAMple:THReshold? + ``` + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + - ```` is a positive integer indicating the number of mask hits required to cause a + fail condition for that mask test. + """ + return self._threshold + + +class EyemaskMaskItemTest(SCPICmdRead): + """The ``EYEMASK:MASK:TESt`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:TESt?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:TESt?`` query and + raise an AssertionError if the returned value does not match ``value``. + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + + Properties: + - ``.sample``: The ``EYEMASK:MASK:TESt:SAMple`` command tree. + - ``.status``: The ``EYEMASK:MASK:TESt:STATUS`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._sample = EyemaskMaskItemTestSample(device, f"{self._cmd_syntax}:SAMple") + self._status = EyemaskMaskItemTestStatus(device, f"{self._cmd_syntax}:STATUS") + + @property + def sample(self) -> EyemaskMaskItemTestSample: + """Return the ``EYEMASK:MASK:TESt:SAMple`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:TESt:SAMple?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:TESt:SAMple?`` + query and raise an AssertionError if the returned value does not match ``value``. + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + + Sub-properties: + - ``.threshold``: The ``EYEMASK:MASK:TESt:SAMple:THReshold`` command. + """ + return self._sample + + @property + def status(self) -> EyemaskMaskItemTestStatus: + """Return the ``EYEMASK:MASK:TESt:STATUS`` command. + + Description: + - This query-only command returns the mask hit test status. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:TESt:STATUS?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:TESt:STATUS?`` + query and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - EYEMASK:MASK:TESt:STATUS? + ``` + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + """ + return self._status + + +class EyemaskMaskItemMaskfile(SCPICmdWrite, SCPICmdRead): + """The ``EYEMASK:MASK:MASKfile`` command. + + Description: + - This command sets or queries the current mask definition file name for the specified mask + test. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:MASKfile?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:MASKfile?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``EYEMASK:MASK:MASKfile value`` + command. + + SCPI Syntax: + ``` + - EYEMASK:MASK:MASKfile + - EYEMASK:MASK:MASKfile? + ``` + + Info: + - ```` is the number of the specified mask test (or mask test plot?). + - ```` is a quoted string that defines the file path that specifies the location of + the mask file to use, in the format '[]'. Specifying a path is + optional. If no path is entered, the instrument will search in the current working + directory as set in ``FILESYSTEM:CWD``. + """ + + +class EyemaskMaskItemMaskoffsetHorizontalAutofit(SCPICmdRead): + """The ``EYEMASK:MASK:MASKOffset:HORizontal:AUTOfit`` command. + + Description: + - This command returns the mask offset value in the specified mask in seconds. The mask test + number is specified by + + Usage: + - Using the ``.query()`` method will send the + ``EYEMASK:MASK:MASKOffset:HORizontal:AUTOfit?`` query. + - Using the ``.verify(value)`` method will send the + ``EYEMASK:MASK:MASKOffset:HORizontal:AUTOfit?`` query and raise an AssertionError if + the returned value does not match ``value``. + + SCPI Syntax: + ``` + - EYEMASK:MASK:MASKOffset:HORizontal:AUTOfit? + ``` + """ + + +class EyemaskMaskItemMaskoffsetHorizontal(SCPICmdRead): + """The ``EYEMASK:MASK:MASKOffset:HORizontal`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:MASKOffset:HORizontal?`` + query. + - Using the ``.verify(value)`` method will send the + ``EYEMASK:MASK:MASKOffset:HORizontal?`` query and raise an AssertionError if the + returned value does not match ``value``. + + Properties: + - ``.autofit``: The ``EYEMASK:MASK:MASKOffset:HORizontal:AUTOfit`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._autofit = EyemaskMaskItemMaskoffsetHorizontalAutofit( + device, f"{self._cmd_syntax}:AUTOfit" + ) + + @property + def autofit(self) -> EyemaskMaskItemMaskoffsetHorizontalAutofit: + """Return the ``EYEMASK:MASK:MASKOffset:HORizontal:AUTOfit`` command. + + Description: + - This command returns the mask offset value in the specified mask in seconds. The mask + test number is specified by + + Usage: + - Using the ``.query()`` method will send the + ``EYEMASK:MASK:MASKOffset:HORizontal:AUTOfit?`` query. + - Using the ``.verify(value)`` method will send the + ``EYEMASK:MASK:MASKOffset:HORizontal:AUTOfit?`` query and raise an AssertionError + if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - EYEMASK:MASK:MASKOffset:HORizontal:AUTOfit? + ``` + """ + return self._autofit + + +class EyemaskMaskItemMaskoffset(SCPICmdRead): + """The ``EYEMASK:MASK:MASKOffset`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:MASKOffset?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:MASKOffset?`` query + and raise an AssertionError if the returned value does not match ``value``. + + Properties: + - ``.horizontal``: The ``EYEMASK:MASK:MASKOffset:HORizontal`` command tree. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._horizontal = EyemaskMaskItemMaskoffsetHorizontal( + device, f"{self._cmd_syntax}:HORizontal" + ) + + @property + def horizontal(self) -> EyemaskMaskItemMaskoffsetHorizontal: + """Return the ``EYEMASK:MASK:MASKOffset:HORizontal`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:MASKOffset:HORizontal?`` + query. + - Using the ``.verify(value)`` method will send the + ``EYEMASK:MASK:MASKOffset:HORizontal?`` query and raise an AssertionError if the + returned value does not match ``value``. + + Sub-properties: + - ``.autofit``: The ``EYEMASK:MASK:MASKOffset:HORizontal:AUTOfit`` command. + """ + return self._horizontal + + +class EyemaskMaskItemEnabled(SCPICmdWrite, SCPICmdRead): + """The ``EYEMASK:MASK:ENAbled`` command. + + Description: + - This command enables or disables eye mask testing in the specified plot. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:ENAbled?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:ENAbled?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``EYEMASK:MASK:ENAbled value`` + command. + + SCPI Syntax: + ``` + - EYEMASK:MASK:ENAbled {ON|OFF} + - EYEMASK:MASK:ENAbled? + ``` + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + """ + + +class EyemaskMaskItemCreator(SCPICmdRead): + """The ``EYEMASK:MASK:CREATor`` command. + + Description: + - This query-only command returns the name of the eye diagram plot that created the mask. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:CREATor?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:CREATor?`` query and + raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - EYEMASK:MASK:CREATor? + ``` + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + """ + + +class EyemaskMaskItemCountSegItemHits(SCPICmdRead): + """The ``EYEMASK:MASK:COUNt:SEG:HITS`` command. + + Description: + - This command returns the number of hit violations for the specified segment (area). + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:COUNt:SEG:HITS?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:COUNt:SEG:HITS?`` + query and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - EYEMASK:MASK:COUNt:SEG:HITS? + ``` + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + - ``SEG`` is the number of the mask segment for which to return hit violations data. + """ + + +class EyemaskMaskItemCountSegItem(ValidatedDynamicNumberCmd, SCPICmdRead): + """The ``EYEMASK:MASK:COUNt:SEG`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:COUNt:SEG?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:COUNt:SEG?`` query + and raise an AssertionError if the returned value does not match ``value``. + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + - ``SEG`` is the number of the mask segment for which to return hit violations data. + + Properties: + - ``.hits``: The ``EYEMASK:MASK:COUNt:SEG:HITS`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._hits = EyemaskMaskItemCountSegItemHits(device, f"{self._cmd_syntax}:HITS") + + @property + def hits(self) -> EyemaskMaskItemCountSegItemHits: + """Return the ``EYEMASK:MASK:COUNt:SEG:HITS`` command. + + Description: + - This command returns the number of hit violations for the specified segment (area). + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:COUNt:SEG:HITS?`` + query. + - Using the ``.verify(value)`` method will send the + ``EYEMASK:MASK:COUNt:SEG:HITS?`` query and raise an AssertionError if the + returned value does not match ``value``. + + SCPI Syntax: + ``` + - EYEMASK:MASK:COUNt:SEG:HITS? + ``` + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + - ``SEG`` is the number of the mask segment for which to return hit violations data. + """ + return self._hits + + +class EyemaskMaskItemCountHits(SCPICmdRead): + """The ``EYEMASK:MASK:COUNt:HITS`` command. + + Description: + - This command returns the total number of hit violations for all segments in the specified + mask test. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:COUNt:HITS?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:COUNt:HITS?`` query + and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - EYEMASK:MASK:COUNt:HITS? + ``` + + Info: + - ``MASK`` is the number of the specified mask test in an eye diagram plot. + """ + + +class EyemaskMaskItemCount(SCPICmdRead): + """The ``EYEMASK:MASK:COUNt`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:COUNt?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:COUNt?`` query and + raise an AssertionError if the returned value does not match ``value``. + + Info: + - ``MASK`` is the number of the specified mask test in an eye diagram plot. + + Properties: + - ``.hits``: The ``EYEMASK:MASK:COUNt:HITS`` command. + - ``.seg``: The ``EYEMASK:MASK:COUNt:SEG`` command tree. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._hits = EyemaskMaskItemCountHits(device, f"{self._cmd_syntax}:HITS") + self._seg: Dict[int, EyemaskMaskItemCountSegItem] = DefaultDictPassKeyToFactory( + lambda x: EyemaskMaskItemCountSegItem(device, f"{self._cmd_syntax}:SEG{x}") + ) + + @property + def hits(self) -> EyemaskMaskItemCountHits: + """Return the ``EYEMASK:MASK:COUNt:HITS`` command. + + Description: + - This command returns the total number of hit violations for all segments in the + specified mask test. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:COUNt:HITS?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:COUNt:HITS?`` + query and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - EYEMASK:MASK:COUNt:HITS? + ``` + + Info: + - ``MASK`` is the number of the specified mask test in an eye diagram plot. + """ + return self._hits + + @property + def seg(self) -> Dict[int, EyemaskMaskItemCountSegItem]: + """Return the ``EYEMASK:MASK:COUNt:SEG`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:COUNt:SEG?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:COUNt:SEG?`` + query and raise an AssertionError if the returned value does not match ``value``. + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + - ``SEG`` is the number of the mask segment for which to return hit violations data. + + Sub-properties: + - ``.hits``: The ``EYEMASK:MASK:COUNt:SEG:HITS`` command. + """ + return self._seg + + +class EyemaskMaskItem(ValidatedDynamicNumberCmd, SCPICmdRead): + """The ``EYEMASK:MASK`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK?`` query and raise an + AssertionError if the returned value does not match ``value``. + + Info: + - ``MASK`` is the number of the specified mask test in an eye diagram plot. + + Properties: + - ``.count``: The ``EYEMASK:MASK:COUNt`` command tree. + - ``.creator``: The ``EYEMASK:MASK:CREATor`` command. + - ``.enabled``: The ``EYEMASK:MASK:ENAbled`` command. + - ``.maskoffset``: The ``EYEMASK:MASK:MASKOffset`` command tree. + - ``.maskfile``: The ``EYEMASK:MASK:MASKfile`` command. + - ``.test``: The ``EYEMASK:MASK:TESt`` command tree. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._count = EyemaskMaskItemCount(device, f"{self._cmd_syntax}:COUNt") + self._creator = EyemaskMaskItemCreator(device, f"{self._cmd_syntax}:CREATor") + self._enabled = EyemaskMaskItemEnabled(device, f"{self._cmd_syntax}:ENAbled") + self._maskoffset = EyemaskMaskItemMaskoffset(device, f"{self._cmd_syntax}:MASKOffset") + self._maskfile = EyemaskMaskItemMaskfile(device, f"{self._cmd_syntax}:MASKfile") + self._test = EyemaskMaskItemTest(device, f"{self._cmd_syntax}:TESt") + + @property + def count(self) -> EyemaskMaskItemCount: + """Return the ``EYEMASK:MASK:COUNt`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:COUNt?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:COUNt?`` query and + raise an AssertionError if the returned value does not match ``value``. + + Info: + - ``MASK`` is the number of the specified mask test in an eye diagram plot. + + Sub-properties: + - ``.hits``: The ``EYEMASK:MASK:COUNt:HITS`` command. + - ``.seg``: The ``EYEMASK:MASK:COUNt:SEG`` command tree. + """ + return self._count + + @property + def creator(self) -> EyemaskMaskItemCreator: + """Return the ``EYEMASK:MASK:CREATor`` command. + + Description: + - This query-only command returns the name of the eye diagram plot that created the + mask. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:CREATor?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:CREATor?`` query + and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - EYEMASK:MASK:CREATor? + ``` + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + """ + return self._creator + + @property + def enabled(self) -> EyemaskMaskItemEnabled: + """Return the ``EYEMASK:MASK:ENAbled`` command. + + Description: + - This command enables or disables eye mask testing in the specified plot. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:ENAbled?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:ENAbled?`` query + and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``EYEMASK:MASK:ENAbled value`` + command. + + SCPI Syntax: + ``` + - EYEMASK:MASK:ENAbled {ON|OFF} + - EYEMASK:MASK:ENAbled? + ``` + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + """ + return self._enabled + + @property + def maskoffset(self) -> EyemaskMaskItemMaskoffset: + """Return the ``EYEMASK:MASK:MASKOffset`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:MASKOffset?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:MASKOffset?`` + query and raise an AssertionError if the returned value does not match ``value``. + + Sub-properties: + - ``.horizontal``: The ``EYEMASK:MASK:MASKOffset:HORizontal`` command tree. + """ + return self._maskoffset + + @property + def maskfile(self) -> EyemaskMaskItemMaskfile: + """Return the ``EYEMASK:MASK:MASKfile`` command. + + Description: + - This command sets or queries the current mask definition file name for the specified + mask test. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:MASKfile?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:MASKfile?`` query + and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``EYEMASK:MASK:MASKfile value`` + command. + + SCPI Syntax: + ``` + - EYEMASK:MASK:MASKfile + - EYEMASK:MASK:MASKfile? + ``` + + Info: + - ```` is the number of the specified mask test (or mask test plot?). + - ```` is a quoted string that defines the file path that specifies the + location of the mask file to use, in the format '[]'. Specifying a + path is optional. If no path is entered, the instrument will search in the current + working directory as set in ``FILESYSTEM:CWD``. + """ + return self._maskfile + + @property + def test(self) -> EyemaskMaskItemTest: + """Return the ``EYEMASK:MASK:TESt`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK:TESt?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK:TESt?`` query and + raise an AssertionError if the returned value does not match ``value``. + + Info: + - ``MASK`` is the number of the specified mask test (or mask test plot?). + + Sub-properties: + - ``.sample``: The ``EYEMASK:MASK:TESt:SAMple`` command tree. + - ``.status``: The ``EYEMASK:MASK:TESt:STATUS`` command. + """ + return self._test + + +class Eyemask(SCPICmdRead): + """The ``EYEMASK`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK?`` query and raise an + AssertionError if the returned value does not match ``value``. + + Properties: + - ``.mask``: The ``EYEMASK:MASK`` command tree. + """ + + def __init__(self, device: Optional["PIDevice"] = None, cmd_syntax: str = "EYEMASK") -> None: + super().__init__(device, cmd_syntax) + self._mask: Dict[int, EyemaskMaskItem] = DefaultDictPassKeyToFactory( + lambda x: EyemaskMaskItem(device, f"{self._cmd_syntax}:MASK{x}") + ) + + @property + def mask(self) -> Dict[int, EyemaskMaskItem]: + """Return the ``EYEMASK:MASK`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``EYEMASK:MASK?`` query. + - Using the ``.verify(value)`` method will send the ``EYEMASK:MASK?`` query and raise + an AssertionError if the returned value does not match ``value``. + + Info: + - ``MASK`` is the number of the specified mask test in an eye diagram plot. + + Sub-properties: + - ``.count``: The ``EYEMASK:MASK:COUNt`` command tree. + - ``.creator``: The ``EYEMASK:MASK:CREATor`` command. + - ``.enabled``: The ``EYEMASK:MASK:ENAbled`` command. + - ``.maskoffset``: The ``EYEMASK:MASK:MASKOffset`` command tree. + - ``.maskfile``: The ``EYEMASK:MASK:MASKfile`` command. + - ``.test``: The ``EYEMASK:MASK:TESt`` command tree. + """ + return self._mask diff --git a/src/tm_devices/commands/gen_e3e9uu_lpdmso/matharbflt.py b/src/tm_devices/commands/gen_e3e9uu_lpdmso/matharbflt.py new file mode 100644 index 00000000..fdd7dd6a --- /dev/null +++ b/src/tm_devices/commands/gen_e3e9uu_lpdmso/matharbflt.py @@ -0,0 +1,96 @@ +"""The matharbflt commands module. + +These commands are used in the following models: +LPD6, MSO4, MSO4B, MSO5, MSO5B, MSO5LP, MSO6, MSO6B + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - MATHArbflt:FILepath + - MATHArbflt:FILepath? + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead, SCPICmdWrite, ValidatedDynamicNumberCmd + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class MatharbfltItemFilepath(SCPICmdWrite, SCPICmdRead): + """The ``MATHArbflt:FILepath`` command. + + Description: + - This command or query sets the file path for a file of filter coefficients for the + specified arbitrary filter. Setting a path will read that file and load the filter for + ARBFLT. Access these filters using a Math with an expression of the form 'ARBFlt()'. + + Usage: + - Using the ``.query()`` method will send the ``MATHArbflt:FILepath?`` query. + - Using the ``.verify(value)`` method will send the ``MATHArbflt:FILepath?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``MATHArbflt:FILepath value`` command. + + SCPI Syntax: + ``` + - MATHArbflt:FILepath + - MATHArbflt:FILepath? + ``` + + Info: + - ```` specifies the path to the file of filter coefficients. + """ + + _WRAP_ARG_WITH_QUOTES = True + + +class MatharbfltItem(ValidatedDynamicNumberCmd, SCPICmdRead): + """The ``MATHArbflt`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``MATHArbflt?`` query. + - Using the ``.verify(value)`` method will send the ``MATHArbflt?`` query and raise an + AssertionError if the returned value does not match ``value``. + + Properties: + - ``.filepath``: The ``MATHArbflt:FILepath`` command. + """ + + def __init__( + self, device: Optional["PIDevice"] = None, cmd_syntax: str = "MATHArbflt" + ) -> None: + super().__init__(device, cmd_syntax) + self._filepath = MatharbfltItemFilepath(device, f"{self._cmd_syntax}:FILepath") + + @property + def filepath(self) -> MatharbfltItemFilepath: + """Return the ``MATHArbflt:FILepath`` command. + + Description: + - This command or query sets the file path for a file of filter coefficients for the + specified arbitrary filter. Setting a path will read that file and load the filter for + ARBFLT. Access these filters using a Math with an expression of the form + 'ARBFlt()'. + + Usage: + - Using the ``.query()`` method will send the ``MATHArbflt:FILepath?`` query. + - Using the ``.verify(value)`` method will send the ``MATHArbflt:FILepath?`` query + and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``MATHArbflt:FILepath value`` + command. + + SCPI Syntax: + ``` + - MATHArbflt:FILepath + - MATHArbflt:FILepath? + ``` + + Info: + - ```` specifies the path to the file of filter coefficients. + """ + return self._filepath diff --git a/src/tm_devices/commands/gen_e3e9uu_lpdmso/peakstable.py b/src/tm_devices/commands/gen_e3e9uu_lpdmso/peakstable.py new file mode 100644 index 00000000..2d6ebd8e --- /dev/null +++ b/src/tm_devices/commands/gen_e3e9uu_lpdmso/peakstable.py @@ -0,0 +1,265 @@ +"""The peakstable commands module. + +These commands are used in the following models: +LPD6, MSO4, MSO4B, MSO5, MSO5B, MSO5LP, MSO6, MSO6B + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - PEAKSTABle:ADDNew + - PEAKSTABle:DELete + - PEAKSTABle:LIST? + - PEAKSTABle:TABle:FRESolution {AUTO|PRECISE} + - PEAKSTABle:TABle:FRESolution? + ``` +""" + +from typing import Dict, Optional, TYPE_CHECKING + +from ..helpers import ( + DefaultDictPassKeyToFactory, + SCPICmdRead, + SCPICmdWrite, + ValidatedDynamicNumberCmd, +) + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class PeakstableTableItemFresolution(SCPICmdWrite, SCPICmdRead): + """The ``PEAKSTABle:TABle:FRESolution`` command. + + Description: + - This command sets or queries the Frequency Resolution state for peak markers table. + + Usage: + - Using the ``.query()`` method will send the ``PEAKSTABle:TABle:FRESolution?`` query. + - Using the ``.verify(value)`` method will send the ``PEAKSTABle:TABle:FRESolution?`` + query and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``PEAKSTABle:TABle:FRESolution value`` + command. + + SCPI Syntax: + ``` + - PEAKSTABle:TABle:FRESolution {AUTO|PRECISE} + - PEAKSTABle:TABle:FRESolution? + ``` + + Info: + - ``AUTO`` shows the frequency with the same precision as shown in the Spectrum View + display. + - ``PRECISE`` shows the frequency down to single Hz resolution. + """ + + +class PeakstableTableItem(ValidatedDynamicNumberCmd, SCPICmdRead): + """The ``PEAKSTABle:TABle`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``PEAKSTABle:TABle?`` query. + - Using the ``.verify(value)`` method will send the ``PEAKSTABle:TABle?`` query and raise + an AssertionError if the returned value does not match ``value``. + + Properties: + - ``.fresolution``: The ``PEAKSTABle:TABle:FRESolution`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._fresolution = PeakstableTableItemFresolution( + device, f"{self._cmd_syntax}:FRESolution" + ) + + @property + def fresolution(self) -> PeakstableTableItemFresolution: + """Return the ``PEAKSTABle:TABle:FRESolution`` command. + + Description: + - This command sets or queries the Frequency Resolution state for peak markers table. + + Usage: + - Using the ``.query()`` method will send the ``PEAKSTABle:TABle:FRESolution?`` + query. + - Using the ``.verify(value)`` method will send the ``PEAKSTABle:TABle:FRESolution?`` + query and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the + ``PEAKSTABle:TABle:FRESolution value`` command. + + SCPI Syntax: + ``` + - PEAKSTABle:TABle:FRESolution {AUTO|PRECISE} + - PEAKSTABle:TABle:FRESolution? + ``` + + Info: + - ``AUTO`` shows the frequency with the same precision as shown in the Spectrum View + display. + - ``PRECISE`` shows the frequency down to single Hz resolution. + """ + return self._fresolution + + +class PeakstableList(SCPICmdRead): + """The ``PEAKSTABle:LIST`` command. + + Description: + - This command deletes the specified peak markers table. + + Usage: + - Using the ``.query()`` method will send the ``PEAKSTABle:LIST?`` query. + - Using the ``.verify(value)`` method will send the ``PEAKSTABle:LIST?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - PEAKSTABle:LIST? + ``` + """ + + +class PeakstableDelete(SCPICmdWrite): + """The ``PEAKSTABle:DELete`` command. + + Description: + - This command deletes the specified peak markers table. + + Usage: + - Using the ``.write(value)`` method will send the ``PEAKSTABle:DELete value`` command. + + SCPI Syntax: + ``` + - PEAKSTABle:DELete + ``` + + Info: + - ```` is a quoted string that is the name of the peak markers table to delete. The + argument is of the form 'TABLE', where ≥ 1. + """ + + _WRAP_ARG_WITH_QUOTES = True + + +class PeakstableAddnew(SCPICmdWrite): + """The ``PEAKSTABle:ADDNew`` command. + + Description: + - This command adds the specified peak markers table. + + Usage: + - Using the ``.write(value)`` method will send the ``PEAKSTABle:ADDNew value`` command. + + SCPI Syntax: + ``` + - PEAKSTABle:ADDNew + ``` + + Info: + - ```` is a quoted string that is the name of the new peak markers table. The + argument is of the form 'TABLE', where ≥ 1. + """ + + _WRAP_ARG_WITH_QUOTES = True + + +class Peakstable(SCPICmdRead): + """The ``PEAKSTABle`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``PEAKSTABle?`` query. + - Using the ``.verify(value)`` method will send the ``PEAKSTABle?`` query and raise an + AssertionError if the returned value does not match ``value``. + + Properties: + - ``.addnew``: The ``PEAKSTABle:ADDNew`` command. + - ``.delete``: The ``PEAKSTABle:DELete`` command. + - ``.list``: The ``PEAKSTABle:LIST`` command. + - ``.table``: The ``PEAKSTABle:TABle`` command tree. + """ + + def __init__(self, device: Optional["PIDevice"] = None, cmd_syntax: str = "PEAKSTABle") -> None: + super().__init__(device, cmd_syntax) + self._addnew = PeakstableAddnew(device, f"{self._cmd_syntax}:ADDNew") + self._delete = PeakstableDelete(device, f"{self._cmd_syntax}:DELete") + self._list = PeakstableList(device, f"{self._cmd_syntax}:LIST") + self._table: Dict[int, PeakstableTableItem] = DefaultDictPassKeyToFactory( + lambda x: PeakstableTableItem(device, f"{self._cmd_syntax}:TABle{x}") + ) + + @property + def addnew(self) -> PeakstableAddnew: + """Return the ``PEAKSTABle:ADDNew`` command. + + Description: + - This command adds the specified peak markers table. + + Usage: + - Using the ``.write(value)`` method will send the ``PEAKSTABle:ADDNew value`` command. + + SCPI Syntax: + ``` + - PEAKSTABle:ADDNew + ``` + + Info: + - ```` is a quoted string that is the name of the new peak markers table. The + argument is of the form 'TABLE', where ≥ 1. + """ + return self._addnew + + @property + def delete(self) -> PeakstableDelete: + """Return the ``PEAKSTABle:DELete`` command. + + Description: + - This command deletes the specified peak markers table. + + Usage: + - Using the ``.write(value)`` method will send the ``PEAKSTABle:DELete value`` command. + + SCPI Syntax: + ``` + - PEAKSTABle:DELete + ``` + + Info: + - ```` is a quoted string that is the name of the peak markers table to delete. + The argument is of the form 'TABLE', where ≥ 1. + """ + return self._delete + + @property + def list(self) -> PeakstableList: + """Return the ``PEAKSTABle:LIST`` command. + + Description: + - This command deletes the specified peak markers table. + + Usage: + - Using the ``.query()`` method will send the ``PEAKSTABle:LIST?`` query. + - Using the ``.verify(value)`` method will send the ``PEAKSTABle:LIST?`` query and raise + an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - PEAKSTABle:LIST? + ``` + """ + return self._list + + @property + def table(self) -> Dict[int, PeakstableTableItem]: + """Return the ``PEAKSTABle:TABle`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``PEAKSTABle:TABle?`` query. + - Using the ``.verify(value)`` method will send the ``PEAKSTABle:TABle?`` query and + raise an AssertionError if the returned value does not match ``value``. + + Sub-properties: + - ``.fresolution``: The ``PEAKSTABle:TABle:FRESolution`` command. + """ + return self._table diff --git a/src/tm_devices/commands/gen_e3e9uu_lpdmso/visual.py b/src/tm_devices/commands/gen_e3e9uu_lpdmso/visual.py new file mode 100644 index 00000000..cd18304b --- /dev/null +++ b/src/tm_devices/commands/gen_e3e9uu_lpdmso/visual.py @@ -0,0 +1,1191 @@ +# pylint: disable=line-too-long +"""The visual commands module. + +These commands are used in the following models: +LPD6, MSO4, MSO4B, MSO5, MSO5B, MSO5LP, MSO6, MSO6B + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - VISual:AREA:ASPEctratio {ON|OFF|} + - VISual:AREA:ASPEctratio? + - VISual:AREA:FLIP:HORizontal + - VISual:AREA:FLIP:VERTical + - VISual:AREA:HEIGht + - VISual:AREA:HEIGht? + - VISual:AREA:HITType {IN|OUT|DONTcare} + - VISual:AREA:HITType? + - VISual:AREA:RESET + - VISual:AREA:ROTAtion + - VISual:AREA:ROTAtion? + - VISual:AREA:SHAPE {TRIAngle|RECTangle|TRAPezoid|HEXAgon} + - VISual:AREA:SHAPE? + - VISual:AREA:SOUrce {CH} + - VISual:AREA:SOUrce? + - VISual:AREA:VERTICES ', , , , , [,, , ...]' + - VISual:AREA:VERTICES? + - VISual:AREA:WIDTH + - VISual:AREA:WIDTH? + - VISual:AREA:XPOSition + - VISual:AREA:XPOSition? + - VISual:AREA:YPOSition + - VISual:AREA:YPOSition? + - VISual:DELETEALL + - VISual:ENAble {ON|OFF|} + - VISual:ENAble? + - VISual:EQUation + - VISual:EQUation? + - VISual:SHOWAReas {ON|OFF|} + - VISual:SHOWAReas? + - VISual:SHOWCRiteria {ON|OFF|} + - VISual:SHOWCRiteria? + - VISual:SHOWEQuation {ON|OFF|} + - VISual:SHOWEQuation? + ``` +""" + +from typing import Dict, Optional, TYPE_CHECKING + +from ..helpers import ( + DefaultDictPassKeyToFactory, + SCPICmdRead, + SCPICmdWrite, + SCPICmdWriteNoArguments, + ValidatedDynamicNumberCmd, +) + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class VisualShowequation(SCPICmdWrite, SCPICmdRead): + """The ``VISual:SHOWEQuation`` command. + + Description: + - Shows or hides the Visual Trigger area combination logic equation. + + Usage: + - Using the ``.query()`` method will send the ``VISual:SHOWEQuation?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:SHOWEQuation?`` query and raise + an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:SHOWEQuation value`` command. + + SCPI Syntax: + ``` + - VISual:SHOWEQuation {ON|OFF|} + - VISual:SHOWEQuation? + ``` + + Info: + - ``ON`` shows the Visual Trigger area combination logic equation. + - ``OFF`` hides the Visual Trigger area combination logic equation. + - ```` is an integer number. 0 hides the area combination logic equation; any other + value displays the area combination logic equation. + """ + + +class VisualShowcriteria(SCPICmdWrite, SCPICmdRead): + """The ``VISual:SHOWCRiteria`` command. + + Description: + - Sets or queries display of the area names and hit criteria for all visual trigger areas. + + Usage: + - Using the ``.query()`` method will send the ``VISual:SHOWCRiteria?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:SHOWCRiteria?`` query and raise + an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:SHOWCRiteria value`` command. + + SCPI Syntax: + ``` + - VISual:SHOWCRiteria {ON|OFF|} + - VISual:SHOWCRiteria? + ``` + + Info: + - ``ON`` enables display of the area name and hit criteria labels (In, Out, Don't care + icons) of all Visual Trigger areas. + - ``OFF`` hides the area name and hit criteria labels (In, Out, Don't care icons) of all + Visual Trigger areas. + - ```` is an integer number. 0 hides the area name and hit criteria of all Visual + Trigger areas; any other value enables displaying the area name and hit criteria of all + Visual Trigger areas. + """ + + +class VisualShowareas(SCPICmdWrite, SCPICmdRead): + """The ``VISual:SHOWAReas`` command. + + Description: + - Shows or hides all Visual Trigger areas. + + Usage: + - Using the ``.query()`` method will send the ``VISual:SHOWAReas?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:SHOWAReas?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:SHOWAReas value`` command. + + SCPI Syntax: + ``` + - VISual:SHOWAReas {ON|OFF|} + - VISual:SHOWAReas? + ``` + + Info: + - ``ON`` shows all Visual Trigger areas. + - ``OFF`` hides all Visual Trigger areas. + - ```` is an integer number. 0 hides all Visual Trigger areas; any other value shows + all Visual Trigger areas. + """ + + +class VisualEquation(SCPICmdWrite, SCPICmdRead): + r"""The ``VISual:EQUation`` command. + + Description: + - Sets or queries the Visual Trigger area combination logic equation. + + Usage: + - Using the ``.query()`` method will send the ``VISual:EQUation?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:EQUation?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:EQUation value`` command. + + SCPI Syntax: + ``` + - VISual:EQUation + - VISual:EQUation? + ``` + + Info: + - ```` defines the Visual Trigger area combination logic equation. The equation is + made up of area names (A) combined with logic operators AND, OR, or XOR (&, \|, ^). It + may also contain parentheses for grouping. The equation must be true to have a valid + Visual Trigger event and display a waveform. Each area's true state depends on the area's + condition setting (In, Out or Don't Care). + """ + + +class VisualEnable(SCPICmdWrite, SCPICmdRead): + """The ``VISual:ENAble`` command. + + Description: + - Sets or queries the status (on or off) of the Visual Trigger mode. + + Usage: + - Using the ``.query()`` method will send the ``VISual:ENAble?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:ENAble?`` query and raise an + AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:ENAble value`` command. + + SCPI Syntax: + ``` + - VISual:ENAble {ON|OFF|} + - VISual:ENAble? + ``` + + Info: + - ``ON`` enables the Visual Trigger mode. + - ``OFF`` disables the Visual Trigger mode. + - ```` is an integer number. 0 turns off the Visual Trigger mode; any other value + enables Visual Trigger mode. + """ + + +class VisualDeleteall(SCPICmdWriteNoArguments): + """The ``VISual:DELETEALL`` command. + + Description: + - Deletes all Visual Trigger areas. + + Usage: + - Using the ``.write()`` method will send the ``VISual:DELETEALL`` command. + + SCPI Syntax: + ``` + - VISual:DELETEALL + ``` + """ + + +class VisualAreaItemYposition(SCPICmdWrite, SCPICmdRead): + """The ``VISual:AREA:YPOSition`` command. + + Description: + - Sets or queries the vertical (Y-axis) center position of the specified Visual Trigger + area. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:YPOSition?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:YPOSition?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:YPOSition value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:YPOSition + - VISual:AREA:YPOSition? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ```` specifies the vertical position of the center of the Visual Trigger area, in + amplitude (volts, amps). + """ + + +class VisualAreaItemXposition(SCPICmdWrite, SCPICmdRead): + """The ``VISual:AREA:XPOSition`` command. + + Description: + - Sets or queries the horizontal (X-axis) center position of the specified Visual Trigger + area. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:XPOSition?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:XPOSition?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:XPOSition value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:XPOSition + - VISual:AREA:XPOSition? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ```` specifies the horizontal position of the center of the Visual Trigger area, in + seconds. + """ + + +class VisualAreaItemWidth(SCPICmdWrite, SCPICmdRead): + """The ``VISual:AREA:WIDTH`` command. + + Description: + - Sets or queries the width of the specified Visual Trigger area. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:WIDTH?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:WIDTH?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:WIDTH value`` command. + + SCPI Syntax: + ``` + - VISual:AREA:WIDTH + - VISual:AREA:WIDTH? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ```` specifies the width of the Visual Trigger area in seconds. + """ + + +class VisualAreaItemVertices(SCPICmdWrite, SCPICmdRead): + """The ``VISual:AREA:VERTICES`` command. + + Description: + - Sets or queries the X and Y vertex coordinate values for all vertices of the specified + Visual Trigger area. Vertex values must be set in pairs. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:VERTICES?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:VERTICES?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:VERTICES value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:VERTICES ', , , , , [,, , ...]' + - VISual:AREA:VERTICES? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ``, `` specifies the X, Y coordinate pair of each vertex in an area. The first + value is X (time) and the second value is Y (amplitude). There must be a minimum of three + vertex pairs to create an area. If the specified area exists, the area is changed to the + shape specified in the arguments. If the specified area does not exist, a new area is + created and assigned the specified vertices. + """ + + +class VisualAreaItemSource(SCPICmdWrite, SCPICmdRead): + """The ``VISual:AREA:SOUrce`` command. + + Description: + - Sets or queries the signal source for the specified Visual Trigger area. The source can + only be an analog channel. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:SOUrce?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:SOUrce?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:SOUrce value`` command. + + SCPI Syntax: + ``` + - VISual:AREA:SOUrce {CH} + - VISual:AREA:SOUrce? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ``CH`` sets the source channel number for the specified area. The channel number is + specified by . + """ + + +class VisualAreaItemShape(SCPICmdWrite, SCPICmdRead): + """The ``VISual:AREA:SHAPE`` command. + + Description: + - Sets or queries the current shape of the area. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:SHAPE?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:SHAPE?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:SHAPE value`` command. + + SCPI Syntax: + ``` + - VISual:AREA:SHAPE {TRIAngle|RECTangle|TRAPezoid|HEXAgon} + - VISual:AREA:SHAPE? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ``TRIAngle`` sets the specified area to a triangular shape (three vertices). If the area + does not exist, the instrument creates a new triangular area with the specified area + number. + - ``RECTangle`` sets the specified area to a rectangular shape (four vertices, right angles + at each corner). If the area does not exist, the instrument creates a new triangular area + with the specified area number. + - ``TRAPezoid`` sets the specified area to a trapezoidal shape (four vertices, two parallel + sides). If the area does not exist, the instrument creates a new triangular area with the + specified area number. + - ``HEXAgon`` sets the specified area to a hexagonal shape (six vertices). If the area does + not exist, the instrument creates a new hexagonal area with the specified area number. + """ + + +class VisualAreaItemRotation(SCPICmdWrite, SCPICmdRead): + """The ``VISual:AREA:ROTAtion`` command. + + Description: + - Sets or queries the rotation angle of the specified Visual Trigger area. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:ROTAtion?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:ROTAtion?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:ROTAtion value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:ROTAtion + - VISual:AREA:ROTAtion? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ```` specifies the rotation angle of the Visual Trigger area, in positive degrees + from 0 to 360. Zero degrees is referenced from when the area was created. + """ + + +class VisualAreaItemReset(SCPICmdWriteNoArguments): + """The ``VISual:AREA:RESET`` command. + + Description: + - Sets the specified Visual Trigger area shape to a default-sized triangle. + + Usage: + - Using the ``.write()`` method will send the ``VISual:AREA:RESET`` command. + + SCPI Syntax: + ``` + - VISual:AREA:RESET + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + """ + + +class VisualAreaItemHittype(SCPICmdWrite, SCPICmdRead): + """The ``VISual:AREA:HITType`` command. + + Description: + - Sets or queries the area hit logic true condition for the specified Visual Trigger area. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:HITType?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:HITType?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:HITType value`` command. + + SCPI Syntax: + ``` + - VISual:AREA:HITType {IN|OUT|DONTcare} + - VISual:AREA:HITType? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ``IN`` specifies that the waveform must intrude anywhere into the specified area to be + true. + - ``OUT`` specifies that the waveform must not intrude anywhere into the specified area to + be true. + - ``DONTcare`` sets the area to a don't care state, causing the area to be ignored. This is + useful when you are developing a Visual Trigger condition and need to change the hit logic + type of an area while keeping the area. + """ + + +class VisualAreaItemHeight(SCPICmdWrite, SCPICmdRead): + """The ``VISual:AREA:HEIGht`` command. + + Description: + - Sets or queries the height of the specified Visual Trigger area. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:HEIGht?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:HEIGht?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:HEIGht value`` command. + + SCPI Syntax: + ``` + - VISual:AREA:HEIGht + - VISual:AREA:HEIGht? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ```` specifies the height of the Visual Trigger area in amplitude. + """ + + +class VisualAreaItemFlipVertical(SCPICmdWriteNoArguments): + """The ``VISual:AREA:FLIP:VERTical`` command. + + Description: + - Flips the specified Visual Trigger area vertically around its center point. + + Usage: + - Using the ``.write()`` method will send the ``VISual:AREA:FLIP:VERTical`` command. + + SCPI Syntax: + ``` + - VISual:AREA:FLIP:VERTical + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + """ + + +class VisualAreaItemFlipHorizontal(SCPICmdWriteNoArguments): + """The ``VISual:AREA:FLIP:HORizontal`` command. + + Description: + - Flips the specified Visual Trigger area horizontally around its center point. + + Usage: + - Using the ``.write()`` method will send the ``VISual:AREA:FLIP:HORizontal`` command. + + SCPI Syntax: + ``` + - VISual:AREA:FLIP:HORizontal + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + """ + + +class VisualAreaItemFlip(SCPICmdRead): + """The ``VISual:AREA:FLIP`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:FLIP?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:FLIP?`` query and raise + an AssertionError if the returned value does not match ``value``. + + Properties: + - ``.horizontal``: The ``VISual:AREA:FLIP:HORizontal`` command. + - ``.vertical``: The ``VISual:AREA:FLIP:VERTical`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._horizontal = VisualAreaItemFlipHorizontal(device, f"{self._cmd_syntax}:HORizontal") + self._vertical = VisualAreaItemFlipVertical(device, f"{self._cmd_syntax}:VERTical") + + @property + def horizontal(self) -> VisualAreaItemFlipHorizontal: + """Return the ``VISual:AREA:FLIP:HORizontal`` command. + + Description: + - Flips the specified Visual Trigger area horizontally around its center point. + + Usage: + - Using the ``.write()`` method will send the ``VISual:AREA:FLIP:HORizontal`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:FLIP:HORizontal + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + """ + return self._horizontal + + @property + def vertical(self) -> VisualAreaItemFlipVertical: + """Return the ``VISual:AREA:FLIP:VERTical`` command. + + Description: + - Flips the specified Visual Trigger area vertically around its center point. + + Usage: + - Using the ``.write()`` method will send the ``VISual:AREA:FLIP:VERTical`` command. + + SCPI Syntax: + ``` + - VISual:AREA:FLIP:VERTical + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + """ + return self._vertical + + +class VisualAreaItemAspectratio(SCPICmdWrite, SCPICmdRead): + """The ``VISual:AREA:ASPEctratio`` command. + + Description: + - Sets or queries whether the aspect ratio of the specified Visual Trigger area is locked. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:ASPEctratio?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:ASPEctratio?`` query + and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:ASPEctratio value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:ASPEctratio {ON|OFF|} + - VISual:AREA:ASPEctratio? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ``ON`` locks the aspect ratio of the specified Visual Trigger area. The aspect ratio is + kept constant when the height or width of the area changes. + - ``OFF`` unlocks the aspect ratio of the specified Visual Trigger area. + - ```` is an integer number. 1 locks the aspect ratio of the specified Visual Trigger + area; any other value unlocks the aspect ratio of the specified Visual Trigger area. + """ + + +# pylint: disable=too-many-instance-attributes +class VisualAreaItem(ValidatedDynamicNumberCmd, SCPICmdRead): + """The ``VISual:AREA`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA?`` query and raise an + AssertionError if the returned value does not match ``value``. + + Properties: + - ``.aspectratio``: The ``VISual:AREA:ASPEctratio`` command. + - ``.flip``: The ``VISual:AREA:FLIP`` command tree. + - ``.height``: The ``VISual:AREA:HEIGht`` command. + - ``.hittype``: The ``VISual:AREA:HITType`` command. + - ``.reset``: The ``VISual:AREA:RESET`` command. + - ``.rotation``: The ``VISual:AREA:ROTAtion`` command. + - ``.shape``: The ``VISual:AREA:SHAPE`` command. + - ``.source``: The ``VISual:AREA:SOUrce`` command. + - ``.vertices``: The ``VISual:AREA:VERTICES`` command. + - ``.width``: The ``VISual:AREA:WIDTH`` command. + - ``.xposition``: The ``VISual:AREA:XPOSition`` command. + - ``.yposition``: The ``VISual:AREA:YPOSition`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._aspectratio = VisualAreaItemAspectratio(device, f"{self._cmd_syntax}:ASPEctratio") + self._flip = VisualAreaItemFlip(device, f"{self._cmd_syntax}:FLIP") + self._height = VisualAreaItemHeight(device, f"{self._cmd_syntax}:HEIGht") + self._hittype = VisualAreaItemHittype(device, f"{self._cmd_syntax}:HITType") + self._reset = VisualAreaItemReset(device, f"{self._cmd_syntax}:RESET") + self._rotation = VisualAreaItemRotation(device, f"{self._cmd_syntax}:ROTAtion") + self._shape = VisualAreaItemShape(device, f"{self._cmd_syntax}:SHAPE") + self._source = VisualAreaItemSource(device, f"{self._cmd_syntax}:SOUrce") + self._vertices = VisualAreaItemVertices(device, f"{self._cmd_syntax}:VERTICES") + self._width = VisualAreaItemWidth(device, f"{self._cmd_syntax}:WIDTH") + self._xposition = VisualAreaItemXposition(device, f"{self._cmd_syntax}:XPOSition") + self._yposition = VisualAreaItemYposition(device, f"{self._cmd_syntax}:YPOSition") + + @property + def aspectratio(self) -> VisualAreaItemAspectratio: + """Return the ``VISual:AREA:ASPEctratio`` command. + + Description: + - Sets or queries whether the aspect ratio of the specified Visual Trigger area is + locked. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:ASPEctratio?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:ASPEctratio?`` + query and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:ASPEctratio value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:ASPEctratio {ON|OFF|} + - VISual:AREA:ASPEctratio? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ``ON`` locks the aspect ratio of the specified Visual Trigger area. The aspect ratio + is kept constant when the height or width of the area changes. + - ``OFF`` unlocks the aspect ratio of the specified Visual Trigger area. + - ```` is an integer number. 1 locks the aspect ratio of the specified Visual + Trigger area; any other value unlocks the aspect ratio of the specified Visual Trigger + area. + """ + return self._aspectratio + + @property + def flip(self) -> VisualAreaItemFlip: + """Return the ``VISual:AREA:FLIP`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:FLIP?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:FLIP?`` query and + raise an AssertionError if the returned value does not match ``value``. + + Sub-properties: + - ``.horizontal``: The ``VISual:AREA:FLIP:HORizontal`` command. + - ``.vertical``: The ``VISual:AREA:FLIP:VERTical`` command. + """ + return self._flip + + @property + def height(self) -> VisualAreaItemHeight: + """Return the ``VISual:AREA:HEIGht`` command. + + Description: + - Sets or queries the height of the specified Visual Trigger area. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:HEIGht?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:HEIGht?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:HEIGht value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:HEIGht + - VISual:AREA:HEIGht? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ```` specifies the height of the Visual Trigger area in amplitude. + """ + return self._height + + @property + def hittype(self) -> VisualAreaItemHittype: + """Return the ``VISual:AREA:HITType`` command. + + Description: + - Sets or queries the area hit logic true condition for the specified Visual Trigger + area. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:HITType?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:HITType?`` query + and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:HITType value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:HITType {IN|OUT|DONTcare} + - VISual:AREA:HITType? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ``IN`` specifies that the waveform must intrude anywhere into the specified area to be + true. + - ``OUT`` specifies that the waveform must not intrude anywhere into the specified area + to be true. + - ``DONTcare`` sets the area to a don't care state, causing the area to be ignored. This + is useful when you are developing a Visual Trigger condition and need to change the + hit logic type of an area while keeping the area. + """ + return self._hittype + + @property + def reset(self) -> VisualAreaItemReset: + """Return the ``VISual:AREA:RESET`` command. + + Description: + - Sets the specified Visual Trigger area shape to a default-sized triangle. + + Usage: + - Using the ``.write()`` method will send the ``VISual:AREA:RESET`` command. + + SCPI Syntax: + ``` + - VISual:AREA:RESET + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + """ + return self._reset + + @property + def rotation(self) -> VisualAreaItemRotation: + """Return the ``VISual:AREA:ROTAtion`` command. + + Description: + - Sets or queries the rotation angle of the specified Visual Trigger area. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:ROTAtion?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:ROTAtion?`` query + and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:ROTAtion value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:ROTAtion + - VISual:AREA:ROTAtion? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ```` specifies the rotation angle of the Visual Trigger area, in positive degrees + from 0 to 360. Zero degrees is referenced from when the area was created. + """ + return self._rotation + + @property + def shape(self) -> VisualAreaItemShape: + """Return the ``VISual:AREA:SHAPE`` command. + + Description: + - Sets or queries the current shape of the area. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:SHAPE?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:SHAPE?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:SHAPE value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:SHAPE {TRIAngle|RECTangle|TRAPezoid|HEXAgon} + - VISual:AREA:SHAPE? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ``TRIAngle`` sets the specified area to a triangular shape (three vertices). If the + area does not exist, the instrument creates a new triangular area with the specified + area number. + - ``RECTangle`` sets the specified area to a rectangular shape (four vertices, right + angles at each corner). If the area does not exist, the instrument creates a new + triangular area with the specified area number. + - ``TRAPezoid`` sets the specified area to a trapezoidal shape (four vertices, two + parallel sides). If the area does not exist, the instrument creates a new triangular + area with the specified area number. + - ``HEXAgon`` sets the specified area to a hexagonal shape (six vertices). If the area + does not exist, the instrument creates a new hexagonal area with the specified area + number. + """ + return self._shape + + @property + def source(self) -> VisualAreaItemSource: + """Return the ``VISual:AREA:SOUrce`` command. + + Description: + - Sets or queries the signal source for the specified Visual Trigger area. The source + can only be an analog channel. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:SOUrce?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:SOUrce?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:SOUrce value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:SOUrce {CH} + - VISual:AREA:SOUrce? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ``CH`` sets the source channel number for the specified area. The channel number is + specified by . + """ + return self._source + + @property + def vertices(self) -> VisualAreaItemVertices: + """Return the ``VISual:AREA:VERTICES`` command. + + Description: + - Sets or queries the X and Y vertex coordinate values for all vertices of the specified + Visual Trigger area. Vertex values must be set in pairs. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:VERTICES?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:VERTICES?`` query + and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:VERTICES value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:VERTICES ', , , , , [,, , ...]' + - VISual:AREA:VERTICES? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ``, `` specifies the X, Y coordinate pair of each vertex in an area. The + first value is X (time) and the second value is Y (amplitude). There must be a minimum + of three vertex pairs to create an area. If the specified area exists, the area is + changed to the shape specified in the arguments. If the specified area does not exist, + a new area is created and assigned the specified vertices. + """ # noqa: E501 + return self._vertices + + @property + def width(self) -> VisualAreaItemWidth: + """Return the ``VISual:AREA:WIDTH`` command. + + Description: + - Sets or queries the width of the specified Visual Trigger area. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:WIDTH?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:WIDTH?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:WIDTH value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:WIDTH + - VISual:AREA:WIDTH? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ```` specifies the width of the Visual Trigger area in seconds. + """ + return self._width + + @property + def xposition(self) -> VisualAreaItemXposition: + """Return the ``VISual:AREA:XPOSition`` command. + + Description: + - Sets or queries the horizontal (X-axis) center position of the specified Visual + Trigger area. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:XPOSition?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:XPOSition?`` query + and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:XPOSition value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:XPOSition + - VISual:AREA:XPOSition? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ```` specifies the horizontal position of the center of the Visual Trigger area, + in seconds. + """ + return self._xposition + + @property + def yposition(self) -> VisualAreaItemYposition: + """Return the ``VISual:AREA:YPOSition`` command. + + Description: + - Sets or queries the vertical (Y-axis) center position of the specified Visual Trigger + area. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA:YPOSition?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA:YPOSition?`` query + and raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:AREA:YPOSition value`` + command. + + SCPI Syntax: + ``` + - VISual:AREA:YPOSition + - VISual:AREA:YPOSition? + ``` + + Info: + - ``Area`` specifies the integer number of a Visual Trigger area. + - ```` specifies the vertical position of the center of the Visual Trigger area, in + amplitude (volts, amps). + """ + return self._yposition + + +class Visual(SCPICmdRead): + """The ``VISual`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``VISual?`` query. + - Using the ``.verify(value)`` method will send the ``VISual?`` query and raise an + AssertionError if the returned value does not match ``value``. + + Properties: + - ``.area``: The ``VISual:AREA`` command tree. + - ``.deleteall``: The ``VISual:DELETEALL`` command. + - ``.enable``: The ``VISual:ENAble`` command. + - ``.equation``: The ``VISual:EQUation`` command. + - ``.showareas``: The ``VISual:SHOWAReas`` command. + - ``.showcriteria``: The ``VISual:SHOWCRiteria`` command. + - ``.showequation``: The ``VISual:SHOWEQuation`` command. + """ + + def __init__(self, device: Optional["PIDevice"] = None, cmd_syntax: str = "VISual") -> None: + super().__init__(device, cmd_syntax) + self._area: Dict[int, VisualAreaItem] = DefaultDictPassKeyToFactory( + lambda x: VisualAreaItem(device, f"{self._cmd_syntax}:AREA{x}") + ) + self._deleteall = VisualDeleteall(device, f"{self._cmd_syntax}:DELETEALL") + self._enable = VisualEnable(device, f"{self._cmd_syntax}:ENAble") + self._equation = VisualEquation(device, f"{self._cmd_syntax}:EQUation") + self._showareas = VisualShowareas(device, f"{self._cmd_syntax}:SHOWAReas") + self._showcriteria = VisualShowcriteria(device, f"{self._cmd_syntax}:SHOWCRiteria") + self._showequation = VisualShowequation(device, f"{self._cmd_syntax}:SHOWEQuation") + + @property + def area(self) -> Dict[int, VisualAreaItem]: + """Return the ``VISual:AREA`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``VISual:AREA?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:AREA?`` query and raise + an AssertionError if the returned value does not match ``value``. + + Sub-properties: + - ``.aspectratio``: The ``VISual:AREA:ASPEctratio`` command. + - ``.flip``: The ``VISual:AREA:FLIP`` command tree. + - ``.height``: The ``VISual:AREA:HEIGht`` command. + - ``.hittype``: The ``VISual:AREA:HITType`` command. + - ``.reset``: The ``VISual:AREA:RESET`` command. + - ``.rotation``: The ``VISual:AREA:ROTAtion`` command. + - ``.shape``: The ``VISual:AREA:SHAPE`` command. + - ``.source``: The ``VISual:AREA:SOUrce`` command. + - ``.vertices``: The ``VISual:AREA:VERTICES`` command. + - ``.width``: The ``VISual:AREA:WIDTH`` command. + - ``.xposition``: The ``VISual:AREA:XPOSition`` command. + - ``.yposition``: The ``VISual:AREA:YPOSition`` command. + """ + return self._area + + @property + def deleteall(self) -> VisualDeleteall: + """Return the ``VISual:DELETEALL`` command. + + Description: + - Deletes all Visual Trigger areas. + + Usage: + - Using the ``.write()`` method will send the ``VISual:DELETEALL`` command. + + SCPI Syntax: + ``` + - VISual:DELETEALL + ``` + """ + return self._deleteall + + @property + def enable(self) -> VisualEnable: + """Return the ``VISual:ENAble`` command. + + Description: + - Sets or queries the status (on or off) of the Visual Trigger mode. + + Usage: + - Using the ``.query()`` method will send the ``VISual:ENAble?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:ENAble?`` query and raise + an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:ENAble value`` command. + + SCPI Syntax: + ``` + - VISual:ENAble {ON|OFF|} + - VISual:ENAble? + ``` + + Info: + - ``ON`` enables the Visual Trigger mode. + - ``OFF`` disables the Visual Trigger mode. + - ```` is an integer number. 0 turns off the Visual Trigger mode; any other value + enables Visual Trigger mode. + """ + return self._enable + + @property + def equation(self) -> VisualEquation: + r"""Return the ``VISual:EQUation`` command. + + Description: + - Sets or queries the Visual Trigger area combination logic equation. + + Usage: + - Using the ``.query()`` method will send the ``VISual:EQUation?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:EQUation?`` query and raise + an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:EQUation value`` command. + + SCPI Syntax: + ``` + - VISual:EQUation + - VISual:EQUation? + ``` + + Info: + - ```` defines the Visual Trigger area combination logic equation. The equation + is made up of area names (A) combined with logic operators AND, OR, or XOR (&, \|, + ^). It may also contain parentheses for grouping. The equation must be true to have a + valid Visual Trigger event and display a waveform. Each area's true state depends on + the area's condition setting (In, Out or Don't Care). + """ + return self._equation + + @property + def showareas(self) -> VisualShowareas: + """Return the ``VISual:SHOWAReas`` command. + + Description: + - Shows or hides all Visual Trigger areas. + + Usage: + - Using the ``.query()`` method will send the ``VISual:SHOWAReas?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:SHOWAReas?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:SHOWAReas value`` command. + + SCPI Syntax: + ``` + - VISual:SHOWAReas {ON|OFF|} + - VISual:SHOWAReas? + ``` + + Info: + - ``ON`` shows all Visual Trigger areas. + - ``OFF`` hides all Visual Trigger areas. + - ```` is an integer number. 0 hides all Visual Trigger areas; any other value + shows all Visual Trigger areas. + """ + return self._showareas + + @property + def showcriteria(self) -> VisualShowcriteria: + """Return the ``VISual:SHOWCRiteria`` command. + + Description: + - Sets or queries display of the area names and hit criteria for all visual trigger + areas. + + Usage: + - Using the ``.query()`` method will send the ``VISual:SHOWCRiteria?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:SHOWCRiteria?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:SHOWCRiteria value`` + command. + + SCPI Syntax: + ``` + - VISual:SHOWCRiteria {ON|OFF|} + - VISual:SHOWCRiteria? + ``` + + Info: + - ``ON`` enables display of the area name and hit criteria labels (In, Out, Don't care + icons) of all Visual Trigger areas. + - ``OFF`` hides the area name and hit criteria labels (In, Out, Don't care icons) of all + Visual Trigger areas. + - ```` is an integer number. 0 hides the area name and hit criteria of all Visual + Trigger areas; any other value enables displaying the area name and hit criteria of + all Visual Trigger areas. + """ + return self._showcriteria + + @property + def showequation(self) -> VisualShowequation: + """Return the ``VISual:SHOWEQuation`` command. + + Description: + - Shows or hides the Visual Trigger area combination logic equation. + + Usage: + - Using the ``.query()`` method will send the ``VISual:SHOWEQuation?`` query. + - Using the ``.verify(value)`` method will send the ``VISual:SHOWEQuation?`` query and + raise an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``VISual:SHOWEQuation value`` + command. + + SCPI Syntax: + ``` + - VISual:SHOWEQuation {ON|OFF|} + - VISual:SHOWEQuation? + ``` + + Info: + - ``ON`` shows the Visual Trigger area combination logic equation. + - ``OFF`` hides the Visual Trigger area combination logic equation. + - ```` is an integer number. 0 hides the area combination logic equation; any other + value displays the area combination logic equation. + """ + return self._showequation diff --git a/src/tm_devices/commands/gen_e3h2zs_lpdmso/autosavepitimeout.py b/src/tm_devices/commands/gen_e3h2zs_lpdmso/autosavepitimeout.py new file mode 100644 index 00000000..d693053c --- /dev/null +++ b/src/tm_devices/commands/gen_e3h2zs_lpdmso/autosavepitimeout.py @@ -0,0 +1,51 @@ +"""The autosavepitimeout commands module. + +These commands are used in the following models: +LPD6, MSO2, MSO4, MSO4B, MSO5, MSO5B, MSO5LP, MSO6, MSO6B + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - AUTOSAVEPITIMEOUT + - AUTOSAVEPITIMEOUT? + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead, SCPICmdWrite + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class Autosavepitimeout(SCPICmdWrite, SCPICmdRead): + """The ``AUTOSAVEPITIMEOUT`` command. + + Description: + - This command sets or queries the idle time from the programmable interface before + auto-save occurs. + + Usage: + - Using the ``.query()`` method will send the ``AUTOSAVEPITIMEOUT?`` query. + - Using the ``.verify(value)`` method will send the ``AUTOSAVEPITIMEOUT?`` query and raise + an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``AUTOSAVEPITIMEOUT value`` command. + + SCPI Syntax: + ``` + - AUTOSAVEPITIMEOUT + - AUTOSAVEPITIMEOUT? + ``` + + Info: + - ```` + """ + + def __init__( + self, device: Optional["PIDevice"] = None, cmd_syntax: str = "AUTOSAVEPITIMEOUT" + ) -> None: + super().__init__(device, cmd_syntax) diff --git a/src/tm_devices/commands/gen_e3h2zs_lpdmso/autosaveuitimeout.py b/src/tm_devices/commands/gen_e3h2zs_lpdmso/autosaveuitimeout.py new file mode 100644 index 00000000..eef72093 --- /dev/null +++ b/src/tm_devices/commands/gen_e3h2zs_lpdmso/autosaveuitimeout.py @@ -0,0 +1,51 @@ +"""The autosaveuitimeout commands module. + +These commands are used in the following models: +LPD6, MSO2, MSO4, MSO4B, MSO5, MSO5B, MSO5LP, MSO6, MSO6B + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - AUTOSAVEUITIMEOUT + - AUTOSAVEUITIMEOUT? + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead, SCPICmdWrite + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class Autosaveuitimeout(SCPICmdWrite, SCPICmdRead): + """The ``AUTOSAVEUITIMEOUT`` command. + + Description: + - This command sets or queries the idle time from the user interface before auto-save + occurs. + + Usage: + - Using the ``.query()`` method will send the ``AUTOSAVEUITIMEOUT?`` query. + - Using the ``.verify(value)`` method will send the ``AUTOSAVEUITIMEOUT?`` query and raise + an AssertionError if the returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``AUTOSAVEUITIMEOUT value`` command. + + SCPI Syntax: + ``` + - AUTOSAVEUITIMEOUT + - AUTOSAVEUITIMEOUT? + ``` + + Info: + - ```` + """ + + def __init__( + self, device: Optional["PIDevice"] = None, cmd_syntax: str = "AUTOSAVEUITIMEOUT" + ) -> None: + super().__init__(device, cmd_syntax) diff --git a/src/tm_devices/commands/gen_e3h2zs_lpdmso/bustable.py b/src/tm_devices/commands/gen_e3h2zs_lpdmso/bustable.py new file mode 100644 index 00000000..6c82de8e --- /dev/null +++ b/src/tm_devices/commands/gen_e3h2zs_lpdmso/bustable.py @@ -0,0 +1,165 @@ +"""The bustable commands module. + +These commands are used in the following models: +LPD6, MSO2, MSO4, MSO4B, MSO5, MSO5B, MSO5LP, MSO6, MSO6B + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - BUSTABle:ADDNew + - BUSTABle:DELete + - BUSTABle:LIST? + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead, SCPICmdWrite + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class BustableList(SCPICmdRead): + """The ``BUSTABle:LIST`` command. + + Description: + - This query lists all currently defined bus tables. + + Usage: + - Using the ``.query()`` method will send the ``BUSTABle:LIST?`` query. + - Using the ``.verify(value)`` method will send the ``BUSTABle:LIST?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - BUSTABle:LIST? + ``` + """ + + +class BustableDelete(SCPICmdWrite): + """The ``BUSTABle:DELete`` command. + + Description: + - Deletes the specified bus table. Argument is of the form 'TABLE', where is ≥1). + + Usage: + - Using the ``.write(value)`` method will send the ``BUSTABle:DELete value`` command. + + SCPI Syntax: + ``` + - BUSTABle:DELete + ``` + + Info: + - ```` is a quoted string that is the name of the bus table to delete. + """ + + _WRAP_ARG_WITH_QUOTES = True + + +class BustableAddnew(SCPICmdWrite): + """The ``BUSTABle:ADDNew`` command. + + Description: + - Adds the specified bus table. Argument is of the form 'TABLE', where is ≥1). + + Usage: + - Using the ``.write(value)`` method will send the ``BUSTABle:ADDNew value`` command. + + SCPI Syntax: + ``` + - BUSTABle:ADDNew + ``` + + Info: + - ```` is a quoted string that is the name of the new bus table. + """ + + _WRAP_ARG_WITH_QUOTES = True + + +class Bustable(SCPICmdRead): + """The ``BUSTABle`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``BUSTABle?`` query. + - Using the ``.verify(value)`` method will send the ``BUSTABle?`` query and raise an + AssertionError if the returned value does not match ``value``. + + Properties: + - ``.addnew``: The ``BUSTABle:ADDNew`` command. + - ``.delete``: The ``BUSTABle:DELete`` command. + - ``.list``: The ``BUSTABle:LIST`` command. + """ + + def __init__(self, device: Optional["PIDevice"] = None, cmd_syntax: str = "BUSTABle") -> None: + super().__init__(device, cmd_syntax) + self._addnew = BustableAddnew(device, f"{self._cmd_syntax}:ADDNew") + self._delete = BustableDelete(device, f"{self._cmd_syntax}:DELete") + self._list = BustableList(device, f"{self._cmd_syntax}:LIST") + + @property + def addnew(self) -> BustableAddnew: + """Return the ``BUSTABle:ADDNew`` command. + + Description: + - Adds the specified bus table. Argument is of the form 'TABLE', where is + ≥1). + + Usage: + - Using the ``.write(value)`` method will send the ``BUSTABle:ADDNew value`` command. + + SCPI Syntax: + ``` + - BUSTABle:ADDNew + ``` + + Info: + - ```` is a quoted string that is the name of the new bus table. + """ + return self._addnew + + @property + def delete(self) -> BustableDelete: + """Return the ``BUSTABle:DELete`` command. + + Description: + - Deletes the specified bus table. Argument is of the form 'TABLE', where is + ≥1). + + Usage: + - Using the ``.write(value)`` method will send the ``BUSTABle:DELete value`` command. + + SCPI Syntax: + ``` + - BUSTABle:DELete + ``` + + Info: + - ```` is a quoted string that is the name of the bus table to delete. + """ + return self._delete + + @property + def list(self) -> BustableList: + """Return the ``BUSTABle:LIST`` command. + + Description: + - This query lists all currently defined bus tables. + + Usage: + - Using the ``.query()`` method will send the ``BUSTABle:LIST?`` query. + - Using the ``.verify(value)`` method will send the ``BUSTABle:LIST?`` query and raise + an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - BUSTABle:LIST? + ``` + """ + return self._list diff --git a/src/tm_devices/commands/gen_e3h2zs_lpdmso/configuration.py b/src/tm_devices/commands/gen_e3h2zs_lpdmso/configuration.py new file mode 100644 index 00000000..d7809659 --- /dev/null +++ b/src/tm_devices/commands/gen_e3h2zs_lpdmso/configuration.py @@ -0,0 +1,108 @@ +"""The configuration commands module. + +These commands are used in the following models: +LPD6, MSO2, MSO4, MSO4B, MSO5, MSO5B, MSO5LP, MSO6, MSO6B + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - CONFIGuration:ANALOg:BANDWidth? + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class ConfigurationAnalogBandwidth(SCPICmdRead): + """The ``CONFIGuration:ANALOg:BANDWidth`` command. + + Description: + - This command queries the maximum licensed bandwidth of the instrument. + + Usage: + - Using the ``.query()`` method will send the ``CONFIGuration:ANALOg:BANDWidth?`` query. + - Using the ``.verify(value)`` method will send the ``CONFIGuration:ANALOg:BANDWidth?`` + query and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - CONFIGuration:ANALOg:BANDWidth? + ``` + """ + + +class ConfigurationAnalog(SCPICmdRead): + """The ``CONFIGuration:ANALOg`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``CONFIGuration:ANALOg?`` query. + - Using the ``.verify(value)`` method will send the ``CONFIGuration:ANALOg?`` query and + raise an AssertionError if the returned value does not match ``value``. + + Properties: + - ``.bandwidth``: The ``CONFIGuration:ANALOg:BANDWidth`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._bandwidth = ConfigurationAnalogBandwidth(device, f"{self._cmd_syntax}:BANDWidth") + + @property + def bandwidth(self) -> ConfigurationAnalogBandwidth: + """Return the ``CONFIGuration:ANALOg:BANDWidth`` command. + + Description: + - This command queries the maximum licensed bandwidth of the instrument. + + Usage: + - Using the ``.query()`` method will send the ``CONFIGuration:ANALOg:BANDWidth?`` query. + - Using the ``.verify(value)`` method will send the ``CONFIGuration:ANALOg:BANDWidth?`` + query and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - CONFIGuration:ANALOg:BANDWidth? + ``` + """ + return self._bandwidth + + +class Configuration(SCPICmdRead): + """The ``CONFIGuration`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``CONFIGuration?`` query. + - Using the ``.verify(value)`` method will send the ``CONFIGuration?`` query and raise an + AssertionError if the returned value does not match ``value``. + + Properties: + - ``.analog``: The ``CONFIGuration:ANALOg`` command tree. + """ + + def __init__( + self, device: Optional["PIDevice"] = None, cmd_syntax: str = "CONFIGuration" + ) -> None: + super().__init__(device, cmd_syntax) + self._analog = ConfigurationAnalog(device, f"{self._cmd_syntax}:ANALOg") + + @property + def analog(self) -> ConfigurationAnalog: + """Return the ``CONFIGuration:ANALOg`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``CONFIGuration:ANALOg?`` query. + - Using the ``.verify(value)`` method will send the ``CONFIGuration:ANALOg?`` query and + raise an AssertionError if the returned value does not match ``value``. + + Sub-properties: + - ``.bandwidth``: The ``CONFIGuration:ANALOg:BANDWidth`` command. + """ + return self._analog diff --git a/src/tm_devices/commands/gen_e3h2zs_lpdmso/curve.py b/src/tm_devices/commands/gen_e3h2zs_lpdmso/curve.py new file mode 100644 index 00000000..d640011c --- /dev/null +++ b/src/tm_devices/commands/gen_e3h2zs_lpdmso/curve.py @@ -0,0 +1,76 @@ +"""The curve commands module. + +These commands are used in the following models: +LPD6, MSO2, MSO4, MSO4B, MSO5, MSO5B, MSO5LP, MSO6, MSO6B + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - CURVe? + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class Curve(SCPICmdRead): + """The ``CURVe`` command. + + Description: + - This command transfers waveform data from the instrument. Each waveform that is + transferred has an associated waveform preamble that contains information such as data + format and scale. The ``CURVe?`` query transfers data from the instrument. The data source + is specified by the ``DATA:SOURCE`` command. The first and last data points are specified + by the ``DATA:START`` and ``DATA:STOP`` commands. For digital sources, ``CH_D`` or + CH _DALL, when the ``:DATa:WIDth`` is 1, the returned data is state only. When the + ``:DATa:WIDth`` is 2, the returned data is transition data with 2 bits per digital channel + representing the transition information as follows: 0 0 low 0 1 high 1 1 multiple + transitions in interval ending with high 1 0 multiple transitions in interval ending with + low For individual digital channels (such as ``CH_D`` ), ``:DATa:WIDth 2`` provides + the 2-bit transition data with the upper 14 bits zero. ``:DATa:WIDth 1`` provides only the + state in the LSB with the upper 7 bits all zero. For ``CH_DAll`` sources, + ``:DATa:WIDth 2`` provides the 2-bit transition data for each of the 8 constituent + channels with the D7 bit represented in the 2 most significant bits, D6 in the next 2, and + so on. ``:DATa:WIDth 1`` provides the states of each of the 8 constituent channels with D7 + represented in the most significant bit and D0 in the least significant bit. Depending on + the sample rate, multi-transition data may not be available and ``:CURVe?`` queries for + digital channels with ``:DATa:WIDth 2`` may result in a warning event 'Execution warning: + Multi-transition data not available'. In this case, the transition data returned will be 0 + 0 or 0 1. For MATH sources, only 8-byte double precision floating point data is returned + in ``:CURVe?`` queries. A Fast Acquisition waveform Pixmap data is a 500 (vertical) by + 1000 (horizontal) point bitmap. Each point represents display intensity for that screen + location. 500 (vertical) which is the row count in the bitmap, might vary based on how + many channels enabled from same FastAcq group. To query and get the Fast Acq Pixel Map + data, the following command set should be sent: ``ACQuire:FASTAcq:STATE ON`` + ``DATA:MODe PIXmap`` When the FastAcq is on, Curve? on Ch will return pixmap data (if + ``DATA:MODe`` is PIXmap). The number of rows in the pixmap will vary based on how many + ch sources are turned on and how they are grouped in acquisition HW. The grouping can + vary from model to model. The number of columns in pixmap data is fixed to 1000. For + example, on a MSO58 instrument, Ch1 to Ch4 is 'group1' and Ch5 to Ch8 is 'group2'. If Ch1 + is turned on (in group1) then Ch1 rows will be 500. If Ch2 and Ch3 are turned on (in + group1) then Ch2 and Ch3 rows will be 250 each. When all Ch1/2/3/4 are turned on (in + group1) then 125 rows per channel. If Ch1 (in group1) and Ch8 (in group2) are turned on + then 500 rows will be returned for each channel. To calculate the number of rows, you can + use- (number of bytes from curve header/``BYT_NR``)/1000. + + Usage: + - Using the ``.query()`` method will send the ``CURVe?`` query. + - Using the ``.verify(value)`` method will send the ``CURVe?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - CURVe? + ``` + """ + + def __init__(self, device: Optional["PIDevice"] = None, cmd_syntax: str = "CURVe") -> None: + super().__init__(device, cmd_syntax) diff --git a/src/tm_devices/commands/gen_e3h2zs_lpdmso/curvestream.py b/src/tm_devices/commands/gen_e3h2zs_lpdmso/curvestream.py new file mode 100644 index 00000000..03287b4e --- /dev/null +++ b/src/tm_devices/commands/gen_e3h2zs_lpdmso/curvestream.py @@ -0,0 +1,62 @@ +"""The curvestream commands module. + +These commands are used in the following models: +LPD6, MSO2, MSO4, MSO4B, MSO5, MSO5B, MSO5LP, MSO6, MSO6B + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - CURVEStream? + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class Curvestream(SCPICmdRead): + """The ``CURVEStream`` command. + + Description: + - This query-only command continuously transfers waveform data from the instrument as it is + acquired. This command puts the instrument into a streaming data mode, allowing the + controller to receive waveform records as fast as they are acquired. Use the + ``DATA:SOURCE`` command to specify the waveform sources. The command supports all the same + data formatting options as the CURVE command. Control of the instrument through the user + interface or other external clients is not allowed while in streaming data mode. The GPIB + controller must take the instrument out of this streaming data mode to terminate the query + and allow other input sources to resume communication with the instrument. The following + options are available to transition out of streaming data mode: Send a device clear over + the bus Send another command or query to the instrument Turning the waveform screen + display mode off ( ``:DISplay:WAVEform OFF`` ) may increase waveform throughput during + streaming mode. Using a data encoding of SRIbinary ( ``DATa:ENCdg SRIbinary`` ) may also + increase the waveform throughput since that is the raw native data format of the + oscilloscope. While in streaming data mode, two extreme conditions can occur. If the + waveform records are being acquired slowly (high resolution), configure the controller for + a long time-out threshold, as the data is not sent out until each complete record is + acquired. If the waveform records are being acquired rapidly (low resolution), and the + controller is not reading the data off the bus fast enough, the trigger rate is slowed to + allow each waveform to be sent sequentially. + + Usage: + - Using the ``.query()`` method will send the ``CURVEStream?`` query. + - Using the ``.verify(value)`` method will send the ``CURVEStream?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - CURVEStream? + ``` + """ + + def __init__( + self, device: Optional["PIDevice"] = None, cmd_syntax: str = "CURVEStream" + ) -> None: + super().__init__(device, cmd_syntax) diff --git a/src/tm_devices/commands/gen_e3h2zs_lpdmso/customtable.py b/src/tm_devices/commands/gen_e3h2zs_lpdmso/customtable.py new file mode 100644 index 00000000..b2029b53 --- /dev/null +++ b/src/tm_devices/commands/gen_e3h2zs_lpdmso/customtable.py @@ -0,0 +1,169 @@ +"""The customtable commands module. + +These commands are used in the following models: +LPD6, MSO2, MSO4, MSO4B, MSO5, MSO5B, MSO5LP, MSO6, MSO6B + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - CUSTOMTABle:ADDNew + - CUSTOMTABle:DELete + - CUSTOMTABle:LIST? + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead, SCPICmdReadWithArguments, SCPICmdWrite + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class CustomtableList(SCPICmdReadWithArguments): + """The ``CUSTOMTABle:LIST`` command. + + Description: + - This command queries the list of custom result tables has been added. + + Usage: + - Using the ``.query(argument)`` method will send the ``CUSTOMTABle:LIST? argument`` query. + - Using the ``.verify(argument, value)`` method will send the ``CUSTOMTABle:LIST? argument`` + query and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - CUSTOMTABle:LIST? + ``` + + Info: + - ```` specifies the custom results table name. + """ + + +class CustomtableDelete(SCPICmdWrite): + """The ``CUSTOMTABle:DELete`` command. + + Description: + - This command deletes the custom result(s) table that was added. + + Usage: + - Using the ``.write(value)`` method will send the ``CUSTOMTABle:DELete value`` command. + + SCPI Syntax: + ``` + - CUSTOMTABle:DELete + ``` + + Info: + - ```` specifies the custom results table name. + """ + + +class CustomtableAddnew(SCPICmdWrite): + """The ``CUSTOMTABle:ADDNew`` command. + + Description: + - This command adds new custom results table. + + Usage: + - Using the ``.write(value)`` method will send the ``CUSTOMTABle:ADDNew value`` command. + + SCPI Syntax: + ``` + - CUSTOMTABle:ADDNew + ``` + + Info: + - ```` specifies the custom results table name. + """ + + +class Customtable(SCPICmdRead): + """The ``CUSTOMTABle`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``CUSTOMTABle?`` query. + - Using the ``.verify(value)`` method will send the ``CUSTOMTABle?`` query and raise an + AssertionError if the returned value does not match ``value``. + + Properties: + - ``.addnew``: The ``CUSTOMTABle:ADDNew`` command. + - ``.delete``: The ``CUSTOMTABle:DELete`` command. + - ``.list``: The ``CUSTOMTABle:LIST`` command. + """ + + def __init__( + self, device: Optional["PIDevice"] = None, cmd_syntax: str = "CUSTOMTABle" + ) -> None: + super().__init__(device, cmd_syntax) + self._addnew = CustomtableAddnew(device, f"{self._cmd_syntax}:ADDNew") + self._delete = CustomtableDelete(device, f"{self._cmd_syntax}:DELete") + self._list = CustomtableList(device, f"{self._cmd_syntax}:LIST") + + @property + def addnew(self) -> CustomtableAddnew: + """Return the ``CUSTOMTABle:ADDNew`` command. + + Description: + - This command adds new custom results table. + + Usage: + - Using the ``.write(value)`` method will send the ``CUSTOMTABle:ADDNew value`` command. + + SCPI Syntax: + ``` + - CUSTOMTABle:ADDNew + ``` + + Info: + - ```` specifies the custom results table name. + """ + return self._addnew + + @property + def delete(self) -> CustomtableDelete: + """Return the ``CUSTOMTABle:DELete`` command. + + Description: + - This command deletes the custom result(s) table that was added. + + Usage: + - Using the ``.write(value)`` method will send the ``CUSTOMTABle:DELete value`` command. + + SCPI Syntax: + ``` + - CUSTOMTABle:DELete + ``` + + Info: + - ```` specifies the custom results table name. + """ + return self._delete + + @property + def list(self) -> CustomtableList: + """Return the ``CUSTOMTABle:LIST`` command. + + Description: + - This command queries the list of custom result tables has been added. + + Usage: + - Using the ``.query(argument)`` method will send the ``CUSTOMTABle:LIST? argument`` + query. + - Using the ``.verify(argument, value)`` method will send the + ``CUSTOMTABle:LIST? argument`` query and raise an AssertionError if the returned value + does not match ``value``. + + SCPI Syntax: + ``` + - CUSTOMTABle:LIST? + ``` + + Info: + - ```` specifies the custom results table name. + """ + return self._list diff --git a/src/tm_devices/commands/gen_e3h2zs_lpdmso/date.py b/src/tm_devices/commands/gen_e3h2zs_lpdmso/date.py new file mode 100644 index 00000000..bd69255f --- /dev/null +++ b/src/tm_devices/commands/gen_e3h2zs_lpdmso/date.py @@ -0,0 +1,42 @@ +"""The date commands module. + +These commands are used in the following models: +LPD6, MSO2, MSO4, MSO4B, MSO5, MSO5B, MSO5LP, MSO6, MSO6B + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - DATE? + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class Date(SCPICmdRead): + """The ``DATE`` command. + + Description: + - This command queries the date that the instrument displays. + + Usage: + - Using the ``.query()`` method will send the ``DATE?`` query. + - Using the ``.verify(value)`` method will send the ``DATE?`` query and raise an + AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - DATE? + ``` + """ + + def __init__(self, device: Optional["PIDevice"] = None, cmd_syntax: str = "DATE") -> None: + super().__init__(device, cmd_syntax) diff --git a/src/tm_devices/commands/gen_e3h2zs_lpdmso/filesystem.py b/src/tm_devices/commands/gen_e3h2zs_lpdmso/filesystem.py new file mode 100644 index 00000000..95d0cffb --- /dev/null +++ b/src/tm_devices/commands/gen_e3h2zs_lpdmso/filesystem.py @@ -0,0 +1,1073 @@ +"""The filesystem commands module. + +These commands are used in the following models: +LPD6, MSO2, MSO4, MSO4B, MSO5, MSO5B, MSO5LP, MSO6, MSO6B + +THIS FILE IS AUTO-GENERATED, IT SHOULD NOT BE MANUALLY MODIFIED. + +Please report an issue if one is found. + +Commands and Queries: + ``` + - FILESystem:COPy {,} + - FILESystem:CWD {} + - FILESystem:CWD? + - FILESystem:DELEte + - FILESystem:DIR? + - FILESystem:HOMEDir? + - FILESystem:LDIR? + - FILESystem:MKDir + - FILESystem:MOUNT:DRIVE + - FILESystem:MOUNT:DRIVE? + - FILESystem:MOUNT:TEKDrive + - FILESystem:MOUNT:TEKDrive? + - FILESystem:READFile + - FILESystem:REName , + - FILESystem:RMDir + - FILESystem:TEKDrive:CODE:EXPirytime? + - FILESystem:TEKDrive:CODE:STATus? + - FILESystem:TEKDrive:CODE? + - FILESystem:UNMOUNT:DRIve + - FILESystem:UNMOUNT:TEKDrive + - FILESystem:WRITEFile , + - FILESystem? + ``` +""" + +from typing import Optional, TYPE_CHECKING + +from ..helpers import SCPICmdRead, SCPICmdReadWithArguments, SCPICmdWrite + +if TYPE_CHECKING: + from tm_devices.drivers.pi.pi_device import PIDevice + + +class FilesystemWritefile(SCPICmdWrite): + """The ``FILESystem:WRITEFile`` command. + + Description: + - This command (no query form) writes the specified block data to the specified file on the + instruments file system. If the destination file cannot be written, an error event is + posted. + + Usage: + - Using the ``.write(value)`` method will send the ``FILESystem:WRITEFile value`` command. + + SCPI Syntax: + ``` + - FILESystem:WRITEFile , + ``` + + Info: + - ```` is a quoted string that defines the file name and path. If the file path + is within the current working directory, you need only specify the file name. + - ```` is the specified block data to be written. + """ + + +class FilesystemUnmountTekdrive(SCPICmdWrite): + """The ``FILESystem:UNMOUNT:TEKDrive`` command. + + Description: + - This command unmounts the TekDrive specified by the quoted string argument and the drive + name is case insensitive. + + Usage: + - Using the ``.write(value)`` method will send the ``FILESystem:UNMOUNT:TEKDrive value`` + command. + + SCPI Syntax: + ``` + - FILESystem:UNMOUNT:TEKDrive + ``` + + Info: + - ```` specifies the TekDrive to unmount. + """ + + _WRAP_ARG_WITH_QUOTES = True + + +class FilesystemUnmountDrive(SCPICmdWrite): + """The ``FILESystem:UNMOUNT:DRIve`` command. + + Description: + - This command unmounts the USB drive specified by the quoted string argument. + + Usage: + - Using the ``.write(value)`` method will send the ``FILESystem:UNMOUNT:DRIve value`` + command. + + SCPI Syntax: + ``` + - FILESystem:UNMOUNT:DRIve + ``` + + Info: + - ```` is a quoted string that specifies which USB drive to unmount. String is a + case insensitive single letter followed by a colon. + """ + + _WRAP_ARG_WITH_QUOTES = True + + +class FilesystemUnmount(SCPICmdRead): + """The ``FILESystem:UNMOUNT`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``FILESystem:UNMOUNT?`` query. + - Using the ``.verify(value)`` method will send the ``FILESystem:UNMOUNT?`` query and raise + an AssertionError if the returned value does not match ``value``. + + Properties: + - ``.drive``: The ``FILESystem:UNMOUNT:DRIve`` command. + - ``.tekdrive``: The ``FILESystem:UNMOUNT:TEKDrive`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._drive = FilesystemUnmountDrive(device, f"{self._cmd_syntax}:DRIve") + self._tekdrive = FilesystemUnmountTekdrive(device, f"{self._cmd_syntax}:TEKDrive") + + @property + def drive(self) -> FilesystemUnmountDrive: + """Return the ``FILESystem:UNMOUNT:DRIve`` command. + + Description: + - This command unmounts the USB drive specified by the quoted string argument. + + Usage: + - Using the ``.write(value)`` method will send the ``FILESystem:UNMOUNT:DRIve value`` + command. + + SCPI Syntax: + ``` + - FILESystem:UNMOUNT:DRIve + ``` + + Info: + - ```` is a quoted string that specifies which USB drive to unmount. String is + a case insensitive single letter followed by a colon. + """ + return self._drive + + @property + def tekdrive(self) -> FilesystemUnmountTekdrive: + """Return the ``FILESystem:UNMOUNT:TEKDrive`` command. + + Description: + - This command unmounts the TekDrive specified by the quoted string argument and the + drive name is case insensitive. + + Usage: + - Using the ``.write(value)`` method will send the ``FILESystem:UNMOUNT:TEKDrive value`` + command. + + SCPI Syntax: + ``` + - FILESystem:UNMOUNT:TEKDrive + ``` + + Info: + - ```` specifies the TekDrive to unmount. + """ + return self._tekdrive + + +class FilesystemTekdriveCodeStatus(SCPICmdRead): + """The ``FILESystem:TEKDrive:CODE:STATus`` command. + + Description: + - This command returns status of short code. + + Usage: + - Using the ``.query()`` method will send the ``FILESystem:TEKDrive:CODE:STATus?`` query. + - Using the ``.verify(value)`` method will send the ``FILESystem:TEKDrive:CODE:STATus?`` + query and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - FILESystem:TEKDrive:CODE:STATus? + ``` + """ + + +class FilesystemTekdriveCodeExpirytime(SCPICmdRead): + """The ``FILESystem:TEKDrive:CODE:EXPirytime`` command. + + Description: + - This command returns expiry time of short code. It is the absolute time that the expiry + command returns. For example, if ``2:11`` pm is the time the user initiated the TekDrive + mounting, then the expiry query returns + 5 minutes (``2:16`` pm). + + Usage: + - Using the ``.query()`` method will send the ``FILESystem:TEKDrive:CODE:EXPirytime?`` + query. + - Using the ``.verify(value)`` method will send the ``FILESystem:TEKDrive:CODE:EXPirytime?`` + query and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - FILESystem:TEKDrive:CODE:EXPirytime? + ``` + """ + + +class FilesystemTekdriveCode(SCPICmdRead): + """The ``FILESystem:TEKDrive:CODE`` command. + + Description: + - This command returns short code in string format. This code must be entered (or pasted) at + http://drive.tekcloud.com/activate. After the code is entered click the Activate button to + complete the mounting of the TekDrive. + + Usage: + - Using the ``.query()`` method will send the ``FILESystem:TEKDrive:CODE?`` query. + - Using the ``.verify(value)`` method will send the ``FILESystem:TEKDrive:CODE?`` query and + raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - FILESystem:TEKDrive:CODE? + ``` + + Properties: + - ``.expirytime``: The ``FILESystem:TEKDrive:CODE:EXPirytime`` command. + - ``.status``: The ``FILESystem:TEKDrive:CODE:STATus`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._expirytime = FilesystemTekdriveCodeExpirytime( + device, f"{self._cmd_syntax}:EXPirytime" + ) + self._status = FilesystemTekdriveCodeStatus(device, f"{self._cmd_syntax}:STATus") + + @property + def expirytime(self) -> FilesystemTekdriveCodeExpirytime: + """Return the ``FILESystem:TEKDrive:CODE:EXPirytime`` command. + + Description: + - This command returns expiry time of short code. It is the absolute time that the + expiry command returns. For example, if ``2:11`` pm is the time the user initiated the + TekDrive mounting, then the expiry query returns + 5 minutes (``2:16`` pm). + + Usage: + - Using the ``.query()`` method will send the ``FILESystem:TEKDrive:CODE:EXPirytime?`` + query. + - Using the ``.verify(value)`` method will send the + ``FILESystem:TEKDrive:CODE:EXPirytime?`` query and raise an AssertionError if the + returned value does not match ``value``. + + SCPI Syntax: + ``` + - FILESystem:TEKDrive:CODE:EXPirytime? + ``` + """ + return self._expirytime + + @property + def status(self) -> FilesystemTekdriveCodeStatus: + """Return the ``FILESystem:TEKDrive:CODE:STATus`` command. + + Description: + - This command returns status of short code. + + Usage: + - Using the ``.query()`` method will send the ``FILESystem:TEKDrive:CODE:STATus?`` + query. + - Using the ``.verify(value)`` method will send the ``FILESystem:TEKDrive:CODE:STATus?`` + query and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - FILESystem:TEKDrive:CODE:STATus? + ``` + """ + return self._status + + +class FilesystemTekdrive(SCPICmdRead): + """The ``FILESystem:TEKDrive`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``FILESystem:TEKDrive?`` query. + - Using the ``.verify(value)`` method will send the ``FILESystem:TEKDrive?`` query and raise + an AssertionError if the returned value does not match ``value``. + + Properties: + - ``.code``: The ``FILESystem:TEKDrive:CODE`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._code = FilesystemTekdriveCode(device, f"{self._cmd_syntax}:CODE") + + @property + def code(self) -> FilesystemTekdriveCode: + """Return the ``FILESystem:TEKDrive:CODE`` command. + + Description: + - This command returns short code in string format. This code must be entered (or + pasted) at http://drive.tekcloud.com/activate. After the code is entered click the + Activate button to complete the mounting of the TekDrive. + + Usage: + - Using the ``.query()`` method will send the ``FILESystem:TEKDrive:CODE?`` query. + - Using the ``.verify(value)`` method will send the ``FILESystem:TEKDrive:CODE?`` query + and raise an AssertionError if the returned value does not match ``value``. + + SCPI Syntax: + ``` + - FILESystem:TEKDrive:CODE? + ``` + + Sub-properties: + - ``.expirytime``: The ``FILESystem:TEKDrive:CODE:EXPirytime`` command. + - ``.status``: The ``FILESystem:TEKDrive:CODE:STATus`` command. + """ + return self._code + + +class FilesystemRmdir(SCPICmdWrite): + """The ``FILESystem:RMDir`` command. + + Description: + - This command (no query form) deletes a named directory. The directory must be empty. + + Usage: + - Using the ``.write(value)`` method will send the ``FILESystem:RMDir value`` command. + + SCPI Syntax: + ``` + - FILESystem:RMDir + ``` + + Info: + - ```` is a quoted string that defines the folder name and path. If the + folder path is within the current working directory, you need only specify the folder + name. + """ + + +class FilesystemRename(SCPICmdWrite): + """The ``FILESystem:REName`` command. + + Description: + - This command (no query form) assigns a new name to an existing file or folder. + + Usage: + - Using the ``.write(value)`` method will send the ``FILESystem:REName value`` command. + + SCPI Syntax: + ``` + - FILESystem:REName , + ``` + + Info: + - ```` is a quoted string that defines the file or folder name and path. If + the path is within the current working directory, you need only specify the file or folder + name. + - ```` is a quoted string that defines the file or folder name and path. If + the path is within the current working directory, you need only specify the file or folder + name. + """ + + +class FilesystemReadfile(SCPICmdWrite): + """The ``FILESystem:READFile`` command. + + Description: + - This command writes the contents of the specified file to the current interface. If the + specified file does not exist or is not readable, an appropriate error event is posted. + + Usage: + - Using the ``.write(value)`` method will send the ``FILESystem:READFile value`` command. + + SCPI Syntax: + ``` + - FILESystem:READFile + ``` + + Info: + - ```` is a quoted string that defines the file name and path. If the file path is + within the current working directory, you need only specify the file name. + """ + + _WRAP_ARG_WITH_QUOTES = True + + +class FilesystemMountTekdrive(SCPICmdWrite, SCPICmdReadWithArguments): + """The ``FILESystem:MOUNT:TEKDrive`` command. + + Description: + - This command mounts the TekDrive specified by the quoted string arguments. The argument + must contain the drive name, AutoDisconnectMode, RestrictToCurrentIP, and + AutoDisconnectTime. The drive name is the TekDrive name to be mounted. It is case + insensitive. There are three options available for AutoDisconnectMode: Select Power Cycle + to unmount the TekDrive after power cycling the oscilloscope. There is no time restriction + when this option is selected Select Never to mount the TekDrive connection permanently. + Select Custom to disconnect the TekDrive after a chosen duration. The default selection is + Power Cycle. RestrictToCurrentIP restricts the connection to current network IP only. This + may be used for additional network security. AutoDisconnectTime is the required time for + the Auto Disconnect. The TekDrive gets disconnected automatically from the instrument + after the specified time. The duration is in hours. The minimum is 0.25 hours and the + maximum is 744 hours. The query form of this command returns whether or not the specified + TekDrive is mounted. + + Usage: + - Using the ``.query(argument)`` method will send the + ``FILESystem:MOUNT:TEKDrive? argument`` query. + - Using the ``.verify(argument, value)`` method will send the + ``FILESystem:MOUNT:TEKDrive? argument`` query and raise an AssertionError if the returned + value does not match ``value``. + - Using the ``.write(value)`` method will send the ``FILESystem:MOUNT:TEKDrive value`` + command. + + SCPI Syntax: + ``` + - FILESystem:MOUNT:TEKDrive + - FILESystem:MOUNT:TEKDrive? + ``` + + Info: + - ```` provides the information needed to mount the TekDrive and must have the + drive name, AutoDisconnectMode, RestrictToCurrentIP, and AutoDisconnectTime. + """ + + _WRAP_ARG_WITH_QUOTES = True + + +class FilesystemMountDrive(SCPICmdWrite, SCPICmdReadWithArguments): + """The ``FILESystem:MOUNT:DRIVE`` command. + + Description: + - The command form mounts a network drive specified by the quoted string argument. The + quoted string argument is a semicolon separated list of the following fields: Drive name - + The drive name to be mounted. It is a case insensitive single letter followed by a colon. + The drive name must be a letter between 'L:' and 'Z:', inclusive. Server identity - The + server identity is the DNS name of the server or the IP address of the server. Path - The + path to be mounted (e.g. /level1/level2/mydirectory). User name - The user name for the + drive. User password - The password for the drive. Domain name - The domain/workgroup of + the target mount. Verbose - The verbose option to capture mount failure messages. Domain + name, user name, user password, and verbose are optional and are only used for mounts + requiring SMB/CIFS interworking (MS Windows and MacOS). The query form returns a 0 or 1 to + indicate that the drive name (quoted string) is currently mounted or not. A return of 1 + indicates the drive is mounted. A return of 0 indicated the drive is not mounted. + + Usage: + - Using the ``.query(argument)`` method will send the ``FILESystem:MOUNT:DRIVE? argument`` + query. + - Using the ``.verify(argument, value)`` method will send the + ``FILESystem:MOUNT:DRIVE? argument`` query and raise an AssertionError if the returned + value does not match ``value``. + - Using the ``.write(value)`` method will send the ``FILESystem:MOUNT:DRIVE value`` command. + + SCPI Syntax: + ``` + - FILESystem:MOUNT:DRIVE + - FILESystem:MOUNT:DRIVE? + ``` + """ + + _WRAP_ARG_WITH_QUOTES = True + + +class FilesystemMount(SCPICmdRead): + """The ``FILESystem:MOUNT`` command tree. + + Usage: + - Using the ``.query()`` method will send the ``FILESystem:MOUNT?`` query. + - Using the ``.verify(value)`` method will send the ``FILESystem:MOUNT?`` query and raise an + AssertionError if the returned value does not match ``value``. + + Properties: + - ``.drive``: The ``FILESystem:MOUNT:DRIVE`` command. + - ``.tekdrive``: The ``FILESystem:MOUNT:TEKDrive`` command. + """ + + def __init__(self, device: Optional["PIDevice"], cmd_syntax: str) -> None: + super().__init__(device, cmd_syntax) + self._drive = FilesystemMountDrive(device, f"{self._cmd_syntax}:DRIVE") + self._tekdrive = FilesystemMountTekdrive(device, f"{self._cmd_syntax}:TEKDrive") + + @property + def drive(self) -> FilesystemMountDrive: + """Return the ``FILESystem:MOUNT:DRIVE`` command. + + Description: + - The command form mounts a network drive specified by the quoted string argument. The + quoted string argument is a semicolon separated list of the following fields: Drive + name - The drive name to be mounted. It is a case insensitive single letter followed + by a colon. The drive name must be a letter between 'L:' and 'Z:', inclusive. Server + identity - The server identity is the DNS name of the server or the IP address of the + server. Path - The path to be mounted (e.g. /level1/level2/mydirectory). User name - + The user name for the drive. User password - The password for the drive. Domain name - + The domain/workgroup of the target mount. Verbose - The verbose option to capture + mount failure messages. Domain name, user name, user password, and verbose are + optional and are only used for mounts requiring SMB/CIFS interworking (MS Windows and + MacOS). The query form returns a 0 or 1 to indicate that the drive name (quoted + string) is currently mounted or not. A return of 1 indicates the drive is mounted. A + return of 0 indicated the drive is not mounted. + + Usage: + - Using the ``.query(argument)`` method will send the + ``FILESystem:MOUNT:DRIVE? argument`` query. + - Using the ``.verify(argument, value)`` method will send the + ``FILESystem:MOUNT:DRIVE? argument`` query and raise an AssertionError if the returned + value does not match ``value``. + - Using the ``.write(value)`` method will send the ``FILESystem:MOUNT:DRIVE value`` + command. + + SCPI Syntax: + ``` + - FILESystem:MOUNT:DRIVE + - FILESystem:MOUNT:DRIVE? + ``` + """ + return self._drive + + @property + def tekdrive(self) -> FilesystemMountTekdrive: + """Return the ``FILESystem:MOUNT:TEKDrive`` command. + + Description: + - This command mounts the TekDrive specified by the quoted string arguments. The + argument must contain the drive name, AutoDisconnectMode, RestrictToCurrentIP, and + AutoDisconnectTime. The drive name is the TekDrive name to be mounted. It is case + insensitive. There are three options available for AutoDisconnectMode: Select Power + Cycle to unmount the TekDrive after power cycling the oscilloscope. There is no time + restriction when this option is selected Select Never to mount the TekDrive connection + permanently. Select Custom to disconnect the TekDrive after a chosen duration. The + default selection is Power Cycle. RestrictToCurrentIP restricts the connection to + current network IP only. This may be used for additional network security. + AutoDisconnectTime is the required time for the Auto Disconnect. The TekDrive gets + disconnected automatically from the instrument after the specified time. The duration + is in hours. The minimum is 0.25 hours and the maximum is 744 hours. The query form of + this command returns whether or not the specified TekDrive is mounted. + + Usage: + - Using the ``.query(argument)`` method will send the + ``FILESystem:MOUNT:TEKDrive? argument`` query. + - Using the ``.verify(argument, value)`` method will send the + ``FILESystem:MOUNT:TEKDrive? argument`` query and raise an AssertionError if the + returned value does not match ``value``. + - Using the ``.write(value)`` method will send the ``FILESystem:MOUNT:TEKDrive value`` + command. + + SCPI Syntax: + ``` + - FILESystem:MOUNT:TEKDrive + - FILESystem:MOUNT:TEKDrive? + ``` + + Info: + - ```` provides the information needed to mount the TekDrive and must have the + drive name, AutoDisconnectMode, RestrictToCurrentIP, and AutoDisconnectTime. + """ + return self._tekdrive + + +class FilesystemMkdir(SCPICmdWrite): + """The ``FILESystem:MKDir`` command. + + Description: + - This command (no query form) creates a new directory. + + Usage: + - Using the ``.write(value)`` method will send the ``FILESystem:MKDir value`` command. + + SCPI Syntax: + ``` + - FILESystem:MKDir + ``` + + Info: + - ```` is a quoted string that specifies the directory to create. + """ + + +class FilesystemLdir(SCPICmdRead): + """The ``FILESystem:LDIR`` command. + + Description: + - Returns a comma separated list of every file, file size, type, modification date and time, + and directory in the folder referred to by the ``FILESYSTEM:CWD`` command. This is + different than the ``:DIR`` query in that it provides a long output format with the file + size, type, and modification date/time. Each entry is a semicolon separated list: < file + name>;;;;