Skip to content

Commit

Permalink
feat: added fast acq support for the mso2 model.
Browse files Browse the repository at this point in the history
  • Loading branch information
v12ganesh committed Jan 7, 2025
1 parent 9c53be5 commit 6b09629
Show file tree
Hide file tree
Showing 11 changed files with 546 additions and 107 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Things to be included in the next release go here.
- This file is located next to the main log file and will start with the same name, but have the unique address of the device appended.
- This file will only be created if file logging is enabled for the package (which is the default behavior).
- Full Python API support for the MDO3 model.
- Added fast acquisition support for the MSO2 model.

### Changed

Expand Down
160 changes: 160 additions & 0 deletions src/tm_devices/commands/gen_1zn03_mso/acquire.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
Commands and Queries:
```
- ACQuire:FASTAcq:PALEtte {NORMal|TEMPerature|SPECtral|INVErted}
- ACQuire:FASTAcq:PALEtte?
- ACQuire:FASTAcq:STATE {ON|OFF|<NR1>}
- ACQuire:FASTAcq:STATE?
- ACQuire:MAXSamplerate?
- ACQuire:MODe {SAMple|PEAKdetect|HIRes|AVErage|ENVelope}
- ACQuire:MODe?
Expand Down Expand Up @@ -354,6 +358,145 @@ class AcquireMaxsamplerate(SCPICmdRead):
"""


class AcquireFastacqState(SCPICmdWrite, SCPICmdRead):
"""The ``ACQuire:FASTAcq:STATE`` command.
Description:
- Sets or queries the state of fast acquisition mode.
Usage:
- Using the ``.query()`` method will send the ``ACQuire:FASTAcq:STATE?`` query.
- Using the ``.verify(value)`` method will send the ``ACQuire:FASTAcq:STATE?`` query and
raise an AssertionError if the returned value does not match ``value``.
- Using the ``.write(value)`` method will send the ``ACQuire:FASTAcq:STATE value`` command.
SCPI Syntax:
```
- ACQuire:FASTAcq:STATE {ON|OFF|<NR1>}
- ACQuire:FASTAcq:STATE?
```
Info:
- ``<NR1>`` = 0 disables FASTAcq; any other value turns this feature on.
- ``OFF`` disables the FASTAcq feature.
- ``ON`` enables the FASTAcq feature.
"""


class AcquireFastacqPalette(SCPICmdWrite, SCPICmdRead):
"""The ``ACQuire:FASTAcq:PALEtte`` command.
Description:
- Sets or queries the waveform grading for fast acquisition mode.
Usage:
- Using the ``.query()`` method will send the ``ACQuire:FASTAcq:PALEtte?`` query.
- Using the ``.verify(value)`` method will send the ``ACQuire:FASTAcq:PALEtte?`` query and
raise an AssertionError if the returned value does not match ``value``.
- Using the ``.write(value)`` method will send the ``ACQuire:FASTAcq:PALEtte value``
command.
SCPI Syntax:
```
- ACQuire:FASTAcq:PALEtte {NORMal|TEMPerature|SPECtral|INVErted}
- ACQuire:FASTAcq:PALEtte?
```
Info:
- ``NORMal`` colors traces according to their channel.
- ``TEMPerature`` colors all traces using a multicolored palette, where 'intensity' is
represented by hue; blue for least frequently hit, red for most frequently hit. All traces
share this palette. This is the default color palette.
- ``SPECtral`` colors all traces using a multicolored palette, where 'intensity' is
represented by hue; red for least frequently hit, blue for most frequently hit. All traces
share this palette.
- ``INVErted`` Inverts the normal display hues and lightness levels based on sample
intensity. The areas of lowest sample density appear the brightest, while the areas with
the highest sample density appear the darkest.
"""


class AcquireFastacq(SCPICmdRead):
"""The ``ACQuire:FASTAcq`` command tree.
Usage:
- Using the ``.query()`` method will send the ``ACQuire:FASTAcq?`` query.
- Using the ``.verify(value)`` method will send the ``ACQuire:FASTAcq?`` query and raise an
AssertionError if the returned value does not match ``value``.
Properties:
- ``.palette``: The ``ACQuire:FASTAcq:PALEtte`` command.
- ``.state``: The ``ACQuire:FASTAcq:STATE`` command.
"""

def __init__(self, device: Optional["PIControl"], cmd_syntax: str) -> None:
super().__init__(device, cmd_syntax)
self._palette = AcquireFastacqPalette(device, f"{self._cmd_syntax}:PALEtte")
self._state = AcquireFastacqState(device, f"{self._cmd_syntax}:STATE")

@property
def palette(self) -> AcquireFastacqPalette:
"""Return the ``ACQuire:FASTAcq:PALEtte`` command.
Description:
- Sets or queries the waveform grading for fast acquisition mode.
Usage:
- Using the ``.query()`` method will send the ``ACQuire:FASTAcq:PALEtte?`` query.
- Using the ``.verify(value)`` method will send the ``ACQuire:FASTAcq:PALEtte?`` query
and raise an AssertionError if the returned value does not match ``value``.
- Using the ``.write(value)`` method will send the ``ACQuire:FASTAcq:PALEtte value``
command.
SCPI Syntax:
```
- ACQuire:FASTAcq:PALEtte {NORMal|TEMPerature|SPECtral|INVErted}
- ACQuire:FASTAcq:PALEtte?
```
Info:
- ``NORMal`` colors traces according to their channel.
- ``TEMPerature`` colors all traces using a multicolored palette, where 'intensity' is
represented by hue; blue for least frequently hit, red for most frequently hit. All
traces share this palette. This is the default color palette.
- ``SPECtral`` colors all traces using a multicolored palette, where 'intensity' is
represented by hue; red for least frequently hit, blue for most frequently hit. All
traces share this palette.
- ``INVErted`` Inverts the normal display hues and lightness levels based on sample
intensity. The areas of lowest sample density appear the brightest, while the areas
with the highest sample density appear the darkest.
"""
return self._palette

@property
def state(self) -> AcquireFastacqState:
"""Return the ``ACQuire:FASTAcq:STATE`` command.
Description:
- Sets or queries the state of fast acquisition mode.
Usage:
- Using the ``.query()`` method will send the ``ACQuire:FASTAcq:STATE?`` query.
- Using the ``.verify(value)`` method will send the ``ACQuire:FASTAcq:STATE?`` query and
raise an AssertionError if the returned value does not match ``value``.
- Using the ``.write(value)`` method will send the ``ACQuire:FASTAcq:STATE value``
command.
SCPI Syntax:
```
- ACQuire:FASTAcq:STATE {ON|OFF|<NR1>}
- ACQuire:FASTAcq:STATE?
```
Info:
- ``<NR1>`` = 0 disables FASTAcq; any other value turns this feature on.
- ``OFF`` disables the FASTAcq feature.
- ``ON`` enables the FASTAcq feature.
"""
return self._state


# pylint: disable=too-many-instance-attributes
class Acquire(SCPICmdRead):
"""The ``ACQuire`` command.
Expand All @@ -371,6 +514,7 @@ class Acquire(SCPICmdRead):
```
Properties:
- ``.fastacq``: The ``ACQuire:FASTAcq`` command tree.
- ``.maxsamplerate``: The ``ACQuire:MAXSamplerate`` command.
- ``.mode``: The ``ACQuire:MODe`` command.
- ``.numacq``: The ``ACQuire:NUMACq`` command.
Expand All @@ -382,6 +526,7 @@ class Acquire(SCPICmdRead):

def __init__(self, device: Optional["PIControl"] = None, cmd_syntax: str = "ACQuire") -> None:
super().__init__(device, cmd_syntax)
self._fastacq = AcquireFastacq(device, f"{self._cmd_syntax}:FASTAcq")
self._maxsamplerate = AcquireMaxsamplerate(device, f"{self._cmd_syntax}:MAXSamplerate")
self._mode = AcquireMode(device, f"{self._cmd_syntax}:MODe")
self._numacq = AcquireNumacq(device, f"{self._cmd_syntax}:NUMACq")
Expand All @@ -390,6 +535,21 @@ def __init__(self, device: Optional["PIControl"] = None, cmd_syntax: str = "ACQu
self._state = AcquireState(device, f"{self._cmd_syntax}:STATE")
self._stopafter = AcquireStopafter(device, f"{self._cmd_syntax}:STOPAfter")

@property
def fastacq(self) -> AcquireFastacq:
"""Return the ``ACQuire:FASTAcq`` command tree.
Usage:
- Using the ``.query()`` method will send the ``ACQuire:FASTAcq?`` query.
- Using the ``.verify(value)`` method will send the ``ACQuire:FASTAcq?`` query and raise
an AssertionError if the returned value does not match ``value``.
Sub-properties:
- ``.palette``: The ``ACQuire:FASTAcq:PALEtte`` command.
- ``.state``: The ``ACQuire:FASTAcq:STATE`` command.
"""
return self._fastacq

@property
def maxsamplerate(self) -> AcquireMaxsamplerate:
"""Return the ``ACQuire:MAXSamplerate`` command.
Expand Down
Loading

0 comments on commit 6b09629

Please sign in to comment.