开机初始化操作代码合并
authorluozheng <1732036298@qq.com>
Fri, 27 Jun 2025 08:25:15 +0000 (16:25 +0800)
committerluozheng <1732036298@qq.com>
Fri, 27 Jun 2025 08:25:15 +0000 (16:25 +0800)
code/sdk/application/wearable/fd230/nativeapp/nativelauncher/src/NativeLauncher.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothDeviceListView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothEarListView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothOptionsView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/bluetooth/src/BluetoothReconnectView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/player/include/PlayersPresenter.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/player/include/PlayersView.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/player/src/PlayersView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/include/TraingModel.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/traing/src/TraingModel.cpp

index 0959763..c122e4b 100644 (file)
 #include <ConfigModelC.h>
 #include "rebootandshutdown/include/RebootAndShutdownModel.h"
 #include <custom_utils.h>
+#include "system/include/SystemLogModel.h"
+#include "traing/include/TraingModel.h"
+#include "goal/include/goalmodel.h"
+#include "takephotos/include/TakephotosModel.h"
+#include "message/include/MessageModel.h"
+#include "assistant/include/AssistantModel.h"
+#include "battery_hal.h"
+#include "main/include/dial/DialModelCharge.h"
+#include "schedule/include/ScheduleModel.h"
+#include "sleep/include/SleepModel.h"
+#include "main/include/MainModel.h"
+
 
 namespace OHOS {
 
@@ -93,14 +105,7 @@ void NativeLauncher::InitNativeLauncher(LaunchMode mode)
         // 初始化所有预加载slice
         InitAllNativeSlices();
 
-        PlayersModel::GetInstance()->AudioInit();//音乐初始化
-        RebootAndShutdownModel::GetInstance().RegisterAllKeyEvents();//  注册按键事件
-        //音乐列表初始化,放在nativelauncher 初始化,防止手表连接耳机时,操控耳机控制手表音乐造成死机
-        do_custom_fileoperate_service_check_msg(CUSTOM_FILEOPERATE_MSG_TYPE_MUSICNAME_READ, nullptr, 0);
-        cm_initScreenBrightness();// 初始化屏幕亮度
-        cm_initializeScreenDuration();// 初始化屏幕时长
-
-        #ifdef FD230_650
+        // #ifdef FD230_650
         CallerLogModel::GetInstance()->InitPhoneService();
         GoalModel::GetInstance().GoalModelInitdata();//活动数据初始化
         // PresenterTask::GetInstance()->Init();
@@ -155,9 +160,8 @@ void NativeLauncher::InitNativeLauncher(LaunchMode mode)
 
         // 开机增加震动 页面启动震动一次
         // ui_api_vibrate_once_func();
-        #endif
+        // #endif
     }
-    #ifdef FD230_650
     // 注册开机时间  
     SystemLogData systemlog;  
     systemlog.timestamp = SystemLogModel::GetInstance()->GetCurrentTime();  
@@ -170,7 +174,6 @@ void NativeLauncher::InitNativeLauncher(LaunchMode mode)
     SystemLogModel::GetInstance()->load_nextday_log();
     // 读取popup_windows日志
     SystemLogModel::GetInstance()->load_popup_windows_log();
-    #endif
 }
 
 void NativeLauncher::InitAllNativeSlices(void)
index 2dd4085..428f9a4 100644 (file)
@@ -111,7 +111,7 @@ namespace OHOS
         emptyLabel->SetTextId(STR_NO_PAIRED_DEV); // 暂无已配对设备\r
         emptyLabel->SetStyle(STYLE_BACKGROUND_COLOR, OPA_OPAQUE);\r
         emptyLabel->SetLineBreakMode(UILabel::LINE_BREAK_OSCILLATION);\r
-        emptyLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_FORTY_SIZE);\r
+        emptyLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40);\r
         emptyLabel->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER, UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER);\r
         emptyLabel->SetVisible(false);\r
     }\r
index 2a68bf6..31bd0e8 100644 (file)
@@ -169,7 +169,7 @@ namespace OHOS
         }\r
         (*button)->SetImageSrc(PNG_NEW_DEVICE, PNG_NEW_DEVICE);\r
         (*button)->SetViewId(id);\r
-        (*button)->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_FORTY_SIZE);\r
+        (*button)->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40);\r
     }\r
 \r
     void BluetoothEarListView::InitNewEquipmentButton()\r
index 97f68ab..e173eae 100644 (file)
@@ -151,7 +151,7 @@ namespace OHOS
         }\r
         connectStateLabel->SetPosition(60, 148, 333, 33);\r
         connectStateLabel->SetText("已连接");\r
-        connectStateLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_THIRTY_SIZE);\r
+        connectStateLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);\r
         connectStateLabel->SetStyle(STYLE_BACKGROUND_COLOR, OPA_OPAQUE);\r
         connectStateLabel->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER, UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER);\r
         connectStateLabel->SetVisible(false);\r
@@ -181,7 +181,7 @@ namespace OHOS
         }\r
         optionsOneButton->SetPosition(157, 210, 139, 47); // 157:x, 210:y, 139:width 47:height\r
         optionsOneButton->SetText("断开连接");\r
-        optionsOneButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_THIRTY_SIZE);\r
+        optionsOneButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);\r
         optionsOneButton->SetViewId(BLUETOOTH_OPTIONONE_BUTTON);\r
         optionsOneButton->SetImageSrc(PNG_SELECTION_BOX, PNG_SELECTION_BOX);\r
         if (BluetoothModel::GetInstance()->GetBluetoothCalleridStatus() == CALLERPLAYERS)\r
index df336f5..4aa486f 100644 (file)
@@ -77,7 +77,7 @@ void BluetoothReconnectView::ShowUpTitleLabel()
         }\r
         titleLabel->SetPosition(87, 285, 280, 45); // 60:x 100:y 333:width 45:height\r
         titleLabel->SetText("正在重连...");\r
-        titleLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_FORTY_SIZE);\r
+        titleLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40);\r
         titleLabel->SetStyle(STYLE_BACKGROUND_COLOR, OPA_OPAQUE);\r
         titleLabel->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER, UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER);\r
         titleLabel->SetVisible(false);\r
@@ -93,7 +93,7 @@ void BluetoothReconnectView::ShowUpTitleLabel()
         bluetoothNameLabel->SetText(reinterpret_cast<const char *>(caseInfo->deviceName));\r
         bluetoothNameLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);\r
         bluetoothNameLabel->SetPosition(60, 235, 333, 45); // 60:x 148:y 333:width 33:height\r
-        bluetoothNameLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_THIRTY_SIZE);\r
+        bluetoothNameLabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);\r
         bluetoothNameLabel->SetStyle(STYLE_BACKGROUND_COLOR, OPA_OPAQUE);\r
         bluetoothNameLabel->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER, UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER);\r
         bluetoothNameLabel->SetVisible(false);\r
index 72f7a41..0894411 100644 (file)
@@ -6,8 +6,8 @@
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersPresenter.h\r
  */\r
 \r
-#ifndef PLAYERS_PRESENTER_H\r
-#define PLAYERS_PRESENTER_H\r
+#ifndef _PLAYERS_PRESENTER_H_\r
+#define _PLAYERS_PRESENTER_H_\r
 #include "gfx_utils/list.h"\r
 #include "ohos_types.h"\r
 #include "components/ui_view.h"\r
@@ -63,9 +63,6 @@ class VolumeSettingView;
 #define TIPS_FAIL_MESSAGE_VIEW "TipsFailMessageView"\r
 #define TIPS_CONN_FAIL_MESSAGE_VIEW "TipsConnFailMessageView"\r
 \r
-static constexpr uint8_t FONT_THIRTY_SIZE = 30; // 30:字体大小\r
-static constexpr uint8_t FONT_FORTY_SIZE = 40; // 40:字体大小\r
-\r
 struct PlayerCaseInfo {\r
     char sliceId[DEC_NUM_256]; /*音乐名*/\r
     int16_t index;\r
index 53bf930..b7556de 100644 (file)
@@ -6,8 +6,8 @@
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/player/include/PlayersView.h\r
  */\r
 \r
-#ifndef PLAYERS_VIEW_H\r
-#define PLAYERS_VIEW_H\r
+#ifndef _PLAYERS_VIEW_H_\r
+#define _PLAYERS_VIEW_H_\r
 \r
 #include "player/include/PlayersPresenter.h"\r
 \r
@@ -85,9 +85,6 @@ namespace OHOS
         void SetPlayerButtonState(UICheckBox::UICheckBoxState state);\r
         void PlayerModelButtonSetSrc(uint32_t playMode);\r
         void ShowUpListView(void);\r
-        int16_t GetVolumeRank(void);\r
-        void SetVolumeRank(int16_t value);\r
-        void SetVolumeAddOne(void);\r
         void SetPlayerCtrVolume(float leftVolume, float rightVolume);\r
 \r
         UIButton *GetMusicListButton(void);\r
index 18e6446..492cca7 100644 (file)
@@ -58,21 +58,6 @@ namespace OHOS
         g_pPlayersView = nullptr;\r
     }\r
 \r
-    int16_t PlayersView::GetVolumeRank(void)\r
-    {\r
-        return volumeSet;\r
-    }\r
-\r
-    void PlayersView::SetVolumeRank(int16_t value)\r
-    {\r
-        volumeSet = value;\r
-    }\r
-\r
-    void PlayersView::SetVolumeAddOne(void)\r
-    {\r
-        volumeSet++;\r
-    }\r
-\r
     /*获取音乐来源按钮*/\r
     UIButton *PlayersView::GetOptionsButton(void)\r
     {\r
index c28c6bd..45b562a 100644 (file)
@@ -121,7 +121,7 @@ namespace OHOS {
 #define HARD_OFF 1
 #define READTEST 0
 
-#define MAX_HEART_RATE 220
+#define MAX_HEART_RATE_TRAINING 220
 #define AGE_THRESHOLD 59
 #define LOW_INTENSITY_THRESHOLD 59
 #define MEDIUM_INTENSITY_LOWER_THRESHOLD 60
index a683e00..7597c4f 100644 (file)
@@ -1459,7 +1459,7 @@ void TraingModel::SetUserSportdata() {
       ConfigModel::CONFIGMODEL_ITEM_TRANING_FREQ);
   WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "训练频率: %d", user_freq);
 
-  user_Intensity = MAX_HEART_RATE - user_Age;
+  user_Intensity = MAX_HEART_RATE_TRAINING - user_Age;
   WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "用户运动强度心率: %d",
                 user_Intensity);
 }