修复650表盘死机问题 1808/1 1808/head 1818/target/1
authorCaisking <Casiking@zhihuishixun.com>
Fri, 6 Jun 2025 04:16:18 +0000 (12:16 +0800)
committerCaisking <Casiking@zhihuishixun.com>
Fri, 6 Jun 2025 04:16:18 +0000 (12:16 +0800)
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dial/DialBoxProgressModel.h [new file with mode: 0644]
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dial/DialBoxProgressView.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialBoxProgressModel.cpp [new file with mode: 0644]
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialBoxProgressView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelKcalgoal.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelPowerStandby.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelStepgoal.cpp
code/sdk/application/wearable/fd230/service/msg_center/CMakeLists.txt
code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp

diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dial/DialBoxProgressModel.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dial/DialBoxProgressModel.h
new file mode 100644 (file)
index 0000000..51d8c66
--- /dev/null
@@ -0,0 +1,42 @@
+#ifndef DIAL_BOX_PROGRESS_MODEL_H
+#define DIAL_BOX_PROGRESS_MODEL_H
+
+#include <cstdint>
+#include "View.h"
+
+enum DialBoxDataType {
+  // 剩余电量百分比
+  BATTERY_LEVEL = 1,
+  // 步数目标
+  STEP_TARGET = 2,
+  // 卡路里
+  CALORIE_TARGET = 3,
+};
+
+namespace OHOS {
+class DialBoxProgressModel {
+public:
+  DialBoxProgressModel();
+  ~DialBoxProgressModel();
+  static DialBoxProgressModel *GetInstance() {
+    static DialBoxProgressModel instance;
+    return &instance;
+  }
+
+  void UpdateBatteryColor( float value_);
+  void SetViewColor(int64_t color);
+  int64_t GetViewColor();
+  
+
+  uint32_t DialBoxDataTypeToBitPattern(DialBoxDataType type);
+  uint32_t ConvertToRequiredFormat(DialBoxDataType type, float data);
+  DialBoxDataType ExtractDataType(uint32_t rawData);
+  uint32_t ExtractValue(uint32_t rawData);
+
+private:
+  int32_t value_ = -1;
+  int64_t color_ = Color::White().full;
+  DialBoxDataType datatype_ = BATTERY_LEVEL;
+};
+} // namespace OHOS
+#endif
index 25bfeeb..cc45b4d 100644 (file)
@@ -1,3 +1,6 @@
+/*
+ * Copyright (c) @CompanyNameMagicTag. 2023. All rights reserved.
+ */
 
 #ifndef DIAL_BOX_PROGRESS_VIEW_H
 #define DIAL_BOX_PROGRESS_VIEW_H
@@ -5,37 +8,14 @@
 #include "DialView.h"
 #include "components/ui_box_progress.h"
 
-enum DialBoxDataType {
-  // 剩余电量百分比
-  BATTERY_LEVEL = 1,
-  // 步数目标
-  STEP_TARGET = 2,
-  // 卡路里
-  CALORIE_TARGET = 3,
-};
 namespace OHOS {
 class DialBoxProgressView : public UIBoxProgress, public DialView {
 public:
-  DialBoxProgressView();
-  ~DialBoxProgressView() override;
-  static DialBoxProgressView *GetInstance() {
-    static DialBoxProgressView instance;
-    return &instance;
-  }
-  void HandleFloatData(float data) override;
-  void UpdataChargColor();
-  void UpdateBatteryColor();
-  void SetViewColor(int64_t color);
-
-  uint32_t DialBoxDataTypeToBitPattern(DialBoxDataType type);
-  uint32_t ConvertToRequiredFormat(DialBoxDataType type, float data);
-  DialBoxDataType ExtractDataType(uint32_t rawData);
-  uint32_t ExtractValue(uint32_t rawData);
-
+    DialBoxProgressView();
+    ~DialBoxProgressView() override;
+    void HandleFloatData(float data) override;
 private:
-  int32_t value_ = -1;
-  int64_t color_ = Color::White().full;
-  DialBoxDataType datatype_ = BATTERY_LEVEL;
+    int32_t value_ = -1;
 };
-} // namespace OHOS
+}
 #endif
\ No newline at end of file
diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialBoxProgressModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialBoxProgressModel.cpp
new file mode 100644 (file)
index 0000000..6b818c0
--- /dev/null
@@ -0,0 +1,88 @@
+#include "DialBoxProgressModel.h"
+#include "DialBoxProgressView.h"
+#include "wearable_log.h"
+
+#include "battery_hal.h"
+extern uint8_t battery_get_voltage(float *voltage);
+
+// 定义电量宏
+#define BATTERY_LOW_THRESHOLD 10
+#define BATTERY_MEDIUM_THRESHOLD 20
+
+// 从转换后的uint32_t数据中提取数据类型
+namespace OHOS {
+DialBoxProgressModel::DialBoxProgressModel(void)
+    : value_(0), color_(Color::White().full) // 初始化 color_
+{}
+
+DialBoxProgressModel::~DialBoxProgressModel(void) {}
+
+/* --------------------------------- 编码解码函数
+ * --------------------------------- */
+
+// 定义用于位操作的掩码和位移值,可根据实际需求调整
+constexpr uint32_t TYPE_MASK = 0xFF000000;
+constexpr uint32_t TYPE_SHIFT = 24;
+constexpr uint32_t VALUE_MASK = 0x00FFFFFF;
+
+uint32_t
+DialBoxProgressModel::DialBoxDataTypeToBitPattern(DialBoxDataType type) {
+  return static_cast<uint32_t>(type) << TYPE_SHIFT;
+}
+//增加box不同值颜色绘制
+uint32_t DialBoxProgressModel::ConvertToRequiredFormat(DialBoxDataType type,
+                                                      float data) {
+
+  uint32_t typeBitPattern = DialBoxDataTypeToBitPattern(type);
+  uint32_t dataAsInt = static_cast<uint32_t>(data);
+
+  return (typeBitPattern | dataAsInt);
+}
+
+DialBoxDataType DialBoxProgressModel::ExtractDataType(uint32_t rawData) {
+
+  uint32_t typeValue = (rawData & TYPE_MASK) >> TYPE_SHIFT;
+  return static_cast<DialBoxDataType>(typeValue);
+}
+
+uint32_t DialBoxProgressModel::ExtractValue(uint32_t rawData) {
+
+  return rawData & VALUE_MASK;
+}
+
+
+void DialBoxProgressModel::UpdateBatteryColor( float value_) {
+  bool isCharging = get_charge_stat(); // 获取充电状态
+
+  if (isCharging) {
+    SetViewColor(Color::Green().full); // 充电状态为绿色
+    return;
+  }
+
+  // 根据值设置电池颜色
+  if (value_ > BATTERY_MEDIUM_THRESHOLD) {
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UpdateBatteryColor White: %d",
+                  value_);
+    SetViewColor(Color::White().full);
+  } else if (value_ <= BATTERY_MEDIUM_THRESHOLD &&
+             value_ > BATTERY_LOW_THRESHOLD) {
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UpdateBatteryColor Yellow: %d",
+                  value_);
+    SetViewColor(Color::Yellow().full);
+  } else if (value_ <= BATTERY_LOW_THRESHOLD && value_ > 0) {
+    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UpdateBatteryColor Red: %d",
+                  value_);
+    SetViewColor(Color::Red().full);
+  }
+}
+
+void DialBoxProgressModel::SetViewColor(int64_t color) {
+  // 仅在颜色变化时设置
+  if (color != color_) {
+    color_ = color;
+  }
+}
+
+//增加返回颜色
+int64_t DialBoxProgressModel::GetViewColor() { return color_; }
+} // namespace OHOS
\ No newline at end of file
index f1846ec..5457370 100644 (file)
@@ -1,66 +1,38 @@
 #include "DialBoxProgressView.h"
+#include "DialBoxProgressModel.h"
 #include "wearable_log.h"
 
-#include "battery_hal.h"
-extern uint8_t battery_get_voltage(float *voltage);
-
-// 定义电量宏
-#define BATTERY_LOW_THRESHOLD 10
-#define BATTERY_MEDIUM_THRESHOLD 20
-
 // 从转换后的uint32_t数据中提取数据类型
 namespace OHOS {
-DialBoxProgressView::DialBoxProgressView(void)
-    : value_(0), color_(Color::White().full) // 初始化 color_
-{}
+DialBoxProgressView::DialBoxProgressView(void) {}
 
 DialBoxProgressView::~DialBoxProgressView(void) {}
 
-/* --------------------------------- 编码解码函数
- * --------------------------------- */
-
-// 定义用于位操作的掩码和位移值,可根据实际需求调整
-constexpr uint32_t TYPE_MASK = 0xFF000000;
-constexpr uint32_t TYPE_SHIFT = 24;
-constexpr uint32_t VALUE_MASK = 0x00FFFFFF;
-
-uint32_t
-DialBoxProgressView::DialBoxDataTypeToBitPattern(DialBoxDataType type) {
-  return static_cast<uint32_t>(type) << TYPE_SHIFT;
-}
-//增加box不同值颜色绘制
-uint32_t DialBoxProgressView::ConvertToRequiredFormat(DialBoxDataType type,
-                                                      float data) {
-
-  uint32_t typeBitPattern = DialBoxDataTypeToBitPattern(type);
-  uint32_t dataAsInt = static_cast<uint32_t>(data);
-
-  return (typeBitPattern | dataAsInt);
-}
-
-DialBoxDataType DialBoxProgressView::ExtractDataType(uint32_t rawData) {
-
-  uint32_t typeValue = (rawData & TYPE_MASK) >> TYPE_SHIFT;
-  return static_cast<DialBoxDataType>(typeValue);
-}
-
-uint32_t DialBoxProgressView::ExtractValue(uint32_t rawData) {
-
-  return rawData & VALUE_MASK;
-}
-
 /* -------------------------------------------------------------------------- */
 void DialBoxProgressView::HandleFloatData(float data) {
   // 获取数据类型
-  datatype_ = ExtractDataType(data); //类型为前4位
-  float value = ExtractValue(data);  //数值为后28位
-  WEARABLE_LOGE("DialBoxProgressView", "HandleFloatData: %d %f", datatype_,
+  DialBoxDataType datatype_ =
+      DialBoxProgressModel::GetInstance()->ExtractDataType(data); //类型为前4位
+  float value =
+      DialBoxProgressModel::GetInstance()->ExtractValue(data); //数值为后28位
+  WEARABLE_LOGD("DialBoxProgressView", "HandleFloatData: %d %f", datatype_,
                 value);
-
-  if (datatype_ == BATTERY_LEVEL) {
-    UpdateBatteryColor(); // 在值变化或充电状态变化时更新颜色
-  } else if (datatype_ == STEP_TARGET) {
-    SetViewColor(0xFFf0c440);
+  int64_t color;
+  switch (datatype_) {
+  //电池颜色
+  case BATTERY_LEVEL:
+    DialBoxProgressModel::GetInstance()->UpdateBatteryColor(value);
+    color = DialBoxProgressModel::GetInstance()->GetViewColor();
+    SetForegroundStyle(STYLE_BACKGROUND_COLOR, color);
+    break;
+  //步数目标
+  case STEP_TARGET:
+    color = 0xFFf0c440; //黄色
+    SetForegroundStyle(STYLE_BACKGROUND_COLOR, color);
+    break;
+  default:
+    WEARABLE_LOGE("DialBoxProgressView", "HandleFloatData: datatype error");
+    break;
   }
   if (value != value_) {
     value_ = value;
@@ -68,36 +40,4 @@ void DialBoxProgressView::HandleFloatData(float data) {
   }
 }
 
-void DialBoxProgressView::UpdateBatteryColor() {
-  bool isCharging = get_charge_stat(); // 获取充电状态
-
-  if (isCharging) {
-    SetViewColor(Color::Green().full); // 充电状态为绿色
-    return;
-  }
-
-  // 根据值设置电池颜色
-  if (value_ > BATTERY_MEDIUM_THRESHOLD) {
-    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UpdateBatteryColor White: %d",
-                  value_);
-    SetViewColor(Color::White().full);
-  } else if (value_ <= BATTERY_MEDIUM_THRESHOLD &&
-             value_ > BATTERY_LOW_THRESHOLD) {
-    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UpdateBatteryColor Yellow: %d",
-                  value_);
-    SetViewColor(Color::Yellow().full);
-  } else if (value_ <= BATTERY_LOW_THRESHOLD && value_ > 0) {
-    WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "UpdateBatteryColor Red: %d",
-                  value_);
-    SetViewColor(Color::Red().full);
-  }
-}
-
-void DialBoxProgressView::SetViewColor(int64_t color) {
-  // 仅在颜色变化时设置
-  if (color != color_) {
-    color_ = color;
-    SetForegroundStyle(STYLE_BACKGROUND_COLOR, color_);
-  }
-}
 } // namespace OHOS
\ No newline at end of file
index 795e3fe..2f66e6e 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "DialModelKcalgoal.h"
 #include "DialBoxProgressView.h"
+#include "DialBoxProgressModel.h"
 #include "RegisterDialModel.h"
 #include "goal/include/goalmodel.h"
 
@@ -16,6 +17,7 @@ REGIST_DIAL_MODULE(OHOS::DialDataType::CALORIE_GOAL_BOXPROGRESS,
 namespace OHOS {
 bool DialModelKcalgoal::GetDialFloatData(DialDataType &type, float &out) {
   (void)type;
+#if 1
   uint32_t goal = GoalModel::GetInstance().getKcalgoaldata();
   uint32_t Kcal_ = GoalModel::GetInstance().show_data_calories_refresh();
   
@@ -23,7 +25,7 @@ bool DialModelKcalgoal::GetDialFloatData(DialDataType &type, float &out) {
     Kcalgoal_ = (static_cast<float>(Kcal_) / goal) * 100;
     if (Kcalgoal_ > 100)
       Kcalgoal_ = 100;
-    Kcalgoal_ = DialBoxProgressView::GetInstance()->ConvertToRequiredFormat(
+      Kcalgoal_ = DialBoxProgressModel::GetInstance()->ConvertToRequiredFormat(
         DialBoxDataType::CALORIE_TARGET, Kcalgoal_);
   } else {
     Kcalgoal_ = 0;
@@ -32,12 +34,16 @@ bool DialModelKcalgoal::GetDialFloatData(DialDataType &type, float &out) {
     onChangeListener_->OnDialFloatDataUpdate(
         OHOS::DialDataType::CALORIE_GOAL_BOXPROGRESS, Kcalgoal_);
   }
-  out = DialBoxProgressView::GetInstance()->ConvertToRequiredFormat(
+  out = DialBoxProgressModel::GetInstance()->ConvertToRequiredFormat(
       DialBoxDataType::CALORIE_TARGET, Kcalgoal_);
+#else
+  out = 0;
+#endif
   return true;
 }
 
 void DialModelKcalgoal::UpdateKcalgoal(uint32_t Kcals) {
+#if 0
   uint32_t Kcal_ = static_cast<float>(Kcals);
   uint32_t goal = GoalModel::GetInstance().getKcalgoaldata();
   if (goal > 0) {
@@ -51,5 +57,6 @@ void DialModelKcalgoal::UpdateKcalgoal(uint32_t Kcals) {
     onChangeListener_->OnDialFloatDataUpdate(
         OHOS::DialDataType::CALORIE_GOAL_BOXPROGRESS, Kcalgoal_);
   }
+#endif
 }
 } // namespace OHOS
index c939320..ca53139 100644 (file)
@@ -2,6 +2,8 @@
 
 #include "DialModelPowerStandby.h"
 #include "DialBoxProgressView.h"
+#include "DialBoxProgressModel.h"
+
 #include "RegisterDialModel.h"
 #include "wearable_log.h"
 #include <string>
@@ -15,12 +17,12 @@ REGIST_DIAL_MODULE(OHOS::DialDataType::POWER_STANDBY,
 namespace OHOS {
 
 bool DialModelPowerStanby::GetDialFloatData(DialDataType &type, float &out) {
+#if 1
   (void)type;
-
   float voltage = 0.0F;
   PowerStanby_ = battery_get_voltage(&voltage);
 
-  WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Battery voltage obtained: %.2f",
+  WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Battery voltage obtained: %.2f",
                 voltage);
 
   // 计算映射值
@@ -33,7 +35,7 @@ bool DialModelPowerStanby::GetDialFloatData(DialDataType &type, float &out) {
   } else {
     mappedValue = (PowerStanby_ == maxPower) ? 1.0f : 0.0f; // 边界处理
   }
-  WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+  WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP,
                 "Raw power value: %d, Mapped value: %.2f", PowerStanby_,
                 mappedValue);
   // 如果需要在 0 到 1 范围映射
@@ -41,11 +43,17 @@ bool DialModelPowerStanby::GetDialFloatData(DialDataType &type, float &out) {
   // 需要前4个为类型
   // 后28位为数据
 
-  out = DialBoxProgressView::GetInstance()->ConvertToRequiredFormat(
+  out = DialBoxProgressModel::GetInstance()->ConvertToRequiredFormat(
       DialBoxDataType::BATTERY_LEVEL, PowerStanby_);
 
-  WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Mapped value sent to caller: %.2f",
+  WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "Mapped value sent to caller: %.2f",
                 out);
+#else
+    (void)type;
+    float voltage = 0.0F;
+    power_ = battery_get_voltage(&voltage);
+    out = static_cast<float>(power_);
+#endif
 
   return true;
 }
index ec7434e..a87214d 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "DialModelStepgoal.h"
 #include "DialBoxProgressView.h"
+#include "DialBoxProgressModel.h"
 #include "RegisterDialModel.h"
 #include "goal/include/goalmodel.h"
 
@@ -16,36 +17,41 @@ REGIST_DIAL_MODULE(OHOS::DialDataType::STEPS_GOAL_BOXPROGRESS,
 namespace OHOS {
 bool DialModelStepgoal::GetDialFloatData(DialDataType &type, float &out) {
   (void)type;
-
+#if 1
   uint32_t step_ = GoalModel::GetInstance().show_data_step_refresh();
   uint32_t goal = GoalModel::GetInstance().getstepgoaldata();
   if (goal > 0) {
     stepgoal_ = (static_cast<float>(step_) / goal) * 100;
     if (stepgoal_ > 100)
       stepgoal_ = 100;
-    stepgoal_ = DialBoxProgressView::GetInstance()->ConvertToRequiredFormat(
+      stepgoal_ = DialBoxProgressModel::GetInstance()->ConvertToRequiredFormat(
         DialBoxDataType::STEP_TARGET, stepgoal_);
   } else {
     stepgoal_ = 0;
   }
-  out = DialBoxProgressView::GetInstance()->ConvertToRequiredFormat(
+  out = DialBoxProgressModel::GetInstance()->ConvertToRequiredFormat(
       DialBoxDataType::STEP_TARGET, stepgoal_);
+#else
+  out = 0;
+#endif
   return true;
 }
 
 void DialModelStepgoal::UpdateStepgoal(uint32_t steps) {
+#if 1
   uint32_t step_ = static_cast<float>(steps);
   uint32_t goal = GoalModel::GetInstance().getstepgoaldata();
   if (goal > 0) {
     stepgoal_ = (static_cast<float>(step_) / goal) * 100;
     if (stepgoal_ > 100)
       stepgoal_ = 100;
-    stepgoal_ = DialBoxProgressView::GetInstance()->ConvertToRequiredFormat(
+    stepgoal_ = DialBoxProgressModel::GetInstance()->ConvertToRequiredFormat(
         DialBoxDataType::STEP_TARGET, stepgoal_);
   }
   if (onChangeListener_ != nullptr) {
-    onChangeListener_->OnDialFloatDataUpdate(OHOS::DialDataType::STEPS_GOAL_BOXPROGRESS,
-                                             stepgoal_);
+    onChangeListener_->OnDialFloatDataUpdate(
+        OHOS::DialDataType::STEPS_GOAL_BOXPROGRESS, stepgoal_);
   }
+#endif
 }
 } // namespace OHOS
index 36a4d55..f39a85c 100644 (file)
@@ -99,6 +99,8 @@ set(PRIVATE_HEADER
     ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/key/include
     ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativelauncher/include
     ${CMAKE_CURRENT_SOURCE_DIR}/../../ohos_deps
+    ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/main/include/dial
+    ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/saveele/include
     ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include
     ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/utils/innerkits
     ${ROOT_DIR}/middleware/services/gui/uikit/ui/interfaces/innerkits
@@ -107,7 +109,8 @@ set(PRIVATE_HEADER
     ${ROOT_DIR}/middleware/services/gui/uikit/utils/interfaces/kits/gfx_utils
     ${ROOT_DIR}/middleware/services/gui/uikit/surface/interfaces/kits
     ${ROOT_DIR}/middleware/services/gui/uikit/ui/frameworks
-    ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components_ext
+    ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/include/components
+    ${ROOT_DIR}/middleware/services/gui/uikit/proprietary/src/ui/frameworks/components/
     ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audio_player/interfaces/kits
     ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audiomanager/interfaces/kits/audiomanager
     ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/audiomanager/interfaces/kits/audiocommon
@@ -134,6 +137,7 @@ set(PRIVATE_HEADER
     ${ROOT_DIR}/application/wearable/nativeapp/nativeui/player/include
     ${ROOT_DIR}/application/wearable/nativeapp/nativeui/applist/include
     ${ROOT_DIR}/open_source/openharmony/foundation/multimedia/player/interfaces/kits
+    
 
     ${ROOT_DIR}/application/wearable/fd230/nativeapp/nativeui/
 )
index 405baf3..11e206f 100644 (file)
 #include "VolumeSettingPresenter.h"
 #include "VolumeSettingView.h"
 #include "pairing_notification.h"
+// #include "saveele/include/SaveEleModel.h"
+// #include "DialModelCharge.h"
+
+#define DIALDATASET 1
+
 #ifdef SUPPORT_BLE_SERVICE
 #include "bleInstruct.h"
 #endif
@@ -395,12 +400,12 @@ void MsgCenterNotifyChargePlugProc(const Topic topic, Request* req)
     {
         GraphicService::GetInstance()->PostGraphicEvent(std::bind(&OHOS::PullUpDownView::UpdateBatteryProcess,  OHOS::PullUpDownView::GetInstance() ));
     }
-
     #if 0
 #if DIALDATASET
     DialModelCharge::GetInstance()->UpdatechargeStatus(1);
 #endif
     SaveEleModel::GetInstance()->SetChargeStatus(true);
+
     if (uapi_dev_runtime_get_train_status()) 
     {
       WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyProc:: CHarger Plug ! but train status is true");
@@ -420,8 +425,7 @@ void MsgCenterNotifyChargePlugProc(const Topic topic, Request* req)
             NotificationManager::GetInstance()->ShowNotify(ShowChargeingNotify, (uint16_t)topic, true);
         }
     }
-    #endif
-   
+   #endif
 }
 
 /*充电器已拔掉*/
@@ -437,13 +441,13 @@ void MsgCenterNotifyChargeUnPlugProc(const Topic topic, Request* req)
     {
         GraphicService::GetInstance()->PostGraphicEvent(std::bind(&OHOS::PullUpDownView::UpdateBatteryProcess,  OHOS::PullUpDownView::GetInstance() ));
     }
-
-    #if 0
+#if 0
 #if DIALDATASET
     DialModelCharge::GetInstance()->UpdatechargeStatus(0);
 #endif
     SaveEleModel::GetInstance()->SetChargeStatus(false);
-    
+
+
     testCHANINGView *t = testCHANINGView::GetInstance();
     if(t != nullptr)
     {
@@ -456,7 +460,7 @@ void MsgCenterNotifyChargeUnPlugProc(const Topic topic, Request* req)
             NotificationManager::GetInstance()->StopNotify();
         }
     }
-    #endif
+ #endif
 }
 
 /*低电量提醒*/