merge
This commit is contained in:
@@ -2,9 +2,6 @@ package com.mogo.module.common.drawer;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
@@ -14,7 +11,7 @@ import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.R;
|
||||
import com.mogo.module.common.constants.DataTypes;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedListResult;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedResult;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -39,7 +36,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
}
|
||||
|
||||
private Map< String, ADASRecognizedListResult > mLastPositions = new ConcurrentHashMap<>();
|
||||
private Map< String, ADASRecognizedResult > mLastPositions = new ConcurrentHashMap<>();
|
||||
|
||||
public static AdasRecognizedResultDrawer getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
@@ -68,13 +65,13 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
return mAdasRecognizedMarkersCaches.containsKey( uniqueKey );
|
||||
}
|
||||
|
||||
public void renderAdasRecognizedResult( List< ADASRecognizedListResult > resultList, boolean machineVision, double curSpeed ) {
|
||||
public void renderAdasRecognizedResult( List< ADASRecognizedResult > resultList, boolean machineVision, double curSpeed ) {
|
||||
if ( resultList == null || resultList.isEmpty() ) {
|
||||
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( mContext ).removeMarkers( DataTypes.TYPE_MARKER_ADAS );
|
||||
return;
|
||||
}
|
||||
purgeAdasRecognizedData( resultList );
|
||||
for ( ADASRecognizedListResult recognizedListResult : resultList ) {
|
||||
for ( ADASRecognizedResult recognizedListResult : resultList ) {
|
||||
if ( recognizedListResult == null ) {
|
||||
continue;
|
||||
}
|
||||
@@ -100,7 +97,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
mAdasRecognizedMarkersCaches.put( uniqueKey, marker );
|
||||
mLastPositions.put( uniqueKey, recognizedListResult );
|
||||
} else {
|
||||
ADASRecognizedListResult lastPosition = mLastPositions.get( uniqueKey );
|
||||
ADASRecognizedResult lastPosition = mLastPositions.get( uniqueKey );
|
||||
mLastPositions.put( uniqueKey, recognizedListResult );
|
||||
if ( lastPosition != null ) {
|
||||
List< MogoLatLng > points = new ArrayList<>();
|
||||
@@ -108,6 +105,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
points.add( new MogoLatLng( lastPosition.lat, lastPosition.lon ) );
|
||||
points.add( endLatLon );
|
||||
if ( DebugConfig.isNotSmooth() ) {
|
||||
marker.setRotateAngle( ( ( float ) recognizedListResult.heading ) );
|
||||
marker.setPosition( recognizedListResult.lat, recognizedListResult.lon );
|
||||
} else {
|
||||
long interval = recognizedListResult.systemTime - lastPosition.systemTime;
|
||||
@@ -117,13 +115,10 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
interval -= 25;
|
||||
marker.startSmoothInMs( points, interval );
|
||||
}
|
||||
} else {
|
||||
marker.setRotateAngle( ( ( float ) recognizedListResult.heading ) );
|
||||
marker.setPosition( recognizedListResult.lat, recognizedListResult.lon );
|
||||
} else {
|
||||
marker.setPosition( recognizedListResult.lat, recognizedListResult.lon );
|
||||
}
|
||||
// marker.setRotateAngle( ( ( float ) recognizedListResult.heading ) );
|
||||
// marker.setPosition( recognizedListResult.lat, recognizedListResult.lon );
|
||||
}
|
||||
showSelfSpeed( mContext,
|
||||
marker,
|
||||
@@ -138,7 +133,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
*
|
||||
* @param resultList
|
||||
*/
|
||||
private void purgeAdasRecognizedData( List< ADASRecognizedListResult > resultList ) {
|
||||
private void purgeAdasRecognizedData( List< ADASRecognizedResult > resultList ) {
|
||||
if ( resultList == null || resultList.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
@@ -146,7 +141,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
return;
|
||||
}
|
||||
Map< String, IMogoMarker > existMarker = new HashMap<>();
|
||||
for ( ADASRecognizedListResult recognizedListResult : resultList ) {
|
||||
for ( ADASRecognizedResult recognizedListResult : resultList ) {
|
||||
if ( recognizedListResult == null ) {
|
||||
continue;
|
||||
}
|
||||
@@ -170,7 +165,7 @@ class AdasRecognizedResultDrawer extends BaseDrawer {
|
||||
}
|
||||
}
|
||||
|
||||
private IMogoMarker drawAdasRecognizedDataMarker( ADASRecognizedListResult recognizedListResult,
|
||||
private IMogoMarker drawAdasRecognizedDataMarker( ADASRecognizedResult recognizedListResult,
|
||||
boolean machineVision,
|
||||
double curSpeed ) {
|
||||
if ( recognizedListResult == null ) {
|
||||
|
||||
@@ -188,16 +188,9 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
CloudRoadData lastPosition = mLastPositions.get( uniqueKey );
|
||||
if ( lastPosition != null ) {
|
||||
if ( lastPosition.equals( cloudRoadData ) ) {
|
||||
if ( ( ( int ) cloudRoadData.getSpeed() ) == 0 ) {
|
||||
// MapCameraPosition position = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().getMapCameraPosition();
|
||||
// if ( position != null ) {
|
||||
// marker.setRotateAngle( 360 - ( float ) cloudRoadData.getHeading() - position.getBearing() );
|
||||
// } else {
|
||||
// }
|
||||
marker.setRotateAngle( ( ( float ) cloudRoadData.getHeading() ) );
|
||||
}
|
||||
Logger.d( TAG, "保持位置 - %s", uniqueKey );
|
||||
// marker.setPosition( lastPosition.getLat(), lastPosition.getLon() );
|
||||
marker.setRotateAngle( ( ( float ) cloudRoadData.getHeading() ) );
|
||||
marker.setPosition( lastPosition.getLat(), lastPosition.getLon() );
|
||||
} else {
|
||||
List< MogoLatLng > points = new ArrayList<>();
|
||||
points.add( new MogoLatLng( lastPosition.getLat(), lastPosition.getLon() ) );
|
||||
@@ -341,7 +334,7 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
private int getVrModel( CloudRoadData data ) {
|
||||
switch ( data.getFromType() ) {
|
||||
case CloudRoadData.FROM_ADAS:
|
||||
return R.raw.taxi;
|
||||
return R.raw.cargrey;
|
||||
case CloudRoadData.FROM_ROAD_UNIT:
|
||||
return R.raw.cargreen;
|
||||
case CloudRoadData.FROM_MY_LOCATION:
|
||||
@@ -395,7 +388,6 @@ class SnapshotSetDataDrawer extends BaseDrawer implements IMogoMarkerClickListen
|
||||
driverInfo.setLat( data.getLat() );
|
||||
driverInfo.setLon( data.getLon() );
|
||||
driverInfo.setSn( data.getSn() );
|
||||
|
||||
ICarsChattingProvider carChatting = CallChatApi.getInstance().getApiProvider();
|
||||
|
||||
if ( carChatting != null ) {
|
||||
|
||||
Reference in New Issue
Block a user