Skip to content

Commit c2ddfef

Browse files
Forairaaaaalbuque
authored andcommitted
modules/startup/tab5: Remove debug code.
Signed-off-by: Forairaaaaa <applesyqd@outlook.com>
1 parent d61d0cb commit c2ddfef

File tree

3 files changed

+8
-59
lines changed

3 files changed

+8
-59
lines changed

m5stack/modules/startup/tab5/launcher/apps/app_ezdata.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,31 +55,11 @@ def _update_last_update_time(self):
5555
self._get_time_since_last_update(self._data_update_time)
5656
)
5757

58-
def create_data_type_label(self, type_name: str):
59-
pass
60-
61-
# panel = lv.obj(self._parent)
62-
# panel.align(lv.ALIGN.TOP_LEFT, 30, 23)
63-
# panel.set_size(len(type_name) * 22 + 20, 32)
64-
# panel.set_style_pad_all(0, lv.PART.MAIN)
65-
# panel.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF)
66-
# panel.set_style_radius(12, lv.PART.MAIN)
67-
# panel.set_style_bg_color(lv.color_hex(0xE0E7FF), lv.PART.MAIN)
68-
# panel.set_style_border_color(lv.color_hex(0x9DC0FA), lv.PART.MAIN)
69-
70-
# label = lv.label(panel)
71-
# label.set_text(type_name)
72-
# label.align(lv.ALIGN.CENTER, 0, 0)
73-
# label.set_style_text_color(lv.color_hex(0x2E3F71), lv.PART.MAIN)
74-
# label.set_style_text_font(lv.font_montserrat_22, lv.PART.MAIN)
75-
7658

7759
class ViewString(ViewBase):
7860
def __init__(self, parent: lv.obj, data: dict):
7961
super().__init__(parent, data)
8062

81-
self.create_data_type_label("Str")
82-
8363
label = lv.label(parent)
8464
label.set_text(str(data.get("value")))
8565
label.align(lv.ALIGN.CENTER, 0, -10)
@@ -92,8 +72,6 @@ class ViewNumber(ViewBase):
9272
def __init__(self, parent: lv.obj, data: dict):
9373
super().__init__(parent, data)
9474

95-
self.create_data_type_label("Num")
96-
9775
label = lv.label(parent)
9876
label.set_text(str(data.get("value")))
9977
label.align(lv.ALIGN.CENTER, 0, -10)

m5stack/modules/startup/tab5/launcher/apps/app_ezdata_settings.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,6 @@
1111
class AppEzdataSettings(AppBase):
1212
async def main(self):
1313
parent = self.get_app_panel()
14-
# qrcode_data = Ezdata.get_add_user_qr_code()
15-
16-
# qr_add = lv.qrcode(parent)
17-
# qr_add.align(lv.ALIGN.CENTER, -167, -62)
18-
# qr_add.set_size(280)
19-
# qr_add.set_dark_color(lv.color_hex(0x0075B0))
20-
# qr_add.update(qrcode_data, len(qrcode_data))
21-
22-
# label_qr_add = lv.label(parent)
23-
# label_qr_add.set_text('Scan with the "Ez Data" app to begin.')
24-
# label_qr_add.align(lv.ALIGN.CENTER, -167, 127)
25-
# label_qr_add.set_style_text_font(lv.font_montserrat_24, lv.PART.MAIN)
26-
27-
# install_url = "https://apps.apple.com/us/app/ezdata/id6738713869"
28-
# qr_install = lv.qrcode(parent)
29-
# qr_install.align(lv.ALIGN.CENTER, 413, -46)
30-
# qr_install.set_size(170)
31-
# qr_install.set_dark_color(lv.color_hex(0x0075B0))
32-
# qr_install.update(install_url, len(install_url))
33-
34-
# label_qr_install = lv.label(parent)
35-
# label_qr_install.set_width(300)
36-
# label_qr_install.set_text('Install "Ez Data" from App Store')
37-
# label_qr_install.align(lv.ALIGN.CENTER, 413, 110)
38-
# label_qr_install.set_style_text_font(lv.font_montserrat_24, lv.PART.MAIN)
39-
# label_qr_install.set_style_text_align(lv.TEXT_ALIGN.CENTER, lv.PART.MAIN)
40-
41-
# divider = lv.obj(parent)
42-
# divider.set_size(6, 345)
43-
# divider.set_style_border_width(0, lv.PART.MAIN)
44-
# divider.align(lv.ALIGN.CENTER, 249, 0)
45-
# divider.set_style_radius(2, lv.PART.MAIN)
46-
# divider.set_style_bg_color(lv.color_hex(0xE5E5E5), lv.PART.MAIN)
4714

4815
# Step 1
4916
img_bg_1 = lv.image(parent)

m5stack/modules/startup/tab5/launcher/launcher.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from .common import Ezdata
1919
import lvgl as lv
2020
import asyncio
21+
import M5
2122

2223

2324
class Launcher:
@@ -111,7 +112,10 @@ async def _main(self):
111112
# Start ezdata service
112113
Ezdata.start()
113114

114-
# Keep app manager running
115-
while True:
116-
await asyncio.sleep_ms(50)
117-
await AppManager.update()
115+
try:
116+
# Keep app manager running
117+
while True:
118+
await asyncio.sleep_ms(50)
119+
await AppManager.update()
120+
except KeyboardInterrupt:
121+
M5.Lcd.lvgl_deinit()

0 commit comments

Comments
 (0)