refactoring
This commit is contained in:
parent
5538c683c3
commit
a3b100b419
@ -1 +1 @@
|
||||
/home/an/Documents/Git/tuhh_gitlab/fn_gen/.venv/bin/python
|
||||
/home/an/Documents/Git/tuhh_gitlab/rigol-dg2052-python-library/.venv/bin/python
|
@ -1,20 +0,0 @@
|
||||
# Minimal makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line, and also
|
||||
# from the environment for the first two.
|
||||
SPHINXOPTS ?=
|
||||
SPHINXBUILD ?= sphinx-build
|
||||
SOURCEDIR = source
|
||||
BUILDDIR = build
|
||||
|
||||
# Put it first so that "make" without argument is like "make help".
|
||||
help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
.PHONY: help Makefile
|
||||
|
||||
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||
%: Makefile
|
||||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
@ -1,35 +0,0 @@
|
||||
@ECHO OFF
|
||||
|
||||
pushd %~dp0
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=sphinx-build
|
||||
)
|
||||
set SOURCEDIR=source
|
||||
set BUILDDIR=build
|
||||
|
||||
%SPHINXBUILD% >NUL 2>NUL
|
||||
if errorlevel 9009 (
|
||||
echo.
|
||||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
||||
echo.installed, then set the SPHINXBUILD environment variable to point
|
||||
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
||||
echo.may add the Sphinx directory to PATH.
|
||||
echo.
|
||||
echo.If you don't have Sphinx installed, grab it from
|
||||
echo.https://www.sphinx-doc.org/
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||
goto end
|
||||
|
||||
:help
|
||||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||
|
||||
:end
|
||||
popd
|
@ -1,28 +0,0 @@
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# For the full list of built-in configuration values, see the documentation:
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
||||
|
||||
project = 'fn_gen'
|
||||
copyright = '2024, Ali Nwegy'
|
||||
author = 'Ali Nwegy'
|
||||
release = '"0.0.1"'
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
||||
|
||||
extensions = []
|
||||
|
||||
templates_path = ['_templates']
|
||||
exclude_patterns = []
|
||||
|
||||
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
||||
|
||||
html_theme = 'alabaster'
|
||||
html_static_path = ['_static']
|
@ -1,24 +0,0 @@
|
||||
.. fn_gen documentation master file, created by
|
||||
sphinx-quickstart on Tue Jan 16 17:51:58 2024.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
Welcome to fn_gen's documentation!
|
||||
==================================
|
||||
|
||||
**fn_gen** (/ˈfʌŋkʃən ˈʤɛnəˌreɪtər/) is a Python library for usage with SCPI (Simple Command Protocol for measurement Instruments) compliant function generators.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Contents:
|
||||
|
||||
usage
|
||||
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
@ -1,16 +0,0 @@
|
||||
Usage
|
||||
=====
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
To use fn_gen, you need to first build it using python build:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
(.venv) $ pip install build
|
||||
(.venv) $ python -m build
|
||||
(.venv) $ deactivate
|
||||
$ pip install dist/fn_gen-0.0.1-py3-none-any.whl
|
||||
|
||||
|
73
examples/dc_signal.py
Normal file → Executable file
73
examples/dc_signal.py
Normal file → Executable file
@ -1,28 +1,57 @@
|
||||
from fn_gen import DG2052
|
||||
from fn_gen.enums import OutputChannel
|
||||
import fn_gen.errors as fg_err
|
||||
import logging
|
||||
import time
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
from typing import Literal
|
||||
|
||||
if __name__ == "__main__":
|
||||
import fn_gen.errors as fg_err
|
||||
from fn_gen import DG2052
|
||||
|
||||
from common import close_output, get_postamplified, get_preamplified
|
||||
from examples.discrete_sweep import AMPLIFICATION
|
||||
|
||||
|
||||
def closeOutput(fg: DG2052, channel: Literal[1, 2]):
|
||||
fg.set_output(channel, False)
|
||||
print(f"Output{channel} State: {fg.get_output_state(channel)}")
|
||||
|
||||
|
||||
def generateDCSignal(v_dc):
|
||||
fg = DG2052("TCPIP::192.168.1.11::INSTR")
|
||||
v_dc = get_preamplified(13.0, v_dc)
|
||||
channel = 2
|
||||
try:
|
||||
# logging.basicConfig(filename="dg2052.log", encoding="utf-8", level=logging.DEBUG)
|
||||
fn_gen = DG2052("TCPIP::192.168.1.11::INSTR")
|
||||
channel = OutputChannel.TWO
|
||||
print(fn_gen.whoami())
|
||||
print( f"\nOutput{channel.value} Impedance: {fn_gen.get_output_impedance(channel)} Ohm" )
|
||||
print( f"Output{channel.value} Load: {fn_gen.get_output_load(channel)} Ohm" )
|
||||
print( f"Output{channel.value} Voltage Limits: {fn_gen.get_output_volt_limits(channel)} V" )
|
||||
fn_gen.set_dc(channel, 10)
|
||||
print( f"Output{channel.value}: {fn_gen.get_output_signal(channel)} | {fn_gen.get_output_state(channel)}" )
|
||||
fn_gen.set_output(channel, True)
|
||||
print( f"Output{channel.value} State: {fn_gen.get_output_state(channel)}" )
|
||||
time.sleep(5)
|
||||
fn_gen.set_output(channel, False)
|
||||
print( f"Output{channel.value} State: {fn_gen.get_output_state(channel)}" )
|
||||
except fg_err.UndefinedCommunicationMethodError as err:
|
||||
print(err)
|
||||
print(fg.whoami())
|
||||
print(f"\nOutput{channel} Impedance: {fg.get_output_impedance(channel)} Ohm")
|
||||
print(f"Output{channel} Load: {fg.get_output_load(channel)} Ohm")
|
||||
print(f"Output{channel} Voltage Limits: {fg.get_output_volt_limits(channel)} V")
|
||||
fg.set_dc(channel, v_dc)
|
||||
print(
|
||||
f"Output{channel}: {fg.get_output_signal(channel)} | {fg.get_output_state(channel)}"
|
||||
)
|
||||
fg.set_output(channel, True)
|
||||
print(f"Voltage: {get_postamplified(AMPLIFICATION, v_dc):.2f} V")
|
||||
print(f"Output{channel} State: {fg.get_output_state(channel)}")
|
||||
while True:
|
||||
pass
|
||||
except fg_err.ValueOutOfBoundsError as err:
|
||||
print(err)
|
||||
except fg_err.UndefinedValueError as err:
|
||||
print(err)
|
||||
except KeyboardInterrupt:
|
||||
close_output(fg, channel)
|
||||
finally:
|
||||
close_output(fg, channel)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(
|
||||
description="This program is for testing the DG2052 function generator library. It generates a DC signal based on the voltage value supplied."
|
||||
)
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--voltage",
|
||||
type=float,
|
||||
required=True,
|
||||
help="The DC voltage supplied",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
generateDCSignal(args.voltage)
|
||||
|
@ -1,29 +1,58 @@
|
||||
from fn_gen import DG2052
|
||||
from fn_gen.enums import OutputChannel
|
||||
import fn_gen.errors as fg_err
|
||||
import logging
|
||||
import time
|
||||
import argparse
|
||||
|
||||
if __name__ == "__main__":
|
||||
import fn_gen.errors as fg_err
|
||||
from fn_gen import DG2052
|
||||
|
||||
from common import close_output, get_postamplified, get_preamplified, AMPLIFICATION
|
||||
|
||||
|
||||
def generate_ramp_wave(v, freq, phase):
|
||||
fg = DG2052("TCPIP::192.168.1.11::INSTR")
|
||||
v = get_preamplified(AMPLIFICATION, v)
|
||||
channel = 2
|
||||
try:
|
||||
# logging.basicConfig(filename="dg2052.log", encoding="utf-8", level=logging.DEBUG)
|
||||
fn_gen = DG2052("TCPIP::192.168.1.11::INSTR")
|
||||
channel = OutputChannel.TWO
|
||||
print(fn_gen.whoami())
|
||||
print( f"\nOutput{channel.value} Impedance: {fn_gen.get_output_impedance(channel)} Ohm" )
|
||||
print( f"Output{channel.value} Load: {fn_gen.get_output_load(channel)} Ohm" )
|
||||
print( f"Output{channel.value} Voltage Limits: {fn_gen.get_output_volt_limits(channel)} V" )
|
||||
fn_gen.set_ramp(channel, 500, 2.5, 0, 0)
|
||||
print( f"Output{channel.value}: {fn_gen.get_output_signal(channel)} | {fn_gen.get_output_state(channel)}" )
|
||||
fn_gen.set_output(channel, True)
|
||||
print( f"Output{channel.value} State: {fn_gen.get_output_state(channel)}" )
|
||||
time.sleep(5)
|
||||
fn_gen.set_output(channel, False)
|
||||
print( f"Output{channel.value} State: {fn_gen.get_output_state(channel)}" )
|
||||
except fg_err.UndefinedCommunicationMethodError as err:
|
||||
print(err)
|
||||
print(fg.whoami())
|
||||
print(f"\nOutput{channel} Impedance: {fg.get_output_impedance(channel)} Ohm")
|
||||
print(f"Output{channel} Load: {fg.get_output_load(channel)} Ohm")
|
||||
print(f"Output{channel} Voltage Limits: {fg.get_output_volt_limits(channel)} V")
|
||||
fg.set_ramp(channel, freq, v, 0, phase)
|
||||
print(
|
||||
f"Output{channel}: {fg.get_output_signal(channel)} | {fg.get_output_state(channel)}"
|
||||
)
|
||||
fg.set_output(channel, True)
|
||||
print(f"Voltage: {get_postamplified(AMPLIFICATION, v):.2f} V")
|
||||
print(f"Frequency: {freq} Hz")
|
||||
print(f"Output{channel} State: {fg.get_output_state(channel)}")
|
||||
while True:
|
||||
pass
|
||||
except fg_err.ValueOutOfBoundsError as err:
|
||||
print(err)
|
||||
except fg_err.UndefinedValueError as err:
|
||||
print(err)
|
||||
except KeyboardInterrupt:
|
||||
close_output(fg, channel)
|
||||
finally:
|
||||
close_output(fg, channel)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(
|
||||
description="This program is for testing the DG2052 function genrator library. It generates a ramp wave with the supplied parameters."
|
||||
)
|
||||
parser.add_argument(
|
||||
"-v", "--voltage", type=float, required=True, help="The voltage supplied"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--freq", type=int, default=200, help="The frequency of the sine wave generated"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--phase",
|
||||
type=int,
|
||||
default=0,
|
||||
help="The phase shift of the signal generated",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
if args.phase not in range(0, 360):
|
||||
parser.print_help()
|
||||
exit(1)
|
||||
generate_ramp_wave(args.v, args.freq, args.phase)
|
||||
|
@ -1,28 +1,58 @@
|
||||
from fn_gen import DG2052
|
||||
from fn_gen.enums import OutputChannel
|
||||
import fn_gen.errors as fg_err
|
||||
import logging
|
||||
import time
|
||||
import argparse
|
||||
|
||||
if __name__ == "__main__":
|
||||
import fn_gen.errors as fg_err
|
||||
from common import close_output, get_preamplified, get_postamplified, AMPLIFICATION
|
||||
from fn_gen import DG2052
|
||||
|
||||
|
||||
def generate_sine_wave(v: float, freq: int, phase: int):
|
||||
fg = DG2052("TCPIP::192.168.1.11::INSTR")
|
||||
channel = 2
|
||||
v = get_preamplified(AMPLIFICATION, v)
|
||||
try:
|
||||
# logging.basicConfig(filename="dg2052.log", encoding="utf-8", level=logging.DEBUG)
|
||||
fn_gen = DG2052("TCPIP::192.168.1.11::INSTR")
|
||||
channel = OutputChannel.TWO
|
||||
print(fn_gen.whoami())
|
||||
print( f"\nOutput{channel.value} Impedance: {fn_gen.get_output_impedance(channel)} Ohm" )
|
||||
print( f"Output{channel.value} Load: {fn_gen.get_output_load(channel)} Ohm" )
|
||||
print( f"Output{channel.value} Voltage Limits: {fn_gen.get_output_volt_limits(channel)} V" )
|
||||
fn_gen.set_sine_wave(channel, 500, 2.5, 0, 0)
|
||||
print( f"Output{channel.value}: {fn_gen.get_output_signal(channel)} | {fn_gen.get_output_state(channel)}" )
|
||||
fn_gen.set_output(channel, True)
|
||||
print( f"Output{channel.value} State: {fn_gen.get_output_state(channel)}" )
|
||||
time.sleep(5)
|
||||
fn_gen.set_output(channel, False)
|
||||
print( f"Output{channel.value} State: {fn_gen.get_output_state(channel)}" )
|
||||
except fg_err.UndefinedCommunicationMethodError as err:
|
||||
print(err)
|
||||
print(fg.whoami())
|
||||
print("")
|
||||
# input("Press Enter to start...")
|
||||
fg.set_sine_wave(channel, freq, v, 0, phase)
|
||||
print(
|
||||
f"Output{channel}: {fg.get_output_signal(channel)} | {fg.get_output_state(channel)}"
|
||||
)
|
||||
fg.set_output(channel, True)
|
||||
print(f"Voltage: {get_postamplified(AMPLIFICATION, v):.2f} V")
|
||||
print(f"Frequency: {freq} Hz")
|
||||
print(f"Output{channel} State: {fg.get_output_state(channel)}")
|
||||
while True:
|
||||
pass
|
||||
except fg_err.ValueOutOfBoundsError as err:
|
||||
print(err)
|
||||
except fg_err.UndefinedValueError as err:
|
||||
print(err)
|
||||
except KeyboardInterrupt:
|
||||
close_output(fg, channel)
|
||||
finally:
|
||||
close_output(fg, channel)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(
|
||||
description="This program is for testing the DG2052 function genrator library. It generates a sine wave with the supplied parameters."
|
||||
)
|
||||
parser.add_argument(
|
||||
"-v", "--voltage", type=float, required=True, help="The voltage supplied"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--freq", type=int, default=200, help="The frequency of the sine wave generated"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--phase",
|
||||
type=int,
|
||||
default=0,
|
||||
help="The phase shift of the signal generated (must be between 0 and 360)",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
if args.phase not in range(0, 360):
|
||||
parser.print_help()
|
||||
exit(1)
|
||||
generate_sine_wave(
|
||||
v=args.voltage, freq=args.freq, phase=args.phase
|
||||
)
|
||||
|
@ -1,28 +1,55 @@
|
||||
import argparse
|
||||
from fn_gen import DG2052
|
||||
from fn_gen.enums import OutputChannel
|
||||
import fn_gen.errors as fg_err
|
||||
import logging
|
||||
import time
|
||||
from common import close_output, get_preamplified, get_postamplified, AMPLIFICATION
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
def generate_square_wave(v: float, freq: int, phase: int):
|
||||
"""
|
||||
This program is for testing the DG2052 function genrator library. It generates a square wave with the supplied parameters.
|
||||
"""
|
||||
fg = DG2052("TCPIP::192.168.1.11::INSTR")
|
||||
v = get_preamplified(AMPLIFICATION, v)
|
||||
channel = 2
|
||||
try:
|
||||
# logging.basicConfig(filename="dg2052.log", encoding="utf-8", level=logging.DEBUG)
|
||||
fn_gen = DG2052("TCPIP::192.168.1.11::INSTR")
|
||||
channel = OutputChannel.TWO
|
||||
print(fn_gen.whoami())
|
||||
print( f"\nOutput{channel.value} Impedance: {fn_gen.get_output_impedance(channel)} Ohm" )
|
||||
print( f"Output{channel.value} Load: {fn_gen.get_output_load(channel)} Ohm" )
|
||||
print( f"Output{channel.value} Voltage Limits: {fn_gen.get_output_volt_limits(channel)} V" )
|
||||
fn_gen.set_square_wave(channel, 500, 2.5, 0, 0)
|
||||
print( f"Output{channel.value}: {fn_gen.get_output_signal(channel)} | {fn_gen.get_output_state(channel)}" )
|
||||
fn_gen.set_output(channel, True)
|
||||
print( f"Output{channel.value} State: {fn_gen.get_output_state(channel)}" )
|
||||
time.sleep(5)
|
||||
fn_gen.set_output(channel, False)
|
||||
print( f"Output{channel.value} State: {fn_gen.get_output_state(channel)}" )
|
||||
except fg_err.UndefinedCommunicationMethodError as err:
|
||||
print(err)
|
||||
print(fg.whoami())
|
||||
print(f"\nOutput{channel} Impedance: {fg.get_output_impedance(channel)} Ohm")
|
||||
print(f"Output{channel} Load: {fg.get_output_load(channel)} Ohm")
|
||||
print(f"Output{channel} Voltage Limits: {fg.get_output_volt_limits(channel)} V")
|
||||
fg.set_square_wave(channel, freq, v, 0, phase)
|
||||
print(
|
||||
f"Output{channel}: {fg.get_output_signal(channel)} | {fg.get_output_state(channel)}"
|
||||
)
|
||||
fg.set_output(channel, True)
|
||||
print(f"Voltage: {get_postamplified(AMPLIFICATION,v)} V")
|
||||
print(f"Frequency: {freq} Hz")
|
||||
print(f"Output{channel} State: {fg.get_output_state(channel)}")
|
||||
while True:
|
||||
pass
|
||||
except fg_err.ValueOutOfBoundsError as err:
|
||||
print(err)
|
||||
except fg_err.UndefinedValueError as err:
|
||||
print(err)
|
||||
except KeyboardInterrupt:
|
||||
close_output(fg, channel)
|
||||
finally:
|
||||
close_output(fg, channel)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="")
|
||||
parser.add_argument("-v", "--voltage", type=float, required=True, help="The voltage supplied")
|
||||
parser.add_argument(
|
||||
"--freq", type=int, default=200, help="The frequency of the square wave generated"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--phase",
|
||||
type=int,
|
||||
default=0,
|
||||
help="The phase shift of the signal generated (must be between 0 and 360)",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
if args.phase not in range(0,360):
|
||||
parser.print_help()
|
||||
exit(1)
|
||||
generate_square_wave(args.voltage, args.freq, args.phase)
|
||||
|
@ -1,28 +1,134 @@
|
||||
from fn_gen import DG2052
|
||||
from fn_gen.enums import OutputChannel, SweepSpacing
|
||||
import fn_gen.errors as fg_err
|
||||
import logging
|
||||
import time
|
||||
import argparse
|
||||
|
||||
if __name__ == "__main__":
|
||||
import fn_gen.errors as fg_err
|
||||
from common import close_output, get_preamplified
|
||||
from fn_gen import DG2052
|
||||
from fn_gen.enums import SweepSignalType, SweepSpacing, SweepTriggerSource
|
||||
|
||||
|
||||
def sweep_over_signal(
|
||||
signal: str,
|
||||
v_min: float,
|
||||
v_max: float,
|
||||
delay: int,
|
||||
duration: int,
|
||||
freq_start: int,
|
||||
freq_stop: int,
|
||||
phase: int,
|
||||
spacing: str,
|
||||
):
|
||||
fg = DG2052("TCPIP::192.168.1.11::INSTR")
|
||||
v_min = get_preamplified(13.0, v_min)
|
||||
v_max = get_preamplified(13.0, v_max)
|
||||
channel = 2
|
||||
signal_type = SweepSignalType.SINE
|
||||
match signal:
|
||||
case "sine":
|
||||
signal_type = SweepSignalType.SINE
|
||||
case "square":
|
||||
signal_type = SweepSignalType.SQUARE
|
||||
case "ramp":
|
||||
signal_type = SweepSignalType.RAMP
|
||||
spacing_type = SweepSpacing.LOG
|
||||
match spacing:
|
||||
case "lin":
|
||||
spacing_type = SweepSpacing.LIN
|
||||
case "log":
|
||||
spacing_type = SweepSpacing.LOG
|
||||
try:
|
||||
# logging.basicConfig(filename="dg2052.log", encoding="utf-8", level=logging.DEBUG)
|
||||
fn_gen = DG2052("TCPIP::192.168.1.11::INSTR")
|
||||
channel = OutputChannel.TWO
|
||||
print(fn_gen.whoami())
|
||||
print( f"\nOutput{channel.value} Impedance: {fn_gen.get_output_impedance(channel)} Ohm" )
|
||||
print( f"Output{channel.value} Load: {fn_gen.get_output_load(channel)} Ohm" )
|
||||
print( f"Output{channel.value} Voltage Limits: {fn_gen.get_output_volt_limits(channel)} V" )
|
||||
fn_gen.set_sweep(channel, htime_start=1, htime_stop=1, time=10, spacing=SweepSpacing.LOG)
|
||||
print( f"Output{channel.value}: {fn_gen.get_output_signal(channel)} | {fn_gen.get_output_state(channel)}" )
|
||||
fn_gen.set_output(channel, True)
|
||||
print( f"Output{channel.value} State: {fn_gen.get_output_state(channel)}" )
|
||||
time.sleep(20)
|
||||
fn_gen.set_output(channel, False)
|
||||
print( f"Output{channel.value} State: {fn_gen.get_output_state(channel)}" )
|
||||
except fg_err.UndefinedCommunicationMethodError as err:
|
||||
print(err)
|
||||
print(fg.whoami())
|
||||
print(f"\nOutput{channel} Impedance: {fg.get_output_impedance(channel)} Ohm")
|
||||
print(f"Output{channel} Load: {fg.get_output_load(channel)} Ohm")
|
||||
print(f"Output{channel} Voltage Limits: {fg.get_output_volt_limits(channel)} V")
|
||||
fg.set_sweep(
|
||||
channel,
|
||||
amp=(v_max + v_min)/2,
|
||||
offset=0,
|
||||
phase=phase,
|
||||
signal_type=signal_type,
|
||||
freq_start=freq_start,
|
||||
freq_stop=freq_stop,
|
||||
spacing=spacing_type,
|
||||
trigger_source=SweepTriggerSource.MANUAL,
|
||||
time=duration,
|
||||
)
|
||||
print(
|
||||
f"Output{channel}: {fg.get_output_signal(channel)} | {fg.get_output_state(channel)}"
|
||||
)
|
||||
fg.set_output(channel, True)
|
||||
time.sleep(delay)
|
||||
fg.trigger_sweep(channel)
|
||||
t0 = time.time()
|
||||
t1 = time.time()
|
||||
while (t1 - t0) < duration:
|
||||
print(f"Current Frequency: {fg.get_output_signal(channel)}")
|
||||
t1 = time.time()
|
||||
print(f"Output{channel} State: {fg.get_output_state(channel)}")
|
||||
except fg_err.ValueOutOfBoundsError as err:
|
||||
print(err)
|
||||
except fg_err.UndefinedValueError as err:
|
||||
print(err)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
finally:
|
||||
close_output(fg, channel)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(
|
||||
description="This program is for testing the DG2052 function genrator library. It sweeps over a signal with the supplied parameters."
|
||||
)
|
||||
parser.add_argument(
|
||||
"-s",
|
||||
"--signal",
|
||||
type=str,
|
||||
choices=["sine", "square", "ramp"],
|
||||
default="sine",
|
||||
help='The type of signal being sweeped',
|
||||
)
|
||||
parser.add_argument(
|
||||
"--vmin", type=float, default=0, help="The minimum voltage supplied"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--vmax", type=float, default=1, help="The maximum voltage supplied"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-d",
|
||||
"--delay",
|
||||
type=int,
|
||||
default=0,
|
||||
help="The buffer time before the sweep starts",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--duration", type=int, default=5 * 60, help="The duration of the sweep"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--freq-start", type=int, default=10, help="The start frequency of the sweep"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--freq-stop", type=int, default=1000, help="The stop frequency of the sweep"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-p",
|
||||
"--phase",
|
||||
type=int,
|
||||
default=0,
|
||||
help="The phase shift of the signal generated (must be between 0 and 360)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--spacing",
|
||||
type=str,
|
||||
choices=["lin", "log"],
|
||||
default="log",
|
||||
help='The spacing of the sweep',
|
||||
)
|
||||
args = parser.parse_args()
|
||||
if (
|
||||
args.phase not in range(0, 360)
|
||||
or args.spacing not in ["lin", "log"]
|
||||
or args.signal not in ["sine", "square", "ramp"]
|
||||
):
|
||||
parser.print_help()
|
||||
exit(1)
|
||||
sweep_over_signal(args.signal, args.vmin, args.vmax, args.delay, args.duration, args.freq_start, args.freq_stop, args.phase, args.spacing)
|
||||
|
@ -1,15 +1,13 @@
|
||||
import pyvisa
|
||||
import sys
|
||||
import click
|
||||
from fn_gen import DG2052
|
||||
|
||||
@click.command()
|
||||
def print_whoami():
|
||||
"""
|
||||
This program is for testing the DG2052 function generator library. It prints the conncted device identification.
|
||||
"""
|
||||
fg = DG2052("TCPIP::192.168.1.11::INSTR")
|
||||
click.echo(f"{fg.whoami()}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
rm = pyvisa.ResourceManager()
|
||||
resources = rm.list_resources() # list available resources
|
||||
if len(resources) == 0:
|
||||
print("No Resources Found!")
|
||||
sys.exit(1)
|
||||
else:
|
||||
print(f"Available Resources: {resources}")
|
||||
port = resources[0] # Select the first resource
|
||||
inst = DG2052(port)
|
||||
print(inst.whoami())
|
||||
print_whoami()
|
||||
|
654
pdm.lock
654
pdm.lock
@ -2,10 +2,270 @@
|
||||
# It is not intended for manual editing.
|
||||
|
||||
[metadata]
|
||||
groups = ["default"]
|
||||
groups = ["default", "dev"]
|
||||
strategy = ["cross_platform", "inherit_metadata"]
|
||||
lock_version = "4.4.1"
|
||||
content_hash = "sha256:d897fb1a81d6c743c286033805df50ba681b989395200b6d43a6f77f9dbb64ff"
|
||||
content_hash = "sha256:c0b68a70e1545b9ea09b060530d9eb2bc2112275ff33351cf27bee9a419221fa"
|
||||
|
||||
[[package]]
|
||||
name = "ansicon"
|
||||
version = "1.89.0"
|
||||
summary = "Python wrapper for loading Jason Hood's ANSICON"
|
||||
groups = ["dev"]
|
||||
marker = "platform_system == \"Windows\""
|
||||
files = [
|
||||
{file = "ansicon-1.89.0-py2.py3-none-any.whl", hash = "sha256:f1def52d17f65c2c9682cf8370c03f541f410c1752d6a14029f97318e4b9dfec"},
|
||||
{file = "ansicon-1.89.0.tar.gz", hash = "sha256:e4d039def5768a47e4afec8e89e83ec3ae5a26bf00ad851f914d1240b444d2b1"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "appdirs"
|
||||
version = "1.4.4"
|
||||
summary = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"."
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"},
|
||||
{file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "astor"
|
||||
version = "0.8.1"
|
||||
requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7"
|
||||
summary = "Read/rewrite/write Python ASTs"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "astor-0.8.1-py2.py3-none-any.whl", hash = "sha256:070a54e890cefb5b3739d19f30f5a5ec840ffc9c50ffa7d23cc9fc1a38ebbfc5"},
|
||||
{file = "astor-0.8.1.tar.gz", hash = "sha256:6a6effda93f4e1ce9f618779b2dd1d9d84f1e32812c23a29b3fff6fd7f63fa5e"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "astroid"
|
||||
version = "3.0.3"
|
||||
requires_python = ">=3.8.0"
|
||||
summary = "An abstract syntax tree for Python with inference support."
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "astroid-3.0.3-py3-none-any.whl", hash = "sha256:92fcf218b89f449cdf9f7b39a269f8d5d617b27be68434912e11e79203963a17"},
|
||||
{file = "astroid-3.0.3.tar.gz", hash = "sha256:4148645659b08b70d72460ed1921158027a9e53ae8b7234149b1400eddacbb93"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "attrs"
|
||||
version = "23.2.0"
|
||||
requires_python = ">=3.7"
|
||||
summary = "Classes Without Boilerplate"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "attrs-23.2.0-py3-none-any.whl", hash = "sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1"},
|
||||
{file = "attrs-23.2.0.tar.gz", hash = "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "automat"
|
||||
version = "22.10.0"
|
||||
summary = "Self-service finite-state machines for the programmer on the go."
|
||||
groups = ["dev"]
|
||||
dependencies = [
|
||||
"attrs>=19.2.0",
|
||||
"six",
|
||||
]
|
||||
files = [
|
||||
{file = "Automat-22.10.0-py2.py3-none-any.whl", hash = "sha256:c3164f8742b9dc440f3682482d32aaff7bb53f71740dd018533f9de286b64180"},
|
||||
{file = "Automat-22.10.0.tar.gz", hash = "sha256:e56beb84edad19dcc11d30e8d9b895f75deeb5ef5e96b84a467066b3b84bb04e"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "blessed"
|
||||
version = "1.20.0"
|
||||
requires_python = ">=2.7"
|
||||
summary = "Easy, practical library for making terminal apps, by providing an elegant, well-documented interface to Colors, Keyboard input, and screen Positioning capabilities."
|
||||
groups = ["dev"]
|
||||
dependencies = [
|
||||
"jinxed>=1.1.0; platform_system == \"Windows\"",
|
||||
"six>=1.9.0",
|
||||
"wcwidth>=0.1.4",
|
||||
]
|
||||
files = [
|
||||
{file = "blessed-1.20.0-py2.py3-none-any.whl", hash = "sha256:0c542922586a265e699188e52d5f5ac5ec0dd517e5a1041d90d2bbf23f906058"},
|
||||
{file = "blessed-1.20.0.tar.gz", hash = "sha256:2cdd67f8746e048f00df47a2880f4d6acbcdb399031b604e34ba8f71d5787680"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bpython"
|
||||
version = "0.24"
|
||||
requires_python = ">=3.7"
|
||||
summary = ""
|
||||
groups = ["dev"]
|
||||
dependencies = [
|
||||
"curtsies>=0.4.0",
|
||||
"cwcwidth",
|
||||
"greenlet",
|
||||
"pygments",
|
||||
"pyxdg",
|
||||
"requests",
|
||||
]
|
||||
files = [
|
||||
{file = "bpython-0.24-py3-none-any.whl", hash = "sha256:0d196ae3d1ce3dcd559a3fb89ed2c468dfbd1504af0d680b906dd65a9c7a32eb"},
|
||||
{file = "bpython-0.24.tar.gz", hash = "sha256:98736ffd7a8c48fd2bfb53d898a475f4241bde0b672125706af04d9d08fd3dbd"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cachecontrol"
|
||||
version = "0.14.0"
|
||||
requires_python = ">=3.7"
|
||||
summary = "httplib2 caching for requests"
|
||||
groups = ["dev"]
|
||||
dependencies = [
|
||||
"msgpack<2.0.0,>=0.5.2",
|
||||
"requests>=2.16.0",
|
||||
]
|
||||
files = [
|
||||
{file = "cachecontrol-0.14.0-py3-none-any.whl", hash = "sha256:f5bf3f0620c38db2e5122c0726bdebb0d16869de966ea6a2befe92470b740ea0"},
|
||||
{file = "cachecontrol-0.14.0.tar.gz", hash = "sha256:7db1195b41c81f8274a7bbd97c956f44e8348265a1bc7641c37dfebc39f0c938"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cachecontrol"
|
||||
version = "0.14.0"
|
||||
extras = ["filecache"]
|
||||
requires_python = ">=3.7"
|
||||
summary = "httplib2 caching for requests"
|
||||
groups = ["dev"]
|
||||
dependencies = [
|
||||
"CacheControl==0.14.0",
|
||||
"filelock>=3.8.0",
|
||||
]
|
||||
files = [
|
||||
{file = "cachecontrol-0.14.0-py3-none-any.whl", hash = "sha256:f5bf3f0620c38db2e5122c0726bdebb0d16869de966ea6a2befe92470b740ea0"},
|
||||
{file = "cachecontrol-0.14.0.tar.gz", hash = "sha256:7db1195b41c81f8274a7bbd97c956f44e8348265a1bc7641c37dfebc39f0c938"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "certifi"
|
||||
version = "2024.2.2"
|
||||
requires_python = ">=3.6"
|
||||
summary = "Python package for providing Mozilla's CA Bundle."
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"},
|
||||
{file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "charset-normalizer"
|
||||
version = "3.3.2"
|
||||
requires_python = ">=3.7.0"
|
||||
summary = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"},
|
||||
{file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"},
|
||||
{file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "colorama"
|
||||
version = "0.4.6"
|
||||
requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
|
||||
summary = "Cross-platform colored terminal text."
|
||||
groups = ["dev"]
|
||||
marker = "sys_platform == \"win32\""
|
||||
files = [
|
||||
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
|
||||
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "configargparse"
|
||||
version = "1.7"
|
||||
requires_python = ">=3.5"
|
||||
summary = "A drop-in replacement for argparse that allows options to also be set via config files and/or environment variables."
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "ConfigArgParse-1.7-py3-none-any.whl", hash = "sha256:d249da6591465c6c26df64a9f73d2536e743be2f244eb3ebe61114af2f94f86b"},
|
||||
{file = "ConfigArgParse-1.7.tar.gz", hash = "sha256:e7067471884de5478c58a511e529f0f9bd1c66bfef1dea90935438d6c23306d1"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "constantly"
|
||||
version = "23.10.4"
|
||||
requires_python = ">=3.8"
|
||||
summary = "Symbolic constants in Python"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "constantly-23.10.4-py3-none-any.whl", hash = "sha256:3fd9b4d1c3dc1ec9757f3c52aef7e53ad9323dbe39f51dfd4c43853b68dfa3f9"},
|
||||
{file = "constantly-23.10.4.tar.gz", hash = "sha256:aa92b70a33e2ac0bb33cd745eb61776594dc48764b06c35e0efd050b7f1c7cbd"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "curtsies"
|
||||
version = "0.4.2"
|
||||
requires_python = ">=3.7"
|
||||
summary = "Curses-like terminal wrapper, with colored strings!"
|
||||
groups = ["dev"]
|
||||
dependencies = [
|
||||
"blessed>=1.5",
|
||||
"cwcwidth",
|
||||
]
|
||||
files = [
|
||||
{file = "curtsies-0.4.2-py3-none-any.whl", hash = "sha256:f24d676a8c4711fb9edba1ab7e6134bc52305a222980b3b717bb303f5e94cec6"},
|
||||
{file = "curtsies-0.4.2.tar.gz", hash = "sha256:6ebe33215bd7c92851a506049c720cca4cf5c192c1665c1d7a98a04c4702760e"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cwcwidth"
|
||||
version = "0.1.9"
|
||||
requires_python = ">=3.8"
|
||||
summary = "Python bindings for wc(s)width"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "cwcwidth-0.1.9-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b1c3eb0a8c1b25c4a17b6b9bbf7d25ce9df3ea43b6f87903c51bc12434a2cc29"},
|
||||
{file = "cwcwidth-0.1.9-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6c8752815ce4e40e7b34b7fe039276a5fbfb1b077131614381b13ef3b7bb21ff"},
|
||||
{file = "cwcwidth-0.1.9-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:368ace13080dbaacdc247370d8a965a749b124aa50d0b1b6eb87601826db870f"},
|
||||
{file = "cwcwidth-0.1.9-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:ca9a653661e152a426bdb51a272f36bc79f9830e6a7169abe8110ec367c3518c"},
|
||||
{file = "cwcwidth-0.1.9-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f96386cc29e6eef8ef066d7dd3c767c5119d66506dabea20dd344dabb3f2d225"},
|
||||
{file = "cwcwidth-0.1.9-cp311-cp311-win32.whl", hash = "sha256:f6ba88970ec12fdbed5554beb1b9a25d8271fc3d0d9e60639db700a79bed1863"},
|
||||
{file = "cwcwidth-0.1.9-cp311-cp311-win_amd64.whl", hash = "sha256:aa6725e7b3571fdf6ce7c02d1dd2d69e00d166bb6df44e46ab215067028b3a03"},
|
||||
{file = "cwcwidth-0.1.9.tar.gz", hash = "sha256:f19d11a0148d4a8cacd064c96e93bca8ce3415a186ae8204038f45e108db76b8"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dill"
|
||||
version = "0.3.8"
|
||||
requires_python = ">=3.8"
|
||||
summary = "serialize all of Python"
|
||||
groups = ["dev"]
|
||||
marker = "python_version >= \"3.11\""
|
||||
files = [
|
||||
{file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"},
|
||||
{file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "docutils"
|
||||
version = "0.20.1"
|
||||
requires_python = ">=3.7"
|
||||
summary = "Docutils -- Python Documentation Utilities"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "docutils-0.20.1-py3-none-any.whl", hash = "sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6"},
|
||||
{file = "docutils-0.20.1.tar.gz", hash = "sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "easy-scpi"
|
||||
@ -20,6 +280,61 @@ files = [
|
||||
{file = "easy_scpi-0.1.4-py3-none-any.whl", hash = "sha256:c3204d1dd6d14089e76aa7f25c41ee46d72e7f6ed82cd05bddfdf9ed91a56aab"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "filelock"
|
||||
version = "3.13.1"
|
||||
requires_python = ">=3.8"
|
||||
summary = "A platform independent file lock."
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "filelock-3.13.1-py3-none-any.whl", hash = "sha256:57dbda9b35157b05fb3e58ee91448612eb674172fab98ee235ccb0b5bee19a1c"},
|
||||
{file = "filelock-3.13.1.tar.gz", hash = "sha256:521f5f56c50f8426f5e03ad3b281b490a87ef15bc6c526f168290f0c7148d44e"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "greenlet"
|
||||
version = "3.0.3"
|
||||
requires_python = ">=3.7"
|
||||
summary = "Lightweight in-process concurrent programming"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "greenlet-3.0.3-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:b1b5667cced97081bf57b8fa1d6bfca67814b0afd38208d52538316e9422fc61"},
|
||||
{file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:52f59dd9c96ad2fc0d5724107444f76eb20aaccb675bf825df6435acb7703559"},
|
||||
{file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:afaff6cf5200befd5cec055b07d1c0a5a06c040fe5ad148abcd11ba6ab9b114e"},
|
||||
{file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fe754d231288e1e64323cfad462fcee8f0288654c10bdf4f603a39ed923bef33"},
|
||||
{file = "greenlet-3.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2797aa5aedac23af156bbb5a6aa2cd3427ada2972c828244eb7d1b9255846379"},
|
||||
{file = "greenlet-3.0.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b7f009caad047246ed379e1c4dbcb8b020f0a390667ea74d2387be2998f58a22"},
|
||||
{file = "greenlet-3.0.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:c5e1536de2aad7bf62e27baf79225d0d64360d4168cf2e6becb91baf1ed074f3"},
|
||||
{file = "greenlet-3.0.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:894393ce10ceac937e56ec00bb71c4c2f8209ad516e96033e4b3b1de270e200d"},
|
||||
{file = "greenlet-3.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:1ea188d4f49089fc6fb283845ab18a2518d279c7cd9da1065d7a84e991748728"},
|
||||
{file = "greenlet-3.0.3.tar.gz", hash = "sha256:43374442353259554ce33599da8b692d5aa96f8976d567d4badf263371fbe491"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyperlink"
|
||||
version = "21.0.0"
|
||||
requires_python = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
|
||||
summary = "A featureful, immutable, and correct URL for Python."
|
||||
groups = ["dev"]
|
||||
dependencies = [
|
||||
"idna>=2.5",
|
||||
]
|
||||
files = [
|
||||
{file = "hyperlink-21.0.0-py2.py3-none-any.whl", hash = "sha256:e6b14c37ecb73e89c77d78cdb4c2cc8f3fb59a885c5b3f819ff4ed80f25af1b4"},
|
||||
{file = "hyperlink-21.0.0.tar.gz", hash = "sha256:427af957daa58bc909471c6c40f74c5450fa123dd093fc53efd2e91d2705a56b"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "3.6"
|
||||
requires_python = ">=3.5"
|
||||
summary = "Internationalized Domain Names in Applications (IDNA)"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "idna-3.6-py3-none-any.whl", hash = "sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f"},
|
||||
{file = "idna-3.6.tar.gz", hash = "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ifaddr"
|
||||
version = "0.2.0"
|
||||
@ -30,6 +345,105 @@ files = [
|
||||
{file = "ifaddr-0.2.0.tar.gz", hash = "sha256:cc0cbfcaabf765d44595825fb96a99bb12c79716b73b44330ea38ee2b0c4aed4"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "incremental"
|
||||
version = "22.10.0"
|
||||
summary = "\"A small library that versions your Python projects.\""
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "incremental-22.10.0-py2.py3-none-any.whl", hash = "sha256:b864a1f30885ee72c5ac2835a761b8fe8aa9c28b9395cacf27286602688d3e51"},
|
||||
{file = "incremental-22.10.0.tar.gz", hash = "sha256:912feeb5e0f7e0188e6f42241d2f450002e11bbc0937c65865045854c24c0bd0"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "isort"
|
||||
version = "5.13.2"
|
||||
requires_python = ">=3.8.0"
|
||||
summary = "A Python utility / library to sort Python imports."
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"},
|
||||
{file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jinxed"
|
||||
version = "1.2.1"
|
||||
summary = "Jinxed Terminal Library"
|
||||
groups = ["dev"]
|
||||
marker = "platform_system == \"Windows\""
|
||||
dependencies = [
|
||||
"ansicon; platform_system == \"Windows\"",
|
||||
]
|
||||
files = [
|
||||
{file = "jinxed-1.2.1-py2.py3-none-any.whl", hash = "sha256:37422659c4925969c66148c5e64979f553386a4226b9484d910d3094ced37d30"},
|
||||
{file = "jinxed-1.2.1.tar.gz", hash = "sha256:30c3f861b73279fea1ed928cfd4dfb1f273e16cd62c8a32acfac362da0f78f3f"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lunr"
|
||||
version = "0.6.2"
|
||||
requires_python = ">=3.6"
|
||||
summary = "A Python implementation of Lunr.js"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "lunr-0.6.2-py2.py3-none-any.whl", hash = "sha256:6fbf619e07ff97c6198f9cae0fc32d69a0d49fb0708c2559efbede45670cba06"},
|
||||
{file = "lunr-0.6.2.tar.gz", hash = "sha256:7983d965bd7baa78cbd4f5b934fc3ef3142c1b6089df6c6fecd66df5bff20921"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mccabe"
|
||||
version = "0.7.0"
|
||||
requires_python = ">=3.6"
|
||||
summary = "McCabe checker, plugin for flake8"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"},
|
||||
{file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "msgpack"
|
||||
version = "1.0.7"
|
||||
requires_python = ">=3.8"
|
||||
summary = "MessagePack serializer"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "msgpack-1.0.7-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:576eb384292b139821c41995523654ad82d1916da6a60cff129c715a6223ea84"},
|
||||
{file = "msgpack-1.0.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:730076207cb816138cf1af7f7237b208340a2c5e749707457d70705715c93b93"},
|
||||
{file = "msgpack-1.0.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:85765fdf4b27eb5086f05ac0491090fc76f4f2b28e09d9350c31aac25a5aaff8"},
|
||||
{file = "msgpack-1.0.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3476fae43db72bd11f29a5147ae2f3cb22e2f1a91d575ef130d2bf49afd21c46"},
|
||||
{file = "msgpack-1.0.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d4c80667de2e36970ebf74f42d1088cc9ee7ef5f4e8c35eee1b40eafd33ca5b"},
|
||||
{file = "msgpack-1.0.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5b0bf0effb196ed76b7ad883848143427a73c355ae8e569fa538365064188b8e"},
|
||||
{file = "msgpack-1.0.7-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:f9a7c509542db4eceed3dcf21ee5267ab565a83555c9b88a8109dcecc4709002"},
|
||||
{file = "msgpack-1.0.7-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:84b0daf226913133f899ea9b30618722d45feffa67e4fe867b0b5ae83a34060c"},
|
||||
{file = "msgpack-1.0.7-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:ec79ff6159dffcc30853b2ad612ed572af86c92b5168aa3fc01a67b0fa40665e"},
|
||||
{file = "msgpack-1.0.7-cp311-cp311-win32.whl", hash = "sha256:3e7bf4442b310ff154b7bb9d81eb2c016b7d597e364f97d72b1acc3817a0fdc1"},
|
||||
{file = "msgpack-1.0.7-cp311-cp311-win_amd64.whl", hash = "sha256:3f0c8c6dfa6605ab8ff0611995ee30d4f9fcff89966cf562733b4008a3d60d82"},
|
||||
{file = "msgpack-1.0.7.tar.gz", hash = "sha256:572efc93db7a4d27e404501975ca6d2d9775705c2d922390d878fcf768d92c87"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "numpy"
|
||||
version = "1.26.4"
|
||||
requires_python = ">=3.9"
|
||||
summary = "Fundamental package for array computing in Python"
|
||||
groups = ["default", "dev"]
|
||||
files = [
|
||||
{file = "numpy-1.26.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4c66707fabe114439db9068ee468c26bbdf909cac0fb58686a42a24de1760c71"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:edd8b5fe47dab091176d21bb6de568acdd906d1887a4584a15a9a96a1dca06ef"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ab55401287bfec946ced39700c053796e7cc0e3acbef09993a9ad2adba6ca6e"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:666dbfb6ec68962c033a450943ded891bed2d54e6755e35e5835d63f4f6931d5"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:96ff0b2ad353d8f990b63294c8986f1ec3cb19d749234014f4e7eb0112ceba5a"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:60dedbb91afcbfdc9bc0b1f3f402804070deed7392c23eb7a7f07fa857868e8a"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-win32.whl", hash = "sha256:1af303d6b2210eb850fcf03064d364652b7120803a0b872f5211f5234b399f20"},
|
||||
{file = "numpy-1.26.4-cp311-cp311-win_amd64.whl", hash = "sha256:cd25bcecc4974d09257ffcd1f098ee778f7834c3ad767fe5db785be9a4aa9cb2"},
|
||||
{file = "numpy-1.26.4-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:afedb719a9dcfc7eaf2287b839d8198e06dcd4cb5d276a3df279231138e83d30"},
|
||||
{file = "numpy-1.26.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95a7476c59002f2f6c590b9b7b998306fba6a5aa646b1e22ddfeaf8f78c3a29c"},
|
||||
{file = "numpy-1.26.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7e50d0a0cc3189f9cb0aeb3a6a6af18c16f59f004b866cd2be1c14b36134a4a0"},
|
||||
{file = "numpy-1.26.4.tar.gz", hash = "sha256:2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4912010"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pip"
|
||||
version = "23.2.1"
|
||||
@ -41,6 +455,17 @@ files = [
|
||||
{file = "pip-23.2.1.tar.gz", hash = "sha256:fb0bd5435b3200c602b5bf61d2d43c2f13c02e29c1707567ae7fbc514eb9faf2"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "platformdirs"
|
||||
version = "4.2.0"
|
||||
requires_python = ">=3.8"
|
||||
summary = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"."
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "platformdirs-4.2.0-py3-none-any.whl", hash = "sha256:0614df2a2f37e1a662acbd8e2b25b92ccf8632929bc6d43467e17fe89c75e068"},
|
||||
{file = "platformdirs-4.2.0.tar.gz", hash = "sha256:ef0cc731df711022c174543cb70a9b5bd22e5a9337c8624ef2c2ceb8ddad8768"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "psutil"
|
||||
version = "5.9.7"
|
||||
@ -57,6 +482,61 @@ files = [
|
||||
{file = "psutil-5.9.7.tar.gz", hash = "sha256:3f02134e82cfb5d089fddf20bb2e03fd5cd52395321d1c8458a9e58500ff417c"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pydoctor"
|
||||
version = "23.9.1"
|
||||
requires_python = ">=3.6"
|
||||
summary = "API doc generator."
|
||||
groups = ["dev"]
|
||||
dependencies = [
|
||||
"CacheControl[filecache]",
|
||||
"Twisted",
|
||||
"appdirs",
|
||||
"astor",
|
||||
"attrs",
|
||||
"configargparse",
|
||||
"docutils>=0.17",
|
||||
"lunr==0.6.2",
|
||||
"requests",
|
||||
"toml",
|
||||
"urllib3<2",
|
||||
]
|
||||
files = [
|
||||
{file = "pydoctor-23.9.1-py3-none-any.whl", hash = "sha256:341cafb7847e3ad17237b725f2c4a04b0b824f154910c3b5cce6aa4a881056db"},
|
||||
{file = "pydoctor-23.9.1.tar.gz", hash = "sha256:e5b7758a51889afdfc101996f7871dc7afb5d3dd7bbcaab895bfe54cdf4f2f17"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pygments"
|
||||
version = "2.17.2"
|
||||
requires_python = ">=3.7"
|
||||
summary = "Pygments is a syntax highlighting package written in Python."
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "pygments-2.17.2-py3-none-any.whl", hash = "sha256:b27c2826c47d0f3219f29554824c30c5e8945175d888647acd804ddd04af846c"},
|
||||
{file = "pygments-2.17.2.tar.gz", hash = "sha256:da46cec9fd2de5be3a8a784f434e4c4ab670b4ff54d605c4c2717e9d49c4c367"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pylint"
|
||||
version = "3.0.3"
|
||||
requires_python = ">=3.8.0"
|
||||
summary = "python code static checker"
|
||||
groups = ["dev"]
|
||||
dependencies = [
|
||||
"astroid<=3.1.0-dev0,>=3.0.1",
|
||||
"colorama>=0.4.5; sys_platform == \"win32\"",
|
||||
"dill>=0.3.6; python_version >= \"3.11\"",
|
||||
"isort!=5.13.0,<6,>=4.2.5",
|
||||
"mccabe<0.8,>=0.6",
|
||||
"platformdirs>=2.2.0",
|
||||
"tomlkit>=0.10.1",
|
||||
]
|
||||
files = [
|
||||
{file = "pylint-3.0.3-py3-none-any.whl", hash = "sha256:7a1585285aefc5165db81083c3e06363a27448f6b467b3b0f30dbd0ac1f73810"},
|
||||
{file = "pylint-3.0.3.tar.gz", hash = "sha256:58c2398b0301e049609a8429789ec6edf3aabe9b6c5fec916acd18639c16de8b"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyvisa"
|
||||
version = "1.14.1"
|
||||
@ -86,65 +566,161 @@ files = [
|
||||
{file = "PyVISA_py-0.7.1-py3-none-any.whl", hash = "sha256:3675aa9fcabfcee6fbcc1e596f565c2538ecd0f69e7061f479d147b4afbd8c75"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pyxdg"
|
||||
version = "0.28"
|
||||
summary = "PyXDG contains implementations of freedesktop.org standards in python."
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "pyxdg-0.28-py2.py3-none-any.whl", hash = "sha256:bdaf595999a0178ecea4052b7f4195569c1ff4d344567bccdc12dfdf02d545ab"},
|
||||
{file = "pyxdg-0.28.tar.gz", hash = "sha256:3267bb3074e934df202af2ee0868575484108581e6f3cb006af1da35395e88b4"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "requests"
|
||||
version = "2.31.0"
|
||||
requires_python = ">=3.7"
|
||||
summary = "Python HTTP for Humans."
|
||||
groups = ["dev"]
|
||||
dependencies = [
|
||||
"certifi>=2017.4.17",
|
||||
"charset-normalizer<4,>=2",
|
||||
"idna<4,>=2.5",
|
||||
"urllib3<3,>=1.21.1",
|
||||
]
|
||||
files = [
|
||||
{file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"},
|
||||
{file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "setuptools"
|
||||
version = "65.5.0"
|
||||
requires_python = ">=3.7"
|
||||
summary = "Easily download, build, install, upgrade, and uninstall Python packages"
|
||||
groups = ["default"]
|
||||
groups = ["default", "dev"]
|
||||
files = [
|
||||
{file = "setuptools-65.5.0-py3-none-any.whl", hash = "sha256:f62ea9da9ed6289bfe868cd6845968a2c854d1427f8548d52cae02a42b4f0356"},
|
||||
{file = "setuptools-65.5.0.tar.gz", hash = "sha256:512e5536220e38146176efb833d4a62aa726b7bbff82cfbc8ba9eaa3996e0b17"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "six"
|
||||
version = "1.16.0"
|
||||
requires_python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
|
||||
summary = "Python 2 and 3 compatibility utilities"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
|
||||
{file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml"
|
||||
version = "0.10.2"
|
||||
requires_python = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
|
||||
summary = "Python Library for Tom's Obvious, Minimal Language"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"},
|
||||
{file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tomlkit"
|
||||
version = "0.12.3"
|
||||
requires_python = ">=3.7"
|
||||
summary = "Style preserving TOML library"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "tomlkit-0.12.3-py3-none-any.whl", hash = "sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba"},
|
||||
{file = "tomlkit-0.12.3.tar.gz", hash = "sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "twisted"
|
||||
version = "23.10.0"
|
||||
requires_python = ">=3.8.0"
|
||||
summary = "An asynchronous networking framework written in Python"
|
||||
groups = ["dev"]
|
||||
dependencies = [
|
||||
"attrs>=21.3.0",
|
||||
"automat>=0.8.0",
|
||||
"constantly>=15.1",
|
||||
"hyperlink>=17.1.1",
|
||||
"incremental>=22.10.0",
|
||||
"twisted-iocpsupport<2,>=1.0.2; platform_system == \"Windows\"",
|
||||
"typing-extensions>=4.2.0",
|
||||
"zope-interface>=5",
|
||||
]
|
||||
files = [
|
||||
{file = "twisted-23.10.0-py3-none-any.whl", hash = "sha256:4ae8bce12999a35f7fe6443e7f1893e6fe09588c8d2bed9c35cdce8ff2d5b444"},
|
||||
{file = "twisted-23.10.0.tar.gz", hash = "sha256:987847a0790a2c597197613686e2784fd54167df3a55d0fb17c8412305d76ce5"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "twisted-iocpsupport"
|
||||
version = "1.0.4"
|
||||
summary = "An extension for use in the twisted I/O Completion Ports reactor."
|
||||
groups = ["dev"]
|
||||
marker = "platform_system == \"Windows\""
|
||||
files = [
|
||||
{file = "twisted-iocpsupport-1.0.4.tar.gz", hash = "sha256:858096c0d15e33f15ac157f455d8f86f2f2cdd223963e58c0f682a3af8362d89"},
|
||||
{file = "twisted_iocpsupport-1.0.4-cp311-cp311-win32.whl", hash = "sha256:196f7c7ccad4ba4d1783b1c4e1d1b22d93c04275cd780bf7498d16c77319ad6e"},
|
||||
{file = "twisted_iocpsupport-1.0.4-cp311-cp311-win_amd64.whl", hash = "sha256:4e5f97bcbabdd79cbaa969b63439b89801ea560f11d42b0a387634275c633623"},
|
||||
{file = "twisted_iocpsupport-1.0.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:872747a3b64e2909aee59c803ccd0bceb9b75bf27915520ebd32d69687040fa2"},
|
||||
{file = "twisted_iocpsupport-1.0.4-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:c2712b778bacf1db434e3e065adfed3db300754186a29aecac1efae9ef4bcaff"},
|
||||
{file = "twisted_iocpsupport-1.0.4-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:7c66fa0aa4236b27b3c61cb488662d85dae746a6d1c7b0d91cf7aae118445adf"},
|
||||
{file = "twisted_iocpsupport-1.0.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:300437af17396a945a58dcfffd77863303a8b6d9e65c6e81f1d2eed55b50d444"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
version = "4.9.0"
|
||||
requires_python = ">=3.8"
|
||||
summary = "Backported and Experimental Type Hints for Python 3.8+"
|
||||
groups = ["default"]
|
||||
groups = ["default", "dev"]
|
||||
files = [
|
||||
{file = "typing_extensions-4.9.0-py3-none-any.whl", hash = "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd"},
|
||||
{file = "typing_extensions-4.9.0.tar.gz", hash = "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zeroconf"
|
||||
version = "0.131.0"
|
||||
requires_python = ">=3.7,<4.0"
|
||||
summary = "A pure python implementation of multicast DNS service discovery"
|
||||
groups = ["default"]
|
||||
name = "urllib3"
|
||||
version = "1.26.18"
|
||||
requires_python = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*"
|
||||
summary = "HTTP library with thread-safe connection pooling, file post, and more."
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "urllib3-1.26.18-py2.py3-none-any.whl", hash = "sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07"},
|
||||
{file = "urllib3-1.26.18.tar.gz", hash = "sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wcwidth"
|
||||
version = "0.2.13"
|
||||
summary = "Measures the displayed width of unicode strings in a terminal"
|
||||
groups = ["dev"]
|
||||
files = [
|
||||
{file = "wcwidth-0.2.13-py2.py3-none-any.whl", hash = "sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859"},
|
||||
{file = "wcwidth-0.2.13.tar.gz", hash = "sha256:72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zope-interface"
|
||||
version = "6.1"
|
||||
requires_python = ">=3.7"
|
||||
summary = "Interfaces for Python"
|
||||
groups = ["dev"]
|
||||
dependencies = [
|
||||
"ifaddr>=0.1.7",
|
||||
"setuptools",
|
||||
]
|
||||
files = [
|
||||
{file = "zeroconf-0.131.0-cp311-cp311-macosx_11_0_x86_64.whl", hash = "sha256:6a041468c428622798193f0006831237aa749ee23e26b5b79e457618484457ef"},
|
||||
{file = "zeroconf-0.131.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9a7f3b9a580af6bf74a7c435b80925dfeb065c987dffaf4d957d578366a80b2c"},
|
||||
{file = "zeroconf-0.131.0-cp311-cp311-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:cc7a76103b03f47d2aa02206f74cc8b2120f4bac02936ccee5d6f29290f5bde5"},
|
||||
{file = "zeroconf-0.131.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d777b177cb472f7996b9d696b81337bfb846dbe454b8a34a8e33704d3a435b0"},
|
||||
{file = "zeroconf-0.131.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:b843d5e2d2e576efeab59e382907bca1302f20eb33ee1a0a485e90d017b1088a"},
|
||||
{file = "zeroconf-0.131.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:08eb87b0500ddc7c148fe3db3913e9d07d5495d756d7d75683f2dee8d7a09dc5"},
|
||||
{file = "zeroconf-0.131.0-cp311-cp311-win32.whl", hash = "sha256:3b167b9e47f3fec8cc28a8f73a9e47c563ceb6681c16dcbe2c7d41e084cee755"},
|
||||
{file = "zeroconf-0.131.0-cp311-cp311-win_amd64.whl", hash = "sha256:f74149a22a6a27e4c039f6477188dcbcb910acd60529dab5c114ff6265d40ba7"},
|
||||
{file = "zeroconf-0.131.0-cp312-cp312-macosx_11_0_x86_64.whl", hash = "sha256:4865ef65b7eb7eee1a38c05bf7e91dd8182ef2afb1add65440f99e8dd43836d2"},
|
||||
{file = "zeroconf-0.131.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:38bfd08c9191716d65e6ac52741442ee918bfe2db43993aa4d3b365966c0ab48"},
|
||||
{file = "zeroconf-0.131.0-cp312-cp312-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:2389e3a61e99bf74796da7ebc3001b90ecd4e6286f392892b1211748e5b19853"},
|
||||
{file = "zeroconf-0.131.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:194cf1465a756c3090e23ef2a5bd3341caa8d36eef486054daa8e532a4e24ac8"},
|
||||
{file = "zeroconf-0.131.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:2907784c8c88795bf1b74cc9b6a4051e37a519ae2caaa7307787d466bc57884c"},
|
||||
{file = "zeroconf-0.131.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:ce67d8dab4d88bcd1e5975d08235590fc5b9f31b2e2b7993ee1680810e67e56d"},
|
||||
{file = "zeroconf-0.131.0-cp312-cp312-win32.whl", hash = "sha256:9dfa3d8827efffebec61b108162eeb76b0fe170a8379f9838be441f61b4557fd"},
|
||||
{file = "zeroconf-0.131.0-cp312-cp312-win_amd64.whl", hash = "sha256:8642d374481d8cc7be9e364b82bcd11bda4a095c24c5f9f5754017a118496b77"},
|
||||
{file = "zeroconf-0.131.0-pp310-pypy310_pp73-macosx_11_0_x86_64.whl", hash = "sha256:d4baa0450b9b0f1bd8acc25c2970d4e49e54726cbc437b81ffb65e5ffb6bd321"},
|
||||
{file = "zeroconf-0.131.0-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:3768ab13a8d7f0df85e40e766edd9e2aef28710a350dc4b15e1f2c5dd1326f00"},
|
||||
{file = "zeroconf-0.131.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c10158396d6875f790bfb5600391d44edcbf52ac4d148e19baab3e8bb7825f76"},
|
||||
{file = "zeroconf-0.131.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:28d906fc0779badb2183f5b20dbcc7e508cce53a13e63ba4d9477381c9f77463"},
|
||||
{file = "zeroconf-0.131.0-pp38-pypy38_pp73-macosx_11_0_x86_64.whl", hash = "sha256:7c4235f45defd43bb2402ff8d3c7ff5d740e671bfd926852541c282ebef992bc"},
|
||||
{file = "zeroconf-0.131.0-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:d08170123f5c04480bd7a82122b46c5afdb91553a9cef7d686d3fb9c369a9204"},
|
||||
{file = "zeroconf-0.131.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1a57e0c4a94276ec690d2ecf1edeea158aaa3a7f38721af6fa572776dda6c8ad"},
|
||||
{file = "zeroconf-0.131.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:0251034ed1d57eeb4e08782b22cc51e2455da7552b592bfad69a5761e69241c7"},
|
||||
{file = "zeroconf-0.131.0-pp39-pypy39_pp73-macosx_11_0_x86_64.whl", hash = "sha256:34c3379d899361cd9d6b573ea9ac1eba53e2306eb28f94353b58c4703f0e74ae"},
|
||||
{file = "zeroconf-0.131.0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux_2_5_i686.manylinux1_i686.manylinux2014_i686.whl", hash = "sha256:d5d92987c3669edbfa9f911a8ef1c46cfd2c3e51971fc80c215f99212b81d4b1"},
|
||||
{file = "zeroconf-0.131.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a613827f97ca49e2b4b6d6eb7e61a0485afe23447978a60f42b981a45c2b25fd"},
|
||||
{file = "zeroconf-0.131.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:24b0a46c5f697cd6a0b27678ea65a3222b95f1804be6b38c6f5f1a7ce8b5cded"},
|
||||
{file = "zeroconf-0.131.0.tar.gz", hash = "sha256:90c431e99192a044a5e0217afd7ca0ca9824af93190332e6f7baf4da5375f331"},
|
||||
{file = "zope.interface-6.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:9ffdaa5290422ac0f1688cb8adb1b94ca56cee3ad11f29f2ae301df8aecba7d1"},
|
||||
{file = "zope.interface-6.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:34c15ca9248f2e095ef2e93af2d633358c5f048c49fbfddf5fdfc47d5e263736"},
|
||||
{file = "zope.interface-6.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b012d023b4fb59183909b45d7f97fb493ef7a46d2838a5e716e3155081894605"},
|
||||
{file = "zope.interface-6.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:97806e9ca3651588c1baaebb8d0c5ee3db95430b612db354c199b57378312ee8"},
|
||||
{file = "zope.interface-6.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fddbab55a2473f1d3b8833ec6b7ac31e8211b0aa608df5ab09ce07f3727326de"},
|
||||
{file = "zope.interface-6.1-cp311-cp311-win_amd64.whl", hash = "sha256:a0da79117952a9a41253696ed3e8b560a425197d4e41634a23b1507efe3273f1"},
|
||||
{file = "zope.interface-6.1.tar.gz", hash = "sha256:2fdc7ccbd6eb6b7df5353012fbed6c3c5d04ceaca0038f75e601060e95345309"},
|
||||
]
|
||||
|
@ -12,6 +12,8 @@ dependencies = [
|
||||
"PyVISA==1.14.1",
|
||||
"PyVISA-py==0.7.1",
|
||||
"setuptools==65.5.0",
|
||||
"numpy>=1.26.3",
|
||||
"fn-gen @ file:///${PROJECT_ROOT}/dist/fn_gen-0.0.2-py3-none-any.whl",
|
||||
]
|
||||
authors = [
|
||||
{name = "Ali Nwegy", email = "ali.el-nwegy@tuhh.de"},
|
||||
@ -22,4 +24,29 @@ license = {text = "MIT"}
|
||||
distribution = true
|
||||
|
||||
[tool.pdm.scripts]
|
||||
edit = {shell = "$VISUAL src/"}
|
||||
edit = {shell = "$VISUAL src/fn_gen"}
|
||||
uml = {shell = "pyreverse -o html -S --colorized -d uml src/fn_gen"}
|
||||
doc = {shell = "pydoctor"}
|
||||
sine = "examples/sine_signal.py"
|
||||
square = "examples/square_signal.py"
|
||||
ramp = "examples/ramp_signal.py"
|
||||
discrete_sweep = "examples/discrete_sweep.py"
|
||||
dc_signal = "examples/dc_signal.py"
|
||||
stop_channel = "examples/stop_channels.py"
|
||||
whoami = "examples/whoami.py"
|
||||
|
||||
|
||||
[tool.pydoctor]
|
||||
add-package = ["src/fn_gen"]
|
||||
docformat = "numpy"
|
||||
html-output = "docs"
|
||||
intersphinx = ["https://docs.python.org/3/objects.inv", "docs/pyvisa/objects.inv"]
|
||||
|
||||
|
||||
[tool.pdm.dev-dependencies]
|
||||
dev = [
|
||||
"bpython>=0.24",
|
||||
"pylint>=3.0.3",
|
||||
"pydoctor>=23.9.1",
|
||||
"numpy>=1.26.4",
|
||||
]
|
||||
|
@ -1,8 +1,24 @@
|
||||
-e file:///home/an/Documents/Git/tuhh_gitlab/rigol-dg2052-python-library#egg=fn-gen
|
||||
blessed==1.20.0
|
||||
bpython==0.24
|
||||
certifi==2024.2.2
|
||||
charset-normalizer==3.3.2
|
||||
click==8.1.7
|
||||
curtsies==0.4.2
|
||||
cwcwidth==0.1.9
|
||||
easy-scpi==0.1.4
|
||||
greenlet==3.0.3
|
||||
idna==3.6
|
||||
ifaddr==0.2.0
|
||||
pip==23.2.1
|
||||
psutil==5.9.7
|
||||
PyVISA==1.14.1
|
||||
Pygments==2.17.2
|
||||
PyVISA-py==0.7.1
|
||||
PyVISA==1.14.1
|
||||
pyxdg==0.28
|
||||
requests==2.31.0
|
||||
setuptools==65.5.0
|
||||
typing_extensions==4.9.0
|
||||
zeroconf==0.131.0
|
||||
six==1.16.0
|
||||
typing-extensions==4.9.0
|
||||
urllib3==2.2.0
|
||||
wcwidth==0.2.13
|
||||
|
@ -1,3 +0,0 @@
|
||||
from .dg2052 import DG2052
|
||||
from .enums import *
|
||||
from .errors import *
|
@ -1,5 +0,0 @@
|
||||
from .errors import ValueOutOfBoundsError
|
||||
|
||||
def check_bounds(bounds: tuple[float, float] | tuple[int, int], value: float | int):
|
||||
if value < bounds[0] or value > bounds[1]:
|
||||
raise ValueOutOfBoundsError(bounds, value)
|
303
src/dg2052.py
303
src/dg2052.py
@ -1,303 +0,0 @@
|
||||
### PLEASE DO NOT MIND THE FORMATTING, IT IS DONE AUTOMATICALLY BY 'BLACK' THE PYTHON FORMATTER
|
||||
import logging
|
||||
from typing import Literal
|
||||
import pyvisa
|
||||
from .common import check_bounds
|
||||
from .constants.dg2052 import (SIN_RANGE, SQU_RANGE, RAMP_RANGE)
|
||||
from .enums import CommMethod, SweepSpacing, SweepTriggerSlope, SweepTriggerSource, SweepSignalType
|
||||
from .errors import UndefinedValueError, UndefinedCommunicationMethodError, ValueOutOfBoundsError
|
||||
|
||||
|
||||
class DG2052(pyvisa.resources.MessageBasedResource):
|
||||
"""
|
||||
This is an object representing the Rigol DG2052 function generator. This object uses the SCPI protocol for communicating with the Rigol DG2052 function generator.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
port : str
|
||||
The SCPI port describing the device, consists of a communication method and device port followed by the "::INSTR" keyword.
|
||||
communication method: can be either USB or TCPIP (other communication methods are not supported for this device)
|
||||
device port: either COMM4 or /dev/USB0 for USB in windows and posix systems respectively or the IP Address for TCPIP
|
||||
format: "<communication method>::<device port>::INSTR"
|
||||
example: "TCPI::192.168.1.11::INSTR" or "USB::COMM4::INSTR"
|
||||
|
||||
Returns
|
||||
-------
|
||||
DG2052(pyvisa.resources.MessageBasedResource)
|
||||
The object representing the instrument
|
||||
|
||||
Raises
|
||||
------
|
||||
UndefinedCommunicationMethodError
|
||||
when the communication method is not a USB or TCPIP in the port string
|
||||
"""
|
||||
|
||||
comm: CommMethod # The communication method used (either TCPIP or USB)
|
||||
rm: pyvisa.ResourceManager # The resource manager object for pyvisa (for future use)
|
||||
port: str # The str used for the port
|
||||
|
||||
def __init__(self, port: str): # Class initialization method
|
||||
if "TCPIP" in port: # Check if port starts with TCPIP
|
||||
logging.debug("(PROG) detected TCPIP port")
|
||||
self.comm = CommMethod.LAN # Set comm to LAN
|
||||
elif "USB" in port: # Check if port starts with USB
|
||||
logging.debug("(PROG) detected USB port")
|
||||
self.comm = CommMethod.USB # Set comm to USB
|
||||
else: # Rause Undefined Communication Method Error
|
||||
raise UndefinedCommunicationMethodError(port)
|
||||
rm = pyvisa.ResourceManager() # Create a pyvisa.ResourceManager object
|
||||
self.rm = rm # Save that object as rm
|
||||
self.port = port # Save the port string as port
|
||||
super().__init__(rm, port) # create tne instrument object
|
||||
logging.debug("(PROG) created dg2052 instance")
|
||||
self.open() # connect to the instrument object (for ease of use)
|
||||
logging.debug("(PROG) connected to dg2052 device")
|
||||
|
||||
def whoami(self) -> str:
|
||||
"""
|
||||
shows the identification of the connected instrument
|
||||
|
||||
Returns
|
||||
-------
|
||||
str
|
||||
The identification of the connected instrument
|
||||
"""
|
||||
match (
|
||||
self.comm
|
||||
): # Return an Identification string depending on the communication method
|
||||
# Here a match case is used to make it easy to extend the communication methods to other methods
|
||||
case CommMethod.LAN: # if the communication method is LAN
|
||||
logging.debug("(PROG) communication method: LAN")
|
||||
(
|
||||
manufacturer,
|
||||
model,
|
||||
serial,
|
||||
software_ver,
|
||||
) = tuple( # Acquire the data for the manufacturer, model, serial and software version from the '*IDN?' SCPI query
|
||||
self.query("*IDN?").strip().split(",")
|
||||
)
|
||||
ipaddr = self.query(
|
||||
":SYST:COMM:LAN:IPAD?"
|
||||
).strip() # Get the IPAddress of the device
|
||||
mac = self.query(
|
||||
":SYST:COMM:LAN:MAC?"
|
||||
).strip() # Get the MAC address of the device
|
||||
out = (
|
||||
f"{manufacturer} {model}:\n\tSerial Nr.:"
|
||||
+ f" {serial}\n\tSoftware Ver.:"
|
||||
+ f" {software_ver}\n\tPort:"
|
||||
+ f" {self.port}\n\tIPADDRESS: {ipaddr}\n\tMAC: {mac}"
|
||||
)
|
||||
return out # return the formatted string
|
||||
case CommMethod.USB: # if the communication method is USB
|
||||
logging.debug("(PROG) communication method USB")
|
||||
(
|
||||
manufacturer,
|
||||
model,
|
||||
serial,
|
||||
software_ver,
|
||||
) = tuple( # Acquire the data for the manufacturer, model, serial and software version from the '*IDN?' SCPI query
|
||||
self.query("*IDN?").strip().split(",")
|
||||
)
|
||||
# info = self.system.communicate.usb.information().strip()
|
||||
info = self.query(
|
||||
":SYST:COMM:USB:INF?"
|
||||
).strip() # Get the USB info of the device
|
||||
out = (
|
||||
f"{manufacturer} {model}:\n\tSerial Nr.:"
|
||||
+ f" {serial}\n\tSoftware Ver.:"
|
||||
+ f" {software_ver}\n\tPort:"
|
||||
+ f" {self.port}\n\tINFORMATION: {info}"
|
||||
)
|
||||
return out # return the formatted string
|
||||
case _: # default case raise Undefined Communication Method Error
|
||||
raise UndefinedCommunicationMethodError(self.port)
|
||||
|
||||
def set_output(self, channel: Literal[1, 2], state: bool):
|
||||
"""
|
||||
Sets the output channel ON or OFF
|
||||
|
||||
Parameters
|
||||
----------
|
||||
channel : OutpuChannel
|
||||
The output channel of the device (either OutputChannel.ONE or OutputChannel.TWO)
|
||||
|
||||
state : bool
|
||||
The state of the output channel
|
||||
"""
|
||||
if state:
|
||||
logging.debug(f"(PROG) :OUTP{channel} ON")
|
||||
self.write(f":OUTP{channel} ON")
|
||||
else:
|
||||
logging.debug(f"(PROG) :OUTP{channel} OFF")
|
||||
self.write(f":OUTP{channel} OFF")
|
||||
|
||||
def toggle_output(self, channel: Literal[1, 2]):
|
||||
state = self.query(f":OUT{channel}?").strip()
|
||||
logging.debug(f"(PROG) output {channel} state: {state}")
|
||||
match (state):
|
||||
case "ON":
|
||||
self.set_output(channel, False)
|
||||
case "OFF":
|
||||
self.set_output(channel, True)
|
||||
case _:
|
||||
raise UndefinedValueError(state, "ON or OFF")
|
||||
|
||||
def get_output_volt_limits(self, channel: Literal[1, 2]) -> tuple[float, float]:
|
||||
low: float = float(self.query(f":OUTP{channel}:VOLL:LOW?"))
|
||||
high: float = float(self.query(f":OUTP{channel}:VOLL:HIGH?"))
|
||||
logging.debug(f"(PROG) output {channel} limits: {low}, {high}")
|
||||
return low, high
|
||||
|
||||
def get_output_impedance(self, channel: Literal[1, 2]) -> float:
|
||||
impedance = float(self.query(f":OUTP{channel}:IMP?"))
|
||||
logging.debug(f"(PROG) output {channel} impedance: {impedance}")
|
||||
return impedance
|
||||
|
||||
def get_output_load(self, channel: Literal[1, 2]) -> float:
|
||||
load = float(self.query(f":OUTP{channel}:LOAD?"))
|
||||
logging.debug(f"(PROG) output {channel} load: {load}")
|
||||
return load
|
||||
|
||||
def get_output_signal(self, channel: Literal[1, 2]) -> str:
|
||||
signal = self.query(f":SOUR{channel}:APPL?").strip()
|
||||
logging.debug(f"(PROG) output {channel} signal: {signal}")
|
||||
return signal
|
||||
|
||||
def get_output_state(self, channel: Literal[1, 2]) -> str:
|
||||
state = self.query(f":OUTP{channel}?").strip()
|
||||
logging.debug(f"(PROG) output {channel} state: {state}")
|
||||
return state
|
||||
|
||||
def is_output_on(self, channel: Literal[1, 2]) -> bool:
|
||||
channel_state = self.get_output_state(channel)
|
||||
match channel_state:
|
||||
case "ON":
|
||||
return True
|
||||
case "OFF":
|
||||
return False
|
||||
case _:
|
||||
raise UndefinedValueError(channel_state, "ON or OFF")
|
||||
|
||||
def set_dc(self, channel: Literal[1, 2], offset: float):
|
||||
logging.debug(f"(PROG) set dc signal with offset: {offset}")
|
||||
self.write(f":SOUR{channel}:APPL:DC 1,1,{offset}")
|
||||
|
||||
def set_sine_wave(
|
||||
self,
|
||||
channel: Literal[1, 2],
|
||||
freq: float = 1e3,
|
||||
amp: float = 5.0,
|
||||
offset: float = 0.0,
|
||||
phase: int = 0,
|
||||
):
|
||||
if freq < SIN_RANGE[0] and freq > SIN_RANGE[1]:
|
||||
raise ValueOutOfBoundsError(SIN_RANGE, freq)
|
||||
if phase < 0 and phase > 360:
|
||||
raise ValueOutOfBoundsError((0, 360), phase)
|
||||
logging.debug(
|
||||
f"(PROG) set sine signal with freq: {freq}, amp: {amp}, offset: {offset}, phase: {phase}"
|
||||
)
|
||||
self.write(f":SOUR{channel}:APPL:SIN {freq},{amp},{offset},{phase}")
|
||||
|
||||
def set_square_wave(
|
||||
self,
|
||||
channel: Literal[1, 2], # Sets the output channel of the ramp function
|
||||
freq: float = 1e3, # Sets the frequency
|
||||
amp: float = 5.0, # Sets the amplitude
|
||||
offset: float = 0.0, # Sets the amplitude offset
|
||||
phase: int = 0, # Sets the phase shift
|
||||
):
|
||||
check_bounds(SQU_RANGE, freq)
|
||||
check_bounds((0, 360), phase)
|
||||
logging.debug(
|
||||
f"(PROG) set square signal with freq: {freq}, amp: {amp}, offset: {offset}, phase: {phase}"
|
||||
)
|
||||
self.write(f":SOUR{channel}:APPL:SQU {freq},{amp},{offset},{phase}")
|
||||
|
||||
def set_ramp(
|
||||
self,
|
||||
channel: Literal[1, 2], # Sets the output channel of the ramp function
|
||||
freq: float = 1e3, # Sets the frequency
|
||||
amp: float = 5, # Sets the amplitude
|
||||
offset: float = 0, # Sets the amplitude offset
|
||||
phase: int = 0, # Sets the phase shift
|
||||
):
|
||||
check_bounds(RAMP_RANGE, freq)
|
||||
check_bounds((0, 360), phase)
|
||||
logging.debug(
|
||||
f"(PROG) set ramp signal with freq: {freq}, amp: {amp}, offset: {offset}, phase: {phase}"
|
||||
)
|
||||
self.write(f":SOUR{channel}:APPL:RAMP {freq},{amp},{offset},{phase}")
|
||||
|
||||
def set_sweep(
|
||||
self,
|
||||
channel: Literal[1, 2], # Sets the output channel of the sweep function
|
||||
amp: float = 5, # Sets the amplitude of the sweeped signal
|
||||
offset: float = 0, # Sets the offset voltage of the sweeped signal
|
||||
phase: int = 0, # Sets the phase shift of the sweeped signal
|
||||
signal_type: SweepSignalType = SweepSignalType.SINE, # Sets the type of signal being sweeped
|
||||
htime_start: float = 0, # Sets the start hold time of the sweep function
|
||||
htime_stop: float = 0, # Sets the stop hold time of the sweep function
|
||||
freq_start: float = 100, # Sets the sweep starting frequency
|
||||
freq_stop: float = 1e3, # Sets the sweep stopping frequency
|
||||
marker: bool = False, # Enables/Disables setting the marker frequency manually
|
||||
freq_marker: float = 550, # Sets the marker frequency at whic the Sync signal changes from high to low
|
||||
rtime: float = 0, # Sets the return time of the sweep function
|
||||
time: float = 1, # Sets the sweep time
|
||||
spacing: SweepSpacing = SweepSpacing.LIN, # Sets the sweep type
|
||||
step: int = 2, # Sets the number of steps of the sweep function
|
||||
trigger_slope: SweepTriggerSlope = SweepTriggerSlope.POSITIVE, # Sets the edge type of the trigger input signal (for external trigger only)
|
||||
trigger_source: SweepTriggerSource = SweepTriggerSource.INTERNAL, # Sets the sweep trigger source
|
||||
):
|
||||
time_bounds: tuple[float, float] = (0, 500)
|
||||
command_header = f":SOUR{channel}:SWE"
|
||||
check_bounds(time_bounds, htime_start)
|
||||
check_bounds(time_bounds, htime_stop)
|
||||
check_bounds(time_bounds, rtime)
|
||||
check_bounds((2, 1024), step)
|
||||
check_bounds((1e-3, 599.0), time)
|
||||
match signal_type:
|
||||
case SweepSignalType.SINE:
|
||||
self.set_sine_wave(channel, amp=amp, offset=offset, phase=phase)
|
||||
case SweepSignalType.SQUARE:
|
||||
self.set_square_wave(channel, amp=amp, offset=offset, phase=phase)
|
||||
case SweepSignalType.RAMP:
|
||||
self.set_ramp(channel, amp=amp, offset=offset, phase=phase)
|
||||
self.write(f":SOUR:FREQ:STAR {freq_start}")
|
||||
self.write(f":SOUR:FREQ:STOP {freq_stop}")
|
||||
if marker:
|
||||
self.write(":SOUR:MARK ON")
|
||||
self.write(f":SOUR:MARK:FREQ {freq_marker}")
|
||||
else:
|
||||
self.write(":SOUR:MARK OFF")
|
||||
self.write(f"{command_header}:SPAC {spacing}")
|
||||
self.write(f"{command_header}:STEP {step}")
|
||||
match trigger_source:
|
||||
case SweepTriggerSource.INTERNAL:
|
||||
self.write(f"{command_header}:TRIG:SOUR INT")
|
||||
self.write(f"{command_header}:HTIM:STAR {htime_start}")
|
||||
self.write(f"{command_header}:HTIM {htime_stop}")
|
||||
self.write(f"{command_header}:RTIM {rtime}")
|
||||
self.write(f"{command_header}:TIME {time}")
|
||||
case SweepTriggerSource.EXTERNAL:
|
||||
self.write(f"{command_header}:TRIG:SOUR EXT")
|
||||
if trigger_slope == SweepTriggerSlope.POSITIVE:
|
||||
self.write(f"{command_header}:TRIG:SLOP POS")
|
||||
elif trigger_slope == SweepTriggerSlope.NEGATIVE:
|
||||
self.write(f"{command_header}:TRIG:SLOP NEG")
|
||||
else:
|
||||
UndefinedValueError(
|
||||
trigger_slope,
|
||||
"SweepTriggerSlope.Positive or SweepTriggerSlope.Negative",
|
||||
)
|
||||
case SweepTriggerSource.MANUAL:
|
||||
self.write(f"{command_header}:TRIG:SOUR MAN")
|
||||
case _:
|
||||
UndefinedValueError(
|
||||
trigger_source, "SweepTriggerSource.[INTERNAL | EXTERNAL | MANUAL]"
|
||||
)
|
||||
self.write(f"{command_header}:STAT ON")
|
||||
|
||||
def trigger_sweep(self, channel: Literal[1, 2]):
|
||||
self.write(f":SOUR{channel}:SWE:TRIG:IMM")
|
@ -1,6 +0,0 @@
|
||||
from .comm_method import CommMethod
|
||||
from .output_channel import OutputChannel
|
||||
from .sweep_spacing import SweepSpacing
|
||||
from .sweep_trigger_slope import SweepTriggerSlope
|
||||
from .sweep_trigger_source import SweepTriggerSource
|
||||
from .sweep_signal_type import SweepSignalType
|
@ -1,5 +0,0 @@
|
||||
from enum import Enum
|
||||
|
||||
class CommMethod(Enum):
|
||||
USB = 0
|
||||
LAN = 1
|
@ -1,5 +0,0 @@
|
||||
from enum import Enum
|
||||
|
||||
class OutputChannel(Enum):
|
||||
ONE = 1
|
||||
TWO = 2
|
@ -1,6 +0,0 @@
|
||||
from enum import Enum
|
||||
|
||||
class SweepSignalType(Enum):
|
||||
SINE = 1
|
||||
SQUARE = 2
|
||||
RAMP = 3
|
@ -1,6 +0,0 @@
|
||||
from enum import Enum
|
||||
|
||||
class SweepSpacing(Enum):
|
||||
LIN = 1
|
||||
LOG = 2
|
||||
STEP = 3
|
@ -1,5 +0,0 @@
|
||||
from enum import Enum
|
||||
|
||||
class SweepTriggerSlope(Enum):
|
||||
POSITIVE = 1
|
||||
NEGATIVE = 2
|
@ -1,6 +0,0 @@
|
||||
from enum import Enum
|
||||
|
||||
class SweepTriggerSource(Enum):
|
||||
INTERNAL = 1
|
||||
EXTERNAL = 2
|
||||
MANUAL = 3
|
@ -1,3 +0,0 @@
|
||||
from .undefined_communication_method_error import UndefinedCommunicationMethodError
|
||||
from .value_out_of_bounds_error import ValueOutOfBoundsError
|
||||
from .undefined_value_error import UndefinedValueError
|
@ -1,5 +0,0 @@
|
||||
class UndefinedCommunicationMethodError(Exception):
|
||||
def __init__(self, port: str):
|
||||
method = port.split( "::" )[0]
|
||||
super().__init__( f"ERROR: Undefined Communication Exception, Method \"{method}\" is not recognized in Port \"{port}\"." )
|
||||
|
@ -1,4 +0,0 @@
|
||||
class UndefinedValueError(Exception):
|
||||
def __init__(self, value: str, expected: str):
|
||||
super().__init__( f"ERROR: Undefined Value, expected: {expected}, value: {value}." )
|
||||
|
@ -1,4 +0,0 @@
|
||||
class ValueOutOfBoundsError(Exception):
|
||||
def __init__(self, bounds: tuple[float, float] | tuple[int, int], value: float | int):
|
||||
super().__init__( f"ERROR: Value out of expected bounds, Min: {bounds[0]}, Max: {bounds[1]}, Value: {value}." )
|
||||
|
@ -1,2 +0,0 @@
|
||||
ON = True
|
||||
OFF = False
|
Loading…
Reference in New Issue
Block a user