Skip to content
Open
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 @@ -64,14 +64,16 @@
SIMULATED_MODEL = "Simulated screen"

SIZE_3_5_INCH = "3.5\""
SIZE_4_6_INCH = "4.6\""
SIZE_4_6_INCH_USB = "4.6\""
SIZE_5_INCH = "5\""
SIZE_8_8_INCH = "8.8\""
SIZE_8_8_INCH_USB = "8.8\" (V1.1) or 9.2\""
SIZE_2_1_INCH = "2.1\"" # Only for retro compatibility
SIZE_2_x_INCH = "2.1\" / 2.8\""
SIZE_0_96_INCH = "0.96\""

size_list = (SIZE_0_96_INCH, SIZE_2_x_INCH, SIZE_3_5_INCH, SIZE_5_INCH, SIZE_8_8_INCH, SIZE_8_8_INCH_USB)
size_list = (SIZE_0_96_INCH, SIZE_2_x_INCH, SIZE_3_5_INCH, SIZE_4_6_INCH_USB, 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 @@ -81,13 +83,15 @@
('C', SIZE_2_x_INCH): TURING_MODEL,
('C', SIZE_5_INCH): TURING_MODEL,
('C', SIZE_8_8_INCH): TURING_MODEL,
('C_USB', SIZE_4_6_INCH_USB): TURING_MODEL,
('C_USB', SIZE_8_8_INCH_USB): TURING_MODEL,
('D', SIZE_3_5_INCH): KIPYE_MODEL,
('WEACT_A', SIZE_3_5_INCH): WEACT_MODEL,
('WEACT_B', SIZE_0_96_INCH): WEACT_MODEL,
('SIMU', SIZE_0_96_INCH): SIMULATED_MODEL,
('SIMU', SIZE_2_x_INCH): SIMULATED_MODEL,
('SIMU', SIZE_3_5_INCH): SIMULATED_MODEL,
('SIMU', SIZE_4_6_INCH): SIMULATED_MODEL,
('SIMU', SIZE_5_INCH): SIMULATED_MODEL,
('SIMU', SIZE_8_8_INCH): SIMULATED_MODEL,
}
Expand All @@ -99,13 +103,15 @@
(TURING_MODEL, SIZE_2_x_INCH): 'C',
(TURING_MODEL, SIZE_5_INCH): 'C',
(TURING_MODEL, SIZE_8_8_INCH): 'C',
(TURING_MODEL, SIZE_4_6_INCH_USB): 'C_USB',
(TURING_MODEL, SIZE_8_8_INCH_USB): 'C_USB',
(KIPYE_MODEL, SIZE_3_5_INCH): 'D',
(WEACT_MODEL, SIZE_3_5_INCH): 'WEACT_A',
(WEACT_MODEL, SIZE_0_96_INCH): 'WEACT_B',
(SIMULATED_MODEL, SIZE_0_96_INCH): 'SIMU',
(SIMULATED_MODEL, SIZE_2_x_INCH): 'SIMU',
(SIMULATED_MODEL, SIZE_3_5_INCH): 'SIMU',
(SIMULATED_MODEL, SIZE_4_6_INCH): 'SIMU',
(SIMULATED_MODEL, SIZE_5_INCH): 'SIMU',
(SIMULATED_MODEL, SIZE_8_8_INCH): 'SIMU',
}
Expand Down
2 changes: 2 additions & 0 deletions library/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def _get_theme_size() -> tuple[int, int]:
return 480, 480
elif config.THEME_DATA["display"].get("DISPLAY_SIZE", '') == '3.5"':
return 320, 480
elif config.THEME_DATA["display"].get("DISPLAY_SIZE", '') == '4.6"':
return 320, 960
elif config.THEME_DATA["display"].get("DISPLAY_SIZE", '') == '5"':
return 480, 800
elif config.THEME_DATA["display"].get("DISPLAY_SIZE", '') == '8.8"':
Expand Down
7 changes: 5 additions & 2 deletions library/lcd/lcd_comm_turing_usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from library.lcd.lcd_comm import Orientation, LcdComm

VENDOR_ID = 0x1cbe
PRODUCT_ID = [0x0088, 0x0092] # 8.8", 9.2"
PRODUCT_ID = [0x0046, 0x0088, 0x0092] # 4.6", 8.8", 9.2"


MAX_CHUNK_BYTES = 1024*1024 # Data sent to screen cannot exceed 1024MB or there will be a timeout
Expand Down Expand Up @@ -462,8 +462,11 @@ def encrypt_command_packet(data: bytearray) -> bytearray:


def find_usb_device():
dev = None
for pid in PRODUCT_ID:
dev = usb.core.find(idVendor=VENDOR_ID, idProduct=pid)
if dev is not None:
break
if dev is None:
raise ValueError(f'USB device not found')

Expand Down Expand Up @@ -936,7 +939,7 @@ def _write_file_command(dev, file_path: str) -> bool:
return False


# This class is for Turing Smart Screen newer models (5.2" / 8" / 8.8" HW rev 1.x / 9.2")
# This class is for Turing Smart Screen newer models (4.6" / 5.2" / 8" / 8.8" HW rev 1.x / 9.2")
# These models are not detected as serial ports but as (Win)USB devices
class LcdCommTuringUSB(LcdComm):
def __init__(self, com_port: str = "AUTO", display_width: int = 480, display_height: int = 1920,
Expand Down
Binary file added res/themes/Gradient46/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/themes/Gradient46/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions res/themes/Gradient46/theme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
author: "@mathoudebine"

display:
DISPLAY_SIZE: 4.6"
DISPLAY_ORIENTATION: portrait
DISPLAY_RGB_LED: 226, 21, 103

static_images:
BACKGROUND:
PATH: background.png
X: 0
Y: 0
WIDTH: 320
HEIGHT: 960

STATS:
CPU:
PERCENTAGE:
INTERVAL: 1
TEXT:
SHOW: True
SHOW_UNIT: True
X: 40
Y: 160
FONT: roboto-mono/RobotoMono-Regular.ttf
FONT_SIZE: 80
FONT_COLOR: 255, 255, 255
BACKGROUND_IMAGE: background.png
TEMPERATURE:
INTERVAL: 1
TEXT:
SHOW: True
SHOW_UNIT: True
X: 80
Y: 110
FONT: roboto-mono/RobotoMono-Regular.ttf
FONT_SIZE: 40
FONT_COLOR: 255, 255, 255
BACKGROUND_IMAGE: background.png
GPU:
INTERVAL: 1
PERCENTAGE:
TEXT:
SHOW: True
SHOW_UNIT: True
X: 40
Y: 480
FONT: roboto-mono/RobotoMono-Regular.ttf
FONT_SIZE: 80
FONT_COLOR: 255, 255, 255
BACKGROUND_IMAGE: background.png
TEMPERATURE:
TEXT:
SHOW: True
SHOW_UNIT: True
X: 80
Y: 430
FONT: roboto-mono/RobotoMono-Regular.ttf
FONT_SIZE: 40
FONT_COLOR: 255, 255, 255
BACKGROUND_IMAGE: background.png
MEMORY:
INTERVAL: 5
VIRTUAL:
USED:
SHOW: True
SHOW_UNIT: True
X: 80
Y: 740
FONT: roboto-mono/RobotoMono-Regular.ttf
FONT_SIZE: 30
FONT_COLOR: 255, 255, 255
BACKGROUND_IMAGE: background.png
PERCENT_TEXT:
SHOW: True
SHOW_UNIT: True
X: 40
Y: 790
FONT: roboto-mono/RobotoMono-Regular.ttf
FONT_SIZE: 80
FONT_COLOR: 255, 255, 255
BACKGROUND_IMAGE: background.png