增加充电测试界面充电ic显示
authorxue <2144439972@qq.com>
Mon, 25 May 2026 02:49:53 +0000 (10:49 +0800)
committerxue <2144439972@qq.com>
Mon, 25 May 2026 02:49:53 +0000 (10:49 +0800)
code/sdk/zhihui/UI/producttest/include/testchanging.h
code/sdk/zhihui/UI/producttest/src/testchanging.cpp

index f7a9f29..2f665f0 100644 (file)
@@ -49,6 +49,7 @@ namespace OHOS
         UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener);
         bool testCHANINGScrollViewcrollViewinit(uint8_t);
         UIScrollView *testCHANINGScrollView{nullptr};
+        uint8_t GetChargeId(void);
         bool initViewStatus{false};
         UILabel *Title{nullptr};           // 标题
         UILabel *charnge_label{nullptr};           // 标题
index 26481c6..0833dcc 100644 (file)
@@ -20,6 +20,9 @@ extern "C"
 #endif
     #include "pm_veto.h"
     #include "pm.h"
+#ifdef ENABLE_HP4570
+    #include "hp4570.h"
+#endif
 #ifdef __cplusplus
 #if __cplusplus
 }
@@ -215,16 +218,21 @@ namespace OHOS
         float bat_temp = 0.0F;
         float pcb_temp = 0.0F;
         uint8_t power = 0;
+        uint8_t charge_id = 0;
 #ifdef SUPPORT_BATTERY_SERVICE
         power = battery_get_voltage(&voltage);
         battery_get_pcb_temp(&pcb_temp);
         battery_get_battery_temp(&bat_temp);
+#endif
+#ifdef ENABLE_HP4570
+
+        charge_id = GetChargeId();
 #endif
         char  battery_buf[64]={0};
 
-        sprintf_s(battery_buf,64,"power:%d\nvoltage:%.2f\nbat_temp:%.2f\npcb_temp:%.2f",power,voltage,bat_temp,pcb_temp);
+        sprintf_s(battery_buf,64,"power:%d\nvoltage:%.2f\nbat_temp:%.2f\npcb_temp:%.2f\ncharge Ic:%d",power,voltage,bat_temp,pcb_temp,charge_id);
 
-        charnge_label= testAboutView::GetInstance()->init_title(70,250,battery_buf);
+        charnge_label= testAboutView::GetInstance()->init_title(70,240,battery_buf);
         testCHANINGScrollView->Add(charnge_label);
 
 #if ENABLE_TEST_RESULT_BUTTONS
@@ -280,6 +288,19 @@ namespace OHOS
         }
         return testCHANINGScrollView;
     }
+
+    uint8_t testCHANINGView::GetChargeId(void)
+    {
+        uint8_t charge_id = hp4570n_get_id();
+        if(0x2 == charge_id)
+        {
+            return 1;
+        }
+        else
+        {
+            return 0;
+        }
+    }
 }
 
 #ifdef __cplusplus