UIScrollView *testoldInitIView(void);
void ClearAll(void);
+ void setbuf(char *buf);
void set_data();
- UILabel *x{nullptr};
+
void setlightvalue(int ,int ,int);
private:
bool testoldScrollViewcrollViewinit(void);
UILabel *InitLabel(LabelConfig &labelConfig);
- UIScrollView *testoldScrollView{nullptr};
- bool initViewStatus{false};
- UILabel *title{nullptr};
- // UILabel *x{nullptr};
- UILabel *y{nullptr};
- UILabel *z{nullptr};
-
- UILabelButtonExt* labelButton_next = nullptr;
};
}
#endif
\ No newline at end of file
namespace OHOS
{
- static testAboutView *g_pSystemAboutTheWatchView{nullptr};
+ static testAboutView g_pSystemAboutTheWatchView;
testAboutView::testAboutView()
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::SystemAboutTheWatchView");
- g_pSystemAboutTheWatchView = this;
+ //g_pSystemAboutTheWatchView = this;
}
testAboutView::~testAboutView()
testAboutView *testAboutView::GetInstance()
{
- return g_pSystemAboutTheWatchView;
+ return &g_pSystemAboutTheWatchView;
}
void testAboutView::ClearAll()
//#include "acc_service.h"
namespace OHOS
{
+ static UILabel *x{nullptr};
static uint8 AGING_task_falg=0;
+ UIScrollView *testoldScrollView{nullptr};
+ bool initViewStatus{false};
+ UILabel *title{nullptr};
+ // UILabel *x{nullptr};
+ UILabel *y{nullptr};
+ UILabel *z{nullptr};
+ UILabelButtonExt* labelButton_next = nullptr;
+
static void AGING_task(void *arg)
{
- while (AGING_task_falg==1)
+ while (AGING_task_falg)
{
msleep(1000);
// uapi_tcxo_delay_ms(3000);
uint16_t angle_value= (int16_t)mag_service_get_fAzimuth();
char buf[16]={0};
sprintf(buf,"angle:%d",angle_value);
- if( testoldView::GetInstance()->x && AGING_task_falg)
+ if( AGING_task_falg && testoldView::GetInstance())
{
- testoldView::GetInstance()->x->SetText(buf);
+ testoldView::GetInstance()->setbuf(buf);
RootView::GetInstance()->Invalidate();
msleep(1000);
}
uint16 y_t=t.y;
uint16 z_t=t.z;
sprintf(buf,"gsensor:\nX:%d\nY:%d\nZ:%d",x_t,y_t,z_t);
- if(testoldView::GetInstance()->x && AGING_task_falg)
+ if(AGING_task_falg && testoldView::GetInstance())
{
- testoldView::GetInstance()->x->SetText(buf);
+ testoldView::GetInstance()->setbuf(buf);
RootView::GetInstance()->Invalidate();
msleep(1000);
}
return ERRCODE_SUCC;
}
- static testoldView *g_pSystemAboutTheWatchView{nullptr};
+
void testoldView:: setlightvalue(int g,int r,int ir)
{
int8_t md = PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST;
send_ppg_cmd_msg(md);
}
-
}
testoldView::testoldView()
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::SystemAboutTheWatchView");
- g_pSystemAboutTheWatchView = this;
+
}
testoldView::~testoldView()
testoldView *testoldView::GetInstance()
{
-
- return g_pSystemAboutTheWatchView;
+ static testoldView g_testoldView;
+
+ return &g_testoldView;
}
void testoldView::ClearAll()
{
delete testoldScrollView;
testoldScrollView=nullptr;
}
- g_pSystemAboutTheWatchView=nullptr;
}
+ void testoldView::setbuf(char *buf)
+ {
+ if(x)
+ x->SetText(buf);
+ }
UILabel *testoldView::InitLabel(LabelConfig &labelConfig)
testoldScrollView->SetReboundSize(0);
testoldScrollView->SetDirection(1);
}
- //UIView::OnDragListener *draglistener = static_cast<UIView::OnDragListener *>(SystemPresenter::GetInstance());
- // if (draglistener == nullptr)
- // {
- // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::draglistener can not be nullptr!");
- // return false;
- // }
- // testoldScrollView->SetOnDragListener(draglistener);
+
LabelConfig Config = {
- .left = 203,
+ .left = 142,
.top = 52,
.width = 60,
.height = 35,