@@ -43,20 +43,23 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
var mContext: Context
|
||||
var mSpeedChartView: SpeedChartView
|
||||
var mDebugSettingViewFloat: WarningFloat.Builder? = null
|
||||
var mDebugSettingView: DebugSettingView? = null
|
||||
|
||||
init {
|
||||
setOnLongClickListener {
|
||||
Log.d(TAG, "长按显示状态工具栏")
|
||||
context.let {
|
||||
val debugSettingView = DebugSettingView(it)
|
||||
|
||||
if (mDebugSettingViewFloat != null) {
|
||||
WarningFloat.dismiss(mDebugSettingViewFloat!!.config.floatTag, false)
|
||||
mDebugSettingViewFloat = null
|
||||
mDebugSettingView = null
|
||||
} else {
|
||||
if (mDebugSettingView == null) {
|
||||
mDebugSettingView = DebugSettingView(it)
|
||||
}
|
||||
mDebugSettingViewFloat = WarningFloat.with(it)
|
||||
.setTag("DebugSettingView")
|
||||
.setLayout(debugSettingView)
|
||||
.setLayout(mDebugSettingView!!)
|
||||
.setSidePattern(SidePattern.RIGHT)
|
||||
.setGravity(Gravity.RIGHT, offsetY = 70)
|
||||
.setImmersionStatusBar(true)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="@dimen/dp_1300"
|
||||
android:layout_width="@dimen/dp_900"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFFFFF">
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
android:id="@+id/rgGpsProvider"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="vertical">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbGpsProviderAndroid"
|
||||
@@ -67,7 +67,7 @@
|
||||
android:id="@+id/rgIsDrawIdentifyData"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="vertical">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/rbDraw"
|
||||
|
||||
@@ -4,12 +4,6 @@ import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
|
||||
//import com.amap.api.maps.LocationSource;
|
||||
//import com.amap.api.maps.model.Polyline;
|
||||
//import com.amap.api.navi.AMapNavi;
|
||||
//import com.amap.api.navi.enums.AimLessMode;
|
||||
//import com.amap.api.navi.enums.NaviType;
|
||||
//import com.amap.api.navi.model.NaviLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.impl.custom.AMapWrapper;
|
||||
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
|
||||
@@ -20,7 +14,6 @@ import com.mogo.map.navi.MogoNaviConfig;
|
||||
import com.mogo.map.navi.OnCalculatePathItemClickInteraction;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
import com.zhidaoauto.map.sdk.open.poyline.Polyline;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoViewHelper;
|
||||
|
||||
import java.util.List;
|
||||
@@ -42,10 +35,6 @@ public class NaviClient implements IMogoNavi {
|
||||
private final Context mContext;
|
||||
|
||||
private MapAutoViewHelper mAMapNavi;
|
||||
// private final NaviListenerAdapter mAMapNaviListener;
|
||||
|
||||
|
||||
// private final AimlessModeListenerAdapter mAimlessModeListener;
|
||||
|
||||
/**
|
||||
* 导航策略配置
|
||||
@@ -67,26 +56,18 @@ public class NaviClient implements IMogoNavi {
|
||||
*/
|
||||
private boolean mAimlessStatus;
|
||||
|
||||
private NaviClient( Context context ) {
|
||||
private NaviClient(Context context) {
|
||||
mCarLocation.setLongitude(116.97000);
|
||||
mCarLocation.setLatitude(39.97000);
|
||||
mContext = context;
|
||||
mAMapNavi = AMapWrapper.getAMap();
|
||||
// mAMapNavi.setEmulatorNaviSpeed( 120 );
|
||||
// mAMapNavi.setUseInnerVoice( false, true );
|
||||
// mAMapNaviListener = new NaviListenerAdapter( context, mAMapNavi, this );
|
||||
// mAimlessModeListener = new AimlessModeListenerAdapter() {
|
||||
// };
|
||||
// mAMapNavi.addAMapNaviListener( mAMapNaviListener );
|
||||
// mAMapNavi.addAimlessModeListener( mAimlessModeListener );
|
||||
// mAimlessModeStatus = SharedPrefsMgr.getInstance( mContext ).getBoolean( KEY_AIMLESS_STATUS, false );
|
||||
}
|
||||
|
||||
public static NaviClient getInstance( Context context ) {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( NaviClient.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new NaviClient( context );
|
||||
public static NaviClient getInstance(Context context) {
|
||||
if (sInstance == null) {
|
||||
synchronized (NaviClient.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new NaviClient(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,134 +79,83 @@ public class NaviClient implements IMogoNavi {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint ) {
|
||||
naviTo( endPoint, mMogoNaviConfig );
|
||||
public void naviTo(MogoLatLng endPoint) {
|
||||
naviTo(endPoint, mMogoNaviConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, MogoNaviConfig config ) {
|
||||
naviTo( endPoint, null, config );
|
||||
public void naviTo(MogoLatLng endPoint, MogoNaviConfig config) {
|
||||
naviTo(endPoint, null, config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints ) {
|
||||
naviTo( endPoint, wayPoints, mMogoNaviConfig );
|
||||
public void naviTo(MogoLatLng endPoint, List<MogoLatLng> wayPoints) {
|
||||
naviTo(endPoint, wayPoints, mMogoNaviConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void naviTo( MogoLatLng endPoint, List< MogoLatLng > wayPoints, MogoNaviConfig config ) {
|
||||
if ( !checkAMapNavi() ) {
|
||||
public void naviTo(MogoLatLng endPoint, List<MogoLatLng> wayPoints, MogoNaviConfig config) {
|
||||
if (!checkAMapNavi()) {
|
||||
return;
|
||||
}
|
||||
Logger.i( TAG, "开始规划路径" );
|
||||
Logger.i(TAG, "开始规划路径");
|
||||
mMogoNaviConfig = config;
|
||||
if ( mMogoNaviConfig == null ) {
|
||||
if (mMogoNaviConfig == null) {
|
||||
mMogoNaviConfig = new MogoNaviConfig();
|
||||
}
|
||||
// int strategy = mAMapNavi.strategyConvert( mMogoNaviConfig.isCongestion(), mMogoNaviConfig.isAvoidSpeed(), mMogoNaviConfig.isCost(), mMogoNaviConfig.isHighSpeed(), config.isMultipleRoute() );
|
||||
// List< NaviLatLng > naviWayPoints = null;
|
||||
// if ( wayPoints != null && !wayPoints.isEmpty() ) {
|
||||
// naviWayPoints = new ArrayList<>( wayPoints.size() );
|
||||
// for ( MogoLatLng wayPoint : wayPoints ) {
|
||||
// naviWayPoints.add( ObjectUtils.fromMogoAsNavi( wayPoint ) );
|
||||
// }
|
||||
// } else {
|
||||
// naviWayPoints = new ArrayList<>();
|
||||
// }
|
||||
// mAMapNavi.calculateDriveRoute(
|
||||
// new ArrayList( Arrays.asList( ObjectUtils.fromMogoAsNavi( endPoint ) ) ),
|
||||
// naviWayPoints,
|
||||
// strategy
|
||||
// );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reCalculateRoute( MogoNaviConfig config ) {
|
||||
if ( !checkAMapNavi() ) {
|
||||
public void reCalculateRoute(MogoNaviConfig config) {
|
||||
if (!checkAMapNavi()) {
|
||||
return;
|
||||
}
|
||||
mMogoNaviConfig = config;
|
||||
if ( mMogoNaviConfig == null ) {
|
||||
if (mMogoNaviConfig == null) {
|
||||
mMogoNaviConfig = new MogoNaviConfig();
|
||||
}
|
||||
// int strategy = mAMapNavi.strategyConvert( mMogoNaviConfig.isCongestion(), mMogoNaviConfig.isAvoidSpeed(), mMogoNaviConfig.isCost(), mMogoNaviConfig.isHighSpeed(), config.isMultipleRoute() );
|
||||
// mAMapNavi.reCalculateRoute( strategy );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopNavi() {
|
||||
// if ( mAMapNaviListener != null ) {
|
||||
// mAMapNaviListener.stopNavi();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void startNavi( boolean isRealNavi ) {
|
||||
// if ( mAMapNaviListener.isStopped() ) {
|
||||
// return;
|
||||
// }
|
||||
// mIsRealNavi = isRealNavi;
|
||||
// stopAimlessMode();
|
||||
// boolean isNaving = isNaviing();
|
||||
// boolean result = mAMapNavi.startNavi( isRealNavi ? NaviType.GPS : NaviType.EMULATOR );
|
||||
// if ( isNaving && !result ) {
|
||||
// // 如果正在导航,又重新规划路线,startNavi 不会成功,不会重新回调 #onStartNavi
|
||||
// MogoNaviListenerHandler.getInstance().onStartNavi();
|
||||
// AMapMessageManager.getInstance().postNaviStarted();
|
||||
// }
|
||||
// Logger.d( TAG, "start navi status: %s", result );
|
||||
public void startNavi(boolean isRealNavi) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNaviing() {
|
||||
// if ( mAMapNaviListener != null ) {
|
||||
// return mAMapNaviListener.isNaviing();
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoCalculatePath > getCalculatedStrategies() {
|
||||
// if ( mAMapNaviListener != null ) {
|
||||
// return mAMapNaviListener.getCalculateStrategies();
|
||||
// }
|
||||
public List<MogoCalculatePath> getCalculatedStrategies() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoLatLng > getCalculatedPathPos() {
|
||||
// if ( mAMapNaviListener != null ) {
|
||||
// return mAMapNaviListener.getCalculatedPathPos();
|
||||
// }
|
||||
public List<MogoLatLng> getCalculatedPathPos() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OnCalculatePathItemClickInteraction getItemClickInteraction() {
|
||||
// if ( mAMapNaviListener != null ) {
|
||||
// return mAMapNaviListener.getItemClickInteraction();
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineClickInteraction( OnCalculatePathItemClickInteraction lineClickInteraction ) {
|
||||
// do not impl.
|
||||
public void setLineClickInteraction(OnCalculatePathItemClickInteraction lineClickInteraction) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearCalculatePaths() {
|
||||
// if ( mAMapNaviListener != null ) {
|
||||
// mAMapNaviListener.clearCalculatePaths();
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCalculatePathDisplayBounds( Rect bounds ) {
|
||||
// if ( mAMapNaviListener != null ) {
|
||||
// mAMapNaviListener.setCalculatePathDisplayBounds( bounds );
|
||||
// }
|
||||
public void setCalculatePathDisplayBounds(Rect bounds) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -234,20 +164,20 @@ public class NaviClient implements IMogoNavi {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBroadcastMode( int mode ) {
|
||||
return false;//mAMapNavi.setBroadcastMode( mode );
|
||||
public boolean setBroadcastMode(int mode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List< MogoLatLng > getNaviPathCoordinates() {
|
||||
public List<MogoLatLng> getNaviPathCoordinates() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCarLocation() {
|
||||
if ( mCarLocation != null ) {
|
||||
synchronized ( mCarLocation ) {
|
||||
return new MogoLatLng( mCarLocation.getLatitude(), mCarLocation.getLongitude() );
|
||||
if (mCarLocation != null) {
|
||||
synchronized (mCarLocation) {
|
||||
return new MogoLatLng(mCarLocation.getLatitude(), mCarLocation.getLongitude());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -259,100 +189,76 @@ public class NaviClient implements IMogoNavi {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCarLocationChangedListener( IMogoCarLocationChangedListener2 listener ) {
|
||||
public void registerCarLocationChangedListener(IMogoCarLocationChangedListener2 listener) {
|
||||
// do not impl.
|
||||
}
|
||||
|
||||
// -- end
|
||||
|
||||
public void syncCarLocation( Location location ) {
|
||||
public void syncCarLocation(Location location) {
|
||||
mCarLocation = location;
|
||||
if ( MogoCarLocationChangedListenerRegister.getInstance().getListener() != null ) {
|
||||
MogoCarLocationChangedListenerRegister.getInstance().getListener().onCarLocationChanged2( location );
|
||||
if (MogoCarLocationChangedListenerRegister.getInstance().getListener() != null) {
|
||||
MogoCarLocationChangedListenerRegister.getInstance().getListener().onCarLocationChanged2(location);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkAMapNavi() {
|
||||
mAMapNavi = AMapWrapper.getAMap();
|
||||
if ( mAMapNavi == null ) {
|
||||
Logger.e( TAG, "自研导航实例为空!!!" );
|
||||
if (mAMapNavi == null) {
|
||||
Logger.e(TAG, "自研导航实例为空!!!");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isRealNavi() {
|
||||
return mIsRealNavi;
|
||||
}
|
||||
|
||||
public void handleClickedPolyline( Polyline polyline ) {
|
||||
// if ( mAMapNaviListener != null ) {
|
||||
// mAMapNaviListener.handleClickedPolyline( polyline );
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startAimlessMode() {
|
||||
// if ( mAimlessModeStatus && !isNaviing() ) {
|
||||
// mAMapNavi.startAimlessMode( AimLessMode.CAMERA_AND_SPECIALROAD_DETECTED );
|
||||
// mAimlessStatus = true;
|
||||
// Logger.d( TAG, "开启巡航成功" );
|
||||
// } else {
|
||||
// mAimlessStatus = false;
|
||||
// Logger.d( TAG, "开启巡航失败" );
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAimlessMode() {
|
||||
// mAMapNavi.stopAimlessMode();
|
||||
// mAimlessStatus = false;
|
||||
// Logger.d( TAG, "关闭巡航成功" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAimlessModeStatus( boolean open ) {
|
||||
public void setAimlessModeStatus(boolean open) {
|
||||
this.mAimlessModeStatus = open;
|
||||
SharedPrefsMgr.getInstance( mContext ).putBoolean( KEY_AIMLESS_STATUS, open );
|
||||
if ( open ) {
|
||||
if ( !mAimlessStatus ) {
|
||||
SharedPrefsMgr.getInstance(mContext).putBoolean(KEY_AIMLESS_STATUS, open);
|
||||
if (open) {
|
||||
if (!mAimlessStatus) {
|
||||
startAimlessMode();
|
||||
}
|
||||
} else {
|
||||
if ( mAimlessStatus ) {
|
||||
if (mAimlessStatus) {
|
||||
stopAimlessMode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview( Rect bounds ) {
|
||||
// if ( mAMapNaviListener != null ) {
|
||||
// mAMapNaviListener.displayOverview( bounds );
|
||||
// }
|
||||
public void displayOverview(Rect bounds) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUseExtraGPSData( boolean use ) {
|
||||
Logger.d( TAG, "设置外部gps源状态 %s", use );
|
||||
mAMapNavi.setIsUseExtraGPSData( use );
|
||||
AMapWrapper.getAMap().setMyLocationEnabled( true );
|
||||
public void setUseExtraGPSData(boolean use) {
|
||||
Logger.d(TAG, "设置外部gps源状态 %s", use);
|
||||
mAMapNavi.setIsUseExtraGPSData(use);
|
||||
AMapWrapper.getAMap().setMyLocationEnabled(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData( double lon, double lat, float speed, float accuracy, float bearing, long timestamp ) {
|
||||
if ( !mAMapNavi.getIsUseExtraGPSData() ) {
|
||||
Logger.d( TAG, "拒绝外部GPS数据" );
|
||||
public void setExtraGPSData(double lon, double lat, float speed, float accuracy, float bearing, long timestamp) {
|
||||
if (!mAMapNavi.getIsUseExtraGPSData()) {
|
||||
Logger.d(TAG, "拒绝外部GPS数据");
|
||||
return;
|
||||
}
|
||||
Location location = new Location( "外部GPS源" );
|
||||
location.setLongitude( lon );
|
||||
location.setLatitude( lat );
|
||||
location.setSpeed( speed );
|
||||
location.setAccuracy( accuracy );
|
||||
location.setBearing( bearing );
|
||||
location.setTime( timestamp );
|
||||
Location location = new Location("外部GPS源");
|
||||
location.setLongitude(lon);
|
||||
location.setLatitude(lat);
|
||||
location.setSpeed(speed);
|
||||
location.setAccuracy(accuracy);
|
||||
location.setBearing(bearing);
|
||||
location.setTime(timestamp);
|
||||
//type字段传1时代表WGS84坐标
|
||||
mAMapNavi.setExtraGPSData( 2, location );
|
||||
mAMapNavi.setExtraGPSData(2, location);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,6 +205,8 @@ public class AdasEventManager implements
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//can数据转发
|
||||
AutopilotCarStateInfo.ValuesBean bean = autoPilotCarStateInfo.getValues();
|
||||
if (bean != null) {
|
||||
@@ -233,12 +235,10 @@ public class AdasEventManager implements
|
||||
|
||||
@Override
|
||||
public void onAutopilotIdentifyDataUpdate(@Nullable List<TrafficData> trafficData) {
|
||||
// 仅在 vr 模式下显示 adas 识别车辆
|
||||
if (trafficData == null) {
|
||||
Logger.w(TAG, "--->action is null");
|
||||
IdentifyDataDrawer.getInstance().clearOldMarker();
|
||||
} else {
|
||||
try {
|
||||
try {
|
||||
if (trafficData == null) {
|
||||
IdentifyDataDrawer.getInstance().clearOldMarker();
|
||||
} else {
|
||||
if (FunctionBuildConfig.isDrawIdentifyData) {
|
||||
ThreadUtils.getSinglePool().execute(() ->
|
||||
IdentifyDataDrawer.getInstance().renderAdasRecognizedResult(trafficData)
|
||||
@@ -246,9 +246,10 @@ public class AdasEventManager implements
|
||||
} else {
|
||||
IdentifyDataDrawer.getInstance().clearOldMarker();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
IdentifyDataDrawer.getInstance().clearOldMarker();
|
||||
}
|
||||
try {
|
||||
for (IAdasDataListener listener : iAdasEventListeners) {
|
||||
|
||||
@@ -67,13 +67,13 @@ public class IdentifyDataDrawer extends BaseDrawer {
|
||||
final long start = System.nanoTime();
|
||||
if (resultList == null || resultList.isEmpty() || !DebugConfig.isUseAdasRecognize()) {
|
||||
clearOldMarker();
|
||||
Log.w(TAG, "ADAS数据延时绘制 resultList==>" + resultList + " DebugConfig.isUseAdasRecognize()==>" + DebugConfig.isUseAdasRecognize());
|
||||
Log.w(TAG, "渲染 adas 识别的数据 resultList==>" + resultList + " DebugConfig.isUseAdasRecognize()==>" + DebugConfig.isUseAdasRecognize());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
clearOldMarker();
|
||||
Log.w(TAG, "ADAS数据延时绘制 当前不是VR模式");
|
||||
Log.w(TAG, "渲染 adas 识别的数据 当前不是VR模式");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.mogo.service.impl.adas;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
@@ -33,7 +31,6 @@ import com.mogo.service.adas.IMogoAdasWarnMessageCallback;
|
||||
import com.mogo.service.impl.singleton.SingletonsHolder;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.zhidao.adasconfig.api.AdasConfigApiController;
|
||||
@@ -109,38 +106,6 @@ public class MogoADASController implements IMogoADASController {
|
||||
|
||||
private final List<IMogoAdasOCHCallback> mAdasOCHCallback = new CopyOnWriteArrayList<>();
|
||||
|
||||
/**
|
||||
* 接收 adas 定位数据线程
|
||||
*/
|
||||
private final Handler mAdasLocationRecHandler = new Handler(WorkThreadHandler.newInstance("AdasLocationRecThread").getLooper()) {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
AutopilotCarStateInfo stateInfo = GsonUtil.objectFromJson(((String) msg.obj), AutopilotCarStateInfo.class);
|
||||
if (stateInfo == null || stateInfo.getValues() == null) {
|
||||
// Logger.d(TAG, "ADAS-LOC-timer", "upd 到 aidl 传输数据 stateInfo or stateInfo.getValues() is null");
|
||||
return;
|
||||
}
|
||||
// if (stateInfo.getValues().getStartReceiverDataTime() != null) {
|
||||
// Logger.d("ADAS-LOC-timer", "upd 到 aidl 传输耗时:%s", start - Long.valueOf(stateInfo.getValues().getStartReceiverDataTime()));
|
||||
// } else {
|
||||
// Logger.d("ADAS-LOC-timer", "upd 到 aidl 传输耗时时间字段 startReceiverDataTime is null");
|
||||
// }
|
||||
|
||||
mLastLon = stateInfo.getValues().getLon();
|
||||
mLastLat = stateInfo.getValues().getLat();
|
||||
mSpeed = stateInfo.getValues().getGnss_speed();
|
||||
satelliteTime = stateInfo.getValues().getSatelliteTime();
|
||||
if (mMogoAdasCarDataCallback != null) {
|
||||
mMogoAdasCarDataCallback.onAdasCarDataCallback(stateInfo);
|
||||
}
|
||||
// Logger.i("ADAS-LOC-timer", "cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@Override
|
||||
public void openADAS() {
|
||||
showADAS();
|
||||
@@ -155,7 +120,6 @@ public class MogoADASController implements IMogoADASController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void showADAS() {
|
||||
Logger.d(TAG, "showADAS()");
|
||||
@@ -246,15 +210,23 @@ public class MogoADASController implements IMogoADASController {
|
||||
|
||||
@Override
|
||||
public void ownerCarStateInfo(String ownerCarStateInfo) {
|
||||
Message message = mAdasLocationRecHandler.obtainMessage();
|
||||
message.obj = ownerCarStateInfo;
|
||||
message.sendToTarget();
|
||||
// 接收 adas 定位数据线程
|
||||
AutopilotCarStateInfo stateInfo = GsonUtil.objectFromJson(ownerCarStateInfo, AutopilotCarStateInfo.class);
|
||||
if (stateInfo == null || stateInfo.getValues() == null) {
|
||||
return;
|
||||
}
|
||||
mLastLon = stateInfo.getValues().getLon();
|
||||
mLastLat = stateInfo.getValues().getLat();
|
||||
mSpeed = stateInfo.getValues().getGnss_speed();
|
||||
satelliteTime = stateInfo.getValues().getSatelliteTime();
|
||||
if (mMogoAdasCarDataCallback != null) {
|
||||
mMogoAdasCarDataCallback.onAdasCarDataCallback(stateInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyAutopilotState(AutopilotStatusInfo autopilotStatus) {
|
||||
DebugConfig.setAutoPilotStatus(autopilotStatus.getState() + "");
|
||||
|
||||
if (!mAdasOCHCallback.isEmpty()) {
|
||||
for (IMogoAdasOCHCallback cb : mAdasOCHCallback) {
|
||||
cb.onStateChanged(autopilotStatus.getState(), autopilotStatus.getReason());
|
||||
|
||||
Reference in New Issue
Block a user