整机产测修改
authorhcj <1224667075@qq.com>
Tue, 18 Jun 2024 12:22:17 +0000 (20:22 +0800)
committerhcj <1224667075@qq.com>
Tue, 18 Jun 2024 12:22:17 +0000 (20:22 +0800)
17 files changed:
code/sdk/application/wearable/fd230app/CMakeLists.txt
code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothModel.cpp
code/sdk/application/wearable/fd230app/nativeui/goal/src/goalview.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testPresenter.h
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testSEChipTest.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testView.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/src/testPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testSEChipTest.cpp [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.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/testgsenson.cpp
code/sdk/drivers/peripheral/config/include/ConfigModel.h
code/sdk/middleware/chips/brandy/pm/include/pm_definition.h
code/sdk/middleware/chips/brandy/pm/pm.c

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