产测界面合并
authorluozheng <1732036298@qq.com>
Tue, 24 Jun 2025 07:48:43 +0000 (15:48 +0800)
committerluozheng <1732036298@qq.com>
Tue, 24 Jun 2025 07:48:43 +0000 (15:48 +0800)
code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp
code/sdk/build/config/target_config/brandy/config.py
code/sdk/zhihui/UI/producttest/CMakeLists.txt
code/sdk/zhihui/UI/producttest/include/testPresenter.h
code/sdk/zhihui/UI/producttest/src/testPing.cpp
code/sdk/zhihui/UI/producttest/src/testPresenter.cpp
code/sdk/zhihui/UI/producttest/src/testView.cpp
code/sdk/zhihui/UI/producttest/src/testcat1.cpp
code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp

index 6ceedcf..c4d1273 100644 (file)
@@ -434,21 +434,16 @@ void MsgCenterNotifyChargePlugProc(const Topic topic, Request* req)
     }
 
     
-    // if(IsTestCHANGINGViewCreated())
-    // {
-    //     ChangeViewcolorC(1);
-    // }
-    // else
-    // {
-    //     if (CheckPriority(topic) && !uapi_dev_runtime_get_factory_test_status_flag()) //产测模式不弹充电弹窗
-    //     {
-    //         NotificationManager::GetInstance()->ShowNotify(ShowChargeingNotify, (uint16_t)topic, true);
-    //     }
-    // }
-
-    if (CheckPriority(topic) && !uapi_dev_runtime_get_factory_test_status_flag()) //产测模式不弹充电弹窗
+    if(IsTestCHANGINGViewCreated())
     {
-        NotificationManager::GetInstance()->ShowNotify(ShowChargeingNotify, (uint16_t)topic, true);
+        ChangeViewcolorC(1);
+    }
+    else
+    {
+        if (CheckPriority(topic) && !uapi_dev_runtime_get_factory_test_status_flag()) //产测模式不弹充电弹窗
+        {
+            NotificationManager::GetInstance()->ShowNotify(ShowChargeingNotify, (uint16_t)topic, true);
+        }
     }
 }
 
@@ -472,21 +467,16 @@ void MsgCenterNotifyChargeUnPlugProc(const Topic topic, Request* req)
     SaveEleModel::GetInstance()->SetChargeStatus(false);
 
 
-    // if(IsTestCHANGINGViewCreated())
-    // {
-    //     ChangeViewcolorC(0);
-    // }
-    // else
-    // {
-    //     if(is_UIViewGroup_charge())
-    //     {
-    //         NotificationManager::GetInstance()->StopNotify();
-    //     }
-    // }
-
-    if(is_UIViewGroup_charge())
+    if(IsTestCHANGINGViewCreated())
     {
-        NotificationManager::GetInstance()->StopNotify();
+        ChangeViewcolorC(0);
+    }
+    else
+    {
+        if(is_UIViewGroup_charge())
+        {
+            NotificationManager::GetInstance()->StopNotify();
+        }
     }
 }
 
index d05b149..d9af678 100644 (file)
@@ -408,7 +408,7 @@ target = {
                            "transspecard",
                            "factorytest_service",
                         #    "hid_service",
-                        #    "producttest",
+                           "producttest",
                             "ppg_hal",
                             "mag_hal",
                             "mag_service",
index e3e73c1..e9cb223 100644 (file)
@@ -55,6 +55,7 @@ set(PRIVATE_HEADER
    
     ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/utils/innerkits
     ${ROOT_DIR}/zhihui/services/factorytest_service
+    ${ROOT_DIR}/zhihui/drivers/
     # /home/hcj/615/FD230/code/sdk/application/wearable/nativeapp/nativeui/player/include/PlayersPresenter.h
     # /home/hcj/615/FD230/code/sdk/middleware/services/gui/uikit/ui/frameworks/font/glyphs_manager.h
     # /home/hcj/615/FD230/code/sdk//UiServersMsg.h
index e1aedea..f207f71 100644 (file)
@@ -78,9 +78,6 @@ namespace OHOS
         virtual ~testPresenter();\r
 \r
         void OnStart() override;\r
-        void OnPause() override;\r
-        void OnResume() override;\r
-        void OnStop() override;\r
 \r
         static testPresenter *GetInstance();\r
 \r
@@ -89,7 +86,7 @@ namespace OHOS
         bool OnClick(UIView &view, const ClickEvent &event) override;\r
         bool OnDrag(UIView &view, const DragEvent &event) override;\r
         bool OnDragEnd(UIView &view, const DragEvent &event) override;\r
-        bool OnPress(UIView &view, const PressEvent &event);\r
+        bool OnPress(UIView &view, const PressEvent &event) override;\r
         bool OnKeyAct(UIView &view, const KeyEvent &event);\r
         bool OnRotate(UIView& view, const RotateEvent& event);\r
         bool OnRotateEnd(UIView& view, const RotateEvent& event);\r
index e037957..04b7e63 100644 (file)
@@ -152,9 +152,11 @@ namespace OHOS
         char hostname[20] = {0};
         char result[256] = {0};
         #ifdef SUPPORT_CAT1_SERVICE
+        #ifdef FD230_650
         get_ping_hostname(hostname,sizeof(hostname));
         get_ping_result(result,sizeof(result));
         #endif
+        #endif
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "result : %s ",result);
         OHOS::testPingView *pview = OHOS::testPingView::GetInstance();
         pview->sethostname(hostname);
index 46a833c..e212fd6 100644 (file)
@@ -4,12 +4,13 @@
     #include"ui_resource_string.h"\r
 #endif\r
 \r
+#include "NativeRegisterManager.h"\r
 #include "NativeAbility.h"\r
 #include "graphic_math.h"\r
 #include "string.h"\r
 #include "producttest/include/testPresenter.h"\r
-#include "font/font_global_manager.h"\r
-#include "font/ui_font.h"\r
+// #include "font/font_global_manager.h"\r
+// #include "font/ui_font.h"\r
 #ifdef FD230\r
     #include "languagecode/LanguageInit.h"\r
 #endif\r
@@ -18,7 +19,9 @@
 #include "components/ui_slider.h"\r
 \r
 #include "audio_capture_wrapper.h"\r
+#ifdef SUPPORT_CYWEE_SERVICE\r
 #include "cywee_service.h"\r
+#endif\r
 \r
 #ifdef FD230\r
     #include "factorytest_protocol.h"\r
@@ -34,7 +37,7 @@
 \r
 namespace OHOS\r
 {\r
-\r
+    REGIST_SLICE(VIEW_TEST, testView, testPresenter);\r
     \r
 \r
     static char* view_id_str[]=\r
@@ -80,41 +83,11 @@ namespace OHOS
     \r
     void testPresenter::OnStart()\r
     {\r
-\r
-        Presenter<testView>::OnStart();\r
-    }\r
-\r
-    void testPresenter::OnPause(void)\r
-    {\r
-\r
-        Presenter<testView>::OnPause();\r
     }\r
 \r
     bool testPresenter::OnPress(UIView &view, const PressEvent &event)\r
     {\r
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemPresenter::");\r
-        // for(int i=0;i<16;i++)\r
-        // // {\r
-        // //     if(strcmp(view.GetViewId(),view_id_str[i]) == 0)\r
-        // //     {\r
-        // //         testTPView::GetInstance()->ChangeViewcolor(i);\r
-               \r
-        // //     }\r
-        // }\r
         return true;\r
-\r
-    }\r
-\r
-    void testPresenter::OnResume(void)\r
-    {\r
-\r
-        Presenter<testView>::OnResume();\r
-    }\r
-\r
-    void testPresenter::OnStop(void)\r
-    {\r
-\r
-        Presenter<testView>::OnStop();\r
     }\r
 \r
     bool testPresenter::OnDrag(UIView &view, const DragEvent &event)\r
@@ -191,18 +164,25 @@ namespace OHOS
         }\r
         if(strcmp(view.GetViewId(),"shutdown") == 0)\r
         {\r
+            #ifdef FD230_650\r
             uapi_poweroff_device();\r
+            #endif\r
             return true;\r
         }\r
         if(strcmp(view.GetViewId(),"reset") == 0)\r
         {\r
+            #ifdef FD230_650\r
             uapi_reboot_device();\r
+            #endif\r
+\r
             return true;\r
         }\r
         if(strcmp(view.GetViewId(),"deepsleep") == 0)\r
         {\r
             //TODO: close bt and cat1 , then deepsleep\r
+            #ifdef SUPPORT_CYWEE_SERVICE\r
             do_cywee_service_check_msg(CYWEE_SERVICE_CMD_STOP_ACC,NULL);\r
+            #endif\r
             stop_custom_ble_service();\r
             LOS_Msleep(50);\r
             uapi_set4GCapability(false);\r
@@ -312,7 +292,9 @@ namespace OHOS
         }\r
         if(strcmp(view.GetViewId(),"deep") == 0)\r
         { \r
+            #ifdef SUPPORT_CYWEE_SERVICE\r
             do_cywee_service_check_msg(CYWEE_SERVICE_CMD_STOP_ACC,NULL);\r
+            #endif\r
             stop_custom_ble_service();\r
             LOS_Msleep(50);\r
             uapi_set4GCapability(false);\r
index 10e318d..88374fb 100644 (file)
@@ -324,7 +324,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
         if (SystemScrollView[thisView] == nullptr)\r
         {\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemView");\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -342,7 +342,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_about_view->SystemAbouTheWatchtInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -359,7 +359,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_LCD_view->testLCDInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -376,7 +376,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_TP_view->testTPInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -393,7 +393,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_MG_view->testmagicInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -410,7 +410,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_lum_view->testLUMInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -427,7 +427,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_charging_view->testCHANINGInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -444,7 +444,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_speak_view->testSPEAKInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -461,7 +461,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_motor_view->testMOTORInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -479,7 +479,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_cat1_view->testcat1InitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         #endif\r
         return true;\r
@@ -497,7 +497,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_KEY_view->testBUTTONInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -514,7 +514,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_MP_view->testmicrophoneInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -531,7 +531,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_hr_view->testhrsensonInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -549,7 +549,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_G_view->testGSENSONInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -568,7 +568,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_old_view->testoldInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
           #endif\r
         return true;\r
@@ -588,7 +588,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_BT_view->testBTInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -606,7 +606,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_SEChip_view->SEChipInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -623,7 +623,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_Ping_view->testPingInitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -642,7 +642,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_GPS_view->testGPSInitIView((uint8_t)thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
 #endif\r
         return true;\r
@@ -661,7 +661,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_pressure_view->testpressureInitIView((uint8_t)thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
 \r
         return true;\r
@@ -682,7 +682,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
                 return false;\r
             }\r
             SystemScrollView[thisView] = test_A5133_view->testA5133InitIView(thisView);\r
-            RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+            AddViewToRootContainer(SystemScrollView[thisView]);\r
         }\r
         return true;\r
     }\r
@@ -874,8 +874,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
 \r
     void testView::OnStart()\r
     {\r
-         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnStart>>>>>>>>>>>>>");\r
-        View<testPresenter>::OnStart();\r
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnStart>>>>>>>>>>>>>");\r
         //InitIView();\r
         initView_ext(43,120,380,100,120,"/user/res/SETTING_NEXT.bin");\r
         const power_display_svr_api_t *display_api = power_display_svr_get_api();\r
@@ -890,7 +889,6 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
 \r
         start_custom_ble_service();\r
 \r
-        View<testPresenter>::OnSetUpView();\r
         if (SystemScrollView[TESTVIEW] == nullptr)\r
         {\r
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: OnSetUpView  has nullptr");\r
@@ -911,7 +909,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0);
         // SystemScrollView[SYSTEMVIEW]->Add(FactoryResetButton);\r
         // SystemScrollView[SYSTEMVIEW]->Add(SystemUpgradeButtonExt);\r
 \r
-        RootView::GetInstance()->Add(SystemScrollView[TESTVIEW]);\r
+        AddViewToRootContainer(SystemScrollView[TESTVIEW]);\r
     }\r
 \r
     \r
index a0ff0cd..b11514a 100644 (file)
@@ -153,7 +153,9 @@ namespace OHOS
     {
         if(button!=NULL)
         {
+            #ifdef FD230_650
             calldial_event_sendmsg_toUI(phone);
+            #endif
             RootView::GetInstance()->Invalidate();
            
         }
index 6ab8291..f5a508b 100644 (file)
@@ -23,6 +23,7 @@ extern "C"
 #if __cplusplus
 }
 #endif
+#include "mag/mmc5603/mmc5603_hal.h"
 #endif
 
 namespace OHOS