From f40808ae8b3fd4ae3dc57102d73df4059172f1b8 Mon Sep 17 00:00:00 2001 From: renwj Date: Tue, 21 Mar 2023 19:55:46 +0800 Subject: [PATCH 1/9] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E8=AF=AD=E9=9F=B3=E5=81=B6=E7=8E=B0=E4=B8=8D=E6=92=AD?= =?UTF-8?q?=E6=8A=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/function/hmi/ui/MoGoHmiProvider.kt | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt index 6324592174..8d5ad1002c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt @@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui import android.content.Context import android.text.TextUtils +import android.util.* import android.view.ViewGroup import androidx.lifecycle.ProcessLifecycleOwner import androidx.lifecycle.lifecycleScope @@ -42,6 +43,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.zhjt.service_biz.BizConfig import kotlinx.coroutines.* +import kotlinx.coroutines.selects.* import java.util.concurrent.atomic.AtomicReference /** @@ -60,6 +62,8 @@ class MoGoHmiProvider : IMoGoHmiProvider { private var lastShowV2XJob: Job? = null private var context: Context? = null + private val scope by lazy { CoroutineScope(Dispatchers.Default + SupervisorJob()) } + override fun init(context: Context?) { this.context = context } @@ -137,13 +141,37 @@ class MoGoHmiProvider : IMoGoHmiProvider { CallerV2XWarningListenerManager.dismiss() } + Log.d("CODE", "---- 00 ------ tts_content: $ttsContent") if (ttsContent != null && !TextUtils.isEmpty(ttsContent) && playTTS) { val last = lastSpeakJob.get() - if (last != null && !last.isCompleted) { + Log.d("CODE", "---- 0 ------: last: $last") + if (last != null && !last.isCompleted) { + Log.d("CODE", "---- 1 ------") return } - ProcessLifecycleOwner.get().lifecycleScope.launch(Dispatchers.Main) { - speak(it, ttsContent) + scope.launch { + Log.d("CODE", "---- 2 ------") + val d1 = async { + Log.d("CODE", "---- 2_1 start ------") + speak(it, ttsContent) + Log.d("CODE", "---- 2_1 end ------") + } + val d2 = async { + Log.d("CODE", "---- 2_2 start ------") + delay((305.75 * ttsContent.length).toLong()) + Log.d("CODE", "---- 2_2 end ------") + } + val ret = select { + d1.onAwait { 1 } + d2.onAwait { 2 } + } + if (ret == 1) { + d2.cancel() + Log.d("CODE", "---- 3 ------") + } else { + d1.cancel() + Log.d("CODE", "---- 4 ------") + } }.also { itx -> lastSpeakJob.set(itx) } From a80a9d3c78d9060e3af58d62bb0ea86e8ff7fe3c Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Mon, 13 Mar 2023 14:25:35 +0800 Subject: [PATCH 2/9] =?UTF-8?q?[Opt]=E5=8E=BB=E6=8E=89=E5=A4=9A=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E9=9B=86=E5=90=88=E4=B8=AD=E5=8D=95=E4=B8=AA=E5=85=83?= =?UTF-8?q?=E7=B4=A0=E5=90=88=E6=88=90=E5=AE=8C=E6=88=90=E7=9A=84=E5=9B=9E?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/mogo/tts/iflytek/IFlyTekTts.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tts/tts-iflytek/src/main/java/com/mogo/tts/iflytek/IFlyTekTts.kt b/tts/tts-iflytek/src/main/java/com/mogo/tts/iflytek/IFlyTekTts.kt index 4dab0363b9..5180d5e305 100644 --- a/tts/tts-iflytek/src/main/java/com/mogo/tts/iflytek/IFlyTekTts.kt +++ b/tts/tts-iflytek/src/main/java/com/mogo/tts/iflytek/IFlyTekTts.kt @@ -266,7 +266,7 @@ class IFlyTekTts : IMogoTTS, InitListener { if (curTtsEntity != null) {// 多语言 val langTtsEntity = curTtsEntity!!.ttsNext() if (langTtsEntity != null) { - speakVoiceMap[curTtsEntity.toString()]?.onSpeakEnd(curTtsEntity.toString()) +// speakVoiceMap[curTtsEntity.toString()]?.onSpeakEnd(curTtsEntity.toString()) ttsNextLanguage(langTtsEntity) } else { speakVoiceMap.remove(curTtsEntity.toString())?.onSpeakEnd(curTtsEntity.toString()) From 6cdfe94c799a0fc85dc66a0880f559bc4fc46362 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Tue, 14 Mar 2023 19:41:19 +0800 Subject: [PATCH 3/9] =?UTF-8?q?[m2]=E6=96=B0=E5=A2=9E=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E6=B5=8B=E8=AF=95=E6=95=B0=E6=8D=AE=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/assets/planningDataTest.txt | 1 + .../core/function/utils/PlanningDataUtils.kt | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 core/function-impl/mogo-core-function-map/src/main/assets/planningDataTest.txt create mode 100644 core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/utils/PlanningDataUtils.kt diff --git a/core/function-impl/mogo-core-function-map/src/main/assets/planningDataTest.txt b/core/function-impl/mogo-core-function-map/src/main/assets/planningDataTest.txt new file mode 100644 index 0000000000..a40201868c --- /dev/null +++ b/core/function-impl/mogo-core-function-map/src/main/assets/planningDataTest.txt @@ -0,0 +1 @@ +全局路径规划的GSON格式的轨迹点数据放这里,然后使用PlanningDataUtils工具类解析一下 \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/utils/PlanningDataUtils.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/utils/PlanningDataUtils.kt new file mode 100644 index 0000000000..2c66808897 --- /dev/null +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/utils/PlanningDataUtils.kt @@ -0,0 +1,50 @@ +package com.mogo.eagle.core.function.utils + +import android.content.Context +import mogo.telematics.pad.MessagePad +import org.json.JSONArray +import org.json.JSONException +import java.io.IOException +import java.io.InputStream + +object PlanningDataUtils { + + @JvmStatic + fun test(context: Context?): List { + if (context == null) return emptyList() + val list: MutableList = ArrayList() + val jsonStr = getAssetsString(context, "planningDataTest.txt") + try { + val jsonElements = JSONArray(jsonStr) + for (i in 0 until jsonElements.length()) { + val s = jsonElements.getJSONObject(i) + val builder = MessagePad.Location.newBuilder() + builder.latitude = s.getDouble("latitude") + builder.longitude = s.getDouble("longitude") + list.add(builder.build()) + } + } catch (e: JSONException) { + e.printStackTrace() + } + return list + } + + private fun getAssetsString(context: Context, fileName: String): String { + var buffer: ByteArray? = null + var istream: InputStream? = null + try { + istream = context.resources.assets.open(fileName) + buffer = ByteArray(istream.available()) + istream.read(buffer) + } catch (e: IOException) { + e.printStackTrace() + } finally { + try { + istream?.close() + } catch (e: IOException) { + e.printStackTrace() + } + } + return String(buffer!!) + } +} \ No newline at end of file From 7b45dc91adda8a19212eb27fd994105ee45a70e1 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Tue, 21 Mar 2023 17:05:50 +0800 Subject: [PATCH 4/9] =?UTF-8?q?[m2][fix]=E7=A7=91=E5=A4=A7=E8=AE=AF?= =?UTF-8?q?=E9=A3=9E=E9=BB=98=E8=AE=A4=E5=8F=91=E9=9F=B3=E4=BA=BA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=B9=B6=E6=8F=90=E9=AB=98=E9=9F=B3=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/mogo/tts/iflytek/IFlyTekTts.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tts/tts-iflytek/src/main/java/com/mogo/tts/iflytek/IFlyTekTts.kt b/tts/tts-iflytek/src/main/java/com/mogo/tts/iflytek/IFlyTekTts.kt index 5180d5e305..ba0dfa497b 100644 --- a/tts/tts-iflytek/src/main/java/com/mogo/tts/iflytek/IFlyTekTts.kt +++ b/tts/tts-iflytek/src/main/java/com/mogo/tts/iflytek/IFlyTekTts.kt @@ -24,7 +24,7 @@ class IFlyTekTts : IMogoTTS, InitListener { private var ttsEngine: SpeechSynthesizer? = null private var engineType = SpeechConstant.TYPE_CLOUD - private var voicer: String = "xiaoyan" + private var voicer: String = "x4_lingxiaoying_en" private var voicerEntries: Array? = null // 等级由低到高为0、1、2、3,默认为-1表示没有正在tts的 @@ -389,7 +389,7 @@ class IFlyTekTts : IMogoTTS, InitListener { ) //设置合成音量 ttsEngine?.setParameter( - SpeechConstant.VOLUME, "50" + SpeechConstant.VOLUME, "100" ) } else { ttsEngine?.setParameter(SpeechConstant.ENGINE_TYPE, SpeechConstant.TYPE_LOCAL) From d88a2ffe72bb5b43c4ab981a998efda4dbe9cb7d Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Thu, 23 Mar 2023 11:02:45 +0800 Subject: [PATCH 5/9] =?UTF-8?q?[mogo-obu]=E6=B7=BB=E5=8A=A0HV=E9=A2=91?= =?UTF-8?q?=E7=8E=87=E6=8E=A7=E5=88=B6=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/zhidao/support/obu/ObuManager.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libraries/mogo-obu/src/main/java/com/zhidao/support/obu/ObuManager.java b/libraries/mogo-obu/src/main/java/com/zhidao/support/obu/ObuManager.java index 2c95eb0da2..aaa6bbe372 100644 --- a/libraries/mogo-obu/src/main/java/com/zhidao/support/obu/ObuManager.java +++ b/libraries/mogo-obu/src/main/java/com/zhidao/support/obu/ObuManager.java @@ -246,6 +246,17 @@ public class ObuManager { MogoObuManager.getInstance().unregisterTopic(topicIds); } + /** + * HV 数据推送周期 + * 连接成功后调用生效,OBU重启失效 + * + * @param pushCycle 周期 单位:ms 默认值:100ms + * @since 1.1.0 + */ + public void setHvInfoPushCycle(int pushCycle) { + MogoObuManager.getInstance().setHvInfoPushCycle(pushCycle); + } + /** * OBU SDK 日志配置 * 支持日志输出至LogCat和写入文件 From a2724b20e215094f8bb475ff330a5d0f22b7e758 Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Thu, 23 Mar 2023 11:04:53 +0800 Subject: [PATCH 6/9] =?UTF-8?q?[mogo-obu]=E5=8D=87=E7=BA=A7=20OBU=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.gradle b/config.gradle index c2c71ebf9c..2bd9bebad6 100644 --- a/config.gradle +++ b/config.gradle @@ -93,7 +93,7 @@ ext { // obu sdk obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3", - mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.0_beta5', + mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.0_beta6', // google googlezxing : "com.google.zxing:core:3.3.3", From 6b03ac3050dcea2adad03392870e036a14380b3d Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Thu, 23 Mar 2023 11:20:06 +0800 Subject: [PATCH 7/9] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=AE=BE=E7=BD=AEobu=E5=8F=91=E9=80=81=E9=A2=91?= =?UTF-8?q?=E7=8E=87=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.gradle | 2 +- .../datacenter/obu/MoGoObuProvider.kt | 4 ++ .../obu/MogoPrivateObuNewManager.kt | 8 ++++ .../hmi/ui/setting/DebugSettingView.kt | 10 +++++ .../main/res/layout/view_debug_setting.xml | 42 ++++++++++++++++++- .../api/datacenter/obu/IMoGoObuProvider.kt | 2 + .../function/call/obu/CallerObuApiManager.kt | 7 ++++ 7 files changed, 73 insertions(+), 2 deletions(-) diff --git a/config.gradle b/config.gradle index c2c71ebf9c..2bd9bebad6 100644 --- a/config.gradle +++ b/config.gradle @@ -93,7 +93,7 @@ ext { // obu sdk obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3", - mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.0_beta5', + mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.0_beta6', // google googlezxing : "com.google.zxing:core:3.3.3", diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt index 6027695b0e..64722c7880 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MoGoObuProvider.kt @@ -82,4 +82,8 @@ class MoGoObuProvider : IMoGoObuProvider { override fun deleteObuFile() { MogoPrivateObuNewManager.INSTANCE.deleteObuFile() } + + override fun setHvInfoSendCycle(time: Int) { + MogoPrivateObuNewManager.INSTANCE.setHvInfoSendCycle(time) + } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt index ec4ff4a718..10ce62b628 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt @@ -1,6 +1,7 @@ package com.mogo.eagle.core.function.datacenter.obu import android.content.Context +import android.util.Log import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.config.HmiBuildConfig import com.mogo.eagle.core.data.enums.* @@ -74,6 +75,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { .registerTopic(MogoObuTopicId.RSI_WARNING) .registerTopic(MogoObuTopicId.RSM_WARNING) .registerTopic(MogoObuTopicId.MAP_MATCH) + .registerTopic(MogoObuTopicId.OBU_SYSTEM_STATUS) .build() //每次连接的时候如果连接连接了,先断开,防止ip改变等导致的连接失败 @@ -103,6 +105,11 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { } } + fun setHvInfoSendCycle(time: Int) { + Log.d("liyz", "---setHvInfoSendCycle = time = $time") +// ObuManager.getInstance().setHvInfoPushCycle(time); + } + /** * 当前的obu版本 */ @@ -199,6 +206,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { * @param data 系统状态 */ override fun onObuSystemStatus(data: MogoObuSystemStatusData?) { + Log.d("liyz", "data.toString() = ${data.toString()}" ) CallerObuInfoListenerManager.invokeGetObuInfo(data.toString()) } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index c32a366d08..d9ab7a8190 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -588,6 +588,16 @@ internal class DebugSettingView @JvmOverloads constructor( } } + //obu设置50ms的频率发送数据 + btnSetFifty.setOnClickListener { + CallerObuApiManager.setHvInfoSendCycle(50) + } + + //obu设置100ms的频率发送数据 + btnSetOneHundred.setOnClickListener { + CallerObuApiManager.setHvInfoSendCycle(100) + } + btnDrawFusion.isChecked = FunctionBuildConfig.isFusionColor btnDrawFusion.setOnCheckedChangeListener { _, isChecked -> FunctionBuildConfig.isFusionColor = isChecked diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml index fbd4be94fa..6fbfba7dcb 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml @@ -1091,7 +1091,7 @@ app:layout_constraintTop_toTopOf="@id/btnSetObuIP" /> + + +