Skip to content

Commit

Permalink
update docs and simpletest
Browse files Browse the repository at this point in the history
... to include envelope plot
  • Loading branch information
CedarGroveStudios committed Feb 15, 2024
1 parent 5d2fb6a commit 8b380a1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions cedargrove_waveviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
`cedargrove_waveviz`
===============================================================================
A CircuitPython class to create a positionable ``displayio.TileGrid`` object
from a ``synthio.ReadableBuffer`` wave table or ``synthio.Envelope object.
The class inherits the properties of a ``TileGrid`` object including bitmap,
pixel_shader, width, height, x, y.
from a ``synthio.waveform`` wave table or ``synthio.Envelope`` object.
The class inherits the properties of a ``TileGrid`` object including
``bitmap``, ``pixel_shader``, ``width``, ``height``, ``x``, ``y``, and
provides the bitmap properties of ``width``, ``height``.
https://github.com/CedarGroveStudios/CircuitPython_WaveViz
https://docs.circuitpython.org/en/latest/shared-bindings/displayio/#displayio.TileGrid
Expand Down Expand Up @@ -46,7 +47,7 @@ class WaveViz(displayio.TileGrid):
:param integer back_color: The grid background color. Defaults to None (transparent).
:param bool auto_scale: Automatically adjust resultant plot to the wave table's
full-scale value. Defaults to True (auto scale enabled).
:param bool envelope_plot: Plot an envelope object. Defaults to False (plot
:param bool env_plot: Plot an envelope object. Defaults to False (plot
a wave object).
"""

Expand All @@ -62,7 +63,7 @@ def __init__(
grid_color=0x808080,
back_color=None,
auto_scale=True,
envelope_plot=False,
env_plot=False,
):
"""Instantiate the tile generator class."""
self._wave_table = wave_table
Expand All @@ -74,7 +75,7 @@ def __init__(
self._auto_scale = auto_scale
self._max_sample_value = 32767 # Maximum signed 16-bit value
self._scale_y = 0 # Define for later use
self._envelope_plot = envelope_plot
self._envelope_plot = env_plot

self._palette = displayio.Palette(3)
self._palette[1] = plot_color
Expand Down
2 changes: 1 addition & 1 deletion examples/waveviz_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
height=40,
plot_color=0xFFFFFF,
back_color=0x800080,
envelope_plot=True,
env_plot=True,
)
)

Expand Down
Binary file modified media/pseudo_rtd_cedargrove_waveviz.pdf
Binary file not shown.
Binary file modified media/waveviz_api_page1a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8b380a1

Please sign in to comment.