From e8fb192ef47427af0fb2e55cc490fb284115e038 Mon Sep 17 00:00:00 2001 From: Caisking Date: Mon, 19 May 2025 11:40:03 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9=E8=A1=A8=E7=9B=98=E6=95=B0?= =?utf8?q?=E6=8D=AE=E7=B1=BB=E5=9E=8B=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/main/include/dial/DialDataBase.h | 18 +++---- .../nativeui/main/src/dial/DialViewGroup.cpp | 48 +++---------------- 2 files changed, 16 insertions(+), 50 deletions(-) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dial/DialDataBase.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dial/DialDataBase.h index d258eec5a..4b0d0d400 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dial/DialDataBase.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dial/DialDataBase.h @@ -42,10 +42,17 @@ enum class DialDataType { DATA_TYPE_STEPS_GOAL_INT, // 运动步数百分比 DATA_TYPE_CALORIE_GOAL_INT, // 运动卡路里目标百分比 - DATA_TYPE_MULTI_FLOAT_BASE = 0x4000, // 多个浮点数据类型基值 + DATA_TYPE_SWIVEL_GEAR_ONE = 0x2000, //原sdk设置为20 太小了 + DATA_TYPE_SWIVEL_GEAR_TWO, + DATA_TYPE_SWIVEL_GEAR_THREE, + DATA_TYPE_SWIVEL_GEAR_FOUR, + DATA_TYPE_SWIVEL_GEAR_FIVE, + DATA_TYPE_SWIVEL_GEAR_SIX, + + DATA_TYPE_MULTI_FLOAT_BASE = 0x2fff, // 多个浮点数据类型基值 DATA_TYPE_HOUR_MIN, // 时分 - DATA_TYPE_TEXT_BASE = 0x2000, // 文本数据类型基值 + DATA_TYPE_TEXT_BASE = 0x4fff, // 文本数据类型基值 DATA_TYPE_WEEK_STR, // 星期(string) DATA_TYPE_DATE_STR, // 日期(string) DATA_TYPE_WEATHER_STR, // 天气(string) @@ -58,12 +65,7 @@ enum class DialDataType { DATA_TYPE_STEPS_GOAL_STR, // 运动步数目标(string) DATA_TYPE_CALORIE_GOAL_STR, // 卡路里目标(string) - DATA_TYPE_SWIVEL_GEAR_ONE = 20, - DATA_TYPE_SWIVEL_GEAR_TWO, - DATA_TYPE_SWIVEL_GEAR_THREE, - DATA_TYPE_SWIVEL_GEAR_FOUR, - DATA_TYPE_SWIVEL_GEAR_FIVE, - DATA_TYPE_SWIVEL_GEAR_SIX, + DATA_TYPE_MAX = 0x6000, // 数据类型的最大值 }; diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp index a8bd70a5c..19ba8d408 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp @@ -218,7 +218,9 @@ namespace OHOS void DialViewGroup::ProcessData(DialDataType type, DialView *view) { + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "DialViewGroup::ProcessData type %d\r\n", type); int16_t value = static_cast(type) >> 14; // 14: bit shift + WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "DialViewGroup::ProcessData value %d\r\n", value); if (value == 0) { // 0: float float floatData = 0; @@ -230,7 +232,7 @@ namespace OHOS std::string *textData = nullptr; int16_t num = 0; bool ret = ModelDialDataFactory::GetInstance().GetDialTextData(type, textData, num); - // printf("ModelDialDataFactory type %d num %d ret %d \r\n", type, num, ret); + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ModelDialDataFactory type %d num %d ret %d textData %s\r\n", type, num, ret,textData->c_str()); view->HandleTextData(textData, num); } else if (value == 2) @@ -731,53 +733,15 @@ namespace OHOS void DialViewGroup::StopDial() { - #if 0 - if (MainModel::GetInstance().getVideostate() != false) - { - return; - } - MainModel::GetInstance().setVideostate(true); - if (video_ != nullptr) - { - if (!video_->IsStopped()) - { - video_->StopPlay(); - } - g_video = nullptr; - } - else if (kaleidoscope_ != nullptr) - { - kaleidoscope_->StopRotateAnimator(); - kaleidoscope_->ClearFocus(); - } - #endif + DoStop(); } void DialViewGroup::StartDial() { - #if 0 - if (MainModel::GetInstance().getVideostate() != true) + MainPresenterSample *mainPresenter = MainPresenterSample::GetInstance(); + if ((mainPresenter == nullptr) || (mainPresenter->GetMainPresenterState() != MainPresenterState::RESUME)) { return; } - MainModel::GetInstance().setVideostate(false); - if (video_ != nullptr) - { - if (video_->IsPaused()) - { - video_->ResumePlay(); - } - else if (!video_->IsPlayed()) - { - video_->StartPlay(); - } - g_video = video_; - } - else if (kaleidoscope_ != nullptr) - { - kaleidoscope_->RequestFocus(); - kaleidoscope_->StartRotateAnimator(); - } - #endif } // 更新数据 -- 2.17.1