From 34f7eaaefb3e13adf96a67b1409b7e129a580367 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Tue, 12 Nov 2024 15:59:26 +0800 Subject: [PATCH] =?utf8?q?=E8=A1=A8=E7=9B=98=E5=AE=89=E8=A3=85=E5=A4=B1?= =?utf8?q?=E8=B4=A5=E6=8F=90=E7=A4=BA=E8=AF=AD=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../service/ble_service/blemoder/bletest.h | 2 + .../service/ble_service/bleservice/bleEvent.c | 14 ++-- .../msg_center/src/notify/transmitting.cpp | 73 ++++++++++++++++++- 3 files changed, 81 insertions(+), 8 deletions(-) diff --git a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h index 95c071aaa..847b81495 100644 --- a/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h +++ b/code/sdk/application/wearable/service/ble_service/blemoder/bletest.h @@ -35,6 +35,8 @@ extern "C" TRANS_DIAL_SUCC, TRANS_DIAL_FAIL, + TRANS_DIAL_MAX_FAIL, + TRANS_OTA_TRANSMITTING, TRANS_OTA_SUCC, TRANS_OTA_FAIL, diff --git a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c index a4d06bde2..71ab13542 100644 --- a/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c +++ b/code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c @@ -7333,7 +7333,7 @@ errcode_t decode_single_dial_info(ble_read_data *buffer_handle) if (check_dial_freespace(dialinfo.dial_uid, file_size) == false) { - TRANSMIT_DATA=TRANS_DIAL_FAIL; + TRANSMIT_DATA=TRANS_DIAL_MAX_FAIL; CustomEventPublish(TOPIC_EVENT_BLE_TRANSMIT,&TRANSMIT_DATA,1); return ERRCODE_FAIL; } @@ -7801,11 +7801,13 @@ void type2AE0Data(ble_read_data *buffer_handle) if (decode_dial_info( buffer_handle) == ERRCODE_SUCC) { - if(ble_dial_uid >=5 && get_dial_num()>=MAX_BLE_EVENT_DIAL_NUM) - { - ble_reply_cmd(DIAL_FILE_RECV_CMD,3); - } - else + //if(ble_dial_uid >=5 && + // if(get_dial_num()>=MAX_BLE_EVENT_DIAL_NUM) + // { + // ble_reply_cmd(DIAL_FILE_RECV_CMD,3); + + // } + //else { ble_reply_cmd(DIAL_FILE_RECV_CMD,1); diff --git a/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp b/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp index 8d6196b81..e0bd21606 100644 --- a/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/notify/transmitting.cpp @@ -739,6 +739,68 @@ namespace OHOS // Add to rootView UIViewGroup_transmitting->Add(label_); label_->SetVisible(true); + } + + + void creat_down_max_Dial_fail() + { + if (Title == nullptr) { + Title = new UILabelExt(); + } + Title->SetPosition(173, 51); // widget's left position and top position + Title->Resize(800, 88); // widget's width and height + Title->SetViewId("label1");// Set style + Title->SetStyle(STYLE_TEXT_FONT, 30); + + // Set additional property + Title->SetText("操作失败");//TODO:多国语言 + //Title->SetTextId (STR_DIAL_FAIL_TITLE); + Title->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + Title->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + Title->SetRollSpeed(0); + Title->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + + // Add to rootView + UIViewGroup_transmitting->Add(Title); + Title->SetVisible(true); + + + if (label_ == nullptr) { + label_ = new UILabelExt(); + } + label_->SetPosition(60, 281); // widget's left position and top position + label_->Resize(345, 101); // widget's width and height + label_->SetViewId("label2");// Set style + label_->SetStyle(STYLE_TEXT_FONT, 30); + + // Set additional property + + label_->SetText("离线表盘个数已经超过最大或内存不足 请到app删除部分表盘再进行下载");//TODO:多国语言 + + label_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + label_->SetTextColor(Color::GetColorFromRGBA(0xAA, 0xAA, 0xAA, 0xff)); + label_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); + label_->SetRollSpeed(0); + label_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30); + + + + if (transmitting_img == nullptr) + { + transmitting_img = new UIImageView(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemUpdateView::KUMILOGOImage new fail!"); + } + transmitting_img->SetPosition(193, 150,80, 80); + const char *imagesPath = TRANSMITTING_FAIL_PATH; + transmitting_img->SetSrc(imagesPath); + UIViewGroup_transmitting->Add(transmitting_img); + + // Add to rootView + UIViewGroup_transmitting->Add(label_); + label_->SetVisible(true); + + + } void creat_down_Dial_fail() @@ -773,8 +835,11 @@ namespace OHOS label_->SetStyle(STYLE_TEXT_FONT, 30); // Set additional property - label_->SetText("离线表盘个数已经超过最大 请到app删除部分表盘再进行下载");//TODO:多国语言 - // label_->SetTextId(STR_DIAL_FAIL_LABEL); + + + label_->SetTextId(STR_DIAL_FAIL_LABEL); + + label_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); label_->SetTextColor(Color::GetColorFromRGBA(0xAA, 0xAA, 0xAA, 0xff)); label_->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER); @@ -894,6 +959,10 @@ namespace OHOS case TRANS_DIAL_FAIL: creat_down_Dial_fail(); break; + case TRANS_DIAL_MAX_FAIL: + creat_down_max_Dial_fail(); + break; + case TRANS_OTA_TRANSMITTING: creat_down_OTA(); break; -- 2.17.1