重写产测部分代码,优化结构,更方便后续更改和添加 561/target/2 562/1 562/head 563/target/1 564/target/1
authorhcj <1224667075@qq.com>
Sat, 20 Jul 2024 04:05:16 +0000 (12:05 +0800)
committerhcj <1224667075@qq.com>
Sat, 20 Jul 2024 04:05:16 +0000 (12:05 +0800)
38 files changed:
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testA5133.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testLCD.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testSEChipTest.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testTP.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testView.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testabout.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testbt.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testbutton.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testcat1.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testchanging.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testgsenson.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testhrsenson.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testluminance.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmagnetic.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmicrophone.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testmotor.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testold.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testspeak.h
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testA5133.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testSEChipTest.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testabout.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbt.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testcat1.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testchanging.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testgsenson.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testhrsenson.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testluminance.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmagnetic.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmotor.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp

index cabadad..9bb5779 100644 (file)
@@ -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};
      
       
index 79114e1..2d655c7 100644 (file)
@@ -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;
index 6d7f831..f23c860 100644 (file)
@@ -43,9 +43,7 @@ namespace OHOS
         FACTORYRESE,\r
 #ifdef SUPPORT_A5133_SERVICE\r
         RF5133,\r
-#endif\r
-        TEST_1,\r
-        \r
+#endif  \r
         MAX_TESTVIEWID,\r
     } TEST_VIEW;\r
 \r
index 58b1673..a431acc 100644 (file)
@@ -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};
 
index ea7d1c4..0c3c96f 100644 (file)
@@ -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;
index 1c70adb..0c69ff9 100644 (file)
@@ -34,6 +34,9 @@
 namespace OHOS\r
 {\r
     \r
+\r
+   \r
+    \r
     class testPresenter;\r
     class testView : public View<testPresenter>\r
     {\r
@@ -132,9 +135,20 @@ namespace OHOS
     #ifdef SUPPORT_A5133_SERVICE\r
         testA5133View  *test_A5133_view{nullptr};\r
     #endif\r
-        UILabelButtonExt *button[20]={NULL};\r
+        UILabelButtonExt *button[30]={NULL};\r
         bool initViewStatus{false};\r
     };\r
+     struct test_ext\r
+    {\r
+            const int16_t viewId;\r
+            char *viewid_str;\r
+            char *Labe_str;\r
+            char *viewid_str_next;\r
+            bool (testView::*func)(int16_t thisView);\r
+            bool enable_falg;\r
+    };\r
+     extern test_ext Test_ViewMapper_t[];\r
+\r
 } // namespace OHOS\r
 \r
 #endif
\ No newline at end of file
index 872c189..4dc8630 100644 (file)
@@ -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"
index 69df1cf..d4120bf 100644 (file)
@@ -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};
      
       
index dbf28d8..9c646c2 100644 (file)
@@ -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};
index 60046d0..d4263ad 100644 (file)
@@ -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};
index 87c392f..730c3bc 100644 (file)
@@ -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};           // 标题
index 86c26f3..c0017ae 100644 (file)
@@ -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};
index f905166..7acd8d1 100644 (file)
@@ -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};
index e5c8c34..ff3b740 100644 (file)
@@ -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;
index 8577d6f..2b726a8 100644 (file)
@@ -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};
index e93389f..4c2b912 100644 (file)
@@ -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};
index 6fc4947..cb68649 100644 (file)
@@ -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};
index 6ceb400..d059dfb 100644 (file)
@@ -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);
     };
 }
index 9b50f80..7c5e977 100644 (file)
@@ -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;
index d694701..0a0a2c2 100644 (file)
@@ -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;
         }
index 753eced..ec816a7 100644 (file)
@@ -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;
         }
index db7463f..60351b6 100644 (file)
@@ -27,42 +27,9 @@ namespace OHOS
         "TP_13","TP_14", "TP_15", "TP_16",\r
     };\r
 \r
-    struct TEST_ext_p\r
-    {\r
-            const int16_t viewId;\r
-            char *viewid_str;\r
-            char *viewid_str_next;\r
-            bool enable_falg;\r
-    };\r
-    \r
 \r
     // 2.ViewMapper[] 是一个静态的视图映射数组,将视图ID与MainStopWatchView类中的特定成员函数指针进行了绑定。\r
-        static TEST_ext_p ViewMapper_t[] = \r
-        {\r
-        {VISON,"AboutTheWatchButton", "LCDButton_next",true},\r
-        {LCD,"LCDButton", "TPButton_next",true},\r
-        {TP,"TPButton", "MAGETICButton_next",true},\r
-        {MAGETIC,"MAGETICButton", "luminanceButton_next",true},\r
-        {LUMINANCE,"luminanceButton", "chargingButton_next",true},\r
-        {CHAR,"chargingButton", "speakButton_next",true},\r
-        {SPEAK,"speakButton", "motorButton_next",true},\r
-        {MOTOR,"motorButton", "cat1button_next",true},\r
-        {CAT1,"cat1button", "buttonbutton_next",true},\r
-        {BUTTON,"buttonbutton", "microphonebutton_next",true},\r
-        {MICROPHONE,"microphonebutton", "hrsensonbutton_next",true},\r
-        {HRSENSON,"hrsensonbutton", "gsensonbutton_next",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
-        {FACTORYRESE,"FactoryReset","xxxxxxxxx",true},\r
-    #ifdef SUPPORT_A5133_SERVICE\r
-        {RF5133,"RF5133","xxxxxxxxx",true},\r
-    #endif\r
-        };\r
+        extern test_ext Test_ViewMapper_t[];\r
         // {FACTORYRESETVIEW,"FactoryResetButton",true},\r
         // {SYSTEMLUPGRADE,"systemupgread",true},\r
         // {TEST,"testButton",true}};\r
@@ -186,10 +153,10 @@ namespace OHOS
     bool testPresenter::OnClick(UIView &view, const ClickEvent &event)\r
     {\r
         testView *p_SystemView = testView::GetInstance();\r
-        int len=sizeof(ViewMapper_t)/sizeof(TEST_ext_p);\r
+        int len=MAX_TESTVIEWID;//sizeof(Test_ViewMapper_t)/sizeof(Test_ViewMapper_t[0]);\r
         //int len=5;\r
         // 根据控件id查找是哪个控件触发了点击回调\r
-        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnClick");\r
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "OnClick %s",view.GetViewId());\r
  \r
         if(strcmp(view.GetViewId(),"xxxx") == 0)  \r
         { \r
@@ -228,18 +195,19 @@ namespace OHOS
             return true;\r
         }\r
 \r
+\r
         for(int i=0;i<len;i++)\r
         {\r
-            if(strcmp(view.GetViewId(),ViewMapper_t[i].viewid_str) == 0)\r
+            if(strcmp(view.GetViewId(),Test_ViewMapper_t[i].viewid_str) == 0)\r
             {\r
-                if(ViewMapper_t[i].enable_falg==true)\r
-                testView::GetInstance()->ChangeView(TESTVIEW, ViewMapper_t[i].viewId);\r
+                if(Test_ViewMapper_t[i].enable_falg==true)\r
+                testView::GetInstance()->ChangeView(TESTVIEW, Test_ViewMapper_t[i].viewId);\r
                 return true;\r
             }\r
-            if(strcmp(view.GetViewId(),ViewMapper_t[i].viewid_str_next) == 0)\r
+            if(strcmp(view.GetViewId(),Test_ViewMapper_t[i].viewid_str_next) == 0)\r
             {\r
-                if(ViewMapper_t[i+1].enable_falg==true)\r
-                testView::GetInstance()->ChangeView(ViewMapper_t[i].viewId, ViewMapper_t[i+1].viewId);\r
+                if(Test_ViewMapper_t[i+1].enable_falg==true)\r
+                testView::GetInstance()->ChangeView(Test_ViewMapper_t[i].viewId, Test_ViewMapper_t[i+1].viewId);\r
                 return true;\r
             }\r
 \r
index 86de121..c11163e 100644 (file)
@@ -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");
index 5c57c07..884005e 100644 (file)
@@ -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;
         }
index 5cdab65..34769a5 100644 (file)
@@ -12,41 +12,30 @@ namespace OHOS
 \r
     static testView *g_pSystemView{nullptr};\r
 \r
-    struct test_ext\r
-    {\r
-            const int16_t viewId;\r
-            char *viewid_str;\r
-            char *Labe_str;\r
-            bool (testView::*func)(int16_t thisView);\r
-    };\r
-    \r
-\r
     // 2.ViewMapper[] 是一个静态的视图映射数组,将视图ID与MainStopWatchView类中的特定成员函数指针进行了绑定。\r
-        static test_ext ViewMapper_t[] = {\r
-        {VISON,"AboutTheWatchButton","Verison",&testView::ChangeSystemAboutView},\r
-        {LCD,"LCDButton","LCD",&testView::ChangeLCDTESTView},\r
-        {TP,"TPButton","TP", &testView::ChangeTPTESTView},\r
-        {MAGETIC,"MAGETICButton","Magetic", &testView::ChangeMGTESTView},\r
-        {LUMINANCE,"luminanceButton","luminance", &testView::ChangLUMTESTView},\r
-        {CHAR,"chargingButton","bat&charger", &testView::ChangchargingTESTView},\r
-        {SPEAK,"speakButton","speak", &testView::ChangspeakTESTView},\r
-        {MOTOR,"motorButton","motor", &testView::ChangmotorTESTView},\r
-        {CAT1,"cat1button","CAT1", &testView::ChangeCAT1TESTView},\r
-        {BUTTON,"buttonbutton","button" ,&testView::ChangKEYTESTView},\r
-        {MICROPHONE,"microphonebutton","microphone" ,&testView::ChangeMPTESTView},\r
-        {HRSENSON,"hrsensonbutton","hrsensor" ,&testView::ChangeHRTESTView},\r
-        {GSENSON,"gsensonbutton","gsensor" ,&testView::ChangeGTESTView},\r
-        {BTTEST,"BTbutton","BT" ,&testView::ChangeBTTESTView},\r
-\r
-        {SEChipTest,"SEChipTestbutton","SEChipTest" ,&testView::ChangeSEChipTESTView},\r
-\r
-\r
-        {OLDTEST,"oldtestbutton","aging" ,&testView::ChangeoldTESTView},\r
-        {DEEPSLEEP,"deepsleep","DeepSleepCurrent" ,&testView::ChangeoldTESTView},\r
-        {shutdown,"shutdown","shutdown" ,&testView::ChangeoldTESTView},\r
-        {FACTORYRESE,"FactoryReset","FactoryReset", &testView::ChangeoldTESTView},\r
+        test_ext Test_ViewMapper_t[] = {\r
+        {TESTVIEW,"","","",&testView::ChangeSystemAboutView,false},//占位,空的\r
+        {VISON,"AboutTheWatchButton","Verison","AboutTheWatchButton_next",&testView::ChangeSystemAboutView,true},\r
+        {LCD,"LCDButton","LCD","LCDButton_next",&testView::ChangeLCDTESTView,true},\r
+        {TP,"TPButton","TP","TPButton_next", &testView::ChangeTPTESTView,true},\r
+        {MAGETIC,"MAGETICButton","Magetic","MAGETICButton_next", &testView::ChangeMGTESTView,true},\r
+        {LUMINANCE,"luminanceButton","luminance","luminanceButton_next", &testView::ChangLUMTESTView,true},\r
+        {CHAR,"chargingButton","bat&charger","chargingButton_next",&testView::ChangchargingTESTView,true},\r
+        {SPEAK,"speakButton","speak","speakButton_next" ,&testView::ChangspeakTESTView,true},\r
+        {MOTOR,"motorButton","motor","motorButton_next" ,&testView::ChangmotorTESTView,true},\r
+        {CAT1,"cat1button","CAT1", "cat1button_next",&testView::ChangeCAT1TESTView,true},\r
+        {BUTTON,"buttonbutton","button" ,"buttonbutton_next",&testView::ChangKEYTESTView,true},\r
+        {MICROPHONE,"microphonebutton","microphone", "microphonebutton_next",&testView::ChangeMPTESTView,true},\r
+        {HRSENSON,"hrsensonbutton","hrsensor", "hrsensonbutton_next",&testView::ChangeHRTESTView,true},\r
+        {GSENSON,"gsensonbutton","gsensor","gsensonbutton_next" ,&testView::ChangeGTESTView,true},\r
+        {BTTEST,"BTbutton","BT" ,"BTbutton_next",&testView::ChangeBTTESTView,true},\r
+        {SEChipTest,"SEChipTestbutton","SEChipTest","SEChipTestbutton_next" ,&testView::ChangeSEChipTESTView,true},\r
+        {OLDTEST,"oldtestbutton","aging" ,"oldtestexit",&testView::ChangeoldTESTView,true},\r
+        {DEEPSLEEP,"deepsleep","DeepSleepCurrent","xxxxxxxxx" ,&testView::ChangeoldTESTView,true},\r
+        {shutdown,"shutdown","shutdown", "xxxxxxxxx",&testView::ChangeoldTESTView,true},\r
+        {FACTORYRESE,"FactoryReset","FactoryReset","xxxxxxxxx", &testView::ChangeoldTESTView,true},\r
     #ifdef SUPPORT_A5133_SERVICE\r
-        {RF5133,"RF5133","RF5133", &testView::ChangeA5133TESTView},\r
+        {RF5133,"RF5133","RF5133", "xxxxxxxxx",&testView::ChangeA5133TESTView,true},\r
     #endif\r
         // {SYSTEMLUPGRADE,"systemupgread","系统升级",&testView::ChangeSystemAboutView},\r
         // {TEST,"testButton","测试模式", &testView::ChangeSystemAboutView},\r
@@ -87,7 +76,7 @@ namespace OHOS
             //     draglistener = nullptr;\r
             // }\r
 \r
-            int funcSize = sizeof(ViewMapper_t) / sizeof(ViewMapper_t[TESTVIEW]);\r
+            int funcSize = sizeof(Test_ViewMapper_t) / sizeof(Test_ViewMapper_t[TESTVIEW]);\r
             for (int i = 0; i < funcSize; i++)\r
             {\r
                 if(button[i])\r
@@ -293,12 +282,12 @@ namespace OHOS
         buttonconfig.w = w;\r
         buttonconfig.h = h;\r
 \r
-        int len =sizeof(ViewMapper_t)/sizeof(test_ext);\r
+        int len =sizeof(Test_ViewMapper_t)/sizeof(Test_ViewMapper_t[0]);\r
 \r
-        for(int i=0;i<len;i++)\r
+        for(int i=1;i<len;i++)\r
         {\r
-            buttonconfig.str=ViewMapper_t[i].Labe_str;\r
-            buttonconfig.ViewId = ViewMapper_t[i].viewid_str;\r
+            buttonconfig.str=Test_ViewMapper_t[i].Labe_str;\r
+            buttonconfig.ViewId = Test_ViewMapper_t[i].viewid_str;\r
             buttonconfig.ImageSrc = imagsrc;\r
             buttonconfig.label_x=40;\r
             buttonconfig.label_y=0;\r
@@ -336,7 +325,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_about_view->SystemAbouTheWatchtInitIView();\r
+            SystemScrollView[thisView] = test_about_view->SystemAbouTheWatchtInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -353,7 +342,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_LCD_view->testLCDInitIView();\r
+            SystemScrollView[thisView] = test_LCD_view->testLCDInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -370,7 +359,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_TP_view->testTPInitIView();\r
+            SystemScrollView[thisView] = test_TP_view->testTPInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -387,7 +376,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_MG_view->testmagicInitIView();\r
+            SystemScrollView[thisView] = test_MG_view->testmagicInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -404,7 +393,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_lum_view->testLUMInitIView();\r
+            SystemScrollView[thisView] = test_lum_view->testLUMInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -421,7 +410,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_charging_view->testCHANINGInitIView();\r
+            SystemScrollView[thisView] = test_charging_view->testCHANINGInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -438,7 +427,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_speak_view->testSPEAKInitIView();\r
+            SystemScrollView[thisView] = test_speak_view->testSPEAKInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -455,7 +444,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_motor_view->testMOTORInitIView();\r
+            SystemScrollView[thisView] = test_motor_view->testMOTORInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -472,7 +461,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_cat1_view->testcat1InitIView();\r
+            SystemScrollView[thisView] = test_cat1_view->testcat1InitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -489,7 +478,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_KEY_view->testBUTTONInitIView();\r
+            SystemScrollView[thisView] = test_KEY_view->testBUTTONInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -506,7 +495,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_MP_view->testmicrophoneInitIView();\r
+            SystemScrollView[thisView] = test_MP_view->testmicrophoneInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -523,7 +512,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_hr_view->testhrsensonInitIView();\r
+            SystemScrollView[thisView] = test_hr_view->testhrsensonInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -541,7 +530,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_G_view->testGSENSONInitIView();\r
+            SystemScrollView[thisView] = test_G_view->testGSENSONInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -558,7 +547,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_old_view->testoldInitIView();\r
+            SystemScrollView[thisView] = test_old_view->testoldInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -575,7 +564,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_BT_view->testBTInitIView();\r
+            SystemScrollView[thisView] = test_BT_view->testBTInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -593,7 +582,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_SEChip_view->SEChipInitIView();\r
+            SystemScrollView[thisView] = test_SEChip_view->SEChipInitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -610,7 +599,7 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView:: new scrollView[%d] fail", thisView);\r
                 return false;\r
             }\r
-            SystemScrollView[thisView] = test_A5133_view->testA5133InitIView();\r
+            SystemScrollView[thisView] = test_A5133_view->testA5133InitIView(thisView);\r
             RootView::GetInstance()->Add(SystemScrollView[thisView]);\r
         }\r
         return true;\r
@@ -632,12 +621,12 @@ namespace OHOS
     // 3.根据传入的interface参数执行相应视图ID关联的成员函数。\r
     bool testView::ClickFunc(int16_t interface)\r
     {\r
-        int funcSize = sizeof(ViewMapper_t) / sizeof(ViewMapper_t[TESTVIEW]);\r
-        for (int i = 0; i < funcSize; i++)\r
+        int funcSize = sizeof(Test_ViewMapper_t) / sizeof(Test_ViewMapper_t[TESTVIEW]);\r
+        for (int i = 1; i < funcSize; i++)\r
         {\r
-            if (interface == ViewMapper_t[i].viewId)\r
+            if (interface == Test_ViewMapper_t[i].viewId)\r
             {\r
-                bool jug = (this->*(ViewMapper_t[i].func))(interface);\r
+                bool jug = (this->*(Test_ViewMapper_t[i].func))(interface);\r
                 if (jug == false)\r
                 {\r
                     return false;\r
@@ -808,7 +797,7 @@ namespace OHOS
         \r
         SystemScrollView[TESTVIEW]->Add(SystemLabel);\r
 \r
-        int len =sizeof(ViewMapper_t)/sizeof(test_ext);\r
+        int len =sizeof(Test_ViewMapper_t)/sizeof(Test_ViewMapper_t[0]);\r
 \r
         for(int i=0;i<len;i++)\r
         {\r
index 5427d17..81ea642 100644 (file)
@@ -4,7 +4,10 @@
 #include "producttest/include/testabout.h"
 #include "ConfigModel.h"
 
-
+#include "cat1_server.h"
+#include "cat1_ctl.h"
+#include "custom_runtime.h"
+#include "producttest/include/testView.h"
 
 
 #define WATCH_ABOUT_TITLE_HEIGHT 50
@@ -186,7 +189,7 @@ namespace OHOS
         return label;
     }
 
-    bool testAboutView::testAboutTheWatchScrollViewinit(void)
+    bool testAboutView::testAboutTheWatchScrollViewinit(uint8_t id)
     {
         testAboutTheWatchScrollView = new UIScrollView();
         if (testAboutTheWatchScrollView == nullptr)
@@ -213,9 +216,9 @@ namespace OHOS
         return true;
     }
 
-    UIScrollView *testAboutView::SystemAbouTheWatchtInitIView()
+    UIScrollView *testAboutView::SystemAbouTheWatchtInitIView(uint8_t id)
     {
-        if (!testAboutTheWatchScrollViewinit())
+        if (!testAboutTheWatchScrollViewinit(id))
         {
             return nullptr;
         }
@@ -375,7 +378,7 @@ namespace OHOS
         /* -------------------------------------------------------------------------- */
         initViewStatus = true;
 
-        labelButton_next =init_button_next(165,400,"LCDButton_next");
+        labelButton_next =init_button_next(165,400,Test_ViewMapper_t[id].viewid_str_next);//"AboutTheWatchButton_next");
 
         testAboutTheWatchScrollView->Add(labelButton_next);
         return testAboutTheWatchScrollView;
index 87b92d3..b3f402a 100644 (file)
@@ -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;
         }
index 6307857..1702f6b 100644 (file)
@@ -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;
         }
index 8d4a7ab..beea8b8 100644 (file)
@@ -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;
         }
index adc5f1b..41f8caf 100644 (file)
@@ -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<UIView::OnDragListener *>(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;
         }
index c5bf575..03c9fe2 100644 (file)
@@ -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;
         }
index 10ec695..b1d6c9e 100644 (file)
@@ -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;
         }
index fa959fb..7b26e3c 100644 (file)
@@ -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;
         }
index 102cb53..b791d45 100644 (file)
@@ -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;
         }
index 42ce279..e018339 100644 (file)
@@ -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;
         }
index 2206ade..c3147c4 100644 (file)
@@ -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;
         }
index 4499b02..e9706dd 100644 (file)
@@ -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;
         }
index fb33f7c..e23cba2 100644 (file)
@@ -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;
         }