From 8d47fa108676fcb573b2ec7e0605efeb30d79e3e Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Tue, 24 Jun 2025 15:48:43 +0800 Subject: [PATCH] =?utf8?q?=E4=BA=A7=E6=B5=8B=E7=95=8C=E9=9D=A2=E5=90=88?= =?utf8?q?=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../msg_center/src/msg_center_customer.cpp | 46 +++++++----------- .../config/target_config/brandy/config.py | 2 +- code/sdk/zhihui/UI/producttest/CMakeLists.txt | 1 + .../UI/producttest/include/testPresenter.h | 5 +- .../zhihui/UI/producttest/src/testPing.cpp | 2 + .../UI/producttest/src/testPresenter.cpp | 48 ++++++------------- .../zhihui/UI/producttest/src/testView.cpp | 48 +++++++++---------- .../zhihui/UI/producttest/src/testcat1.cpp | 2 + .../UI/producttest/src/testmagnetic.cpp | 1 + 9 files changed, 64 insertions(+), 91 deletions(-) diff --git a/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp index 6ceedcf6a..c4d12737e 100644 --- a/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp @@ -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(); + } } } diff --git a/code/sdk/build/config/target_config/brandy/config.py b/code/sdk/build/config/target_config/brandy/config.py index d05b14986..d9af678a2 100644 --- a/code/sdk/build/config/target_config/brandy/config.py +++ b/code/sdk/build/config/target_config/brandy/config.py @@ -408,7 +408,7 @@ target = { "transspecard", "factorytest_service", # "hid_service", - # "producttest", + "producttest", "ppg_hal", "mag_hal", "mag_service", diff --git a/code/sdk/zhihui/UI/producttest/CMakeLists.txt b/code/sdk/zhihui/UI/producttest/CMakeLists.txt index e3e73c1c0..e9cb223a1 100644 --- a/code/sdk/zhihui/UI/producttest/CMakeLists.txt +++ b/code/sdk/zhihui/UI/producttest/CMakeLists.txt @@ -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 diff --git a/code/sdk/zhihui/UI/producttest/include/testPresenter.h b/code/sdk/zhihui/UI/producttest/include/testPresenter.h index e1aedea50..f207f7105 100644 --- a/code/sdk/zhihui/UI/producttest/include/testPresenter.h +++ b/code/sdk/zhihui/UI/producttest/include/testPresenter.h @@ -78,9 +78,6 @@ namespace OHOS virtual ~testPresenter(); void OnStart() override; - void OnPause() override; - void OnResume() override; - void OnStop() override; static testPresenter *GetInstance(); @@ -89,7 +86,7 @@ namespace OHOS bool OnClick(UIView &view, const ClickEvent &event) override; bool OnDrag(UIView &view, const DragEvent &event) override; bool OnDragEnd(UIView &view, const DragEvent &event) override; - bool OnPress(UIView &view, const PressEvent &event); + bool OnPress(UIView &view, const PressEvent &event) override; bool OnKeyAct(UIView &view, const KeyEvent &event); bool OnRotate(UIView& view, const RotateEvent& event); bool OnRotateEnd(UIView& view, const RotateEvent& event); diff --git a/code/sdk/zhihui/UI/producttest/src/testPing.cpp b/code/sdk/zhihui/UI/producttest/src/testPing.cpp index e03795775..04b7e63fa 100644 --- a/code/sdk/zhihui/UI/producttest/src/testPing.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testPing.cpp @@ -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); diff --git a/code/sdk/zhihui/UI/producttest/src/testPresenter.cpp b/code/sdk/zhihui/UI/producttest/src/testPresenter.cpp index 46a833cb6..e212fd66f 100644 --- a/code/sdk/zhihui/UI/producttest/src/testPresenter.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testPresenter.cpp @@ -4,12 +4,13 @@ #include"ui_resource_string.h" #endif +#include "NativeRegisterManager.h" #include "NativeAbility.h" #include "graphic_math.h" #include "string.h" #include "producttest/include/testPresenter.h" -#include "font/font_global_manager.h" -#include "font/ui_font.h" +// #include "font/font_global_manager.h" +// #include "font/ui_font.h" #ifdef FD230 #include "languagecode/LanguageInit.h" #endif @@ -18,7 +19,9 @@ #include "components/ui_slider.h" #include "audio_capture_wrapper.h" +#ifdef SUPPORT_CYWEE_SERVICE #include "cywee_service.h" +#endif #ifdef FD230 #include "factorytest_protocol.h" @@ -34,7 +37,7 @@ namespace OHOS { - + REGIST_SLICE(VIEW_TEST, testView, testPresenter); static char* view_id_str[]= @@ -80,41 +83,11 @@ namespace OHOS void testPresenter::OnStart() { - - Presenter::OnStart(); - } - - void testPresenter::OnPause(void) - { - - Presenter::OnPause(); } bool testPresenter::OnPress(UIView &view, const PressEvent &event) { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemPresenter::"); - // for(int i=0;i<16;i++) - // // { - // // if(strcmp(view.GetViewId(),view_id_str[i]) == 0) - // // { - // // testTPView::GetInstance()->ChangeViewcolor(i); - - // // } - // } return true; - - } - - void testPresenter::OnResume(void) - { - - Presenter::OnResume(); - } - - void testPresenter::OnStop(void) - { - - Presenter::OnStop(); } bool testPresenter::OnDrag(UIView &view, const DragEvent &event) @@ -191,18 +164,25 @@ namespace OHOS } if(strcmp(view.GetViewId(),"shutdown") == 0) { + #ifdef FD230_650 uapi_poweroff_device(); + #endif return true; } if(strcmp(view.GetViewId(),"reset") == 0) { + #ifdef FD230_650 uapi_reboot_device(); + #endif + return true; } if(strcmp(view.GetViewId(),"deepsleep") == 0) { //TODO: close bt and cat1 , then deepsleep + #ifdef SUPPORT_CYWEE_SERVICE do_cywee_service_check_msg(CYWEE_SERVICE_CMD_STOP_ACC,NULL); + #endif stop_custom_ble_service(); LOS_Msleep(50); uapi_set4GCapability(false); @@ -312,7 +292,9 @@ namespace OHOS } if(strcmp(view.GetViewId(),"deep") == 0) { + #ifdef SUPPORT_CYWEE_SERVICE do_cywee_service_check_msg(CYWEE_SERVICE_CMD_STOP_ACC,NULL); + #endif stop_custom_ble_service(); LOS_Msleep(50); uapi_set4GCapability(false); diff --git a/code/sdk/zhihui/UI/producttest/src/testView.cpp b/code/sdk/zhihui/UI/producttest/src/testView.cpp index 10e318dad..88374fb1c 100644 --- a/code/sdk/zhihui/UI/producttest/src/testView.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testView.cpp @@ -324,7 +324,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); if (SystemScrollView[thisView] == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemView"); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -342,7 +342,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_about_view->SystemAbouTheWatchtInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -359,7 +359,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_LCD_view->testLCDInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -376,7 +376,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_TP_view->testTPInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -393,7 +393,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_MG_view->testmagicInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -410,7 +410,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_lum_view->testLUMInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -427,7 +427,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_charging_view->testCHANINGInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -444,7 +444,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_speak_view->testSPEAKInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -461,7 +461,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_motor_view->testMOTORInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -479,7 +479,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_cat1_view->testcat1InitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } #endif return true; @@ -497,7 +497,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_KEY_view->testBUTTONInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -514,7 +514,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_MP_view->testmicrophoneInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -531,7 +531,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_hr_view->testhrsensonInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -549,7 +549,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_G_view->testGSENSONInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -568,7 +568,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_old_view->testoldInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } #endif return true; @@ -588,7 +588,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_BT_view->testBTInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -606,7 +606,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_SEChip_view->SEChipInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -623,7 +623,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_Ping_view->testPingInitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -642,7 +642,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_GPS_view->testGPSInitIView((uint8_t)thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } #endif return true; @@ -661,7 +661,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_pressure_view->testpressureInitIView((uint8_t)thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; @@ -682,7 +682,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); return false; } SystemScrollView[thisView] = test_A5133_view->testA5133InitIView(thisView); - RootView::GetInstance()->Add(SystemScrollView[thisView]); + AddViewToRootContainer(SystemScrollView[thisView]); } return true; } @@ -874,8 +874,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); void testView::OnStart() { - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnStart>>>>>>>>>>>>>"); - View::OnStart(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnStart>>>>>>>>>>>>>"); //InitIView(); initView_ext(43,120,380,100,120,"/user/res/SETTING_NEXT.bin"); const power_display_svr_api_t *display_api = power_display_svr_get_api(); @@ -890,7 +889,6 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); start_custom_ble_service(); - View::OnSetUpView(); if (SystemScrollView[TESTVIEW] == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: OnSetUpView has nullptr"); @@ -911,7 +909,7 @@ SystemScrollView[TESTVIEW]->SetStyle(STYLE_BORDER_RADIUS, 0); // SystemScrollView[SYSTEMVIEW]->Add(FactoryResetButton); // SystemScrollView[SYSTEMVIEW]->Add(SystemUpgradeButtonExt); - RootView::GetInstance()->Add(SystemScrollView[TESTVIEW]); + AddViewToRootContainer(SystemScrollView[TESTVIEW]); } diff --git a/code/sdk/zhihui/UI/producttest/src/testcat1.cpp b/code/sdk/zhihui/UI/producttest/src/testcat1.cpp index a0ff0cda8..b11514a7d 100644 --- a/code/sdk/zhihui/UI/producttest/src/testcat1.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testcat1.cpp @@ -153,7 +153,9 @@ namespace OHOS { if(button!=NULL) { + #ifdef FD230_650 calldial_event_sendmsg_toUI(phone); + #endif RootView::GetInstance()->Invalidate(); } diff --git a/code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp b/code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp index 6ab829127..f5a508be3 100644 --- a/code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testmagnetic.cpp @@ -23,6 +23,7 @@ extern "C" #if __cplusplus } #endif +#include "mag/mmc5603/mmc5603_hal.h" #endif namespace OHOS -- 2.17.1