From 8e4ecbb628ea4eecfa51d5dabfa53f08ab9c4d07 Mon Sep 17 00:00:00 2001 From: Caisking Date: Mon, 25 Aug 2025 10:52:58 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E4=BA=A7=E6=B5=8B=E6=88=90?= =?utf8?q?=E5=8A=9F=E5=A4=B1=E8=B4=A5=E6=8C=89=E9=94=AE=E6=8E=A7=E5=88=B6?= =?utf8?q?=E5=AE=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- code/sdk/zhihui/UI/producttest/include/testModel.h | 3 +++ code/sdk/zhihui/UI/producttest/src/testGPS.cpp | 2 ++ code/sdk/zhihui/UI/producttest/src/testLCD.cpp | 2 ++ code/sdk/zhihui/UI/producttest/src/testSEChipTest.cpp | 2 ++ code/sdk/zhihui/UI/producttest/src/testTP.cpp | 2 ++ code/sdk/zhihui/UI/producttest/src/testbt.cpp | 2 ++ code/sdk/zhihui/UI/producttest/src/testcat1.cpp | 2 ++ code/sdk/zhihui/UI/producttest/src/testchanging.cpp | 2 ++ code/sdk/zhihui/UI/producttest/src/testgsenson.cpp | 2 ++ code/sdk/zhihui/UI/producttest/src/testhrsenson.cpp | 2 ++ code/sdk/zhihui/UI/producttest/src/testluminance.cpp | 2 ++ code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp | 2 ++ code/sdk/zhihui/UI/producttest/src/testmicrophone.cpp | 2 ++ code/sdk/zhihui/UI/producttest/src/testmotor.cpp | 2 ++ code/sdk/zhihui/UI/producttest/src/testspeak.cpp | 2 ++ 15 files changed, 31 insertions(+) diff --git a/code/sdk/zhihui/UI/producttest/include/testModel.h b/code/sdk/zhihui/UI/producttest/include/testModel.h index b49df2c0a..313547992 100644 --- a/code/sdk/zhihui/UI/producttest/include/testModel.h +++ b/code/sdk/zhihui/UI/producttest/include/testModel.h @@ -10,6 +10,9 @@ #define TEST_MODEL_H #include #include + +// 宏控制:是否添加成功/失败按钮 +#define ENABLE_TEST_RESULT_BUTTONS 0 // 1: 启用成功/失败按钮, 0: 禁用成功/失败按钮 namespace OHOS { //测试结果枚举 未测试 成功 失败 diff --git a/code/sdk/zhihui/UI/producttest/src/testGPS.cpp b/code/sdk/zhihui/UI/producttest/src/testGPS.cpp index 8f6c1aa1d..f9627aea2 100644 --- a/code/sdk/zhihui/UI/producttest/src/testGPS.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testGPS.cpp @@ -284,6 +284,7 @@ namespace OHOS testGPSScrollView->SetTouchable(true); testGPSScrollView->SetDraggable(true); +#if ENABLE_TEST_RESULT_BUTTONS // 使用通用的InitLabelButton函数初始化按钮,避免viewId地址过期问题 // 获取GPS测试界面的按钮推荐位置 int okX, okY, failX, failY; @@ -316,6 +317,7 @@ namespace OHOS // 根据当前测试状态更新按钮颜色和状态 testView::GetInstance()->UpdateResultButtonStatus(GPS_TEST, oktestBtn, failtestBtn); +#endif uint32_t tick; osStatus_t retTimer; diff --git a/code/sdk/zhihui/UI/producttest/src/testLCD.cpp b/code/sdk/zhihui/UI/producttest/src/testLCD.cpp index 4c4b79228..205aabec7 100644 --- a/code/sdk/zhihui/UI/producttest/src/testLCD.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testLCD.cpp @@ -197,6 +197,7 @@ namespace OHOS +#if ENABLE_TEST_RESULT_BUTTONS // 使用通用的InitLabelButton函数初始化按钮,避免viewId地址过期问题 // 获取LCD测试界面的按钮推荐位置 int okX, okY, failX, failY; @@ -229,6 +230,7 @@ namespace OHOS // 根据当前测试状态更新按钮颜色和状态 testView::GetInstance()->UpdateResultButtonStatus(LCD_TEST, oktestBtn, failtestBtn); +#endif return true; } diff --git a/code/sdk/zhihui/UI/producttest/src/testSEChipTest.cpp b/code/sdk/zhihui/UI/producttest/src/testSEChipTest.cpp index 3c58c16cd..4aa88c7f1 100644 --- a/code/sdk/zhihui/UI/producttest/src/testSEChipTest.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testSEChipTest.cpp @@ -247,6 +247,7 @@ namespace OHOS Title= testAboutView::GetInstance()->init_title(142,40,"SEChip_TEST"); testSEChipScrollView->Add(Title); +#if ENABLE_TEST_RESULT_BUTTONS // 使用通用的InitLabelButton函数初始化按钮,避免viewId地址过期问题 // 获取SE Chip测试界面的按钮推荐位置 int okX, okY, failX, failY; @@ -279,6 +280,7 @@ namespace OHOS // 根据当前测试状态更新按钮颜色和状态 testView::GetInstance()->UpdateResultButtonStatus(APPI_TEST, oktestBtn, failtestBtn); +#endif // uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); // if (cnt == 0) { diff --git a/code/sdk/zhihui/UI/producttest/src/testTP.cpp b/code/sdk/zhihui/UI/producttest/src/testTP.cpp index 698bd4f13..fde76650e 100644 --- a/code/sdk/zhihui/UI/producttest/src/testTP.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testTP.cpp @@ -208,6 +208,7 @@ namespace OHOS +#if ENABLE_TEST_RESULT_BUTTONS // 使用通用的InitLabelButton函数初始化按钮,避免viewId地址过期问题 // 获取TP测试界面的按钮推荐位置 int okX, okY, failX, failY; @@ -240,6 +241,7 @@ namespace OHOS // 根据当前测试状态更新按钮颜色和状态 testView::GetInstance()->UpdateResultButtonStatus(TP_TEST, oktestBtn, failtestBtn); +#endif return true; } diff --git a/code/sdk/zhihui/UI/producttest/src/testbt.cpp b/code/sdk/zhihui/UI/producttest/src/testbt.cpp index 7225da643..a465ded4e 100644 --- a/code/sdk/zhihui/UI/producttest/src/testbt.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testbt.cpp @@ -402,6 +402,7 @@ namespace OHOS discovery_falg=false; +#if ENABLE_TEST_RESULT_BUTTONS // 使用通用的InitLabelButton函数初始化按钮,避免viewId地址过期问题 // 获取BT测试界面的按钮推荐位置 int okX, okY, failX, failY; @@ -434,6 +435,7 @@ namespace OHOS // 根据当前测试状态更新按钮颜色和状态 testView::GetInstance()->UpdateResultButtonStatus(BT_TEST, oktestBtn, failtestBtn); +#endif // uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); // if (cnt == 0) { diff --git a/code/sdk/zhihui/UI/producttest/src/testcat1.cpp b/code/sdk/zhihui/UI/producttest/src/testcat1.cpp index 01c722d82..9996c02b3 100644 --- a/code/sdk/zhihui/UI/producttest/src/testcat1.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testcat1.cpp @@ -354,6 +354,7 @@ namespace OHOS testcat1ScrollView->SetTouchable(true); testcat1ScrollView->SetDraggable(true); +#if ENABLE_TEST_RESULT_BUTTONS // 使用通用的InitLabelButton函数初始化按钮,避免viewId地址过期问题 // 获取CAT1测试界面的按钮推荐位置 int okX, okY, failX, failY; @@ -386,6 +387,7 @@ namespace OHOS // 根据当前测试状态更新按钮颜色和状态 testView::GetInstance()->UpdateResultButtonStatus(CAT1_TEST, oktestBtn, failtestBtn); +#endif uint32_t tick; osStatus_t retTimer; diff --git a/code/sdk/zhihui/UI/producttest/src/testchanging.cpp b/code/sdk/zhihui/UI/producttest/src/testchanging.cpp index eb2612160..20a2ccb33 100644 --- a/code/sdk/zhihui/UI/producttest/src/testchanging.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testchanging.cpp @@ -222,6 +222,7 @@ namespace OHOS charnge_label= testAboutView::GetInstance()->init_title(100,250,battery_buf); testCHANINGScrollView->Add(charnge_label); +#if ENABLE_TEST_RESULT_BUTTONS // 使用通用的InitLabelButton函数初始化按钮,避免viewId地址过期问题 // 获取充电测试界面的按钮推荐位置 int okX, okY, failX, failY; @@ -254,6 +255,7 @@ namespace OHOS // 根据当前测试状态更新按钮颜色和状态 testView::GetInstance()->UpdateResultButtonStatus(BAT_TEST, oktestBtn, failtestBtn); +#endif // uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); // if (cnt == 0) { diff --git a/code/sdk/zhihui/UI/producttest/src/testgsenson.cpp b/code/sdk/zhihui/UI/producttest/src/testgsenson.cpp index ed0d26364..b3596567a 100644 --- a/code/sdk/zhihui/UI/producttest/src/testgsenson.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testgsenson.cpp @@ -313,6 +313,7 @@ namespace OHOS testGsonsonScrollView->SetTouchable(true); testGsonsonScrollView->SetDraggable(true); +#if ENABLE_TEST_RESULT_BUTTONS // 使用通用的InitLabelButton函数初始化按钮,避免viewId地址过期问题 // 获取G-Sensor测试界面的按钮推荐位置 int okX, okY, failX, failY; @@ -345,6 +346,7 @@ namespace OHOS // 根据当前测试状态更新按钮颜色和状态 testView::GetInstance()->UpdateResultButtonStatus(GSENSOR_TEST, oktestBtn, failtestBtn); +#endif return true; } diff --git a/code/sdk/zhihui/UI/producttest/src/testhrsenson.cpp b/code/sdk/zhihui/UI/producttest/src/testhrsenson.cpp index 01d78efed..be20567a2 100644 --- a/code/sdk/zhihui/UI/producttest/src/testhrsenson.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testhrsenson.cpp @@ -308,6 +308,7 @@ namespace OHOS testhrsensonScrollView->SetTouchable(true); testhrsensonScrollView->SetDraggable(true); +#if ENABLE_TEST_RESULT_BUTTONS // 使用通用的InitLabelButton函数初始化按钮,避免viewId地址过期问题 // 获取心率传感器测试界面的按钮推荐位置 int okX, okY, failX, failY; @@ -340,6 +341,7 @@ namespace OHOS // 根据当前测试状态更新按钮颜色和状态 testView::GetInstance()->UpdateResultButtonStatus(HR_TEST, oktestBtn, failtestBtn); +#endif #ifdef SUPPORT_PPG_SERVICE int8_t md = PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST; diff --git a/code/sdk/zhihui/UI/producttest/src/testluminance.cpp b/code/sdk/zhihui/UI/producttest/src/testluminance.cpp index c0f18bc35..ab68b6553 100644 --- a/code/sdk/zhihui/UI/producttest/src/testluminance.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testluminance.cpp @@ -151,6 +151,7 @@ namespace OHOS Title= testAboutView::GetInstance()->init_title(99,54,"BRIGHTNESS_TEST"); testLUMScrollView->Add(Title); +#if ENABLE_TEST_RESULT_BUTTONS // 使用通用的InitLabelButton函数初始化按钮,避免viewId地址过期问题 // 获取亮度测试界面的按钮推荐位置 int okX, okY, failX, failY; @@ -183,6 +184,7 @@ namespace OHOS // 根据当前测试状态更新按钮颜色和状态 testView::GetInstance()->UpdateResultButtonStatus(LUMINANCE_TEST, oktestBtn, failtestBtn); +#endif // uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); // if (cnt == 0) { diff --git a/code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp b/code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp index 5a32c16d6..49dfd358e 100644 --- a/code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp @@ -302,6 +302,7 @@ namespace OHOS testmagicScrollView->SetTouchable(true); testmagicScrollView->SetDraggable(true); +#if ENABLE_TEST_RESULT_BUTTONS // 使用通用的InitLabelButton函数初始化按钮,避免viewId地址过期问题 // 获取磁力计测试界面的按钮推荐位置 int okX, okY, failX, failY; @@ -334,6 +335,7 @@ namespace OHOS // 根据当前测试状态更新按钮颜色和状态 testView::GetInstance()->UpdateResultButtonStatus(MAGETIC_TEST, oktestBtn, failtestBtn); +#endif // uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); // if (cnt == 0) { diff --git a/code/sdk/zhihui/UI/producttest/src/testmicrophone.cpp b/code/sdk/zhihui/UI/producttest/src/testmicrophone.cpp index 24bc9055e..b8c8388fa 100644 --- a/code/sdk/zhihui/UI/producttest/src/testmicrophone.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testmicrophone.cpp @@ -322,6 +322,7 @@ namespace OHOS testmakephoneScrollView->SetTouchable(true); testmakephoneScrollView->SetDraggable(true); +#if ENABLE_TEST_RESULT_BUTTONS // 使用通用的InitLabelButton函数初始化按钮,避免viewId地址过期问题 // 获取麦克风测试界面的按钮推荐位置 int okX, okY, failX, failY; @@ -354,6 +355,7 @@ namespace OHOS // 根据当前测试状态更新按钮颜色和状态 testView::GetInstance()->UpdateResultButtonStatus(MIC_TEST, oktestBtn, failtestBtn); +#endif // uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); // if (cnt == 0) { diff --git a/code/sdk/zhihui/UI/producttest/src/testmotor.cpp b/code/sdk/zhihui/UI/producttest/src/testmotor.cpp index 604033e23..bb659e7ff 100644 --- a/code/sdk/zhihui/UI/producttest/src/testmotor.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testmotor.cpp @@ -224,6 +224,7 @@ namespace OHOS Title= testAboutView::GetInstance()->init_title(136,45,"MOTOR_TEST"); tesMOTORScrollView->Add(Title); +#if ENABLE_TEST_RESULT_BUTTONS // 使用通用的InitLabelButton函数初始化按钮,避免viewId地址过期问题 // 获取马达测试界面的按钮推荐位置 int okX, okY, failX, failY; @@ -256,6 +257,7 @@ namespace OHOS // 根据当前测试状态更新按钮颜色和状态 testView::GetInstance()->UpdateResultButtonStatus(MOTOR_TEST, oktestBtn, failtestBtn); +#endif // uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); // if (cnt == 0) { diff --git a/code/sdk/zhihui/UI/producttest/src/testspeak.cpp b/code/sdk/zhihui/UI/producttest/src/testspeak.cpp index 4d62f2c4a..1731905b6 100644 --- a/code/sdk/zhihui/UI/producttest/src/testspeak.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testspeak.cpp @@ -251,6 +251,7 @@ namespace OHOS testSPEAKScrollView->SetTouchable(true); testSPEAKScrollView->SetDraggable(true); +#if ENABLE_TEST_RESULT_BUTTONS // 使用通用的InitLabelButton函数初始化按钮,避免viewId地址过期问题 // 获取扬声器测试界面的按钮推荐位置 int okX, okY, failX, failY; @@ -283,6 +284,7 @@ namespace OHOS // 根据当前测试状态更新按钮颜色和状态 testView::GetInstance()->UpdateResultButtonStatus(SPK_TEST, oktestBtn, failtestBtn); +#endif // uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); // if (cnt == 0) { -- 2.17.1