绘制每秒一次的车辆
This commit is contained in:
@@ -96,6 +96,7 @@ public class MogoServiceProvider implements IMogoModuleProvider {
|
||||
public void init( Context context ) {
|
||||
Logger.d( TAG, "init" );
|
||||
MarkerServiceHandler.init( context );
|
||||
MogoServices.getInstance().preInit( context );
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
MogoServices.getInstance().init( AbsMogoApplication.getApp() );
|
||||
}, 5_000L );
|
||||
|
||||
@@ -339,6 +339,7 @@ public class MogoServices implements IMogoMapListener,
|
||||
unregisterInternalUnWakeupWords();
|
||||
stopAutoRefreshStrategy();
|
||||
}
|
||||
VrModeController.getInstance().onMainPageResumeStatusChanged( resume );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -373,15 +374,14 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
};
|
||||
|
||||
public void init( Context context ) {
|
||||
public void preInit( Context context ) {
|
||||
mContext = context;
|
||||
|
||||
initWorkThread();
|
||||
|
||||
mRefreshModel = new RefreshModel( context );
|
||||
mMogoMapService = MarkerServiceHandler.getMapService();
|
||||
mUiController = mMogoMapService.getMapUIController();
|
||||
mNavi = mMogoMapService.getNavi( context );
|
||||
|
||||
mStatusManager = MarkerServiceHandler.getMogoStatusManager();
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.USER_INTERACTED, statusChangedListener );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.SEARCH_UI, statusChangedListener );
|
||||
@@ -390,6 +390,12 @@ public class MogoServices implements IMogoMapListener,
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.ACC_STATUS, statusChangedListener );
|
||||
mStatusManager.registerStatusChangedListener( ServiceConst.TYPE, StatusDescriptor.VR_MODE, statusChangedListener );
|
||||
mStatusManager.setAIAssistReady( TAG, AIAssist.getInstance( mContext ).hasFlush() );
|
||||
}
|
||||
|
||||
public void init( Context context ) {
|
||||
|
||||
|
||||
initWorkThread();
|
||||
|
||||
registerMogoReceiver( context );
|
||||
registerInternalUnWakeupWords();
|
||||
@@ -461,16 +467,17 @@ public class MogoServices implements IMogoMapListener,
|
||||
if ( lastCarLocation != null ) {
|
||||
locationResult = new LocationResult();
|
||||
locationResult.lastCoordinate = new CloudLocationInfo();
|
||||
locationResult.lastCoordinate.setAlt(lastCarLocation.getAltitude());
|
||||
locationResult.lastCoordinate.setHeading(lastCarLocation.getBearing());
|
||||
locationResult.lastCoordinate.setLat(lastCarLocation.getLatitude());
|
||||
locationResult.lastCoordinate.setLon(lastCarLocation.getLongitude());
|
||||
locationResult.lastCoordinate.setSatelliteTime(lastCarLocation.getTime());
|
||||
locationResult.lastCoordinate.setSystemTime(System.currentTimeMillis());
|
||||
locationResult.lastCoordinate.setSpeed(lastCarLocation.getSpeed());
|
||||
locationResult.lastCoordinate.setAlt( lastCarLocation.getAltitude() );
|
||||
locationResult.lastCoordinate.setHeading( lastCarLocation.getBearing() );
|
||||
locationResult.lastCoordinate.setLat( lastCarLocation.getLatitude() );
|
||||
locationResult.lastCoordinate.setLon( lastCarLocation.getLongitude() );
|
||||
locationResult.lastCoordinate.setSatelliteTime( lastCarLocation.getTime() );
|
||||
locationResult.lastCoordinate.setSystemTime( System.currentTimeMillis() );
|
||||
locationResult.lastCoordinate.setSpeed( lastCarLocation.getSpeed() );
|
||||
locationResult.coordinates = new ArrayList<>();
|
||||
locationResult.sn = com.mogo.commons.network.Utils.getSn();
|
||||
locationResult.mortonCode = MortonCode.wrapEncodeMorton( locationResult.lastCoordinate.getLon(), locationResult.lastCoordinate.getLat() );
|
||||
locationResult.coordinates.add( locationResult.lastCoordinate );
|
||||
}
|
||||
List< ADASRecognizedResult > recognizedResults = MarkerServiceHandler.getADASController().getLastADASRecognizedResult();
|
||||
OnePerSecondSendContent content = new OnePerSecondSendContent();
|
||||
|
||||
@@ -228,4 +228,14 @@ public class ServiceConst {
|
||||
*/
|
||||
public static final long INTERVAL_SEND_CAR_LOCATION_AND_ADAS_RECOGNIZED_RESULT_2_SERVER = 1 * 1_000L;
|
||||
|
||||
/**
|
||||
* adas识别数据
|
||||
*/
|
||||
public static final String TYPE_MARKER_ADAS = "TYPE_MARKER_ADAS";
|
||||
|
||||
/**
|
||||
* 云端下发数据
|
||||
*/
|
||||
public static final String TYPE_MARKER_CLOUD_DATA = "TYPE_MARKER_CLOUD_DATA";
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
package com.mogo.module.service.marker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.BitmapFactory;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.ModuleNames;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedListResult;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/28
|
||||
*
|
||||
* 绘制adas近景识别到的车辆
|
||||
*/
|
||||
class AdasRecognizedResultDrawer {
|
||||
|
||||
private static volatile AdasRecognizedResultDrawer sInstance;
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private AdasRecognizedResultDrawer() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
}
|
||||
|
||||
public static AdasRecognizedResultDrawer getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( AdasRecognizedResultDrawer.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new AdasRecognizedResultDrawer();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
// adas marker 缓存
|
||||
private Map< String, IMogoMarker > mAdasRecognizedMarkersCaches = new ConcurrentHashMap<>();
|
||||
|
||||
public void renderAdasRecognizedResult( List< ADASRecognizedListResult > resultList ) {
|
||||
if ( resultList == null || resultList.isEmpty() ) {
|
||||
MarkerServiceHandler.getApis().getMapServiceApi().getMarkerManager( mContext ).removeMarkers( ServiceConst.TYPE_MARKER_ADAS );
|
||||
return;
|
||||
}
|
||||
purgeAdasRecognizedData( resultList );
|
||||
for ( ADASRecognizedListResult recognizedListResult : resultList ) {
|
||||
if ( recognizedListResult == null ) {
|
||||
continue;
|
||||
}
|
||||
IMogoMarker marker = null;
|
||||
String uniqueKey = recognizedListResult.uuid;
|
||||
if ( mAdasRecognizedMarkersCaches.containsKey( uniqueKey ) ) {
|
||||
marker = mAdasRecognizedMarkersCaches.get( uniqueKey );
|
||||
}
|
||||
if ( marker == null || marker.isDestroyed() ) {
|
||||
marker = drawAdasRecognizedDataMarker( recognizedListResult );
|
||||
mAdasRecognizedMarkersCaches.put( uniqueKey, marker );
|
||||
}
|
||||
|
||||
if ( recognizedListResult.latLonList != null
|
||||
|| recognizedListResult.latLonList.size() > 1 ) {
|
||||
List< MogoLatLng > points = new ArrayList<>();
|
||||
for ( int j = 0; j < recognizedListResult.latLonList.size(); j++ ) {
|
||||
ADASRecognizedListResult.LatLon latLon = recognizedListResult.latLonList.get( j );
|
||||
if ( latLon == null ) {
|
||||
continue;
|
||||
}
|
||||
points.add( new MogoLatLng( latLon.lat, latLon.lon ) );
|
||||
}
|
||||
if ( points.size() >= 1 ) {
|
||||
marker.startSmooth( points, 1000 );
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤adas数据中,不存在的 marker
|
||||
*
|
||||
* @param resultList
|
||||
*/
|
||||
private void purgeAdasRecognizedData( List< ADASRecognizedListResult > resultList ) {
|
||||
if ( resultList == null || resultList.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
if ( mAdasRecognizedMarkersCaches.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
Map< String, IMogoMarker > existMarker = new HashMap<>();
|
||||
for ( ADASRecognizedListResult recognizedListResult : resultList ) {
|
||||
if ( recognizedListResult == null ) {
|
||||
continue;
|
||||
}
|
||||
String uniqueKey = recognizedListResult.uuid;
|
||||
if ( mAdasRecognizedMarkersCaches.containsKey( uniqueKey ) ) {
|
||||
existMarker.put( uniqueKey, mAdasRecognizedMarkersCaches.get( uniqueKey ) );
|
||||
}
|
||||
}
|
||||
if ( !existMarker.isEmpty() ) {
|
||||
for ( String key : mAdasRecognizedMarkersCaches.keySet() ) {
|
||||
if ( !existMarker.containsKey( key ) ) {
|
||||
try {
|
||||
IMogoMarker marker = mAdasRecognizedMarkersCaches.remove( key );
|
||||
marker.destroy();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IMogoMarker drawAdasRecognizedDataMarker( ADASRecognizedListResult recognizedListResult ) {
|
||||
if ( recognizedListResult == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ( recognizedListResult.type == AdasRecognizedType.classIdBackground ) {
|
||||
|
||||
}
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner( ServiceConst.TYPE_MARKER_ADAS )
|
||||
.icon( BitmapFactory.decodeResource( mContext.getResources(), R.drawable.map_custom_ic_current_location2 ) )
|
||||
.position( new MogoLatLng( recognizedListResult.latLonList.get( 0 ).lat, recognizedListResult.latLonList.get( 0 ).lon ) );
|
||||
return MarkerServiceHandler.getMapService().getMarkerManager( mContext ).addMarker( ModuleNames.CARD_TYPE_ROAD_CONDITION, options );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.mogo.module.service.marker;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/27
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
class AdasRecognizedType {
|
||||
//背景
|
||||
public static final int classIdBackground = 0;
|
||||
//人
|
||||
public static final int classIdPerson = 1;
|
||||
//自行车
|
||||
public static final int classIdBicycle = 2;
|
||||
//小轿车
|
||||
public static final int classIdCar = 3;
|
||||
//摩托车
|
||||
public static final int classIdMoto = 4;
|
||||
//红绿灯
|
||||
public static final int classIdTrafficSign = 5;
|
||||
//bus
|
||||
public static final int classIdTrafficBus = 6;
|
||||
//track
|
||||
public static final int classIdTrafficTruck = 8;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.service.marker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Rect;
|
||||
import android.text.TextUtils;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
@@ -16,6 +17,8 @@ import com.mogo.map.marker.anim.OnMarkerAnimationListener;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.module.common.ModuleNames;
|
||||
import com.mogo.module.common.api.CallChatApi;
|
||||
import com.mogo.module.common.entity.CloudLocationInfo;
|
||||
import com.mogo.module.common.entity.CloudRoadData;
|
||||
import com.mogo.module.common.entity.MarkerCarPois;
|
||||
import com.mogo.module.common.entity.MarkerCardResult;
|
||||
import com.mogo.module.common.entity.MarkerExploreWay;
|
||||
@@ -35,6 +38,7 @@ import com.mogo.module.service.network.RefreshModel;
|
||||
import com.mogo.module.service.utils.ViewUtils;
|
||||
import com.mogo.module.service.vrmode.VrModeController;
|
||||
import com.mogo.service.adas.IMogoADASControlStatusChangedListener;
|
||||
import com.mogo.service.adas.entity.ADASRecognizedListResult;
|
||||
import com.mogo.service.connection.IMogoOnMessageListener;
|
||||
import com.mogo.service.connection.IMogoOnWebSocketMessageListener;
|
||||
import com.mogo.service.connection.WebSocketMsgType;
|
||||
@@ -53,6 +57,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* author : donghongyu
|
||||
@@ -133,6 +138,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
|
||||
} );
|
||||
|
||||
// 每隔一秒下发的数据
|
||||
MarkerServiceHandler.getApis().getWebSocketManagerApi( mContext )
|
||||
.registerOnWebSocketMessageListener( new IMogoOnWebSocketMessageListener< MogoSnapshotSetData >() {
|
||||
|
||||
@@ -156,6 +162,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
if ( data == null ) {
|
||||
return;
|
||||
}
|
||||
SnapshotSetDataDrawer.getInstance().renderSnapshotData( data );
|
||||
VrModeController.getInstance().renderMogoSnapshotSetData( data );
|
||||
}
|
||||
|
||||
@@ -164,15 +171,17 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
|
||||
}
|
||||
} );
|
||||
// adas 每隔一秒传递的数据
|
||||
MarkerServiceHandler.getApis().getAdasControllerApi().addAdasRecognizedDataCallback( resultList -> {
|
||||
if ( resultList == null || resultList.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
// 绘制近景识别到的车辆,每秒绘制一次
|
||||
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult( resultList );
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 地图上的Marker点击回调
|
||||
*/
|
||||
@@ -242,7 +251,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
updateCarUserInfoWindow( mogoMarker );
|
||||
} else {
|
||||
Object object = mogoMarker.getObject();
|
||||
if ( object != null ) {
|
||||
if ( object instanceof MarkerShowEntity ) {
|
||||
MarkerShowEntity markerShowEntity = ( MarkerShowEntity ) object;
|
||||
markerShowEntity.setChecked( true );
|
||||
IMarkerView markerView = MapMarkerAdapter.getMarkerView( mContext, markerShowEntity, mogoMarker.getMogoMarkerOptions() );
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
package com.mogo.module.service.marker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.BitmapFactory;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.module.common.ModuleNames;
|
||||
import com.mogo.module.common.entity.CloudLocationInfo;
|
||||
import com.mogo.module.common.entity.CloudRoadData;
|
||||
import com.mogo.module.common.entity.MogoSnapshotSetData;
|
||||
import com.mogo.module.service.MarkerServiceHandler;
|
||||
import com.mogo.module.service.R;
|
||||
import com.mogo.module.service.ServiceConst;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/10/28
|
||||
*
|
||||
* 云端数据绘制
|
||||
*/
|
||||
class SnapshotSetDataDrawer {
|
||||
|
||||
private static volatile SnapshotSetDataDrawer sInstance;
|
||||
|
||||
private Context mContext;
|
||||
|
||||
private SnapshotSetDataDrawer() {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
}
|
||||
|
||||
public static SnapshotSetDataDrawer getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( SnapshotSetDataDrawer.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new SnapshotSetDataDrawer();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
// 云端 marker 缓存
|
||||
private Map< String, IMogoMarker > mCloudSnapshotMarkersCaches = new ConcurrentHashMap<>();
|
||||
|
||||
|
||||
/**
|
||||
* 其他车辆、rsu 车辆数据
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
public void renderSnapshotData( MogoSnapshotSetData data ) {
|
||||
if ( data == null || data.getAllList() == null || data.getAllList().isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
purgeCloudSnapshotData( data );
|
||||
for ( CloudRoadData cloudRoadData : data.getAllList() ) {
|
||||
if ( cloudRoadData == null ) {
|
||||
continue;
|
||||
}
|
||||
if ( cloudRoadData.getDistance() < 50 ) {
|
||||
// 过滤 adas 识别的车辆
|
||||
continue;
|
||||
}
|
||||
IMogoMarker marker = null;
|
||||
String uniqueKey = cloudRoadData.getUniqueKey();
|
||||
if ( mCloudSnapshotMarkersCaches.containsKey( uniqueKey ) ) {
|
||||
marker = mCloudSnapshotMarkersCaches.get( uniqueKey );
|
||||
}
|
||||
if ( marker == null || marker.isDestroyed() ) {
|
||||
marker = drawSnapshotDataMarker( cloudRoadData );
|
||||
mCloudSnapshotMarkersCaches.put( uniqueKey, marker );
|
||||
}
|
||||
if ( cloudRoadData.getCoordinates() != null
|
||||
|| cloudRoadData.getCoordinates().size() > 1 ) {
|
||||
List< MogoLatLng > points = new ArrayList<>();
|
||||
for ( int j = 0; j < cloudRoadData.getCoordinates().size(); j++ ) {
|
||||
CloudLocationInfo poi = cloudRoadData.getCoordinates().get( j );
|
||||
if ( poi == null ) {
|
||||
continue;
|
||||
}
|
||||
double lat = poi.getLat();
|
||||
double lng = poi.getLon();
|
||||
points.add( new MogoLatLng( lat, lng ) );
|
||||
}
|
||||
if ( points.size() >= 1 ) {
|
||||
marker.startSmooth( points, 1000 );
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤本次数据中,不存在的 marker
|
||||
*
|
||||
* @param data
|
||||
*/
|
||||
private void purgeCloudSnapshotData( MogoSnapshotSetData data ) {
|
||||
if ( data == null || data.getAllList() == null || data.getAllList().isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
if ( mCloudSnapshotMarkersCaches.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
Map< String, IMogoMarker > existMarker = new HashMap<>();
|
||||
for ( CloudRoadData cloudRoadData : data.getAllList() ) {
|
||||
if ( cloudRoadData == null ) {
|
||||
continue;
|
||||
}
|
||||
String uniqueKey = cloudRoadData.getUniqueKey();
|
||||
if ( mCloudSnapshotMarkersCaches.containsKey( uniqueKey ) ) {
|
||||
existMarker.put( uniqueKey, mCloudSnapshotMarkersCaches.get( uniqueKey ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( !existMarker.isEmpty() ) {
|
||||
for ( String key : mCloudSnapshotMarkersCaches.keySet() ) {
|
||||
if ( !existMarker.containsKey( key ) ) {
|
||||
try {
|
||||
IMogoMarker marker = mCloudSnapshotMarkersCaches.remove( key );
|
||||
marker.destroy();
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IMogoMarker drawSnapshotDataMarker( CloudRoadData data ) {
|
||||
if ( data == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ( data.getType() == AdasRecognizedType.classIdBackground ) {
|
||||
|
||||
}
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
.owner( ServiceConst.TYPE_MARKER_CLOUD_DATA )
|
||||
.icon( BitmapFactory.decodeResource( mContext.getResources(), R.drawable.map_custom_ic_current_location2 ) )
|
||||
.position( new MogoLatLng( data.getLat(), data.getLon() ) );
|
||||
return MarkerServiceHandler.getMapService().getMarkerManager( mContext ).addMarker( ModuleNames.CARD_TYPE_ROAD_CONDITION, options );
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.module.service.MogoServices;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.strategy.IMogoRefreshStrategyController;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -16,9 +17,15 @@ import com.mogo.service.strategy.IMogoRefreshStrategyController;
|
||||
@Route( path = MogoServicePaths.PATH_REFRESH_STRATEGY_API )
|
||||
public class MogoRefreshStrategyController implements IMogoRefreshStrategyController {
|
||||
|
||||
private static final String TAG = "MogoRefreshStrategyController";
|
||||
|
||||
@Override
|
||||
public void restartAutoRefreshAtTime( int delay ) {
|
||||
MogoServices.getInstance().restartAutoRefreshAtTime( delay );
|
||||
try {
|
||||
MogoServices.getInstance().restartAutoRefreshAtTime( delay );
|
||||
} catch ( Exception e ) {
|
||||
Logger.e(TAG, e, "restartAutoRefreshAtTime");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.module.common.entity.MogoSnapshotSetData;
|
||||
@@ -93,6 +94,24 @@ class VrModeController {
|
||||
}
|
||||
}
|
||||
|
||||
public void onMainPageResumeStatusChanged( boolean isResume ) {
|
||||
if ( mMachineVisionInterface != null ) {
|
||||
if ( isResume ) {
|
||||
try {
|
||||
mMachineVisionInterface.showViewIfExist();
|
||||
} catch ( RemoteException e ) {
|
||||
Logger.e( TAG, e, "onMainPageResumeStatusChanged" );
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
mMachineVisionInterface.hideViewIfExist();
|
||||
} catch ( RemoteException e ) {
|
||||
Logger.e( TAG, e, "onMainPageResumeStatusChanged" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void renderMogoSnapshotSetData( MogoSnapshotSetData data ) {
|
||||
if ( data == null ) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user