866 lines
35 KiB
C++
866 lines
35 KiB
C++
#include "TjdUiAppSleepView.h"
|
|
#include "TjdUiAppSleepPresenter.h"
|
|
#include "TjdUiImageIds.h"
|
|
#include "TjdUiMemManage.h"
|
|
#include "TjdUiMultiLanguageExt.h"
|
|
#include "TjdUiUtils.h"
|
|
#include "common/image_cache_manager.h"
|
|
#include "dock/focus_manager.h"
|
|
#include "sys_config.h"
|
|
#include <stdio.h>
|
|
|
|
using namespace OHOS;
|
|
|
|
#define ENABLE_PRINT_INFO 1
|
|
#if ENABLE_PRINT_INFO
|
|
#define static_print_info(...) sys_ui_log_i(__VA_ARGS__) // 一般信息打印宏控制
|
|
#define static_print_warn(...) sys_ui_log_w(__VA_ARGS__) // 警告信息打印一般常开
|
|
#define static_print_error(...) sys_ui_log_e(__VA_ARGS__) // 错误信息打印一般常开
|
|
#define static_print_debug(...) sys_ui_log_d(__VA_ARGS__) // 调试信息打印
|
|
#else
|
|
#define static_print_info(...)
|
|
#define static_print_warn(...)
|
|
#define static_print_error(...)
|
|
#define static_print_debug(...)
|
|
#endif
|
|
|
|
#define SLEEP_IMAGE_BIN_PATH TJD_IMAGE_PATH "img_sleep.bin"
|
|
#define SLEEP_NO_DATA_BIN_PATH TJD_IMAGE_PATH "img_no_data.bin"
|
|
|
|
namespace TJD {
|
|
|
|
static ImageAnimatorInfo g_imageAnimator1Info[12] = {
|
|
{nullptr, {0, 0}, 466, 466, IMG_SRC_IMAGE_INFO}, {nullptr, {0, 0}, 466, 466, IMG_SRC_IMAGE_INFO},
|
|
{nullptr, {0, 0}, 466, 466, IMG_SRC_IMAGE_INFO}, {nullptr, {0, 0}, 466, 466, IMG_SRC_IMAGE_INFO},
|
|
{nullptr, {0, 0}, 466, 466, IMG_SRC_IMAGE_INFO}, {nullptr, {0, 0}, 466, 466, IMG_SRC_IMAGE_INFO},
|
|
{nullptr, {0, 0}, 466, 466, IMG_SRC_IMAGE_INFO}, {nullptr, {0, 0}, 466, 466, IMG_SRC_IMAGE_INFO},
|
|
{nullptr, {0, 0}, 466, 466, IMG_SRC_IMAGE_INFO}, {nullptr, {0, 0}, 466, 466, IMG_SRC_IMAGE_INFO},
|
|
{nullptr, {0, 0}, 466, 466, IMG_SRC_IMAGE_INFO}, {nullptr, {0, 0}, 466, 466, IMG_SRC_IMAGE_INFO},
|
|
};
|
|
const std::string weeksText[7] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
|
|
|
|
static TjdUiAppSleepView *g_pv_AppSleepView = nullptr;
|
|
|
|
static void DeleteViewChilden(UIViewGroup *viewGroup)
|
|
{
|
|
if (viewGroup == nullptr) {
|
|
return;
|
|
}
|
|
UIView *view = viewGroup->GetChildrenHead();
|
|
while (view != nullptr) {
|
|
UIView *tempView = view;
|
|
view = view->GetNextSibling();
|
|
if (tempView->GetParent()) {
|
|
static_cast<UIViewGroup *>(tempView->GetParent())->Remove(tempView);
|
|
}
|
|
delete tempView;
|
|
tempView = nullptr;
|
|
}
|
|
}
|
|
|
|
TjdUiAppSleepView::TjdUiAppSleepView() { g_pv_AppSleepView = this; }
|
|
|
|
TjdUiAppSleepView::~TjdUiAppSleepView()
|
|
{
|
|
g_pv_AppSleepView = nullptr;
|
|
ImageCacheManager::GetInstance().UnloadAllInMultiRes(SLEEP_NO_DATA_BIN_PATH);
|
|
ImageCacheManager::GetInstance().UnloadAllInMultiRes(SLEEP_IMAGE_BIN_PATH);
|
|
|
|
static_cast<UIChart *>(sleepWeekDataView_->GetChildById(SLEEP_BLINK_CHART))->ClearDataSerial();
|
|
if (uiChartBlinkdata) {
|
|
delete uiChartBlinkdata;
|
|
uiChartBlinkdata = nullptr;
|
|
} else {
|
|
static_print_error("uiChartBlinkdata was not initialized !!!");
|
|
}
|
|
|
|
static_cast<UIChart *>(sleepWeekDataView_->GetChildById(SLEEP_WAKEUP_CHART))->ClearDataSerial();
|
|
if (uiChartWakeupdata) {
|
|
delete uiChartWakeupdata;
|
|
uiChartWakeupdata = nullptr;
|
|
} else {
|
|
static_print_error("uiChartWakeupdata was not initialized !!!");
|
|
}
|
|
|
|
static_cast<UIChart *>(sleepWeekDataView_->GetChildById(SLEEP_DEEP_CHART))->ClearDataSerial();
|
|
if (uiChartDeepdata) {
|
|
delete uiChartDeepdata;
|
|
uiChartDeepdata = nullptr;
|
|
} else {
|
|
static_print_error("uiChartDeepdata was not initialized !!!");
|
|
}
|
|
static_cast<UIChart *>(sleepWeekDataView_->GetChildById(SLEEP_LIGHT_CHART))->ClearDataSerial();
|
|
if (uiChartLightdata) {
|
|
delete uiChartLightdata;
|
|
uiChartLightdata = nullptr;
|
|
} else {
|
|
static_print_error("uiChartLightdata was not initialized !!!");
|
|
}
|
|
|
|
if (swipeContainer_) {
|
|
swipeContainer_->RemoveAll();
|
|
delete swipeContainer_;
|
|
swipeContainer_ = nullptr;
|
|
} else {
|
|
static_print_error("swipeContainer_ was not initialized !!!");
|
|
}
|
|
if (sleepHomeView_) {
|
|
// sleepHomeView_->Remove(imageAnimator1_);
|
|
DeleteViewChilden(sleepHomeView_);
|
|
delete sleepHomeView_;
|
|
sleepHomeView_ = nullptr;
|
|
} else {
|
|
static_print_error("sleepHomeView_ was not initialized !!!");
|
|
}
|
|
if (sleepDayDataView_) {
|
|
DeleteViewChilden(sleepDayDataView_);
|
|
delete sleepDayDataView_;
|
|
sleepDayDataView_ = nullptr;
|
|
} else {
|
|
static_print_error("sleepDayDataView_ was not initialized !!!");
|
|
}
|
|
if (sleepWeekDataView_) {
|
|
DeleteViewChilden(sleepWeekDataView_);
|
|
delete sleepWeekDataView_;
|
|
sleepWeekDataView_ = nullptr;
|
|
} else {
|
|
static_print_error("sleepWeekDataView_ was not initialized !!!");
|
|
}
|
|
}
|
|
|
|
TjdUiAppSleepView *TjdUiAppSleepView::GetInstance(void) { return g_pv_AppSleepView; }
|
|
|
|
void TjdUiAppSleepView::OnStart()
|
|
{
|
|
LoadImageRes();
|
|
presenter_->GetSleepModel()->LoadSleepData();
|
|
|
|
static_print_info("[TjdUiAppSleepView]::%s", __func__);
|
|
if (swipeContainer_ == nullptr) {
|
|
swipeContainer_ = new UISwipeViewNested(UISwipeView::VERTICAL);
|
|
swipeContainer_->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
|
|
swipeContainer_->SetViewId("swipeContainer_");
|
|
if (OHOS::PageTransitionMgr::GetInstance().GetTopSlideBackImage() == nullptr) {
|
|
swipeContainer_->SetOnDragListener(presenter_);
|
|
}
|
|
}
|
|
swipeContainer_->Add(SleepHomeViewInit());
|
|
swipeContainer_->Add(SleepDayDataViewInit());
|
|
swipeContainer_->Add(SleepWeekDataViewInit());
|
|
|
|
AddViewToRootContainer(swipeContainer_);
|
|
}
|
|
|
|
void TjdUiAppSleepView::OnStop() { static_print_info("[TjdUiAppSleepView]::%s", __func__); }
|
|
|
|
UIViewGroup *TjdUiAppSleepView::SleepHomeViewInit(void)
|
|
{
|
|
if (sleepHomeView_ == nullptr) {
|
|
sleepHomeView_ = new UIViewGroup();
|
|
sleepHomeView_->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
|
|
sleepHomeView_->SetViewId(SLEEP_HOME_VIEW);
|
|
}
|
|
|
|
/*-----------------------------Add imageAnimator1_ to App------------------------------*/
|
|
UIImageAnimatorView *imageAnimator1_ = new UIImageAnimatorView();
|
|
imageAnimator1_->SetPosition(0, 0, 466, 466);
|
|
imageAnimator1_->SetViewId("imageAnimator1_");
|
|
imageAnimator1_->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);
|
|
imageAnimator1_->SetStyle(STYLE_BACKGROUND_OPA, 0x0);
|
|
imageAnimator1_->SetImageAnimatorSrc(g_imageAnimator1Info, sizeof(g_imageAnimator1Info) / sizeof(ImageAnimatorInfo),
|
|
100);
|
|
imageAnimator1_->SetTimeOfPause(100);
|
|
// imageAnimator1_->SetRepeatTimes(1);
|
|
imageAnimator1_->SetReverse(false);
|
|
imageAnimator1_->Start();
|
|
sleepHomeView_->Add(imageAnimator1_);
|
|
|
|
/*-----------------------------Add label1_ to App------------------------------*/
|
|
UILabelExt *label1_ = new UILabelExt();
|
|
label1_->SetPosition(0, 18, 466, 37);
|
|
label1_->SetViewId("label1_");
|
|
label1_->SetStyle(STYLE_TEXT_FONT, 28);
|
|
label1_->SetTextId(STR_ID_02);
|
|
// label1_->SetText("睡眠");
|
|
// label1_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
|
|
label1_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
|
|
label1_->SetFont(TJD_VECTOR_FONT_FILENAME, 28);
|
|
sleepHomeView_->Add(label1_);
|
|
|
|
/*-----------------------------Add label2_ to App------------------------------*/
|
|
UILabel *label2_ = new UILabel();
|
|
label2_->SetPosition(0, 324, HORIZONTAL_RESOLUTION, 60);
|
|
label2_->SetViewId(SLEEP_TOTAL_TIME);
|
|
label2_->SetText("-- H -- min");
|
|
label2_->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
|
|
label2_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_TOP);
|
|
label2_->SetFont(TJD_DIN_MEDIUM_FONT_FILENAME, 56);
|
|
TjdUiUtils::AutoAlignHorizontalCenter(*label2_);
|
|
sleepHomeView_->Add(label2_);
|
|
|
|
/*-----------------------------Add labelNodata_ to App------------------------------*/
|
|
UILabelExt *labelNodata_ = new UILabelExt();
|
|
labelNodata_->SetPosition(0, 382, 466, 40);
|
|
labelNodata_->SetViewId(SLEEP_NODATA_LABEL);
|
|
labelNodata_->SetTextId(STR_ID_554);
|
|
labelNodata_->SetStyle(STYLE_TEXT_COLOR, 0xFF666666);
|
|
// labelNodata_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
|
|
labelNodata_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_TOP);
|
|
labelNodata_->SetFont(TJD_VECTOR_FONT_FILENAME, 30);
|
|
TjdUiUtils::AutoAlignHorizontalCenter(*labelNodata_);
|
|
sleepHomeView_->Add(labelNodata_);
|
|
|
|
return sleepHomeView_;
|
|
}
|
|
|
|
UIViewGroup *TjdUiAppSleepView::SleepDayDataViewInit(void)
|
|
{
|
|
if (sleepDayDataView_ == nullptr) {
|
|
sleepDayDataView_ = new UIViewGroup();
|
|
sleepDayDataView_->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
|
|
sleepDayDataView_->SetViewId(SLEEP_DAYDATA_VIEW);
|
|
}
|
|
|
|
/*-----------------------------Add label1_ to App------------------------------*/
|
|
UILabelExt *label1_ = new UILabelExt();
|
|
label1_->SetPosition(0, 18, 466, 37);
|
|
label1_->SetViewId("label1_");
|
|
label1_->SetStyle(STYLE_TEXT_FONT, 28);
|
|
// label1_->SetText("睡眠阶段");
|
|
label1_->SetTextId(STR_ID_117);
|
|
// label1_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
|
|
label1_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
|
|
label1_->SetFont(TJD_VECTOR_FONT_FILENAME, 28);
|
|
sleepDayDataView_->Add(label1_);
|
|
|
|
UILabelExt *label[4] = {nullptr};
|
|
for (int i = 0; i < 4; i++) {
|
|
label[i] = new UILabelExt();
|
|
label[i]->SetPosition(52, 105 + (i * 73), 47, 23);
|
|
// label[i]->SetViewId("label1");
|
|
label[i]->SetStyle(STYLE_TEXT_FONT, 28);
|
|
label[i]->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
|
|
label[i]->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
|
|
label[i]->SetFont(TJD_VECTOR_FONT_FILENAME, 28);
|
|
|
|
UILabel *label2 = new UILabel();
|
|
label2->SetPosition(110, 105 + (i * 73), 138, 20);
|
|
label2->SetStyle(STYLE_TEXT_FONT, 28);
|
|
label2->SetText("-- H -- min");
|
|
label2->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
|
|
label2->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
|
|
label2->SetFont(TJD_VECTOR_FONT_FILENAME, 28);
|
|
|
|
UILabel *label3 = new UILabel();
|
|
label3->SetPosition(361, 105 + (i * 73), 45, 20);
|
|
label3->SetText("--%");
|
|
label3->SetStyle(STYLE_TEXT_FONT, 28);
|
|
label3->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
|
|
label3->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
|
|
label3->SetFont(TJD_VECTOR_FONT_FILENAME, 28);
|
|
|
|
UISlider *slider_ = new UISlider();
|
|
|
|
slider_->SetPosition(53, 143 + (i * 73), 360, 16);
|
|
slider_->SetStyle(STYLE_BORDER_RADIUS, 29);
|
|
slider_->SetValidWidth(360);
|
|
slider_->SetValidHeight(16);
|
|
slider_->SetValue(2);
|
|
slider_->SetKnobWidth(16);
|
|
slider_->SetKnobRadius(7);
|
|
slider_->SetForegroundStyle(STYLE_BACKGROUND_OPA, 0xff);
|
|
slider_->SetCapType(CAP_ROUND);
|
|
|
|
switch (i) {
|
|
case 0:
|
|
// label1->SetText("快速眼动");
|
|
label[i]->SetTextId(STR_ID_118);
|
|
label2->SetViewId(SLEEP_BLINK_TIME);
|
|
label3->SetViewId(SLEEP_BLINK_PERSENT);
|
|
slider_->SetViewId(SLEEP_BLINK_SLIDER);
|
|
slider_->SetKnobStyle(STYLE_BACKGROUND_COLOR, 0xffA600FF);
|
|
slider_->SetSliderColor(Color::GetColorFromRGBA(0x31, 0x31, 0x31, 0xff),
|
|
Color::GetColorFromRGBA(0xa6, 0x00, 0xff, 0xff));
|
|
break;
|
|
case 1:
|
|
// label1->SetText("清醒");
|
|
label[i]->SetTextId(STR_ID_119);
|
|
label2->SetViewId(SLEEP_WAKEUP_TIME);
|
|
label3->SetViewId(SLEEP_WAKEUP_PERSENT);
|
|
slider_->SetViewId(SLEEP_WAKEUP_SLIDER);
|
|
slider_->SetKnobStyle(STYLE_BACKGROUND_COLOR, 0xff9A47F6);
|
|
slider_->SetSliderColor(Color::GetColorFromRGBA(0x31, 0x31, 0x31, 0xff),
|
|
Color::GetColorFromRGBA(0x9a, 0x47, 0xf6, 0xff));
|
|
break;
|
|
case 2:
|
|
// label1->SetText("深睡");
|
|
label[i]->SetTextId(STR_ID_120);
|
|
label2->SetViewId(SLEEP_DEEP_TIME);
|
|
label3->SetViewId(SLEEP_DEEP_PERSENT);
|
|
slider_->SetViewId(SLEEP_DEEP_SLIDER);
|
|
slider_->SetKnobStyle(STYLE_BACKGROUND_COLOR, 0xff6B2BFF);
|
|
slider_->SetSliderColor(Color::GetColorFromRGBA(0x31, 0x31, 0x31, 0xff),
|
|
Color::GetColorFromRGBA(0x6b, 0x2b, 0xff, 0xff));
|
|
break;
|
|
case 3:
|
|
// label1->SetText("浅睡");
|
|
label[i]->SetTextId(STR_ID_121);
|
|
label2->SetViewId(SLEEP_LIGHT_TIME);
|
|
label3->SetViewId(SLEEP_LIGHT_PERSENT);
|
|
slider_->SetViewId(SLEEP_LIGHT_SLIDER);
|
|
slider_->SetKnobStyle(STYLE_BACKGROUND_COLOR, 0xff986BFF);
|
|
slider_->SetSliderColor(Color::GetColorFromRGBA(0x31, 0x31, 0x31, 0xff),
|
|
Color::GetColorFromRGBA(0x98, 0x6B, 0xFF, 0xff));
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
TjdUiUtils::AdjustViewOffset(*label2, *label[i], 12, TjdUiUtils::OffsetDirection::OFFSET_RIGHT);
|
|
sleepDayDataView_->Add(label[i]);
|
|
sleepDayDataView_->Add(label2);
|
|
sleepDayDataView_->Add(label3);
|
|
sleepDayDataView_->Add(slider_);
|
|
}
|
|
|
|
return sleepDayDataView_;
|
|
}
|
|
|
|
class TjdUIChartPillar : public UIChart
|
|
{
|
|
public:
|
|
TjdUIChartPillar() {}
|
|
virtual ~TjdUIChartPillar() {}
|
|
void RefreshChart()
|
|
{
|
|
ListNode<UIChartDataSerial *> *iter = list_.Begin();
|
|
if (list_.Size() == 0) {
|
|
return;
|
|
}
|
|
uint16_t minXStep = static_cast<uint16_t>(xAxis_.GetMarkInterval());
|
|
uint16_t width = minXStep / list_.Size();
|
|
int16_t barWidth = 16;
|
|
uint8_t dataSerialIndex = 0;
|
|
|
|
Rect rect = GetContentRect();
|
|
for (; iter != list_.End(); iter = iter->next_) {
|
|
UIChartDataSerial *data = iter->data_;
|
|
int16_t xOffset = (width - barWidth) / 2 + width * dataSerialIndex;
|
|
|
|
if (data == nullptr) {
|
|
break;
|
|
}
|
|
uint16_t dataCount = data->GetDataCount();
|
|
if (dataCount <= 1) {
|
|
break;
|
|
}
|
|
|
|
uint16_t index = data->GetLastPointIndex();
|
|
if (index >= dataCount) {
|
|
break;
|
|
}
|
|
|
|
Point current;
|
|
data->GetPoint(index, current);
|
|
Point last;
|
|
data->GetPoint(dataCount - 1, last);
|
|
last.x += xOffset;
|
|
Rect refresh(current.x, rect.GetTop(), last.x + (barWidth >> 1), rect.GetBottom());
|
|
InvalidateRect(refresh);
|
|
data->Refresh();
|
|
data->SetLastPointIndex(dataCount - 1);
|
|
dataSerialIndex++;
|
|
}
|
|
}
|
|
|
|
void DrawDataSerials(BufferInfo &gfxDstBuffer, const Rect &invalidatedArea)
|
|
{
|
|
xAxis_.UpdateAxisPoints();
|
|
yAxis_.UpdateAxisPoints();
|
|
uint16_t minXStep = static_cast<uint16_t>(xAxis_.GetMarkInterval());
|
|
Point xStart = xAxis_.GetStartPoint();
|
|
uint16_t dataSerialCount = list_.Size();
|
|
if (dataSerialCount == 0) {
|
|
return;
|
|
}
|
|
uint16_t width = minXStep / dataSerialCount;
|
|
uint8_t dataSerialIndex = 0;
|
|
uint16_t barWidth = 16;
|
|
// uint8_t opa = DrawUtils::GetMixOpacity(opaScale_, style_->lineOpa_);
|
|
capRadius_ = (barWidth >> 1) + 1;
|
|
|
|
// if (!paths_.IsEmpty()) {
|
|
// ClearPath();
|
|
// }
|
|
for (ListNode<UIChartDataSerial *> *iter = list_.Begin(); iter != list_.End(); iter = iter->next_) {
|
|
UIChartDataSerial *data = iter->data_;
|
|
uint16_t dataSerialWidth = width * dataSerialIndex;
|
|
int16_t x = dataSerialWidth + (width >> 1);
|
|
|
|
for (uint16_t index = 0; index < data->GetDataCount(); index++) {
|
|
Point current;
|
|
data->GetPoint(index, current);
|
|
if (current.y == xStart.y) {
|
|
continue;
|
|
}
|
|
current.x += x;
|
|
xStart.x = current.x;
|
|
|
|
BaseGfxEngine::GetInstance()->DrawLine(gfxDstBuffer, current, xStart, invalidatedArea, barWidth,
|
|
data->GetFillColor(), style_->lineOpa_);
|
|
}
|
|
dataSerialIndex++;
|
|
}
|
|
}
|
|
|
|
private:
|
|
static constexpr float DEFAULT_MARK_PERCENTAGE = 0.1f;
|
|
VGUGradient gradient_ = {0};
|
|
bool isDrawGradient_ = false;
|
|
uint16_t capRadius_ = 0;
|
|
List<Path *> paths_;
|
|
};
|
|
|
|
UIViewGroup *TjdUiAppSleepView::SleepWeekDataViewInit(void)
|
|
{
|
|
if (sleepWeekDataView_ == nullptr) {
|
|
sleepWeekDataView_ = new UIViewGroup();
|
|
sleepWeekDataView_->SetPosition(0, 0, HORIZONTAL_RESOLUTION, VERTICAL_RESOLUTION);
|
|
sleepWeekDataView_->SetViewId(SLEEP_WEEKDATA_VIEW);
|
|
}
|
|
|
|
/*-----------------------------Add label1_ to App------------------------------*/
|
|
UILabelExt *label1_ = new UILabelExt();
|
|
label1_->SetPosition(134, 27, 197, 37);
|
|
label1_->SetViewId("label1_");
|
|
// label1_->SetText("本周睡眠数据");
|
|
label1_->SetTextId(STR_ID_122);
|
|
label1_->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
|
|
label1_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_TOP);
|
|
label1_->SetFont(TJD_VECTOR_FONT_FILENAME, 28);
|
|
sleepWeekDataView_->Add(label1_);
|
|
|
|
/*-----------------------------Add label1_ to App------------------------------*/
|
|
UILabel *label2_ = new UILabel();
|
|
label2_->SetPosition(0, 70, HORIZONTAL_RESOLUTION, 55);
|
|
label2_->SetViewId(SLEEP_AVERAGE_TIME);
|
|
label2_->SetText("-- H -- min");
|
|
label2_->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
|
|
label2_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_TOP);
|
|
label2_->SetFont(TJD_VECTOR_FONT_FILENAME, 50);
|
|
sleepWeekDataView_->Add(label2_);
|
|
|
|
/*-----------------------------Add image1_ to App------------------------------*/
|
|
// UICanvas *canvas = new UICanvas();
|
|
// canvas->SetPosition(0, 0, 466, 466);
|
|
// canvas->SetStyle(STYLE_BACKGROUND_OPA, 0);
|
|
// canvas->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
|
|
// sleepWeekDataView_->Add(canvas);
|
|
|
|
// Paint paint;
|
|
// paint.SetStrokeWidth(2);
|
|
// paint.SetStrokeColor(Color::GetColorFromRGBA(0x4D, 0x4D, 0x4D, 0xff));
|
|
// canvas->DrawLine({51, 356}, {51 + 364, 356}, paint);
|
|
|
|
// const int startX = 74;
|
|
// const int labelWidth = 38;
|
|
// const int intervalWidth = 9;
|
|
// UILabel *weeksLabel_[7];
|
|
// uint8_t wday = presenter_->GetSleepModel()->GetWeekDay();
|
|
// static_print_debug("wday:%d", wday);
|
|
|
|
// for (int i = 0; i < 7; i++) {
|
|
// weeksLabel_[i] = new UILabel();
|
|
// int x = startX + i * (intervalWidth + labelWidth);
|
|
// weeksLabel_[i]->SetPosition(x, 369, labelWidth, 25);
|
|
// const char *text = weeksText[(wday - (6 - i) + 7) % 7].c_str();
|
|
// weeksLabel_[i]->SetText(text);
|
|
// weeksLabel_[i]->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
|
|
// weeksLabel_[i]->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_TOP);
|
|
// weeksLabel_[i]->SetStyle(STYLE_TEXT_COLOR, 0xff696969);
|
|
// // weeksLabel_[i]->SetStyle(STYLE_BACKGROUND_COLOR, 0xffff0000);
|
|
// // weeksLabel_[i]->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
|
|
// weeksLabel_[i]->SetFont(TJD_VECTOR_FONT_FILENAME, 18);
|
|
// sleepWeekDataView_->Add(weeksLabel_[i]);
|
|
// }
|
|
UIImageView *imageChartTime_ = new UIImageView();
|
|
imageChartTime_->SetPosition(51, 356, 364, 33);
|
|
ImageInfo *imgInfo = ImageCacheManager::GetInstance().LoadOneInMultiRes(IMG_SLEEP_CHART_DATE, SLEEP_IMAGE_BIN_PATH);
|
|
if (imgInfo == nullptr) {
|
|
static_print_info("%s: load imageChartTime_ error", __func__);
|
|
}
|
|
imageChartTime_->SetSrc(imgInfo);
|
|
sleepWeekDataView_->Add(imageChartTime_);
|
|
|
|
/*-----------------------------Add image2_ to App------------------------------*/
|
|
UIImageView *image2_ = new UIImageView();
|
|
image2_->SetPosition(164, 131, 162, 203);
|
|
image2_->SetViewId("week_nodata");
|
|
imgInfo = ImageCacheManager::GetInstance().LoadOneInMultiRes(IMG_NO_DATA_NO_DATA, SLEEP_NO_DATA_BIN_PATH);
|
|
if (imgInfo == nullptr) {
|
|
static_print_info("%s: load image2_ error", __func__);
|
|
}
|
|
image2_->SetSrc(imgInfo);
|
|
sleepWeekDataView_->Add(image2_);
|
|
|
|
/*-----------------------------Add uiChart1_ to App------------------------------*/
|
|
TjdUIChartPillar *uiChartDeep_ = new TjdUIChartPillar();
|
|
uiChartDeep_->SetPosition(70, 136);
|
|
uiChartDeep_->Resize(332, 220);
|
|
uiChartDeep_->SetWidth(332);
|
|
uiChartDeep_->SetViewId(SLEEP_DEEP_CHART);
|
|
uiChartDeep_->SetStyle(STYLE_LINE_CAP, true);
|
|
uiChartDeep_->SetStyle(STYLE_BACKGROUND_OPA, 0);
|
|
|
|
// Set additional property
|
|
UIXAxis &uiChartDeepXAxis = uiChartDeep_->GetXAxis();
|
|
UIYAxis &uiChartDeepYAxis = uiChartDeep_->GetYAxis();
|
|
uiChartDeepXAxis.SetMarkNum(7);
|
|
uiChartDeepXAxis.SetDataRange(0, 7);
|
|
uiChartDeepXAxis.SetVisible(false);
|
|
uiChartDeepYAxis.SetMarkNum(4);
|
|
uiChartDeepYAxis.SetVisible(false);
|
|
|
|
uiChartDeepdata = new UIChartDataSerial();
|
|
uiChartDeepdata->SetMaxDataCount(7);
|
|
uiChartDeepdata->SetFillColor(Color::GetColorFromRGBA(0x6b, 0x2b, 0xff, 0xff));
|
|
uiChartDeep_->AddDataSerial(uiChartDeepdata);
|
|
sleepWeekDataView_->Add(uiChartDeep_);
|
|
uiChartDeep_->SetVisible(false);
|
|
|
|
/*-----------------------------Add uiChart1_ to App------------------------------*/
|
|
TjdUIChartPillar *uiChartLight_ = new TjdUIChartPillar();
|
|
uiChartLight_->SetPosition(70, 136);
|
|
uiChartLight_->Resize(332, 220);
|
|
uiChartLight_->SetWidth(332);
|
|
uiChartLight_->SetViewId(SLEEP_LIGHT_CHART);
|
|
uiChartLight_->SetStyle(STYLE_LINE_CAP, true);
|
|
uiChartLight_->SetStyle(STYLE_BACKGROUND_OPA, 0);
|
|
|
|
// Set additional property
|
|
UIXAxis &uiChartLightXAxis = uiChartLight_->GetXAxis();
|
|
UIYAxis &uiChartLightYAxis = uiChartLight_->GetYAxis();
|
|
uiChartLightXAxis.SetMarkNum(7);
|
|
uiChartLightXAxis.SetDataRange(0, 7);
|
|
uiChartLightXAxis.SetVisible(false);
|
|
uiChartLightYAxis.SetMarkNum(4);
|
|
uiChartLightYAxis.SetVisible(false);
|
|
|
|
uiChartLightdata = new UIChartDataSerial();
|
|
uiChartLightdata->SetMaxDataCount(7);
|
|
uiChartLightdata->SetFillColor(Color::GetColorFromRGBA(0x98, 0x6b, 0xff, 0xff));
|
|
uiChartLight_->AddDataSerial(uiChartLightdata);
|
|
sleepWeekDataView_->Add(uiChartLight_);
|
|
uiChartLight_->SetVisible(false);
|
|
|
|
/*-----------------------------Add uiChart1_ to App------------------------------*/
|
|
TjdUIChartPillar *uiChartWakeup_ = new TjdUIChartPillar();
|
|
uiChartWakeup_->SetPosition(70, 136);
|
|
uiChartWakeup_->Resize(332, 220);
|
|
uiChartWakeup_->SetWidth(332);
|
|
uiChartWakeup_->SetViewId(SLEEP_WAKEUP_CHART);
|
|
uiChartWakeup_->SetStyle(STYLE_LINE_CAP, true);
|
|
uiChartWakeup_->SetStyle(STYLE_BACKGROUND_OPA, 0);
|
|
|
|
// Set additional property
|
|
UIXAxis &uiChartWakeupXAxis = uiChartWakeup_->GetXAxis();
|
|
UIYAxis &uiChartWakeupYAxis = uiChartWakeup_->GetYAxis();
|
|
uiChartWakeupXAxis.SetMarkNum(7);
|
|
uiChartWakeupXAxis.SetDataRange(0, 7);
|
|
uiChartWakeupXAxis.SetVisible(false);
|
|
uiChartWakeupYAxis.SetMarkNum(4);
|
|
uiChartWakeupYAxis.SetVisible(false);
|
|
|
|
uiChartWakeupdata = new UIChartDataSerial();
|
|
uiChartWakeupdata->SetMaxDataCount(7);
|
|
uiChartWakeupdata->SetFillColor(Color::GetColorFromRGBA(0x9a, 0x47, 0xf6, 0xff));
|
|
uiChartWakeup_->AddDataSerial(uiChartWakeupdata);
|
|
sleepWeekDataView_->Add(uiChartWakeup_);
|
|
uiChartWakeup_->SetVisible(false);
|
|
|
|
/*-----------------------------Add uiChart1_ to App------------------------------*/
|
|
TjdUIChartPillar *uiChartBlink_ = new TjdUIChartPillar();
|
|
uiChartBlink_->SetPosition(70, 136);
|
|
uiChartBlink_->Resize(332, 220);
|
|
uiChartBlink_->SetWidth(332);
|
|
uiChartBlink_->SetViewId(SLEEP_BLINK_CHART);
|
|
uiChartBlink_->SetStyle(STYLE_LINE_CAP, true);
|
|
uiChartBlink_->SetStyle(STYLE_BACKGROUND_OPA, 0);
|
|
|
|
// Set additional property
|
|
UIXAxis &uiChartBlinkXAxis = uiChartBlink_->GetXAxis();
|
|
UIYAxis &uiChartBlinkYAxis = uiChartBlink_->GetYAxis();
|
|
uiChartBlinkXAxis.SetMarkNum(7);
|
|
uiChartBlinkXAxis.SetDataRange(0, 7);
|
|
uiChartBlinkXAxis.SetVisible(false);
|
|
uiChartBlinkYAxis.SetMarkNum(4);
|
|
uiChartBlinkYAxis.SetVisible(false);
|
|
|
|
uiChartBlinkdata = new UIChartDataSerial();
|
|
uiChartBlinkdata->SetMaxDataCount(7);
|
|
uiChartBlinkdata->SetFillColor(Color::GetColorFromRGBA(0xa6, 0x00, 0xff, 0xff));
|
|
uiChartBlink_->AddDataSerial(uiChartBlinkdata);
|
|
sleepWeekDataView_->Add(uiChartBlink_);
|
|
uiChartBlink_->SetVisible(false);
|
|
|
|
return sleepWeekDataView_;
|
|
}
|
|
|
|
void TjdUiAppSleepView::LoadImageRes(void)
|
|
{
|
|
ImageInfo *imgInfo;
|
|
printf("load image res = %d \n", sizeof(g_imageAnimator1Info) / sizeof(ImageAnimatorInfo));
|
|
for (int i = 0; i < sizeof(g_imageAnimator1Info) / sizeof(ImageAnimatorInfo); i++) {
|
|
imgInfo = ImageCacheManager::GetInstance().LoadOneInMultiRes(IMG_SLEEP_SLEEP_DT_01 + i, SLEEP_IMAGE_BIN_PATH);
|
|
g_imageAnimator1Info[i].imageInfo = imgInfo;
|
|
}
|
|
}
|
|
|
|
// 更新label数据
|
|
void TjdUiAppSleepView::UpdateData(SleepDataType type, const char *str)
|
|
{
|
|
if (type == TOTAL_TIME) {
|
|
UILabel *label =
|
|
static_cast<UILabel *>(swipeContainer_->GetChildById(SLEEP_HOME_VIEW)->GetChildById(SLEEP_TOTAL_TIME));
|
|
label->SetText(str);
|
|
|
|
UILabelExt *labelNodata =
|
|
static_cast<UILabelExt *>(swipeContainer_->GetChildById(SLEEP_HOME_VIEW)->GetChildById(SLEEP_NODATA_LABEL));
|
|
if (strncmp(str, "--", 2) != 0)
|
|
labelNodata->SetTextId(STR_ID_553);
|
|
else
|
|
labelNodata->SetTextId(STR_ID_554);
|
|
|
|
} else if (type == BLINK_TIME) {
|
|
UILabel *label =
|
|
static_cast<UILabel *>(swipeContainer_->GetChildById(SLEEP_DAYDATA_VIEW)->GetChildById(SLEEP_BLINK_TIME));
|
|
label->SetText(str);
|
|
} else if (type == WAKEUP_TIME) {
|
|
UILabel *label =
|
|
static_cast<UILabel *>(swipeContainer_->GetChildById(SLEEP_DAYDATA_VIEW)->GetChildById(SLEEP_WAKEUP_TIME));
|
|
label->SetText(str);
|
|
} else if (type == DEEP_TIME) {
|
|
UILabel *label =
|
|
static_cast<UILabel *>(swipeContainer_->GetChildById(SLEEP_DAYDATA_VIEW)->GetChildById(SLEEP_DEEP_TIME));
|
|
label->SetText(str);
|
|
} else if (type == LIGHT_TIME) {
|
|
UILabel *label =
|
|
static_cast<UILabel *>(swipeContainer_->GetChildById(SLEEP_DAYDATA_VIEW)->GetChildById(SLEEP_LIGHT_TIME));
|
|
label->SetText(str);
|
|
} else if (type == AVERAGE_TIME) {
|
|
UILabel *label = static_cast<UILabel *>(
|
|
swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById(SLEEP_AVERAGE_TIME));
|
|
label->SetText(str);
|
|
} else if (type == BLINK_PERSENT) {
|
|
UILabel *label = static_cast<UILabel *>(
|
|
swipeContainer_->GetChildById(SLEEP_DAYDATA_VIEW)->GetChildById(SLEEP_BLINK_PERSENT));
|
|
label->SetText(str);
|
|
} else if (type == WAKEUP_PERSENT) {
|
|
UILabel *label = static_cast<UILabel *>(
|
|
swipeContainer_->GetChildById(SLEEP_DAYDATA_VIEW)->GetChildById(SLEEP_WAKEUP_PERSENT));
|
|
label->SetText(str);
|
|
} else if (type == DEEP_PERSENT) {
|
|
UILabel *label =
|
|
static_cast<UILabel *>(swipeContainer_->GetChildById(SLEEP_DAYDATA_VIEW)->GetChildById(SLEEP_DEEP_PERSENT));
|
|
label->SetText(str);
|
|
} else if (type == LIGHT_PERSENT) {
|
|
UILabel *label = static_cast<UILabel *>(
|
|
swipeContainer_->GetChildById(SLEEP_DAYDATA_VIEW)->GetChildById(SLEEP_LIGHT_PERSENT));
|
|
label->SetText(str);
|
|
}
|
|
}
|
|
|
|
// 更新进度条
|
|
void TjdUiAppSleepView::UpdateData(SleepDataType type, uint32_t value)
|
|
{
|
|
if (type == DEEP_SLIDER) {
|
|
UISlider *slider =
|
|
static_cast<UISlider *>(swipeContainer_->GetChildById(SLEEP_DAYDATA_VIEW)->GetChildById(SLEEP_DEEP_SLIDER));
|
|
slider->SetValue(value);
|
|
slider->Invalidate();
|
|
} else if (type == LIGHT_SLIDER) {
|
|
UISlider *slider = static_cast<UISlider *>(
|
|
swipeContainer_->GetChildById(SLEEP_DAYDATA_VIEW)->GetChildById(SLEEP_LIGHT_SLIDER));
|
|
slider->SetValue(value);
|
|
slider->Invalidate();
|
|
} else if (type == BLINK_SLIDER) {
|
|
UISlider *slider = static_cast<UISlider *>(
|
|
swipeContainer_->GetChildById(SLEEP_DAYDATA_VIEW)->GetChildById(SLEEP_BLINK_SLIDER));
|
|
slider->SetValue(value);
|
|
slider->Invalidate();
|
|
} else if (type == WAKEUP_SLIDER) {
|
|
UISlider *slider = static_cast<UISlider *>(
|
|
swipeContainer_->GetChildById(SLEEP_DAYDATA_VIEW)->GetChildById(SLEEP_WAKEUP_SLIDER));
|
|
slider->SetValue(value);
|
|
slider->Invalidate();
|
|
}
|
|
}
|
|
|
|
// 更新chart
|
|
void TjdUiAppSleepView::UpdateData(SleepDataType type, uint16_t *array, uint16_t arrayMaxItem)
|
|
{
|
|
TjdUIChartPillar *chart;
|
|
Point PointArray[7];
|
|
|
|
for (int i = 0; i < 7; i++) {
|
|
if (i == 0) {
|
|
PointArray[6].x = 6;
|
|
PointArray[6].y = array[i];
|
|
} else {
|
|
PointArray[i - 1].x = i - 1;
|
|
PointArray[i - 1].y = array[i];
|
|
}
|
|
}
|
|
|
|
for (int i = 0; i < 7; i++) {
|
|
printf("PointArray[%d] = %d\n", i, PointArray[i].y);
|
|
}
|
|
|
|
if (arrayMaxItem == 0) {
|
|
ShowChart(false);
|
|
return;
|
|
} else {
|
|
ShowChart(true);
|
|
}
|
|
if (type == BLINK_CHART) {
|
|
chart = static_cast<TjdUIChartPillar *>(
|
|
swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById(SLEEP_BLINK_CHART));
|
|
|
|
if (chart == nullptr) {
|
|
static_print_error("[%s]GetChildById: %s fail", __func__, SLEEP_BLINK_CHART);
|
|
return;
|
|
}
|
|
UIYAxis &uiChartYAxis = chart->GetYAxis();
|
|
uiChartYAxis.SetDataRange(0, arrayMaxItem);
|
|
|
|
uiChartBlinkdata->AddPoints(PointArray, 7);
|
|
chart->RefreshChart();
|
|
} else if (type == WAKEUP_CHART) {
|
|
chart = static_cast<TjdUIChartPillar *>(
|
|
swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById(SLEEP_WAKEUP_CHART));
|
|
|
|
if (chart == nullptr) {
|
|
static_print_error("[%s]GetChildById: %s fail", __func__, SLEEP_WAKEUP_CHART);
|
|
return;
|
|
}
|
|
UIYAxis &uiChartYAxis = chart->GetYAxis();
|
|
uiChartYAxis.SetDataRange(0, arrayMaxItem);
|
|
|
|
uiChartWakeupdata->AddPoints(PointArray, 7);
|
|
chart->RefreshChart();
|
|
} else if (type == DEEP_CHART) {
|
|
chart = static_cast<TjdUIChartPillar *>(
|
|
swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById(SLEEP_DEEP_CHART));
|
|
|
|
if (chart == nullptr) {
|
|
static_print_error("[%s]GetChildById: %s fail", __func__, SLEEP_DEEP_CHART);
|
|
return;
|
|
}
|
|
UIYAxis &uiChartYAxis = chart->GetYAxis();
|
|
uiChartYAxis.SetDataRange(0, arrayMaxItem);
|
|
|
|
uiChartDeepdata->AddPoints(PointArray, 7);
|
|
chart->RefreshChart();
|
|
} else if (type == LIGHT_CHART) {
|
|
chart = static_cast<TjdUIChartPillar *>(
|
|
swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById(SLEEP_LIGHT_CHART));
|
|
|
|
if (chart == nullptr) {
|
|
static_print_error("[%s]GetChildById: %s fail", __func__, SLEEP_LIGHT_CHART);
|
|
return;
|
|
}
|
|
UIYAxis &uiChartYAxis = chart->GetYAxis();
|
|
uiChartYAxis.SetDataRange(0, arrayMaxItem);
|
|
|
|
uiChartLightdata->AddPoints(PointArray, 7);
|
|
chart->RefreshChart();
|
|
}
|
|
}
|
|
|
|
void TjdUiAppSleepView::ShowChart(bool ret)
|
|
{
|
|
if (swipeContainer_ == nullptr) {
|
|
static_print_error("[%s]swipeContainer_ is nullptr ", __func__);
|
|
return;
|
|
}
|
|
TjdUIChartPillar *chart = nullptr;
|
|
UIImageView *image = nullptr;
|
|
if (ret == true) {
|
|
image =
|
|
static_cast<UIImageView *>(swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById("week_nodata"));
|
|
if (image != nullptr)
|
|
image->SetVisible(false);
|
|
else
|
|
static_print_error("[%s]GetChildById:week_nodata fail", __func__);
|
|
|
|
chart = static_cast<TjdUIChartPillar *>(
|
|
swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById(SLEEP_BLINK_CHART));
|
|
if (chart != nullptr)
|
|
chart->SetVisible(true);
|
|
else
|
|
static_print_error("[%s]GetChildById:%s fail", __func__, SLEEP_BLINK_CHART);
|
|
|
|
chart = nullptr;
|
|
chart = static_cast<TjdUIChartPillar *>(
|
|
swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById(SLEEP_WAKEUP_CHART));
|
|
if (chart != nullptr)
|
|
chart->SetVisible(true);
|
|
else
|
|
static_print_error("[%s]GetChildById:%s fail", __func__, SLEEP_WAKEUP_CHART);
|
|
|
|
chart = nullptr;
|
|
chart = static_cast<TjdUIChartPillar *>(
|
|
swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById(SLEEP_DEEP_CHART));
|
|
if (chart != nullptr)
|
|
chart->SetVisible(true);
|
|
else
|
|
static_print_error("[%s]GetChildById:%s fail", __func__, SLEEP_DEEP_CHART);
|
|
|
|
chart = nullptr;
|
|
chart = static_cast<TjdUIChartPillar *>(
|
|
swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById(SLEEP_LIGHT_CHART));
|
|
if (chart != nullptr)
|
|
chart->SetVisible(true);
|
|
else
|
|
static_print_error("[%s]GetChildById:%s fail", __func__, SLEEP_LIGHT_CHART);
|
|
} else {
|
|
image =
|
|
static_cast<UIImageView *>(swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById("week_nodata"));
|
|
if (image != nullptr)
|
|
image->SetVisible(true);
|
|
else
|
|
static_print_error("[%s]GetChildById:week_nodata fail", __func__);
|
|
|
|
chart = static_cast<TjdUIChartPillar *>(
|
|
swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById(SLEEP_BLINK_CHART));
|
|
if (chart != nullptr)
|
|
chart->SetVisible(false);
|
|
else
|
|
static_print_error("[%s]GetChildById:%s fail", __func__, SLEEP_BLINK_CHART);
|
|
|
|
chart = nullptr;
|
|
chart = static_cast<TjdUIChartPillar *>(
|
|
swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById(SLEEP_WAKEUP_CHART));
|
|
if (chart != nullptr)
|
|
chart->SetVisible(false);
|
|
else
|
|
static_print_error("[%s]GetChildById:%s fail", __func__, SLEEP_WAKEUP_CHART);
|
|
|
|
chart = nullptr;
|
|
chart = static_cast<TjdUIChartPillar *>(
|
|
swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById(SLEEP_DEEP_CHART));
|
|
if (chart != nullptr)
|
|
chart->SetVisible(false);
|
|
else
|
|
static_print_error("[%s]GetChildById:%s fail", __func__, SLEEP_DEEP_CHART);
|
|
chart = nullptr;
|
|
chart = static_cast<TjdUIChartPillar *>(
|
|
swipeContainer_->GetChildById(SLEEP_WEEKDATA_VIEW)->GetChildById(SLEEP_LIGHT_CHART));
|
|
if (chart != nullptr)
|
|
chart->SetVisible(false);
|
|
else
|
|
static_print_error("[%s]GetChildById:%s fail", __func__, SLEEP_LIGHT_CHART);
|
|
}
|
|
}
|
|
|
|
} // namespace TJD
|