[dev_arch_opt_3.0]

[Change]
[
1、增加控制定位HZ的回调用
]

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2023-02-01 18:35:39 +08:00
parent 2df96d3dac
commit 4e9ca58409
14 changed files with 147 additions and 21 deletions

View File

@@ -23,7 +23,7 @@ object CallerChassisLocationWGS84ListenerManager : CallerBase<IMoGoChassisLocati
* @param gnssInfo
*/
@Synchronized
fun invokeChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo?) {
fun invokeChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
this.gnssInfo = gnssInfo
M_LISTENERS.forEach {
val tag = it.key

View File

@@ -12,9 +12,32 @@ import java.util.concurrent.ConcurrentHashMap
*/
open class CallerBase<T : Any> {
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
/**
* 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
*/
protected val M_LISTENERS: ConcurrentHashMap<String, T> = ConcurrentHashMap()
/**
* 存储所有注册了监听的对象,并设定监听频率invokeXXXX进行遍历回调将信息同步,
*/
protected val M_LISTENERS_HZ: ConcurrentHashMap<String, Int> = ConcurrentHashMap()
/**
* HZ发送记录最后一次发送时间
*/
protected val M_LISTENERS_HZ_LAST_SEND_TIME: ConcurrentHashMap<String, Long> =
ConcurrentHashMap()
/**
* 设置对应监听指定Hz频率
*/
fun setListenerHz(tag: String, hz: Int) {
if (M_LISTENERS_HZ.containsKey(tag)) {
return
}
M_LISTENERS_HZ[tag] = hz
}
/**
* 添加 监听
* @param tag 标记,用来注销监听使用