Compare commits
8 Commits
7555efcba9
...
pi/general
| Author | SHA1 | Date | |
|---|---|---|---|
| 436e55a0c5 | |||
|
|
776aee18fc | ||
|
|
41e0a6b81d | ||
|
|
e4da3687b4 | ||
|
|
05cd085b89 | ||
|
|
d0d0b4dc39 | ||
|
|
25420d57b3 | ||
|
|
18984c29a3 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,3 +3,6 @@ managed_components/
|
|||||||
sdkconfig
|
sdkconfig
|
||||||
sdkconfig.old
|
sdkconfig.old
|
||||||
dependencies.lock
|
dependencies.lock
|
||||||
|
|
||||||
|
# vscode local settings
|
||||||
|
.vscode/
|
||||||
12
.vscode/settings.json
vendored
12
.vscode/settings.json
vendored
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"idf.currentSetup": "J:\\esp\\.espressif\\v5.5.2\\esp-idf",
|
|
||||||
"idf.flashType": "UART",
|
|
||||||
"idf.portWin": "COM7",
|
|
||||||
"idf.openOcdConfigs": [
|
|
||||||
"interface/ftdi/esp_ftdi.cfg",
|
|
||||||
"target/esp32s3.cfg"
|
|
||||||
],
|
|
||||||
"idf.customExtraVars": {
|
|
||||||
"IDF_TARGET": "esp32s3"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -132,7 +132,9 @@ static void scroll_timer_cb(lv_timer_t *timer)
|
|||||||
cur_y = 0;
|
cur_y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_obj_scroll_to_y(tbl_services, cur_y + s_row_h, LV_ANIM_OFF);
|
// lv_obj_scroll_to_y(tbl_services, cur_y + s_row_h, LV_ANIM_OFF);
|
||||||
|
const int delta_y = s_row_h / 8;
|
||||||
|
lv_obj_scroll_to_y(tbl_services, cur_y + delta_y, LV_ANIM_ON);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Measure row height, compute visible rows, append duplicates for seamless loop */
|
/* Measure row height, compute visible rows, append duplicates for seamless loop */
|
||||||
@@ -213,7 +215,7 @@ static void create_top_bar(lv_obj_t *parent)
|
|||||||
/* Battery positive terminal nub */
|
/* Battery positive terminal nub */
|
||||||
lv_obj_t *batt_nub = lv_obj_create(bar_cont);
|
lv_obj_t *batt_nub = lv_obj_create(bar_cont);
|
||||||
lv_obj_set_size(batt_nub, 2, 4);
|
lv_obj_set_size(batt_nub, 2, 4);
|
||||||
lv_obj_align(batt_nub, LV_ALIGN_RIGHT_MID, -37, 0);
|
lv_obj_align(batt_nub, LV_ALIGN_RIGHT_MID, -38, 0);
|
||||||
lv_obj_set_style_bg_color(batt_nub, lv_color_white(), 0);
|
lv_obj_set_style_bg_color(batt_nub, lv_color_white(), 0);
|
||||||
lv_obj_set_style_bg_opa(batt_nub, LV_OPA_COVER, 0);
|
lv_obj_set_style_bg_opa(batt_nub, LV_OPA_COVER, 0);
|
||||||
lv_obj_set_style_border_width(batt_nub, 0, 0);
|
lv_obj_set_style_border_width(batt_nub, 0, 0);
|
||||||
@@ -281,8 +283,8 @@ static void create_main_section(lv_obj_t *parent)
|
|||||||
lv_table_set_cell_value(tbl_services, i, 1, "---");
|
lv_table_set_cell_value(tbl_services, i, 1, "---");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Auto-scroll timer: 2 second period */
|
/* Timer for each shift of 1/8 line's height */
|
||||||
s_scroll_timer = lv_timer_create(scroll_timer_cb, 2048, NULL);
|
s_scroll_timer = lv_timer_create(scroll_timer_cb, 120, NULL);
|
||||||
|
|
||||||
/* === Left column: Pi Vitals (below services) === */
|
/* === Left column: Pi Vitals (below services) === */
|
||||||
int rx = 0;
|
int rx = 0;
|
||||||
@@ -336,7 +338,7 @@ static void create_bottom_bar(lv_obj_t *parent)
|
|||||||
lv_obj_t *bot_cont = lv_obj_create(parent);
|
lv_obj_t *bot_cont = lv_obj_create(parent);
|
||||||
lv_obj_set_pos(bot_cont, 0, y0);
|
lv_obj_set_pos(bot_cont, 0, y0);
|
||||||
lv_obj_set_size(bot_cont, SCREEN_W, BOT_H);
|
lv_obj_set_size(bot_cont, SCREEN_W, BOT_H);
|
||||||
lv_obj_set_style_bg_color(bot_cont, lv_color_white(), 0);
|
lv_obj_set_style_bg_color(bot_cont, lv_color_black(), 0);
|
||||||
lv_obj_set_style_bg_opa(bot_cont, LV_OPA_COVER, 0);
|
lv_obj_set_style_bg_opa(bot_cont, LV_OPA_COVER, 0);
|
||||||
lv_obj_set_style_border_color(bot_cont, lv_color_black(), 0);
|
lv_obj_set_style_border_color(bot_cont, lv_color_black(), 0);
|
||||||
lv_obj_set_style_border_width(bot_cont, 1, 0);
|
lv_obj_set_style_border_width(bot_cont, 1, 0);
|
||||||
@@ -347,14 +349,14 @@ static void create_bottom_bar(lv_obj_t *parent)
|
|||||||
|
|
||||||
lbl_net = lv_label_create(bot_cont);
|
lbl_net = lv_label_create(bot_cont);
|
||||||
lv_obj_set_style_text_font(lbl_net, &InziuIosevka_Slab_CC_12px, 0);
|
lv_obj_set_style_text_font(lbl_net, &InziuIosevka_Slab_CC_12px, 0);
|
||||||
lv_obj_set_style_text_color(lbl_net, lv_color_black(), 0);
|
lv_obj_set_style_text_color(lbl_net, lv_color_white(), 0);
|
||||||
lv_obj_align(lbl_net, LV_ALIGN_LEFT_MID, 0, 0);
|
lv_obj_align(lbl_net, LV_ALIGN_LEFT_MID, 0, 0);
|
||||||
lv_label_set_text(lbl_net, "NETWORK DOWN: ---- kBps / UP: ---- kBps");
|
lv_label_set_text(lbl_net, "NETWORK DOWN: ---- kBps / UP: ---- kBps");
|
||||||
|
|
||||||
/* Local sensor readings — right-aligned */
|
/* Local sensor readings — right-aligned */
|
||||||
lbl_local = lv_label_create(bot_cont);
|
lbl_local = lv_label_create(bot_cont);
|
||||||
lv_obj_set_style_text_font(lbl_local, &InziuIosevka_Slab_CC_12px, 0);
|
lv_obj_set_style_text_font(lbl_local, &InziuIosevka_Slab_CC_12px, 0);
|
||||||
lv_obj_set_style_text_color(lbl_local, lv_color_black(), 0);
|
lv_obj_set_style_text_color(lbl_local, lv_color_white(), 0);
|
||||||
lv_obj_align(lbl_local, LV_ALIGN_RIGHT_MID, 0, 0);
|
lv_obj_align(lbl_local, LV_ALIGN_RIGHT_MID, 0, 0);
|
||||||
lv_label_set_text(lbl_local, "T: --.- H: --%");
|
lv_label_set_text(lbl_local, "T: --.- H: --%");
|
||||||
}
|
}
|
||||||
|
|||||||
4
pi/.gitignore
vendored
4
pi/.gitignore
vendored
@@ -3,3 +3,7 @@
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
*.pyo
|
*.pyo
|
||||||
*.pyc
|
*.pyc
|
||||||
|
|
||||||
|
# configs
|
||||||
|
config/
|
||||||
|
!config/alarms.sample.json
|
||||||
@@ -93,6 +93,8 @@ async def handler(ws):
|
|||||||
await send_status_image(ws, current_img)
|
await send_status_image(ws, current_img)
|
||||||
await stream_alarm(ws, alarm["pcm"], alarm["sr"],
|
await stream_alarm(ws, alarm["pcm"], alarm["sr"],
|
||||||
alarm["ch"], alarm["bits"])
|
alarm["ch"], alarm["bits"])
|
||||||
|
# let the image persist a bit more
|
||||||
|
await asyncio.sleep(1)
|
||||||
current_img = img_idle
|
current_img = img_idle
|
||||||
await send_status_image(ws, current_img)
|
await send_status_image(ws, current_img)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user