${CMAKE_CURRENT_SOURCE_DIR}/nativeui/producttest/src/testgsenson.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nativeui/producttest/src/testold.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nativeui/producttest/src/testbt.cpp
-
+ ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/producttest/src/testSEChipTest.cpp
+
#每日目标
${CMAKE_CURRENT_SOURCE_DIR}/nativeui/goal/src/goalmodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/nativeui/goal/src/goalview.cpp
{\r
callerid = value;\r
}\r
+static bool Productfalg=false;\r
+\r
+// void BluetoothModel::SetProductfalg(bool falg)\r
+// {\r
+// callerid = value;\r
+// }\r
\r
int BluetoothModel::GetBluetoothCalleridStatus(void)\r
{\r
for (auto it = btScansDevicesList_.begin(); it != btScansDevicesList_.end(); it++) {\r
if ((it->addr[0] == bdAddr->addr[0]) && (it->addr[1] == bdAddr->addr[1])\r
&& (it->addr[2] == bdAddr->addr[2]) && (it->addr[3] == bdAddr->addr[3])\r
- && (it->addr[4] == bdAddr->addr[4]) && (it->addr[5] == bdAddr->addr[5])) {\r
+ && (it->addr[4] == bdAddr->addr[4]) && (it->addr[5] == bdAddr->addr[5])) \r
+ {\r
it->temp = rssi;\r
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "btScansDevicesList_ rssi:%d deviceName:%s", it->temp, it->deviceName);\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "btScansDevicesList_ rssi:%d deviceName:%s", it->temp, it->deviceName);\r
}\r
}\r
}\r
void BtGapReadRemoteRssiEventCallback(const bd_addr_t *bdAddr, int rssi, int status)\r
{\r
UNUSED(status);\r
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BtGapReadRemoteRssiEventCallback addr: %02x%02x%02x%02x%02x%02x",\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "BtGapReadRemoteRssiEventCallback addr: %02x%02x%02x%02x%02x%02x",\r
bdAddr->addr[5], bdAddr->addr[4], bdAddr->addr[3], /* mac下标 0 1 2 3 4 5 */\r
bdAddr->addr[2], bdAddr->addr[1], bdAddr->addr[0]); /* mac下标 0 1 2 3 4 5 */\r
BluetoothModel::GetInstance()->SetScansCaseRssi(bdAddr, rssi);\r
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "bt BtGapReadRemoteRssiEventCallback SetSortCaseRssi: %d status: %d", rssi, status);\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bt BtGapReadRemoteRssiEventCallback SetSortCaseRssi: %d status: %d", rssi, status);\r
}\r
\r
// 回调:发现状态变化上报/扫描结束\r
void BtGapDiscoveryStateChangedCallback(int status)\r
{\r
UNUSED(status);\r
- WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "bt BtGapDiscoveryStateChangedCallback %d", status);\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bt BtGapDiscoveryStateChangedCallback %d", status);\r
}\r
\r
static void ChangeScanView()\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "gap_discovery_result_callback getNameRet(bool): %d nameLen: %d name:%s",\r
getNameRet, nameLen, caseInfo.deviceName);\r
\r
+\r
if (nameLen == 0) { // 过滤未扫描到名字的设备\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "nameLen == 0 return");\r
return;\r
}\r
bool ret = gap_read_remote_rssi_value(&bdAddr); // 获取rssi\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "gap_read_remote_rssi_value ret = %d", ret);\r
+\r
BluetoothEarPhoneView *bluetoothEarPhoneView = BluetoothEarPhoneView::GetInstance();\r
if (bluetoothEarPhoneView == nullptr) {\r
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bluetoothEarPhoneView nullptr");\r
goalstepLabel->SetText(GoalModel::GetInstance().getstepGoal());
circleProgress1_->SetValue(GoalModel::GetInstance().getstepvalue());
+ Invalidate();
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "GoalViewrefresh Invalidat ");
RootView::GetInstance()->Invalidate();
}
HRSENSON,\r
GSENSON,\r
BTTEST,\r
+ SEChipTest,\r
OLDTEST,\r
DEEPSLEEP,\r
shutdown,\r
TEST_1,\r
\r
-\r
MAX_TESTVIEWID,\r
} TEST_VIEW;\r
\r
public UIView::OnClickListener,\r
public UIView::OnDragListener,\r
public UIView::OnTouchListener,\r
- public RootView::OnKeyActListener\r
+ public RootView::OnKeyActListener,\r
+ public UIView::OnRotateListener\r
\r
{\r
public:\r
bool OnDragEnd(UIView &view, const DragEvent &event) override;\r
bool OnPress(UIView &view, const PressEvent &event);\r
bool OnKeyAct(UIView &view, const KeyEvent &event);\r
+ bool OnRotate(UIView& view, const RotateEvent& event);\r
+ bool OnRotateEnd(UIView& view, const RotateEvent& event);\r
//bool OnChange(int) override;\r
private:\r
testModel *systemModel;\r
--- /dev/null
+#ifndef TEST_SECCHIP_VIEW_H
+#define TEST_SECCHIP_VIEW_H
+
+#include "BaseView.h"
+#include "View.h"
+#include "components/ui_scroll_view.h"
+#include "components/ui_label.h"
+#include "components/ui_label_ext.h"
+#include "components/ui_image_view.h"
+#include "producttest/include/testabout.h"
+#include "components/ui_label_button_ext.h"
+#include <iostream>
+namespace OHOS
+{
+ class testSEChipView
+ {
+
+ public:
+ testSEChipView();
+ virtual ~testSEChipView();
+ static testSEChipView *GetInstance(void);
+ struct LabelConfig
+ {
+ int16_t left;
+ int16_t top;
+ int16_t width;
+ int16_t height;
+ int16_t fontSize; // 字体大小
+ int16_t lineHeigh; // 行高
+ std::string text; // 文本
+ uint8_t lineBreakMode; // 断行模式。
+ };
+ UIScrollView *SEChipInitIView(void);
+ void ClearAll(void);
+ UILabel *InitLabel(LabelConfig &labelConfig);
+
+
+ private:
+ UIScrollView *testSEChipScrollView{nullptr};
+
+ bool SEChipInitIview(void);
+
+ UILabel *chipinfo_label{nullptr};
+
+ UILabel *IIC_label{nullptr};
+
+ UILabelButtonExt* labelButton_next = nullptr;
+ UILabel *Title{nullptr}; // 标题
+
+ bool initViewStatus{false};
+ };
+}
+#endif
\ No newline at end of file
#include "producttest/include/testhrsenson.h" \r
#include "producttest/include/testgsenson.h"\r
#include "producttest/include/testold.h"\r
-\r
#include "producttest/include/testbt.h"\r
+#include "producttest/include/testSEChipTest.h"\r
\r
namespace OHOS\r
{\r
bool ChangeCAT1TESTView(int16_t thisView);\r
bool ChangeGTESTView(int16_t thisView);\r
bool ChangeoldTESTView(int16_t thisView);\r
-\r
bool ChangeBTTESTView(int16_t thisView);\r
+ bool ChangeSEChipTESTView(int16_t thisView);\r
\r
bool ClickFunc(int16_t interface);\r
void ChangeView(int16_t hideView, int16_t showView);\r
testoldView *test_old_view{nullptr};\r
testBTView *test_BT_view{nullptr};\r
\r
+ testSEChipView *test_SEChip_view{nullptr};\r
+\r
UILabelButtonExt *button[20]={NULL};\r
bool initViewStatus{false};\r
};\r
int Fontsize;
};
-
-
struct LabelConfig
{
UILabelButtonExt* labelButton_next = nullptr;
UILabel *label_BR_SCAN[5]{nullptr};
-
+
bool initViewStatus{false};
UILabel *Title{nullptr}; // 标题
virtual ~testbuttonView();
static testbuttonView *GetInstance(void);
void Changbutton(int,bool);
+ void Changbutton(bool);
+ void Changbutton(int16_t);
+
UIScrollView *testBUTTONInitIView(void);
void ClearAll(void);
bool testBUTTONScrollViewcrollViewinit(void);
UIScrollView *testBUTTONScrollView{nullptr};
UILabelButtonExt* labelButton_next = nullptr;
- UILabelButtonExt* button[2]{NULL};
+ UILabelButtonExt* button[3]{nullptr};
+ UILabel *label_crown{nullptr};
UILabel *Title{nullptr}; // 标题
bool initViewStatus{false};
};
{BUTTON,"buttonbutton", "microphonebutton_next",true},\r
{MICROPHONE,"microphonebutton", "hrsensonbutton_next",true},\r
{HRSENSON,"hrsensonbutton", "gsensonbutton_next",true},\r
- {GSENSON,"gsensonbutton","xxxx" ,true},\r
- {BTTEST,"BTbutton","xxxx",true},\r
+ {GSENSON,"gsensonbutton","BTbutton_next" ,true},\r
+ {BTTEST,"BTbutton","SEChipTestbutton_next",true},\r
+ {SEChipTest,"SEChipTestbutton","xxxx" ,true},\r
+\r
{OLDTEST,"oldtestbutton","oldtestexit",true},\r
{DEEPSLEEP,"deepsleep","xxxxxxxxx",true},\r
{shutdown,"shutdown","xxxxxxxxx",true},\r
if(strcmp(view.GetViewId(),"xxxx") == 0) \r
{ \r
//testSPEAKView::GetInstance()->Changspeak(true);\r
- testView::GetInstance()->ChangeView(GSENSON,TESTVIEW);\r
+ testView::GetInstance()->ChangeView(SEChipTest,TESTVIEW);\r
return true;\r
}\r
\r
return true;\r
}\r
\r
+ bool testPresenter::OnRotate(UIView &view, const RotateEvent &event)\r
+ {\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "testPresenter::OnRotate %d",event.GetRotate());\r
+ testbuttonView::GetInstance()->Changbutton(event.GetRotate());\r
+ \r
+ testbuttonView::GetInstance()->Changbutton(true);\r
+ return true;\r
+ }\r
+\r
+ bool testPresenter::OnRotateEnd(UIView &view, const RotateEvent &event)\r
+ {\r
+ UNUSED(view);\r
+ UNUSED(event);\r
+ testbuttonView::GetInstance()->Changbutton(false);\r
+ return true;\r
+ }\r
+\r
// 该拖拽是用来处理系统视图(slice)的左滑退出事件和子视图的左滑退出到系统视图区分开\r
\r
\r
--- /dev/null
+#include "wearable_log.h"
+#include "custom_utils.h"
+#include "producttest/include/testPresenter.h"
+#include "producttest/include/testSEChipTest.h"
+#include "ConfigModel.h"
+
+
+namespace OHOS
+{
+
+ static testSEChipView g_pSystemAboutTheWatchView;
+
+ testSEChipView::testSEChipView()
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::SystemAboutTheWatchView");
+ //g_pSystemAboutTheWatchView = this;
+ }
+
+ testSEChipView::~testSEChipView()
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::~SystemAboutTheWatchView");
+ ClearAll();
+ //g_pSystemAboutTheWatchView = nullptr;
+ }
+
+ testSEChipView *testSEChipView::GetInstance()
+ {
+
+ return &g_pSystemAboutTheWatchView;
+ }
+
+ void testSEChipView::ClearAll()
+ {
+
+ }
+
+ UILabel *testSEChipView::InitLabel(LabelConfig &labelConfig)
+ {
+ UILabel *label = new UILabel();
+ if (label == nullptr)
+ {
+ return nullptr;
+ }
+ label->SetPosition(labelConfig.left, labelConfig.top, labelConfig.width, labelConfig.height); // 位置大小
+ label->SetStyle(STYLE_TEXT_FONT, labelConfig.fontSize); // 字体大小
+ label->SetStyle(STYLE_LINE_HEIGHT, labelConfig.lineHeigh); // 字体行高
+ label->SetText(labelConfig.text.c_str()); // 内容
+ label->SetLineBreakMode(labelConfig.lineBreakMode); // 断行模式。
+ label->SetAlign(TEXT_ALIGNMENT_LEFT, TEXT_ALIGNMENT_TOP);
+ label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelConfig.fontSize);
+ return label;
+ }
+
+ bool testSEChipView::SEChipInitIview(void)
+ {
+ testSEChipScrollView = new UIScrollView();
+ if (testSEChipScrollView == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::testSEChipScrollView new fail!");
+ return false;
+ }
+ testSEChipScrollView->SetPosition(0, 0, Screen::GetInstance().GetWidth(), Screen::GetInstance().GetHeight());
+ testSEChipScrollView->SetStyle(STYLE_BACKGROUND_OPA, 0xff);
+ testSEChipScrollView->SetStyle(STYLE_BORDER_RADIUS, 1294);
+ testSEChipScrollView->SetScrollBlankSize(0);
+ testSEChipScrollView->SetReboundSize(0);
+ testSEChipScrollView->SetDirection(1);
+ UIView::OnDragListener *draglistener = static_cast<UIView::OnDragListener *>(testPresenter::GetInstance());
+ if (draglistener == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::draglistener can not be nullptr!");
+ return false;
+ }
+ testSEChipScrollView->SetOnDragListener(draglistener);
+ testSEChipScrollView->SetTouchable(true);
+
+ testSEChipScrollView->SetDraggable(true);
+ return true;
+ }
+
+ UIScrollView *testSEChipView::SEChipInitIView()
+ {
+ if (!SEChipInitIview())
+ {
+ return nullptr;
+ }
+
+ char chipinfo[64] = {0};
+ uapi_cywee_get_chipinfo(chipinfo,sizeof(chipinfo));
+
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s ",chipinfo);
+
+ /* -------------------------------------------------------------------------- */
+ char buf[128]={0};
+
+ sprintf_s(buf,128,"chipinfo:%s\n",chipinfo);
+ LabelConfig Config = {
+ .left = 33,
+ .top = 150,
+ .width = 380,
+ .height = 44,
+ .fontSize = 30,
+ .lineHeigh = 0,
+ .text = buf,
+ .lineBreakMode = UILabel::LINE_BREAK_WRAP,
+ };
+ chipinfo_label = InitLabel(Config);
+ if (chipinfo_label == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::IMELTitle new fail!");
+ return nullptr;
+ }
+ testSEChipScrollView->Add(chipinfo_label);
+
+ if(custom_i2c_test()==ERRCODE_SUCC)
+ {
+ sprintf_s(buf,128,"IIC true\n");
+ }
+ else
+ {
+ sprintf_s(buf,128,"IIC false\n");
+ }
+
+ Config = {
+ .left = 33,
+ .top = 250,
+ .width = 380,
+ .height = 44,
+ .fontSize = 30,
+ .lineHeigh = 0,
+ .text = buf,
+ .lineBreakMode = UILabel::LINE_BREAK_WRAP,
+ };
+ IIC_label = InitLabel(Config);
+ if (IIC_label == nullptr)
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemAboutTheWatchView::IMELTitle new fail!");
+ return nullptr;
+ }
+ testSEChipScrollView->Add(IIC_label);
+
+
+
+ labelButton_next= testAboutView::GetInstance()->init_button_next(267,300,"xxxx");
+ testSEChipScrollView->Add(labelButton_next);
+
+ Title= testAboutView::GetInstance()->init_title(142,40,"SEChip_TEST");
+ testSEChipScrollView->Add(Title);
+ /* -------------------------------------------------------------------------- */
+
+ return testSEChipScrollView;
+ }
+}
\ No newline at end of file
{MICROPHONE,"microphonebutton","microphone" ,&testView::ChangeMPTESTView},\r
{HRSENSON,"hrsensonbutton","hrsensor" ,&testView::ChangeHRTESTView},\r
{GSENSON,"gsensonbutton","gsensor" ,&testView::ChangeGTESTView},\r
+ {BTTEST,"BTbutton","BR" ,&testView::ChangeBTTESTView},\r
+\r
+ {SEChipTest,"SEChipTestbutton","SEChipTest" ,&testView::ChangeSEChipTESTView},\r
\r
- {BTTEST,"BTbutton","BT" ,&testView::ChangeBTTESTView},\r
\r
{OLDTEST,"oldtestbutton","aging" ,&testView::ChangeoldTESTView},\r
{DEEPSLEEP,"deepsleep","CloseBTCat1&Sleep" ,&testView::ChangeoldTESTView},\r
return true;\r
}\r
\r
- bool testView::ChangeBTTESTView(int16_t thisView)\r
+ bool testView::ChangeBTTESTView(int16_t thisView)\r
{\r
if (SystemScrollView[thisView] == nullptr)\r
{\r
return true;\r
}\r
\r
+ \r
+ bool testView::ChangeSEChipTESTView(int16_t thisView)\r
+ {\r
+ if (SystemScrollView[thisView] == nullptr)\r
+ {\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::ChangeSystemAboutView");\r
+ test_SEChip_view = new testSEChipView();\r
+ if (test_SEChip_view == nullptr)\r
+ {\r
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
+ return false;\r
+ }\r
+ SystemScrollView[thisView] = test_SEChip_view->SEChipInitIView();\r
+ RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
+ }\r
+ return true;\r
+ }\r
+\r
+\r
+\r
UIScrollView *testView::GetSystemScrollView(int ViewId)\r
{\r
if (SystemScrollView[ViewId] == nullptr)\r
test_BT_view = nullptr;\r
SystemScrollView[hideView]=nullptr;\r
break;\r
-\r
+ case SEChipTest:\r
+ RootView::GetInstance()->Remove(SystemScrollView[hideView]);\r
+ delete test_SEChip_view; \r
+ test_SEChip_view = nullptr;\r
+ SystemScrollView[hideView]=nullptr;\r
+ break;\r
+ \r
default:\r
break;\r
}\r
{ \r
display_api->turn_on_screen(); \r
} \r
- display_api->set_screen_set_keepon_timeout(-1);\r
+ display_api->set_auto_timeout_function(false);\r
}\r
\r
void testView::OnSetUpView()\r
#include "bts_le_gap.h"
#include "bleService.h"
#include "BluetoothModel.h"
+#ifdef __cplusplus
+#if __cplusplus
+extern "C"
+{
+#endif
+#endif
+ #include "pm_veto.h"
+ #include "pm.h"
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+
+
namespace OHOS
{
}
}
+ uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST);
+ if (cnt == 1) {
+ uapi_pm_remove_sleep_veto(PM_ID_P_TEST);
+ } else {
+ // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n");
+ }
+
+
delete testBTScrollView;
testBTScrollView=nullptr;
}
RootView::GetInstance()->Invalidate();
return true;
}
-
+// void uapi_cat1_remove_cat1_vote(void)
+// {
+// uint8_t cnt = pm_veto_get_id_cnt(PM_ID_CAT1);
+// if (cnt == 1) {
+// uapi_pm_remove_sleep_veto(PM_ID_CAT1);
+// } else {
+// // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has delete pm_id_cat1 vote\r\n");
+// }
+// // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"\r\nCAT1 SERVICE MCU SLEEP SUCCESS\r\n");
+// }
+// void uapi_cat1_add_cat1_vote(void)
+// {
+// uint8_t cnt = pm_veto_get_id_cnt(PM_ID_CAT1);
+// if (cnt == 0) {
+// uapi_pm_add_sleep_veto(PM_ID_CAT1);
+// } else {
+// // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n");
+// }
+// // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"\r\nCAT1 SERVICE MCU WAKEUP SUCCESS\r\n");
+// }
bool testBTView::testBTScrollViewcrollViewinit(void)
{
.width = 400,
.height = 44,
.fontSize = 30,
- .lineHeigh = 35,
+ .lineHeigh = 0,
.text = "",
.lineBreakMode = UILabel::LINE_BREAK_WRAP,
};
for(int i=0 ;i<5;i++)
{
- Config.top+=120;
+ Config.top+=180;
label_BR_SCAN[i]= InitLabel(Config);
testBTScrollView->Add(label_BR_SCAN[i]);
}
- labelButton_next= testAboutView::GetInstance()->init_button_next(270,80,"buttonbutton_next");
+ labelButton_next= testAboutView::GetInstance()->init_button_next(270,80,"SEChipTestbutton_next");
testBTScrollView->Add(labelButton_next);
Title= testAboutView::GetInstance()->init_title(165,45,"BT_TEST");
BR_TEST_timer = NULL;
return false;
}
+
+ discovery_falg=false;
+ uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST);
+ if (cnt == 0) {
+ uapi_pm_add_sleep_veto(PM_ID_P_TEST);
+ } else {
+ // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n");
+ }
+
+
+
+
return true;
}
if(testBUTTONScrollView)
{
testBUTTONScrollView->RemoveAll();
+ testBUTTONScrollView->ClearFocus();
if(button[0])
{
delete button[1];
button[1]=nullptr;
}
+ if(button[2])
+ {
+ delete button[2];
+ button[2]=nullptr;
+ }
if(labelButton_next)
{
if(falg==true)
{
button[0]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
- button[0]->SetText("UP_KEY::press");
+ button[0]->SetText("UP_KEY::\npress");
}
else
{
button[0]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Blue().full);
- button[0]->SetText("UP_KEY::raise");
+ button[0]->SetText("UP_KEY::\nraise");
}
if(falg==true)
{
button[1]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
- button[1]->SetText("UP_KEY::press");
+ button[1]->SetText("DOWN_KEY::\npress");
}
else
{
button[1]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Blue().full);
- button[1]->SetText("UP_KEY::raise");
+ button[1]->SetText("DOWN_KEY::\nraise");
}
}
}
+
+ void testbuttonView::Changbutton(bool falg)
+ {
+ if(falg)
+ {
+ button[2]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Red().full);
+ button[2]->SetText("crown::spin");
+
+ }
+ else
+ {
+ button[2]->SetStyle(STYLE_BACKGROUND_COLOR, Color::Blue().full);
+ button[2]->SetText("crown::raise");
+ }
+ RootView::GetInstance()->Invalidate();
+
+ }
+
+ void testbuttonView::Changbutton(int16_t falg)
+ {
+ char buf[8]={0};
+ sprintf(buf,"%d",falg);
+
+ label_crown->SetText(buf);
+
+ RootView::GetInstance()->Invalidate();
+
+ }
+
+
bool testbuttonView::testBUTTONScrollViewcrollViewinit(void)
testBUTTONScrollView->SetStyle(STYLE_BORDER_RADIUS, 0);
testBUTTONScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
testBUTTONScrollView->SetStyle(STYLE_BORDER_COLOR, Color::Yellow().blue);
-
+
+ /* -------------------------------------------------------------------------- */
+
+ if (label_crown == nullptr) {
+ label_crown = new UILabel();
+ }
+ label_crown->SetPosition(321, 98); // widget's left position and top position
+ label_crown->Resize(200, 60); // widget's width and height
+ label_crown->SetViewId("label3");// Set style
+ label_crown->SetStyle(STYLE_TEXT_FONT, 50);
+
+ // Set additional property
+ label_crown->SetText("0");
+ label_crown->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+ label_crown->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+ label_crown->SetRollSpeed(0);
+ label_crown->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 50);
+ testBUTTONScrollView->Add(label_crown);
/* -------------------------------------------------------------------------- */
ButtonConfig_ext_t buttonconfig;
- buttonconfig.x = 100;
+ buttonconfig.x = 80;
buttonconfig.y = 100;
- buttonconfig.w = 250;
- buttonconfig.h = 116;
+ buttonconfig.w = 200;
+ buttonconfig.h = 80;
buttonconfig.label_x=40;
buttonconfig.label_y=0;
- buttonconfig.Fontsize=30;
+ buttonconfig.Fontsize=25;
buttonconfig.ViewId="UP_KEY::";
buttonconfig.str="UP_KEY";
buttonconfig.ALIGN=TEXT_ALIGNMENT_LEFT;
button[0]=SetTheButton_ext(buttonconfig);
testBUTTONScrollView->Add(button[0]);
- buttonconfig.x = 100;
- buttonconfig.y = 300;
- buttonconfig.w = 250;
- buttonconfig.h = 116;
+ buttonconfig.x = 80;
+ buttonconfig.y = 200;
+ buttonconfig.w = 200;
+ buttonconfig.h = 80;
buttonconfig.label_x=40;
buttonconfig.label_y=0;
- buttonconfig.Fontsize=30;
+ buttonconfig.Fontsize=25;
buttonconfig.ViewId="DOWN_KEY::";
buttonconfig.str="DOWN_KEY";
buttonconfig.ALIGN=TEXT_ALIGNMENT_LEFT;
button[1]=SetTheButton_ext(buttonconfig);
testBUTTONScrollView->Add(button[1]);
+ buttonconfig.x = 80;
+ buttonconfig.y = 300;
+ buttonconfig.w = 200;
+ buttonconfig.h = 80;
+ buttonconfig.label_x=40;
+ buttonconfig.label_y=0;
+ buttonconfig.Fontsize=25;
+ buttonconfig.ViewId="crown::";
+ buttonconfig.str="crown::";
+ buttonconfig.ALIGN=TEXT_ALIGNMENT_LEFT;
+ button[2]=SetTheButton_ext(buttonconfig);
+ testBUTTONScrollView->Add(button[2]);
+
+
+
RootView::OnKeyActListener *keyactListener = (RootView::OnKeyActListener *)OHOS::testPresenter::GetInstance();
RootView::GetInstance()->SetOnKeyActListener(keyactListener);
+ UIView::OnRotateListener *RotateListener = static_cast<UIView::OnRotateListener *>(testPresenter::GetInstance());
+ testBUTTONScrollView->SetOnRotateListener(RotateListener);
+ // // 增加表冠控制
+ testBUTTONScrollView->SetRotateFactor(2);
+ testBUTTONScrollView->RequestFocus();
+
+
// UIView::OnDragListener *draglistener = static_cast<UIView::OnDragListener *>(testPresenter::GetInstance());
// if (draglistener == nullptr)
// {
// }
// testcat1ScrollView->SetOnDragListener(draglistener);
- labelButton_next= testAboutView::GetInstance()->init_button_next(267,220,"microphonebutton_next");
+ labelButton_next= testAboutView::GetInstance()->init_button_next(300,220,"microphonebutton_next");
testBUTTONScrollView->Add(labelButton_next);
Title= testAboutView::GetInstance()->init_title(165,45,"KEY_TEST");
testGsonsonScrollView->Add(x);
/* -------------------------------------------------------------------------- */
- labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,"xxxx");
+ labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,"BTbutton_next");
testGsonsonScrollView->Add(labelButton_next);
#ifndef _CONFIG_MODEL_H_
#define _CONFIG_MODEL_H_
-
+#include <string>
#include <iostream>
#include <fstream>
#include <filesystem>
CONFIGMODEL_ITEM_SEDENTARY_INTERVAL,//久坐提醒时间间隔(单位小时)
CONFIGMODEL_ITEM_SEDENTARY_REMINDERTIME,//久坐提醒时间段
+ //手表密码
+ CONFIGMODEL_ITEM_PASSWORD,
+ CONFIGMODEL_ITEM_PASSWORD_SWITCH,
+
CONFIGMODEL_ITEM_SIM_ICCID,//SIM卡的ICCID
CONFIGMODEL_ITEM_TELECOM_DMP_TIMESEC,//注册时间戳
{ConfigDataType::DATATYPE_INT, "sleep_remide", "0" }, // CONFIGMODEL_ITEM_SLEEP_REMIND,//提前20分钟提醒开关
{ConfigDataType::DATATYPE_BOOL, "sedentary_switch", "false" }, // CONFIGMODEL_ITEM_SEDENTARY_SWITCH,//久坐提醒开关
{ConfigDataType::DATATYPE_INT, "sedentary_interval", "1" }, // CONFIGMODEL_ITEM_SEDENTARY_INTERVAL,//久坐提醒时间间隔
- {ConfigDataType::DATATYPE_INT, "sedentary_reminderTime", "0" }, // CONFIGMODEL_ITEM_SEDENTARY_REMINDERTIME,//久坐提醒时间段 前16位是开始时间 前8 为小时 后8为分钟 后16位为结束时间规则同前 例: 1600 0B00 11点开始到 22点结束
+ {ConfigDataType::DATATYPE_INT, "sedentary_reminderTime", "0" }, // CONFIGMODEL_ITEM_SEDENTARY_REMINDERTIME,//久坐提醒时间段 前16位是开始时间 前8 为小时 后8为分钟 后16位为结束时间规则同前 例: 1600 0B00 11点开始到 22点结束
+ {ConfigDataType::DATATYPE_STRING, "password", "000000" }, //CONFIGMODEL_ITEM_PASSWORD //手表密码 CONFIGMODEL_ITEM_SWITCH
+ {ConfigDataType::DATATYPE_INT, "passwordswich", "0" },//CONFIGMODEL_ITEM_PASSWORD_SWITCH 手表密码开关 0关 1开
{ConfigDataType::DATATYPE_STRING, "sim_iccid", "" },//CONFIGMODEL_ITEM_SIM_ICCID cat1的iccid
{ConfigDataType::DATATYPE_STRING, "telecom_regist_timesec", "" },//CONFIGMODEL_ITEM_TELECOM_DMP_TIMESEC
{ConfigDataType::DATATYPE_INT, "dmp_factory_status", "0" },//CONFIGMODEL_ITEM_DMP_FACTORY_STATUS默认是0
PM_ID_MOTOR,//新增,马达
PM_ID_GSENSOR,//新增,加速计
PM_ID_CAT1,//Cat1 communication
+ PM_ID_P_TEST,//产测
PM_ID_MAX,
} pm_id_t;
"PM_ID_MOTOR",//新增,马达
"PM_ID_GSENSOR",//新增,加速计
"PM_ID_CAT1",//Cat1 communication
+ "PM_ID_P_TEST",
"PM_ID_MAX"
};