产测UI修改 354/1 354/head
authorhcj <1224667075@qq.com>
Sat, 22 Jun 2024 02:09:05 +0000 (10:09 +0800)
committerhcj <1224667075@qq.com>
Sat, 22 Jun 2024 02:09:05 +0000 (10:09 +0800)
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testchanging.h
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testabout.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testcat1.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testchanging.cpp

index 15985e4..87c392f 100644 (file)
@@ -48,6 +48,8 @@ namespace OHOS
         UIScrollView *testCHANINGScrollView{nullptr};
         bool initViewStatus{false};
         UILabel *Title{nullptr};           // 标题
+        UILabel *charnge_label{nullptr};           // 标题
+
         UILabelButtonExt* labelButton_next = nullptr;
     };
 }
index 3a9fca5..4436d9c 100644 (file)
@@ -2,7 +2,10 @@
 #include "producttest/include/testPresenter.h"\r
 #include "power_display_service.h"\r
 #include "wearable_log.h"\r
-\r
+#include "cat1_server.h"\r
+#include "cat1_ctl.h"\r
+#include "cat1_server_hal.h"\r
+#include "custom_utils.h"\r
 \r
 namespace OHOS\r
 {\r
@@ -25,7 +28,7 @@ namespace OHOS
         {TP,"TPButton","TP", &testView::ChangeTPTESTView},\r
         {MAGETIC,"MAGETICButton","Magetic", &testView::ChangeMGTESTView},\r
         {LUMINANCE,"luminanceButton","luminance", &testView::ChangLUMTESTView},\r
-        {CHAR,"chargingButton","charging", &testView::ChangchargingTESTView},\r
+        {CHAR,"chargingButton","bat&charger", &testView::ChangchargingTESTView},\r
         {SPEAK,"speakButton","speak", &testView::ChangspeakTESTView},\r
         {MOTOR,"motorButton","motor", &testView::ChangmotorTESTView},\r
         {CAT1,"cat1button","CAT1", &testView::ChangeCAT1TESTView},\r
@@ -33,13 +36,13 @@ namespace OHOS
         {MICROPHONE,"microphonebutton","microphone" ,&testView::ChangeMPTESTView},\r
         {HRSENSON,"hrsensonbutton","hrsensor" ,&testView::ChangeHRTESTView},\r
         {GSENSON,"gsensonbutton","gsensor" ,&testView::ChangeGTESTView},\r
-        {BTTEST,"BTbutton","BR" ,&testView::ChangeBTTESTView},\r
+        {BTTEST,"BTbutton","BT" ,&testView::ChangeBTTESTView},\r
 \r
         {SEChipTest,"SEChipTestbutton","SEChipTest" ,&testView::ChangeSEChipTESTView},\r
 \r
 \r
         {OLDTEST,"oldtestbutton","aging" ,&testView::ChangeoldTESTView},\r
-        {DEEPSLEEP,"deepsleep","CloseBTCat1&Sleep" ,&testView::ChangeoldTESTView},\r
+        {DEEPSLEEP,"deepsleep","DeepSleepCurrent" ,&testView::ChangeoldTESTView},\r
 \r
         {shutdown,"shutdown","shutdown" ,&testView::ChangeoldTESTView},\r
         // {FACTORYRESETVIEW,"FactoryResetButton","恢复出厂", &testView::ChangeSystemAboutView},\r
@@ -745,6 +748,7 @@ namespace OHOS
 \r
     void testView::OnStart()\r
     {\r
+         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnStart>>>>>>>>>>>>>");\r
         View<testPresenter>::OnStart();\r
         //InitIView();\r
         initView_ext(43,120,380,100,120,"/user/res/SETTING_NEXT.bin");\r
@@ -754,6 +758,11 @@ namespace OHOS
                display_api->turn_on_screen();  \r
          }  \r
         display_api->set_auto_timeout_function(false);\r
+\r
+        uapi_cat1_power_on(1);\r
+        uapi_cat1_reset(0);\r
+\r
+        start_custom_ble_service();\r
     }\r
 \r
     void testView::OnSetUpView()\r
index b81514d..5427d17 100644 (file)
@@ -46,7 +46,7 @@ namespace OHOS
     static constexpr uint16_t LABEL_W = 400;
     static constexpr uint16_t LABEL_H = 40;
     static constexpr uint16_t LABEL_FONTSIZE = 30;
-    static constexpr uint16_t LABEL_LINEHEIGHT = 35;
+    static constexpr uint16_t LABEL_LINEHEIGHT = 0;
 
 
     static testAboutView g_pSystemAboutTheWatchView;
@@ -72,55 +72,49 @@ namespace OHOS
 
     void testAboutView::ClearAll()
     {
-        if (initViewStatus == true)
-        {
+       if(testAboutTheWatchScrollView)
+       {
             testAboutTheWatchScrollView->RemoveAll();
-            delete SystemAboutTheWatchTitle;
-            SystemAboutTheWatchTitle = nullptr;
-
-            delete WatchNameTitle;
-            WatchNameTitle = nullptr;
-            delete WatchName;
-            WatchName = nullptr;
-
-            delete FirmwareVersionTitle;
-            FirmwareVersionTitle = nullptr;
-            delete FirmwareVersion;
-            FirmwareVersion = nullptr;
-
-            delete BluetoothNameTitle;
-            BluetoothNameTitle = nullptr;
-            delete BluetoothName;
-            BluetoothName = nullptr;
-
-            delete BluetoothAddressTitle;
-            BluetoothAddressTitle = nullptr;
-            delete BluetoothAddress;
-            BluetoothAddress = nullptr;
-
-            delete Network4GTitle;
-            Network4GTitle = nullptr;
-            delete Network4G;
-            Network4G = nullptr;
-
-            delete PyVerTitle;
-            PyVerTitle = nullptr;
-            delete PyVer;
-            PyVer = nullptr;
-
-            delete IMELTitle;
-            IMELTitle = nullptr;
-            delete IMEL;
-            IMEL = nullptr;
-
-            delete FONTTitle;
-            FONTTitle = nullptr;
-            delete FONT;
-            FONT = nullptr;
+            if(SystemAboutTheWatchTitle)
+            {
+                delete SystemAboutTheWatchTitle;
+                SystemAboutTheWatchTitle = nullptr;
+            }
+            
+            if(FirmwareVersion)
+            {
+                delete FirmwareVersion;
+                FirmwareVersion = nullptr;
+            }
+
+            if(BluetoothAddress)
+            {
+                delete BluetoothAddress;
+                BluetoothAddress = nullptr;
+            }
             
+            if(Network4G)
+            {
+                delete Network4G;
+                Network4G = nullptr;
+            }
+            
+            if(PyVer)
+            {
+                delete PyVer;
+                PyVer = nullptr;
+            }
+
+            if(IMEL)
+            {
+                delete IMEL;
+                IMEL = nullptr;
+            }
+
             delete testAboutTheWatchScrollView;
             testAboutTheWatchScrollView = nullptr;
-        }
+       }
+       
     }
 
 
@@ -212,7 +206,7 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::draglistener can not be nullptr!");
             return false;
         }
-       testAboutTheWatchScrollView->SetOnDragListener(draglistener);
+        testAboutTheWatchScrollView->SetOnDragListener(draglistener);
         testAboutTheWatchScrollView->SetTouchable(true);
 
         testAboutTheWatchScrollView->SetDraggable(true);
@@ -226,93 +220,49 @@ namespace OHOS
             return nullptr;
         }
         /* -------------------------------------------------------------------------- */
-        LabelConfig Config = {
-            .left = SYSTEM_ABOUT_THEWATCH_TITLE_X,
-            .top = SYSTEM_ABOUT_THEWATCH_TITLE_Y,
-            .width = SYSTEM_ABOUT_THEWATCH_TITLE_W,
-            .height = SYSTEM_ABOUT_THEWATCH_TITLE_H,
-            .fontSize = SYSTEM_ABOUT_THEWATCH_TITLE_FONTSIZE,
-            .lineHeigh = SYSTEM_ABOUT_THEWATCH_TITLE_LINEHEIGHT,
-            .text = "关于",
-            .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
-        };
-        SystemAboutTheWatchTitle = InitLabel(Config);
-        if (SystemAboutTheWatchTitle == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::SystemAboutTheWatchTitle new fail!");
-            return nullptr;
-        }
+       
+        SystemAboutTheWatchTitle = init_title(142,60,"ABOUT_WATCH");
+       
         testAboutTheWatchScrollView->Add(SystemAboutTheWatchTitle);
         /* -------------------------------------------------------------------------- */
-        Config = {
-            .left = TITLE_LABEL_X,
-            .top = WATCH_NAME_POS_TOP,
-            .width = TITLE_LABEL_W,
-            .height = TITLE_LABEL_H,
-            .fontSize = TITLE_LABEL_FONTSIZE,
-            .lineHeigh = TITLE_LABEL_LINEHEIGHT,
-            .text = "手表名称",
-            .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
-        };
-        WatchNameTitle = InitLabel(Config);
-        if (WatchNameTitle == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::WatchNameTitle new fail!");
-            return nullptr;
-        }
-        testAboutTheWatchScrollView->Add(WatchNameTitle);
+       
         /* -------------------------------------------------------------------------- */
-        Config = {
-            .left = LABEL_X,
-            .top = WATCH_NAME_VALUE_POS_TOP,
-            .width = LABEL_W,
-            .height = LABEL_H,
-            .fontSize = LABEL_FONTSIZE,
-            .lineHeigh = LABEL_LINEHEIGHT,
-            .text = "Watch Soar",
-            .lineBreakMode = UILabel::LINE_BREAK_WRAP,
-        };
-        WatchName = InitLabel(Config);
-        if (WatchName == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::WatchName new fail!");
-            return nullptr;
-        }
-        WatchName->SetTextColor(Color::GetColorFromRGBA(0x88, 0x88, 0x88, 0xff));
-        testAboutTheWatchScrollView->Add(WatchName);
-        /* -------------------------------------------------------------------------- */
-        Config = {
-            .left = TITLE_LABEL_X,
-            .top = WATCH_FIRMWARE_POS_TOP,
-            .width = TITLE_LABEL_W,
-            .height = TITLE_LABEL_H,
-            .fontSize = TITLE_LABEL_FONTSIZE,
-            .lineHeigh = TITLE_LABEL_LINEHEIGHT,
-            .text = "固件版本",
-            .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
-        };
-        FirmwareVersionTitle = InitLabel(Config);
-        if (FirmwareVersionTitle == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::FirmwareVersionTitle new fail!");
-            return nullptr;
-        }
-        testAboutTheWatchScrollView->Add(FirmwareVersionTitle);
+        // Config = {
+        //     .left = TITLE_LABEL_X,
+        //     .top = WATCH_FIRMWARE_POS_TOP,
+        //     .width = TITLE_LABEL_W,
+        //     .height = TITLE_LABEL_H,
+        //     .fontSize = TITLE_LABEL_FONTSIZE,
+        //     .lineHeigh = TITLE_LABEL_LINEHEIGHT,
+        //     .text = "固件版本",
+        //     .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
+        // };
+        // FirmwareVersionTitle = InitLabel(Config);
+        // if (FirmwareVersionTitle == nullptr)
+        // {
+        //     WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::FirmwareVersionTitle new fail!");
+        //     return nullptr;
+        // }
+        // testAboutTheWatchScrollView->Add(FirmwareVersionTitle);
         /* -------------------------------------------------------------------------- */
+         #define offest 40
         char version_buf[128] = {0};
         uint32_t version_len = 128;
         uapi_get_buildversion((uint8_t *)version_buf, version_len);
-        Config = {
+        char version_buf_[128] = {0};
+        sprintf_s(version_buf_,128,"ver:%s",version_buf);
+        LabelConfig Config = {
             .left = LABEL_X,
-            .top = WATCH_FIRMWARE_VALUE_POS_TOP,
+            .top = 110,
             .width = LABEL_W,
             .height = LABEL_H,
             .fontSize = LABEL_FONTSIZE,
             .lineHeigh = LABEL_LINEHEIGHT,
-            .text = (char *)version_buf,
+            .text = (char *)version_buf_,
             .lineBreakMode = UILabel::LINE_BREAK_WRAP,
         };
         FirmwareVersion = InitLabel(Config);
+
         if (FirmwareVersion == nullptr)
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::FirmwareVersion new fail!");
@@ -321,76 +271,21 @@ namespace OHOS
         FirmwareVersion->SetTextColor(Color::GetColorFromRGBA(0x88, 0x88, 0x88, 0xff));
         testAboutTheWatchScrollView->Add(FirmwareVersion);
         /* -------------------------------------------------------------------------- */
-        Config = {
-            .left = TITLE_LABEL_X,
-            .top = WATCH_BT_NAME_TOP,
-            .width = TITLE_LABEL_W,
-            .height = TITLE_LABEL_H,
-            .fontSize = TITLE_LABEL_FONTSIZE,
-            .lineHeigh = TITLE_LABEL_LINEHEIGHT,
-            .text = "蓝牙名称",
-            .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
-        };
-        BluetoothNameTitle = InitLabel(Config);
-        if (BluetoothNameTitle == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::BluetoothNameTitle new fail!");
-            return nullptr;
-        }
-        testAboutTheWatchScrollView->Add(BluetoothNameTitle);
+      
+    
         /* -------------------------------------------------------------------------- */
-        uint8_t ble_name[LABEL_FONTSIZE] = {0};
-        uint32_t ble_name_len = sizeof(ble_name);
-        errcode_t ret = uapi_get_nv_btname(ble_name, &ble_name_len);
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "get btname %s ,ret 0x%X\n", ble_name, ret);
-
-        Config = {
-            .left = LABEL_X,
-            .top = WATCH_BT_NAME_VALUE_TOP,
-            .width = LABEL_W,
-            .height = LABEL_H,
-            .fontSize = LABEL_FONTSIZE,
-            .lineHeigh = LABEL_LINEHEIGHT,
-            .text = (char *)ble_name,
-            .lineBreakMode = UILabel::LINE_BREAK_WRAP,
-        };
-        BluetoothName = InitLabel(Config);
-        if (BluetoothName == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::BluetoothName new fail!");
-            return nullptr;
-        }
-        BluetoothName->SetTextColor(Color::GetColorFromRGBA(0x88, 0x88, 0x88, 0xff));
-        testAboutTheWatchScrollView->Add(BluetoothName);
-        /* -------------------------------------------------------------------------- */
-        Config = {
-            .left = TITLE_LABEL_X,
-            .top = WATCH_BT_ADDR_TOP,
-            .width = TITLE_LABEL_W,
-            .height = TITLE_LABEL_H,
-            .fontSize = TITLE_LABEL_FONTSIZE,
-            .lineHeigh = TITLE_LABEL_LINEHEIGHT,
-            .text = "蓝牙地址",
-            .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
-        };
-        BluetoothAddressTitle = InitLabel(Config);
-        if (BluetoothAddressTitle == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::BluetoothAddressTitle new fail!");
-            return nullptr;
-        }
-        testAboutTheWatchScrollView->Add(BluetoothAddressTitle);
+      
         /* -------------------------------------------------------------------------- */
         uint8_t btaddr[6] = {0};
         uint8_t btaddr_str[64] = {0};
         uint32_t len = 6;
-        ret = uapi_get_nv_btaddr((uint8_t *)btaddr, &len);
-        sprintf((char *)btaddr_str, "%02X:%02X:%02X:%02X:%02X:%02X", btaddr[0], btaddr[1], btaddr[2], btaddr[3], btaddr[4], btaddr[5]);
+        errcode_t ret = uapi_get_nv_btaddr((uint8_t *)btaddr, &len);
+        sprintf((char *)btaddr_str, "蓝牙地址:%02X:%02X:%02X:%02X:%02X:%02X", btaddr[0], btaddr[1], btaddr[2], btaddr[3], btaddr[4], btaddr[5]);
 
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "get btaddr %s , ret 0x%X\n", btaddr_str, ret);
         Config = {
             .left = LABEL_X,
-            .top = WATCH_BT_ADDR_VALUE_TOP,
+            .top = 150+offest,
             .width = LABEL_W,
             .height = LABEL_H,
             .fontSize = LABEL_FONTSIZE,
@@ -407,69 +302,20 @@ namespace OHOS
         BluetoothAddress->SetTextColor(Color::GetColorFromRGBA(0x88, 0x88, 0x88, 0xff));
         testAboutTheWatchScrollView->Add(BluetoothAddress);
         /* -------------------------------------------------------------------------- */
-        Config = {
-            .left = TITLE_LABEL_X,
-            .top = WATCH_MODEM_VERSION_TOP,
-            .width = TITLE_LABEL_W,
-            .height = TITLE_LABEL_H,
-            .fontSize = TITLE_LABEL_FONTSIZE,
-            .lineHeigh = TITLE_LABEL_LINEHEIGHT,
-            .text = "4G Modem",
-            .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
-        };
-        Network4GTitle = InitLabel(Config);
-        if (Network4GTitle == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::Network4GTitle new fail!");
-            return nullptr;
-        }
-        testAboutTheWatchScrollView->Add(Network4GTitle);
-        /* -------------------------------------------------------------------------- */
-        Config = {
-            .left = LABEL_X,
-            .top = WATCH_MODEM_VERSION_VALUE_TOP,
-            .width = LABEL_W,
-            .height = LABEL_H,
-            .fontSize = LABEL_FONTSIZE - 2,
-            .lineHeigh = LABEL_LINEHEIGHT,
-            .text = ConfigModel::GetInstance()->GetmoderVer(),
-            .lineBreakMode = UILabel::LINE_BREAK_WRAP,
-        };
-        Network4G = InitLabel(Config);
-        if (Network4G == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::Network4G new fail!");
-            return nullptr;
-        }
-        Network4G->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87));
-        testAboutTheWatchScrollView->Add(Network4G);
+      
         /* -------------------------------------------------------------------------- */
-        Config = {
-            .left = TITLE_LABEL_X,
-            .top = WATCH_MODEM_APP_VERSION_TOP,
-            .width = TITLE_LABEL_W,
-            .height = TITLE_LABEL_H,
-            .fontSize = TITLE_LABEL_FONTSIZE,
-            .lineHeigh = TITLE_LABEL_LINEHEIGHT,
-            .text = "pyVer",
-            .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
-        };
-        PyVerTitle = InitLabel(Config);
-        if (PyVerTitle == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::PyVerTitle new fail!");
-            return nullptr;
-        }
-        testAboutTheWatchScrollView->Add(PyVerTitle);
+        char GetpyVer_buf[256] = {0};
+        sprintf_s(GetpyVer_buf,256,"PY:%s",ConfigModel::GetInstance()->GetpyVer().c_str());
+
         /* -------------------------------------------------------------------------- */
         Config = {
             .left = LABEL_X,
-            .top = WATCH_MODEM_APP_VERSION_VALUE_TOP,
+            .top = 190+offest,
             .width = LABEL_W,
             .height = LABEL_H,
             .fontSize = LABEL_FONTSIZE,
             .lineHeigh = LABEL_LINEHEIGHT,
-            .text = ConfigModel::GetInstance()->GetpyVer(),
+            .text = GetpyVer_buf,
             .lineBreakMode = UILabel::LINE_BREAK_WRAP,
         };
         PyVer = InitLabel(Config);
@@ -480,33 +326,19 @@ namespace OHOS
         }
         PyVer->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87));
         testAboutTheWatchScrollView->Add(PyVer);
-        /* -------------------------------------------------------------------------- */
-        Config = {
-            .left = TITLE_LABEL_X,
-            .top = WATCH_IMEI_TOP,
-            .width = TITLE_LABEL_W,
-            .height = TITLE_LABEL_H,
-            .fontSize = TITLE_LABEL_FONTSIZE,
-            .lineHeigh = TITLE_LABEL_LINEHEIGHT,
-            .text = "IMEI",
-            .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
-        };
-        IMELTitle = InitLabel(Config);
-        if (IMELTitle == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::IMELTitle new fail!");
-            return nullptr;
-        }
-        testAboutTheWatchScrollView->Add(IMELTitle);
+
+         char Getimei_buf[256] = {0};
+        sprintf_s(Getimei_buf,256,"IMEI:%s",ConfigModel::GetInstance()->Getimei().c_str());
+      
         /* -------------------------------------------------------------------------- */
         Config = {
             .left = LABEL_X,
-            .top = WATCH_IMEI_VALUE_TOP,
+            .top = 230+offest,
             .width = LABEL_W,
             .height = LABEL_H,
             .fontSize = LABEL_FONTSIZE,
             .lineHeigh = TITLE_LABEL_LINEHEIGHT,
-            .text = ConfigModel::GetInstance()->Getimei(),
+            .text =Getimei_buf, //ConfigModel::GetInstance()->Getimei(),
             .lineBreakMode = UILabel::LINE_BREAK_WRAP,
         };
         IMEL = InitLabel(Config);
@@ -518,46 +350,32 @@ namespace OHOS
         IMEL->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87));
         testAboutTheWatchScrollView->Add(IMEL);
         /* -------------------------------------------------------------------------- */
-        Config = {
-            .left = TITLE_LABEL_X,
-            .top = WATCH_FONT_TOP,
-            .width = TITLE_LABEL_W,
-            .height = TITLE_LABEL_H,
-            .fontSize = TITLE_LABEL_FONTSIZE,
-            .lineHeigh = TITLE_LABEL_LINEHEIGHT,
-            .text = "FONTS",
-            .lineBreakMode = UILabel::LINE_BREAK_MARQUEE,
-        };
-        FONTTitle = InitLabel(Config);
-        if (FONTTitle == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::FONTTitle new fail!");
-            return nullptr;
-        }
-        testAboutTheWatchScrollView->Add(FONTTitle);
+          char GetmoderVer_buf[256] = {0};
+        sprintf_s(GetmoderVer_buf,256,"4G:%s",ConfigModel::GetInstance()->GetmoderVer().c_str());
         /* -------------------------------------------------------------------------- */
         Config = {
             .left = LABEL_X,
-            .top = WATCH_FONT_VALUE_TOP,
+            .top = 270+offest,
             .width = LABEL_W,
             .height = LABEL_H,
-            .fontSize = LABEL_FONTSIZE,
+            .fontSize = LABEL_FONTSIZE - 2,
             .lineHeigh = LABEL_LINEHEIGHT,
-            .text = "HarmonyOS Sans",
+            .text = GetmoderVer_buf,
             .lineBreakMode = UILabel::LINE_BREAK_WRAP,
         };
-        FONT = InitLabel(Config);
-        if (FONT == nullptr)
+        Network4G = InitLabel(Config);
+        if (Network4G == nullptr)
         {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::FONT new fail!");
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::Network4G new fail!");
             return nullptr;
         }
-        FONT->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87));
-        testAboutTheWatchScrollView->Add(FONT);
+        Network4G->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87));
+        testAboutTheWatchScrollView->Add(Network4G);
+       
         /* -------------------------------------------------------------------------- */
         initViewStatus = true;
 
-        labelButton_next =init_button_next(165, WATCH_ABOUT_NEXT_BUTTON_TOP,"LCDButton_next");
+        labelButton_next =init_button_next(165,400,"LCDButton_next");
 
         testAboutTheWatchScrollView->Add(labelButton_next);
         return testAboutTheWatchScrollView;
index a06b853..0991f14 100644 (file)
@@ -45,11 +45,11 @@ namespace OHOS
                 Gsenson_TEST_timer = NULL;
                 return ;
             }
-            if(button)
-            {
-                delete button;
-                button=nullptr;
-            }
+            // if(button)
+            // {
+            //     delete button;
+            //     button=nullptr;
+            // }
             if(labelButton_next)
             {
                 delete labelButton_next;
@@ -280,19 +280,19 @@ namespace OHOS
         cat1_getsignal();
         cat1_getver();
         /* -------------------------------------------------------------------------- */
-        ButtonConfig_ext_t buttonconfig;
-        buttonconfig.x = 100;
-        buttonconfig.y = 350;
-        buttonconfig.w = 180;
-        buttonconfig.h = 96;
-        buttonconfig.label_x=40;
-        buttonconfig.label_y=0;
-        buttonconfig.Fontsize=30;
-        buttonconfig.ViewId="dial_112";
-        buttonconfig.str="dial";
-        buttonconfig.ALIGN=TEXT_ALIGNMENT_LEFT;
-        button=SetTheButton_ext(buttonconfig);
-        testcat1ScrollView->Add(button);
+        // ButtonConfig_ext_t buttonconfig;
+        // buttonconfig.x = 100;
+        // buttonconfig.y = 350;
+        // buttonconfig.w = 180;
+        // buttonconfig.h = 96;
+        // buttonconfig.label_x=40;
+        // buttonconfig.label_y=0;
+        // buttonconfig.Fontsize=30;
+        // buttonconfig.ViewId="dial_112";
+        // buttonconfig.str="dial";
+        // buttonconfig.ALIGN=TEXT_ALIGNMENT_LEFT;
+        // button=SetTheButton_ext(buttonconfig);
+        // //testcat1ScrollView->Add(button);
 
         UIView::OnDragListener *draglistener = static_cast<UIView::OnDragListener *>(testPresenter::GetInstance());
         if (draglistener == nullptr)
index 018a34c..adc5f1b 100644 (file)
@@ -2,6 +2,7 @@
 #include "custom_utils.h"
 #include "producttest/include/testPresenter.h"
 #include "producttest/include/testchanging.h"
+#include "battery_hal.h"
 
 #include "cmsis_os2.h"
 #ifdef __cplusplus
@@ -62,6 +63,12 @@ namespace OHOS
                 delete Title;
                 Title=nullptr;
             }
+            if(charnge_label)
+            {
+                delete charnge_label;
+                charnge_label=nullptr;
+            }
+            
              uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST);
             if (cnt == 1) {
                 uapi_pm_remove_sleep_veto(PM_ID_P_TEST);
@@ -184,6 +191,20 @@ namespace OHOS
         Title= testAboutView::GetInstance()->init_title(120,45,"CHANING_TEST");
         testCHANINGScrollView->Add(Title);
 
+
+        float voltage = 0.0F;
+        uint8_t power = 0;
+        power = battery_get_voltage(&voltage);
+
+        char  battery_buf[32]={0};
+
+        sprintf_s(battery_buf,32,"power:%d\nvoltage:%.2f",power,voltage);
+
+        charnge_label= testAboutView::GetInstance()->init_title(100,250,battery_buf);
+        testCHANINGScrollView->Add(charnge_label);
+
+
+
          uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST);
         if (cnt == 0) {
             uapi_pm_add_sleep_veto(PM_ID_P_TEST);