@@ -7,7 +7,7 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AdasOCHData
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.obu.ObuStatusInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotStatusListener
|
||||
@@ -108,8 +108,8 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
|
||||
}
|
||||
|
||||
override fun onAutoPilotStatusResponse(autopilotStatusInfo: AutopilotStatusInfo?) {
|
||||
tvAutopilotInfo.text = GsonUtils.toJson(autopilotStatusInfo)
|
||||
override fun onAutoPilotStatusResponse(autoPilotStatusInfo: AutoPilotStatusInfo?) {
|
||||
tvAutopilotInfo.text = GsonUtils.toJson(autoPilotStatusInfo)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@ package com.mogo.eagle.core.data.autopilot
|
||||
* 域控制器状态信息
|
||||
* 不建议自己初始化此对象,建议使用 CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
|
||||
*/
|
||||
class AutopilotStatusInfo {
|
||||
class AutoPilotStatusInfo {
|
||||
/**
|
||||
* 当前链接的IP地址, 默认地址 192.168.1.102
|
||||
*/
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.eagle.core.function.api.autopilot;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AdasOCHData;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo;
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -42,7 +42,7 @@ public interface IMoGoAutoPilotStatusListener {
|
||||
/**
|
||||
* 自动驾驶状态信息
|
||||
*
|
||||
* @param autopilotStatusInfo 状态信息
|
||||
* @param autoPilotStatusInfo 状态信息
|
||||
*/
|
||||
void onAutoPilotStatusResponse(AutopilotStatusInfo autopilotStatusInfo);
|
||||
void onAutoPilotStatusResponse(AutoPilotStatusInfo autoPilotStatusInfo);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.data.autopilot.AdasOCHData
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
@@ -18,7 +18,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
private val TAG = "CallerAutopilotListenerManager"
|
||||
|
||||
// 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
|
||||
private var mAutopilotStatusInfo: AutopilotStatusInfo = AutopilotStatusInfo()
|
||||
private var mAutoPilotStatusInfo: AutoPilotStatusInfo = AutoPilotStatusInfo()
|
||||
|
||||
// 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步
|
||||
private val mAutoPilotStatusListeners: HashMap<String, IMoGoAutoPilotStatusListener> = HashMap()
|
||||
@@ -26,15 +26,15 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
/**
|
||||
* 查询AutoPilot状态
|
||||
*/
|
||||
fun getAutoPilotStatusInfo(): AutopilotStatusInfo {
|
||||
return mAutopilotStatusInfo
|
||||
fun getAutoPilotStatusInfo(): AutoPilotStatusInfo {
|
||||
return mAutoPilotStatusInfo
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询AutoPilot状态
|
||||
*/
|
||||
fun getAutoPilotStatusInfoJsonString(): String {
|
||||
return GsonUtils.toJson(mAutopilotStatusInfo)
|
||||
return GsonUtils.toJson(mAutoPilotStatusInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
@Nullable listener: IMoGoAutoPilotStatusListener
|
||||
) {
|
||||
mAutoPilotStatusListeners[tag] = listener
|
||||
listener.onAutoPilotStatusResponse(mAutopilotStatusInfo)
|
||||
listener.onAutoPilotStatusResponse(mAutoPilotStatusInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,23 +75,23 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutoPilotStatusListener() {
|
||||
LogUtils.dTag(TAG, "$mAutopilotStatusInfo")
|
||||
invokeAutoPilotStatusListener(mAutopilotStatusInfo)
|
||||
LogUtils.dTag(TAG, "$mAutoPilotStatusInfo")
|
||||
invokeAutoPilotStatusListener(mAutoPilotStatusInfo)
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶状态信息回调
|
||||
* @param autopilotStatusInfo 自动驾驶状态信息
|
||||
* @param autoPilotStatusInfo 自动驾驶状态信息
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutoPilotStatusListener(autopilotStatusInfo: AutopilotStatusInfo) {
|
||||
LogUtils.dTag(TAG, "$autopilotStatusInfo")
|
||||
mAutopilotStatusInfo = autopilotStatusInfo
|
||||
fun invokeAutoPilotStatusListener(autoPilotStatusInfo: AutoPilotStatusInfo) {
|
||||
LogUtils.dTag(TAG, "$autoPilotStatusInfo")
|
||||
mAutoPilotStatusInfo = autoPilotStatusInfo
|
||||
mAutoPilotStatusListeners.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutoPilotStatusResponse(mAutopilotStatusInfo)
|
||||
listener.onAutoPilotStatusResponse(mAutoPilotStatusInfo)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.module.adas;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.module.adas.model.AdasServiceModel;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -184,7 +184,7 @@ public class AdasEventManager implements OnAdasListener, OnAdasMsgConnectStatusL
|
||||
AutopilotStatus.ValuesBean autopilotStatusValues = autopilotStatus.getValues();
|
||||
if (autopilotStatusValues != null) {
|
||||
// 初始化自动驾驶状态信息
|
||||
AutopilotStatusInfo autopilotStatusInfo = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
|
||||
AutoPilotStatusInfo autopilotStatusInfo = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
|
||||
autopilotStatusInfo.setAutopilotStatus(autopilotStatusValues.getState());
|
||||
autopilotStatusInfo.setAutoDriveStatus(autopilotStatusValues.getPilotmode());
|
||||
autopilotStatusInfo.setErrorReason(autopilotStatusValues.getReason());
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.mogo.module.common.datacenter;
|
||||
|
||||
import com.mogo.commons.FunctionBuildConfig;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutoPilotStatusInfo;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.cloud.location.CloudLocationInfo;
|
||||
@@ -94,7 +94,7 @@ public class SnapshotLocationDataCenter {
|
||||
// 使用与渠道配置一样的gps提供者提供的数据
|
||||
if (gpsProvider == FunctionBuildConfig.gpsProvider) {
|
||||
//测试面板状态同步
|
||||
AutopilotStatusInfo autopilotStatusInfo = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
|
||||
AutoPilotStatusInfo autopilotStatusInfo = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
|
||||
autopilotStatusInfo.setLocationLat(lat);
|
||||
autopilotStatusInfo.setLocationLon(lon);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatusListener();
|
||||
|
||||
Reference in New Issue
Block a user