瀏覽代碼

在功耗显示界面,如果检测到两端的电压大于2.8V,说明两端都有接入,同时显示输入输出的数据,如果只有一端的电压大于2.8V,则只显示输入数据

mohliy 2 月之前
父節點
當前提交
edb2c9e327

二進制
application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.res


二進制
application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.sty


+ 32 - 0
application/aem_watch/resource/360x360/bt_watch.ui

@@ -11421,6 +11421,36 @@
                     <property name="0" value=".\in_out_power\深绿色箭头.png" />
                 </element>
             </element>
+            <element class="picture_resource">
+                <property name="name" value="PIC_VOLTAGE_ICON" />
+                <property name="id" value="33312" />
+                <property name="x" value="0x0090" />
+                <property name="y" value="0x00d8" />
+                <property name="width" value="0x0016" />
+                <property name="height" value="0x0018" />
+                <property name="visible" value="0x0011" />
+                <property name="compress" value="0x0000" />
+                <property name="PNG_A8" value="0x0000" />
+                <property name="ARGB" value="0x0000" />
+                <element class="layer">
+                    <property name="0" value=".\in_out_power\电压.png" />
+                </element>
+            </element>
+            <element class="picture_resource">
+                <property name="name" value="PIC_CURRENT_ICON" />
+                <property name="id" value="33313" />
+                <property name="x" value="0x0090" />
+                <property name="y" value="0x0102" />
+                <property name="width" value="0x0016" />
+                <property name="height" value="0x0018" />
+                <property name="visible" value="0x0011" />
+                <property name="compress" value="0x0000" />
+                <property name="PNG_A8" value="0x0000" />
+                <property name="ARGB" value="0x0000" />
+                <element class="layer">
+                    <property name="0" value=".\in_out_power\电流.png" />
+                </element>
+            </element>
             <element class="string_resource">
                 <property name="name" value="STR_IN_OUT_POWER" />
                 <property name="id" value="33258" />
@@ -22896,6 +22926,8 @@
         <picture value=".\in_out_power\out电压动标.png" />
         <picture value=".\in_out_power\深蓝箭头.png" />
         <picture value=".\in_out_power\深绿色箭头.png" />
+        <picture value=".\in_out_power\电压.png" />
+        <picture value=".\in_out_power\电流.png" />
         <txt value="..\multilang_translate_table.xls" />
         <string value="key_setupwizard_language" />
         <string value="key_setupwizard_download_app" />

+ 3 - 0
application/aem_watch/resource/360x360/bt_watch_sty.h

@@ -569,6 +569,8 @@
 #define  PIC_POINT_OUT    0x4a988cfa
 #define  PIC_DEEPBLUE_ARROW    0x5d86aef
 #define  PIC_DEEPGREEN_ARROW    0x447f98a0
+#define  PIC_VOLTAGE_ICON    0x1c353bf9
+#define  PIC_CURRENT_ICON    0x643044ea
 #define  STR_IN_OUT_POWER    0xddae7726
 #define  SCENE_PROFILE_PHOTO    0x598f6bff
 #define  PIC_PHOTO_MALE    0x361b9093
@@ -1091,6 +1093,7 @@
 #define  STR_SET_TIME    0x7cd1484
 #define  STR_SET_DATE    0x2f38573b
 #define  SCENE_BLUETOOTH    0xdec0857f
+#define  PIC_VOLG_ICON    0x9c1059f3
 #define  STR_BT_CONNECT_MORE    0xad6733b
 #define  STR_BT_BLUETOOTH    0x2c134409
 #define  SCENE_RECORDER    0x348a22e9

二進制
application/aem_watch/resource/360x360/in_out_power/电压.png


二進制
application/aem_watch/resource/360x360/in_out_power/电流.png


+ 2 - 0
application/aem_watch/resource/360x360/res_include.h

@@ -307,6 +307,8 @@ extern lv_img_dsc_t IMG_SCENE_IN_OUT_POWER_PIC_POINT_IN;
 extern lv_img_dsc_t IMG_SCENE_IN_OUT_POWER_PIC_POINT_OUT; 
 extern lv_img_dsc_t IMG_SCENE_IN_OUT_POWER_PIC_DEEPBLUE_ARROW; 
 extern lv_img_dsc_t IMG_SCENE_IN_OUT_POWER_PIC_DEEPGREEN_ARROW; 
+extern lv_img_dsc_t IMG_SCENE_IN_OUT_POWER_PIC_VOLTAGE_ICON; 
+extern lv_img_dsc_t IMG_SCENE_IN_OUT_POWER_PIC_CURRENT_ICON; 
 extern lv_img_dsc_t IMG_SCENE_PROFILE_PHOTO_PIC_PHOTO_MALE; 
 extern lv_img_dsc_t IMG_SCENE_PROFILE_PHOTO_PIC_PHOTO_FEMALE; 
 extern lv_img_dsc_t IMG_SCENE_PROFILE_PHOTO_PIC_IN; 

File diff suppressed because it is too large
+ 112 - 112
application/aem_watch/resource/360x360/res_style_bitmap.c


+ 1 - 0
application/aem_watch/simulator/LVGL.Simulator/LVGL.Simulator.vcxproj

@@ -417,6 +417,7 @@
     <ClCompile Include="..\..\src\application\health\heart_rate\aem_wf_heart_rate.c" />
     <ClCompile Include="..\..\src\application\health\spo2\aem_spo2.c" />
     <ClCompile Include="..\..\src\application\health\stress\aem_stress.c" />
+    <ClCompile Include="..\..\src\application\in_out_power\aem_input_power_screen.c" />
     <ClCompile Include="..\..\src\application\in_out_power\aem_in_out_power.c" />
     <ClCompile Include="..\..\src\application\in_out_power\aem_in_out_power_screen.c" />
     <ClCompile Include="..\..\src\application\in_out_power\aem_widget_in_out_power.c" />

+ 3 - 0
application/aem_watch/simulator/LVGL.Simulator/LVGL.Simulator.vcxproj.filters

@@ -1589,6 +1589,9 @@
     <ClCompile Include="..\..\src\application\bluetooth\aem_bluetooth.c">
       <Filter>aem_watch\application\bluetooth</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\application\in_out_power\aem_input_power_screen.c">
+      <Filter>aem_watch\application\in_out_power</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="LVGL.Simulator.rc" />

+ 2 - 1
application/aem_watch/src/application/in_out_power/CMakeLists.txt

@@ -6,4 +6,5 @@ zephyr_include_directories(
 
 zephyr_library_sources( aem_in_out_power.c)
 zephyr_library_sources( aem_widget_in_out_power.c)
-zephyr_library_sources( aem_in_out_power_screen.c)
+zephyr_library_sources( aem_in_out_power_screen.c)
+zephyr_library_sources( aem_input_power_screen.c)

+ 89 - 2
application/aem_watch/src/application/in_out_power/aem_in_out_power.c

@@ -60,11 +60,89 @@ static activity_ui_data_t *activity_ui_data = NULL;
 static lv_timer_t *sim_timer = NULL;
 #endif
 
+#ifndef CONFIG_SIMULATOR
+extern float f_BusVoltage[2];
+#else
+static float f_BusVoltage[2] = {5.00, 5.00};
+static uint8_t simulator_cnt = 0;
+#include "time.h"
+#endif
+
+static bool in_out_value_show_flag = false;
+
+lv_obj_t *in_out_power_ui_init(lv_obj_t *par);
+
+bool aem_in_out_value_show()
+{   
+#ifdef CONFIG_SIMULATOR
+    f_BusVoltage[0] = (float)(rand() % 20) + 0.50;
+    simulator_cnt++;
+    if (simulator_cnt < 13)
+    {
+        f_BusVoltage[1] = (float)(rand() % 2) + 0.50;
+    }
+    else if (simulator_cnt < 26)
+    {
+        f_BusVoltage[1] = (float)(rand() % 20) + 4.50;
+    }
+    else
+    {
+        simulator_cnt = 0;
+    }
+        
+#endif
+    //os_printk("f_BusVoltage[0]:%f, f_BusVoltage[1]:%f\n", f_BusVoltage[0], f_BusVoltage[1]);
+
+    if (f_BusVoltage[0] > 2.80 && f_BusVoltage[1] > 2.80)
+    {
+        return true;  //show in & out value
+    }
+    return false;  //show in value
+}
+
 static void refresh_in_out_power_ui(void)
 {
+    if (in_out_value_show_flag != aem_in_out_value_show())
+    {
+        //os_printk("[refresh_in_out_power_ui] in_out_value_show_flag:%d\n", in_out_value_show_flag);
+
+        activity_ui_data->page_complete = false;
+        aem_in_out_power_screen_del(activity_ui_data->arc_screen);
+        aem_input_power_screen_del(activity_ui_data->arc_screen);
+
+        if (activity_ui_data->s_app_bg != NULL)
+        {
+            lv_obj_del(activity_ui_data->s_app_bg);
+            activity_ui_data->s_app_bg = NULL;
+        }
+
+        if (activity_ui_data->timer)
+        {
+            lv_timer_del(activity_ui_data->timer);
+            activity_ui_data->timer = NULL;
+        }
+
+    #ifdef CONFIG_SIMULATOR
+        lv_timer_del(sim_timer);
+    #endif
+
+        in_out_value_show_flag = aem_in_out_value_show();
+
+        in_out_power_ui_init(NULL);
+
+        return;
+    }
+
     if (activity_ui_data != NULL && activity_ui_data->page_complete)
     {
-        aem_in_out_power_screen_update(activity_ui_data->arc_screen);
+        if (in_out_value_show_flag)  //show in & out value
+        {
+            aem_in_out_power_screen_update(activity_ui_data->arc_screen);
+        }
+        else
+        {
+            aem_input_power_screen_update(activity_ui_data->arc_screen);
+        }
     }
 }
 
@@ -107,7 +185,14 @@ lv_obj_t *in_out_power_ui_init(lv_obj_t *par)
     lv_obj_t *screen1 = aem_bg_create(bg, DEF_UI_WIDTH, DEF_UI_HEIGHT, lv_color_black());
     if (screen1)
     {
-        activity_ui_data->arc_screen = aem_in_out_power_screen_create(screen1, false);
+        if (in_out_value_show_flag)  //show in & out value
+        {
+            activity_ui_data->arc_screen = aem_in_out_power_screen_create(screen1, false);
+        }
+        else
+        {
+            activity_ui_data->arc_screen = aem_input_power_screen_create(screen1, false);
+        }
     }
 
     activity_ui_data->timer = lv_timer_create(delay_timer_cb, 300, NULL);
@@ -153,6 +238,7 @@ static void on_resume(void)
 {
     if (activity_ui_data && activity_ui_data->s_is_frist)
     {
+        in_out_value_show_flag = aem_in_out_value_show();
         in_out_power_ui_init(NULL);
         activity_ui_data->s_is_frist = false;
     }
@@ -171,6 +257,7 @@ static void on_stop(void)
 
     activity_ui_data->page_complete = false;
     aem_in_out_power_screen_del(activity_ui_data->arc_screen);
+    aem_input_power_screen_del(activity_ui_data->arc_screen);
 
     if (activity_ui_data->s_app_bg != NULL)
     {

+ 1 - 0
application/aem_watch/src/application/in_out_power/aem_in_out_power.h

@@ -5,4 +5,5 @@
 #include "lvgl.h"
 
 void aem_in_out_power_create(void);
+bool aem_in_out_value_show();
 #endif

+ 24 - 71
application/aem_watch/src/application/in_out_power/aem_in_out_power_screen.c

@@ -610,7 +610,7 @@ static lv_obj_t *create_chart(lv_obj_t *par, int type)
     return chart;
 }
 
-static void aem_create_point_page(lv_obj_t *par)
+static void aem_create_in_out_point_page(lv_obj_t *par)
 {
     s_power_point = (aem_struct_power_point *)lv_mem_alloc(sizeof(aem_struct_power_point));
     if(s_power_point == NULL)
@@ -643,7 +643,7 @@ lv_obj_t *aem_in_out_power_screen_create(lv_obj_t *par, bool widget_start)
 
         aem_in_out_power_arc_show_create(screen);
 
-        aem_create_point_page(screen);  // 创建点阵屏
+        aem_create_in_out_point_page(screen);  // 创建点阵屏
     }
 
     return screen;
@@ -705,13 +705,14 @@ void aem_in_out_power_screen_update(lv_obj_t *par)
     uint16_t output_power_green_chart_point_min = 600;
     uint16_t input_power_blue_chart_point_max = 0;
     uint16_t output_power_green_chart_point_max = 0;
+    bool f_Power_index;
 
 #ifdef CONFIG_SIMULATOR
     // 设置随机数种子 
     //srand((unsigned int)time(0)); // 获取随机数
 
     f_Current[0] = (float)(rand() % 3) + 0.04;
-    f_BusVoltage[0] = (float)(rand() % 20) + 4.40;
+    f_BusVoltage[0] = (float)(rand() % 20) + 0.50;
     //f_Power[0] = f_BusVoltage[0] * f_Current[0];
 
     f_Current[1] = (float)(rand() % 3) + 0.04;
@@ -736,6 +737,8 @@ void aem_in_out_power_screen_update(lv_obj_t *par)
 
     if (power_volt_cur_data)
     {
+        f_Power_index = f_Power[0] > f_Power[1] ? 0 : 1;
+
         if (s_power_point)
         {
             aem_power_point_item_t *info = aem_get_baro_items_data();
@@ -746,16 +749,8 @@ void aem_in_out_power_screen_update(lv_obj_t *par)
                 info->output_power_green_chart[i] = info->output_power_green_chart[i - 1];
             }
 
-            if (f_Power[0] > 0.08 && f_Power[1] < 0.08)
-            {
-                info->input_power_blue_chart[0] = f_Power[0] * 10.00;//rand() % 59 + 1;
-                info->output_power_green_chart[0] = f_Power[1] * 10.00;//rand() % 59 + 1;
-            }
-            else
-            {
-                info->input_power_blue_chart[0] = f_Power[1] * 10.00;//rand() % 59 + 1;
-                info->output_power_green_chart[0] = f_Power[0] * 10.00;//rand() % 59 + 1;
-            }
+            info->input_power_blue_chart[0] = f_Power[f_Power_index] * 10.00;//rand() % 59 + 1;
+            info->output_power_green_chart[0] = f_Power[1 - f_Power_index] * 10.00;//rand() % 59 + 1;
 
             for (int i = 0; i < chart_point_num; i++)
             {
@@ -967,65 +962,23 @@ void aem_in_out_power_screen_update(lv_obj_t *par)
         }
 
         char str_data[32] = {0};
-
-        //if (power_volt_cur_data->in_power_value)
-        {
-            if (f_Power[0] > 0.08 && f_Power[1] < 0.08)
-            {
-                sprintf(str_data, "%6.3f", f_Power[0]);
-                text_canvas_set_text(power_volt_cur_data->in_power_value, str_data);
-            
-                sprintf(str_data, "%6.3f", f_Power[1]);
-                text_canvas_set_text(power_volt_cur_data->out_power_value, str_data);
-            }
-            else
-            {
-                sprintf(str_data, "%6.3f", f_Power[1]);
-                text_canvas_set_text(power_volt_cur_data->in_power_value, str_data);
-            
-                sprintf(str_data, "%6.3f", f_Power[0]);
-                text_canvas_set_text(power_volt_cur_data->out_power_value, str_data);
-            }
-            
-        }
-        //if (power_volt_cur_data->in_voltage_value)
-        {
-            if (f_BusVoltage[0] > 2.5 && f_BusVoltage[1] < 2.5)
-            {
-                sprintf(str_data, "%6.3f", f_BusVoltage[0]);
-                text_canvas_set_text(power_volt_cur_data->in_voltage_value, str_data);
-            
-                sprintf(str_data, "%6.3f", f_BusVoltage[1]);
-                text_canvas_set_text(power_volt_cur_data->out_voltage_value, str_data);
-            }
-            else
-            {
-                sprintf(str_data, "%6.3f", f_BusVoltage[1]);
-                text_canvas_set_text(power_volt_cur_data->in_voltage_value, str_data);
-            
-                sprintf(str_data, "%6.3f", f_BusVoltage[0]);
-                text_canvas_set_text(power_volt_cur_data->out_voltage_value, str_data);
-            }
-            
-        }
-        //if (power_volt_cur_data->in_current_value)
-        {
-            if (f_Current[0] > 0.03 && f_Current[1] < 0.03)
-            {
-                sprintf(str_data, "%6.3f", f_Current[0]);
-                text_canvas_set_text(power_volt_cur_data->in_current_value, str_data);
+        
+        sprintf(str_data, "%6.3f", f_Power[f_Power_index]);
+        text_canvas_set_text(power_volt_cur_data->in_power_value, str_data);
+    
+        sprintf(str_data, "%6.3f", f_Power[1 - f_Power_index]);
+        text_canvas_set_text(power_volt_cur_data->out_power_value, str_data);
             
-                sprintf(str_data, "%6.3f", f_Current[1]);
-                text_canvas_set_text(power_volt_cur_data->out_current_value, str_data);
-            }
-            else
-            {
-                sprintf(str_data, "%6.3f", f_Current[1]);
-                text_canvas_set_text(power_volt_cur_data->in_current_value, str_data);
+        sprintf(str_data, "%6.3f", f_BusVoltage[f_Power_index]);
+        text_canvas_set_text(power_volt_cur_data->in_voltage_value, str_data);
+    
+        sprintf(str_data, "%6.3f", f_BusVoltage[1 - f_Power_index]);
+        text_canvas_set_text(power_volt_cur_data->out_voltage_value, str_data);
             
-                sprintf(str_data, "%6.3f", f_Current[0]);
-                text_canvas_set_text(power_volt_cur_data->out_current_value, str_data);
-            }
-        }
+        sprintf(str_data, "%6.3f", f_Current[f_Power_index]);
+        text_canvas_set_text(power_volt_cur_data->in_current_value, str_data);
+    
+        sprintf(str_data, "%6.3f", f_Current[1 - f_Power_index]);
+        text_canvas_set_text(power_volt_cur_data->out_current_value, str_data);
     }
 }

+ 3 - 0
application/aem_watch/src/application/in_out_power/aem_in_out_power_screen.h

@@ -20,8 +20,11 @@ typedef struct
 
 aem_power_point_item_t *aem_get_baro_items_data(void);
 lv_obj_t *aem_in_out_power_screen_create(lv_obj_t *par, bool widget_start);
+lv_obj_t *aem_input_power_screen_create(lv_obj_t *par, bool widget_start);
 
 void aem_in_out_power_screen_update(lv_obj_t *par);
 void aem_in_out_power_screen_del(lv_obj_t *par);
+void aem_input_power_screen_update(lv_obj_t *par);
+void aem_input_power_screen_del(lv_obj_t *par);
 
 #endif

+ 722 - 0
application/aem_watch/src/application/in_out_power/aem_input_power_screen.c

@@ -0,0 +1,722 @@
+#include "aem_in_out_power_screen.h"
+#include "app_ui.h"
+#include "simple_img.h"
+#include "aem_workout_res.h"
+#include "aem_sys_function_interface.h"
+#include "aem_bg.h"
+#include "aem_in_out_power.h"
+#include "aem_app_fwk.h"
+#include "text_canvas.h"
+#include "aem_txt.h"
+#include "aem_activity_id.h"
+
+#define ARC_WIDTH 54
+
+#define LV_COLOR_BLUE LV_COLOR_MAKE(0x36, 0xdc, 0xff)
+#define LV_COLOR_GREEN LV_COLOR_MAKE(0x88, 0xff, 0x56)
+#define LV_COLOR_BLACK LV_COLOR_MAKE(0x00, 0x00, 0x00)
+#define LV_COLOR_WHITE LV_COLOR_MAKE(0xff, 0xff, 0xff)
+
+typedef struct
+{
+    lv_obj_t *in_power_value;
+    lv_obj_t *in_voltage_value;
+    lv_obj_t *in_current_value;
+    bool widget_start;
+
+} input_power_scr_ui_data_t;
+
+typedef struct
+{
+    lv_obj_t *bg;
+    lv_obj_t *input_power_blue_chart;
+} aem_struct_power_point;
+
+const uint16_t in_chart_width = 360;
+const uint8_t in_chart_hight = 120;
+const uint8_t in_chart_align_y_to_up = 40;
+const uint16_t in_chart_point_num = 12;
+static uint16_t chart_range_max = 50;
+static uint16_t chart_range_min = 0;
+static uint16_t chart_range_max_pre = 50;
+static uint16_t chart_range_min_pre = 0;
+static aem_struct_power_point *s_power_point = NULL;
+
+static inline lv_color_t lv_color_blue(void)
+{
+    return lv_color_make(0x36, 0xdc, 0xff);
+}
+static inline lv_color_t lv_color_green(void)
+{
+    return lv_color_make(0x88, 0xff, 0x56);
+}
+
+static void *load_res()
+{
+    input_power_scr_ui_data_t *ext_data = lv_mem_alloc(sizeof(input_power_scr_ui_data_t));
+    if (ext_data == NULL)
+    {
+        return NULL;
+    }
+    lv_memset(ext_data, 0, sizeof(input_power_scr_ui_data_t));
+
+    return ext_data;
+}
+
+static lv_obj_t *activity_value_item_create(lv_obj_t *par, lv_color_t value_color,
+                                            char *value, lv_coord_t hight, const lv_font_t *value_font)
+{
+    if (par == NULL)
+    {
+        return NULL;
+    }
+
+    lv_obj_t *bg = aem_bg_create(par, AEM_SIZE_HOR_FACTOR_466(360), AEM_SIZE_VER_FACTOR_466(hight), lv_color_black());
+    if (bg == NULL)
+    {
+        return NULL;
+    }
+
+    //lv_obj_clear_flag(bg, LV_OBJ_FLAG_CLICKABLE);
+
+    lv_obj_t *value_label = text_canvas_create(bg);
+    if (value_label)
+    {
+        lv_obj_set_width(value_label, AEM_SIZE_HOR_FACTOR_466(160));
+        text_canvas_set_long_mode(value_label, LV_LABEL_LONG_SCROLL_CIRCULAR);
+        lv_obj_set_style_text_align(value_label, LV_TEXT_ALIGN_LEFT, 0);
+        //lv_obj_clear_flag(value_label, LV_OBJ_FLAG_CLICKABLE);
+        lv_obj_set_style_text_color(value_label, value_color, 0);
+        lv_obj_set_style_text_font(value_label, value_font, 0);
+        text_canvas_set_text(value_label, value);
+        lv_obj_align(value_label, LV_ALIGN_CENTER, 0, 0);
+    }
+
+    return bg;
+}
+
+static void link_icon_event_cb(lv_event_t *event)
+{
+    //printk("link_icon_event_cb\n");
+
+    if (event->code == LV_EVENT_CLICKED)
+    {
+        aem_activity_run(AEM_BIND_QRCODE, NULL);
+        //aem_app_close(AEM_APP_ID_input_power);
+    }
+}
+
+static void draw_event_cb(lv_event_t *e)
+{    
+    /*Add the faded area before the lines are drawn*/
+    lv_obj_draw_part_dsc_t *dsc = lv_event_get_draw_part_dsc(e);
+    if (dsc && dsc->part == LV_PART_ITEMS)
+    {
+        if (!dsc->p1 || !dsc->p2)
+        {
+            return;
+        }
+    #if 0    
+        dsc->rect_dsc->bg_opa = LV_OPA_TRANSP;
+        dsc->rect_dsc->bg_color = lv_color_black();
+    
+        dsc->rect_dsc->border_opa = LV_OPA_TRANSP;
+        dsc->rect_dsc->border_color = lv_color_black();
+        dsc->rect_dsc->border_width = 6;
+
+        if (e->user_data == 0)
+        {
+            dsc->rect_dsc->outline_color = lv_color_blue();
+        }
+        else
+        {
+            dsc->rect_dsc->outline_color = lv_color_green();
+        }
+
+        dsc->rect_dsc->outline_opa = LV_OPA_COVER;
+        //dsc->rect_dsc->outline_color = lv_color_blue();
+        dsc->rect_dsc->outline_width = 6;
+        dsc->rect_dsc->radius = LV_RADIUS_CIRCLE;
+        static lv_area_t a = { 0 };
+        a.x1 = dsc->draw_area->x1;// -5;
+        a.x2 = dsc->draw_area->x2;// +5;
+        a.y1 = dsc->draw_area->y1;// -5;
+        a.y2 = dsc->draw_area->y2;// +5;
+        lv_draw_rect(dsc->draw_ctx, dsc->rect_dsc, &a);
+    #else
+        lv_draw_img_dsc_t img_dsc;
+        lv_draw_img_dsc_init(&img_dsc);
+        img_dsc.opa = LV_OPA_COVER;
+        lv_area_t a = { 0 };
+        a.x1 = dsc->draw_area->x1 - (IMG_SCENE_IN_OUT_POWER_PIC_POINT_IN.header.w / 2);
+        a.x2 = dsc->draw_area->x1 + (IMG_SCENE_IN_OUT_POWER_PIC_POINT_IN.header.w / 2) - 1;
+        a.y1 = dsc->draw_area->y1 - (IMG_SCENE_IN_OUT_POWER_PIC_POINT_IN.header.h / 2);
+        a.y2 = dsc->draw_area->y1 + (IMG_SCENE_IN_OUT_POWER_PIC_POINT_IN.header.h / 2) - 1;
+        lv_draw_img(dsc->draw_ctx, &img_dsc, &a, &IMG_SCENE_IN_OUT_POWER_PIC_POINT_IN);
+        
+    #endif    
+    }
+}
+
+#define VOLT_CURR_WIDTH 180
+#define POWER_STYLE_WIDTH 180
+#ifndef CONFIG_SIMULATOR
+#define BG_ICON1_IMG_OPA LV_OPA_40//250
+#define BG_ICON2_IMG_OPA 20//LV_OPA_10
+#define BG_ICON3_IMG_OPA 20//20
+#define BG_ICON4_IMG_OPA 20//15
+#define BG_ICON5_IMG_OPA 20//10
+#define BG_ICON6_IMG_OPA 20//5
+#else
+#define BG_ICON1_IMG_OPA LV_OPA_COVER
+#define BG_ICON2_IMG_OPA LV_OPA_COVER
+#define BG_ICON3_IMG_OPA LV_OPA_COVER
+#define BG_ICON4_IMG_OPA LV_OPA_COVER
+#define BG_ICON5_IMG_OPA LV_OPA_COVER
+#define BG_ICON6_IMG_OPA LV_OPA_COVER
+#endif
+static lv_obj_t *aem_input_power_arc_show_create(lv_obj_t *par)
+{
+    input_power_scr_ui_data_t *activity_ui_data = lv_obj_get_user_data(par);
+    activity_day_data_t day_data = get_today_training_day_data();
+
+    char *in_power_data = aem_auto_release_txt_fmt("%d", day_data.steps);
+    lv_obj_t *in_power_item = activity_value_item_create(par, (lv_color_t)LV_COLOR_BLACK, in_power_data, 70, aem_font_def());
+    lv_obj_set_style_bg_color(in_power_item, (lv_color_t)LV_COLOR_BLUE, 0);
+    lv_obj_set_style_radius(in_power_item, AEM_SIZE_FACTOR_466(10), 0);
+    lv_obj_set_style_width(in_power_item, AEM_SIZE_FACTOR_466(POWER_STYLE_WIDTH), 0);
+
+    if (in_power_item)
+    {
+        activity_ui_data->in_power_value = lv_obj_get_child(in_power_item, 0);
+    }
+
+    char *in_voltage_data = aem_auto_release_txt_fmt("%d", day_data.calories);
+    lv_obj_t *in_voltage_item = activity_value_item_create(par, (lv_color_t)LV_COLOR_BLUE, in_voltage_data, 50, aem_font_sub());
+    //lv_obj_set_style_bg_color(in_voltage_item, (lv_color_t)LV_COLOR_WHITE, 0);
+    lv_obj_set_style_align(in_voltage_item, LV_ALIGN_LEFT_MID, 0);
+    lv_obj_set_style_width(in_voltage_item, AEM_SIZE_FACTOR_466(VOLT_CURR_WIDTH), 0);
+
+    if (in_voltage_item)
+    {
+        activity_ui_data->in_voltage_value = lv_obj_get_child(in_voltage_item, 0);
+    }
+
+    char *in_current_data = aem_auto_release_txt_fmt("%d", day_data.durmin);
+    lv_obj_t *in_current_item = activity_value_item_create(par, (lv_color_t)LV_COLOR_BLUE, in_current_data, 50, aem_font_sub());
+    //lv_obj_set_style_bg_color(in_current_item, (lv_color_t)LV_COLOR_WHITE, 0);
+    lv_obj_set_style_align(in_current_item, LV_ALIGN_LEFT_MID, 0);
+    lv_obj_set_style_width(in_current_item, AEM_SIZE_FACTOR_466(VOLT_CURR_WIDTH), 0);
+
+    if (in_current_item)
+    {
+        activity_ui_data->in_current_value = lv_obj_get_child(in_current_item, 0);
+    }
+
+    lv_obj_align(in_power_item, LV_ALIGN_CENTER, AEM_SIZE_HOR_FACTOR_466(0), AEM_SIZE_VER_FACTOR_466(0));
+    lv_obj_align_to(in_voltage_item, in_power_item, LV_ALIGN_OUT_BOTTOM_MID, AEM_SIZE_HOR_FACTOR_466(28), AEM_SIZE_VER_FACTOR_466(0));        
+    lv_obj_align_to(in_current_item, in_voltage_item, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);        
+
+    lv_obj_t *in_power_unit_label = text_canvas_create(in_power_item);
+    if (in_power_unit_label)
+    {
+        lv_obj_set_style_text_font(in_power_unit_label, aem_font_small(), 0);
+        text_canvas_set_text(in_power_unit_label, "W");
+        lv_obj_set_style_text_color(in_power_unit_label, (lv_color_t)LV_COLOR_BLACK, 0);
+        lv_obj_align(in_power_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(58), AEM_SIZE_VER_FACTOR_466(30));
+    }
+
+    lv_obj_t *in_voltage_unit_label = text_canvas_create(in_voltage_item);
+    if (in_voltage_unit_label)
+    {
+        lv_obj_set_style_text_font(in_voltage_unit_label, aem_font_small(), 0);
+        text_canvas_set_text(in_voltage_unit_label, "V");
+        lv_obj_set_style_text_color(in_voltage_unit_label, (lv_color_t)LV_COLOR_BLUE, 0);
+        lv_obj_align(in_voltage_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(26), AEM_SIZE_VER_FACTOR_466(16));
+    }
+
+    lv_obj_t *in_current_unit_label = text_canvas_create(in_current_item);
+    if (in_current_unit_label)
+    {
+        lv_obj_set_style_text_font(in_current_unit_label, aem_font_small(), 0);
+        text_canvas_set_text(in_current_unit_label, "A");
+        lv_obj_set_style_text_color(in_current_unit_label, (lv_color_t)LV_COLOR_BLUE, 0);
+        lv_obj_align(in_current_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(26), AEM_SIZE_VER_FACTOR_466(16));
+    }
+
+    // Arcs
+    lv_obj_t *arc_bg = aem_bg_create(par, DEF_UI_WIDTH, DEF_UI_HEIGHT, lv_color_black());
+    if (arc_bg)
+    {
+        //lv_obj_clear_flag(arc_bg, LV_OBJ_FLAG_CLICKABLE);
+        lv_obj_set_style_bg_opa(arc_bg, LV_OPA_TRANSP, 0);
+        lv_obj_set_style_transform_pivot_x(arc_bg, DEF_UI_WIDTH / 2, 0);
+        lv_obj_set_style_transform_pivot_y(arc_bg, DEF_UI_HEIGHT / 2, 0);
+   
+        //lv_obj_t *point_line_icon = lv_img_create(arc_bg);
+        //if (point_line_icon)
+        //{
+        //    //lv_obj_clear_flag(point_line_icon, LV_OBJ_FLAG_CLICKABLE);
+        //    lv_img_set_src(point_line_icon, &IMG_SCENE_IN_OUT_POWER_PIC_POINT_LINE);
+        //    lv_obj_align(point_line_icon, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(0), AEM_SIZE_VER_FACTOR_466(0));
+        //}
+
+        lv_obj_t *in_icon = lv_img_create(arc_bg);
+        if (in_icon)
+        {
+            //lv_obj_clear_flag(in_icon, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(in_icon, &IMG_SCENE_IN_OUT_POWER_PIC_IN);
+            lv_obj_align(in_icon, LV_ALIGN_LEFT_MID, AEM_SIZE_HOR_FACTOR_466(75), AEM_SIZE_VER_FACTOR_466(0));
+        }
+
+        lv_obj_t *voltage_icon = lv_img_create(arc_bg);
+        if (voltage_icon)
+        {
+            //lv_obj_clear_flag(voltage_icon, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(voltage_icon, &IMG_SCENE_IN_OUT_POWER_PIC_VOLTAGE_ICON);
+            lv_obj_align(voltage_icon, LV_ALIGN_LEFT_MID, AEM_SIZE_HOR_FACTOR_466(150), AEM_SIZE_VER_FACTOR_466(60));
+        }
+
+        lv_obj_t *current_icon = lv_img_create(arc_bg);
+        if (current_icon)
+        {
+            //lv_obj_clear_flag(current_icon, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(current_icon, &IMG_SCENE_IN_OUT_POWER_PIC_CURRENT_ICON);
+            lv_obj_align(current_icon, LV_ALIGN_LEFT_MID, AEM_SIZE_HOR_FACTOR_466(150), AEM_SIZE_VER_FACTOR_466(110));
+        }
+
+        lv_obj_t *in_bg_icon1 = lv_img_create(arc_bg);
+        if (in_bg_icon1)
+        {
+            //lv_obj_clear_flag(in_icon, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(in_bg_icon1, &IMG_SCENE_IN_OUT_POWER_PIC_DEEPBLUE_ARROW);
+            lv_obj_align(in_bg_icon1, LV_ALIGN_LEFT_MID, AEM_SIZE_HOR_FACTOR_466(145), AEM_SIZE_VER_FACTOR_466(0));
+            lv_obj_set_style_img_opa(in_bg_icon1, BG_ICON1_IMG_OPA, 0);
+        }
+
+        lv_obj_t *in_bg_icon2 = lv_img_create(in_bg_icon1);
+        if (in_bg_icon2)
+        {
+            //lv_obj_clear_flag(in_icon, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(in_bg_icon2, &IMG_SCENE_IN_OUT_POWER_PIC_DEEPBLUE_ARROW);
+            lv_obj_align_to(in_bg_icon2, in_bg_icon1, LV_ALIGN_OUT_RIGHT_MID, AEM_SIZE_HOR_FACTOR_466(0), AEM_SIZE_VER_FACTOR_466(0));
+            lv_obj_set_style_img_opa(in_bg_icon2, BG_ICON2_IMG_OPA, 0);
+        }
+
+        lv_obj_t *in_bg_icon3 = lv_img_create(in_bg_icon2);
+        if (in_bg_icon3)
+        {
+            //lv_obj_clear_flag(in_icon, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(in_bg_icon3, &IMG_SCENE_IN_OUT_POWER_PIC_DEEPBLUE_ARROW);
+            lv_obj_align_to(in_bg_icon3, in_bg_icon2, LV_ALIGN_OUT_RIGHT_MID, AEM_SIZE_HOR_FACTOR_466(0), AEM_SIZE_VER_FACTOR_466(0));
+            lv_obj_set_style_img_opa(in_bg_icon3, BG_ICON3_IMG_OPA, 0);
+        }
+
+        lv_obj_t *in_bg_icon4 = lv_img_create(in_bg_icon3);
+        if (in_bg_icon4)
+        {
+            //lv_obj_clear_flag(in_icon, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(in_bg_icon4, &IMG_SCENE_IN_OUT_POWER_PIC_DEEPBLUE_ARROW);
+            lv_obj_align_to(in_bg_icon4, in_bg_icon3, LV_ALIGN_OUT_RIGHT_MID, AEM_SIZE_HOR_FACTOR_466(0), AEM_SIZE_VER_FACTOR_466(0));
+            lv_obj_set_style_img_opa(in_bg_icon4, BG_ICON4_IMG_OPA, 0);
+        }
+
+        lv_obj_t *in_bg_icon5 = lv_img_create(in_bg_icon4);
+        if (in_bg_icon5)
+        {
+            //lv_obj_clear_flag(in_icon, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(in_bg_icon5, &IMG_SCENE_IN_OUT_POWER_PIC_DEEPBLUE_ARROW);
+            lv_obj_align_to(in_bg_icon5, in_bg_icon4, LV_ALIGN_OUT_RIGHT_MID, AEM_SIZE_HOR_FACTOR_466(0), AEM_SIZE_VER_FACTOR_466(0));
+            lv_obj_set_style_img_opa(in_bg_icon5, BG_ICON5_IMG_OPA, 0);
+        }
+
+        lv_obj_t *in_bg_icon6 = lv_img_create(in_bg_icon5);
+        if (in_bg_icon6)
+        {
+            //lv_obj_clear_flag(in_icon, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(in_bg_icon6, &IMG_SCENE_IN_OUT_POWER_PIC_DEEPBLUE_ARROW);
+            lv_obj_align_to(in_bg_icon6, in_bg_icon5, LV_ALIGN_OUT_RIGHT_MID, AEM_SIZE_HOR_FACTOR_466(0), AEM_SIZE_VER_FACTOR_466(0));
+            lv_obj_set_style_img_opa(in_bg_icon6, BG_ICON6_IMG_OPA, 0);
+        }
+        //==========================================================================================//
+        
+        lv_obj_t *link_icon = lv_img_create(arc_bg);
+        if (link_icon)
+        {
+            lv_img_set_src(link_icon, &IMG_SCENE_IN_OUT_POWER_PIC_LINK);
+            lv_obj_align(link_icon, LV_ALIGN_BOTTOM_MID, AEM_SIZE_HOR_FACTOR_466(0), AEM_SIZE_VER_FACTOR_466(-15));
+        } 
+
+        lv_obj_t *link_bg = aem_bg_create(arc_bg, AEM_SIZE_HOR_FACTOR_466(120), AEM_SIZE_VER_FACTOR_466(80), lv_color_white());
+        if (link_bg)
+        {
+            lv_obj_set_style_bg_opa(link_bg, LV_OPA_TRANSP, 0);
+            lv_obj_add_flag(link_bg, LV_OBJ_FLAG_CLICKABLE);
+            lv_obj_align(link_bg, LV_ALIGN_BOTTOM_MID, AEM_SIZE_HOR_FACTOR_466(0), AEM_SIZE_VER_FACTOR_466(0));
+            lv_obj_add_event_cb(link_bg, link_icon_event_cb, LV_EVENT_CLICKED, NULL);
+        }  
+    }
+
+    return par;
+}
+
+static lv_obj_t *arc_bg_create(lv_obj_t *par)
+{
+    lv_obj_t *bg = lv_arc_create(par);
+    if (bg == NULL)
+    {
+        return NULL;
+    }
+
+    //lv_obj_set_style_arc_color(bg, lv_color_hex(0x001831), LV_PART_MAIN);
+    //lv_obj_set_style_arc_width(bg, AEM_SIZE_FACTOR_466(35), LV_PART_MAIN);
+    lv_obj_set_size(bg, AEM_SIZE_HOR_FACTOR_466(460), AEM_SIZE_VER_FACTOR_466(in_chart_hight + in_chart_align_y_to_up));
+    //lv_arc_set_bg_angles(bg, 0, 360);
+    //lv_arc_set_angles(bg, 0, 0);
+    lv_obj_remove_style(bg, NULL, LV_PART_KNOB);
+    lv_obj_clear_flag(bg, LV_OBJ_FLAG_CLICKABLE);
+    lv_obj_add_flag(bg, LV_OBJ_FLAG_EVENT_BUBBLE | LV_OBJ_FLAG_GESTURE_BUBBLE | LV_OBJ_FLAG_SCROLL_CHAIN);
+    return bg;
+}
+
+static lv_obj_t *create_chart(lv_obj_t *par, int type)
+{
+    // 创建图表对象,并将其添加到指定的父对象中
+    lv_obj_t *chart = lv_chart_create(par);
+    if (chart == NULL)
+    {
+        return NULL;
+    }
+
+    // 设置图表对象的大小为 360x120
+    lv_obj_set_size(chart, AEM_SIZE_HOR_FACTOR_466(in_chart_width), AEM_SIZE_VER_FACTOR_466(in_chart_hight));
+    // 设置图表对象的内边距为0
+    lv_obj_set_style_pad_all(chart, 0, LV_PART_MAIN);
+    // 设置图表对象的间隙为0
+    lv_obj_set_style_pad_gap(chart, 0, LV_PART_MAIN);
+    // 设置图表对象的背景颜色为白色
+    lv_obj_set_style_bg_color(chart, lv_color_white(), LV_PART_MAIN);
+    // 设置图表对象的背景透明度为完全透明
+    lv_obj_set_style_bg_opa(chart, LV_OPA_TRANSP, LV_PART_MAIN);
+    // 设置图表对象的边框宽度为0,使边框不可见
+    lv_obj_set_style_border_width(chart, 0, LV_PART_MAIN);
+    // 设置图表对象的边框透明度为完全透明
+    lv_obj_set_style_border_opa(chart, LV_OPA_TRANSP, LV_PART_MAIN);
+    // 设置图表对象的轮廓宽度为0,使轮廓不可见
+    lv_obj_set_style_outline_width(chart, 0, LV_PART_MAIN);
+    // 设置图表对象的轮廓透明度为完全透明
+    lv_obj_set_style_outline_opa(chart, LV_OPA_TRANSP, LV_PART_MAIN);
+    // 设置图表对象的阴影宽度为0,使阴影不可见
+    lv_obj_set_style_shadow_width(chart, 0, LV_PART_MAIN);
+    // 设置图表对象的阴影透明度为完全透明
+    lv_obj_set_style_shadow_opa(chart, LV_OPA_TRANSP, LV_PART_MAIN);
+    // 设置图表数据点的线条宽度为3
+    lv_obj_set_style_line_width(chart, AEM_SIZE_FACTOR_466(3), LV_PART_ITEMS);
+    // 设置图表数据点的线条透明度为完全覆盖
+    lv_obj_set_style_line_opa(chart, LV_OPA_COVER, LV_PART_ITEMS);
+    // 设置图表数据点的线条颜色为蓝色
+    lv_obj_set_style_line_color(chart, lv_color_hex(0x36DCFF), LV_PART_ITEMS);
+    // 将图表对象水平居中对齐
+    lv_obj_align(chart, LV_ALIGN_TOP_MID, 0, AEM_SIZE_VER_FACTOR_466(in_chart_align_y_to_up));
+    // 将图表对象的类型设置为线图表,即用线连接数据点
+    lv_chart_set_type(chart, LV_CHART_TYPE_LINE);
+    // 设置图表对象的数据点数量为24
+    lv_chart_set_point_count(chart, in_chart_point_num);
+    // 设置图表对象的Y轴范围,最小值为chart_range_min,最大值为chart_range_max
+    lv_chart_set_range(chart, LV_CHART_AXIS_PRIMARY_Y, chart_range_min, chart_range_max);
+
+    lv_chart_set_div_line_count(chart, 0, 0); //	设置背景分界线
+    lv_obj_add_event_cb(chart, draw_event_cb, LV_EVENT_DRAW_PART_BEGIN, (void *)type);
+
+    lv_chart_series_t *series;
+    series = lv_chart_add_series(chart, lv_color_hex(0x36DCFF), LV_CHART_AXIS_PRIMARY_Y);
+
+    int value = 0;
+    // 将数据点添加到图表对象中
+    for (int i = 0; i < in_chart_point_num; i++)
+    {
+        aem_power_point_item_t *info = aem_get_baro_items_data();
+
+        value = info->input_power_blue_chart[i];
+
+        lv_chart_set_value_by_id(chart, series, i, value);              
+    }
+
+    lv_chart_set_update_mode(chart, LV_CHART_UPDATE_MODE_SHIFT);
+    // lv_chart_refresh(chart);
+
+    return chart;
+}
+
+static void aem_create_input_point_page(lv_obj_t *par)
+{
+    s_power_point = (aem_struct_power_point *)lv_mem_alloc(sizeof(aem_struct_power_point));
+    if(s_power_point == NULL)
+    {
+        return;
+    }
+    lv_memset(s_power_point, 0x00, sizeof(aem_struct_power_point));
+
+    s_power_point->bg = arc_bg_create(par);
+    if (s_power_point->bg)
+    {
+        s_power_point->input_power_blue_chart = create_chart(par, 0);
+    }
+}
+
+lv_obj_t *aem_input_power_screen_create(lv_obj_t *par, bool widget_start)
+{
+    input_power_scr_ui_data_t *ext_data = load_res();
+    if (ext_data == NULL)
+    {
+        return NULL;
+    }
+
+    ext_data->widget_start = widget_start;
+    lv_obj_t *screen = aem_bg_create(par, DEF_UI_WIDTH, DEF_UI_HEIGHT, lv_color_black());
+    if (screen)
+    {
+        lv_obj_set_user_data(screen, ext_data);
+
+        aem_input_power_arc_show_create(screen);
+
+        aem_create_input_point_page(screen);  // 创建点阵屏
+    }
+
+    return screen;
+}
+
+void aem_input_power_screen_del(lv_obj_t *par)
+{
+    if (par == NULL)
+    {
+        return;
+    }
+
+    input_power_scr_ui_data_t *ext_data = lv_obj_get_user_data(par);
+    if (ext_data)
+    {
+        lv_mem_free(ext_data);
+        ext_data = NULL;
+        lv_obj_set_user_data(par, NULL);
+    }
+}
+
+#define RANGER_ONE_MIN 0
+#define RANGER_ONE_MAX 60
+#define RANGER_TWO_MIN 60
+#define RANGER_TWO_MAX 120
+#define RANGER_THREE_MIN 120
+#define RANGER_THREE_MAX 180
+#define RANGER_FOUR_MIN 180
+#define RANGER_FOUR_MAX 240
+#define RANGER_FIVE_MIN 240
+#define RANGER_FIVE_MAX 300
+#define RANGER_SIX_MIN 300
+#define RANGER_SIX_MAX 360
+#define RANGER_SEVEN_MIN 360
+#define RANGER_SEVEN_MAX 420
+#define RANGER_EIGHT_MIN 420
+#define RANGER_EIGHT_MAX 480
+#define RANGER_NINE_MIN 480
+#define RANGER_NINE_MAX 540
+#define RANGER_TEN_MIN 540
+#define RANGER_TEN_MAX 600
+
+#ifndef CONFIG_SIMULATOR
+extern float f_BusVoltage[2];
+extern float f_Power[2];
+extern float f_Current[2];
+#else
+static float f_Power[2] = {10.0, 15.0};
+static float f_BusVoltage[2] = {5.00, 5.00};
+static float f_Current[2] = {2.00, 3.00};
+static uint16_t chart_point_cnt = 0;
+static uint16_t chart_point_cnt_plus2 = 1;
+static uint8_t simulator_cnt = 0;
+#include "time.h"
+#endif
+void aem_input_power_screen_update(lv_obj_t *par)
+{
+    input_power_scr_ui_data_t *power_volt_cur_data = lv_obj_get_user_data(par);
+    uint16_t input_power_blue_chart_point_min = 600;
+    uint16_t input_power_blue_chart_point_max = 0;
+    bool f_Power_index;
+
+#ifdef CONFIG_SIMULATOR
+    // 设置随机数种子 
+    //srand((unsigned int)time(0)); // 获取随机数
+
+    f_Current[0] = (float)(rand() % 3) + 0.04;
+    //f_BusVoltage[0] = (float)(rand() % 20) + 4.40;
+    //f_Power[0] = f_BusVoltage[0] * f_Current[0];
+
+    f_Current[1] = (float)(rand() % 3) + 0.04;
+    //f_BusVoltage[1] = (float)(rand() % 20) + 4.40;
+    //f_Power[1] = f_BusVoltage[1] * f_Current[1];
+
+    f_BusVoltage[0] = (float)(rand() % 20) + 0.50;
+    simulator_cnt++;
+    if (simulator_cnt < 13)
+    {
+        f_BusVoltage[1] = (float)(rand() % 2) + 0.50;
+    }
+    else if (simulator_cnt < 26)
+    {
+        f_BusVoltage[1] = (float)(rand() % 20) + 4.50;
+    }
+    else
+    {
+        simulator_cnt = 0;
+    }
+
+    chart_point_cnt++;
+    if (chart_point_cnt > in_chart_point_num)
+    {
+        chart_point_cnt = 0;
+        chart_point_cnt_plus2++;
+        if (chart_point_cnt_plus2 > 11)
+        {
+            chart_point_cnt_plus2 = 1;
+        }
+    }
+
+    f_Power[0] = (float)(rand() % (5 * chart_point_cnt_plus2)) + (5 * (chart_point_cnt_plus2 - 1));
+    f_Power[1] = (float)(rand() % (5 * chart_point_cnt_plus2)) + (5 * (chart_point_cnt_plus2 - 1));
+
+#endif
+
+    if (power_volt_cur_data)
+    {
+        f_Power_index = f_Power[0] > f_Power[1] ? 0 : 1;
+
+        if (s_power_point)
+        {
+            aem_power_point_item_t *info = aem_get_baro_items_data();
+
+            for (int i = in_chart_point_num - 1; i > 0; i--)
+            {
+                info->input_power_blue_chart[i] = info->input_power_blue_chart[i - 1];
+            }
+
+            info->input_power_blue_chart[0] = f_Power[f_Power_index] * 10.00;//rand() % 59 + 1;
+
+            for (int i = 0; i < in_chart_point_num; i++)
+            {
+                lv_chart_series_t *series = lv_chart_get_series_next(s_power_point->input_power_blue_chart, NULL);
+
+                lv_chart_set_value_by_id(s_power_point->input_power_blue_chart, series, i, info->input_power_blue_chart[i]);
+
+                if (info->input_power_blue_chart[i] < input_power_blue_chart_point_min)
+                {
+                    input_power_blue_chart_point_min = info->input_power_blue_chart[i];
+                }
+                if (info->input_power_blue_chart[i] > input_power_blue_chart_point_max)
+                {
+                    input_power_blue_chart_point_max = info->input_power_blue_chart[i];
+                }
+            }
+
+            if (input_power_blue_chart_point_min <= RANGER_ONE_MAX)
+            {
+                chart_range_min = RANGER_ONE_MIN;
+            }
+            else if (input_power_blue_chart_point_min <= RANGER_TWO_MAX)
+            {
+                chart_range_min = RANGER_TWO_MIN;
+            }
+            else if (input_power_blue_chart_point_min <= RANGER_THREE_MAX)
+            {
+                chart_range_min = RANGER_THREE_MIN;
+            }
+            else if (input_power_blue_chart_point_min <= RANGER_FOUR_MAX)
+            {
+                chart_range_min = RANGER_FOUR_MIN;
+            }
+            else if (input_power_blue_chart_point_min <= RANGER_FIVE_MAX)
+            {
+                chart_range_min = RANGER_FIVE_MIN;
+            }
+            else if (input_power_blue_chart_point_min <= RANGER_SIX_MAX)
+            {
+                chart_range_min = RANGER_SIX_MIN;
+            }
+            else if (input_power_blue_chart_point_min <= RANGER_SEVEN_MAX)
+            {
+                chart_range_min = RANGER_SEVEN_MIN;
+            }
+            else if (input_power_blue_chart_point_min <= RANGER_EIGHT_MAX)
+            {
+                chart_range_min = RANGER_EIGHT_MIN;
+            }
+            else if (input_power_blue_chart_point_min <= RANGER_NINE_MAX)
+            {
+                chart_range_min = RANGER_NINE_MIN;
+            }
+            else //if (input_power_blue_chart_point_min <= RANGER_TEN_MAX)
+            {
+                chart_range_min = RANGER_TEN_MIN;
+            }
+
+            if (input_power_blue_chart_point_max >= RANGER_TEN_MIN)
+            {
+                chart_range_max = RANGER_TEN_MAX;
+            }
+            else if (input_power_blue_chart_point_max >= RANGER_NINE_MIN)
+            {
+                chart_range_max = RANGER_NINE_MAX;
+            }
+            else if (input_power_blue_chart_point_max >= RANGER_EIGHT_MIN)
+            {
+                chart_range_max = RANGER_EIGHT_MAX;
+            }
+            else if (input_power_blue_chart_point_max >= RANGER_SEVEN_MIN)
+            {
+                chart_range_max = RANGER_SEVEN_MAX;
+            }
+            else if (input_power_blue_chart_point_max >= RANGER_SIX_MIN)
+            {
+                chart_range_max = RANGER_SIX_MAX;
+            }
+            else if (input_power_blue_chart_point_max >= RANGER_FIVE_MIN)
+            {
+                chart_range_max = RANGER_FIVE_MAX;
+            }
+            else if (input_power_blue_chart_point_max >= RANGER_FOUR_MIN)
+            {
+                chart_range_max = RANGER_FOUR_MAX;
+            }
+            else if (input_power_blue_chart_point_max >= RANGER_THREE_MIN)
+            {
+                chart_range_max = RANGER_THREE_MAX;
+            }
+            else if (input_power_blue_chart_point_max >= RANGER_TWO_MIN)
+            {
+                chart_range_max = RANGER_TWO_MAX;
+            }
+            else //if (input_power_blue_chart_point_max >= RANGER_ONE_MIN)
+            {
+                chart_range_max = RANGER_ONE_MAX;
+            }
+
+            if (chart_range_max != chart_range_max_pre || chart_range_min != chart_range_min_pre)
+            {
+                chart_range_max_pre = chart_range_max;
+                chart_range_min_pre = chart_range_min;
+                lv_chart_set_range(s_power_point->input_power_blue_chart, LV_CHART_AXIS_PRIMARY_Y, chart_range_min, chart_range_max);
+            }
+            //=================================================================================//
+        }
+
+
+        char str_data[32] = {0};
+        sprintf(str_data, "%6.3f", f_Power[f_Power_index]);
+        text_canvas_set_text(power_volt_cur_data->in_power_value, str_data);
+
+        sprintf(str_data, "%6.3f", f_BusVoltage[f_Power_index]);
+        text_canvas_set_text(power_volt_cur_data->in_voltage_value, str_data);
+            
+        sprintf(str_data, "%6.3f", f_Current[f_Power_index]);
+        text_canvas_set_text(power_volt_cur_data->in_current_value, str_data);
+    }
+}

+ 53 - 2
application/aem_watch/src/application/in_out_power/aem_widget_in_out_power.c

@@ -14,6 +14,7 @@
 #include "aem_in_out_power_screen.h"
 #include "res_include.h"
 #include "app_ui.h"
+#include "aem_in_out_power.h"
 
 typedef struct
 {
@@ -23,6 +24,8 @@ typedef struct
 
 static aem_wf_in_out_power_t *s_wf_in_out_power = NULL;
 
+static bool in_out_value_show_flag = false;
+
 static void timer_cb(lv_timer_t *t)
 {
     if (s_wf_in_out_power == NULL)
@@ -30,7 +33,44 @@ static void timer_cb(lv_timer_t *t)
     if (s_wf_in_out_power->bg == NULL)
         return;
 
-    aem_in_out_power_screen_update(s_wf_in_out_power->bg);
+    if (in_out_value_show_flag != aem_in_out_value_show())
+    {
+        lv_timer_pause(s_wf_in_out_power->timer);
+
+        //os_printk("[timer_cb] in_out_value_show_flag:%d\n", in_out_value_show_flag);
+
+        if (s_wf_in_out_power->bg)
+        {
+            aem_in_out_power_screen_del(s_wf_in_out_power->bg);
+            aem_input_power_screen_del(s_wf_in_out_power->bg);
+
+            //lv_obj_del(s_wf_in_out_power->bg);
+            //s_wf_in_out_power->bg = NULL;
+        }
+        in_out_value_show_flag = aem_in_out_value_show();
+
+        if (in_out_value_show_flag)
+        {
+            s_wf_in_out_power->bg = aem_in_out_power_screen_create(s_wf_in_out_power->bg, true);
+        }
+        else
+        {
+            s_wf_in_out_power->bg = aem_input_power_screen_create(s_wf_in_out_power->bg, true);
+        }
+
+        lv_timer_resume(s_wf_in_out_power->timer);
+
+        return;
+    }    
+
+    if (in_out_value_show_flag)  //show in & out value
+    {
+        aem_in_out_power_screen_update(s_wf_in_out_power->bg);
+    }
+    else
+    {
+        aem_input_power_screen_update(s_wf_in_out_power->bg);
+    }
 }
 
 static int32_t keypad_evt_handler(aem_key_evt_info_t *evt_info)
@@ -50,7 +90,17 @@ static lv_obj_t *on_start(lv_obj_t *par)
         if (s_wf_in_out_power)
         {
             memset(s_wf_in_out_power, 0, sizeof(aem_wf_in_out_power_t));
-            s_wf_in_out_power->bg = aem_in_out_power_screen_create(par, true);
+
+            in_out_value_show_flag = aem_in_out_value_show();
+
+            if (in_out_value_show_flag)
+            {
+                s_wf_in_out_power->bg = aem_in_out_power_screen_create(par, true);
+            }
+            else
+            {
+                s_wf_in_out_power->bg = aem_input_power_screen_create(par, true);
+            }
             return s_wf_in_out_power->bg;
         }
     }
@@ -102,6 +152,7 @@ static void on_close()
     if (s_wf_in_out_power->bg)
     {
         aem_in_out_power_screen_del(s_wf_in_out_power->bg);
+        aem_input_power_screen_del(s_wf_in_out_power->bg);
 
         lv_obj_del(s_wf_in_out_power->bg);
         s_wf_in_out_power->bg = NULL;

+ 1 - 1
thirdparty/lib/aem/config/aem_project.h

@@ -4,7 +4,7 @@
 #pragma warning(error : 4013)
 #endif
 #define AEM_VERSION "BL_Develop_NOR"
-#define BUILD_TIME "202501141416"
+#define BUILD_TIME "202501151727"
 #define AEM_GUI_FWK_LIB_VER "2.0.0.0"
 #define APP_DOWNLOAD_URL "https://customer.com"
 #define AEM_APP_TRANS_ANIMATION 1

Some files were not shown because too many files changed in this diff