修复产测代码线程干扰问题
authorhcj <1224667075@qq.com>
Thu, 22 Aug 2024 07:36:20 +0000 (15:36 +0800)
committerhcj <1224667075@qq.com>
Thu, 22 Aug 2024 07:36:20 +0000 (15:36 +0800)
13 files changed:
code/sdk/application/wearable/fd230app/CMakeLists.txt
code/sdk/application/wearable/fd230app/nativeui/activity/src/ActivityModel.cpp
code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/include/testModel.h
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testModel.cpp
code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h
code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_serviceC.h [new file with mode: 0644]
code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp
code/sdk/drivers/peripheral/utils/CMakeLists.txt
code/sdk/drivers/peripheral/utils/custom_cmd_service.c

index 04d9dc4..42019e1 100644 (file)
@@ -733,6 +733,7 @@ set(SOURCES
     ${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/producttest/src/testModel.cpp
     
     #每日目标
     ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/goal/src/goalmodel.cpp
index 64371d4..f053aac 100644 (file)
@@ -142,9 +142,6 @@ static void Notify(void *args, const Topic topic, Request* request)
     if (request->msgId == TOPIC_EVENT_NEXTDAY_UPDATE) {
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "STEP:TOPIC_EVENT_NEXTDAY_UPDATE");
 
-        //午夜清除运动数据
-        do_cywee_service_check_msg(CYWEE_SERVICE_CMD_RESET_DAILY_DATA,NULL);
-        
         uint32_t refreshValue = OHOS::ActivityModel::GetInstance()->ZeroHourStepHandle();
         RefreshStepControls(refreshValue, TOPIC_EVENT_NEXTDAY_UPDATE);
     }
index dee89e0..9fd0b3f 100644 (file)
@@ -310,7 +310,10 @@ extern "C"
     {\r
         AlarmClockEventData unuse;\r
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmCallBackProcB");\r
-        AlarmTimerEventPublish(TOPIC_EVENT_NEXTDAY_UPDATE, unuse);\r
+         GraphicService::GetInstance()->PostGraphicEvent(\r
+            std::bind(AlarmTimerEventPublish, TOPIC_EVENT_NEXTDAY_UPDATE, unuse));\r
+\r
+       // AlarmTimerEventPublish(TOPIC_EVENT_NEXTDAY_UPDATE, unuse);\r
         SetZeroAlarm();\r
     }\r
 \r
index 4c9de35..4e813a8 100644 (file)
@@ -7,6 +7,7 @@ namespace OHOS
     {
     public:
         static testModel *GetInstance(void);
+        void testModelupdata(int);
 
     private:
         testModel() = default;
index 123eb54..36a0cdc 100644 (file)
@@ -188,7 +188,7 @@ namespace OHOS
     void testLCDView::LCDHideNextButton(void)
     {
         labelButton_next->SetVisible(false);
-        testLCDScrollView->Remove(Title);
+        Title->SetVisible(false);
     }
 
 #ifdef __cplusplus
@@ -208,9 +208,13 @@ extern "C"
 
     void factorytest_hide_test_lcd_button(void)
     {
-        testLCDView::GetInstance()->LCDHideNextButton();
-        if(MG_TEST_timer)
-            osTimerStop(MG_TEST_timer);
+        if(testLCDView::GetInstance())
+        {
+            testLCDView::GetInstance()->LCDHideNextButton();
+            if(MG_TEST_timer)
+                osTimerStop(MG_TEST_timer);
+        }
+       
     }
 
 #ifdef __cplusplus
index c653ac1..66cb476 100644 (file)
@@ -1,4 +1,6 @@
 #include "producttest/include/testModel.h"
+#include "producttest/include/testPresenter.h"
+#include "producttest/include/testLCDC.h"
 
 namespace OHOS
 {
@@ -9,4 +11,33 @@ namespace OHOS
         return &instance;
     }
 
+    void testModel::testModelupdata(int type)
+    {
+        switch (type)
+        {
+        case 1:
+            /* code */
+            break;
+        
+        default:
+            break;
+        }
+        if( testView::GetInstance())
+        {
+            testView::GetInstance()->ChangeView(TESTVIEW,LCD);
+           
+            factorytest_hide_test_lcd_button();
+            
+        }
+        else
+        printf("xxxxxxxxxxxxxxxxxxxxx\r\n");
+
+
+
+       return ;
+    }
+
+
+    
+
 }
\ No newline at end of file
index ae7ab8d..3cda8dc 100644 (file)
@@ -365,7 +365,10 @@ extern "C"
 \r
     void factorytest_enter_test_lcd_view(void)\r
     {\r
+        if( testView::GetInstance())\r
         testView::GetInstance()->ChangeView(TESTVIEW,LCD);\r
+        else\r
+        printf("xxxxxxxxxxxxxxxxxxxxx\r\n");\r
     }\r
 \r
     void factorytest_enter_test_button_view(void)\r
diff --git a/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_serviceC.h b/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_serviceC.h
new file mode 100644 (file)
index 0000000..1bd17e1
--- /dev/null
@@ -0,0 +1,44 @@
+/*** 
+ * @Date: 2024-07-12 19:25:33
+ * @LastEditors: Caisking 3449750381@qq.com
+ * @LastEditTime: 2024-08-20 18:34:42
+ * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h
+ */
+/*
+ * @Author: luozheng 1732036298@qq.com
+ * @Date: 2024-06-12 11:44:04
+ * @LastEditors: luozheng 1732036298@qq.com
+ * @LastEditTime: 2024-08-13 11:06:07
+ * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/uiservice/include/ui_service.h
+ */
+/*
+ * Copyright (c) 2021-2021 CompanyNameMagicTag.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OHOS_UI_SERVICE_C_H
+#define OHOS_UI_SERVICE_C_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define UI_SERVICE "uiservice"
+void HandleUpdatelcdMode(int);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // OHOS_UiService_SERVICE_H
index 1e0da34..141e540 100644 (file)
@@ -48,6 +48,9 @@
 
 #include "errcode.h"
 #include "pm_definition.h"
+#include "producttest/include/testModel.h"
+#include "ui_serviceC.h"
+
 extern "C" errcode_t uapi_pm_add_sleep_veto(pm_id_t veto_id);
 extern "C" errcode_t uapi_pm_remove_sleep_veto(pm_id_t veto_id);
 
@@ -633,6 +636,15 @@ extern "C"
         GraphicService::GetInstance()->PostGraphicEvent(
             std::bind(&OHOS::MainModel::UpdateDialState, &OHOS::MainModel::GetInstance()));
     }
+
+    void HandleUpdatelcdMode(int type)
+    {
+        WEARABLE_LOGI(WEARABLE_LOG_MODULE_UI_SERVICE, "HandleUpdateSilentMode");
+        GraphicService::GetInstance()->PostGraphicEvent(
+            std::bind(&OHOS::testModel::testModelupdata,OHOS::testModel::GetInstance(),type));
+    }
+
+
 /* -------------------------------------------------------------------------- */
 #ifdef __cplusplus
 }
index 3fec2b4..d2866b9 100644 (file)
@@ -57,7 +57,7 @@
 #include "producttest/include/testcat1.h"
 #endif
 #include <cywee_hal.h>
-
+#include "cywee_service.h"
 #include "goalview.h"
 #include "goalother.h"
 
@@ -498,6 +498,8 @@ void MsgCenterNotifyNextDayProc(const Topic topic, Request* req)
     HealthService::GetInstance()->ClearHourlyHeartRates();
     HealthService::GetInstance()->SaveDailyHeartRate();
 
+    //午夜清除运动数据
+    do_cywee_service_check_msg(CYWEE_SERVICE_CMD_RESET_DAILY_DATA,NULL);
 #endif
 }
 
@@ -1345,7 +1347,8 @@ void MsgCenterNotifybleAPPtraining(const Topic topic, Request* req)
 void MsgCenterNotifybleTransmit(const Topic topic, Request* req)
 {
     unused(topic);
-     uint8_t* data=(uint8_t*)req->data;
+    uint8_t* data=(uint8_t*)req->data;
+    NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE);
     
     if(data[0]==TRANS_FREE)
     {
index f9ca05e..ab3c733 100644 (file)
@@ -16,6 +16,8 @@ set(SOURCES
 set(PUBLIC_HEADER
     ${CMAKE_CURRENT_SOURCE_DIR}
     ${ROOT_DIR}/application/wearable/fd230app/nativeui/phoneservice/include
+    ${ROOT_DIR}/application/wearable/fd230app/nativeui/uiservice/include
+    
 )
 
 set(PRIVATE_HEADER
index 33c20a3..f5c8a48 100644 (file)
@@ -35,6 +35,8 @@
 
 #include "PhoneServiceC.h"
 
+#include "ui_serviceC.h"
+
 
 typedef struct
 {
@@ -138,11 +140,16 @@ static void custom_cmd_service_check_task(void const *arg)
         case CUSTOM_CMD_MSG_TYPE_LCD_TEST:
             if(mail.data[0] == 1)
             {
-                uapi_setScreenBrightness(255);
                 uapi_set_screen_on_api();
+                uapi_setScreenBrightness(255);
+                printf("111\n");
                 uapi_factorytest_enter_test_view(1);
-                uapi_factorytest_enter_test_lcd_view();
-                uapi_factorytest_hide_test_lcd_button();
+                HandleUpdatelcdMode(1);
+                // printf("222\n");
+                // LOS_Msleep(500);
+                // uapi_factorytest_enter_test_lcd_view();
+                // printf("333\n");
+                // uapi_factorytest_hide_test_lcd_button();
             }
             else
             {