Browse Source

调整UI位置

3lead_uart_test_ok_version
zhaohe 1 year ago
parent
commit
f03664ddd8
  1. 2
      README.md
  2. 2
      app/src/one_conduction/config.h
  3. 40
      app/src/one_conduction/display_manager.c
  4. 2
      app/src/one_conduction/one_conduction_main.c

2
README.md

@ -260,7 +260,7 @@ TODO:
8. 采集完30秒,蜂鸣器滴一声,采集完成,蜂鸣器滴一声
16. 调整UI位置
11. 死机后一直重启的BUG OK
12. 修改蓝牙名称
12. 修改蓝牙名称 OK
--------------------------------------------------------------
2. UI添加蓝牙状态

2
app/src/one_conduction/config.h

@ -19,4 +19,4 @@
#define SAMPLE_PRECISION 12
#define AUTOMATIC_SLEEP_TIME 15000
#define SAMPLE_MIN_TIME_S (5.0)
#define SAMPLE_MIN_TIME_S (30.0)

40
app/src/one_conduction/display_manager.c

@ -7,10 +7,10 @@
#include "basic/ssd1306/driver_ssd1306.h"
#include "basic/ssd1306/driver_ssd1306_basic.h"
#include "basic/ssd1306/wave_drawer.h"
#include "config.h"
#include "font.h"
#include "heart_wave_sample_service.h"
#include "one_conduction_board.h"
#include "config.h"
PageState_t g_pageState;
void dsp_mgr_change_to_page(page_t page) { //
@ -279,18 +279,18 @@ void samplePage_update_state(int progress_s, int wave_y, int heartrate, bool upd
void dsp_mgr_change_to_sampling(int progress_s, int heartrate) { //
sample_page_state_t* sps = &m_sample_page_state;
sps->progress_x = SMAPLE_PAGE_START_X + 1;
sps->progress_y = SMAPLE_PAGE_START_Y;
sps->progress_width = 110;
sps->progress_x = SMAPLE_PAGE_START_X + 10;
sps->progress_y = SMAPLE_PAGE_START_Y + 2;
sps->progress_width = 100;
sps->progress_hight = 8;
sps->wave_drawser_x = SMAPLE_PAGE_START_X;
sps->wave_drawser_y = SMAPLE_PAGE_START_Y + sps->progress_hight + 10;
sps->wave_drawser_hight = 40;
sps->wave_drawser_width = 100;
sps->wave_drawser_x = SMAPLE_PAGE_START_X + 5;
sps->wave_drawser_y = SMAPLE_PAGE_START_Y + sps->progress_hight + 5;
sps->wave_drawser_hight = 45;
sps->wave_drawser_width = 90;
sps->heartrate_x = sps->wave_drawser_x + sps->wave_drawser_width + 5;
sps->heartrate_y = sps->wave_drawser_y;
sps->heartrate_y = sps->wave_drawser_y + 5;
int progress = progress_s / SAMPLE_MIN_TIME_S * 25;
uint8_t xchange, ychange;
@ -298,18 +298,18 @@ void dsp_mgr_change_to_sampling(int progress_s, int heartrate) { //
ssd1306_basic_clear_gram();
/**
* @brief
* =============== o
* =================
* | | ÐÄ
* | wave |
* | | ÐÄÂÊ
*/
ssd1306_basic_draw_progress(sps->progress_x, sps->progress_y, sps->progress_width, sps->progress_hight, 25, progress);
ssd1306_basic_draw_str(sps->progress_x + sps->progress_width + 2, sps->progress_y, &xchange, &ychange, "x", &font8x8_xo_lib);
// ssd1306_basic_draw_str(sps->progress_x + sps->progress_width + 2, sps->progress_y, &xchange, &ychange, "x", &font8x8_xo_lib);
wave_drawer_init(&sps->wave_drawer, sps->wave_drawser_x, sps->wave_drawser_y, sps->wave_drawser_width, sps->wave_drawser_hight);
wave_drawer_draw_border(&sps->wave_drawer);
// wave_drawer_draw_border(&sps->wave_drawer);
ssd1306_basic_draw_str(sps->heartrate_x, sps->heartrate_y, &xchange, &ychange, "<>", &font_asicc16x8_lib);
ssd1306_basic_draw_str(sps->heartrate_x + 2, sps->heartrate_y, &xchange, &ychange, "<>", &font_asicc16x8_lib);
if (heartrate <= 0) {
ssd1306_basic_draw_str(sps->heartrate_x, sps->heartrate_y + 20, &xchange, &ychange, "-- ", &font_asicc16x8_lib);
} else {
@ -327,13 +327,13 @@ void samplePage_update_state(int progress_s, int wave_y, int heartrate, bool upd
int progress = progress_s / SAMPLE_MIN_TIME_S * 25;
ssd1306_basic_draw_progress(sps->progress_x, sps->progress_y, sps->progress_width, sps->progress_hight, 25, progress);
if (progress_s / 10 >= 3) {
ssd1306_basic_draw_str(sps->progress_x + sps->progress_width + 2, sps->progress_y, &xchange, &ychange, "o", &font8x8_xo_lib);
} else {
ssd1306_basic_draw_str(sps->progress_x + sps->progress_width + 2, sps->progress_y, &xchange, &ychange, "x", &font8x8_xo_lib);
}
// if (progress_s / 10 >= 3) {
// ssd1306_basic_draw_str(sps->progress_x + sps->progress_width + 2, sps->progress_y, &xchange, &ychange, "o", &font8x8_xo_lib);
// } else {
// ssd1306_basic_draw_str(sps->progress_x + sps->progress_width + 2, sps->progress_y, &xchange, &ychange, "x", &font8x8_xo_lib);
// }
ssd1306_basic_draw_str(sps->heartrate_x, sps->heartrate_y, &xchange, &ychange, "<>", &font_asicc16x8_lib);
ssd1306_basic_draw_str(sps->heartrate_x + 2, sps->heartrate_y, &xchange, &ychange, "<>", &font_asicc16x8_lib);
if (heartrate <= 0) {
ssd1306_basic_draw_str(sps->heartrate_x, sps->heartrate_y + 20, &xchange, &ychange, "-- ", &font_asicc16x8_lib);
} else {
@ -350,7 +350,7 @@ void samplePage_schedule() {
int wave_y = (int)hwss_read_val();
int heartrate = (int)hwss_read_heart_rate();
// ZLOGI("samplePage_schedule %d %d %d", capturetime, wave_y, heartrate);
samplePage_update_state(capturetime / 1000, wave_y, heartrate, count % 10 == 0);
samplePage_update_state(capturetime / 1000, wave_y, 123, count % 10 == 0);
}
/*******************************************************************************

2
app/src/one_conduction/one_conduction_main.c

@ -399,7 +399,7 @@ void one_conduction_main() {
ztm_t tm;
znordic_rtc_gettime(&tm);
NRF_LOG_INFO("RTC time :%d-%d-%d %d:%d:%d", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
static uint8_t ble_name[20];
static char ble_name[20];
sn_t sn;
device_info_read_sn(&sn);
memcpy(ble_name, sn.sn, sizeof(sn.sn));

Loading…
Cancel
Save