Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0

# Conflicts:
#	OCH/mogo-och-sweeper/build.gradle
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/SweeperProvider.java
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/SweeperFragment.java
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/presenter/SweeperPresenter.java
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java
#	OCH/mogo-och-sweeper/src/main/res/layout/sweeper_base_fragment.xml
This commit is contained in:
donghongyu
2023-02-08 14:40:42 +08:00
314 changed files with 5403 additions and 6632 deletions

View File

@@ -10,7 +10,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_C
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_ADAS
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotControlProvider
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.zhjt.service.chain.ChainLog
@@ -23,12 +23,12 @@ import kotlin.random.Random
*@date 2021/10/14 2:15 下午
* 域控制器管理
*/
object CallerAutoPilotManager {
object CallerAutoPilotControlManager {
private val TAG = "CallerAutoPilotManager"
private val providerApi: IMoGoAutopilotProvider?
private val providerApi: IMoGoAutopilotControlProvider?
get() = CallerBase.getApiInstance(
IMoGoAutopilotProvider::class.java,
IMoGoAutopilotControlProvider::class.java,
MogoServicePaths.PATH_AUTO_PILOT
)
@@ -104,14 +104,14 @@ object CallerAutoPilotManager {
/**
* 开启域控制器录制bag包
*/
@BizConfig(FuncBizConfig.FOUNDATION,"", FuncBizConfig.BIZ_BAG_RECORD)
@BizConfig(FuncBizConfig.FOUNDATION, "", FuncBizConfig.BIZ_BAG_RECORD)
fun recordPackage() {
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
providerApi?.recordPackage(1, Random(SystemClock.elapsedRealtime()).nextInt())
}
}
@BizConfig(FuncBizConfig.FOUNDATION,"", FuncBizConfig.BIZ_BAG_RECORD)
@BizConfig(FuncBizConfig.FOUNDATION, "", FuncBizConfig.BIZ_BAG_RECORD)
fun recordPackage(duration: Int) {
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
providerApi?.recordPackage(1, Random(SystemClock.elapsedRealtime()).nextInt(), duration)
@@ -136,8 +136,8 @@ object CallerAutoPilotManager {
}
}
fun recordPackage(type: Int,id: Int,duration: Int,bduration: Int,topics: List<String>){
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){
fun recordPackage(type: Int, id: Int, duration: Int, bduration: Int, topics: List<String>) {
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
providerApi?.recordPackage(type, id, duration, bduration, topics)
}
}
@@ -240,7 +240,7 @@ object CallerAutoPilotManager {
* isEnable = false 关闭
* @return boolean
*/
fun sendDetouring(isEnable: Boolean): Boolean?{
fun sendDetouring(isEnable: Boolean): Boolean? {
return providerApi?.sendDetouring(isEnable)
}
@@ -249,7 +249,7 @@ object CallerAutoPilotManager {
* @param speed 速度阈值 m/s
* @return boolean
*/
fun sendDetouringSpeed(speed: Double): Boolean?{
fun sendDetouringSpeed(speed: Double): Boolean? {
return providerApi?.sendDetouringSpeed(speed)
}
@@ -259,11 +259,11 @@ object CallerAutoPilotManager {
* @param recordType 0:不需要修改内置类型的topic组合, 1:需要修改内置类型的topic组合
* @param topicsNeedToCache
*/
fun getBadCaseConfig(reqType: Int,recordType: Int,topicsNeedToCache: List<String>): Boolean?{
fun getBadCaseConfig(reqType: Int, recordType: Int, topicsNeedToCache: List<String>): Boolean? {
// 司机屏才能查询数据采集的配置
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
return providerApi?.getBadCaseConfig(reqType, recordType, topicsNeedToCache)
}else{
} else {
return false
}
}
@@ -309,7 +309,14 @@ object CallerAutoPilotManager {
* @param isLastStop 是否最终站
* @return boolean
*/
fun sendTripInfo(type: Int, lineName: String, departureStopName: String, arrivalStopName: String, isLastStop: Boolean) {
@JvmStatic
fun sendTripInfo(
type: Int,
lineName: String,
departureStopName: String,
arrivalStopName: String,
isLastStop: Boolean
) {
providerApi?.sendTripInfo(type, lineName, departureStopName, arrivalStopName, isLastStop)
}
@@ -400,4 +407,12 @@ object CallerAutoPilotManager {
fun sendSweeperFuTianTaskCmd(fuTianTaskCmd: SpecialVehicleTaskCmdOuterClass.RoboSweeperFuTianTaskCmd) {
providerApi?.sendSweeperFuTianTaskCmd(fuTianTaskCmd)
}
/**
* 打开点云绘制
*/
fun setIsDrawPointCloud(isDrawPointCloud: Boolean) {
providerApi?.setIsDrawPointCloud(isDrawPointCloud)
}
}

View File

@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.zhidao.support.adas.high.bean.AutopilotAbility
/**
@@ -11,10 +10,10 @@ import com.zhidao.support.adas.high.bean.AutopilotAbility
object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsListener>() {
@Synchronized
fun invokeAutopilotAbility(ability: AutopilotAbility?) {
fun invokeAutopilotAbility(isAutopilotAbility: Boolean, unableAutopilotReason: String?) {
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotAbility(ability)
listener.onAutopilotAbility(isAutopilotAbility, unableAutopilotReason)
}
}
}

View File

@@ -6,9 +6,9 @@ import mogo.telematics.pad.MessagePad
import perception.TrafficLightOuterClass
/**
* 域控制器感知数据
* @author xiaoyuzhou
* @date 2021/9/30 5:48 下午
* 域控制器感知数据
*/
object CallerAutopilotIdentifyListenerManager : CallerBase<IMoGoAutopilotIdentifyListener>() {

View File

@@ -0,0 +1,27 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGnssListener
import com.mogo.eagle.core.function.call.base.CallerBase
import mogo.telematics.pad.MessagePad
/**
* 车辆定位 WGS84 坐标系-高精度坐标系 数据 回调监听
* @author xiaoyuzhou
* @date 2021/9/30 5:48 下午
*/
object CallerChassisGnssListenerManager : CallerBase<IMoGoChassisGnssListener>() {
/**
* 车辆定位 WGS84 坐标系-高精度坐标系 数据
* @param gnssInfo
*/
@Synchronized
fun invokeChassisGnssListener(gnssInfo: MessagePad.GnssInfo) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onChassisGnss(gnssInfo)
}
}
}

View File

@@ -9,14 +9,37 @@ import com.mogo.eagle.core.function.call.base.CallerBase
*/
object CallerChassisLamplightListenerManager : CallerBase<IMoGoChassisLamplightListener>() {
private var turnLightTimes = 0
private var isOnTurnLight = false
/**
* 车辆转向灯数据回调
* @param lightSwitch
*/
fun invokeAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
fun invokeAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch) {
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotLightSwitchData(lightSwitch)
listener.onAutopilotLightSwitchData(getTurnLightState(lightSwitch))
}
}
private fun getTurnLightState(turn_light: Chassis.LightSwitch): Chassis.LightSwitch? {
if (turn_light == Chassis.LightSwitch.LIGHT_NONE) {
return if (isOnTurnLight) {
if (turnLightTimes >= 10) {
isOnTurnLight = false
return turn_light
} else {
turnLightTimes++
null
}
} else {
null
}
} else {
turnLightTimes = 0
isOnTurnLight = true
return turn_light
}
}

View File

@@ -0,0 +1,112 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.util.CoordinateTransform
import com.mogo.eagle.core.utilcode.util.FileUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils
/**
* @author xiaoyuzhou
* @date 2021/9/30 5:48 下午
* 车辆定位 WGS84 坐标系-高精度坐标系 数据 回调监听
*/
object CallerChassisLocationGCJ02ListenerManager : CallerBase<IMoGoChassisLocationGCJ02Listener>() {
val TAG = "CallerChassisLocationGCJ20ListenerManager"
@Volatile
private var mGnssInfo: MogoLocation? = null
/**
* 添加监听并指定回掉频率
* @param tag
* @param callBackHz // 设置数据回调频率单位HZ1HZ的周期是1秒50HZ的周期是1/50=0.02秒10HZ的周期是1/10=0.1秒。
* @param listener
*/
fun addListener(
tag: String,
callBackHz: Int,
listener: IMoGoChassisLocationGCJ02Listener
) {
addListener(tag, listener)
setListenerHz(tag, callBackHz)
}
fun getChassisLocationGCJ02(): MogoLocation? {
return mGnssInfo
}
/**
* 车辆定位 WGS84 坐标系-高精度坐标系 数据
* @param gnssInfo
*/
@Synchronized
fun invokeChassisLocationGCJ02(gnssInfo: MogoLocation?, sourceType: DataSourceType) {
gnssInfo?.let {
// 克隆定位数据,防止原数据被篡改导致位置跳变
mGnssInfo = gnssInfo.clone()
// 转换 WGS84-->GCJ02 坐标
val gcj20Location =
CoordinateTransform.WGS84ToGCJ02(gnssInfo.longitude, gnssInfo.latitude)
mGnssInfo?.let {
mGnssInfo!!.longitude = gcj20Location[0]
mGnssInfo!!.latitude = gcj20Location[1]
M_LISTENERS.forEach {
val tag = it.key
// 获取数据监听需要的HZ
val hz = M_LISTENERS_HZ[tag]
if (hz != null && hz > 0) {
val hzTime = (1.0 / hz.toDouble()) * 1000
// 获取最后一次回调的时间
val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag]
if (hzLastSendTime != null && hzLastSendTime > 0) {
// 计算是否进入下一次回调周期
val nowTime = TimeUtils.getNowMills()
if (nowTime - hzLastSendTime > hzTime) {
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
}
} else {
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
}
} else {
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
}
}
}
} ?: let {
Logger.e(TAG, "定位数据为Null")
}
}
/**
* 向订阅位置信息的发出定位信息
* @param tag
* @param it
* @param gnssInfo
* @param sourceType 数据来源
*/
private fun syncLocationCallback(
tag: String,
it: Map.Entry<String, IMoGoChassisLocationGCJ02Listener>,
mogoLocation: MogoLocation,
sourceType: DataSourceType
) {
// 记录最后一次回调时间
M_LISTENERS_HZ_LAST_SEND_TIME[tag] = TimeUtils.getNowMills()
val listener = it.value
listener.onChassisLocationGCJ02(mogoLocation)
// FileUtils.writeToFile(
// "/sdcard/Download/",
// "location_gcj02.txt",
// "${mogoLocation.longitude},${mogoLocation.latitude},${sourceType}\n"
// )
}
}

View File

@@ -1,51 +0,0 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.util.CoordinateTransform
import mogo.telematics.pad.MessagePad
/**
* @author xiaoyuzhou
* @date 2021/9/30 5:48 下午
* 车辆定位 WGS84 坐标系-高精度坐标系 数据 回调监听
*/
object CallerChassisLocationGCJ20ListenerManager : CallerBase<IMoGoChassisLocationGCJ02Listener>() {
val TAG = "CallerChassisLocationGCJ20ListenerManager"
@Volatile
private var mGnssInfo: MessagePad.GnssInfo? = null
fun getChassisLocationGCJ02(): MessagePad.GnssInfo? {
return mGnssInfo
}
/**
* 车辆定位 WGS84 坐标系-高精度坐标系 数据
* @param gnssInfo
*/
@Synchronized
fun invokeChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
gnssInfo?.let {
// 转换 WGS84-->GCJ02 坐标
val gcj20Location = CoordinateTransform.WGS84ToGCJ02(gnssInfo.longitude, gnssInfo.latitude)
val gnssBuilder = gnssInfo.toBuilder()
gnssBuilder.longitude = gcj20Location[0]
gnssBuilder.latitude = gcj20Location[1]
this.mGnssInfo = gnssBuilder.build()
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onChassisLocationGCJ02(this.mGnssInfo)
}
} ?: let {
Logger.e(TAG, "定位数据为Null")
}
}
}

View File

@@ -1,8 +1,10 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.data.enums.DataSourceType
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.base.CallerBase
import mogo.telematics.pad.MessagePad
import com.mogo.eagle.core.utilcode.util.TimeUtils
/**
* @author xiaoyuzhou
@@ -12,24 +14,81 @@ import mogo.telematics.pad.MessagePad
object CallerChassisLocationWGS84ListenerManager : CallerBase<IMoGoChassisLocationWGS84Listener>() {
@Volatile
private var gnssInfo: MessagePad.GnssInfo? = null
private var mGnssInfo: MogoLocation? = null
fun getChassisLocationWGS84(): MessagePad.GnssInfo? {
return gnssInfo
fun getChassisLocationWGS84(): MogoLocation? {
return mGnssInfo
}
/**
* 添加监听并指定回掉频率
*/
fun addListener(
tag: String,
callBackHz: Int,
listener: IMoGoChassisLocationWGS84Listener
) {
addListener(tag, listener)
setListenerHz(tag, callBackHz)
}
/**
* 车辆定位 WGS84 坐标系-高精度坐标系 数据
* @param gnssInfo
*/
@Synchronized
fun invokeChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
this.gnssInfo = gnssInfo
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value
listener.onChassisLocationWGS84(gnssInfo)
fun invokeChassisLocationWGS84(gnssInfo: MogoLocation, sourceType: DataSourceType) {
this.mGnssInfo = gnssInfo.clone()
mGnssInfo?.let {
M_LISTENERS.forEach {
val tag = it.key
// 获取数据监听需要的HZ
val hz = M_LISTENERS_HZ[tag]
if (hz != null && hz > 0) {
val hzTime = (1.0 / hz.toDouble()) * 1000
// 获取最后一次回调的时间
val hzLastSendTime = M_LISTENERS_HZ_LAST_SEND_TIME[tag]
if (hzLastSendTime != null && hzLastSendTime > 0) {
// 计算是否进入下一次回调周期
val nowTime = TimeUtils.getNowMills()
if (nowTime - hzLastSendTime > hzTime) {
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
}
} else {
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
}
} else {
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
}
}
}
}
/**
* 向订阅位置信息的发出定位信息
* @param tag
* @param it
* @param gnssInfo
* @param sourceType 数据来源
*/
private fun syncLocationCallback(
tag: String,
it: Map.Entry<String, IMoGoChassisLocationWGS84Listener>,
mogoLocation: MogoLocation,
sourceType: DataSourceType
) {
// 记录最后一次回调时间
M_LISTENERS_HZ_LAST_SEND_TIME[tag] = TimeUtils.getNowMills()
val listener = it.value
listener.onChassisLocationWGS84(mogoLocation)
// FileUtils.writeToFile(
// "/sdcard/Download/",
// "location_wgs84.txt",
// "${mogoLocation.longitude},${mogoLocation.latitude},${sourceType}\n"
// )
}
}

View File

@@ -11,12 +11,21 @@ import mogo.telematics.pad.MessagePad
*/
object CallerPlanningRottingListenerManager : CallerBase<IMoGoPlanningRottingListener>() {
private var globalPathResp: MessagePad.GlobalPathResp? = null
override fun doSomeAfterAddListener(tag: String, listener: IMoGoPlanningRottingListener) {
globalPathResp?.let {
listener.onAutopilotRotting(globalPathResp)
}
}
/**
* 路径规划 回调
* @param globalPathResp 自动驾驶网约车回调数据
*/
@Synchronized
fun invokeAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) {
this.globalPathResp = globalPathResp
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value

View File

@@ -11,7 +11,7 @@ import com.mogo.eagle.core.function.call.base.CallerBase
object CallerRoboBusJinlvM1StatesListenerManager : CallerBase<IMoGoRoboBusJinlvM1StatesListener>() {
/**
* 电池管理系统
* 金旅M1
*/
fun invokeRoboBusJinlvM1States(states: VehicleStateOuterClass.RoboBusJinlvM1State) {
M_LISTENERS.forEach {

View File

@@ -30,12 +30,14 @@ open class CallerBase<T : Any> {
/**
* 设置对应监听指定Hz频率
* @param tag 订阅者标记
* @param callBackHz 订阅者想要接受的回调的hz频率
*/
fun setListenerHz(tag: String, hz: Int) {
fun setListenerHz(tag: String, callBackHz: Int) {
if (M_LISTENERS_HZ.containsKey(tag)) {
return
}
M_LISTENERS_HZ[tag] = hz
M_LISTENERS_HZ[tag] = callBackHz
}
/**

View File

@@ -0,0 +1,33 @@
package com.mogo.eagle.core.function.call.biz
import androidx.annotation.MainThread
import com.mogo.eagle.core.data.map.Infrastructure
import com.mogo.eagle.core.data.v2x.V2XEvent
import com.mogo.eagle.core.function.api.v2x.IFuncBizProvider
import com.mogo.eagle.core.function.call.base.CallerBase
object CallerFuncBizListenerManager: CallerBase<IFuncBizProvider>() {
private var map: HashMap<String, java.util.ArrayList<Infrastructure>>? = null
override fun doSomeAfterAddListener(tag: String, listener: IFuncBizProvider) {
listener.onInfStructures(map)
}
@MainThread
fun invokeInfStructures(map: HashMap<String, java.util.ArrayList<Infrastructure>>) {
this.map = map
M_LISTENERS.forEach {
val listener = it.value
listener.onInfStructures(map)
}
}
@MainThread
fun invokeV2XEvents(v2xEvents: List<V2XEvent>?) {
M_LISTENERS.forEach {
val listener = it.value
listener.onV2XEvents(v2xEvents)
}
}
}

View File

@@ -28,6 +28,10 @@ object CallerDevaToolsManager {
devaToolsProviderApi?.initBiz()
}
fun checkMonitorDb(){
devaToolsProviderApi?.checkMonitorDb()
}
/**
* 开始抓取全量日志
*/
@@ -177,6 +181,22 @@ object CallerDevaToolsManager {
return devaToolsProviderApi?.getEnvConfig()
}
fun getEnvCityName():String?{
return devaToolsProviderApi?.getEnvCityName()
}
fun getEnvNetMode():String?{
return devaToolsProviderApi?.getEnvNetMode()
}
fun envConfigReset(){
devaToolsProviderApi?.envConfigReset()
}
fun envConfigChange(cityCode: String, netMode: Int){
devaToolsProviderApi?.envConfigChange(cityCode, netMode)
}
fun modifyCarInfo(callBack: (ModifyBindingcarInfo) -> Unit){
devaToolsProviderApi?.modifyCarInfo(callBack)
}
@@ -193,6 +213,10 @@ object CallerDevaToolsManager {
devaToolsProviderApi?.queryContainers(padSn, dockerVersion)
}
fun dockerVersion(dockerVersion: String?){
devaToolsProviderApi?.dockerVersion(dockerVersion)
}
fun queryAppUpgrade(){
devaToolsProviderApi?.queryAppUpgrade()
}

View File

@@ -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)
}
/**
@@ -59,106 +37,96 @@ object CallerHmiManager {
v2xType: String,
alertContent: CharSequence?,
ttsContent: String?,
tag: String?,
listenerIMoGo: IMoGoWarningStatusListener?,
playTts: Boolean,
listenerIMoGo: IMoGoWarningStatusListener? = null,
direction: WarningDirectionEnum = WarningDirectionEnum.ALERT_WARNING_NON,
expireTime: Long = 5000L,
) {
waringProviderApi?.warningV2X(
hmiProviderApi?.warningV2X(
v2xType,
alertContent,
ttsContent,
tag,
listenerIMoGo,
playTts,
direction,
expireTime
)
}
/**
* 关闭指定floatTag 的 VR下V2X预警弹窗
* @param tag 弹窗标识
*/
fun disableWarningV2X(tag: String?) {
waringProviderApi?.disableWarningV2X(tag)
}
/**
* 展示指定方位上的红框预警
* @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)
}
/**
* 呈现交通云公告弹窗(hmi)
*
* @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)
}
/**
* 呈现转向灯ui
*
* @param light
* 超视距感知关闭
*/
fun showTurnLight(light: Int) {
waringProviderApi?.showTurnLight(light)
fun showNoSignalView() {
hmiProviderApi?.showNoSignView()
}
/**
* 呈现刹车灯ui
*
* @param brakeLight
* 展示工具栏
*/
fun showBrakeLight(brakeLight: Int) {
waringProviderApi?.showBrakeLight(brakeLight)
fun showToolsView() {
hmiProviderApi?.showToolsView()
}
fun showBindingcarDialog() {
waringProviderApi?.showToBindingcarDialog()
/**
* 关闭工具栏
*/
fun hideToolsView() {
hmiProviderApi?.hideToolsView()
}
fun showModifyBindingcarDialog() {
waringProviderApi?.showModifyBindingcarDialog()
/**
* 展示绑定车辆弹框
*/
fun showBindingCarDialog() {
hmiProviderApi?.showToBindingCarDialog()
}
/**
* 展示修改绑定车辆弹框
*/
fun showModifyBindingCarDialog() {
hmiProviderApi?.showModifyBindingCarDialog()
}
/**
* 展示升级app弹框
*/
fun showUpgradeDialog(
name: String,
url: String,
@@ -166,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()
}
/**
@@ -214,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)
}
/**
@@ -226,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)
}
}

View File

@@ -1,112 +0,0 @@
package com.mogo.eagle.core.function.call.map
import androidx.annotation.RawRes
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
import com.mogo.eagle.core.data.map.CenterLine
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider
import com.zhidao.support.adas.high.AdasManager
import com.zhidao.support.adas.high.common.Constants
import com.zhidao.support.adas.high.common.MessageType
/**
* @author xiaoyuzhou
* @date 2021/9/17 6:15 下午
* 高精度地图控制
*/
object CallerHDMapManager {
private val mapProviderApi: IMoGoMapFragmentProvider
get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_MAP)
.navigation() as IMoGoMapFragmentProvider
/**
* 修改地图中心点
* MapAutoApi.CAR_CENTER_100 1/4
* MapAutoApi.CAR_CENTER_100 2/5
* MapAutoApi.CAR_CENTER_100 80米
* MapAutoApi.CAR_CENTER_100 2/5
*/
fun changeMaoViewAngle(type: Int) {
mapProviderApi.changeMaoViewAngle(type)
}
/**
* 修改高精地图自车图标
* 传入资源ID
*/
fun changeCurrentIcon(@RawRes iconId: Int) {
mapProviderApi.changeCurrentIcon(iconId)
}
/**
* 设置地图视线角度
*/
fun setMapDAngle(mode: Int) {
mapProviderApi.setMapDAngle(mode)
}
/**
* 获取车道中心线信息
*/
fun getCenterLineInfo(lon: Double, lat: Double, angle: Float): CenterLine? {
return mapProviderApi.getCenterLineInfo(lon, lat, angle)
}
/**
* 切换到自研vr
* @param isDayMode true-白天模式false-夜间模式
*/
fun stepInVrMode(isDayMode: Boolean) {
return mapProviderApi.stepInVrMode(isDayMode)
}
/**
*
* 打开点云绘制
*
* @param isDrawPointCloud 是否绘制点云
*/
fun setIsDrawPointCloud(isDrawPointCloud: Boolean) {
if (isDrawPointCloud) {
AdasManager.getInstance().subscribeInterface(
Constants.TERMINAL_ROLE.DRIVER,
Constants.SUBSCRIBE_TYPE.SUBSCRIBE,
MessageType.TYPE_RECEIVE_POINT_CLOUD)
} else {
AdasManager.getInstance().subscribeInterface(
Constants.TERMINAL_ROLE.DRIVER,
Constants.SUBSCRIBE_TYPE.UNSUBSCRIBE,
MessageType.TYPE_RECEIVE_POINT_CLOUD)
}
FunctionBuildConfig.isDrawPointCloudData = isDrawPointCloud
return mapProviderApi.setIsDrawPointCloud(isDrawPointCloud)
}
/**
* 设制点云大小
* @param pointCloudSize 点云的点大小
*/
fun setPointCloudSize(pointCloudSize: Float) {
return mapProviderApi.setPointCloudSize(pointCloudSize)
}
/**
* 设置点云颜色
*
* @param color // color:"#RRGGBB*
*/
fun setPointCloudColor(color: String) {
return mapProviderApi.setPointCloudColor(color)
}
/**
* 设置地图是否是Debug模式
* @param debugMode 是否开启Debug模式
*/
fun setDebugMode(debugMode: Boolean) {
return mapProviderApi.setDebugMode(debugMode)
}
}

View File

@@ -1,27 +0,0 @@
package com.mogo.eagle.core.function.call.map
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* 高德地图 位置改变 监听管理
* @author dongghongyu
* @date 2021/9/30 5:48 下午
*/
object CallerMapLocationListenerManager : CallerBase<Any>() {
// 记录地图最后一次位置
@Volatile
private var mLocation: MogoLocation? = null
/**
* 获取当前经纬度
*/
fun getCurrentLocation(): MogoLocation? {
return mLocation
}
fun setCurrentLocation(location: MogoLocation) {
mLocation = location
}
}

View File

@@ -2,10 +2,8 @@ package com.mogo.eagle.core.function.call.map
import android.os.Looper
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.map.MogoLatLng
import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider
import com.mogo.eagle.core.function.api.v2x.IV2XEventProvider
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
@@ -16,13 +14,9 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler
* 小地图调用者管理这里对外及其他模块提供小地图功能的调用用啥写啥不要过度设计不允许直接将Provider暴露出去
*/
object CallerSmpManager : CallerBase<Any>() {
private val mogoSmallMapProvider: IMogoSmallMapProvider
get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_SMP)
.navigation() as IMogoSmallMapProvider
private val mogoOverViewMapProvider: IMogoSmallMapProvider
get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_OVERVIEW)
.navigation() as IMogoSmallMapProvider
// private val mogoSmallMapProvider: IMogoSmallMapProvider
// get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_SMP)
// .navigation() as IMogoSmallMapProvider
private val v2xProvider: IV2XEventProvider
get() = ARouter.getInstance().build(MogoServicePaths.PATH_V2X_MODULE)
@@ -33,7 +27,7 @@ object CallerSmpManager : CallerBase<Any>() {
*/
@JvmStatic
fun drawablePolyline(coordinates: List<MogoLatLng?>?) {
mogoSmallMapProvider.drawablePolyline(coordinates)
// mogoSmallMapProvider.drawablePolyline(coordinates)
}
/**
@@ -41,7 +35,7 @@ object CallerSmpManager : CallerBase<Any>() {
*/
@JvmStatic
fun clearPolyline() {
mogoSmallMapProvider.clearPolyline()
// mogoSmallMapProvider.clearPolyline()
}
/**
@@ -49,7 +43,7 @@ object CallerSmpManager : CallerBase<Any>() {
*/
@JvmStatic
fun showPanel() {
mogoSmallMapProvider.showPanel()
// mogoSmallMapProvider.showPanel()
}
/**
@@ -57,7 +51,7 @@ object CallerSmpManager : CallerBase<Any>() {
*/
@JvmStatic
fun hidePanel() {
mogoSmallMapProvider.hidePanel()
// mogoSmallMapProvider.hidePanel()
}
@JvmStatic
@@ -65,22 +59,20 @@ object CallerSmpManager : CallerBase<Any>() {
if (Thread.currentThread() !== Looper.getMainLooper().thread) {
UiThreadHandler.post {
v2xProvider.queryWholeRoadEvents()
mogoOverViewMapProvider.startQueryV2XEvents()
}
} else {
v2xProvider.queryWholeRoadEvents()
mogoOverViewMapProvider.startQueryV2XEvents()
}
}
@JvmStatic
fun clearV2XMarkers() {
if (Thread.currentThread() !== Looper.getMainLooper().thread) {
UiThreadHandler.post {
mogoOverViewMapProvider.clearV2XMarkers()
}
} else {
mogoOverViewMapProvider.clearV2XMarkers()
}
// if (Thread.currentThread() !== Looper.getMainLooper().thread) {
// UiThreadHandler.post {
// mogoOverViewMapProvider.clearV2XMarkers()
// }
// } else {
// mogoOverViewMapProvider.clearV2XMarkers()
// }
}
}

View File

@@ -24,7 +24,6 @@ import com.zhidaoauto.map.sdk.open.tools.MapTools
import kotlinx.coroutines.*
import kotlinx.coroutines.android.asCoroutineDispatcher
import kotlinx.coroutines.internal.synchronized
import mogo.telematics.pad.MessagePad.GnssInfo
import java.util.*
import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeUnit.SECONDS
@@ -65,7 +64,7 @@ object CallerVisualAngleManager {
val displayThreshold: Long //最大展示时长 > 0; 表示最长展示多长时间, -1 表示,一直展示,直到触发默认视角, 0: 默认视角专用值,
}
private val triggerLocation = AtomicReference<GnssInfo>()
private val triggerLocation = AtomicReference<MogoLocation>()
private val distanceOfCarToStopLine = AtomicReference(0.0)
@@ -78,7 +77,7 @@ object CallerVisualAngleManager {
override fun onRoadIdInfo(roadId: String) {
this.roadId.set(roadId)
Log.d(TAG, "-- onRoadIdInfo --: prev: ${this.triggerRoadId.get()} -> curr: $roadId")
val loc = CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02()
val loc = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
var triggerClose = false
val distance = distanceOfCarToStopLine.get() + 5
if (hasCrossRoad && distance > 0) {
@@ -111,7 +110,7 @@ object CallerVisualAngleManager {
hasCrossRoad = true
triggerRoadId.set(this.roadId.get())
distanceOfCarToStopLine.set(info.distanceOfCarToStopLine)
triggerLocation.set(CallerChassisLocationGCJ20ListenerManager.getChassisLocationGCJ02())
triggerLocation.set(CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02())
changeVisualAngle(CrossRoad(true))
}
}

View File

@@ -26,7 +26,7 @@ object CallerMoGoUiSettingManager : MoGoUiSettingProvider {
CallerSkinModeListenerManager.invokeListener(FunctionBuildConfig.skinMode)
}
override fun stepOutDayMode() {
override fun stepInNightMode() {
FunctionBuildConfig.skinMode = 0
CallerSkinModeListenerManager.invokeListener(FunctionBuildConfig.skinMode)
}

View File

@@ -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

View File

@@ -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)

View File

@@ -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)
}
}

View File

@@ -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)
}
}
}

View File

@@ -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)
}
}
}