From: penglei <1624952103@qq.com> Date: Fri, 10 Jan 2025 03:20:45 +0000 (+0800) Subject: u8气压计产测UI添加数据更新 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=989e586560fb149e5cfc463046ad2c768d6bada3;p=mirrors%2FFD230.git u8气压计产测UI添加数据更新 --- diff --git a/code/sdk/zhihui/UI/producttest/src/testpressure.cpp b/code/sdk/zhihui/UI/producttest/src/testpressure.cpp index 950a5e1bf..3f3d076ab 100644 --- a/code/sdk/zhihui/UI/producttest/src/testpressure.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testpressure.cpp @@ -8,6 +8,24 @@ // #include "gnss_sample.h" #include "graphic_service.h" +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif +#ifdef ENABLE_LQBP002TA +#include "lqbp_service.h" +#include "lqbp002ta.h" +#endif +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif + + + namespace OHOS { @@ -35,6 +53,9 @@ namespace OHOS void testpressureView::ClearAll() { +#ifdef ENABLE_LQBP002TA + do_lqbp_service_check_msg(LQBP_SERVICE_CMD_STOP_CHECK); +#endif if(testpressureScrollView) { testpressureScrollView->RemoveAll(); @@ -120,6 +141,18 @@ namespace OHOS void testpressureView:: pressuredataTimerCallBack(void) { //此处实现数据刷新 +#ifdef ENABLE_LQBP002TA + float temp = lqbp002ta_get_temp(); + float pressure = lqbp002ta_get_pressure(); + char buf1[32]={0}; + char buf2[32]={0}; + sprintf(buf1,"temp:%.2f",temp); + sprintf(buf2,"pressure:%.2f",pressure); + + label_1_MSG->SetText(buf1); + label_2_MSG->SetText(buf2); + RootView::GetInstance()->Invalidate(); +#endif } void pressuredataTimerCallBackproc() @@ -154,11 +187,11 @@ namespace OHOS LabelConfig Config = { .left = 50, - .top = 85, - .width = Screen::GetInstance().GetWidth()-80, + .top = 100, + .width = 350, .height = 35, - .fontSize = 20, - .lineHeigh = 25, + .fontSize = 40, + .lineHeigh = 35, .text = "", .lineBreakMode = UILabel::LINE_BREAK_WRAP, }; @@ -172,10 +205,10 @@ namespace OHOS Config = { .left = 50, - .top = 50, + .top = 200, .width = 350, - .height = 30, - .fontSize = 25, + .height = 35, + .fontSize = 40, .lineHeigh = 35, .text = "", .lineBreakMode = UILabel::LINE_BREAK_WRAP, @@ -193,12 +226,17 @@ namespace OHOS labelButton_next= testAboutView::GetInstance()->init_button_next(267,320,Test_ViewMapper_t[id].viewid_str_next); testpressureScrollView->Add(labelButton_next); - Title= testAboutView::GetInstance()->init_title(165,45,"PRESSURE_TEST"); + Title= testAboutView::GetInstance()->init_title(125,45,"PRESSURE_TEST"); testpressureScrollView->Add(Title); testpressureScrollView->SetTouchable(true); testpressureScrollView->SetDraggable(true); + +#ifdef ENABLE_LQBP002TA + do_lqbp_service_check_msg(LQBP_SERVICE_CMD_START_CHECK); +#endif + uint32_t tick; osStatus_t retTimer; P_TEST_timer = osTimerNew((osTimerFunc_t)pressuredataTimerCallBackproc, osTimerPeriodic, NULL, NULL);