[6.8.0]
[fea] [车外播放音频]
This commit is contained in:
@@ -10,7 +10,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerFsm2024ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerReceiveReceivedAckListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.R
|
||||
@@ -279,6 +278,10 @@ object OchAutoPilotStatusListenerManager : CallerBase<IOchAutopilotStatusListene
|
||||
override fun onReceiveReceivedAck(receivedAck: ReceivedAck) {
|
||||
if (receivedAck.messageType == MessageType.TYPE_SEND_SET_AUTOPILOT_MODE_REQ) {
|
||||
OchAutopilotAnalytics.triggerStartAutopilotParametersAck(receivedAck.toString(),receivedAck.status == Status.NORMAL)
|
||||
if(receivedAck.status==Status.NORMAL){
|
||||
// 底盘接受成功
|
||||
LineManager.invokeStartAutopilotAckSuccess(receivedAck)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,15 +3,20 @@ package com.mogo.och.common.module.manager.autopilot.line;
|
||||
|
||||
public interface ILineCallback {
|
||||
default void clearLineSuccess(){}
|
||||
|
||||
default void drawLineSuccess(){}
|
||||
|
||||
default void drawLineFail(){}
|
||||
|
||||
default void startAutopilotSuccess(){}
|
||||
default void sendStartAutopilotSuccess(){}
|
||||
|
||||
default void startAutopilotTimeOut(){}
|
||||
|
||||
default void sendStartAutopilotSuccessAck(){}
|
||||
|
||||
default void startAutopilotFailure(String startFailedCode,String startFailedMessage){}
|
||||
|
||||
default void startAutopilotSuccess(){}
|
||||
|
||||
default void arrivedStationSuccessBySearch(){}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ import com.mogo.och.common.module.voice.VoiceNotice
|
||||
import com.mogo.och.data.bean.BusStationBean
|
||||
import com.mogo.och.data.bean.ContraiInfo
|
||||
import com.mogo.och.data.bean.LineInfo
|
||||
import com.zhjt.mogo.adas.data.bean.ReceivedAck
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
/**
|
||||
@@ -490,7 +491,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
)
|
||||
|
||||
M_LISTENERS.forEach {
|
||||
it.value.startAutopilotSuccess()
|
||||
it.value.sendStartAutopilotSuccess()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,4 +534,10 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeStartAutopilotAckSuccess(receivedAck: ReceivedAck) {
|
||||
M_LISTENERS.forEach {
|
||||
it.value.sendStartAutopilotSuccessAck()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,6 +21,14 @@ object VoiceNotice {
|
||||
showNotice(notice, AIAssist.LEVEL0)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun showNoticeOut(notice: String?) {
|
||||
save2Log("车外准备播放 内容${notice}")
|
||||
notice?.let {
|
||||
AIAssist.getInstance(AbsMogoApplication.getApp()).playVoiceOutside(notice)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun showNotice(notice: String?, level: Int) {
|
||||
showNotice(notice,level,0)
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.debug.autopilot.AutopilotStateDebug
|
||||
import com.mogo.och.common.module.debug.autopilot.IOchDebugAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.autopilot.line.ILineCallback
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager
|
||||
@@ -132,7 +131,7 @@ class AutopilotStateModel : ViewModel(), IOchAutopilotStatusListener, ILineCall
|
||||
fun startAutopilot() {
|
||||
OchChainLogManager.writeChainLog("自驾信息","启动自驾")
|
||||
if(AutopilotStateDebug.debugStatus){
|
||||
startAutopilotSuccess()
|
||||
sendStartAutopilotSuccess()
|
||||
RxUtils.createSubscribe(5_000) {
|
||||
startAutopilotFail()
|
||||
}
|
||||
@@ -144,7 +143,7 @@ class AutopilotStateModel : ViewModel(), IOchAutopilotStatusListener, ILineCall
|
||||
/**
|
||||
* 条件过滤完成 正式进入启动自驾状态
|
||||
*/
|
||||
override fun startAutopilotSuccess() {
|
||||
override fun sendStartAutopilotSuccess() {
|
||||
OchChainLogManager.writeChainLog("自驾信息","启动自驾成功")
|
||||
BizLoopManager.runInMainThread {
|
||||
this.viewCallback?.startAutopilotAnimation()
|
||||
|
||||
@@ -23,6 +23,8 @@ class BusConst {
|
||||
// 尝试下发给MEC轨迹最多10次
|
||||
const val LOOP_SEND_TRAJ_TIMES = 10
|
||||
|
||||
const val SEND_OUTVOICE_DISTANCES_TARTSTATIONE = 15
|
||||
|
||||
//起点UUID
|
||||
const val BUS_START_MAP_MAKER = "bus_start_map_maker";
|
||||
//终点UUID
|
||||
|
||||
@@ -10,14 +10,20 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.biz.login.LoginStatusManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
import com.mogo.och.common.module.manager.autopilot.autopilot.bean.ArrivedStation
|
||||
import com.mogo.och.common.module.manager.autopilot.line.ILineCallback
|
||||
import com.mogo.och.common.module.manager.autopilot.line.LineManager
|
||||
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.manager.loop.LoopInfo
|
||||
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.LedScreenManager
|
||||
import com.mogo.och.common.module.manager.transform.OchTransform
|
||||
@@ -39,6 +45,7 @@ import io.reactivex.Observer
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import mogo_msg.MogoReportMsg.MogoReportMessage
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -71,6 +78,7 @@ object OrderModel {
|
||||
// 加载核销模块
|
||||
TicketModel.load()
|
||||
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, ochAutopilotStatusListener)
|
||||
|
||||
LineManager.addListener(TAG,arriveStationBySearch)
|
||||
|
||||
@@ -89,10 +97,26 @@ object OrderModel {
|
||||
|
||||
TicketModel.release()
|
||||
|
||||
OchAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
|
||||
LineManager.removeListener(TAG)
|
||||
OchTransform.removeListener(TAG)
|
||||
}
|
||||
|
||||
private val ochAutopilotStatusListener = object : IOchAutopilotStatusListener{
|
||||
override fun onAutopilotArriveAtStation(arrivedStation: ArrivedStation?) {
|
||||
e(M_BUS + TAG, "行程日志-onAutopilotArriveAtStation arrive")
|
||||
onArriveAt(arrivedStation, "底盘触发进站")
|
||||
}
|
||||
|
||||
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMessage, lineId: Long) {
|
||||
BusTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo, lineId)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private val ochTransform = object : OchTransformDispatch {
|
||||
override fun logout() {
|
||||
logoutInner()
|
||||
@@ -110,6 +134,34 @@ object OrderModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun sendStartAutopilotSuccessAck() {
|
||||
//底盘收到启动自驾的回执
|
||||
BizLoopManager.setLoopFunction(TAG, LoopInfo(2, ::calculateDistanceAndAutoStatus,scheduler = Schedulers.io()))
|
||||
}
|
||||
}
|
||||
// 在站点15m内且启动自动驾驶成功后播报,每次启动仅播报1次
|
||||
private fun calculateDistanceAndAutoStatus() {
|
||||
val (start, end) = LineManager.getStations()
|
||||
if(start==null){
|
||||
BizLoopManager.removeLoopFunction(TAG)
|
||||
}else{
|
||||
val startLon = start.gcjLon
|
||||
val startLat = start.gcjLat
|
||||
val mogoLocation = OchLocationManager.getGCJ02Location()
|
||||
val distance = CoordinateUtils.calculateLineDistance(
|
||||
startLon, startLat,
|
||||
mogoLocation.longitude, mogoLocation.latitude
|
||||
)
|
||||
if (distance < BusConst.SEND_OUTVOICE_DISTANCES_TARTSTATIONE) {
|
||||
if(OchAutoPilotStatusListenerManager.autopilotState==IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
|
||||
ShuttleVoiceManager.arrivedStationOut(ResourcesUtils.getString(R.string.m2_voice_out_autopilot_start_in15m))
|
||||
BizLoopManager.removeLoopFunction(TAG)
|
||||
}
|
||||
}else{
|
||||
BizLoopManager.removeLoopFunction(TAG)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,8 +16,10 @@ import com.mogo.och.common.module.manager.socket.lan.LedScreenManager
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.BusinessType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.DPMsgType
|
||||
import com.mogo.och.common.module.manager.socket.lan.bean.TaskDetailsMsg
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import com.mogo.och.data.bean.BusRoutesResult
|
||||
import com.mogo.och.data.bean.BusTransferData
|
||||
import com.mogo.och.shuttle.weaknet.R
|
||||
import com.mogo.och.weaknet.constant.BusConst
|
||||
import com.mogo.och.weaknet.util.ShuttleVoiceManager
|
||||
|
||||
@@ -92,6 +94,8 @@ object ThirdDeviceData {
|
||||
}
|
||||
LineManager.getStationsWithLine { start, end, lineInfo ->
|
||||
ShuttleVoiceManager.arrivedStationBus(end.name, end.nameKr)
|
||||
// 收到正在进站的决策信息时播报,每个站点仅播报1次
|
||||
ShuttleVoiceManager.arrivedStationOut(ResourcesUtils.getString(R.string.m2_voice_out_arrive_station))
|
||||
//给bus外屏发送
|
||||
LedScreenManager.sendTripInfo2Led(
|
||||
LedScreenManager.ARRIVE_STATION,
|
||||
|
||||
@@ -23,8 +23,7 @@ import mogo_msg.MogoReportMsg.MogoReportMessage
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view),
|
||||
IOchAutopilotStatusListener, ILoginCallback {
|
||||
class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view), ILoginCallback {
|
||||
|
||||
init {
|
||||
//2021.11.1 鹰眼架构整合,由IMoGoAutopilotStatusListener逐步替代IMogoAdasOCHCallback接口
|
||||
@@ -44,27 +43,15 @@ class BusPresenter(view: ShuttleFragment?) : Presenter<ShuttleFragment?>(view),
|
||||
}
|
||||
|
||||
fun initModelListener() {
|
||||
OchAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
LoginStatusManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
fun releaseListener() {
|
||||
OCHAdasAbilityManager.getInstance().release()
|
||||
OchAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
|
||||
LoginStatusManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onAutopilotArriveAtStation(arrivedStation: ArrivedStation?) {
|
||||
e(SceneConstant.M_BUS + TAG, "行程日志-onAutopilotArriveAtStation arrive")
|
||||
OrderModel.onArriveAt(arrivedStation, "底盘触发进站")
|
||||
}
|
||||
|
||||
|
||||
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMessage, lineId: Long) {
|
||||
BusTrajectoryManager.getInstance().onAutopilotGuardian(guardianInfo, lineId)
|
||||
}
|
||||
|
||||
override fun onStatusChange(currentStatus: LoginStatusEnum) {
|
||||
d(SceneConstant.M_BUS + TAG, " loginStatus =" + isLogin())
|
||||
if (isLogin()) {
|
||||
|
||||
@@ -15,6 +15,12 @@ import com.mogo.tts.base.LanguageType
|
||||
|
||||
object ShuttleVoiceManager {
|
||||
|
||||
fun arrivedStationOut(notice:String?){
|
||||
if (AppIdentityModeUtils.isB2(FunctionBuildConfig.appIdentityMode)) {
|
||||
VoiceNotice.showNoticeOut(notice)
|
||||
}
|
||||
}
|
||||
|
||||
fun arrivedStationBus(siteNameCN: String?, siteNameKR: String?) {
|
||||
val context = AbsMogoApplication.getApp()
|
||||
val list: MutableList<LangTtsEntity> = ArrayList()
|
||||
|
||||
@@ -46,6 +46,11 @@
|
||||
<string name="bus_dialog_confirm">确认</string>
|
||||
<string name="bus_dialog_cancel">取消</string>
|
||||
|
||||
<string name="m2_voice_out_arrive_station">蘑菇小巴正在进站</string>
|
||||
<string name="m2_voice_out_autopilot_start_in15m">蘑菇小巴出发咯</string>
|
||||
|
||||
|
||||
|
||||
<string name="shuttle_logout_error">请在网络良好的区域完成任务信息同步后退出</string>
|
||||
<string name="shuttle_logout_error_running">请结束任务后再退出登录</string>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user