修改表盘数据类型获取
authorCaisking <Casiking@zhihuishixun.com>
Mon, 19 May 2025 03:40:03 +0000 (11:40 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Mon, 19 May 2025 03:40:03 +0000 (11:40 +0800)
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dial/DialDataBase.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialViewGroup.cpp

index d258eec..4b0d0d4 100644 (file)
@@ -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, // 数据类型的最大值
 };
index a8bd70a..19ba8d4 100644 (file)
@@ -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<int16_t>(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
     }
     
     // 更新数据