Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Fixing Bug Bash Issues #307

Merged
merged 4 commits into from
Apr 9, 2020
Merged

Fixing Bug Bash Issues #307

merged 4 commits into from
Apr 9, 2020

Conversation

andreamah
Copy link
Contributor

Description:

Issues

  • Slideshow library not working due to socketio python import
    • Changed import method on slideshow and added warning on debugger_communication_client
  • Calling pop() on displayio.group gives runtime error
    • Corrected __elem_changed on group.pop()
  • Board.DISPLAY and board.Display are both autocomplete options
    • Made Display class declaration private.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Limitations:

Please describe limitations of this PR

Testing:

Tested slideshow and shapes (debug and regular mode):

from adafruit_slideshow import SlideShow, PlayBackDirection, PlayBackOrder
import board
import pulseio

# Create the slideshow object that plays through once alphabetically.
slideshow = SlideShow(
    board.DISPLAY,
    pulseio.PWMOut(board.TFT_BACKLIGHT),
    dwell=0.001,
    loop=True,
    fade_effect=False,
    auto_advance=True,
    order=PlayBackOrder.RANDOM,
    direction=PlayBackDirection.BACKWARD,
)

while slideshow.update():
    pass

import board
import displayio
from adafruit_display_shapes.rect import Rect
from adafruit_display_shapes.circle import Circle
from adafruit_display_shapes.roundrect import RoundRect
from adafruit_display_shapes.triangle import Triangle
from adafruit_display_shapes.line import Line
from adafruit_display_shapes.polygon import Polygon

from datetime import datetime

splash = displayio.Group(max_size=20)
board.DISPLAY.show(splash)

# Make a background color fill
color_bitmap = displayio.Bitmap(320, 240, 1)
color_palette = displayio.Palette(1)
color_palette[0] = 0xFFFFFF
bg_sprite = displayio.TileGrid(color_bitmap, x=0, y=0, pixel_shader=color_palette)
splash.append(bg_sprite)
##########################################################################

splash.append(Line(220, 130, 270, 210, 0xFF0000))
splash.append(Line(270, 210, 220, 210, 0xFF0000))
splash.append(Line(220, 210, 270, 130, 0xFF0000))
splash.append(Line(270, 130, 220, 130, 0xFF0000))

# Draw a blue star
polygon = Polygon(
    [
        (255, 40),
        (262, 62),
        (285, 62),
        (265, 76),
        (275, 100),
        (255, 84),
        (235, 100),
        (245, 76),
        (225, 62),
        (248, 62),
    ],
    outline=0x0000FF,
)
splash.append(polygon)

triangle = Triangle(170, 50, 120, 140, 210, 160, fill=0x00FF00, outline=0xFF00FF)
splash.append(triangle)

rect = Rect(80, 20, 41, 41, fill=0x0)
splash.append(rect)

circle = Circle(100, 100, 20, fill=0x00FF00, outline=0xFF00FF)
splash.append(circle)

rect2 = Rect(50, 100, 61, 81, outline=0x0, stroke=3)
splash.insert(6, rect2)
roundrect = RoundRect(10, 10, 61, 81, 10, fill=0x0, outline=0xFF00FF, stroke=6)
splash.append(roundrect)
del splash[splash.index(circle)]
splash.remove(triangle)

Checklist:

  • My code follows the style guidelines of this project
  • My code has been formatted with npm run format and passes the checks in npm run check
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Copy link
Contributor

@vandyliu vandyliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andreamah andreamah merged commit 02d99a3 into dev Apr 9, 2020
@andreamah andreamah deleted the users/t-anmah/bug-bash-issues branch April 9, 2020 03:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants