+/***
+ * @Date: 2024-08-21 15:27:38
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-08-28 18:32:09
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/codedlock/include/CodedLockModel.h
+ */
#ifndef CODEDLOCKMODEL_H
#define CODEDLOCKMODEL_H
uint8_t GetPointNum();
// 配置用户密码
void SetUserPassWord(const std::string &password);
+ // ble进行解锁
+ void BleUnlock();
private:
CodedLockModel();
#include "codedlock/include/CodedLockModel.h"
+#include "MainViewSample.h"
+#include "codedlock/include/CodedLockView.h"
#include <cctype>
#include <algorithm>
#include "wearable_log.h"
#include "string.h"
#include "ConfigModel.h"
+
+extern "C" void uapi_dev_runtime_set_lock_status(uint8_t status);
namespace OHOS
{
/**
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "密码为空");
}
}
+
+ /**
+ * @brief 更新用户状态
+ */
+ void CodedLockModel::BleUnlock()
+ {
+ // 先进行解锁
+ uapi_dev_runtime_set_lock_status(0);
+ /*设置表盘状态*/
+ MainModel::GetInstance().setDialState(DialState::LOCK, false);
+
+ // 获取当前活动视图的实例
+ auto mainViewInstance = MainViewSample::GetInstance();
+ auto codedLockViewInstance = CodedLockView::GetInstance();
+
+ // 如果是在主界面或密码锁界面,重新进入主界面
+ if (mainViewInstance != nullptr || codedLockViewInstance != nullptr)
+ {
+ NativeAbility::GetInstance().ChangeSlice(VIEW_MAIN);
+ }
+ }
+
}
\ No newline at end of file
circleProgress1_->SetForegroundStyle(STYLE_LINE_WIDTH, 20);
circleProgress1_->SetCenterPosition(233, 229);
circleProgress1_->SetRadius(205);
- circleProgress1_->SetStartAngle(40);
- circleProgress1_->SetEndAngle(320);
+ circleProgress1_->SetStartAngle(320);
+ circleProgress1_->SetEndAngle(40);
circleProgress1_->SetValue(GoalModel::GetInstance().getstepvalue());
circleProgress1_->SetBackgroundImagePosition(36, 26);
circleProgress1_->SetCapType(CAP_ROUND);
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, " SleepView::~SleepView");
ClearAll();
+
g_pSleepView = nullptr;
}
float value = (static_cast<float>(SleepModel::GetInstance().get_sleep_total()) / static_cast<float>(SleepModel::GetInstance().get_sleep_goal())) * 100.0f;
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "value %d!", value);
circleProgress_->SetValue(value);
+ circleProgress_->SetCapType(CAP_ROUND);
}
// 更新目标时间
circleProgress->SetBackgroundStyle(STYLE_LINE_WIDTH, 12);
circleProgress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, 0xff2195F6);
circleProgress->SetForegroundStyle(STYLE_BORDER_COLOR, 0xff000000);
- circleProgress->SetForegroundStyle(STYLE_LINE_COLOR, 0xff45A5FF);
+ circleProgress->SetForegroundStyle(STYLE_LINE_COLOR, 0xff4fC34C);
circleProgress->SetForegroundStyle(STYLE_LINE_WIDTH, 10);
circleProgress->SetCenterPosition(235, 235);
circleProgress->SetRadius(215);
InitLabel(curtimelabel, 155, 60, 150, 50, "label1", "23:54", DEFAULT_VECTOR_FONT_FILENAME, 40);
- InitLabel(timerlabel, 0, 163, 466, 150, "label3", "00:00:00", GILROY_BOLD_FONT, 80);
- InitLabel(heartlabel, 85, 284, 230, 80, "label4", "144", GILROY_BOLD_FONT, 60);
+ InitLabel(timerlabel, 0, 163, 466, 150, "label3", "00:00:00", DEFAULT_VECTOR_FONT_FILENAME, 80);
+ InitLabel(heartlabel, 85, 284, 230, 80, "label4", "144", DEFAULT_VECTOR_FONT_FILENAME, 60);
InitLabel(ubpmlabel, 218, 284, 230, 80, "label5", "bpm", DEFAULT_VECTOR_FONT_FILENAME, 60);
ubpmlabel->SetTextColor(Color::Gray());
Add(curtimelabel);
printf("设置手表密码 %d %s \r\n",falg, data);
/*更新model密码配置*/
+ if(falg == 0)
+ {
+ //更新手表状态
+ GraphicService::GetInstance()->PostGraphicEvent(
+ std::bind(&OHOS::CodedLockModel::BleUnlock, OHOS::CodedLockModel::GetInstance()));
+ }
OHOS::CodedLockModel::GetInstance()->SetUserPassWord(data);
return;
STR_WAERKEEP$请确认已带上手表,并保持静止\r
STR_WEARRE$进行重新检测\r
STR_WEARREADY$准备好后点击下方按钮\r
-STR_RECHECK$é\87\8dæ\96°æ£\80æµ\8b\r
+STR_RECHECK$重测\r
STR_CHECKEWARN$血氧提醒\r
STR_BLOODSHORT$当前血氧含量已低于XX%\r
STR_HEARTNOTE$请注意身体健康\r
<lanstr id="STR_WAERKEEP" value="请确认已带上手表,并保持静止"/>
<lanstr id="STR_WEARRE" value="进行重新检测"/>
<lanstr id="STR_WEARREADY" value="准备好后点击下方按钮"/>
- <lanstr id="STR_RECHECK" value="é\87\8dæ\96°æ£\80æµ\8b"/>
+ <lanstr id="STR_RECHECK" value="重测"/>
<lanstr id="STR_CHECKEWARN" value="血氧提醒"/>
<lanstr id="STR_BLOODSHORT" value="当前血氧含量已低于XX%"/>
<lanstr id="STR_HEARTNOTE" value="请注意身体健康"/>