New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signal Generation Restructure and addition of high level methods #183
base: main
Are you sure you want to change the base?
Conversation
set_if_needed: only sets the value if it is different from the current value poll_query: poll query until desired value is returned
…lues param serves the same purpose
Signed-off-by: qthompso <quinn.thompson@tektronix.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #183 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 170 172 +2
Lines 3804 4500 +696
Branches 643 761 +118
==========================================
+ Hits 3804 4500 +696 ☔ View full report in Codecov by Sentry. |
Please also update the pull request title and description. It needs to have all the relevant information anyone might look for in the future. |
Signed-off-by: qthompso <quinn.thompson@tektronix.com>
Signed-off-by: qthompso <quinn.thompson@tektronix.com>
Moved some classes around Signed-off-by: qthompso <quinn.thompson@tektronix.com>
Signed-off-by: qthompso <quinn.thompson@tektronix.com>
channel_name: The channel name for the AWG source channel. | ||
""" | ||
super().__init__(awg=awg, channel_name=channel_name) | ||
self._awg = awg |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class Warning
AWGSourceChannel
channel_name: The channel name for the AWG source channel. | ||
""" | ||
super().__init__(awg=cast(AWG5K, awg), channel_name=channel_name) | ||
self._awg = awg |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class Warning
AWGSourceChannel
Assignment overwrites attribute _awg, which was previously defined in superclass
AWG5KSourceChannel
channel_name: The channel name for the AWG source channel. | ||
""" | ||
super().__init__(awg=awg, channel_name=channel_name) | ||
self._awg = awg |
Check warning
Code scanning / CodeQL
Overwriting attribute in super-class or sub-class Warning
AWGSourceChannel
Test Results (windows)
|
Test Results (macos)
tests/test_afgs.pydevice_manager = <tm_devices.device_manager.DeviceManager object at 0x1163a1760>
def test_afg3k(device_manager: DeviceManager) -> None: # noqa: PLR0915 # pylint: disable=too-many-locals
"""Test the AFG3KC driver.
Args:
device_manager: The DeviceManager object.
"""
afg3252c = device_manager.add_afg(
"afg3252c-hostname", alias="afg3252c", connection_type="SOCKET", port=10001
)
assert id(device_manager.get_afg(number_or_alias="afg3252c")) == id(afg3252c)
assert id(device_manager.get_afg(number_or_alias=1)) == id(afg3252c)
assert afg3252c.visa_timeout == UNIT_TEST_TIMEOUT
assert afg3252c.default_visa_timeout == UNIT_TEST_TIMEOUT
assert afg3252c.resource_expression == "TCPIP0::AFG3252C-HOSTNAME::10001::SOCKET"
assert afg3252c.total_channels == 2
assert afg3252c.idn_string == "TEKTRONIX,AFG3252C,SERIAL1,SCPI:99.0 FV:3.2.3"
assert afg3252c.sw_version == Version("3.2.3")
assert afg3252c.all_channel_names_list == ("SOURCE1", "SOURCE2")
> assert afg3252c.visa_backend == "PyVISA-sim"
E AssertionError: assert '' == 'PyVISA-sim'
E
E - PyVISA-sim
afg3252c = <tm_devices.drivers.pi.signal_generators.afgs.afg3kc.AFG3KC object at 0x1160ae330>
device_manager = <tm_devices.device_manager.DeviceManager object at 0x1163a1760>
tests/test_afgs.py:39: AssertionError |
Test Results (ubuntu)
|
Proposed changes
This PR contains a fundamental change to how the signal generator (previously signal source) class is structured.
Along with this, there is a the introduction of many more high level functions to help with generating functions.
Please view the signal_generators.md documentation file for an in depth view of each of these methods.
Added
source_channel
in AWG's and AFG's.internal_afg
in TekScope.generate_function
for all AWG models.OutputSignalPath
enum attribute in AWG's representing output signal path options.sample_waveform_set_file
attribute in AWG70k's and AWG5200 to define the default waveform set file.Changed
generate_waveform()
togenerate_function()
.generate_waveform()
only exists on AWGs now, however the functionality is entirely changed.generate_function()
function by removing burst functionality.setup_burst()
andgenerate_burst()
instead.family_base_class
is at the model level.Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.