Merge remote-tracking branch 'origin/dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0' into dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0
This commit is contained in:
@@ -3,6 +3,7 @@ package com.mogo.och.bus.passenger.model
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.net.ConnectivityManager
|
||||
import android.os.Build
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.module.intent.IMogoIntentListener
|
||||
import com.mogo.commons.module.intent.IntentManager
|
||||
@@ -34,6 +35,7 @@ import com.mogo.och.bus.passenger.callback.IOrderChangeCallback
|
||||
import com.mogo.och.bus.passenger.constant.BusPassengerConst.Companion.Charter_AVERAGE_SPEED
|
||||
import com.mogo.och.bus.passenger.net.BusPassengerModelLoopManager
|
||||
import com.mogo.och.bus.passenger.net.BusPassengerServiceManager
|
||||
import com.mogo.och.bus.passenger.utils.VoiceFocusManager
|
||||
import com.mogo.och.common.module.biz.common.socketmessage.OCHSocketMessageManager
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager
|
||||
import com.mogo.och.common.module.biz.constant.TaxiLoginStatusEnum
|
||||
@@ -530,7 +532,11 @@ object CharterPassengerModel {
|
||||
AbsMogoApplication.getApp()
|
||||
.getString(R.string.m1_end_order_5min), 2
|
||||
)
|
||||
VoiceManager.surplus5min()
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
VoiceManager.surplus5min(VoiceFocusManager.getVoiceCmdCallBack())
|
||||
}else{
|
||||
VoiceManager.surplus5min()
|
||||
}
|
||||
broadcastList["${it}$min5Speak"] = true
|
||||
}
|
||||
}
|
||||
@@ -726,7 +732,12 @@ object CharterPassengerModel {
|
||||
mContext, lindId = it, object : OchCommonServiceCallback<BaseData> {
|
||||
override fun onSuccess(data: BaseData?) {
|
||||
if (null != data && 0 == data.code) {
|
||||
VoiceManager.arrivedStation(orderInfo!!.siteName!!)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
VoiceManager.arrivedStation(orderInfo!!.siteName!!,
|
||||
VoiceFocusManager.getVoiceCmdCallBack())
|
||||
}else{
|
||||
VoiceManager.arrivedStation(orderInfo!!.siteName!!,)
|
||||
}
|
||||
broadcastList["${it}$endKey"] = true
|
||||
// 到站结束自驾
|
||||
CallerAutoPilotControlManager.cancelAutoPilot()
|
||||
@@ -744,7 +755,11 @@ object CharterPassengerModel {
|
||||
|
||||
fun leaveStation(){
|
||||
orderInfo?.siteName?.let {
|
||||
VoiceManager.leaveStation(it)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
VoiceManager.leaveStation(it,VoiceFocusManager.getVoiceCmdCallBack())
|
||||
}else{
|
||||
VoiceManager.leaveStation(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package com.mogo.och.bus.passenger.ui
|
||||
|
||||
import android.graphics.BitmapFactory
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.msgbox.MMsgBoxButtonView
|
||||
@@ -22,6 +25,7 @@ import com.mogo.och.bus.passenger.R
|
||||
import com.mogo.och.bus.passenger.model.CharterPassengerModel
|
||||
import com.mogo.och.common.module.voice.VoiceManager
|
||||
import com.mogo.och.bus.passenger.presenter.BusPassengerPresenter
|
||||
import com.mogo.och.bus.passenger.utils.VoiceFocusManager
|
||||
import com.mogo.och.common.module.biz.constant.LoginStatusManager
|
||||
import kotlinx.android.synthetic.m1.m1_main_fragment.*
|
||||
import java.lang.ref.WeakReference
|
||||
@@ -77,11 +81,17 @@ class MainFragment :
|
||||
}
|
||||
}
|
||||
ll_car_speed.onClick {
|
||||
if (LoginStatusManager.isLogin()) {
|
||||
VoiceManager.endOrder()
|
||||
CharterPassengerModel.arriveDest()
|
||||
}else{
|
||||
ToastUtils.showShort(AbsMogoApplication.getApp().getString(R.string.m1_please_login_driver))
|
||||
if (DebugConfig.isDebug()) {
|
||||
if (LoginStatusManager.isLogin()) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
VoiceManager.endOrder(VoiceFocusManager.getVoiceCmdCallBack())
|
||||
}else{
|
||||
VoiceManager.endOrder()
|
||||
}
|
||||
CharterPassengerModel.arriveDest()
|
||||
}else{
|
||||
ToastUtils.showShort(AbsMogoApplication.getApp().getString(R.string.m1_please_login_driver))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,9 @@ import android.view.View
|
||||
import android.view.animation.LinearInterpolator
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
@@ -32,6 +34,7 @@ import com.mogo.och.common.module.bean.dpmsg.ChangeDestMsg
|
||||
import com.mogo.och.common.module.bean.dpmsg.DPMsgType
|
||||
import com.mogo.och.common.module.biz.constant.OchCommonConst
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.manager.OCHPlanningStopSideStatusManager
|
||||
import kotlinx.android.synthetic.m1.m1_order_lineside.view.*
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
@@ -325,11 +328,49 @@ class LineSiteView @JvmOverloads constructor(
|
||||
if (gnssSpeed < 0.5) {
|
||||
// TODO: 自驾中 需要 靠边停车中、到站
|
||||
// TODO: 没有自驾中 需要 靠边停车中、到站
|
||||
isChangeIngLineAndSite = false
|
||||
onlyChangeSite(false)
|
||||
// 可以切换路径
|
||||
setEnableLineStatus(true)
|
||||
queryLineList()
|
||||
when (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {// 不可自动驾驶
|
||||
// 可以切换路径
|
||||
isChangeIngLineAndSite = false
|
||||
onlyChangeSite(false)
|
||||
// 可以切换路径
|
||||
setEnableLineStatus(true)
|
||||
queryLineList()
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {//
|
||||
isChangeIngLineAndSite = false
|
||||
onlyChangeSite(false)
|
||||
// 可以切换路径
|
||||
setEnableLineStatus(true)
|
||||
queryLineList()
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
// 自动驾驶中
|
||||
when (OCHPlanningStopSideStatusManager.stopSiteStatus) {
|
||||
OCHPlanningStopSideStatusManager.StopSite.NOTHING -> {
|
||||
isChangeIngLineAndSite = false
|
||||
onlyChangeSite(false)
|
||||
// 可以切换路径
|
||||
setEnableLineStatus(true)
|
||||
queryLineList()
|
||||
}
|
||||
OCHPlanningStopSideStatusManager.StopSite.STOPSITED -> {
|
||||
isChangeIngLineAndSite = false
|
||||
onlyChangeSite(false)
|
||||
// 可以切换路径
|
||||
setEnableLineStatus(true)
|
||||
queryLineList()
|
||||
}
|
||||
OCHPlanningStopSideStatusManager.StopSite.LANKE_KEEP ->{
|
||||
ToastUtils.showShort("自动驾驶中无法切换线路")
|
||||
}
|
||||
}
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {
|
||||
ToastUtils.showShort("因车辆正在平行驾驶中无法切换线路")
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showShort("请停车后再修改目的地~")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.mogo.och.bus.passenger.utils
|
||||
|
||||
import android.os.Build
|
||||
import androidx.annotation.RequiresApi
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
|
||||
object VoiceFocusManager {
|
||||
@RequiresApi(Build.VERSION_CODES.O)
|
||||
fun getVoiceCmdCallBack():IMogoVoiceCmdCallBack{
|
||||
GSYVideoManager.onPause()
|
||||
GSYVideoManager.instance().curPlayerManager.setNeedMute(true)
|
||||
|
||||
return object : IMogoVoiceCmdCallBack{
|
||||
|
||||
override fun onSpeakEnd(speakText: String?) {
|
||||
GSYVideoManager.instance().curPlayerManager.setNeedMute(false)
|
||||
GSYVideoManager.onResume()
|
||||
}
|
||||
|
||||
override fun onSpeakError(speakText: String?, errorMsg: String?) {
|
||||
GSYVideoManager.instance().curPlayerManager.setNeedMute(false)
|
||||
}
|
||||
|
||||
override fun onSpeakSelectTimeOut(speakText: String?) {
|
||||
GSYVideoManager.instance().curPlayerManager.setNeedMute(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,8 @@ object OCHPlanningStopSideStatusManager : IMoGoAutopilotPlanningActionsListener
|
||||
CallerPlanningActionsListenerManager.setListenerHz(TAG,5)
|
||||
}
|
||||
|
||||
var stopSiteStatus = StopSite.NOTHING
|
||||
|
||||
val M_LISTENERS: ConcurrentHashMap<String, OCHPlanningActionsCallback> = ConcurrentHashMap()
|
||||
|
||||
fun addListener(
|
||||
@@ -69,6 +71,7 @@ object OCHPlanningStopSideStatusManager : IMoGoAutopilotPlanningActionsListener
|
||||
MessagePad.DrivingAction.DRIVING_ACTION_STATE_TWO -> {
|
||||
//表示靠边停车成功
|
||||
CallerLogger.d(SceneConstant.M_BUS+ TAG,"靠边停车成功")
|
||||
stopSiteStatus = StopSite.STOPSITED
|
||||
M_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
@@ -127,6 +130,9 @@ object OCHPlanningStopSideStatusManager : IMoGoAutopilotPlanningActionsListener
|
||||
}
|
||||
}
|
||||
}
|
||||
MessagePad.ParkScenarioDrivingState.PARK_SENARIO_LANKE_KEEP ->{
|
||||
stopSiteStatus = StopSite.LANKE_KEEP
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
@@ -138,6 +144,12 @@ object OCHPlanningStopSideStatusManager : IMoGoAutopilotPlanningActionsListener
|
||||
Ending(2)
|
||||
}
|
||||
|
||||
enum class StopSite{
|
||||
NOTHING,// 初始状态
|
||||
STOPSITED,// 靠边停车状态
|
||||
LANKE_KEEP;// 形式状态
|
||||
}
|
||||
|
||||
interface OCHPlanningActionsCallback {
|
||||
fun onStartAutopilotFailure(actionStatus:Status,stopSideStatus : Boolean?, errorInfo : String?)
|
||||
}
|
||||
|
||||
@@ -3,12 +3,17 @@ package com.mogo.och.common.module.voice
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.och.common.module.R
|
||||
import com.mogo.tts.base.IMogoTTSCallback
|
||||
import com.mogo.tts.base.LangTtsEntity
|
||||
import com.mogo.tts.base.LanguageType
|
||||
import java.util.ArrayList
|
||||
|
||||
object VoiceManager {
|
||||
|
||||
fun arrivedStation(siteName: String) {
|
||||
arrivedStation(siteName,null)
|
||||
}
|
||||
fun arrivedStation(siteName: String,callBack: IMogoTTSCallback?=null) {
|
||||
val contenxt = AbsMogoApplication.getApp()
|
||||
val list: MutableList<LangTtsEntity> = ArrayList()
|
||||
val chineseTTS = LangTtsEntity(
|
||||
@@ -26,10 +31,12 @@ object VoiceManager {
|
||||
list.add(chineseTTS)
|
||||
list.add(engTTS)
|
||||
list.add(koreanTTS)
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL1)
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL1,callBack)
|
||||
}
|
||||
|
||||
fun leaveStation(siteName: String) {
|
||||
fun leaveStation(siteName: String){
|
||||
leaveStation(siteName,null)
|
||||
}
|
||||
fun leaveStation(siteName: String,callBack: IMogoTTSCallback?=null) {
|
||||
val contenxt = AbsMogoApplication.getApp()
|
||||
val list: MutableList<LangTtsEntity> = ArrayList()
|
||||
val chineseTTS = LangTtsEntity(
|
||||
@@ -47,10 +54,14 @@ object VoiceManager {
|
||||
list.add(chineseTTS)
|
||||
list.add(engTTS)
|
||||
list.add(koreanTTS)
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL1)
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL1,callBack)
|
||||
}
|
||||
|
||||
fun surplus5min() {
|
||||
fun surplus5min(){
|
||||
surplus5min(null)
|
||||
}
|
||||
|
||||
fun surplus5min(callBack: IMogoTTSCallback?=null) {
|
||||
val contenxt = AbsMogoApplication.getApp()
|
||||
val list: MutableList<LangTtsEntity> = ArrayList()
|
||||
val chineseTTS = LangTtsEntity(contenxt.getString(R.string.surplus5_order_zh), LanguageType.CHINESE)
|
||||
@@ -59,10 +70,12 @@ object VoiceManager {
|
||||
list.add(chineseTTS)
|
||||
list.add(engTTS)
|
||||
list.add(koreanTTS)
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL0)
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL0,callBack)
|
||||
}
|
||||
|
||||
fun endOrder() {
|
||||
fun endOrder(){
|
||||
endOrder(null)
|
||||
}
|
||||
fun endOrder(callBack: IMogoTTSCallback?=null) {
|
||||
val contenxt = AbsMogoApplication.getApp()
|
||||
val list: MutableList<LangTtsEntity> = ArrayList()
|
||||
val chineseTTS = LangTtsEntity(contenxt.getString(R.string.end_order_zh), LanguageType.CHINESE)
|
||||
@@ -71,6 +84,6 @@ object VoiceManager {
|
||||
list.add(chineseTTS)
|
||||
list.add(engTTS)
|
||||
list.add(koreanTTS)
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL0)
|
||||
VoiceNotice.showNotice(list, AIAssist.LEVEL0,callBack)
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.mogo.och.common.module.voice
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.tts.base.IMogoTTSCallback
|
||||
import com.mogo.tts.base.LangTtsEntity
|
||||
import com.mogo.tts.base.MultiLangTtsEntity
|
||||
|
||||
@@ -50,8 +51,8 @@ object VoiceNotice {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun showNotice(listTTS: MutableList<LangTtsEntity>, level: Int) {
|
||||
fun showNotice(listTTS: MutableList<LangTtsEntity>, level: Int,callBack: IMogoTTSCallback?=null) {
|
||||
AIAssist.getInstance(AbsMogoApplication.getApp())
|
||||
.speakMultiLangTTSWithLevel(MultiLangTtsEntity(listTTS), level, null)
|
||||
.speakMultiLangTTSWithLevel(MultiLangTtsEntity(listTTS), level, callBack)
|
||||
}
|
||||
}
|
||||
@@ -124,6 +124,7 @@ object ConfigStartUp {
|
||||
mapParams.setDebugMode(false) // 1-使用本地地图数据,0-使用在线地图数据
|
||||
//.setDataFileSource(1)
|
||||
.setDebugMode(false)
|
||||
.setIsRecordLogs(false)
|
||||
.setCoordinateType(MapParams.COORDINATETYPE_GCJ02)
|
||||
.setPerspectiveMode(MapParams.MAP_PERSPECTIVE_UP_CAR)
|
||||
.setHDVisibileArray(
|
||||
|
||||
Reference in New Issue
Block a user