[8.0.0]调整TTS语音+下架V2N绿波通行

This commit is contained in:
xuxinchao
2025-04-24 11:21:14 +08:00
parent 400154bf38
commit 5d12752125
7 changed files with 104 additions and 133 deletions

View File

@@ -352,93 +352,94 @@ internal object V2NIdentifyDrawer : IEventDismissListener {
) )
}.receive() }.receive()
} else if (msg.what == MSG_WHAT_DRAW_GREEN_WAVE) { } else if (msg.what == MSG_WHAT_DRAW_GREEN_WAVE) {
val data = msg.obj as? V2nCrossSpeed ?: return@Callback true //下架V2N绿波通行
val destX = data.lng // val data = msg.obj as? V2nCrossSpeed ?: return@Callback true
val destY = data.lat // val destX = data.lng
val location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84() // val destY = data.lat
if (DrivingDirectionUtils.getDegreeOfCar2Poi( // val location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
location.longitude, // if (DrivingDirectionUtils.getDegreeOfCar2Poi(
location.latitude, // location.longitude,
destX, // location.latitude,
destY, // destX,
location.heading.toInt() // destY,
) >= 90 // location.heading.toInt()
) { // ) >= 90
V2XBizTrace.onAck(data, "green-wave-event" to "事件在车的后面,不触发", true) // ) {
return@Callback true // V2XBizTrace.onAck(data, "green-wave-event" to "事件在车的后面,不触发", true)
} // return@Callback true
val id = "${destX}_${destY}" // }
AiRoadMarker.aiMakers.getOrPut(id) { // val id = "${destX}_${destY}"
AiRoadMarker().apply { // AiRoadMarker.aiMakers.getOrPut(id) {
try { // AiRoadMarker().apply {
val current = abs(location.gnssSpeed).toInt() // try {
val min = abs(data.speedStraightMin).toInt() // val current = abs(location.gnssSpeed).toInt()
val max = abs(data.speedStraightMax).toInt() // val min = abs(data.speedStraightMin).toInt()
marker( // val max = abs(data.speedStraightMax).toInt()
Marker( // marker(
id, // Marker(
EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType, // id,
destX, // EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType,
destY, // destX,
0.0, // destY,
null, // 0.0,
null, // null,
null // null,
), drawMarker = false, false // null
) // ), drawMarker = false, false
var alertTts = "" // )
var alertContent = "" // var alertTts = ""
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { // var alertContent = ""
AppStateManager.currentActivity()?.let { // if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
val speakText = StringBuilder("保持当前车速即可通过路口,好丝滑!") // AppStateManager.currentActivity()?.let {
if (current < min) { // val speakText = StringBuilder("保持当前车速即可通过路口,好丝滑!")
speakText.setLength(0) // if (current < min) {
speakText.append( // speakText.setLength(0)
"${ // speakText.append(
SkinResources.getInstance() // "${
.getString(R.string.operation_platform_name) // SkinResources.getInstance()
}推荐您提升车速至${min}千米每小时, 当前车速${current}千米每小时" // .getString(R.string.operation_platform_name)
) // }推荐您提升车速至${min}千米每小时, 当前车速${current}千米每小时"
} // )
if (current > max) { // }
speakText.setLength(0) // if (current > max) {
speakText.append( // speakText.setLength(0)
"${ // speakText.append(
SkinResources.getInstance() // "${
.getString(R.string.operation_platform_name) // SkinResources.getInstance()
}推荐您降低车速至${max}千米每小时, 当前车速${current}千米每小时" // .getString(R.string.operation_platform_name)
) // }推荐您降低车速至${max}千米每小时, 当前车速${current}千米每小时"
} // )
val tts = speakText.toString() // }
alertTts = tts // val tts = speakText.toString()
alertContent = tts // alertTts = tts
AIAssist.getInstance(it).speakTTSVoice(tts) // alertContent = tts
} // AIAssist.getInstance(it).speakTTSVoice(tts)
} // }
//消息埋点 // }
V2XEventAnalyticsManager.triggerV2XEvent( // //消息埋点
EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType, // V2XEventAnalyticsManager.triggerV2XEvent(
alertContent, // EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType,
alertTts, // alertContent,
DataSourceType.AICLOUD, // alertTts,
CommunicationType.V2N // DataSourceType.AICLOUD,
) // CommunicationType.V2N
CallerHmiManager.showGreenWave( // )
min, // CallerHmiManager.showGreenWave(
max, // min,
computeCrossCountBetween( // max,
Triple( // computeCrossCountBetween(
location.longitude, // Triple(
location.latitude, // location.longitude,
location.heading // location.latitude,
), kotlin.Pair(destX, destY) // location.heading
) // ), kotlin.Pair(destX, destY)
) // )
} finally { // )
receive() // } finally {
} // receive()
} // }
} // }
// }
} else if (msg.what == MSG_WHAT_DRAW_PEOPLE_CROSS) { } else if (msg.what == MSG_WHAT_DRAW_PEOPLE_CROSS) {
Logger.i(TAG, "people cross -- 1 --") Logger.i(TAG, "people cross -- 1 --")
val data = msg.obj as? MessagePad.Event ?: return@Callback true val data = msg.obj as? MessagePad.Event ?: return@Callback true
@@ -689,7 +690,7 @@ internal object V2NIdentifyDrawer : IEventDismissListener {
} }
private fun drawGreenWave(crossSpeed: V2nCrossSpeed) { private fun drawGreenWave(crossSpeed: V2nCrossSpeed) {
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch && FunctionBuildConfig.v2nGreenWave) { if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nTotalSwitch) {
handler.removeMessages(MSG_WHAT_DRAW_GREEN_WAVE) handler.removeMessages(MSG_WHAT_DRAW_GREEN_WAVE)
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_GREEN_WAVE, crossSpeed)) handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_GREEN_WAVE, crossSpeed))
} }
@@ -818,7 +819,7 @@ internal object V2NIdentifyDrawer : IEventDismissListener {
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
ThreadUtils.runOnUiThread { ThreadUtils.runOnUiThread {
AIAssist.getInstance(Utils.getApp()) AIAssist.getInstance(Utils.getApp())
.speakTTSVoiceWithLevel("蘑菇发现前方路口有车龙", AIAssist.NEW_LEVEL_2) .speakTTSVoiceWithLevel("前方路口有车龙", AIAssist.NEW_LEVEL_2)
} }
} }
} }

View File

@@ -14,7 +14,6 @@ import androidx.constraintlayout.widget.ConstraintLayout
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.mogo.commons.voice.AIAssist import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.data.autopilot.AutopilotSummaryInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.MsgBoxType
@@ -27,7 +26,6 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxListenerManager
import com.mogo.eagle.core.function.hmi.R import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.skin.utils.SkinResources
/** /**
@@ -162,8 +160,7 @@ open class AutomaticExplorationView @JvmOverloads constructor(
rotationAnim?.cancel() rotationAnim?.cancel()
//语音播放,只在司机端播放 //语音播放,只在司机端播放
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){ if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
AIAssist.getInstance(context).speakTTSVoice("道路畅通一切正常${SkinResources.getInstance().getString( AIAssist.getInstance(context).speakTTSVoice("正为您探查道路情况")
R.string.operation_platform_name)}型车助手将持续守候您的出行")
} }
//5秒后关闭弹窗 //5秒后关闭弹窗
val hideViewTimer =object: CountDownTimer(EXPLORATION_HIDE_TIME,EXPLORATION_HIDE_TIME){ val hideViewTimer =object: CountDownTimer(EXPLORATION_HIDE_TIME,EXPLORATION_HIDE_TIME){

View File

@@ -327,7 +327,6 @@ class OperatePanelLayout : LinearLayout {
private const val KEY_V2X_TOTAL_SWITCH = "v2x_total_switch" private const val KEY_V2X_TOTAL_SWITCH = "v2x_total_switch"
private const val KEY_V2N_TOTAL_SWITCH = "v2n_total_switch" private const val KEY_V2N_TOTAL_SWITCH = "v2n_total_switch"
private const val KEY_V2N_NEW_LINKED_TO_PNC = "v2n_new_linked_to_pnc" private const val KEY_V2N_NEW_LINKED_TO_PNC = "v2n_new_linked_to_pnc"
private const val KEY_V2N_NEW_LINKED_GREEN_WAVE = "v2n_new_linked_green_wave"
private const val KEY_V2I_TOTAL_SWITCH = "v2i_total_switch" private const val KEY_V2I_TOTAL_SWITCH = "v2i_total_switch"
private const val KEY_V2I_TO_PNC = "v2i_to_pnc" private const val KEY_V2I_TO_PNC = "v2i_to_pnc"
private const val KEY_V2I_RED_LIGHT_WARNING = "v2i_red_light_warning" private const val KEY_V2I_RED_LIGHT_WARNING = "v2i_red_light_warning"
@@ -351,9 +350,6 @@ class OperatePanelLayout : LinearLayout {
KEY_V2N_NEW_LINKED_TO_PNC -> { KEY_V2N_NEW_LINKED_TO_PNC -> {
return FunctionBuildConfig.v2nNewLinkedToPNC return FunctionBuildConfig.v2nNewLinkedToPNC
} }
KEY_V2N_NEW_LINKED_GREEN_WAVE -> {
return FunctionBuildConfig.v2nGreenWave
}
KEY_V2I_TOTAL_SWITCH -> { KEY_V2I_TOTAL_SWITCH -> {
return HmiBuildConfig.v2iTotalSwitch return HmiBuildConfig.v2iTotalSwitch
} }
@@ -404,7 +400,6 @@ class OperatePanelLayout : LinearLayout {
clickEventAnalytics("V2N总开关", isChecked) clickEventAnalytics("V2N总开关", isChecked)
if (!isChecked) { // preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(KEY_V2N_NEW_LINKED)?.also { changeValue(it, false) } if (!isChecked) { // preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(KEY_V2N_NEW_LINKED)?.also { changeValue(it, false) }
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(KEY_V2N_NEW_LINKED_TO_PNC)?.also { changeValue(it, false) } preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(KEY_V2N_NEW_LINKED_TO_PNC)?.also { changeValue(it, false) }
preferenceScreen.findPreferenceReal<SwitchPreferenceCompat>(KEY_V2N_NEW_LINKED_GREEN_WAVE)?.also { changeValue(it, false) }
} }
val map = HashMap<String, Boolean>().also { val map = HashMap<String, Boolean>().also {
it["f1"] = isChecked it["f1"] = isChecked
@@ -420,14 +415,6 @@ class OperatePanelLayout : LinearLayout {
CallerAutoPilotControlManager.sendV2nToPncCmd(isChecked) CallerAutoPilotControlManager.sendV2nToPncCmd(isChecked)
return true return true
} }
KEY_V2N_NEW_LINKED_GREEN_WAVE -> {
val isChecked = newValue as? Boolean ?: false
FunctionBuildConfig.v2nGreenWave = isChecked
hmiAction("绿波通行", isChecked)
clickEventAnalytics("绿波通行", isChecked)
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.OBU_GREENWAVE_WARNING, (if (isChecked) "1" else "0").toByteArray())
return true
}
KEY_V2I_TOTAL_SWITCH -> { KEY_V2I_TOTAL_SWITCH -> {
val isChecked = newValue as? Boolean ?: false val isChecked = newValue as? Boolean ?: false
HmiBuildConfig.v2iTotalSwitch = isChecked HmiBuildConfig.v2iTotalSwitch = isChecked

View File

@@ -34,14 +34,6 @@
android:defaultValue="@bool/v2n_new_linked_to_pnc" android:defaultValue="@bool/v2n_new_linked_to_pnc"
android:layout="@layout/layout_operate_panel_preference_switch_compat_dependee" android:layout="@layout/layout_operate_panel_preference_switch_compat_dependee"
android:widgetLayout="@layout/layout_operate_panel_preference_widget_switch_compat"/> android:widgetLayout="@layout/layout_operate_panel_preference_widget_switch_compat"/>
<SwitchPreferenceCompat
android:key="v2n_new_linked_green_wave"
android:title="绿波通行"
android:persistent="false"
android:defaultValue="@bool/v2n_green_wave"
android:dependency="v2n_total_switch"
android:layout="@layout/layout_operate_panel_preference_switch_compat_dependee"
android:widgetLayout="@layout/layout_operate_panel_preference_widget_switch_compat"/>
<SwitchPreferenceCompat <SwitchPreferenceCompat
android:key="v2i_total_switch" android:key="v2i_total_switch"
android:title="V2I总开关" android:title="V2I总开关"

View File

@@ -227,16 +227,17 @@ class RoadCrossRoamView @JvmOverloads constructor(
} }
isShow = true isShow = true
//播放语音 //播放语音
val dis = CallerMapRoadListenerManager.getStopLineDistance()?.toInt() ?: 0 // val dis = CallerMapRoadListenerManager.getStopLineDistance()?.toInt() ?: 0
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
var disStr = "前方即将通过路口,${ // var disStr = "前方即将通过路口,${
SkinResources.getInstance().getString(R.string.operation_platform_name) // SkinResources.getInstance().getString(R.string.operation_platform_name)
}为您提供路口全息影像助力出行" // }为您提供路口全息影像,助力出行"
if (dis >= 80) { // if (dis >= 80) {
disStr = "前方${dis}米将通过路口,${ // disStr = "前方${dis}米将通过路口,${
SkinResources.getInstance().getString(R.string.operation_platform_name) // SkinResources.getInstance().getString(R.string.operation_platform_name)
}为您提供路口全息影像助力出行" // }为您提供路口全息影像,助力出行"
} // }
val disStr = "为您提供路口全息影像,助力出行"
AIAssist.getInstance(context).speakTTSVoiceWithLevel(disStr, AIAssist.NEW_LEVEL_2) AIAssist.getInstance(context).speakTTSVoiceWithLevel(disStr, AIAssist.NEW_LEVEL_2)
} }
CallerHmiViewControlListenerManager.invokeV2XEvent(View.VISIBLE, TAG) CallerHmiViewControlListenerManager.invokeV2XEvent(View.VISIBLE, TAG)

View File

@@ -297,19 +297,12 @@ object FunctionBuildConfig {
var v2xTotalSwitch = Utils.getApp().resources.getBoolean(R.bool.v2x_total_switch) var v2xTotalSwitch = Utils.getApp().resources.getBoolean(R.bool.v2x_total_switch)
/** /**
* V2N总开关,其子开关包括V2N新链路、V2N场景进PNC、绿波通行 * V2N总开关,其子开关包括V2N新链路、V2N场景进PNC
*/ */
@Volatile @Volatile
@JvmField @JvmField
var v2nTotalSwitch = Utils.getApp().resources.getBoolean(R.bool.v2n_total_switch) var v2nTotalSwitch = Utils.getApp().resources.getBoolean(R.bool.v2n_total_switch)
/**
* V2N事件-绿波通行开关
*/
@Volatile
@JvmField
var v2nGreenWave = Utils.getApp().resources.getBoolean(R.bool.v2n_green_wave)
/** /**
* 是否开启PNC障碍物颜色提醒 * 是否开启PNC障碍物颜色提醒
*/ */

View File

@@ -518,7 +518,7 @@ enum class EventTypeEnumNew(
"他车倒车/逆行", "他车倒车/逆行",
poiTypeSrcVr = R.drawable.icon_v2x_other_retrograde_vehicle_driver, poiTypeSrcVr = R.drawable.icon_v2x_other_retrograde_vehicle_driver,
content = "前方%s米有他车倒车或逆行", content = "前方%s米有他车倒车或逆行",
tts = "${SkinResources.getInstance().getString(R.string.operation_platform_name)}发现前方有异常车辆,提醒您注意观察 小心通过" tts = "前方有异常车辆"
), ),
TYPE_SOCKET_ROAD_GREE_WAVE( TYPE_SOCKET_ROAD_GREE_WAVE(
"100063", "100063",
@@ -532,7 +532,7 @@ enum class EventTypeEnumNew(
"行人横穿", "行人横穿",
poiTypeSrcVr = View.NO_ID, poiTypeSrcVr = View.NO_ID,
content = "前方%s米有行人/非机动车横穿", content = "前方%s米有行人/非机动车横穿",
tts = "${SkinResources.getInstance().getString(R.string.operation_platform_name)}发现前方有行人或非机动车横穿,提醒您注意观察,小心通过" tts = "前方有行人或非机动车横穿"
), ),
TYPE_ERROR( TYPE_ERROR(
0.toString(), 0.toString(),