Merge branch 'dev_arch_opt_3.0' into 'dev_robobus-m1-p-app-module_1.1.0_230112_1.1.0'

Dev arch opt 3.0

See merge request zhjt/AndroidApp/MoGoEagleEye!665
This commit is contained in:
wangmingjun
2023-03-13 07:27:11 +00:00
4 changed files with 28 additions and 4 deletions

View File

@@ -44,7 +44,7 @@ public class MogoRouteOverlayManager implements
public void init() {
CallerPlanningTrajectoryListenerManager.INSTANCE.addListener(TAG, this);
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 20,this);
}
public static MogoRouteOverlayManager getInstance() {

View File

@@ -32,7 +32,7 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
initMapView()
CallerSkinModeListenerManager.addListener(TAG, this)
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
CallerChassisLocationWGS84ListenerManager.addListener(TAG, 20,this)
CallerChassisLamplightListenerManager.addListener(TAG, this)
}

View File

@@ -74,7 +74,19 @@ object CallerChassisLocationGCJ02ListenerManager : CallerBase<IMoGoChassisLocati
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
}
} else {
syncLocationCallback(tag, it, mGnssInfo!!, sourceType)
//Logger.d(TAG, "没设置监听频率使用默认5HZ")
val hzTime = (1.0 / 5) * 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)
}
}
}
}

View File

@@ -59,7 +59,19 @@ object CallerChassisLocationWGS84ListenerManager : CallerBase<IMoGoChassisLocati
syncLocationCallback(tag, it, mGnssInfo, sourceType)
}
} else {
syncLocationCallback(tag, it, mGnssInfo, sourceType)
//Logger.d(TAG, "没设置监听频率使用默认5HZ")
val hzTime = (1.0 / 5) * 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)
}
}
}
}