Fixed indents

This commit is contained in:
Maximilian Giller 2019-02-19 22:02:11 +01:00
parent c2d345dea0
commit a630dd2d54
3 changed files with 10 additions and 6 deletions

View file

@ -3,8 +3,8 @@ from settings import display_colours
from PIL import Image, ImageDraw from PIL import Image, ImageDraw
class Epd7in5Adapter (EpdAdapter): class Epd7in5Adapter (EpdAdapter):
def __init__ (): def __init__ ():
super(Epd7in5Adapter, self).__init__(640, 384) super(Epd7in5Adapter, self).__init__(640, 384)
def display_frame (self, frame_buffer): def display_frame (self, frame_buffer):
self.send_command(DATA_START_TRANSMISSION_1) self.send_command(DATA_START_TRANSMISSION_1)

View file

@ -3,8 +3,8 @@ from settings import display_colours
from PIL import Image, ImageDraw from PIL import Image, ImageDraw
class Epd7in5bAdapter (EpdAdapter): class Epd7in5bAdapter (EpdAdapter):
def __init__ (): def __init__ ():
super(Epd7in5bAdapter, self).__init__(640, 384) super(Epd7in5bAdapter, self).__init__(640, 384)
def display_frame (self, frame_buffer): def display_frame (self, frame_buffer):
self.send_command(DATA_START_TRANSMISSION_1) self.send_command(DATA_START_TRANSMISSION_1)

View file

@ -49,7 +49,7 @@ READ_VCOM_VALUE = 0x81
VCM_DC_SETTING = 0x82 VCM_DC_SETTING = 0x82
class EpdAdapter (DisplayAdapter): class EpdAdapter (DisplayAdapter):
"""Generalized adapter for epd7in5 and epd7in5b""" """Generalized adapter for epd7in5 and epd7in5b"""
def __init__ (self, width, height): def __init__ (self, width, height):
self.width = width self.width = width
self.height = height self.height = height
@ -69,12 +69,16 @@ class EpdAdapter (DisplayAdapter):
def render (self, design): def render (self, design):
self.init_render() self.init_render()
time.sleep(5) time.sleep(5)
print('Converting image to data and sending it to the display')
print('This may take a while...' + '\n')
prepared_image = design.get_image().rotate(270, expand=1) prepared_image = design.get_image().rotate(270, expand=1)
self.display_frame(self.get_frame_buffer(prepared_image)) self.display_frame(self.get_frame_buffer(prepared_image))
# Powering off the E-Paper until the next loop # Powering off the E-Paper until the next loop
self.sleep() self.sleep()
print('Data sent successfully')
print('Powering off the E-Paper until the next loop' + '\n')
def init_render (self): def init_render (self):
if (self.epd_init() != 0): if (self.epd_init() != 0):