Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@
SIZE_3_5_INCH = "3.5\""
SIZE_5_INCH = "5\""
SIZE_8_8_INCH = "8.8\""
SIZE_8_8_INCH_USB = "8.8\" (V1.1)"
SIZE_2_1_INCH = "2.1\""

size_list = (SIZE_2_1_INCH, SIZE_3_5_INCH, SIZE_5_INCH, SIZE_8_8_INCH)
size_list = (SIZE_2_1_INCH, SIZE_3_5_INCH, SIZE_5_INCH, SIZE_8_8_INCH, SIZE_8_8_INCH_USB)

# Maps between config.yaml values and GUI description
revision_and_size_to_model_map = {
Expand All @@ -78,6 +79,7 @@
('C', SIZE_2_1_INCH): TURING_MODEL,
('C', SIZE_5_INCH): TURING_MODEL,
('C', SIZE_8_8_INCH): TURING_MODEL,
('C_USB', SIZE_8_8_INCH_USB): TURING_MODEL,
('D', SIZE_3_5_INCH): KIPYE_MODEL,
('SIMU', SIZE_2_1_INCH): SIMULATED_MODEL,
('SIMU', SIZE_3_5_INCH): SIMULATED_MODEL,
Expand All @@ -92,6 +94,7 @@
(TURING_MODEL, SIZE_2_1_INCH): 'C',
(TURING_MODEL, SIZE_5_INCH): 'C',
(TURING_MODEL, SIZE_8_8_INCH): 'C',
(TURING_MODEL, SIZE_8_8_INCH_USB): 'C_USB',
(KIPYE_MODEL, SIZE_3_5_INCH): 'D',
(SIMULATED_MODEL, SIZE_2_1_INCH): 'SIMU',
(SIMULATED_MODEL, SIZE_3_5_INCH): 'SIMU',
Expand Down Expand Up @@ -133,6 +136,7 @@ def get_theme_data(name: str):


def get_themes(size: str):
size = size.split('"')[0] + '"'
themes = []
for filename in os.listdir(THEMES_DIR):
theme_data = get_theme_data(filename)
Expand Down Expand Up @@ -374,6 +378,8 @@ def load_config_values(self):
# Guess display size from theme in the configuration
size = get_theme_size(self.config['config']['THEME'])
try:
if size == SIZE_8_8_INCH and self.config['display']['REVISION'] == 'C_USB':
size = SIZE_8_8_INCH_USB
self.size_cb.set(size)
except:
self.size_cb.current(0)
Expand Down
4 changes: 4 additions & 0 deletions library/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from library.lcd.lcd_comm_rev_a import LcdCommRevA
from library.lcd.lcd_comm_rev_b import LcdCommRevB
from library.lcd.lcd_comm_rev_c import LcdCommRevC
from library.lcd.lcd_comm_rev_c_usb import LcdCommRevCUSB
from library.lcd.lcd_comm_rev_d import LcdCommRevD
from library.lcd.lcd_simulated import LcdSimulated
from library.log import logger
Expand Down Expand Up @@ -79,6 +80,9 @@ def __init__(self):
# Because of issue with Turing rev. C size auto-detection, manually configure screen width/height from theme
self.lcd = LcdCommRevC(com_port=config.CONFIG_DATA['config']['COM_PORT'],
update_queue=config.update_queue, display_width=width, display_height=height)
elif config.CONFIG_DATA["display"]["REVISION"] == "C_USB":
# Because of issue with Turing rev. C size auto-detection, manually configure screen width/height from theme
self.lcd = LcdCommRevCUSB(display_width=width, display_height=height)
elif config.CONFIG_DATA["display"]["REVISION"] == "D":
self.lcd = LcdCommRevD(com_port=config.CONFIG_DATA['config']['COM_PORT'],
update_queue=config.update_queue)
Expand Down
Loading
Loading