From: CCC <2393524978@qq.com> Date: Mon, 18 Sep 2023 03:18:00 +0000 (+0800) Subject: gengxin X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=7588244f1da3fbb2a92ec82ed028c23b818967e9;p=mirrors%2FASR3603_Z5.git gengxin --- diff --git a/2.sdk/project/Z5_K7/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h b/2.sdk/project/Z5_K7/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h index c0235f6e..13590d85 100644 --- a/2.sdk/project/Z5_K7/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h +++ b/2.sdk/project/Z5_K7/product/craneg_modem/config/watch/lv_watch_conf_CUSTOM.h @@ -162,7 +162,7 @@ #define __MMI_WECHAT_SUPPORT__ -#define __MMI_ZHSX_SUPPORT_MAIN_MENU_FOUR_GRID__ +#define __MMI_MAIN_MENU_FOUR_GRID_STYLE__ #define __MMI_HEALTH_MEASURE_HEART_SUPPORT__ diff --git a/2.sdk/sdk/gui/lv_watch/lv_apps/calculator/calculator.c b/2.sdk/sdk/gui/lv_watch/lv_apps/calculator/calculator.c index b8872118..e57f87e4 100644 --- a/2.sdk/sdk/gui/lv_watch/lv_apps/calculator/calculator.c +++ b/2.sdk/sdk/gui/lv_watch/lv_apps/calculator/calculator.c @@ -130,6 +130,29 @@ static void calc_warn_task(lv_task_t * task) ext->warn_task_p = NULL; } +#if 0//def __MMI_ZHSX_SUPPORT__ +char * mmi_strtok(char ** str1, uint8_t len1, char * str2, uint8_t len2) +{ + char * t_str = NULL; + uint8_t t_index = 0; + uint8_t i = 0; + + t_str = *str1; + for(i = 0; i < len1; i++) + { + if(strncmp(* str1 + i, str2, len2) == 0) + { + * str1 += (i + len2); + + t_str[i] = '\0'; + return t_str; + } + } + + return NULL; +} +#endif + static void calc_add_oper(char * ptr) { lv_calculator_obj_ext_t * ext = calc_get_ext(); @@ -141,7 +164,7 @@ static void calc_add_oper(char * ptr) else { printf("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__); - #ifdef __MMI_ZHSX_SUPPORT__ + #if 0//def __MMI_ZHSX_SUPPORT__ char * fac1 = NULL; char * fac2 = NULL; char * temp = NULL; @@ -164,22 +187,53 @@ static void calc_add_oper(char * ptr) if(sn) { temp = &sn[2]; } + + printf("[@CHENG_DEBUG][%s][%d]: temp=%s\n", __FUNCTION__, __LINE__, temp); + #if 1 strtok(temp, ext->oper); + printf("[@CHENG_DEBUG][%s][%d]: temp=%s\n", __FUNCTION__, __LINE__, temp); fac2 = strtok(NULL, ptr); + printf("[@CHENG_DEBUG][%s][%d]: temp=%s\n", __FUNCTION__, __LINE__, temp); #if CALC_LATIN_SYMBOL_MUL_AND_DIV_SUP != 0 if(strcmp(ext->oper, CALC_MUL) == 0 || strcmp(ext->oper, CALC_DIV) == 0) { fac2 = &fac2[1]; } #endif fac1 = (char *)text; + + #else + + fac1 = mmi_strtok(&temp, strlen(temp), ext->oper, strlen(ext->oper)); + printf("[@CHENG_DEBUG][%s][%d]: temp=%s\n", __FUNCTION__, __LINE__, temp); + fac2 = mmi_strtok(&temp, strlen(temp), ptr, strlen(ptr)); + printf("[@CHENG_DEBUG][%s][%d]: temp=%s\n", __FUNCTION__, __LINE__, temp); + #endif + printf("[@CHENG_DEBUG][%s][%d]: fac1=%s,fac2=%s\n", __FUNCTION__, __LINE__, fac1, fac2); calc_get_result(fac1, fac2); + ext->oper = ptr; calc_label_add_text(ext, ptr); ext->finish_flag = false; - ext->input_len = 0; - ext->point = false; + text = lv_label_get_text(ext->label); + char * point = strchr(text, '.'); + if(point) + { + ext->point = true; + ext->input_len = strlen(point) - 1; + + printf("[@CHENG_DEBUG][%s][%d]: input_len=%d\n", __FUNCTION__, __LINE__, ext->input_len); + } + else + { + ext->point = false; + ext->input_len = strlen(text); + if(text[0] == '-') { + ext->input_len--; + } + printf("[@CHENG_DEBUG][%s][%d]: input_len=%d\n", __FUNCTION__, __LINE__, ext->input_len); + } } #endif @@ -840,6 +894,9 @@ static void calc_get_result(char * fac1, char * fac2) fval1 = atof(fac1); fval2 = atof(fac2); + printf("[@CHENG_DEBUG][%s][%d]: fval1=%f,fval2=%f\n", __FUNCTION__, __LINE__, fval1, fval2); + + if(strcmp(ext->oper, CALC_PLUS) == 0) { resval = fval1 + fval2; } else if(strcmp(ext->oper, CALC_MINUS) == 0) { diff --git a/2.sdk/sdk/gui/lv_watch/mmi_default.h b/2.sdk/sdk/gui/lv_watch/mmi_default.h index d7698091..e9eeb7c8 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_default.h +++ b/2.sdk/sdk/gui/lv_watch/mmi_default.h @@ -202,6 +202,12 @@ extern "C" #endif +//main menu style +#ifdef MMI_CUSTOMER_MAIN_MENU_STYLE +#define MMI_MAIN_MENU_STYLE_DEFAULT MMI_CUSTOMER_MAIN_MENU_STYLE +#else +#define MMI_MAIN_MENU_STYLE_DEFAULT (MMI_MAIN_MENU_STYLE_FOUR_GRID) +#endif diff --git a/2.sdk/sdk/gui/lv_watch/mmi_location/mmi_location.h b/2.sdk/sdk/gui/lv_watch/mmi_location/mmi_location.h index 54896554..fc96c855 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_location/mmi_location.h +++ b/2.sdk/sdk/gui/lv_watch/mmi_location/mmi_location.h @@ -36,6 +36,8 @@ typedef void (*FUNC_CB)(int); #define MMI_WATCH_LOCATION_PROCESS_DURATION (1000 * 10) // ms #define MMI_WATCH_LOCATION_CHECK_TIMES_COUNT_MAX (4) // 40000 ms +#define MMI_WATCH_LOCATION_UPLOAD_INTERVAL_MIN (2 * 60) // s + typedef enum { diff --git a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c index 7e2c3521..e139e232 100644 --- a/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c +++ b/2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_api.c @@ -186,7 +186,7 @@ uint32_t mmi_protocol_watch_location_upload_interval_get(void) void mmi_protocol_watch_location_upload_interval_set(uint32_t value) { - s_watch_protocol_data.location_upload_interval = ((300 > value) ? 300 : value); // value; + s_watch_protocol_data.location_upload_interval = ((MMI_WATCH_LOCATION_UPLOAD_INTERVAL_MIN > value) ? MMI_WATCH_LOCATION_UPLOAD_INTERVAL_MIN : value); // value; mmi_watch_protocol_data_nv_write(); }