Skip to content

Commit

Permalink
Merge pull request #7 from sam210723/dev
Browse files Browse the repository at this point in the history
Merge v2.1
  • Loading branch information
sam210723 authored Feb 27, 2021
2 parents 539fda6 + 2c8c4ea commit 2d5cdf7
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 20 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@ All notable changes to this project will be documented in this file.
</details>


## [v2.1](https://github.com/sam210723/wavebin/releases/tag/v2.1) - 2021-02-27
Add support for Rigol waveform captures, plus some minor fixes.

<details>
<summary>Details</summary>

### Added
- Support for Rigol waveform captures

### Changed
- Open file dialog in directory of current waveform capture

### Fixed
- Minimum number of subsampling points
</details>


## [v2.0](https://github.com/sam210723/wavebin/releases/tag/v2.0) - 2021-02-07
Complete re-write of the project with various new features.

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# <img src="https://raw.githubusercontent.com/sam210723/wavebin/master/icon.ico" width=24 /> Keysight Waveform Capture Viewer
# <img src="https://raw.githubusercontent.com/sam210723/wavebin/master/icon.ico" width=24 /> Oscilloscope Waveform Capture Viewer

[![GitHub release](https://img.shields.io/github/release/sam210723/wavebin.svg)](https://pypi.org/project/wavebin/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/wavebin)](https://pypi.org/project/wavebin/)
[![PyPI - Downloads](https://img.shields.io/pypi/dw/wavebin)](https://pypi.org/project/wavebin/)
[![GitHub license](https://img.shields.io/github/license/sam210723/wavebin.svg)](https://github.com/sam210723/wavebin/master/LICENSE)

**wavebin** reads binary capture files generated by Keysight oscilloscopes and renders the waveforms in an interactive plot. Waveforms can be inspected, [filtered](#filtering), [clipped](#clipping), [subsampled](#subsampling) and exported to [sigrok PulseView](#export-to-pulseview) or [WAV files](#export-to-wav).
**wavebin** reads binary capture files generated by Agilent, Keysight and Rigol oscilloscopes and renders the waveforms in an interactive plot. Waveforms can be inspected, [filtered](#filtering), [clipped](#clipping), [subsampled](#subsampling) and exported to [sigrok PulseView](#export-to-pulseview) or [WAV files](#export-to-wav).

![](https://raw.githubusercontent.com/sam210723/wavebin/master/screenshots/wavebin.png)

**wavebin** has been tested with capture files from a [**DSO-X 1102G**](https://www.keysight.com/en/pdx-2766207-pn-DSOX1102G/oscilloscope-70-100-mhz-2-analog-channels) and [**MSO-X 4154A**](). If you have access to waveform files from other Keysight (or Agilent) oscilloscopes, please submit them for testing through the [Sample Waveforms issue](https://github.com/sam210723/wavebin/issues/1).
**wavebin** has been tested with capture files from a [**Keysight DSO-X 1102G**](https://www.keysight.com/en/pdx-2766207-pn-DSOX1102G/oscilloscope-70-100-mhz-2-analog-channels), [**Keysight MSO-X 4154A**](https://www.keysight.com/en/pdx-x201943-pn-MSOX4154A/mixed-signal-oscilloscope-15-ghz-4-analog-plus-16-digital-channels) and [**Rigol MSO5074**](https://www.rigolna.com/products/digital-oscilloscopes/MSO5000/). If you have access to waveform files from other Agilent, Keysight or Rigol oscilloscopes, please submit them for testing through the [Sample Waveforms issue](https://github.com/sam210723/wavebin/issues/1).

![](https://raw.githubusercontent.com/sam210723/wavebin/master/screenshots/console.png)

Expand Down Expand Up @@ -45,7 +45,7 @@ For more information about the **wavebin** command-line arguments run:
_ ______ __ _____ / /_ (_)___
| | /| / / __ `/ | / / _ \/ __ \/ / __ \
| |/ |/ / /_/ /| |/ / __/ /_/ / / / / /
|__/|__/\__,_/ |___/\___/_.___/_/_/ /_/ v2.0
|__/|__/\__,_/ |___/\___/_.___/_/_/ /_/ v2.1
vksdr.com/wavebin
Expand Down
Binary file added samples/DSOX1102G/digital.bin
Binary file not shown.
Binary file added samples/DSOX1102G/digital.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions samples/DSOX1102G/digital.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ANALOG
Ch 1 Scale 1.00V/, Pos -1.50000V, Coup DC, BW Limit Off, Inv Off, Imp 1M Ohm
Probe 1.0000000 : 1, Skew 0.0s

EXT TRIG
Range 1.6V, Threshold 0.0V, Pos -2.600
Probe 1.0000000 : 1

TRIGGER
Sweep Mode Auto, Coup DC, Noise Rej Off, HF Rej Off, Holdoff 60.0ns
Mode Edge, Source Ch 1, Slope Rising, Level -135.75mV

HORIZONTAL
Mode Normal, Ref Center, Main Scale 2.000us/, Main Delay 0.0s

ACQUISITION
Mode Normal, Realtime On, Vectors On, Persistence Off

MEASUREMENTS
Frequency(1), Cur 249.69kHz
Pk-Pk(1), Cur 2.73V
Frequency(2), Cur No signal
Pk-Pk(2), Cur No signal

Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

setuptools.setup(
name='wavebin',
version='2.0',
version='2.1',
packages=['wavebin'],
author="sam210723",
author_email="[email protected]",
description="Waveform capture viewer for Keysight oscilloscopes",
description="Waveform capture viewer for Agilent, Keysight and Rigol oscilloscopes",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/sam210723/wavebin",
Expand Down
6 changes: 3 additions & 3 deletions wavebin/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
wavebin
https://github.com/sam210723/wavebin
Waveform capture viewer for Keysight oscilloscopes.
Waveform capture viewer for oscilloscopes.
"""

from argparse import ArgumentParser
Expand All @@ -13,7 +13,7 @@
from wavebin.plot import QtPlot
from wavebin.wave import WaveParser

__version__ = 2.0
__version__ = 2.1


def init():
Expand Down Expand Up @@ -55,7 +55,7 @@ def init():
plot = QtPlot({
"verbose": args.v,
"opengl": not args.no_opengl,
"subsampling": -1,
"subsampling": limit,
"filter_type": 0,
"clipping": False,
"colours": [
Expand Down
2 changes: 1 addition & 1 deletion wavebin/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
wavebin
https://github.com/sam210723/wavebin
Waveform capture viewer for Keysight oscilloscopes.
Waveform capture viewer for oscilloscopes.
"""

from pathlib import Path
Expand Down
15 changes: 11 additions & 4 deletions wavebin/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
wavebin
https://github.com/sam210723/wavebin
Waveform capture viewer for Keysight oscilloscopes.
Waveform capture viewer for oscilloscopes.
"""

from pathlib import Path
Expand Down Expand Up @@ -158,11 +158,17 @@ def keyPressEvent(self, event):


def menu_file_open(self):
# Get initial path
if "file" in self.config:
initial_path = str(self.config['file'].parents[0])
else:
initial_path = "."

# Show open file dialog
file_path = self.ofd.getOpenFileName(
self.window,
"Open waveform capture",
".",
initial_path,
"Waveform files (*.bin);;All files (*.*)"
)[0]

Expand Down Expand Up @@ -352,7 +358,7 @@ def menu_help_about(self):
msgbox.setIcon(qt.QMessageBox.Information)
msgbox.setStandardButtons(qt.QMessageBox.Ok)
msgbox.setText(
"Waveform capture viewer for Keysight oscilloscopes.\n\n"\
"Waveform capture viewer for Agilent, Keysight and Rigol oscilloscopes.\n\n"\
"Update wavebin by running \"pip install wavebin --upgrade\""
)
self.log("About dialog launched")
Expand Down Expand Up @@ -445,7 +451,8 @@ def update(self, f, c, p):
self.clipping_changed(c)

if p != None:
# Set subsampling spin box maximum
# Set subsampling spin box min/max
self.config['parts'][2]['widget'].setMinimum(2)
self.config['parts'][2]['widget'].setMaximum(p)
self.config['parts'][2]['widget'].setValue(p)
self.subsampling_changed(p)
Expand Down
8 changes: 4 additions & 4 deletions wavebin/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
wavebin
https://github.com/sam210723/wavebin
Waveform capture viewer for Keysight oscilloscopes.
Waveform capture viewer for oscilloscopes.
"""

from enum import Enum
Expand Down Expand Up @@ -44,10 +44,10 @@ def update(self):
for i, w in enumerate(self.waveforms):
self.log(f"Rendering waveform {i + 1}")
# Subsampling
if self.config['subsampling'] >= len(w['data']) or self.config['subsampling'] == -1:
if self.config['subsampling'] >= len(w['data']):
y = w['data']
else:
self.log(f" Subsampling ({len(w['data'])} -> {self.config['subsampling']})")
self.log(f" Subsampling ({len(w['data'])} -> {int(self.config['subsampling'])})")
y = w['data'][:: int( len(w['data']) / self.config['subsampling'] )]

# Generate X points
Expand All @@ -65,7 +65,7 @@ def update(self):

# Catch filter exceptions
try:
# Applt filter
# Apply filter
y = Filters().savitzky_golay(y, window, 3)
except TypeError as e:
if str(e) == "window_size is too small for the polynomials order":
Expand Down
11 changes: 9 additions & 2 deletions wavebin/wave.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
wavebin
https://github.com/sam210723/wavebin
Waveform capture viewer for Keysight oscilloscopes.
Waveform capture viewer for oscilloscopes.
"""

from collections import namedtuple
Expand Down Expand Up @@ -74,13 +74,20 @@ def parse_file_header(self, data):
fields = struct.unpack("2s2s2i", data)
self.file_header = file_header_tuple(*fields)

# Get vendor based on file magic
vendor = {
b'AG': "Agilent/Keysight",
b'RG': "Rigol"
}

# Check file magic
if self.file_header.magic != b'AG':
if not self.file_header.magic in vendor:
print("Unknown file format")
return False

# Print file header info
self.log("File Header:")
self.log(f" - Vendor: {vendor[self.file_header.magic]}")
self.log(f" - Waveforms: {self.file_header.waveforms}")
self.log(f" - File Size: {self.human_format(self.file_header.size, binary=True)}B\n")

Expand Down

0 comments on commit 2d5cdf7

Please sign in to comment.