From a5696d51153c03e75f502d292b9aa4afd280a546 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E8=A2=81=E6=B8=85=E6=A2=A6?= <3449750381@qq.com> Date: Fri, 6 Feb 2026 06:31:09 +0000 Subject: [PATCH] Merge #3192 into fd272 from refs/changes/3192/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 袁清梦 * refs/changes/3192/head: (4 commits squashed) - 配速秒数补零避免误解 - Merge branch 'fd272' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into fd272 - 增加用户信息的打印 - release V1.3.135 Signed-off-by: Caisking <3449750381@qq.com> Merged-by: Caisking <3449750381@qq.com> CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/3192 --- autobuild.sh | 2 +- .../nativeui/traing/src/TraingEnddataView.cpp | 17 +++++---- .../blemoder/bleinstruct_sample.cpp | 36 +++++++++---------- .../ble_service/bleservice/bleEvent.c | 2 +- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/autobuild.sh b/autobuild.sh index 9acb2a8b6..8857cc879 100644 --- a/autobuild.sh +++ b/autobuild.sh @@ -49,7 +49,7 @@ DEFAULT_SSB_NAME=$DEFAULT_APPLICATION_NAME-ssb declare -A PROJECT_VERSIONS=( # 基础项目版本 ["fd230"]="1.3.107" - ["fd272"]="1.3.134" + ["fd272"]="1.3.135" ["user"]="1.3.107" ["fd230_user"]="1.3.107" diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingEnddataView.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingEnddataView.cpp index 379033ade..c41971080 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingEnddataView.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/traing/src/TraingEnddataView.cpp @@ -14,7 +14,8 @@ #include "ui_resource_image.h" #include "ui_resource_string.h" #include "uicomponents/UIComponents.h" -#include // 包含数学函数库,用于四舍五入 +#include // 包含数学函数库,用于四舍五入 +#include // 用于 std::setfill / setw 配速补零 #include #include // 用于 std::ostringstream #include // 包含字符串处理库,用于使用 std::to_string @@ -676,15 +677,13 @@ void TraingEnddataView::InitData() { //特殊配置 if (TraingModel::GetInstance()->GetIsSpecial()) { - // 平均配速 - // 需要计算一下 是秒 需要显示 分钟''秒'' - int totalSeconds = enddata->apc; // 总秒数 - int minutes = totalSeconds / 60; // 计算分钟 - int seconds = totalSeconds % 60; // 计算剩余秒数 - // 格式化为字符串 + // 平均配速:显示为 分钟'秒"(如 5'05"),秒数补零避免误解 + int totalSeconds = enddata->apc; // 总秒数(秒/公里) + int minutes = totalSeconds / 60; + int seconds = totalSeconds % 60; std::ostringstream oss; - oss << minutes << "'" << seconds << "\""; // 生成 "X'Y\"" 格式的字符串 - std::string avpaceStr = oss.str(); // 得到字符串 + oss << minutes << "'" << std::setfill('0') << std::setw(2) << seconds << "\""; + std::string avpaceStr = oss.str(); if (labelavpace) // 检查标签是否为空 { labelavpace->SetText(avpaceStr.c_str()); diff --git a/code/sdk/zhihui/services/ble_service/blemoder/bleinstruct_sample.cpp b/code/sdk/zhihui/services/ble_service/blemoder/bleinstruct_sample.cpp index ff13f6c17..a1341b55f 100644 --- a/code/sdk/zhihui/services/ble_service/blemoder/bleinstruct_sample.cpp +++ b/code/sdk/zhihui/services/ble_service/blemoder/bleinstruct_sample.cpp @@ -1999,31 +1999,31 @@ uint8_t ble_falg=0; void set_user_data(msg_user_info_t *data) { OHOS::ConfigModel *p_ConfigModel = OHOS::ConfigModel::GetInstance(); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"高:%d\r\n",data->height); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"高:%d\r\n",data->height); p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_CUSTOM_DATA_HEIGHT,data->height); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"重:%d\r\n",data->weight); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"重:%d\r\n",data->weight); p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_CUSTOM_DATA_WEIGHT,data->weight); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"性别:%d\r\n",data->gender); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"性别:%d\r\n",data->gender); p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_CUSTOM_DATA_SEX,data->gender); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"年纪:%d\r\n",data->age); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"年纪:%d\r\n",data->age); p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_CUSTOM_DATA_AGE,data->age); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标步数:%d\r\n",data->target_step); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"目标步数:%d\r\n",data->target_step); p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT,data->target_step); //目标站立 - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标站立 %d\r\n",data->target_stand); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"目标站立 %d\r\n",data->target_stand); if(data->target_stand) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES,data->target_stand); //目标燃脂 - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标燃脂 %d\r\n",data->fat_time); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"目标燃脂 %d\r\n",data->fat_time); if(data->fat_time) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION,data->fat_time); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标卡路里 %d\r\n",data->fat_time); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"目标卡路里 %d\r\n",data->fat_time); if(data->calorie) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES,data->calorie); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标距离 %d\r\n",data->fat_time); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"目标距离 %d\r\n",data->fat_time); if(data->distance) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE,data->distance); @@ -3687,31 +3687,31 @@ uint8_t ble_falg=0; void set_user_data(msg_user_info_t *data) { OHOS::ConfigModel *p_ConfigModel = OHOS::ConfigModel::GetInstance(); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"高:%d\r\n",data->height); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"高:%d\r\n",data->height); p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_CUSTOM_DATA_HEIGHT,data->height); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"重:%d\r\n",data->weight); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"重:%d\r\n",data->weight); p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_CUSTOM_DATA_WEIGHT,data->weight); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"性别:%d\r\n",data->gender); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"性别:%d\r\n",data->gender); p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_CUSTOM_DATA_SEX,data->gender); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"年纪:%d\r\n",data->age); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"年纪:%d\r\n",data->age); p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_CUSTOM_DATA_AGE,data->age); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标步数:%d\r\n",data->target_step); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"目标步数:%d\r\n",data->target_step); p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEPCOUNT,data->target_step); //目标站立 - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标站立 %d\r\n",data->target_stand); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"目标站立 %d\r\n",data->target_stand); if(data->target_stand) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STANDUP_TIMES,data->target_stand); //目标燃脂 - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标燃脂 %d\r\n",data->fat_time); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"目标燃脂 %d\r\n",data->fat_time); if(data->fat_time) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DURATION,data->fat_time); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标卡路里 %d\r\n",data->fat_time); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"目标卡路里 %d\r\n",data->fat_time); if(data->calorie) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_CALORIES,data->calorie); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"目标距离 %d\r\n",data->fat_time); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"目标距离 %d\r\n",data->fat_time); if(data->distance) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_DISTANCE,data->distance); diff --git a/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c b/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c index 2cd425434..228cdff61 100644 --- a/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c +++ b/code/sdk/zhihui/services/ble_service/bleservice/bleEvent.c @@ -4169,7 +4169,7 @@ void SetUserInfo(ble_read_data *buffer_handle,uint16_t cmd,uint8_t *data,uint16_ msg_userinfo.calorie=p_userinfo->calorie; msg_userinfo.distance=p_userinfo->distance; - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,"getUserInfo:!!age %d, fat %d, sex %d, height %d, stand %d, step %d , timeformat %d , weight %d !!!!!!\r\n", + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,"getUserInfo:!!age %d, fat %d, sex %d, height %d, stand %d, step %d , timeformat %d , weight %d !!!!!!\r\n", p_userinfo->age, p_userinfo->fat_time, p_userinfo->gender, -- 2.17.1