Bladeren bron

1、修改设置和读取时间日期时的BCD码和十进制/十六进制转换,在设置途中不发送串口数据
2、增加输入输出功耗的动点chart图,点根据功耗大小上下浮动
3、模拟器上增加电压、电流、功耗的随机数显示
4、测试安卓APP的OTA升级成功,升级的文件是application\aem_watch\outdir\ats3085s4_dev_watch_ext_nor\_firmware下的ota_full.bin(包含代码和资源的整包)或ota_firmware.bin(只包含代码段)
(OTA升级完、启动的时候,会先出现2秒左右的花屏界面,再正常进入,用USB连接升级则不会,问题待查)

mohliy 2 maanden geleden
bovenliggende
commit
2896cb89dc

BIN
application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.res


BIN
application/aem_watch/boards/ats3085s4_dev_watch_ext_nor/res/bt_watch.sty


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

@@ -11361,6 +11361,66 @@
                     <property name="0" value=".\in_out_power\out.png" />
                 </element>
             </element>
+            <element class="picture_resource">
+                <property name="name" value="PIC_POINT_IN" />
+                <property name="id" value="33308" />
+                <property name="x" value="0x006d" />
+                <property name="y" value="0x0091" />
+                <property name="width" value="0x000a" />
+                <property name="height" value="0x000a" />
+                <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\in电压标.png" />
+                </element>
+            </element>
+            <element class="picture_resource">
+                <property name="name" value="PIC_POINT_OUT" />
+                <property name="id" value="33309" />
+                <property name="x" value="0x00ef" />
+                <property name="y" value="0x0098" />
+                <property name="width" value="0x000a" />
+                <property name="height" value="0x000a" />
+                <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\out电压动标.png" />
+                </element>
+            </element>
+            <element class="picture_resource">
+                <property name="name" value="PIC_DEEPBLUE_ARROW" />
+                <property name="id" value="33310" />
+                <property name="x" value="0x006d" />
+                <property name="y" value="0x00db" />
+                <property name="width" value="0x0017" />
+                <property name="height" value="0x0037" />
+                <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_DEEPGREEN_ARROW" />
+                <property name="id" value="33311" />
+                <property name="x" value="0x00cb" />
+                <property name="y" value="0x00db" />
+                <property name="width" value="0x0017" />
+                <property name="height" value="0x0037" />
+                <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" />
@@ -22832,6 +22892,10 @@
         <picture value=".\applist\png\icon\蓝牙连接.png" />
         <picture value=".\profile_photo\in小.png" />
         <picture value=".\profile_photo\out小.png" />
+        <picture value=".\in_out_power\in电压标.png" />
+        <picture value=".\in_out_power\out电压动标.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" />

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

@@ -565,6 +565,10 @@
 #define  PIC_POINT_LINE    0xdd06e5e8
 #define  PIC_IN    0xd8449a9a
 #define  PIC_OUT    0x48fb4075
+#define  PIC_POINT_IN    0x6dc361a7
+#define  PIC_POINT_OUT    0x4a988cfa
+#define  PIC_DEEPBLUE_ARROW    0x5d86aef
+#define  PIC_DEEPGREEN_ARROW    0x447f98a0
 #define  STR_IN_OUT_POWER    0xddae7726
 #define  SCENE_PROFILE_PHOTO    0x598f6bff
 #define  PIC_PHOTO_MALE    0x361b9093

BIN
application/aem_watch/resource/360x360/in_out_power/in电压标.png


BIN
application/aem_watch/resource/360x360/in_out_power/out电压动标.png


BIN
application/aem_watch/resource/360x360/in_out_power/深绿色箭头.png


BIN
application/aem_watch/resource/360x360/in_out_power/深蓝箭头.png


BIN
application/aem_watch/resource/360x360/in_out_power/灰箭头.png


BIN
application/aem_watch/resource/360x360/in_out_power/箭头.png


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

@@ -303,6 +303,10 @@ extern lv_img_dsc_t IMG_SCENE_IN_OUT_POWER_PIC_POINT_LINE;
 extern lv_img_dsc_t IMG_SCENE_IN_OUT_POWER_PIC_IN; 
 extern lv_img_dsc_t IMG_SCENE_IN_OUT_POWER_PIC_LINK; 
 extern lv_img_dsc_t IMG_SCENE_IN_OUT_POWER_PIC_OUT; 
+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_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


+ 8 - 1
application/aem_watch/src/application/in_out_power/aem_in_out_power.c

@@ -56,6 +56,9 @@ typedef struct
 } activity_ui_data_t;
 
 static activity_ui_data_t *activity_ui_data = NULL;
+#ifdef CONFIG_SIMULATOR
+static lv_timer_t *sim_timer = NULL;
+#endif
 
 static void refresh_in_out_power_ui(void)
 {
@@ -114,7 +117,7 @@ lv_obj_t *in_out_power_ui_init(lv_obj_t *par)
     }
 
 #ifdef CONFIG_SIMULATOR
-    lv_timer_create(sim_timer_cb, 1000, NULL);
+    sim_timer = lv_timer_create(sim_timer_cb, 1000, NULL);
 #endif
 
     return bg;
@@ -181,6 +184,10 @@ static void on_stop(void)
         activity_ui_data->timer = NULL;
     }
 
+#ifdef CONFIG_SIMULATOR
+    lv_timer_del(sim_timer);
+#endif
+
     lv_mem_free(activity_ui_data);
     activity_ui_data = NULL;
 }

+ 671 - 34
application/aem_watch/src/application/in_out_power/aem_in_out_power_screen.c

@@ -1,8 +1,6 @@
-
-
-#include "aem_in_out_power_screen.h"
+#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"
@@ -32,6 +30,36 @@ typedef struct
 
 } in_out_power_scr_ui_data_t;
 
+typedef struct
+{
+    lv_obj_t *bg;
+    lv_obj_t *input_power_blue_chart;
+    lv_obj_t *output_power_green_chart;
+} aem_struct_power_point;
+
+const uint16_t chart_width = 360;
+const uint8_t chart_hight = 120;
+const uint8_t chart_align_y_to_up = 40;
+const uint16_t chart_point_num = 12;
+static uint16_t chart_range_max = 50;
+static uint16_t chart_range_min = 0;
+static uint16_t output_power_green_chart_range_max = 50;
+static uint16_t output_power_green_chart_range_min = 0;
+static uint16_t chart_range_max_pre = 50;
+static uint16_t chart_range_min_pre = 0;
+static uint16_t output_power_green_chart_range_max_pre = 50;
+static uint16_t output_power_green_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()
 {
     in_out_power_scr_ui_data_t *ext_data = lv_mem_alloc(sizeof(in_out_power_scr_ui_data_t));
@@ -63,7 +91,7 @@ static lv_obj_t *activity_value_item_create(lv_obj_t *par, lv_color_t value_colo
     lv_obj_t *value_label = text_canvas_create(bg);
     if (value_label)
     {
-        lv_obj_set_width(value_label, AEM_SIZE_HOR_FACTOR_466(180));
+        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);
@@ -87,7 +115,86 @@ static void link_icon_event_cb(lv_event_t *event)
     }
 }
 
+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 };
+        if (e->user_data == 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);
+        }
+        else
+        {
+            a.x1 = dsc->draw_area->x1 - (IMG_SCENE_IN_OUT_POWER_PIC_POINT_OUT.header.w / 2);
+            a.x2 = dsc->draw_area->x1 + (IMG_SCENE_IN_OUT_POWER_PIC_POINT_OUT.header.w / 2) - 1;
+            a.y1 = dsc->draw_area->y1 - (IMG_SCENE_IN_OUT_POWER_PIC_POINT_OUT.header.h / 2);
+            a.y2 = dsc->draw_area->y1 + (IMG_SCENE_IN_OUT_POWER_PIC_POINT_OUT.header.h / 2) - 1;
+            lv_draw_img(dsc->draw_ctx, &img_dsc, &a, &IMG_SCENE_IN_OUT_POWER_PIC_POINT_OUT);
+        }
+        
+    #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_in_out_power_arc_show_create(lv_obj_t *par)
 {
     in_out_power_scr_ui_data_t *activity_ui_data = lv_obj_get_user_data(par);
@@ -97,7 +204,7 @@ static lv_obj_t *aem_in_out_power_arc_show_create(lv_obj_t *par)
     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(200), 0);
+    lv_obj_set_style_width(in_power_item, AEM_SIZE_FACTOR_466(POWER_STYLE_WIDTH), 0);
 
     if (in_power_item)
     {
@@ -108,7 +215,7 @@ static lv_obj_t *aem_in_out_power_arc_show_create(lv_obj_t *par)
     lv_obj_t *out_power_item = activity_value_item_create(par, (lv_color_t)LV_COLOR_BLACK, out_power_data, 70, aem_font_def());
     lv_obj_set_style_bg_color(out_power_item, (lv_color_t)LV_COLOR_GREEN, 0);
     lv_obj_set_style_radius(out_power_item, AEM_SIZE_FACTOR_466(10), 0);
-    lv_obj_set_style_width(out_power_item, AEM_SIZE_FACTOR_466(200), 0);
+    lv_obj_set_style_width(out_power_item, AEM_SIZE_FACTOR_466(POWER_STYLE_WIDTH), 0);
 
     if (out_power_item)
     {
@@ -168,10 +275,10 @@ static lv_obj_t *aem_in_out_power_arc_show_create(lv_obj_t *par)
     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_sub(), 0);
+        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(50), AEM_SIZE_VER_FACTOR_466(18));
+        lv_obj_align(in_power_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(58), AEM_SIZE_VER_FACTOR_466(28));
     }
 
     lv_obj_t *in_voltage_unit_label = text_canvas_create(in_voltage_item);
@@ -180,7 +287,7 @@ static lv_obj_t *aem_in_out_power_arc_show_create(lv_obj_t *par)
         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(20), AEM_SIZE_VER_FACTOR_466(15));
+        lv_obj_align(in_voltage_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(26), AEM_SIZE_VER_FACTOR_466(15));
     }
 
     lv_obj_t *in_current_unit_label = text_canvas_create(in_current_item);
@@ -189,20 +296,20 @@ static lv_obj_t *aem_in_out_power_arc_show_create(lv_obj_t *par)
         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(20), AEM_SIZE_VER_FACTOR_466(15));
+        lv_obj_align(in_current_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(26), AEM_SIZE_VER_FACTOR_466(15));
     }
 
     lv_obj_align(out_power_item, LV_ALIGN_RIGHT_MID, AEM_SIZE_HOR_FACTOR_466(-10), AEM_SIZE_VER_FACTOR_466(0));
-    lv_obj_align_to(out_voltage_item, out_power_item, LV_ALIGN_OUT_BOTTOM_MID, AEM_SIZE_HOR_FACTOR_466(0), AEM_SIZE_VER_FACTOR_466(0));
+    lv_obj_align_to(out_voltage_item, out_power_item, LV_ALIGN_OUT_BOTTOM_MID, AEM_SIZE_HOR_FACTOR_466(-15), AEM_SIZE_VER_FACTOR_466(0));
     lv_obj_align_to(out_current_item, out_voltage_item, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
 
     lv_obj_t *out_power_unit_label = text_canvas_create(out_power_item);
     if (out_power_unit_label)
     {
-        lv_obj_set_style_text_font(out_power_unit_label, aem_font_sub(), 0);
+        lv_obj_set_style_text_font(out_power_unit_label, aem_font_small(), 0);
         text_canvas_set_text(out_power_unit_label, "W");
         lv_obj_set_style_text_color(out_power_unit_label, (lv_color_t)LV_COLOR_BLACK, 0);
-        lv_obj_align(out_power_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(50), AEM_SIZE_VER_FACTOR_466(18));
+        lv_obj_align(out_power_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(58), AEM_SIZE_VER_FACTOR_466(28));
     }
 
     lv_obj_t *out_voltage_unit_label = text_canvas_create(out_voltage_item);
@@ -211,7 +318,7 @@ static lv_obj_t *aem_in_out_power_arc_show_create(lv_obj_t *par)
         lv_obj_set_style_text_font(out_voltage_unit_label, aem_font_small(), 0);
         text_canvas_set_text(out_voltage_unit_label, "V");
         lv_obj_set_style_text_color(out_voltage_unit_label, (lv_color_t)LV_COLOR_GREEN, 0);
-        lv_obj_align(out_voltage_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(20), AEM_SIZE_VER_FACTOR_466(15));
+        lv_obj_align(out_voltage_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(25), AEM_SIZE_VER_FACTOR_466(15));
     }
 
     lv_obj_t *out_current_unit_label = text_canvas_create(out_current_item);
@@ -220,7 +327,7 @@ static lv_obj_t *aem_in_out_power_arc_show_create(lv_obj_t *par)
         lv_obj_set_style_text_font(out_current_unit_label, aem_font_small(), 0);
         text_canvas_set_text(out_current_unit_label, "A");
         lv_obj_set_style_text_color(out_current_unit_label, (lv_color_t)LV_COLOR_GREEN, 0);
-        lv_obj_align(out_current_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(20), AEM_SIZE_VER_FACTOR_466(15));
+        lv_obj_align(out_current_unit_label, LV_ALIGN_TOP_MID, AEM_SIZE_HOR_FACTOR_466(25), AEM_SIZE_VER_FACTOR_466(15));
     }
 
     // Arcs
@@ -232,13 +339,13 @@ static lv_obj_t *aem_in_out_power_arc_show_create(lv_obj_t *par)
         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 *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)
@@ -248,6 +355,116 @@ static lv_obj_t *aem_in_out_power_arc_show_create(lv_obj_t *par)
             lv_obj_align(in_icon, LV_ALIGN_LEFT_MID, AEM_SIZE_HOR_FACTOR_466(20), AEM_SIZE_VER_FACTOR_466(80));
         }
 
+        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(10), 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 *out_bg_icon1 = lv_img_create(arc_bg);
+        if (out_bg_icon1)
+        {
+            //lv_obj_clear_flag(out_bg_icon1, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(out_bg_icon1, &IMG_SCENE_IN_OUT_POWER_PIC_DEEPGREEN_ARROW);
+            lv_obj_align(out_bg_icon1, LV_ALIGN_RIGHT_MID, AEM_SIZE_HOR_FACTOR_466(-10), AEM_SIZE_VER_FACTOR_466(0));
+            lv_obj_set_style_img_opa(out_bg_icon1, BG_ICON1_IMG_OPA, 0);
+        }
+
+        lv_obj_t *out_bg_icon2 = lv_img_create(out_bg_icon1);
+        if (out_bg_icon2)
+        {
+            //lv_obj_clear_flag(out_bg_icon2, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(out_bg_icon2, &IMG_SCENE_IN_OUT_POWER_PIC_DEEPGREEN_ARROW);
+            lv_obj_align_to(out_bg_icon2, out_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(out_bg_icon2, BG_ICON2_IMG_OPA, 0);
+        }
+
+        lv_obj_t *out_bg_icon3 = lv_img_create(out_bg_icon2);
+        if (out_bg_icon3)
+        {
+            //lv_obj_clear_flag(out_bg_icon3, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(out_bg_icon3, &IMG_SCENE_IN_OUT_POWER_PIC_DEEPGREEN_ARROW);
+            lv_obj_align_to(out_bg_icon3, out_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(out_bg_icon3, BG_ICON3_IMG_OPA, 0);
+        }
+
+        lv_obj_t *out_bg_icon4 = lv_img_create(out_bg_icon3);
+        if (out_bg_icon4)
+        {
+            //lv_obj_clear_flag(out_bg_icon4, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(out_bg_icon4, &IMG_SCENE_IN_OUT_POWER_PIC_DEEPGREEN_ARROW);
+            lv_obj_align_to(out_bg_icon4, out_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(out_bg_icon4, BG_ICON4_IMG_OPA, 0);
+        }
+
+        lv_obj_t *out_bg_icon5 = lv_img_create(out_bg_icon4);
+        if (out_bg_icon5)
+        {
+            //lv_obj_clear_flag(out_bg_icon5, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(out_bg_icon5, &IMG_SCENE_IN_OUT_POWER_PIC_DEEPGREEN_ARROW);
+            lv_obj_align_to(out_bg_icon5, out_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(out_bg_icon5, BG_ICON5_IMG_OPA, 0);
+        }
+
+        lv_obj_t *out_bg_icon6 = lv_img_create(out_bg_icon5);
+        if (out_bg_icon6)
+        {
+            //lv_obj_clear_flag(out_bg_icon6, LV_OBJ_FLAG_CLICKABLE);
+            lv_img_set_src(out_bg_icon6, &IMG_SCENE_IN_OUT_POWER_PIC_DEEPGREEN_ARROW);
+            lv_obj_align_to(out_bg_icon6, out_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(out_bg_icon6, BG_ICON6_IMG_OPA, 0);
+        }
+
+
         lv_obj_t *out_icon = lv_img_create(arc_bg);
         if (out_icon)
         {
@@ -276,6 +493,140 @@ static lv_obj_t *aem_in_out_power_arc_show_create(lv_obj_t *par)
     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(chart_hight + 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(chart_width), AEM_SIZE_VER_FACTOR_466(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);
+    // 设置图表数据点的线条颜色为蓝色
+    if (type == 0) // input?output
+    {
+        lv_obj_set_style_line_color(chart, lv_color_hex(0x36DCFF), LV_PART_ITEMS);
+    }
+    else //if (type == 1)
+    {
+        lv_obj_set_style_line_color(chart, lv_color_hex(0x88FF56), LV_PART_ITEMS);
+    }
+    // 将图表对象水平居中对齐
+    lv_obj_align(chart, LV_ALIGN_TOP_MID, 0, AEM_SIZE_VER_FACTOR_466(chart_align_y_to_up));
+    // 将图表对象的类型设置为线图表,即用线连接数据点
+    lv_chart_set_type(chart, LV_CHART_TYPE_LINE);
+    // 设置图表对象的数据点数量为24
+    lv_chart_set_point_count(chart, chart_point_num);
+    //if (type == 0) // input?output
+    {
+        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;
+    if (type == 0) // input?output
+    {
+        series = lv_chart_add_series(chart, lv_color_hex(0x36DCFF), LV_CHART_AXIS_PRIMARY_Y);
+    }
+    else
+    {
+        series = lv_chart_add_series(chart, lv_color_hex(0x88FF56), LV_CHART_AXIS_PRIMARY_Y);
+    }
+        
+    int value = 0;
+    // 将数据点添加到图表对象中
+    for (int i = 0; i < chart_point_num; i++)
+    {
+        aem_power_point_item_t *info = aem_get_baro_items_data();
+        if (type == 0)
+        {
+            value = info->input_power_blue_chart[i];
+        }
+        else
+        {
+            value = info->output_power_green_chart[i];
+        }
+
+        if (type == 0)
+        {
+            lv_chart_set_value_by_id(chart, series, i, value);              
+        }
+        else
+        {
+            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_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);
+        s_power_point->output_power_green_chart = create_chart(par, 1);
+    }
+}
+
 lv_obj_t *aem_in_out_power_screen_create(lv_obj_t *par, bool widget_start)
 {
     in_out_power_scr_ui_data_t *ext_data = load_res();
@@ -285,15 +636,17 @@ lv_obj_t *aem_in_out_power_screen_create(lv_obj_t *par, bool widget_start)
     }
 
     ext_data->widget_start = widget_start;
-    lv_obj_t *screen1 = aem_bg_create(par, DEF_UI_WIDTH, DEF_UI_HEIGHT, lv_color_black());
-    if (screen1)
+    lv_obj_t *screen = aem_bg_create(par, DEF_UI_WIDTH, DEF_UI_HEIGHT, lv_color_black());
+    if (screen)
     {
-        lv_obj_set_user_data(screen1, ext_data);
+        lv_obj_set_user_data(screen, ext_data);
+
+        aem_in_out_power_arc_show_create(screen);
 
-        aem_in_out_power_arc_show_create(screen1);
+        aem_create_point_page(screen);  // 创建点阵屏
     }
 
-    return screen1;
+    return screen;
 }
 
 void aem_in_out_power_screen_del(lv_obj_t *par)
@@ -312,28 +665,312 @@ void aem_in_out_power_screen_del(lv_obj_t *par)
     }
 }
 
+#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;
+#include "time.h"
 #endif
 void aem_in_out_power_screen_update(lv_obj_t *par)
 {
     in_out_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 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;
 
 #ifdef CONFIG_SIMULATOR
-    float f_Power[2] = {10.0, 12.0};
-    float f_BusVoltage[2] = {5.00, 4.00};
-    float f_Current[2] = {2.00, 3.00};
+    // 设置随机数种子 
+    //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];
+
+    chart_point_cnt++;
+    if (chart_point_cnt > 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)
     {
+        if (s_power_point)
+        {
+            aem_power_point_item_t *info = aem_get_baro_items_data();
+
+            for (int i = chart_point_num - 1; i > 0; i--)
+            {
+                info->input_power_blue_chart[i] = info->input_power_blue_chart[i - 1];
+                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;
+            }
+
+            for (int i = 0; i < 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]);
+
+                series = lv_chart_get_series_next(s_power_point->output_power_green_chart, NULL);
+
+                lv_chart_set_value_by_id(s_power_point->output_power_green_chart, series, i, info->output_power_green_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 (info->output_power_green_chart[i] < output_power_green_chart_point_min)
+                {
+                    output_power_green_chart_point_min = info->output_power_green_chart[i];
+                }
+                if (info->output_power_green_chart[i] > output_power_green_chart_point_max)
+                {
+                    output_power_green_chart_point_max = info->output_power_green_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);
+            }
+            //=================================================================================//
+
+            if (output_power_green_chart_point_min <= RANGER_ONE_MAX)
+            {
+                output_power_green_chart_range_min = RANGER_ONE_MIN;
+            }
+            else if (output_power_green_chart_point_min <= RANGER_TWO_MAX)
+            {
+                output_power_green_chart_range_min = RANGER_TWO_MIN;
+            }
+            else if (output_power_green_chart_point_min <= RANGER_THREE_MAX)
+            {
+                output_power_green_chart_range_min = RANGER_THREE_MIN;
+            }
+            else if (output_power_green_chart_point_min <= RANGER_FOUR_MAX)
+            {
+                output_power_green_chart_range_min = RANGER_FOUR_MIN;
+            }
+            else if (output_power_green_chart_point_min <= RANGER_FIVE_MAX)
+            {
+                output_power_green_chart_range_min = RANGER_FIVE_MIN;
+            }
+            else if (output_power_green_chart_point_min <= RANGER_SIX_MAX)
+            {
+                output_power_green_chart_range_min = RANGER_SIX_MIN;
+            }
+            else if (output_power_green_chart_point_min <= RANGER_SEVEN_MAX)
+            {
+                output_power_green_chart_range_min = RANGER_SEVEN_MIN;
+            }
+            else if (output_power_green_chart_point_min <= RANGER_EIGHT_MAX)
+            {
+                output_power_green_chart_range_min = RANGER_EIGHT_MIN;
+            }
+            else if (output_power_green_chart_point_min <= RANGER_NINE_MAX)
+            {
+                output_power_green_chart_range_min = RANGER_NINE_MIN;
+            }
+            else //if (output_power_green_chart_point_min <= RANGER_TEN_MAX)
+            {
+                output_power_green_chart_range_min = RANGER_TEN_MIN;
+            }
+
+            if (output_power_green_chart_point_max >= RANGER_TEN_MIN)
+            {
+                output_power_green_chart_range_max = RANGER_TEN_MAX;
+            }
+            else if (output_power_green_chart_point_max >= RANGER_NINE_MIN)
+            {
+                output_power_green_chart_range_max = RANGER_NINE_MAX;
+            }
+            else if (output_power_green_chart_point_max >= RANGER_EIGHT_MIN)
+            {
+                output_power_green_chart_range_max = RANGER_EIGHT_MAX;
+            }
+            else if (output_power_green_chart_point_max >= RANGER_SEVEN_MIN)
+            {
+                output_power_green_chart_range_max = RANGER_SEVEN_MAX;
+            }
+            else if (output_power_green_chart_point_max >= RANGER_SIX_MIN)
+            {
+                output_power_green_chart_range_max = RANGER_SIX_MAX;
+            }
+            else if (output_power_green_chart_point_max >= RANGER_FIVE_MIN)
+            {
+                output_power_green_chart_range_max = RANGER_FIVE_MAX;
+            }
+            else if (output_power_green_chart_point_max >= RANGER_FOUR_MIN)
+            {
+                output_power_green_chart_range_max = RANGER_FOUR_MAX;
+            }
+            else if (output_power_green_chart_point_max >= RANGER_THREE_MIN)
+            {
+                output_power_green_chart_range_max = RANGER_THREE_MAX;
+            }
+            else if (output_power_green_chart_point_max >= RANGER_TWO_MIN)
+            {
+                output_power_green_chart_range_max = RANGER_TWO_MAX;
+            }
+            else //if (output_power_green_chart_point_max >= RANGER_ONE_MIN)
+            {
+                output_power_green_chart_range_max = RANGER_ONE_MAX;
+            }
+
+            if (output_power_green_chart_range_max != output_power_green_chart_range_max_pre || output_power_green_chart_range_min != output_power_green_chart_range_min_pre)
+            {
+                output_power_green_chart_range_max_pre = output_power_green_chart_range_max;
+                output_power_green_chart_range_min_pre = output_power_green_chart_range_min;
+                lv_chart_set_range(s_power_point->output_power_green_chart, LV_CHART_AXIS_PRIMARY_Y, output_power_green_chart_range_min, output_power_green_chart_range_max);
+            }
+        }
+
         char str_data[32] = {0};
 
         //if (power_volt_cur_data->in_power_value)
         {
-            if (f_Power[1] < 0.08)
+            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);
@@ -353,7 +990,7 @@ void aem_in_out_power_screen_update(lv_obj_t *par)
         }
         //if (power_volt_cur_data->in_voltage_value)
         {
-            if (f_BusVoltage[1] < 2.5)
+            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);
@@ -373,7 +1010,7 @@ void aem_in_out_power_screen_update(lv_obj_t *par)
         }
         //if (power_volt_cur_data->in_current_value)
         {
-            if (f_Current[1] < 0.03)
+            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);

+ 17 - 2
application/aem_watch/src/application/in_out_power/aem_in_out_power_screen.h

@@ -1,9 +1,24 @@
-#ifndef AEM_ACTIVITY_SCREEN_H
-#define AEM_ACTIVITY_SCREEN_H
+#ifndef AEM_IN_OUT_POWER_SCREEN_H
+#define AEM_IN_OUT_POWER_SCREEN_H
 
 #include "aem_activity_data_if.h"
 #include "lvgl.h"
 
+typedef struct
+{
+    uint32_t input_power_min;
+    uint32_t input_power_max;
+    uint32_t input_power_value;
+    uint32_t input_power_blue_chart[24]; // input power chart(blue)
+
+    int16_t output_power_min;
+    int16_t output_power_max;
+    int16_t output_power_value;
+    int16_t output_power_green_chart[24]; // output power chart(green)
+
+} aem_power_point_item_t;
+
+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);
 
 void aem_in_out_power_screen_update(lv_obj_t *par);

+ 8 - 5
application/aem_watch/src/application/profile_photo/aem_profile_photo_screen.c

@@ -195,18 +195,21 @@ void aem_profile_photo_screen_del(lv_obj_t *par)
 }
 
 #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, 12.0};
+#include "time.h"
 #endif
 void aem_profile_photo_screen_update(lv_obj_t *par)
 {
     profile_photo_scr_ui_data_t *power_volt_cur_data = lv_obj_get_user_data(par);
 
 #ifdef CONFIG_SIMULATOR
-    float f_Power[2] = {10.0, 12.0};
-    //float f_BusVoltage[2] = {5.00, 4.00};
-    //float f_Current[2] = {2.00, 3.00};
+    // 设置随机数种子 
+    srand((unsigned int)time(0)); // 获取随机数
+
+    f_Power[0] = (float)(rand() % 55) + 0.085;
+    f_Power[1] = (float)(rand() % 60) + 0.085;
 #endif
 
     if (power_volt_cur_data)

+ 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 "202412241923"
+#define BUILD_TIME "202501081102"
 #define AEM_GUI_FWK_LIB_VER "2.0.0.0"
 #define APP_DOWNLOAD_URL "https://customer.com"
 #define AEM_APP_TRANS_ANIMATION 1

+ 34 - 18
zephyr/drivers/input/sd8563_timer_acts.c

@@ -64,7 +64,7 @@ static struct acts_timer_data timer_acts_ddata;
 
 static int _sd8563_close_write_protection(const struct device *i2c_dev);
 static void _sd8563_open_write_protection(const struct device *i2c_dev);
-static void _sd8563_read_time(const struct device *i2c_dev);
+static void _sd8563_read_time(const struct device *i2c_dev, bool is_uart_send);
 static void _sd8563_set_time(const struct device *i2c_dev, 
 							 uint8_t set_hour, 
 							 uint8_t set_minute,
@@ -106,12 +106,14 @@ static void timer_acts_handler(struct k_work *work)
 		bySetMonth = 0xff;
 		bySetDay = 0xff;
 
+		_sd8563_read_time(external_rtc->i2c_dev, false);  //读一次,避免用户在设置后再次快速进入设置界面时数据不正确
+
 		hrtimer_restart(&g_rtc_ht_read);
 
 		return;
 	}
 
-    _sd8563_read_time(external_rtc->i2c_dev);  //不在ISR中完成,防止中断嵌套
+    _sd8563_read_time(external_rtc->i2c_dev, true);  //不在ISR中完成,防止中断嵌套
 }
 K_WORK_DEFINE(timer_acts, timer_acts_handler);
 static void htimer_fun(struct hrtimer *ttimer, void *expiry_fn_arg)
@@ -119,7 +121,7 @@ static void htimer_fun(struct hrtimer *ttimer, void *expiry_fn_arg)
 	//static int t;
 	//static struct acts_timer_data *external_rtc = &timer_acts_ddata;
 	//printk("%d ---htimer--\n", t++);
-	//_sd8563_read_time(external_rtc->i2c_dev);
+	//_sd8563_read_time(external_rtc->i2c_dev, true);  //不在ISR中完成,防止中断嵌套
 	k_work_submit(&timer_acts);  //向系统工作队列提交一个工作项,让工作队列的线程将执行该工作
 }
 
@@ -133,8 +135,8 @@ static void htimer_read(unsigned int ms)
 static void _sd8563_open_write_protection(const struct device *i2c_dev)
 {
 #if 1	
-	static uint8_t write_cmd[2] = {0};
-	static uint8_t read_cmd[7] = {0};
+	uint8_t write_cmd[2] = {0};
+	uint8_t read_cmd[7] = {0};
 	int ret = 0;
 
 	printk("_sd8563_read_write_protection\n");
@@ -224,8 +226,8 @@ static void _sd8563_open_write_protection(const struct device *i2c_dev)
 static int _sd8563_close_write_protection(const struct device *i2c_dev)
 {
 #if 1	
-	static uint8_t write_cmd[2] = {0};
-	static uint8_t read_cmd[7] = {0};
+	uint8_t write_cmd[2] = {0};
+	uint8_t read_cmd[7] = {0};
 	int ret = 0;
 
 	printk("_sd8563_read_write_protection\n");
@@ -329,8 +331,8 @@ static void _sd8563_set_time(const struct device *i2c_dev,
 							 uint8_t set_day)
 {
 #if 1	
-	static uint8_t write_cmd[8] = {0};
-	static uint8_t read_cmd[7] = {0};
+	uint8_t write_cmd[8] = {0};
+	uint8_t read_cmd[7] = {0};
 	bool power_on_set_time_data = false;
 	int ret = 0;
 
@@ -356,20 +358,30 @@ static void _sd8563_set_time(const struct device *i2c_dev,
 		power_on_set_time_data = true;
 	}
 
-    _sd8563_read_time(i2c_dev);  //read time
+    _sd8563_read_time(i2c_dev, false);  //read time
 
-    printk("y:20%d, mon:%d, week:%d, d:%d, h:%d, min:%d, sec:%d\n",
-			read_time_data[6], read_time_data[5], read_time_data[4], read_time_data[3], read_time_data[2], read_time_data[1], read_time_data[0]);
+    //printk("y:%x, mon:%x, week:%x, d:%x, h:%x, min:%x, sec:%x\n",
+	//		read_time_data[6], read_time_data[5], read_time_data[4], read_time_data[3], read_time_data[2], read_time_data[1], read_time_data[0]);
 
 	if(set_hour != 0xFF)
 	{
 		read_time_data[0] = 0;
+		set_minute = (set_minute / 10) * 16 + set_minute % 10;  //DEC TO BCD CODE
+		set_hour = (set_hour / 10) * 16 + set_hour % 10;  //DEC TO BCD CODE
 		read_time_data[1] = set_minute;//(set_minute / 10) * 16  + set_minute % 10;  //DEC TO BCD CODE
 		read_time_data[2] = set_hour;//(set_hour / 10) * 16  + set_hour % 10;  //DEC TO BCD CODE
 		read_time_data[4] = set_week % 7;//0:Sun. 1:Mon. 2:Tue. 3:Wed. 4:Thu. 5:Fri. 6:Sat.
 	}
 	else if (set_year != 0xFF)
-	{
+	{	
+		if (set_year >= 2000)
+		{
+			set_year = set_year - 2000;
+		}
+
+		set_day = (set_day / 10) * 16 + set_day % 10;  //DEC TO BCD CODE
+		set_month = (set_month / 10) * 16 + set_month % 10;  //DEC TO BCD CODE
+		set_year = (set_year / 10) * 16 + set_year % 10;  //DEC TO BCD CODE
 		read_time_data[3] = set_day;//(set_day / 10) * 16  + set_day % 10;  //DEC TO BCD CODE
 		read_time_data[5] = set_month;//(set_month / 10) * 16  + set_month % 10;  //DEC TO BCD CODE
 		read_time_data[6] = set_year;//(set_year / 10) * 16  + set_year % 10;  //DEC TO BCD CODE
@@ -393,7 +405,7 @@ static void _sd8563_set_time(const struct device *i2c_dev,
 		//BCD code
 		for (uint8_t i = 0; i < 7; i++)
 		{
-			write_cmd[i + 1] = (read_time_data[i] / 10) * 16  + read_time_data[i] % 10;
+			write_cmd[i + 1] = read_time_data[i];//(read_time_data[i] / 10) * 16  + read_time_data[i] % 10;  //DEC TO BCD CODE	
 		}
 		//write_cmd[1] = read_time_data[0];  //sec
 		//write_cmd[2] = read_time_data[1];  //min
@@ -420,18 +432,18 @@ static void _sd8563_set_time(const struct device *i2c_dev,
 		return;
 	}
 
-	printk("y:20%d, mon:%d, week:%d, d:%d, h:%d, min:%d, sec:%d\n",
+	printk("y:%x, mon:%x, week:%x, d:%x, h:%x, min:%x, sec:%x\n",
 			read_cmd[6], read_cmd[5], read_cmd[4], read_cmd[3], read_cmd[2], read_cmd[1], read_cmd[0]);
 
     printk("_sd8563_set_time exit\n");
 #endif	
 }
 
-static void _sd8563_read_time(const struct device *i2c_dev)
+static void _sd8563_read_time(const struct device *i2c_dev, bool is_uart_send)
 {
 #if 1	
     uint8_t i, check_sum = 0x52;
-	static uint8_t write_cmd[1] = {0x02};
+	uint8_t write_cmd[1] = {0x02};
 	//static uint8_t read_time_data[7] = {0};
 	int ret = 0;
 
@@ -448,6 +460,10 @@ static void _sd8563_read_time(const struct device *i2c_dev)
 	read_time_data[0] = read_time_data[0] & 0x7F; //bit7:0SF/
 	read_time_data[5] = read_time_data[5] & 0x7F; //bit7:C/century
 
+    if (is_uart_send == false)
+	{
+		return;
+	}
     //uart2 send data start ==============================================//
     uart2_poll_out_ch(0x5A);  //报文表头
 	uart2_poll_out_ch(0x54);
@@ -495,7 +511,7 @@ static void _sd8563_init_work(struct k_work *work)
     {
         k_msleep(1000);
     
-	    _sd8563_read_time(external_rtc->i2c_dev);
+	    _sd8563_read_time(external_rtc->i2c_dev, 0);
 	}
 #endif    
 	htimer_read(1000);  //1000ms = 1s

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