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

# Conflicts:
#	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/view/SweeperTrafficDataView.java
This commit is contained in:
donghongyu
2023-02-17 14:23:49 +08:00
43 changed files with 585 additions and 211 deletions

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.call.autopilot
import android.util.Log
import chassis.Chassis
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.call.base.CallerBase
@@ -17,24 +18,24 @@ object CallerChassisLamplightListenerManager : CallerBase<IMoGoChassisLamplightL
* @param lightSwitch
*/
fun invokeAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch) {
val switch = getTurnLightState(lightSwitch)
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotLightSwitchData(getTurnLightState(lightSwitch))
listener.onAutopilotLightSwitchData(switch)
}
}
private fun getTurnLightState(turn_light: Chassis.LightSwitch): Chassis.LightSwitch? {
if (turn_light == Chassis.LightSwitch.LIGHT_NONE) {
return if (isOnTurnLight) {
if (turn_light.number == Chassis.LightSwitch.LIGHT_NONE.number) {
if (isOnTurnLight) {
if (turnLightTimes >= 10) {
isOnTurnLight = false
return turn_light
} else {
turnLightTimes++
null
}
turnLightTimes++
return null
} else {
null
return null
}
} else {
turnLightTimes = 0

View File

@@ -14,9 +14,9 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils
object CallerChassisLocationWGS84ListenerManager : CallerBase<IMoGoChassisLocationWGS84Listener>() {
@Volatile
private var mGnssInfo: MogoLocation? = null
private var mGnssInfo: MogoLocation = MogoLocation()
fun getChassisLocationWGS84(): MogoLocation? {
fun getChassisLocationWGS84(): MogoLocation {
return mGnssInfo
}
@@ -40,27 +40,26 @@ object CallerChassisLocationWGS84ListenerManager : CallerBase<IMoGoChassisLocati
@Synchronized
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)
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)
syncLocationCallback(tag, it, mGnssInfo, sourceType)
}
} else {
syncLocationCallback(tag, it, mGnssInfo, sourceType)
}
}
}

View File

@@ -154,6 +154,13 @@ object CallerDevaToolsManager {
devaToolsProviderApi?.updateUpgradeProgress()
}
/**
* obu下载状态
*/
fun updateObuUpgradeStatus() {
devaToolsProviderApi?.updateObuUpgradeStatus()
}
/**
* 展示状态栏
*/

View File

@@ -14,6 +14,9 @@ object CallerVisualAngleManager {
.navigation() as? IMoGoVisualAngleChangeProvider
}
@Volatile
private var isVisualAngleChanged = false
fun changeAngle(scene: Scene) {
provider?.changeAngle(scene)
}
@@ -21,4 +24,18 @@ object CallerVisualAngleManager {
fun updateLongSightLevel(level: Boolean) {
provider?.updateLongSightLevel(level)
}
fun showTurning(open: Boolean) {
if (open) {
if (!isVisualAngleChanged) {
isVisualAngleChanged = true
changeAngle(Turning(true))
}
} else {
if (isVisualAngleChanged) {
isVisualAngleChanged = false
changeAngle(Turning(false))
}
}
}
}

View File

@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.call.obu
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.call.base.CallerBase
import mogo.telematics.pad.MessagePad
/**
* OBU 监听管理
@@ -19,6 +20,13 @@ object CallerObuWarningListenerManager : CallerBase<IMoGoObuStatusListener>() {
}
}
fun invokeTrackerFusionData(trackObject: MessagePad.TrackedObject?){
M_LISTENERS.forEach {
val listener = it.value
listener.updateTrackerFusionData(trackObject)
}
}
fun invokeTrackerWarningInfo(trafficData: TrafficData) {
M_LISTENERS.forEach {
val listener = it.value