Skip to content

Commit 65652cf

Browse files
committed
Detect Turing USB resolution by PID, crop images when needed
1 parent 510c33a commit 65652cf

3 files changed

Lines changed: 77 additions & 128 deletions

File tree

configure.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@
7272
SIZE_5_2_INCH = "5.2\""
7373
SIZE_8_0_INCH = "8.0\""
7474
SIZE_8_8_INCH = "8.8\""
75-
SIZE_8_8_INCH_NEWREV = "8.8\" (V1.X new HW rev.)"
76-
SIZE_9_2_INCH = "9.2\""
75+
SIZE_8_8_INCH_NEWREV = "8.8\" / 9.2\" (V1.X new HW rev.)"
7776

7877
# List of sizes that can be selected
7978
size_list = (
@@ -86,7 +85,6 @@
8685
# SIZE_8_0_INCH, Not implemented yet
8786
SIZE_8_8_INCH,
8887
SIZE_8_8_INCH_NEWREV,
89-
# SIZE_9_2_INCH, Not implemented yet
9088
)
9189

9290
# Maps between config.yaml values and GUI description
@@ -104,7 +102,6 @@
104102
('TUR_USB', SIZE_8_0_INCH): TURING_MODEL,
105103
('TUR_USB', SIZE_8_8_INCH): TURING_MODEL,
106104
('TUR_USB', SIZE_8_8_INCH_NEWREV): TURING_MODEL,
107-
('TUR_USB', SIZE_9_2_INCH): TURING_MODEL,
108105
('WEACT_A', SIZE_3_5_INCH): WEACT_MODEL,
109106
('WEACT_B', SIZE_0_96_INCH): WEACT_MODEL,
110107

@@ -116,7 +113,6 @@
116113
('SIMU', SIZE_5_2_INCH): SIMULATED_MODEL,
117114
('SIMU', SIZE_8_0_INCH): SIMULATED_MODEL,
118115
('SIMU', SIZE_8_8_INCH): SIMULATED_MODEL,
119-
('SIMU', SIZE_9_2_INCH): SIMULATED_MODEL,
120116
}
121117
# This map is used to write the correct config.yaml "REVISION" from selected smart screen model and size
122118
model_and_size_to_revision_map = {
@@ -129,7 +125,6 @@
129125
(TURING_MODEL, SIZE_8_0_INCH): 'TUR_USB',
130126
(TURING_MODEL, SIZE_8_8_INCH): 'C',
131127
(TURING_MODEL, SIZE_8_8_INCH_NEWREV): 'TUR_USB',
132-
(TURING_MODEL, SIZE_9_2_INCH): 'TUR_USB',
133128
(USBPCMONITOR_MODEL, SIZE_3_5_INCH): 'A',
134129
(USBPCMONITOR_MODEL, SIZE_5_INCH): 'A',
135130
(WEACT_MODEL, SIZE_0_96_INCH): 'WEACT_B',
@@ -144,7 +139,6 @@
144139
(SIMULATED_MODEL, SIZE_5_2_INCH): 'SIMU',
145140
(SIMULATED_MODEL, SIZE_8_0_INCH): 'SIMU',
146141
(SIMULATED_MODEL, SIZE_8_8_INCH): 'SIMU',
147-
(SIMULATED_MODEL, SIZE_9_2_INCH): 'SIMU',
148142
}
149143
hw_lib_map = {"AUTO": "Automatic", "LHM": "LibreHardwareMonitor (admin.)", "PYTHON": "Python libraries",
150144
"STUB": "Fake random data", "STATIC": "Fake static data"}

library/display.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ def __init__(self):
9292
self.lcd = LcdCommRevD(com_port=config.CONFIG_DATA['config']['COM_PORT'],
9393
update_queue=config.update_queue)
9494
elif config.CONFIG_DATA["display"]["REVISION"] == "TUR_USB":
95-
# On all USB models, manually configure screen width/height from theme
96-
self.lcd = LcdCommTuringUSB(display_width=width, display_height=height)
95+
self.lcd = LcdCommTuringUSB()
9796
elif config.CONFIG_DATA["display"]["REVISION"] == "WEACT_A":
9897
self.lcd = LcdCommWeActA(com_port=config.CONFIG_DATA['config']['COM_PORT'],
9998
update_queue=config.update_queue)

0 commit comments

Comments
 (0)