优化马达震动 优化黑曜表盘天气图标显示以及跳转APPVIEW 1049/1 1049/head
authorpenglei <1624952103@qq.com>
Sat, 28 Sep 2024 12:24:53 +0000 (20:24 +0800)
committerpenglei <1624952103@qq.com>
Sat, 28 Sep 2024 12:24:53 +0000 (20:24 +0800)
code/sdk/application/wearable/fd230app/nativelauncher/include/AppViewIDs.h
code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp
code/sdk/drivers/peripheral/vibrator/service/vibrator_service.cpp
tools/dial_converter_tool/instance/114/obsidianrhythm.xml

index eb8881a..3347c9d 100644 (file)
@@ -40,7 +40,6 @@ typedef enum : uint16_t
     VIEW_INCOMING_CALL,             // 来电界面
     VIEW_COMPASS,                   // 指南针界面
     VIEW_CONNECT_PHONE,             // 连接手机界面
-    VIEW_WEATHER,                   // 天气
     VIEW_SYSTEM,                    // 系统
     VIEW_SOUND_VIBRATION,           // 声音与震动
     VIEW_SYSTEM_VOLUME,             // 系统音量
@@ -64,7 +63,8 @@ typedef enum : uint16_t
     VIEW_THEME_STYLE,               // 主题样式
     VIEW_AI_VOICE,                  // AI Voice(人工智能语音)
     VIEW_AI_MODELS,                 // AI模型选择界面
-    VIEW_REBOOTANDSHUTDOWN,         //(关机或重启界面)
+    VIEW_SHUTDOWN_OR_REBOOT,
+    VIEW_REBOOTANDSHUTDOWN, //(关机或重启界面)
     VIEW_RECORD,
     VIEW_MUSIC_PLAYER, // 音乐播放器
     /* -------------------------------------------------------------------------- */
@@ -118,7 +118,6 @@ typedef enum : uint16_t
     VIEW_MAIN_PHONE,     // 主电话Slice
     VIEW_DIALING_METHOD, // 拨号方式
     VIEW_TEST,           // 测试
-    VIEW_GOAL,           // 每日目标
     VIEW_CALCULATOR,     // 计算器
     VIEW_SCHEDULE,       // schedule
     VIEW_SLEEPMODE,      // sleep mode
@@ -135,9 +134,15 @@ typedef enum : uint16_t
 #ifdef SUPPORT_ALIPAY_SEC
     VIEW_MAIN_ALIPAY,
 #endif
-    /*请在最末添加新的viewID*/
-    VIEW_CALENDAR,        //日历
-    VIEW_SAFE_MODE,           // 安全模式
+    VIEW_CALENDAR,  // 日历
+    VIEW_SAFE_MODE, // 安全模式
+
+    /*表盘功能相关VIEW_ID 请勿移动 请勿在下方增加slice*/
+    VIEW_DIAL_FUN_ID = 200,
+    VIEW_GOAL,    // 每日目标
+    VIEW_WEATHER, // 天气
+    VIEW_ADD_NEW_ID = 250,
+    /* -------------------------------------------------------------------------- */
     VIEW_MAX_INTER_APP,       // 在此之前添加native应用ID.
     VIEW_EXTERN_APP = 0xFFFE, // 三方应用
     VIEW_INVALIDE_APP = 0xFFFF,
index 7a5412b..72ba782 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-04-08 18:40:09
- * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-09-13 10:43:56
+ * @LastEditors: penglei 1624952103@qq.com
+ * @LastEditTime: 2024-09-28 17:27:46
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherModel.cpp
  */
 #include "weather/include/WeatherModel.h"
@@ -345,7 +345,16 @@ namespace OHOS
         }
         if (DialModelWeather::GetInstance())
         {
-            DialModelWeather::GetInstance()->UpdateWeather(Weather_data_seven_data[0].iconDay); // 更新主界面天气图标
+            int index;
+            if(IsNightTime())
+            {
+                index = Weather_data_t_now.iconNight; // 夜晚天气图标
+            }
+            else
+            {
+                index = Weather_data_seven_data[0].iconDay; //白天天气图标
+            }
+            DialModelWeather::GetInstance()->UpdateWeather(index); // 更新主界面天气图标
             // const std::string str = GetWeatherTemperature() + " "+GetWeatherDescription();
             const std::string str = GetWeatherTemperature();
             DialModelWeatherStr::GetInstance()->UpdateWeatherStr(str);
index 631d240..70c1734 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: penglei 1624952103@qq.com
  * @Date: 2024-08-08 16:33:23
  * @LastEditors: penglei 1624952103@qq.com
- * @LastEditTime: 2024-08-08 16:43:33
+ * @LastEditTime: 2024-09-28 20:17:37
  * @FilePath: /FD230/code/sdk/drivers/peripheral/vibrator/service/vibrator_service.cpp
  * @Description: 
  * 
@@ -78,22 +78,23 @@ void custom_VibratorFunc_int(int vibratorType)
         break;
     case 3:
         mail.cycle_time_ms = 235;
-        mail.duty = 65;
-        mail.duration_time_ms = 100;
+        mail.duty = 50;
+        mail.duration_time_ms = 60;
         break;
     case 2:
         mail.cycle_time_ms = 235;
-        mail.duty = 40;
-        mail.duration_time_ms = 100;
+        mail.duty = 50;
+        mail.duration_time_ms = 40;
         break;
     case 1:
         mail.cycle_time_ms = 235;
-        mail.duty = 20;
-        mail.duration_time_ms = 100;
+        mail.duty = 50;
+        mail.duration_time_ms = 20;
         break;
     default:
         break;
     }
+    // PRINT("cycle_time_ms[%d], duty[%d], duration_time_ms[%d] \n",mail.cycle_time_ms,mail.duty,mail.duration_time_ms);
     do_vibrator_cmd(mail);
 }
 
index 2cf759e..d76ed49 100644 (file)
     <click rect="0 193 80 80" action_slice="84"></click>\r
     -->\r
     <!--天气-->\r
-    <click rect="193 0 80 80" action_slice="13"></click>\r
+    <click rect="193 0 80 80" action_slice="202"></click>\r
     <!--支付宝\r
     <click rect="386 193 80 80" action_slice="98"></click>\r
     -->\r
     <!--每日活动-->\r
-    <click rect="193 396 80 80" action_slice="87"></click>\r
+    <click rect="193 396 80 80" action_slice="201"></click>\r
 </dial>\r