Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #41 from tektronix/develop
Browse files Browse the repository at this point in the history
Revision 3.1.0
  • Loading branch information
cwstryker authored Sep 21, 2021
2 parents 2ca7650 + 201885a commit 08797b2
Show file tree
Hide file tree
Showing 17 changed files with 1,211 additions and 394 deletions.
114 changes: 114 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,121 @@
<<<<<<< Updated upstream
/curvequery/__pycache__/
/test/__pycache__/
/build/
/dist/
/curvequery.egg-info/
/.tox/
/jupyter/
=======
*.py[cod]

# C extensions
*.so

# Packages
*.whl
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
__pycache__
MANIFEST

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox
nosetests.xml

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Virtual environments
venv/

# Pycharm settings
.idea/

# Do not save setup.py (used to editable installs only)
setup.py
>>>>>>> Stashed changes
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,52 @@ Finally, test your new feature.
>>> oscope.setup()
'*RST;:PARAMBATCHING 0;:TRIGGER:AUXLEVEL 0.0E+0;:CH1:BANDWIDTH 1.0000E+9;:CH... '

## Tests

A number of tests are available to verify functionality of the package module.
All tests are stored in the ./test/ directory.

__Setting Up the Test Environment__

The test environment can be setup in your virtual environment using the following command.

..\curvequery> python -m pip install .[test]

__Running the Tests__

The command to run the entire test suite is shown below:

..\curvequery> pytest --resource VISA::RESOURCE::NAME

Given the nature of this package module, the tests require an external hardware target.
The following hardware was used to develop the test suite:
* MSO 5 Series Oscilloscope with an AFG license
* 3 foot BNC Cable
* TLP058 Logic Analyzer Probe
* MDO Demo 1 Board (020-3087-00 demo kit)

If an AFG license is not available, and external 50 MHz sine wave generator can be used.
The generator settings are 1 volt peak-to-peak (into a 1 megaohm input) and zero volts offset.
When invoking the test suite, add the "--skip-license-checks" option.

If a MDO Demo 1 Board is not available, you can use another data source that can implement an 8-bit counter.
The least significant bit of the 8-bit counter must oscillate at a frequency of 1.25 MHz.
The digital bits must be connected to the TLP058 probe as shown below.
* CH2_D0 - Bit 1
* CH2_D1 - Bit 2
* CH2_D2 - Bit 3
* CH2_D3 - Bit 4
* CH2_D4 - Bit 5
* CH2_D5 - Bit 6
* CH2_D6 - Bit 7 (msb)
* CH2_D7 - Bit 0 (lsb)

__Hardware Setup__

On the oscilloscope, connect the AFG output to CH1 using the BNC cable.
Connect the TLP058 to CH2 of the oscilloscope.
The other end of the logic analyzer probe connects to the MDO Demo 1 Board.

## Contributor License Agreement
Contributions to this project must be accompanied by a Contributor License Agreement. You (or
your employer) retain the copyright to your contribution; this simply gives us permission to use
Expand Down
44 changes: 33 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The Oscilloscope object provides a high-level API that simplifies getting data f
Identity(company='TEKTRONIX', model='MSO58', serial='Q200011', config='CF:91.1CT FV:1.12.5.5575')

>>> wave_collection = oscope.curve() # download waveform data from the instrument
Downloading: 100%|█████████████████████████████████| 11/11 [00:00<00:00, 34.05Wfm/s]
Downloading: 20%|██ | 65.0M/320M [00:05<00:19, 12.9MB/s]

>>> oscope.default_setup() # restore the instrument's default settings

Expand Down Expand Up @@ -77,26 +77,48 @@ Other potential high level features are possible...
>>> id = oscope.add("meas", source="ch1", measurement="risetime") # potential future feature
>>> measurements = oscope.meas() # potential future feature

## Progress Bar

When using the curve feature, the progress bar is enabled by default, and it displays the number of bytes
associated with the curve query.

Downloading: 20%|██ | 65.0M/320M [00:05<00:19, 12.9MB/s]

## Requirements

The following Python elements are required.

- Python:
- 3.5+
- 3.7+
- 3rd Party Modules:
- pyvisa 1.9.1 Python VISA interface library
- visadore Visadore plugin manager
- pyvisa == 1.11.3 Python VISA interface library
- visadore Visadore plugin manager
- tqdm >= 4.62.2 Progress bar

To improve the progress bar support, the curve query package monkey patches pyvisa at runtime; therefore,
a specific version of pyvisa (shown above) must be used.
The installer will ensure that the required version of pyvisa is used.

## Installation

The curvequery package can be installed from source.
The curve query package can be installed from source.

#### Installation from Source

See the [Source section](#source-section) below for instructions on how to make a source distribution tarball.
Using pip, install the package module directly from a source distribution tarball in the Windows and Linux environments.
Using this method, all 3rd-party package modules will automatically be downloaded from PyPI and installed.
To install curve query, first clone the source repository from GitHub.
Using pip, install the package module directly from a clone of the git repository in either the Windows
and Linux environments.

../curvequery> python -m pip install .

Alternatively, create a wheel file using pip, and use the wheel file to install curve query on a different
Windows or Linux computer.

../curvequery> python -m pip wheel .

$ pip install curvequery-2.0.tar.gz
Using either of these methods, all 3rd-party package modules will automatically be downloaded from PyPI
and installed.

## <a name="source-section"></a>Source
## Source

The source code for curvequery is available on GitHub.
The source code for curve query is available on GitHub.
2 changes: 1 addition & 1 deletion curvequery/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__VERSION__ = "2.0"
__VERSION__ = "3.1.0"
Loading

0 comments on commit 08797b2

Please sign in to comment.