From dd9b33f85f3dd6248f754473802a4a900440f9e1 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Sat, 20 Jul 2024 12:05:16 +0800 Subject: [PATCH] =?utf8?q?=E9=87=8D=E5=86=99=E4=BA=A7=E6=B5=8B=E9=83=A8?= =?utf8?q?=E5=88=86=E4=BB=A3=E7=A0=81=EF=BC=8C=E4=BC=98=E5=8C=96=E7=BB=93?= =?utf8?q?=E6=9E=84=EF=BC=8C=E6=9B=B4=E6=96=B9=E4=BE=BF=E5=90=8E=E7=BB=AD?= =?utf8?q?=E6=9B=B4=E6=94=B9=E5=92=8C=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/producttest/include/testA5133.h | 4 +- .../nativeui/producttest/include/testLCD.h | 4 +- .../producttest/include/testPresenter.h | 4 +- .../producttest/include/testSEChipTest.h | 4 +- .../nativeui/producttest/include/testTP.h | 4 +- .../nativeui/producttest/include/testView.h | 16 ++- .../nativeui/producttest/include/testabout.h | 4 +- .../nativeui/producttest/include/testbt.h | 4 +- .../nativeui/producttest/include/testbutton.h | 4 +- .../nativeui/producttest/include/testcat1.h | 4 +- .../producttest/include/testchanging.h | 4 +- .../producttest/include/testgsenson.h | 4 +- .../producttest/include/testhrsenson.h | 4 +- .../producttest/include/testluminance.h | 4 +- .../producttest/include/testmagnetic.h | 4 +- .../producttest/include/testmicrophone.h | 4 +- .../nativeui/producttest/include/testmotor.h | 4 +- .../nativeui/producttest/include/testold.h | 4 +- .../nativeui/producttest/include/testspeak.h | 4 +- .../nativeui/producttest/src/testA5133.cpp | 9 +- .../nativeui/producttest/src/testLCD.cpp | 10 +- .../producttest/src/testPresenter.cpp | 52 ++------- .../producttest/src/testSEChipTest.cpp | 9 +- .../nativeui/producttest/src/testTP.cpp | 10 +- .../nativeui/producttest/src/testView.cpp | 109 ++++++++---------- .../nativeui/producttest/src/testabout.cpp | 13 ++- .../nativeui/producttest/src/testbt.cpp | 9 +- .../nativeui/producttest/src/testbutton.cpp | 9 +- .../nativeui/producttest/src/testcat1.cpp | 10 +- .../nativeui/producttest/src/testchanging.cpp | 10 +- .../nativeui/producttest/src/testgsenson.cpp | 10 +- .../nativeui/producttest/src/testhrsenson.cpp | 10 +- .../producttest/src/testluminance.cpp | 9 +- .../nativeui/producttest/src/testmagnetic.cpp | 9 +- .../producttest/src/testmicrophone.cpp | 9 +- .../nativeui/producttest/src/testmotor.cpp | 10 +- .../nativeui/producttest/src/testold.cpp | 9 +- .../nativeui/producttest/src/testspeak.cpp | 9 +- 38 files changed, 197 insertions(+), 216 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testA5133.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testA5133.h index cabadad60..9bb57795f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testA5133.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testA5133.h @@ -56,7 +56,7 @@ namespace OHOS void dial_112(bool); void BT_discovery_callback(void); - UIScrollView *testA5133InitIView(void); + UIScrollView *testA5133InitIView(uint8_t); void ClearAll(void); void set_BR_connect(char *); bool br_scan_set_text(unsigned char *name ,unsigned char *addr,int16_t rssi,int i); @@ -65,7 +65,7 @@ namespace OHOS private: UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); UILabel *InitLabel(LabelConfig &labelConfig); - bool testA5133ScrollViewcrollViewinit(void); + bool testA5133ScrollViewcrollViewinit(uint8_t); UIScrollView *testa5133ScrollView{nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCD.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCD.h index 79114e1f0..2d655c76a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCD.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCD.h @@ -21,12 +21,12 @@ namespace OHOS virtual ~testLCDView(); static testLCDView *GetInstance(void); - UIScrollView *testLCDInitIView(void); + UIScrollView *testLCDInitIView(uint8_t); void ClearAll(void); void set_LCD_color(int); void LCDHideNextButton(void); private: - bool testLCDScrollViewcrollViewinit(void); + bool testLCDScrollViewcrollViewinit(uint8_t); UIScrollView *testLCDScrollView{nullptr}; bool initViewStatus{false}; UILabelButtonExt* labelButton_next = nullptr; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h index 6d7f831e7..f23c86012 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h @@ -43,9 +43,7 @@ namespace OHOS FACTORYRESE, #ifdef SUPPORT_A5133_SERVICE RF5133, -#endif - TEST_1, - +#endif MAX_TESTVIEWID, } TEST_VIEW; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testSEChipTest.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testSEChipTest.h index 58b16732d..a431accb6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testSEChipTest.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testSEChipTest.h @@ -30,7 +30,7 @@ namespace OHOS std::string text; // 文本 uint8_t lineBreakMode; // 断行模式。 }; - UIScrollView *SEChipInitIView(void); + UIScrollView *SEChipInitIView(uint8_t); void ClearAll(void); UILabel *InitLabel(LabelConfig &labelConfig); @@ -38,7 +38,7 @@ namespace OHOS private: UIScrollView *testSEChipScrollView{nullptr}; - bool SEChipInitIview(void); + bool SEChipInitIview(uint8_t); UILabel *chipinfo_label{nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTP.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTP.h index ea7d1c464..0c3c96f30 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTP.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTP.h @@ -33,12 +33,12 @@ namespace OHOS static testTPView *GetInstance(void); void ChangeViewcolor(int,int); - UIScrollView *testTPInitIView(void); + UIScrollView *testTPInitIView(uint8_t); void ClearAll(void); void TPHideNextButton(void); private: UIButton *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig, UIView::OnTouchListener *clickListener); - bool testTPScrollViewcrollViewinit(void); + bool testTPScrollViewcrollViewinit(uint8_t); UIScrollView *testTPScrollView{nullptr}; bool initViewStatus{false}; UILabelButtonExt* labelButton_next = nullptr; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testView.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testView.h index 1c70adb36..0c69ff954 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testView.h @@ -34,6 +34,9 @@ namespace OHOS { + + + class testPresenter; class testView : public View { @@ -132,9 +135,20 @@ namespace OHOS #ifdef SUPPORT_A5133_SERVICE testA5133View *test_A5133_view{nullptr}; #endif - UILabelButtonExt *button[20]={NULL}; + UILabelButtonExt *button[30]={NULL}; bool initViewStatus{false}; }; + struct test_ext + { + const int16_t viewId; + char *viewid_str; + char *Labe_str; + char *viewid_str_next; + bool (testView::*func)(int16_t thisView); + bool enable_falg; + }; + extern test_ext Test_ViewMapper_t[]; + } // namespace OHOS #endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testabout.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testabout.h index 872c18927..4dc863092 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testabout.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testabout.h @@ -30,14 +30,14 @@ namespace OHOS std::string text; // 文本 uint8_t lineBreakMode; // 断行模式。 }; - UIScrollView *SystemAbouTheWatchtInitIView(void); + UIScrollView *SystemAbouTheWatchtInitIView(uint8_t); void ClearAll(void); UILabel *InitLabel(LabelConfig &labelConfig); UILabelButtonExt* init_button_next(int x,int y,char *view_id); UILabel *init_title(int x,int y,char *view_text); private: - bool testAboutTheWatchScrollViewinit(void); + bool testAboutTheWatchScrollViewinit(uint8_t); UIScrollView *testAboutTheWatchScrollView{nullptr}; UILabel *SystemAboutTheWatchTitle{nullptr}; // "关于" UILabel *WatchNameTitle{nullptr}; // "手表名称Title" diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testbt.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testbt.h index 69df1cf9e..d4120bf91 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testbt.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testbt.h @@ -56,7 +56,7 @@ namespace OHOS void dial_112(bool); void BT_discovery_callback(void); - UIScrollView *testBTInitIView(void); + UIScrollView *testBTInitIView(uint8_t); void ClearAll(void); void set_BR_connect(char *); bool br_scan_set_text(unsigned char *name ,unsigned char *addr,int16_t rssi,int i); @@ -65,7 +65,7 @@ namespace OHOS private: UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); UILabel *InitLabel(LabelConfig &labelConfig); - bool testBTScrollViewcrollViewinit(void); + bool testBTScrollViewcrollViewinit(uint8_t); UIScrollView *testBTScrollView{nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testbutton.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testbutton.h index dbf28d8f4..9c646c29d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testbutton.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testbutton.h @@ -44,11 +44,11 @@ namespace OHOS void Changbutton(int16_t); - UIScrollView *testBUTTONInitIView(void); + UIScrollView *testBUTTONInitIView(uint8_t); void ClearAll(void); private: UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); - bool testBUTTONScrollViewcrollViewinit(void); + bool testBUTTONScrollViewcrollViewinit(uint8_t); UIScrollView *testBUTTONScrollView{nullptr}; UILabelButtonExt* labelButton_next = nullptr; UILabelButtonExt* button[3]{nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testcat1.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testcat1.h index 60046d0a6..d4263ad07 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testcat1.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testcat1.h @@ -75,14 +75,14 @@ namespace OHOS static testcat1View *GetInstance(void); void dial_112(bool); - UIScrollView *testcat1InitIView(void); + UIScrollView *testcat1InitIView(uint8_t); void ClearAll(void); void setcat1msg(cat1_msg); void setcat1vermsg(cat1_Ver); private: UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); UILabel *InitLabel(LabelConfig &labelConfig); - bool tesScat1ScrollViewcrollViewinit(void); + bool tesScat1ScrollViewcrollViewinit(uint8_t); UIScrollView *testcat1ScrollView{nullptr}; UILabel *label_1_cat1msg_1=NULL; // UILabel *label_1_cat1msg_oper{nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testchanging.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testchanging.h index 87c392ff8..730c3bcf9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testchanging.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testchanging.h @@ -40,11 +40,11 @@ namespace OHOS static testCHANINGView *GetInstance(void); void ChangeViewcolor(bool); - UIScrollView *testCHANINGInitIView(void); + UIScrollView *testCHANINGInitIView(uint8_t); void ClearAll(void); private: UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); - bool testCHANINGScrollViewcrollViewinit(void); + bool testCHANINGScrollViewcrollViewinit(uint8_t); UIScrollView *testCHANINGScrollView{nullptr}; bool initViewStatus{false}; UILabel *Title{nullptr}; // 标题 diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testgsenson.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testgsenson.h index 86c26f3a4..c0017aeea 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testgsenson.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testgsenson.h @@ -36,11 +36,11 @@ namespace OHOS virtual ~testgsensonView(); static testgsensonView *GetInstance(void); - UIScrollView *testGSENSONInitIView(void); + UIScrollView *testGSENSONInitIView(uint8_t); void ClearAll(void); void set_data(); private: - bool testGsonsonScrollViewcrollViewinit(void); + bool testGsonsonScrollViewcrollViewinit(uint8_t); UILabel *InitLabel(LabelConfig &labelConfig); UIScrollView *testGsonsonScrollView{nullptr}; bool initViewStatus{false}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testhrsenson.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testhrsenson.h index f9051667c..7acd8d1f2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testhrsenson.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testhrsenson.h @@ -74,14 +74,14 @@ namespace OHOS static testhrsenson1View *GetInstance(void); void gray_test(bool); void leeklight_test(bool); - UIScrollView *testhrsensonInitIView(void); + UIScrollView *testhrsensonInitIView(uint8_t); void ClearAll(void); void setgrayvalue(int,int,int); void setlightvalue(int g,int r,int ir); private: UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); UILabel *InitLabel(LabelConfig &labelConfig); - bool tesScat1ScrollViewcrollViewinit(void); + bool tesScat1ScrollViewcrollViewinit(uint8_t); UIScrollView *testhrsensonScrollView{nullptr}; UILabel *label_1_cat1msg_1=NULL; // UILabel *label_1_cat1msg_oper{nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testluminance.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testluminance.h index e5c8c34cf..ff3b74095 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testluminance.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testluminance.h @@ -28,10 +28,10 @@ namespace OHOS { return BrightnessControlViewSlider->GetValue(); } - UIScrollView *testLUMInitIView(void); + UIScrollView *testLUMInitIView(uint8_t); void ClearAll(void); private: - bool testLUMScrollViewcrollViewinit(void); + bool testLUMScrollViewcrollViewinit(uint8_t); UIScrollView *testLUMScrollView{nullptr}; bool initViewStatus{false}; UISlider *BrightnessControlViewSlider = nullptr; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmagnetic.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmagnetic.h index 8577d6f98..2b726a8cc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmagnetic.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmagnetic.h @@ -36,11 +36,11 @@ namespace OHOS virtual ~testMagicView(); static testMagicView *GetInstance(void); - UIScrollView *testmagicInitIView(void); + UIScrollView *testmagicInitIView(uint8_t); void ClearAll(void); void set_data(); private: - bool testmagicScrollViewcrollViewinit(void); + bool testmagicScrollViewcrollViewinit(uint8_t); UILabel *InitLabel(LabelConfig &labelConfig); UIScrollView *testmagicScrollView{nullptr}; bool initViewStatus{false}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophone.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophone.h index e93389ff3..4c2b912ab 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophone.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophone.h @@ -42,11 +42,11 @@ namespace OHOS static testmicrohoneView *GetInstance(void); void buttoncallback(); - UIScrollView *testmicrophoneInitIView(void); + UIScrollView *testmicrophoneInitIView(uint8_t); void ClearAll(void); private: UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); - bool testphoneScrollViewcrollViewinit(void); + bool testphoneScrollViewcrollViewinit(uint8_t); UIScrollView *testmakephoneScrollView{nullptr}; UILabelButtonExt* labelButton_next = nullptr; UILabelButtonExt* button{NULL}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmotor.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmotor.h index 6fc494714..cb68649d1 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmotor.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmotor.h @@ -42,11 +42,11 @@ namespace OHOS static testMOTORView *GetInstance(void); void Changstatr(bool); - UIScrollView *testMOTORInitIView(void); + UIScrollView *testMOTORInitIView(uint8_t); void ClearAll(void); private: UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); - bool testMOTORScrollViewcrollViewinit(void); + bool testMOTORScrollViewcrollViewinit(uint8_t); UIScrollView *tesMOTORScrollView{nullptr}; UILabelButtonExt* labelButton_next = nullptr; UILabelButtonExt* button[2]{NULL}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h index 6ceb40064..d059dfbf9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h @@ -33,14 +33,14 @@ namespace OHOS virtual ~testoldView(); static testoldView *GetInstance(void); - UIScrollView *testoldInitIView(void); + UIScrollView *testoldInitIView(uint8_t); void ClearAll(void); void setbuf(char *buf); void set_data(); void setlightvalue(int ,int ,int); private: - bool testoldScrollViewcrollViewinit(void); + bool testoldScrollViewcrollViewinit(uint8_t); UILabel *InitLabel(LabelConfig &labelConfig); }; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testspeak.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testspeak.h index 9b50f80d6..7c5e977d7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testspeak.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testspeak.h @@ -41,11 +41,11 @@ namespace OHOS static testSPEAKView *GetInstance(void); void Changspeak(bool); - UIScrollView *testSPEAKInitIView(void); + UIScrollView *testSPEAKInitIView(uint8_t); void ClearAll(void); private: UILabelButtonExt *SetTheButton_ext(ButtonConfig_ext_t &buttonconfig);//, UIView::OnTouchListener *clickListener); - bool tesSPEAKScrollViewcrollViewinit(void); + bool tesSPEAKScrollViewcrollViewinit(uint8_t); UIScrollView *testSPEAKScrollView{nullptr}; bool initViewStatus{false}; UILabelButtonExt* labelButton_next = nullptr; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testA5133.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testA5133.cpp index d69470102..0a0a2c25c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testA5133.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testA5133.cpp @@ -12,6 +12,7 @@ #include "bts_le_gap.h" #include "bleService.h" #include "BluetoothModel.h" +#include "producttest/include/testView.h" #ifdef __cplusplus #if __cplusplus extern "C" @@ -227,7 +228,7 @@ namespace OHOS } - bool testA5133View::testA5133ScrollViewcrollViewinit(void) + bool testA5133View::testA5133ScrollViewcrollViewinit(uint8_t id) { testa5133ScrollView = new UIScrollView(); @@ -291,7 +292,7 @@ namespace OHOS - labelButton_next= testAboutView::GetInstance()->init_button_next(270,80,"SEChipTestbutton_next"); + labelButton_next= testAboutView::GetInstance()->init_button_next(270,80,Test_ViewMapper_t[id].viewid_str_next); testa5133ScrollView->Add(labelButton_next); Title= testAboutView::GetInstance()->init_title(165,45,"BT_TEST"); @@ -323,9 +324,9 @@ namespace OHOS return true; } - UIScrollView *testA5133View::testA5133InitIView() + UIScrollView *testA5133View::testA5133InitIView(uint8_t id) { - if (!testA5133ScrollViewcrollViewinit()) + if (!testA5133ScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp index 753eced0d..ec816a70b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp @@ -2,7 +2,7 @@ #include "custom_utils.h" #include "producttest/include/testPresenter.h" #include "producttest/include/testLCD.h" - +#include "producttest/include/testView.h" #include "cmsis_os2.h" #ifdef __cplusplus #if __cplusplus @@ -116,7 +116,7 @@ namespace OHOS } - bool testLCDView::testLCDScrollViewcrollViewinit(void) + bool testLCDView::testLCDScrollViewcrollViewinit(uint8_t id) { uint32_t tick; osStatus_t retTimer; @@ -133,7 +133,7 @@ namespace OHOS testLCDScrollView->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full); - labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,"TPButton_next"); + labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,Test_ViewMapper_t[id].viewid_str_next); testLCDScrollView->Add(labelButton_next); LCD_TEST_FALG=0; @@ -176,9 +176,9 @@ namespace OHOS return true; } - UIScrollView *testLCDView::testLCDInitIView() + UIScrollView *testLCDView::testLCDInitIView(uint8_t id) { - if (!testLCDScrollViewcrollViewinit()) + if (!testLCDScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp index db7463fc3..60351b676 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp @@ -27,42 +27,9 @@ namespace OHOS "TP_13","TP_14", "TP_15", "TP_16", }; - struct TEST_ext_p - { - const int16_t viewId; - char *viewid_str; - char *viewid_str_next; - bool enable_falg; - }; - // 2.ViewMapper[] 是一个静态的视图映射数组,将视图ID与MainStopWatchView类中的特定成员函数指针进行了绑定。 - static TEST_ext_p ViewMapper_t[] = - { - {VISON,"AboutTheWatchButton", "LCDButton_next",true}, - {LCD,"LCDButton", "TPButton_next",true}, - {TP,"TPButton", "MAGETICButton_next",true}, - {MAGETIC,"MAGETICButton", "luminanceButton_next",true}, - {LUMINANCE,"luminanceButton", "chargingButton_next",true}, - {CHAR,"chargingButton", "speakButton_next",true}, - {SPEAK,"speakButton", "motorButton_next",true}, - {MOTOR,"motorButton", "cat1button_next",true}, - {CAT1,"cat1button", "buttonbutton_next",true}, - {BUTTON,"buttonbutton", "microphonebutton_next",true}, - {MICROPHONE,"microphonebutton", "hrsensonbutton_next",true}, - {HRSENSON,"hrsensonbutton", "gsensonbutton_next",true}, - {GSENSON,"gsensonbutton","BTbutton_next" ,true}, - {BTTEST,"BTbutton","SEChipTestbutton_next",true}, - {SEChipTest,"SEChipTestbutton","xxxx" ,true}, - - {OLDTEST,"oldtestbutton","oldtestexit",true}, - {DEEPSLEEP,"deepsleep","xxxxxxxxx",true}, - {shutdown,"shutdown","xxxxxxxxx",true}, - {FACTORYRESE,"FactoryReset","xxxxxxxxx",true}, - #ifdef SUPPORT_A5133_SERVICE - {RF5133,"RF5133","xxxxxxxxx",true}, - #endif - }; + extern test_ext Test_ViewMapper_t[]; // {FACTORYRESETVIEW,"FactoryResetButton",true}, // {SYSTEMLUPGRADE,"systemupgread",true}, // {TEST,"testButton",true}}; @@ -186,10 +153,10 @@ namespace OHOS bool testPresenter::OnClick(UIView &view, const ClickEvent &event) { testView *p_SystemView = testView::GetInstance(); - int len=sizeof(ViewMapper_t)/sizeof(TEST_ext_p); + int len=MAX_TESTVIEWID;//sizeof(Test_ViewMapper_t)/sizeof(Test_ViewMapper_t[0]); //int len=5; // 根据控件id查找是哪个控件触发了点击回调 - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnClick"); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnClick %s",view.GetViewId()); if(strcmp(view.GetViewId(),"xxxx") == 0) { @@ -228,18 +195,19 @@ namespace OHOS return true; } + for(int i=0;iChangeView(TESTVIEW, ViewMapper_t[i].viewId); + if(Test_ViewMapper_t[i].enable_falg==true) + testView::GetInstance()->ChangeView(TESTVIEW, Test_ViewMapper_t[i].viewId); return true; } - if(strcmp(view.GetViewId(),ViewMapper_t[i].viewid_str_next) == 0) + if(strcmp(view.GetViewId(),Test_ViewMapper_t[i].viewid_str_next) == 0) { - if(ViewMapper_t[i+1].enable_falg==true) - testView::GetInstance()->ChangeView(ViewMapper_t[i].viewId, ViewMapper_t[i+1].viewId); + if(Test_ViewMapper_t[i+1].enable_falg==true) + testView::GetInstance()->ChangeView(Test_ViewMapper_t[i].viewId, Test_ViewMapper_t[i+1].viewId); return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testSEChipTest.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testSEChipTest.cpp index 86de1211c..c11163e78 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testSEChipTest.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testSEChipTest.cpp @@ -3,6 +3,7 @@ #include "producttest/include/testPresenter.h" #include "producttest/include/testSEChipTest.h" #include "ConfigModel.h" +#include "producttest/include/testView.h" #ifdef __cplusplus #if __cplusplus extern "C" @@ -107,7 +108,7 @@ namespace OHOS return label; } - bool testSEChipView::SEChipInitIview(void) + bool testSEChipView::SEChipInitIview(uint8_t id) { testSEChipScrollView = new UIScrollView(); if (testSEChipScrollView == nullptr) @@ -134,9 +135,9 @@ namespace OHOS return true; } - UIScrollView *testSEChipView::SEChipInitIView() + UIScrollView *testSEChipView::SEChipInitIView(uint8_t id) { - if (!SEChipInitIview()) + if (!SEChipInitIview(id)) { return nullptr; } @@ -226,7 +227,7 @@ namespace OHOS - labelButton_next= testAboutView::GetInstance()->init_button_next(267,300,"xxxx"); + labelButton_next= testAboutView::GetInstance()->init_button_next(267,300,Test_ViewMapper_t[id].viewid_str_next); testSEChipScrollView->Add(labelButton_next); Title= testAboutView::GetInstance()->init_title(142,40,"SEChip_TEST"); diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp index 5c57c070d..884005e49 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp @@ -2,7 +2,7 @@ #include "custom_utils.h" #include "producttest/include/testPresenter.h" #include "producttest/include/testTP.h" - +#include "producttest/include/testView.h" #include "cmsis_os2.h" #ifdef __cplusplus #if __cplusplus @@ -127,7 +127,7 @@ namespace OHOS } } - bool testTPView::testTPScrollViewcrollViewinit(void) + bool testTPView::testTPScrollViewcrollViewinit(uint8_t id) { testTPScrollView = new UIScrollView(); @@ -177,7 +177,7 @@ namespace OHOS testTPScrollView->SetTouchable(true); testTPScrollView->SetDraggable(true); - labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,"MAGETICButton_next"); + labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,Test_ViewMapper_t[id].viewid_str_next); testTPScrollView->Add(labelButton_next); Title= testAboutView::GetInstance()->init_title(175,45,"TP_TEST"); @@ -195,9 +195,9 @@ namespace OHOS return true; } - UIScrollView *testTPView::testTPInitIView() + UIScrollView *testTPView::testTPInitIView(uint8_t id) { - if (!testTPScrollViewcrollViewinit()) + if (!testTPScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp index 5cdab6500..34769a5cb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp @@ -12,41 +12,30 @@ namespace OHOS static testView *g_pSystemView{nullptr}; - struct test_ext - { - const int16_t viewId; - char *viewid_str; - char *Labe_str; - bool (testView::*func)(int16_t thisView); - }; - - // 2.ViewMapper[] 是一个静态的视图映射数组,将视图ID与MainStopWatchView类中的特定成员函数指针进行了绑定。 - static test_ext ViewMapper_t[] = { - {VISON,"AboutTheWatchButton","Verison",&testView::ChangeSystemAboutView}, - {LCD,"LCDButton","LCD",&testView::ChangeLCDTESTView}, - {TP,"TPButton","TP", &testView::ChangeTPTESTView}, - {MAGETIC,"MAGETICButton","Magetic", &testView::ChangeMGTESTView}, - {LUMINANCE,"luminanceButton","luminance", &testView::ChangLUMTESTView}, - {CHAR,"chargingButton","bat&charger", &testView::ChangchargingTESTView}, - {SPEAK,"speakButton","speak", &testView::ChangspeakTESTView}, - {MOTOR,"motorButton","motor", &testView::ChangmotorTESTView}, - {CAT1,"cat1button","CAT1", &testView::ChangeCAT1TESTView}, - {BUTTON,"buttonbutton","button" ,&testView::ChangKEYTESTView}, - {MICROPHONE,"microphonebutton","microphone" ,&testView::ChangeMPTESTView}, - {HRSENSON,"hrsensonbutton","hrsensor" ,&testView::ChangeHRTESTView}, - {GSENSON,"gsensonbutton","gsensor" ,&testView::ChangeGTESTView}, - {BTTEST,"BTbutton","BT" ,&testView::ChangeBTTESTView}, - - {SEChipTest,"SEChipTestbutton","SEChipTest" ,&testView::ChangeSEChipTESTView}, - - - {OLDTEST,"oldtestbutton","aging" ,&testView::ChangeoldTESTView}, - {DEEPSLEEP,"deepsleep","DeepSleepCurrent" ,&testView::ChangeoldTESTView}, - {shutdown,"shutdown","shutdown" ,&testView::ChangeoldTESTView}, - {FACTORYRESE,"FactoryReset","FactoryReset", &testView::ChangeoldTESTView}, + test_ext Test_ViewMapper_t[] = { + {TESTVIEW,"","","",&testView::ChangeSystemAboutView,false},//占位,空的 + {VISON,"AboutTheWatchButton","Verison","AboutTheWatchButton_next",&testView::ChangeSystemAboutView,true}, + {LCD,"LCDButton","LCD","LCDButton_next",&testView::ChangeLCDTESTView,true}, + {TP,"TPButton","TP","TPButton_next", &testView::ChangeTPTESTView,true}, + {MAGETIC,"MAGETICButton","Magetic","MAGETICButton_next", &testView::ChangeMGTESTView,true}, + {LUMINANCE,"luminanceButton","luminance","luminanceButton_next", &testView::ChangLUMTESTView,true}, + {CHAR,"chargingButton","bat&charger","chargingButton_next",&testView::ChangchargingTESTView,true}, + {SPEAK,"speakButton","speak","speakButton_next" ,&testView::ChangspeakTESTView,true}, + {MOTOR,"motorButton","motor","motorButton_next" ,&testView::ChangmotorTESTView,true}, + {CAT1,"cat1button","CAT1", "cat1button_next",&testView::ChangeCAT1TESTView,true}, + {BUTTON,"buttonbutton","button" ,"buttonbutton_next",&testView::ChangKEYTESTView,true}, + {MICROPHONE,"microphonebutton","microphone", "microphonebutton_next",&testView::ChangeMPTESTView,true}, + {HRSENSON,"hrsensonbutton","hrsensor", "hrsensonbutton_next",&testView::ChangeHRTESTView,true}, + {GSENSON,"gsensonbutton","gsensor","gsensonbutton_next" ,&testView::ChangeGTESTView,true}, + {BTTEST,"BTbutton","BT" ,"BTbutton_next",&testView::ChangeBTTESTView,true}, + {SEChipTest,"SEChipTestbutton","SEChipTest","SEChipTestbutton_next" ,&testView::ChangeSEChipTESTView,true}, + {OLDTEST,"oldtestbutton","aging" ,"oldtestexit",&testView::ChangeoldTESTView,true}, + {DEEPSLEEP,"deepsleep","DeepSleepCurrent","xxxxxxxxx" ,&testView::ChangeoldTESTView,true}, + {shutdown,"shutdown","shutdown", "xxxxxxxxx",&testView::ChangeoldTESTView,true}, + {FACTORYRESE,"FactoryReset","FactoryReset","xxxxxxxxx", &testView::ChangeoldTESTView,true}, #ifdef SUPPORT_A5133_SERVICE - {RF5133,"RF5133","RF5133", &testView::ChangeA5133TESTView}, + {RF5133,"RF5133","RF5133", "xxxxxxxxx",&testView::ChangeA5133TESTView,true}, #endif // {SYSTEMLUPGRADE,"systemupgread","系统升级",&testView::ChangeSystemAboutView}, // {TEST,"testButton","测试模式", &testView::ChangeSystemAboutView}, @@ -87,7 +76,7 @@ namespace OHOS // draglistener = nullptr; // } - int funcSize = sizeof(ViewMapper_t) / sizeof(ViewMapper_t[TESTVIEW]); + int funcSize = sizeof(Test_ViewMapper_t) / sizeof(Test_ViewMapper_t[TESTVIEW]); for (int i = 0; i < funcSize; i++) { if(button[i]) @@ -293,12 +282,12 @@ namespace OHOS buttonconfig.w = w; buttonconfig.h = h; - int len =sizeof(ViewMapper_t)/sizeof(test_ext); + int len =sizeof(Test_ViewMapper_t)/sizeof(Test_ViewMapper_t[0]); - for(int i=0;iSystemAbouTheWatchtInitIView(); + SystemScrollView[thisView] = test_about_view->SystemAbouTheWatchtInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -353,7 +342,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_LCD_view->testLCDInitIView(); + SystemScrollView[thisView] = test_LCD_view->testLCDInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -370,7 +359,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_TP_view->testTPInitIView(); + SystemScrollView[thisView] = test_TP_view->testTPInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -387,7 +376,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_MG_view->testmagicInitIView(); + SystemScrollView[thisView] = test_MG_view->testmagicInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -404,7 +393,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_lum_view->testLUMInitIView(); + SystemScrollView[thisView] = test_lum_view->testLUMInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -421,7 +410,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_charging_view->testCHANINGInitIView(); + SystemScrollView[thisView] = test_charging_view->testCHANINGInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -438,7 +427,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_speak_view->testSPEAKInitIView(); + SystemScrollView[thisView] = test_speak_view->testSPEAKInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -455,7 +444,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_motor_view->testMOTORInitIView(); + SystemScrollView[thisView] = test_motor_view->testMOTORInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -472,7 +461,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_cat1_view->testcat1InitIView(); + SystemScrollView[thisView] = test_cat1_view->testcat1InitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -489,7 +478,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_KEY_view->testBUTTONInitIView(); + SystemScrollView[thisView] = test_KEY_view->testBUTTONInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -506,7 +495,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_MP_view->testmicrophoneInitIView(); + SystemScrollView[thisView] = test_MP_view->testmicrophoneInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -523,7 +512,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_hr_view->testhrsensonInitIView(); + SystemScrollView[thisView] = test_hr_view->testhrsensonInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -541,7 +530,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_G_view->testGSENSONInitIView(); + SystemScrollView[thisView] = test_G_view->testGSENSONInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -558,7 +547,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_old_view->testoldInitIView(); + SystemScrollView[thisView] = test_old_view->testoldInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -575,7 +564,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_BT_view->testBTInitIView(); + SystemScrollView[thisView] = test_BT_view->testBTInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -593,7 +582,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_SEChip_view->SEChipInitIView(); + SystemScrollView[thisView] = test_SEChip_view->SEChipInitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -610,7 +599,7 @@ namespace OHOS WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView); return false; } - SystemScrollView[thisView] = test_A5133_view->testA5133InitIView(); + SystemScrollView[thisView] = test_A5133_view->testA5133InitIView(thisView); RootView::GetInstance()->Add(SystemScrollView[thisView]); } return true; @@ -632,12 +621,12 @@ namespace OHOS // 3.根据传入的interface参数执行相应视图ID关联的成员函数。 bool testView::ClickFunc(int16_t interface) { - int funcSize = sizeof(ViewMapper_t) / sizeof(ViewMapper_t[TESTVIEW]); - for (int i = 0; i < funcSize; i++) + int funcSize = sizeof(Test_ViewMapper_t) / sizeof(Test_ViewMapper_t[TESTVIEW]); + for (int i = 1; i < funcSize; i++) { - if (interface == ViewMapper_t[i].viewId) + if (interface == Test_ViewMapper_t[i].viewId) { - bool jug = (this->*(ViewMapper_t[i].func))(interface); + bool jug = (this->*(Test_ViewMapper_t[i].func))(interface); if (jug == false) { return false; @@ -808,7 +797,7 @@ namespace OHOS SystemScrollView[TESTVIEW]->Add(SystemLabel); - int len =sizeof(ViewMapper_t)/sizeof(test_ext); + int len =sizeof(Test_ViewMapper_t)/sizeof(Test_ViewMapper_t[0]); for(int i=0;iAdd(labelButton_next); return testAboutTheWatchScrollView; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbt.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbt.cpp index 87b92d31b..b3f402aae 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbt.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbt.cpp @@ -12,6 +12,7 @@ #include "bts_le_gap.h" #include "bleService.h" #include "BluetoothModel.h" +#include "producttest/include/testView.h" #ifdef __cplusplus #if __cplusplus extern "C" @@ -307,7 +308,7 @@ namespace OHOS // // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"\r\nCAT1 SERVICE MCU WAKEUP SUCCESS\r\n"); // } - bool testBTView::testBTScrollViewcrollViewinit(void) + bool testBTView::testBTScrollViewcrollViewinit(uint8_t id) { testBTScrollView = new UIScrollView(); @@ -371,7 +372,7 @@ namespace OHOS - labelButton_next= testAboutView::GetInstance()->init_button_next(270,80,"SEChipTestbutton_next"); + labelButton_next= testAboutView::GetInstance()->init_button_next(270,80,Test_ViewMapper_t[id].viewid_str_next); testBTScrollView->Add(labelButton_next); Title= testAboutView::GetInstance()->init_title(165,45,"BT_TEST"); @@ -406,9 +407,9 @@ namespace OHOS return true; } - UIScrollView *testBTView::testBTInitIView() + UIScrollView *testBTView::testBTInitIView(uint8_t id) { - if (!testBTScrollViewcrollViewinit()) + if (!testBTScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp index 6307857d7..1702f6b01 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp @@ -4,6 +4,7 @@ #include "producttest/include/testbutton.h" #include "AlarmClockModel.h" #include "cmsis_os2.h" +#include "producttest/include/testView.h" #ifdef __cplusplus #if __cplusplus extern "C" @@ -198,7 +199,7 @@ namespace OHOS - bool testbuttonView::testBUTTONScrollViewcrollViewinit(void) + bool testbuttonView::testBUTTONScrollViewcrollViewinit(uint8_t id) { testBUTTONScrollView = new UIScrollView(); @@ -293,7 +294,7 @@ namespace OHOS // } // testcat1ScrollView->SetOnDragListener(draglistener); - labelButton_next= testAboutView::GetInstance()->init_button_next(300,220,"microphonebutton_next"); + labelButton_next= testAboutView::GetInstance()->init_button_next(300,220,Test_ViewMapper_t[id].viewid_str_next); testBUTTONScrollView->Add(labelButton_next); Title= testAboutView::GetInstance()->init_title(165,45,"KEY_TEST"); @@ -323,9 +324,9 @@ namespace OHOS return true; } - UIScrollView *testbuttonView::testBUTTONInitIView() + UIScrollView *testbuttonView::testBUTTONInitIView(uint8_t id) { - if (!testBUTTONScrollViewcrollViewinit()) + if (!testBUTTONScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testcat1.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testcat1.cpp index 8d4a7ab08..beea8b8d6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testcat1.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testcat1.cpp @@ -8,7 +8,7 @@ #include "cat1_ctl.h" #include "cat1_server_hal.h" #include "custom_runtime.h" - +#include "producttest/include/testView.h" namespace OHOS { @@ -206,7 +206,7 @@ namespace OHOS } - bool testcat1View::tesScat1ScrollViewcrollViewinit(void) + bool testcat1View::tesScat1ScrollViewcrollViewinit(uint8_t id) { testcat1ScrollView = new UIScrollView(); @@ -329,7 +329,7 @@ namespace OHOS // } // testcat1ScrollView->SetOnDragListener(draglistener); - labelButton_next= testAboutView::GetInstance()->init_button_next(267,278,"buttonbutton_next"); + labelButton_next= testAboutView::GetInstance()->init_button_next(267,278,Test_ViewMapper_t[id].viewid_str_next); testcat1ScrollView->Add(labelButton_next); Title= testAboutView::GetInstance()->init_title(165,45,"CAT1_TEST"); @@ -352,9 +352,9 @@ namespace OHOS return true; } - UIScrollView *testcat1View::testcat1InitIView() + UIScrollView *testcat1View::testcat1InitIView(uint8_t id) { - if (!tesScat1ScrollViewcrollViewinit()) + if (!tesScat1ScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testchanging.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testchanging.cpp index adc5f1ba0..41f8cafce 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testchanging.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testchanging.cpp @@ -3,7 +3,7 @@ #include "producttest/include/testPresenter.h" #include "producttest/include/testchanging.h" #include "battery_hal.h" - +#include "producttest/include/testView.h" #include "cmsis_os2.h" #ifdef __cplusplus #if __cplusplus @@ -135,7 +135,7 @@ namespace OHOS } - bool testCHANINGView::testCHANINGScrollViewcrollViewinit(void) + bool testCHANINGView::testCHANINGScrollViewcrollViewinit(uint8_t id) { testCHANINGScrollView = new UIScrollView(); @@ -177,7 +177,7 @@ namespace OHOS testCHANINGScrollView->SetTouchable(true); testCHANINGScrollView->SetDraggable(true); - labelButton_next= testAboutView::GetInstance()->init_button_next(267,278,"speakButton_next"); + labelButton_next= testAboutView::GetInstance()->init_button_next(267,278,Test_ViewMapper_t[id].viewid_str_next); testCHANINGScrollView->Add(labelButton_next); UIView::OnDragListener *draglistener = static_cast(testPresenter::GetInstance()); @@ -215,9 +215,9 @@ namespace OHOS return true; } - UIScrollView *testCHANINGView::testCHANINGInitIView() + UIScrollView *testCHANINGView::testCHANINGInitIView(uint8_t id) { - if (!testCHANINGScrollViewcrollViewinit()) + if (!testCHANINGScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testgsenson.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testgsenson.cpp index c5bf5754f..03c9fe2c5 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testgsenson.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testgsenson.cpp @@ -4,7 +4,7 @@ #include "producttest/include/testgsenson.h" #include "cmsis_os2.h" #include "cywee_hal.h" - +#include "producttest/include/testView.h" #ifdef __cplusplus #if __cplusplus extern "C" @@ -145,7 +145,7 @@ namespace OHOS - bool testgsensonView::testGsonsonScrollViewcrollViewinit(void) + bool testgsensonView::testGsonsonScrollViewcrollViewinit(uint8_t id) { uint32_t tick; osStatus_t retTimer; @@ -236,7 +236,7 @@ namespace OHOS testGsonsonScrollView->Add(x); /* -------------------------------------------------------------------------- */ - labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,"BTbutton_next"); + labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,Test_ViewMapper_t[id].viewid_str_next); testGsonsonScrollView->Add(labelButton_next); uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); @@ -256,9 +256,9 @@ namespace OHOS return true; } - UIScrollView *testgsensonView::testGSENSONInitIView() + UIScrollView *testgsensonView::testGSENSONInitIView(uint8_t id) { - if (!testGsonsonScrollViewcrollViewinit()) + if (!testGsonsonScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testhrsenson.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testhrsenson.cpp index 10ec69513..b1d6c9e8e 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testhrsenson.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testhrsenson.cpp @@ -8,7 +8,7 @@ #include "cat1_ctl.h" #include "cat1_server_hal.h" #include "ppg_service.h" - +#include "producttest/include/testView.h" #ifdef __cplusplus #if __cplusplus extern "C" @@ -202,7 +202,7 @@ namespace OHOS - bool testhrsenson1View::tesScat1ScrollViewcrollViewinit(void) + bool testhrsenson1View::tesScat1ScrollViewcrollViewinit(uint8_t id) { testhrsensonScrollView = new UIScrollView(); @@ -290,7 +290,7 @@ namespace OHOS - labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,"gsensonbutton_next"); + labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,Test_ViewMapper_t[id].viewid_str_next); testhrsensonScrollView->Add(labelButton_next); Title= testAboutView::GetInstance()->init_title(102,45,"HRSSONSER_TEST"); @@ -313,9 +313,9 @@ namespace OHOS return true; } - UIScrollView *testhrsenson1View::testhrsensonInitIView() + UIScrollView *testhrsenson1View::testhrsensonInitIView(uint8_t id) { - if (!tesScat1ScrollViewcrollViewinit()) + if (!tesScat1ScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testluminance.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testluminance.cpp index fa959fb56..7b26e3cfb 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testluminance.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testluminance.cpp @@ -4,6 +4,7 @@ #include "producttest/include/testluminance.h" #include "ConfigModel.h" #include "cmsis_os2.h" +#include "producttest/include/testView.h" #ifdef __cplusplus #if __cplusplus extern "C" @@ -77,7 +78,7 @@ namespace OHOS - bool testLUMView::testLUMScrollViewcrollViewinit(void) + bool testLUMView::testLUMScrollViewcrollViewinit(uint8_t id) { testLUMScrollView = new UIScrollView(); @@ -129,7 +130,7 @@ namespace OHOS testLUMScrollView->SetTouchable(true); testLUMScrollView->SetDraggable(true); - labelButton_next= testAboutView::GetInstance()->init_button_next(300,278,"chargingButton_next"); + labelButton_next= testAboutView::GetInstance()->init_button_next(300,278,Test_ViewMapper_t[id].viewid_str_next); testLUMScrollView->Add(labelButton_next); Title= testAboutView::GetInstance()->init_title(99,54,"BRIGHTNESS_TEST"); @@ -145,9 +146,9 @@ namespace OHOS return true; } - UIScrollView *testLUMView::testLUMInitIView() + UIScrollView *testLUMView::testLUMInitIView(uint8_t id) { - if (!testLUMScrollViewcrollViewinit()) + if (!testLUMScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmagnetic.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmagnetic.cpp index 102cb53ee..b791d4523 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmagnetic.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmagnetic.cpp @@ -4,6 +4,7 @@ #include "producttest/include/testmagnetic.h" #include "mag_service.h" #include "cmsis_os2.h" +#include "producttest/include/testView.h" // #define TEST_BATTERY #ifdef TEST_BATTERY #include "battery_service.h" @@ -146,7 +147,7 @@ namespace OHOS - bool testMagicView::testmagicScrollViewcrollViewinit(void) + bool testMagicView::testmagicScrollViewcrollViewinit(uint8_t id) { uint32_t tick; osStatus_t retTimer; @@ -236,7 +237,7 @@ namespace OHOS testmagicScrollView->Add(x); /* -------------------------------------------------------------------------- */ - labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,"luminanceButton_next"); + labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,Test_ViewMapper_t[id].viewid_str_next); testmagicScrollView->Add(labelButton_next); @@ -256,9 +257,9 @@ namespace OHOS return true; } - UIScrollView *testMagicView::testmagicInitIView() + UIScrollView *testMagicView::testmagicInitIView(uint8_t id) { - if (!testmagicScrollViewcrollViewinit()) + if (!testmagicScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp index 42ce2798a..e0183392d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp @@ -5,6 +5,7 @@ #include "AlarmClockModel.h" #include "cmsis_os2.h" #include "audio_capture_wrapper.h" +#include "producttest/include/testView.h" #ifdef __cplusplus #if __cplusplus extern "C" @@ -160,7 +161,7 @@ namespace OHOS - bool testmicrohoneView::testphoneScrollViewcrollViewinit(void) + bool testmicrohoneView::testphoneScrollViewcrollViewinit(uint8_t id) { testmakephoneScrollView = new UIScrollView(); @@ -201,7 +202,7 @@ namespace OHOS } testmakephoneScrollView->SetOnDragListener(draglistener); - labelButton_next= testAboutView::GetInstance()->init_button_next(50,278,"hrsensonbutton_next"); + labelButton_next= testAboutView::GetInstance()->init_button_next(50,278,Test_ViewMapper_t[id].viewid_str_next); testmakephoneScrollView->Add(labelButton_next); Title= testAboutView::GetInstance()->init_title(99,45,"MICRPPHONE_TEST"); @@ -223,9 +224,9 @@ namespace OHOS return true; } - UIScrollView *testmicrohoneView::testmicrophoneInitIView() + UIScrollView *testmicrohoneView::testmicrophoneInitIView(uint8_t id) { - if (!testphoneScrollViewcrollViewinit()) + if (!testphoneScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmotor.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmotor.cpp index 2206ade0e..c3147c410 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmotor.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmotor.cpp @@ -6,7 +6,7 @@ #include "cmsis_os2.h" #include "dock/vibrator_manager.h" #include "vibrator_service.h" - +#include "producttest/include/testView.h" #ifdef __cplusplus #if __cplusplus @@ -148,7 +148,7 @@ namespace OHOS } - bool testMOTORView::testMOTORScrollViewcrollViewinit(void) + bool testMOTORView::testMOTORScrollViewcrollViewinit(uint8_t id) { tesMOTORScrollView = new UIScrollView(); @@ -203,7 +203,7 @@ namespace OHOS tesMOTORScrollView->SetTouchable(true); tesMOTORScrollView->SetDraggable(false); - labelButton_next= testAboutView::GetInstance()->init_button_next(267,278,"cat1button_next"); + labelButton_next= testAboutView::GetInstance()->init_button_next(267,278,Test_ViewMapper_t[id].viewid_str_next); tesMOTORScrollView->Add(labelButton_next); Title= testAboutView::GetInstance()->init_title(136,45,"MOTOR_TEST"); @@ -220,9 +220,9 @@ namespace OHOS return true; } - UIScrollView *testMOTORView::testMOTORInitIView() + UIScrollView *testMOTORView::testMOTORInitIView(uint8_t id) { - if (!testMOTORScrollViewcrollViewinit()) + if (!testMOTORScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp index 4499b0282..e9706ddfc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp @@ -10,6 +10,7 @@ #include "CompassModel.h" #include "linux/delay.h" #include "power_display_service.h" +#include "producttest/include/testView.h" #ifdef __cplusplus #if __cplusplus extern "C" @@ -207,7 +208,7 @@ namespace OHOS - bool testoldView::testoldScrollViewcrollViewinit(void) + bool testoldView::testoldScrollViewcrollViewinit(uint8_t id) { @@ -285,7 +286,7 @@ namespace OHOS /* -------------------------------------------------------------------------- */ if(labelButton_next==NULL) { - labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,"oldtestexit"); + labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,Test_ViewMapper_t[id].viewid_str_next); testoldScrollView->Add(labelButton_next); } @@ -317,9 +318,9 @@ namespace OHOS return true; } - UIScrollView *testoldView::testoldInitIView() + UIScrollView *testoldView::testoldInitIView(uint8_t id) { - if (!testoldScrollViewcrollViewinit()) + if (!testoldScrollViewcrollViewinit(id)) { return nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp index fb33f7cd8..e23cba250 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp @@ -4,6 +4,7 @@ #include "producttest/include/testspeak.h" #include "AlarmClockModel.h" #include "cmsis_os2.h" +#include "producttest/include/testView.h" #ifdef __cplusplus #if __cplusplus extern "C" @@ -172,7 +173,7 @@ namespace OHOS - bool testSPEAKView::tesSPEAKScrollViewcrollViewinit(void) + bool testSPEAKView::tesSPEAKScrollViewcrollViewinit(uint8_t id) { testSPEAKScrollView = new UIScrollView(); @@ -225,7 +226,7 @@ namespace OHOS } testSPEAKScrollView->SetOnDragListener(draglistener); - labelButton_next= testAboutView::GetInstance()->init_button_next(267,220,"motorButton_next"); + labelButton_next= testAboutView::GetInstance()->init_button_next(267,220,Test_ViewMapper_t[id].viewid_str_next); testSPEAKScrollView->Add(labelButton_next); Title= testAboutView::GetInstance()->init_title(120,45,"SPEAK_TEST"); @@ -246,9 +247,9 @@ namespace OHOS return true; } - UIScrollView *testSPEAKView::testSPEAKInitIView() + UIScrollView *testSPEAKView::testSPEAKInitIView(uint8_t id) { - if (!tesSPEAKScrollViewcrollViewinit()) + if (!tesSPEAKScrollViewcrollViewinit(id)) { return nullptr; } -- 2.17.1