[8.0.0]调整TTS语音+下架V2N绿波通行
This commit is contained in:
@@ -352,93 +352,94 @@ internal object V2NIdentifyDrawer : IEventDismissListener {
|
||||
)
|
||||
}.receive()
|
||||
} else if (msg.what == MSG_WHAT_DRAW_GREEN_WAVE) {
|
||||
val data = msg.obj as? V2nCrossSpeed ?: return@Callback true
|
||||
val destX = data.lng
|
||||
val destY = data.lat
|
||||
val location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
if (DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||
location.longitude,
|
||||
location.latitude,
|
||||
destX,
|
||||
destY,
|
||||
location.heading.toInt()
|
||||
) >= 90
|
||||
) {
|
||||
V2XBizTrace.onAck(data, "green-wave-event" to "事件在车的后面,不触发", true)
|
||||
return@Callback true
|
||||
}
|
||||
val id = "${destX}_${destY}"
|
||||
AiRoadMarker.aiMakers.getOrPut(id) {
|
||||
AiRoadMarker().apply {
|
||||
try {
|
||||
val current = abs(location.gnssSpeed).toInt()
|
||||
val min = abs(data.speedStraightMin).toInt()
|
||||
val max = abs(data.speedStraightMax).toInt()
|
||||
marker(
|
||||
Marker(
|
||||
id,
|
||||
EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType,
|
||||
destX,
|
||||
destY,
|
||||
0.0,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
), drawMarker = false, false
|
||||
)
|
||||
var alertTts = ""
|
||||
var alertContent = ""
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
AppStateManager.currentActivity()?.let {
|
||||
val speakText = StringBuilder("保持当前车速即可通过路口,好丝滑!")
|
||||
if (current < min) {
|
||||
speakText.setLength(0)
|
||||
speakText.append(
|
||||
"${
|
||||
SkinResources.getInstance()
|
||||
.getString(R.string.operation_platform_name)
|
||||
}推荐您提升车速至${min}千米每小时, 当前车速${current}千米每小时"
|
||||
)
|
||||
}
|
||||
if (current > max) {
|
||||
speakText.setLength(0)
|
||||
speakText.append(
|
||||
"${
|
||||
SkinResources.getInstance()
|
||||
.getString(R.string.operation_platform_name)
|
||||
}推荐您降低车速至${max}千米每小时, 当前车速${current}千米每小时"
|
||||
)
|
||||
}
|
||||
val tts = speakText.toString()
|
||||
alertTts = tts
|
||||
alertContent = tts
|
||||
AIAssist.getInstance(it).speakTTSVoice(tts)
|
||||
}
|
||||
}
|
||||
//消息埋点
|
||||
V2XEventAnalyticsManager.triggerV2XEvent(
|
||||
EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType,
|
||||
alertContent,
|
||||
alertTts,
|
||||
DataSourceType.AICLOUD,
|
||||
CommunicationType.V2N
|
||||
)
|
||||
CallerHmiManager.showGreenWave(
|
||||
min,
|
||||
max,
|
||||
computeCrossCountBetween(
|
||||
Triple(
|
||||
location.longitude,
|
||||
location.latitude,
|
||||
location.heading
|
||||
), kotlin.Pair(destX, destY)
|
||||
)
|
||||
)
|
||||
} finally {
|
||||
receive()
|
||||
}
|
||||
}
|
||||
}
|
||||
//下架V2N绿波通行
|
||||
// val data = msg.obj as? V2nCrossSpeed ?: return@Callback true
|
||||
// val destX = data.lng
|
||||
// val destY = data.lat
|
||||
// val location = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
|
||||
// if (DrivingDirectionUtils.getDegreeOfCar2Poi(
|
||||
// location.longitude,
|
||||
// location.latitude,
|
||||
// destX,
|
||||
// destY,
|
||||
// location.heading.toInt()
|
||||
// ) >= 90
|
||||
// ) {
|
||||
// V2XBizTrace.onAck(data, "green-wave-event" to "事件在车的后面,不触发", true)
|
||||
// return@Callback true
|
||||
// }
|
||||
// val id = "${destX}_${destY}"
|
||||
// AiRoadMarker.aiMakers.getOrPut(id) {
|
||||
// AiRoadMarker().apply {
|
||||
// try {
|
||||
// val current = abs(location.gnssSpeed).toInt()
|
||||
// val min = abs(data.speedStraightMin).toInt()
|
||||
// val max = abs(data.speedStraightMax).toInt()
|
||||
// marker(
|
||||
// Marker(
|
||||
// id,
|
||||
// EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType,
|
||||
// destX,
|
||||
// destY,
|
||||
// 0.0,
|
||||
// null,
|
||||
// null,
|
||||
// null
|
||||
// ), drawMarker = false, false
|
||||
// )
|
||||
// var alertTts = ""
|
||||
// var alertContent = ""
|
||||
// if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
// AppStateManager.currentActivity()?.let {
|
||||
// val speakText = StringBuilder("保持当前车速即可通过路口,好丝滑!")
|
||||
// if (current < min) {
|
||||
// speakText.setLength(0)
|
||||
// speakText.append(
|
||||
// "${
|
||||
// SkinResources.getInstance()
|
||||
// .getString(R.string.operation_platform_name)
|
||||
// }推荐您提升车速至${min}千米每小时, 当前车速${current}千米每小时"
|
||||
// )
|
||||
// }
|
||||
// if (current > max) {
|
||||
// speakText.setLength(0)
|
||||
// speakText.append(
|
||||
// "${
|
||||
// SkinResources.getInstance()
|
||||
// .getString(R.string.operation_platform_name)
|
||||
// }推荐您降低车速至${max}千米每小时, 当前车速${current}千米每小时"
|
||||
// )
|
||||
// }
|
||||
// val tts = speakText.toString()
|
||||
// alertTts = tts
|
||||
// alertContent = tts
|
||||
// AIAssist.getInstance(it).speakTTSVoice(tts)
|
||||
// }
|
||||
// }
|
||||
// //消息埋点
|
||||
// V2XEventAnalyticsManager.triggerV2XEvent(
|
||||
// EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType,
|
||||
// alertContent,
|
||||
// alertTts,
|
||||
// DataSourceType.AICLOUD,
|
||||
// CommunicationType.V2N
|
||||
// )
|
||||
// CallerHmiManager.showGreenWave(
|
||||
// min,
|
||||
// max,
|
||||
// computeCrossCountBetween(
|
||||
// Triple(
|
||||
// location.longitude,
|
||||
// location.latitude,
|
||||
// location.heading
|
||||
// ), kotlin.Pair(destX, destY)
|
||||
// )
|
||||
// )
|
||||
// } finally {
|
||||
// receive()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
} else if (msg.what == MSG_WHAT_DRAW_PEOPLE_CROSS) {
|
||||
Logger.i(TAG, "people cross -- 1 --")
|
||||
val data = msg.obj as? MessagePad.Event ?: return@Callback true
|
||||
@@ -689,7 +690,7 @@ internal object V2NIdentifyDrawer : IEventDismissListener {
|
||||
}
|
||||
|
||||
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.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_GREEN_WAVE, crossSpeed))
|
||||
}
|
||||
@@ -818,7 +819,7 @@ internal object V2NIdentifyDrawer : IEventDismissListener {
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
AIAssist.getInstance(Utils.getApp())
|
||||
.speakTTSVoiceWithLevel("蘑菇发现前方路口有车龙", AIAssist.NEW_LEVEL_2)
|
||||
.speakTTSVoiceWithLevel("前方路口有车龙", AIAssist.NEW_LEVEL_2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
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.msgbox.MsgBoxBean
|
||||
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.utilcode.mogo.AppIdentityModeUtils
|
||||
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()
|
||||
//语音播放,只在司机端播放
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
|
||||
AIAssist.getInstance(context).speakTTSVoice("道路畅通一切正常${SkinResources.getInstance().getString(
|
||||
R.string.operation_platform_name)}型车助手将持续守候您的出行")
|
||||
AIAssist.getInstance(context).speakTTSVoice("正为您探查道路情况")
|
||||
}
|
||||
//5秒后关闭弹窗
|
||||
val hideViewTimer =object: CountDownTimer(EXPLORATION_HIDE_TIME,EXPLORATION_HIDE_TIME){
|
||||
|
||||
@@ -327,7 +327,6 @@ class OperatePanelLayout : LinearLayout {
|
||||
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_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_TO_PNC = "v2i_to_pnc"
|
||||
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 -> {
|
||||
return FunctionBuildConfig.v2nNewLinkedToPNC
|
||||
}
|
||||
KEY_V2N_NEW_LINKED_GREEN_WAVE -> {
|
||||
return FunctionBuildConfig.v2nGreenWave
|
||||
}
|
||||
KEY_V2I_TOTAL_SWITCH -> {
|
||||
return HmiBuildConfig.v2iTotalSwitch
|
||||
}
|
||||
@@ -404,7 +400,6 @@ class OperatePanelLayout : LinearLayout {
|
||||
clickEventAnalytics("V2N总开关", isChecked)
|
||||
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_GREEN_WAVE)?.also { changeValue(it, false) }
|
||||
}
|
||||
val map = HashMap<String, Boolean>().also {
|
||||
it["f1"] = isChecked
|
||||
@@ -420,14 +415,6 @@ class OperatePanelLayout : LinearLayout {
|
||||
CallerAutoPilotControlManager.sendV2nToPncCmd(isChecked)
|
||||
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 -> {
|
||||
val isChecked = newValue as? Boolean ?: false
|
||||
HmiBuildConfig.v2iTotalSwitch = isChecked
|
||||
|
||||
@@ -34,14 +34,6 @@
|
||||
android:defaultValue="@bool/v2n_new_linked_to_pnc"
|
||||
android:layout="@layout/layout_operate_panel_preference_switch_compat_dependee"
|
||||
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
|
||||
android:key="v2i_total_switch"
|
||||
android:title="V2I总开关"
|
||||
|
||||
@@ -227,16 +227,17 @@ class RoadCrossRoamView @JvmOverloads constructor(
|
||||
}
|
||||
isShow = true
|
||||
//播放语音
|
||||
val dis = CallerMapRoadListenerManager.getStopLineDistance()?.toInt() ?: 0
|
||||
// val dis = CallerMapRoadListenerManager.getStopLineDistance()?.toInt() ?: 0
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
var disStr = "前方即将通过路口,${
|
||||
SkinResources.getInstance().getString(R.string.operation_platform_name)
|
||||
}为您提供路口全息影像,助力出行"
|
||||
if (dis >= 80) {
|
||||
disStr = "前方${dis}米将通过路口,${
|
||||
SkinResources.getInstance().getString(R.string.operation_platform_name)
|
||||
}为您提供路口全息影像,助力出行"
|
||||
}
|
||||
// var disStr = "前方即将通过路口,${
|
||||
// SkinResources.getInstance().getString(R.string.operation_platform_name)
|
||||
// }为您提供路口全息影像,助力出行"
|
||||
// if (dis >= 80) {
|
||||
// disStr = "前方${dis}米将通过路口,${
|
||||
// SkinResources.getInstance().getString(R.string.operation_platform_name)
|
||||
// }为您提供路口全息影像,助力出行"
|
||||
// }
|
||||
val disStr = "为您提供路口全息影像,助力出行"
|
||||
AIAssist.getInstance(context).speakTTSVoiceWithLevel(disStr, AIAssist.NEW_LEVEL_2)
|
||||
}
|
||||
CallerHmiViewControlListenerManager.invokeV2XEvent(View.VISIBLE, TAG)
|
||||
|
||||
Reference in New Issue
Block a user