增加产测成功失败按键控制宏
authorCaisking <Casiking@zhihuishixun.com>
Mon, 25 Aug 2025 02:52:58 +0000 (10:52 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Mon, 25 Aug 2025 02:52:58 +0000 (10:52 +0800)
15 files changed:
code/sdk/zhihui/UI/producttest/include/testModel.h
code/sdk/zhihui/UI/producttest/src/testGPS.cpp
code/sdk/zhihui/UI/producttest/src/testLCD.cpp
code/sdk/zhihui/UI/producttest/src/testSEChipTest.cpp
code/sdk/zhihui/UI/producttest/src/testTP.cpp
code/sdk/zhihui/UI/producttest/src/testbt.cpp
code/sdk/zhihui/UI/producttest/src/testcat1.cpp
code/sdk/zhihui/UI/producttest/src/testchanging.cpp
code/sdk/zhihui/UI/producttest/src/testgsenson.cpp
code/sdk/zhihui/UI/producttest/src/testhrsenson.cpp
code/sdk/zhihui/UI/producttest/src/testluminance.cpp
code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp
code/sdk/zhihui/UI/producttest/src/testmicrophone.cpp
code/sdk/zhihui/UI/producttest/src/testmotor.cpp
code/sdk/zhihui/UI/producttest/src/testspeak.cpp

index b49df2c..3135479 100644 (file)
@@ -10,6 +10,9 @@
 #define TEST_MODEL_H
 #include <stdint.h>
 #include <string>
+
+// 宏控制:是否添加成功/失败按钮
+#define ENABLE_TEST_RESULT_BUTTONS 0  // 1: 启用成功/失败按钮, 0: 禁用成功/失败按钮
 namespace OHOS
 {
     //测试结果枚举 未测试 成功 失败
index 8f6c1aa..f9627ae 100644 (file)
@@ -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;
index 4c4b792..205aabe 100644 (file)
@@ -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;
     }
index 3c58c16..4aa88c7 100644 (file)
@@ -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) {
index 698bd4f..fde7665 100644 (file)
@@ -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;
     }
index 7225da6..a465ded 100644 (file)
@@ -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) {
index 01c722d..9996c02 100644 (file)
@@ -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;
index eb26121..20a2ccb 100644 (file)
@@ -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) {
index ed0d263..b359656 100644 (file)
@@ -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;
     }
index 01d78ef..be20567 100644 (file)
@@ -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;
index c0f18bc..ab68b65 100644 (file)
@@ -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) {
index 5a32c16..49dfd35 100644 (file)
@@ -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) {
index 24bc905..b8c8388 100644 (file)
@@ -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) {
index 604033e..bb659e7 100644 (file)
@@ -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) {
index 4d62f2c..1731905 100644 (file)
@@ -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) {