九天ai修改为星辰ai 2826/target/1
authorluozheng <1732036298@qq.com>
Fri, 28 Nov 2025 04:56:25 +0000 (12:56 +0800)
committerluozheng <1732036298@qq.com>
Fri, 28 Nov 2025 04:56:25 +0000 (12:56 +0800)
code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceModel.h
code/sdk/application/wearable/fd230app/nativeui/aivoice/include/AiVoiceView.h
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceBluetoothFailedStartView.cpp
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AiVoiceView.cpp
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceConnectTimeoutView.cpp
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceMobileDataFailedStartView.cpp
code/sdk/application/wearable/fd230app/nativeui/aivoice/src/AivoiceReturnResultTextView.cpp
code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodes_xingchen.bin [new file with mode: 0644]

index 33c74ec..a0b7d42 100644 (file)
@@ -21,6 +21,8 @@
 // 设置当前使用的音频类型,0 表示 PCM,1 表示 SBC,2 表示 MSBC
 #define CURRENT_AIAUDIO_TYPE AIAUDIO_TYPE_SBC
 
+#define AI_VOICE_XINGCHEN 1  //打开星辰康瑞的宏
+
 #if defined(SUPPORT_CHINA_MOBILE_DMP) || defined(SUPPORT_CHINA_MOBILE_AI_REGULATION)
     #define AI_VOICE_FD230  // 九天版本
 #elif defined(BOARD_N9)
index 2d743b9..1b19fa4 100644 (file)
@@ -44,6 +44,7 @@ namespace OHOS
     static constexpr const char *AIMODEL_IFLYTEK_SPARK_PATH = "/user/res/AIVoice/aimodels/aimodes_iflytek_spark.bin";   /*讯飞星火*/
     static constexpr const char *AIMODEL_DEEPSEEK_PATH = "/user/res/AIVoice/aimodels/aimodes_deepseek.bin";             /*deepseek*/
     static constexpr const char *AIMODEL_LINGXI_PATH = "/user/res/AIVoice/aimodels/aimodels_lingxi.bin";                /*jiutian*/
+    static constexpr const char *AIMODEL_XINGCHEN_PATH = "/user/res/AIVoice/aimodels/aimodes_xingchen.bin";             /*星辰ai*/
 
     /*组件ID*/
     static constexpr const char *AIVOICE_START_CHAT_BUTTON_VIEW_ID = "aivoice_start_chat_button_view_id"; // 开始对话
@@ -79,7 +80,11 @@ namespace OHOS
         {STR_DEEPSEEK, AIMODEL_DEEPSEEK_PATH},
         {STR_IFLYTEK_SPARK, AIMODEL_IFLYTEK_SPARK_PATH},
         {STR_AIMODES_CHATGPT, AIMODEL_CHATGPT_ON_PATH},
+        #if (AI_VOICE_LINGXI)
         {STR_JIUTIAN, AIMODEL_LINGXI_PATH},
+        #else
+        {STR_JIUTIAN, AIMODEL_XINGCHEN_PATH},
+        #endif
     };
 
     class AiVoicePresenter;
index d0a36eb..a35299f 100644 (file)
@@ -89,11 +89,18 @@ namespace OHOS
         label->SetPosition(labelconfig.left, labelconfig.top, labelconfig.width, labelconfig.height);
         label->SetStyle(STYLE_TEXT_FONT, labelconfig.fontSize);
         label->SetStyle(STYLE_LINE_HEIGHT, labelconfig.lineHeigh);
-        //TOOD: 待优化
-        // if(labelconfig.textId == STR_DEEPSEEK) {
-        //     label->SetText("DeepSeek");
-        // } else
+        if(labelconfig.textId == STR_JIUTIAN)
+        { 
+            #if AI_VOICE_XINGCHEN
+            label->SetText("星辰康瑞");
+            #else
             label->SetTextId(labelconfig.textId);
+            #endif
+        }
+        else
+        {
+            label->SetTextId(labelconfig.textId);
+        }
         label->SetLineBreakMode(labelconfig.lineBreakMode);
         label->SetRollSpeed(23);
         label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
@@ -278,15 +285,19 @@ namespace OHOS
     {
         if (title)
         {
-            // if(textId == STR_DEEPSEEK) 
-            // {
-            //     title->SetText("DeepSeek");
-            // } 
-            // else 
-            // {
-            title->SetTextId(textId);
-            title->ForceResetText();
-            // }
+            if(textId == STR_JIUTIAN)
+            { 
+                #if AI_VOICE_XINGCHEN
+                title->SetText("星辰康瑞");
+                #else
+                title->SetTextId(textId);
+                #endif
+            }
+            else
+            {
+                title->SetTextId(textId);
+                title->ForceResetText();
+            }
         }
     }
 
index e31a6e8..c1d6641 100644 (file)
@@ -184,13 +184,16 @@ namespace OHOS
         label->SetPosition(labelconfig.left, labelconfig.top, labelconfig.width, labelconfig.height);
         label->SetStyle(STYLE_TEXT_FONT, labelconfig.fontSize);
         label->SetStyle(STYLE_LINE_HEIGHT, labelconfig.lineHeigh);
-        // // TOOD: 待优化
-        // if (labelconfig.textId == STR_DEEPSEEK)
-        // {
-        //     label->SetText("DeepSeek");
-        // }
-        // else
-        label->SetTextId(labelconfig.textId);
+        if(labelconfig.textId == STR_JIUTIAN)
+        {
+            #if AI_VOICE_XINGCHEN
+            label->SetText("星辰康瑞");
+            #else
+            label->SetTextId(labelconfig.textId);
+            #endif
+        } 
+        else
+            label->SetTextId(labelconfig.textId);
         label->SetLineBreakMode(labelconfig.lineBreakMode);
         label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
         label->SetRollSpeed(23);
@@ -1193,15 +1196,19 @@ namespace OHOS
         int textId = AiVoiceModel::GetInstance().GetAiModelTextId();
         if (title)
         {
-            // if (textId == STR_DEEPSEEK)
-            // {
-            //     title->SetText("DeepSeek");
-            // }
-            // else
-            // {
-            title->SetTextId(textId);
-            title->ForceResetText();
-            // }
+            if(textId == STR_JIUTIAN)
+            {
+                #if AI_VOICE_XINGCHEN
+                title->SetText("星辰康瑞");
+                #else
+                title->SetTextId(textId);
+                #endif
+            } 
+            else
+            {
+                title->SetTextId(textId);
+                title->ForceResetText();
+            }
         }
         if (aiModelImage)
         {
index f831ec6..d1038e1 100644 (file)
@@ -85,7 +85,18 @@ namespace OHOS
         // if(labelconfig.textId == STR_DEEPSEEK) {
         //     label->SetText("DeepSeek");
         // } else
+        if(labelconfig.textId == STR_JIUTIAN)
+        {
+            #if AI_VOICE_XINGCHEN
+            label->SetText("星辰康瑞");
+            #else
             label->SetTextId(labelconfig.textId);
+            #endif
+        }
+        else
+        {
+            label->SetTextId(labelconfig.textId);
+        }
         label->SetLineBreakMode(labelconfig.lineBreakMode);
         label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
         label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelconfig.fontSize);
@@ -269,15 +280,19 @@ namespace OHOS
     {
         if (title)
         {
-            // if(textId == STR_DEEPSEEK) 
-            // {
-            //     title->SetText("DeepSeek");
-            // } 
-            // else 
-            // {
-            title->SetTextId(textId);
-            title->ForceResetText();
-            // }
+            if(textId == STR_JIUTIAN)
+            {
+                #if AI_VOICE_XINGCHEN
+                title->SetText("星辰康瑞");
+                #else
+                title->SetTextId(textId);
+                #endif
+            }
+            else
+            {
+                title->SetTextId(textId);
+                title->ForceResetText();
+            }
         }
     }
 
index 100c7f7..4019c3d 100644 (file)
@@ -93,7 +93,18 @@ namespace OHOS
         // if(labelconfig.textId == STR_DEEPSEEK) {
         //     label->SetText("DeepSeek");
         // } else
+        if(labelconfig.textId == STR_JIUTIAN)
+        {
+            #if AI_VOICE_XINGCHEN
+            label->SetText("星辰康瑞");
+            #else
             label->SetTextId(labelconfig.textId);
+            #endif
+        }
+        else
+        {
+            label->SetTextId(labelconfig.textId);
+        }
         label->SetLineBreakMode(labelconfig.lineBreakMode);
         label->SetRollSpeed(23);
         label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
@@ -279,15 +290,19 @@ namespace OHOS
     {
         if (title)
         {
-            // if(textId == STR_DEEPSEEK) 
-            // {
-            //     title->SetText("DeepSeek");
-            // } 
-            // else 
-            // {
-            title->SetTextId(textId);
-            title->ForceResetText();
-            // }
+            if(textId == STR_JIUTIAN)
+            {
+                #if AI_VOICE_XINGCHEN
+                title->SetText("星辰康瑞");
+                #else
+                title->SetTextId(textId);
+                #endif
+            }
+            else
+            {
+                title->SetTextId(textId);
+                title->ForceResetText();
+            }
         }
     }
 }
\ No newline at end of file
index 62b50ae..22909cc 100644 (file)
@@ -137,7 +137,18 @@ namespace OHOS
         //  if(labelconfig.textId == STR_DEEPSEEK) {
         //      label->SetText("DeepSeek");
         //  } else
-        label->SetTextId(labelconfig.textId);
+        if(labelconfig.textId == STR_JIUTIAN)
+        {
+            #if AI_VOICE_XINGCHEN
+            label->SetText("星辰康瑞");
+            #else
+            label->SetTextId(labelconfig.textId);
+            #endif
+        }
+        else
+        {
+            label->SetTextId(labelconfig.textId);
+        }
         label->SetLineBreakMode(labelconfig.lineBreakMode);
         label->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
         label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelconfig.fontSize);
@@ -361,15 +372,19 @@ namespace OHOS
     {
         if (title)
         {
-            // if(textId == STR_DEEPSEEK)
-            // {
-            //     title->SetText("DeepSeek");
-            // }
-            // else
-            // {
-            title->SetTextId(textId);
-            title->ForceResetText();
-            // }
+            if(textId == STR_JIUTIAN)
+            {
+                #if AI_VOICE_XINGCHEN
+                title->SetText("星辰康瑞");
+                #else
+                title->SetTextId(textId);
+                #endif
+            }
+            else
+            {
+                title->SetTextId(textId);
+                title->ForceResetText();
+            }
         }
     }
 
diff --git a/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodes_xingchen.bin b/code/sdk/build/config/target_config/brandy/mk_fs_image/fd230/fs/user/res/AIVoice/aimodels/aimodes_xingchen.bin
new file mode 100644 (file)
index 0000000..d1bc653
--- /dev/null
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a5b2149e4fafc3628f3e4f1bc61c37cc6d8e0d56d37bbcc8a0ed38acbd839f78
+size 14376