[2.13.0-arhc-opt] merge
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
package com.mogo.eagle.core.function.call.hmi
|
||||
|
||||
import android.content.Context
|
||||
import android.view.ViewGroup
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.dispatch.DispatchAdasAutoPilotLocReceiverBean
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
@@ -18,38 +19,15 @@ import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
* @date 2021/9/17 3:59 下午
|
||||
*
|
||||
* HMI 调用者管理,这里对外及其他模块提供功能的调用,用啥写啥,不要过度设计,不允许直接将Provider暴露出去
|
||||
*
|
||||
*/
|
||||
object CallerHmiManager {
|
||||
private val waringProviderApi
|
||||
get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI)
|
||||
private val hmiProviderApi
|
||||
get() = ARouter.getInstance().build(MogoServicePaths.PATH_FRAGMENT_HMI)
|
||||
.navigation() as? IMoGoHmiProvider
|
||||
|
||||
/**
|
||||
* 浓雾预警
|
||||
*/
|
||||
fun displayEffects() {
|
||||
waringProviderApi?.displayEffects()
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制显示sn绑定弹框
|
||||
*/
|
||||
fun setSnBinding(isOpen: Boolean) {
|
||||
waringProviderApi?.setSnBinding(isOpen)
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否展示obu的弱势交通
|
||||
*/
|
||||
fun setObuWeaknessTraffic(isOpen: Boolean) {
|
||||
waringProviderApi?.setObuWeaknessTraffic(isOpen)
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否展示云端的弱势交通
|
||||
*/
|
||||
fun setCloudWeaknessTraffic(isOpen: Boolean) {
|
||||
waringProviderApi?.setCloudWeaknessTraffic(isOpen)
|
||||
fun init(context:Context){
|
||||
hmiProviderApi?.init(context)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,15 +38,15 @@ object CallerHmiManager {
|
||||
alertContent: CharSequence?,
|
||||
ttsContent: String?,
|
||||
listenerIMoGo: IMoGoWarningStatusListener? = null,
|
||||
playTts: Boolean = true,
|
||||
direction: WarningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_NON,
|
||||
expireTime: Long = 5000L,
|
||||
) {
|
||||
waringProviderApi?.warningV2X(
|
||||
hmiProviderApi?.warningV2X(
|
||||
v2xType,
|
||||
alertContent,
|
||||
ttsContent,
|
||||
listenerIMoGo,
|
||||
playTts,
|
||||
direction,
|
||||
expireTime
|
||||
)
|
||||
}
|
||||
@@ -78,25 +56,15 @@ object CallerHmiManager {
|
||||
* @param direction
|
||||
* @see WarningDirectionEnum
|
||||
*/
|
||||
fun showWarning(direction: WarningDirectionEnum) {
|
||||
waringProviderApi?.showWarning(direction)
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示指定方位上的红框预警
|
||||
* @param direction
|
||||
* @see WarningDirectionEnum
|
||||
* @param closeTime 倒计时
|
||||
*/
|
||||
fun showWarning(direction: WarningDirectionEnum, closeTime: Long) {
|
||||
waringProviderApi?.showWarning(direction, closeTime)
|
||||
fun showWarning(v2xType: String, direction: WarningDirectionEnum, expireTime: Long) {
|
||||
hmiProviderApi?.showWarning(v2xType, direction, expireTime)
|
||||
}
|
||||
|
||||
/**
|
||||
* 主动消失边框预警
|
||||
*/
|
||||
fun dismissWarning(direction: WarningDirectionEnum) {
|
||||
waringProviderApi?.dismissWarning(direction)
|
||||
hmiProviderApi?.dismissWarning(direction)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,31 +72,61 @@ object CallerHmiManager {
|
||||
* @param trafficStylePushData
|
||||
*/
|
||||
fun showTrafficBanner(trafficStylePushData: NoticeTrafficStylePushData?) {
|
||||
waringProviderApi?.showNoticeForTrafficWithData(trafficStylePushData)
|
||||
hmiProviderApi?.showNoticeForTrafficWithData(trafficStylePushData)
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通公告弹窗
|
||||
*/
|
||||
fun showNoticeNormalData(noticeNormal: NoticeNormalData) {
|
||||
waringProviderApi?.showNoticeNormalData(noticeNormal)
|
||||
hmiProviderApi?.showNoticeNormalData(noticeNormal)
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启道路视频直播
|
||||
*/
|
||||
fun startRoadCameraLive(flvUrl: String) {
|
||||
waringProviderApi?.startRoadCameraLive(flvUrl)
|
||||
hmiProviderApi?.startRoadCameraLive(flvUrl)
|
||||
}
|
||||
|
||||
/**
|
||||
* 超视距感知关闭
|
||||
*/
|
||||
fun showNoSignalView() {
|
||||
hmiProviderApi?.showNoSignView()
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示工具栏
|
||||
*/
|
||||
fun showToolsView() {
|
||||
hmiProviderApi?.showToolsView()
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭工具栏
|
||||
*/
|
||||
fun hideToolsView() {
|
||||
hmiProviderApi?.hideToolsView()
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示绑定车辆弹框
|
||||
*/
|
||||
fun showBindingCarDialog() {
|
||||
waringProviderApi?.showToBindingcarDialog()
|
||||
hmiProviderApi?.showToBindingCarDialog()
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示修改绑定车辆弹框
|
||||
*/
|
||||
fun showModifyBindingCarDialog() {
|
||||
waringProviderApi?.showModifyBindingcarDialog()
|
||||
hmiProviderApi?.showModifyBindingCarDialog()
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示升级app弹框
|
||||
*/
|
||||
fun showUpgradeDialog(
|
||||
name: String,
|
||||
url: String,
|
||||
@@ -136,41 +134,35 @@ object CallerHmiManager {
|
||||
content: String,
|
||||
installType: String
|
||||
) {
|
||||
waringProviderApi?.showUpgradeDialog(name, url, title, content, installType)
|
||||
hmiProviderApi?.showUpgradeDialog(name, url, title, content, installType)
|
||||
}
|
||||
|
||||
/**
|
||||
* 呈现工控机升级确认框
|
||||
*/
|
||||
fun showAdUpgradeDialog(images: List<String>, padSn: String, releaseId: String) {
|
||||
waringProviderApi?.showAdUpgradeDialog(images, padSn, releaseId)
|
||||
hmiProviderApi?.showAdUpgradeDialog(images, padSn, releaseId)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新工控机下载、升级状态
|
||||
*/
|
||||
fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo) {
|
||||
waringProviderApi?.showAdUpgradeStatus(ipcUpgradeStateInfo)
|
||||
hmiProviderApi?.showAdUpgradeStatus(ipcUpgradeStateInfo)
|
||||
}
|
||||
|
||||
fun showNoSignalView() {
|
||||
waringProviderApi?.showNoSignView()
|
||||
/**
|
||||
* 调度弹窗展示
|
||||
*/
|
||||
fun showDispatchDialog(msgData: DispatchAdasAutoPilotLocReceiverBean) {
|
||||
hmiProviderApi?.showDispatchDialog(msgData)
|
||||
}
|
||||
|
||||
fun showToolsView() {
|
||||
waringProviderApi?.showToolsView()
|
||||
}
|
||||
|
||||
fun hideToolsView() {
|
||||
waringProviderApi?.hideToolsView()
|
||||
}
|
||||
|
||||
fun showSmallFragment() {
|
||||
waringProviderApi?.showSmallFragment()
|
||||
}
|
||||
|
||||
fun hideSmallFragment() {
|
||||
waringProviderApi?.hideSmallFragment()
|
||||
/**
|
||||
* 隐藏调度弹窗
|
||||
*/
|
||||
fun dismissDispatchDialog() {
|
||||
hmiProviderApi?.dismissDispatchDialog()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,11 +176,11 @@ object CallerHmiManager {
|
||||
warningReportList: ArrayList<ReportEntity>,
|
||||
reportLevel: Int
|
||||
) {
|
||||
waringProviderApi?.showIPCReportWindow(errorReportList, warningReportList, reportLevel)
|
||||
hmiProviderApi?.showIPCReportWindow(errorReportList, warningReportList, reportLevel)
|
||||
}
|
||||
|
||||
fun showVideoDialog(infList: List<Infrastructure>) {
|
||||
waringProviderApi?.showVideoDialog(infList)
|
||||
hmiProviderApi?.showVideoDialog(infList)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,49 +188,35 @@ object CallerHmiManager {
|
||||
* 默认 light
|
||||
*/
|
||||
fun setStatusBarDarkOrLight(light: Boolean = true) {
|
||||
waringProviderApi?.setStatusBarDarkOrLight(light)
|
||||
hmiProviderApi?.setStatusBarDarkOrLight(light)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新(添加/删除)状态栏右侧元素
|
||||
*/
|
||||
fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
waringProviderApi?.updateStatusBarRightView(insert, tag, viewGroup)
|
||||
hmiProviderApi?.updateStatusBarRightView(insert, tag, viewGroup)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新(添加/删除)状态栏左侧元素
|
||||
*/
|
||||
fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
waringProviderApi?.updateStatusBarLeftView(insert, tag, viewGroup)
|
||||
hmiProviderApi?.updateStatusBarLeftView(insert, tag, viewGroup)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新(添加/删除)状态栏右侧元素
|
||||
*/
|
||||
fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) {
|
||||
waringProviderApi?.updateStatusBarDownloadView(insert, tag, progress)
|
||||
hmiProviderApi?.updateStatusBarDownloadView(insert, tag, progress)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新魔方的链接状态
|
||||
*/
|
||||
fun updateMfStatusView(tag: String, status: Boolean) {
|
||||
waringProviderApi?.updateMfStatus(tag, status)
|
||||
}
|
||||
|
||||
/**
|
||||
* 调度弹窗展示
|
||||
*/
|
||||
fun showDispatchDialog(msgData: DispatchAdasAutoPilotLocReceiverBean) {
|
||||
waringProviderApi?.showDispatchDialog(msgData)
|
||||
}
|
||||
|
||||
/**
|
||||
* 隐藏调度弹窗
|
||||
*/
|
||||
fun dismissDispatchDialog(){
|
||||
waringProviderApi?.dismissDispatchDialog()
|
||||
hmiProviderApi?.updateMfStatus(tag, status)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.eagle.core.function.call.vip
|
||||
package com.mogo.eagle.core.function.call.v2x
|
||||
|
||||
import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener
|
||||
import com.mogo.eagle.core.function.api.v2x.IMoGoVipSetListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
object CallVipSetListenerManager : CallerBase<IMoGoVipSetListener>() {
|
||||
@@ -12,7 +12,7 @@ object CallVipSetListenerManager : CallerBase<IMoGoVipSetListener>() {
|
||||
}
|
||||
|
||||
fun invokeVipSetStatus(vipStatus: Boolean) {
|
||||
this.vipSet = vipStatus
|
||||
vipSet = vipStatus
|
||||
M_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
@@ -16,9 +16,16 @@ object CallerLimitingVelocityListenerManager : CallerBase<ILimitingVelocityListe
|
||||
listener.onLimitingVelocityChange(mCurrentLimitingVelocity, sourceType)
|
||||
}
|
||||
|
||||
fun invokeOnLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
|
||||
fun invokeUnion(limitingVelocity: Int, sourceType: DataSourceType){
|
||||
this.mCurrentLimitingVelocity = limitingVelocity
|
||||
this.sourceType = sourceType
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onUnion(limitingVelocity, sourceType)
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeOnLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onLimitingVelocityChange(limitingVelocity, sourceType)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.mogo.eagle.core.function.call.trafficlight
|
||||
package com.mogo.eagle.core.function.call.v2x
|
||||
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>() {
|
||||
@@ -17,7 +17,7 @@ object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>
|
||||
}
|
||||
|
||||
fun invokeTrafficLightStatus(trafficLightResult: TrafficLightResult) {
|
||||
this.trafficLightResult = trafficLightResult
|
||||
CallerTrafficLightListenerManager.trafficLightResult = trafficLightResult
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onTrafficLightStatus(trafficLightResult)
|
||||
@@ -38,10 +38,10 @@ object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeObuTrafficLightStatus(light: TrafficLightEnum) {
|
||||
fun invokeTrafficLightPlusSource(light: TrafficLightEnum, remain:Int = -1, lightSource: DataSourceType) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onObuTrafficLightStatus(light)
|
||||
listener.onTrafficLightPlusSource(light ,remain, lightSource)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.mogo.eagle.core.function.call.v2x
|
||||
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.function.api.v2x.IV2XEventListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
object CallerV2XWarningListenerManager : CallerBase<IV2XEventListener>() {
|
||||
|
||||
fun show(v2xType: String, direction: WarningDirectionEnum, time: Long) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.show(v2xType, direction, time)
|
||||
}
|
||||
}
|
||||
|
||||
fun dismiss(direction: WarningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_ALL) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.dismiss(direction)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.mogo.eagle.core.function.call.v2x
|
||||
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
/**
|
||||
* 限速信息监听
|
||||
*/
|
||||
object CallerViewLimitingVelocityListenerManager : CallerBase<ILimitingVelocityListener>() {
|
||||
|
||||
private var mCurrentLimitingVelocity = 0
|
||||
private var sourceType = DataSourceType.DEFAULT
|
||||
|
||||
override fun doSomeAfterAddListener(tag: String, listener: ILimitingVelocityListener) {
|
||||
listener.onLimitingVelocityChange(mCurrentLimitingVelocity, sourceType)
|
||||
}
|
||||
|
||||
fun invokeOnLimitingVelocityChange(limitingVelocity: Int, sourceType: DataSourceType) {
|
||||
this.mCurrentLimitingVelocity = limitingVelocity
|
||||
this.sourceType = sourceType
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onLimitingVelocityChange(limitingVelocity, sourceType)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user