add lat lon in test panel
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package com.mogo.commons.debug;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-23
|
||||
@@ -28,7 +26,7 @@ public class DebugConfig {
|
||||
*
|
||||
* @param sDebug true - 调试模式 false - 非调试模式
|
||||
*/
|
||||
public static void setDebug( boolean sDebug ) {
|
||||
public static void setDebug(boolean sDebug) {
|
||||
DebugConfig.sDebug = sDebug;
|
||||
}
|
||||
|
||||
@@ -69,7 +67,7 @@ public class DebugConfig {
|
||||
*/
|
||||
public static final int AI_TYPE_SPEECH = 2;
|
||||
|
||||
private static int sAIType = AI_TYPE_TXZ;
|
||||
private static final int sAIType = AI_TYPE_TXZ;
|
||||
|
||||
/**
|
||||
* 自研车机
|
||||
@@ -116,7 +114,7 @@ public class DebugConfig {
|
||||
* {@link #NET_MODE_DEMO}
|
||||
* {@link #NET_MODE_RELEASE}
|
||||
*/
|
||||
public static void setNetMode( int netMode ) {
|
||||
public static void setNetMode(int netMode) {
|
||||
DebugConfig.sNetMode = netMode;
|
||||
}
|
||||
|
||||
@@ -129,7 +127,7 @@ public class DebugConfig {
|
||||
return sLaunchLocationService;
|
||||
}
|
||||
|
||||
public static void setLaunchLocationService( boolean launchLocationService ) {
|
||||
public static void setLaunchLocationService(boolean launchLocationService) {
|
||||
DebugConfig.sLaunchLocationService = launchLocationService;
|
||||
}
|
||||
|
||||
@@ -142,7 +140,7 @@ public class DebugConfig {
|
||||
return sUseCustomNavi;
|
||||
}
|
||||
|
||||
public static void setUseCustomNavi( boolean sUseCustomNavi ) {
|
||||
public static void setUseCustomNavi(boolean sUseCustomNavi) {
|
||||
DebugConfig.sUseCustomNavi = sUseCustomNavi;
|
||||
}
|
||||
|
||||
@@ -151,7 +149,7 @@ public class DebugConfig {
|
||||
*
|
||||
* @param type {@link #CAR_MACHINE_TYPE_SELF_INNOVATE} {@link #CAR_MACHINE_TYPE_BYD}
|
||||
*/
|
||||
public static void setCarMachineType( int type ) {
|
||||
public static void setCarMachineType(int type) {
|
||||
sCarMachineType = type;
|
||||
}
|
||||
|
||||
@@ -173,7 +171,7 @@ public class DebugConfig {
|
||||
return sIsLauncher;
|
||||
}
|
||||
|
||||
public static void setLauncher( boolean isLauncher ) {
|
||||
public static void setLauncher(boolean isLauncher) {
|
||||
DebugConfig.sIsLauncher = isLauncher;
|
||||
}
|
||||
|
||||
@@ -183,7 +181,7 @@ public class DebugConfig {
|
||||
return sRequestOnlineCarData;
|
||||
}
|
||||
|
||||
public static void setRequestOnlineCarData( boolean sRequestOnlineCarData ) {
|
||||
public static void setRequestOnlineCarData(boolean sRequestOnlineCarData) {
|
||||
DebugConfig.sRequestOnlineCarData = sRequestOnlineCarData;
|
||||
}
|
||||
|
||||
@@ -193,7 +191,7 @@ public class DebugConfig {
|
||||
return sUseCustomMap;
|
||||
}
|
||||
|
||||
public static void setUseCustomMap( boolean sUseCustomMap ) {
|
||||
public static void setUseCustomMap(boolean sUseCustomMap) {
|
||||
DebugConfig.sUseCustomMap = sUseCustomMap;
|
||||
}
|
||||
|
||||
@@ -206,13 +204,13 @@ public class DebugConfig {
|
||||
return sActiveAIAssistFlag;
|
||||
}
|
||||
|
||||
public static void setActiveAIAssistFlag( boolean sActiveAIAssistFlag ) {
|
||||
public static void setActiveAIAssistFlag(boolean sActiveAIAssistFlag) {
|
||||
DebugConfig.sActiveAIAssistFlag = sActiveAIAssistFlag;
|
||||
}
|
||||
|
||||
private static boolean useMockObuData;
|
||||
|
||||
public static void setUseMockObuData( boolean use ) {
|
||||
public static void setUseMockObuData(boolean use) {
|
||||
useMockObuData = use;
|
||||
}
|
||||
|
||||
@@ -231,13 +229,13 @@ public class DebugConfig {
|
||||
*
|
||||
* @param sProductFlavor
|
||||
*/
|
||||
public static void setProductFlavor( String sProductFlavor ) {
|
||||
public static void setProductFlavor(String sProductFlavor) {
|
||||
DebugConfig.sProductFlavor = sProductFlavor;
|
||||
}
|
||||
|
||||
private static String sSocketAppId;
|
||||
|
||||
public static void setSocketAppId( String sSocketAppId ) {
|
||||
public static void setSocketAppId(String sSocketAppId) {
|
||||
DebugConfig.sSocketAppId = sSocketAppId;
|
||||
}
|
||||
|
||||
@@ -254,14 +252,14 @@ public class DebugConfig {
|
||||
return sRoadEventAnimated;
|
||||
}
|
||||
|
||||
public static void setRoadEventAnimated( boolean sRoadEventAnimated ) {
|
||||
public static void setRoadEventAnimated(boolean sRoadEventAnimated) {
|
||||
DebugConfig.sRoadEventAnimated = sRoadEventAnimated;
|
||||
}
|
||||
|
||||
|
||||
private static boolean sLoadGuideModule = false;
|
||||
|
||||
public static void setLoadGuideModule( boolean sLoadGuideModule ) {
|
||||
public static void setLoadGuideModule(boolean sLoadGuideModule) {
|
||||
DebugConfig.sLoadGuideModule = sLoadGuideModule;
|
||||
}
|
||||
|
||||
@@ -277,7 +275,7 @@ public class DebugConfig {
|
||||
|
||||
private static boolean isSkinSupported = false;
|
||||
|
||||
public static void setSkinSupported( boolean isSkinSupported ) {
|
||||
public static void setSkinSupported(boolean isSkinSupported) {
|
||||
DebugConfig.isSkinSupported = isSkinSupported;
|
||||
}
|
||||
|
||||
@@ -290,7 +288,7 @@ public class DebugConfig {
|
||||
*/
|
||||
private static boolean isSupportedSearchDestinationOnlineCarList = false;
|
||||
|
||||
public static void setSupportedSearchDestinationOnlineCarList( boolean isSupportedSearchDestinationOnlineCarList ) {
|
||||
public static void setSupportedSearchDestinationOnlineCarList(boolean isSupportedSearchDestinationOnlineCarList) {
|
||||
DebugConfig.isSupportedSearchDestinationOnlineCarList = isSupportedSearchDestinationOnlineCarList;
|
||||
}
|
||||
|
||||
@@ -303,7 +301,7 @@ public class DebugConfig {
|
||||
*/
|
||||
private static boolean isScheduleCalculateNotHomeCompanyDistanceForPush = false;
|
||||
|
||||
public static void setScheduleCalculateNotHomeCompanyDistanceForPush( boolean isScheduleCalculateNotHomeCompanyDistanceForPush ) {
|
||||
public static void setScheduleCalculateNotHomeCompanyDistanceForPush(boolean isScheduleCalculateNotHomeCompanyDistanceForPush) {
|
||||
DebugConfig.isScheduleCalculateNotHomeCompanyDistanceForPush = isScheduleCalculateNotHomeCompanyDistanceForPush;
|
||||
}
|
||||
|
||||
@@ -316,7 +314,7 @@ public class DebugConfig {
|
||||
*/
|
||||
private static boolean isSupportLauncherCardRefreshStrategy = false;
|
||||
|
||||
public static void setSupportLauncherCardRefreshStrategy( boolean isSupportLauncherCardRefreshStrategy ) {
|
||||
public static void setSupportLauncherCardRefreshStrategy(boolean isSupportLauncherCardRefreshStrategy) {
|
||||
DebugConfig.isSupportLauncherCardRefreshStrategy = isSupportLauncherCardRefreshStrategy;
|
||||
}
|
||||
|
||||
@@ -330,7 +328,7 @@ public class DebugConfig {
|
||||
return obuType;
|
||||
}
|
||||
|
||||
public static void setObuType( int type ) {
|
||||
public static void setObuType(int type) {
|
||||
obuType = type;
|
||||
}
|
||||
|
||||
@@ -339,7 +337,7 @@ public class DebugConfig {
|
||||
*/
|
||||
private static boolean needRequestUserInfo = false;
|
||||
|
||||
public static void setNeedRequestUserInfo( boolean needRequestUserInfo ) {
|
||||
public static void setNeedRequestUserInfo(boolean needRequestUserInfo) {
|
||||
DebugConfig.needRequestUserInfo = needRequestUserInfo;
|
||||
}
|
||||
|
||||
@@ -356,13 +354,13 @@ public class DebugConfig {
|
||||
return isMapBased;
|
||||
}
|
||||
|
||||
public static void setMapBased( boolean isMapBased ) {
|
||||
public static void setMapBased(boolean isMapBased) {
|
||||
DebugConfig.isMapBased = isMapBased;
|
||||
}
|
||||
|
||||
private static boolean isNeedLoadGuideModule = true;
|
||||
|
||||
public static void setNeedLoadGuideModule( boolean isNeedLoadGuideModule ) {
|
||||
public static void setNeedLoadGuideModule(boolean isNeedLoadGuideModule) {
|
||||
DebugConfig.isNeedLoadGuideModule = isNeedLoadGuideModule;
|
||||
}
|
||||
|
||||
@@ -376,7 +374,7 @@ public class DebugConfig {
|
||||
return isNeedHideAdasWhenShare;
|
||||
}
|
||||
|
||||
public static void setNeedHideAdasWhenShare( boolean isNeedHideAdas ) {
|
||||
public static void setNeedHideAdasWhenShare(boolean isNeedHideAdas) {
|
||||
DebugConfig.isNeedHideAdasWhenShare = isNeedHideAdas;
|
||||
}
|
||||
|
||||
@@ -389,7 +387,7 @@ public class DebugConfig {
|
||||
return sIsNeedUploadCoordinatesInTime;
|
||||
}
|
||||
|
||||
public static void setNeedUploadCoordinatesInTime( boolean sIsNeedUploadCoordinatesInTime ) {
|
||||
public static void setNeedUploadCoordinatesInTime(boolean sIsNeedUploadCoordinatesInTime) {
|
||||
DebugConfig.sIsNeedUploadCoordinatesInTime = sIsNeedUploadCoordinatesInTime;
|
||||
}
|
||||
|
||||
@@ -402,7 +400,7 @@ public class DebugConfig {
|
||||
return sIsUseAdasRtkLocationInfo;
|
||||
}
|
||||
|
||||
public static void setUseAdasRtkLocationInfo( boolean sIsUseAdasRtkLocationInfo ) {
|
||||
public static void setUseAdasRtkLocationInfo(boolean sIsUseAdasRtkLocationInfo) {
|
||||
DebugConfig.sIsUseAdasRtkLocationInfo = sIsUseAdasRtkLocationInfo;
|
||||
}
|
||||
|
||||
@@ -412,17 +410,17 @@ public class DebugConfig {
|
||||
return sIsNotSmooth;
|
||||
}
|
||||
|
||||
public static void setNotSmooth( boolean sIsNotSmooth ) {
|
||||
public static void setNotSmooth(boolean sIsNotSmooth) {
|
||||
DebugConfig.sIsNotSmooth = sIsNotSmooth;
|
||||
}
|
||||
|
||||
public static boolean isOCHModule() {
|
||||
return sProductFlavor != null && sProductFlavor.startsWith( "foch" );
|
||||
return sProductFlavor != null && sProductFlavor.startsWith("foch");
|
||||
}
|
||||
|
||||
public static int sSelfCarSpeedYOffset = 20;
|
||||
|
||||
public static void setSelfCarSpeedYOffset( int sSelfCarSpeedYOffset ) {
|
||||
public static void setSelfCarSpeedYOffset(int sSelfCarSpeedYOffset) {
|
||||
DebugConfig.sSelfCarSpeedYOffset = sSelfCarSpeedYOffset;
|
||||
}
|
||||
|
||||
@@ -436,20 +434,28 @@ public class DebugConfig {
|
||||
public static final int sDownloadSnapshot = 2;
|
||||
public static final int sAutoPilotStatus = 3;
|
||||
public static final int sDownloadLink = 4;
|
||||
public static final int sLon = 5;
|
||||
public static final int sLat = 6;
|
||||
|
||||
public static String[] sStatus = new String[]{
|
||||
"false",
|
||||
"false",
|
||||
"false",
|
||||
"0",
|
||||
"false"
|
||||
"false",
|
||||
"0",
|
||||
"0"
|
||||
};
|
||||
|
||||
public synchronized static void setStatus( int type, boolean status ) {
|
||||
sStatus[type] = String.valueOf( status );
|
||||
public synchronized static void setStatus(int type, boolean status) {
|
||||
sStatus[type] = String.valueOf(status);
|
||||
}
|
||||
|
||||
public synchronized static void setAutoPilotStatus( String status ) {
|
||||
public synchronized static void setStatusData(int type, double data) {
|
||||
sStatus[type] = String.valueOf(data);
|
||||
}
|
||||
|
||||
public synchronized static void setAutoPilotStatus(String status) {
|
||||
sStatus[sAutoPilotStatus] = status;
|
||||
}
|
||||
|
||||
@@ -457,21 +463,29 @@ public class DebugConfig {
|
||||
return sStatus[sAutoPilotStatus];
|
||||
}
|
||||
|
||||
public synchronized static String getStatus( int type, boolean set2False ) {
|
||||
public synchronized static String getStatus(int type, boolean set2False) {
|
||||
String result = sStatus[type];
|
||||
if ( set2False ) {
|
||||
if (set2False) {
|
||||
sStatus[type] = "false";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public synchronized static String getStatusData(int type){
|
||||
if(type > 4){
|
||||
return sStatus[type].toString();
|
||||
}else{
|
||||
return "0";
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isUseAdasRecognize = true;
|
||||
|
||||
public static void setUseAdasRecognize(boolean status) {
|
||||
isUseAdasRecognize = status;
|
||||
}
|
||||
|
||||
public static boolean isUseAdasRecognize(){
|
||||
public static boolean isUseAdasRecognize() {
|
||||
return isUseAdasRecognize;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public
|
||||
/*
|
||||
* @author congtaowang
|
||||
* @since 2020/12/14
|
||||
*
|
||||
* 实时坐标数据处理中心
|
||||
*/
|
||||
/*
|
||||
* @author congtaowang
|
||||
* @since 2020/12/14
|
||||
*
|
||||
* 实时坐标数据处理中心
|
||||
*/
|
||||
class SnapshotLocationController {
|
||||
|
||||
private static final String TAG = "SnapshotLocationController";
|
||||
@@ -27,9 +27,9 @@ class SnapshotLocationController {
|
||||
}
|
||||
|
||||
public static SnapshotLocationController getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( SnapshotLocationController.class ) {
|
||||
if ( sInstance == null ) {
|
||||
if (sInstance == null) {
|
||||
synchronized (SnapshotLocationController.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new SnapshotLocationController();
|
||||
}
|
||||
}
|
||||
@@ -44,10 +44,10 @@ class SnapshotLocationController {
|
||||
private CloudLocationInfo mLastLocationInfo = null;
|
||||
|
||||
// GPS(1s1次) RTK(OS侧)缓存数据,
|
||||
private final List< CloudLocationInfo > mLocationList = new ArrayList<>();
|
||||
private final List<CloudLocationInfo> mLocationList = new ArrayList<>();
|
||||
|
||||
// adda 工控机数据缓存
|
||||
private final List< CloudLocationInfo > mMachineCacheList = new ArrayList<>();
|
||||
private final List<CloudLocationInfo> mMachineCacheList = new ArrayList<>();
|
||||
|
||||
private int mDataAccuracy = 0;
|
||||
private double mCurSpeed;
|
||||
@@ -59,15 +59,15 @@ class SnapshotLocationController {
|
||||
*
|
||||
* @param cli {@link CloudLocationInfo}
|
||||
*/
|
||||
public void syncLocationInfo( CloudLocationInfo cli ) {
|
||||
if ( cli == null ) {
|
||||
public void syncLocationInfo(CloudLocationInfo cli) {
|
||||
if (cli == null) {
|
||||
return;
|
||||
}
|
||||
mLastLocationInfo = cli;
|
||||
mCurSpeed = cli.getSpeed();
|
||||
mCurLon = cli.getLon();
|
||||
mCurLat = cli.getLat();
|
||||
mLocationList.add( cli );
|
||||
mLocationList.add(cli);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -75,33 +75,39 @@ class SnapshotLocationController {
|
||||
*
|
||||
* @param data JSON结构化数据
|
||||
*/
|
||||
public void syncAdasLocationInfo( JSONObject data ) {
|
||||
if ( data == null ) {
|
||||
public void syncAdasLocationInfo(JSONObject data) {
|
||||
if (data == null) {
|
||||
return;
|
||||
}
|
||||
DebugConfig.setStatus( DebugConfig.sLocation, true );
|
||||
Logger.d( TAG, "同步到rtk数据" );
|
||||
double lon = data.optDouble( "lon", -1 );
|
||||
double lat = data.optDouble( "lat", -1 );
|
||||
double alt = data.optDouble( "alt", -1 );
|
||||
double heading = data.optDouble( "heading", -1 );
|
||||
double acceleration = data.optDouble( "acceleration", -1 );
|
||||
double yawRate = data.optDouble( "yawRate", -1 );
|
||||
double speed = data.optDouble( "speed", -1 );
|
||||
long satelliteTime = data.optLong( "satelliteTime" );
|
||||
long systemTime = data.optLong( "systemTime" );
|
||||
//测试面板状态同步
|
||||
DebugConfig.setStatus(DebugConfig.sLocation, true);
|
||||
|
||||
Logger.d(TAG, "同步到rtk数据");
|
||||
double lon = data.optDouble("lon", -1);
|
||||
double lat = data.optDouble("lat", -1);
|
||||
double alt = data.optDouble("alt", -1);
|
||||
double heading = data.optDouble("heading", -1);
|
||||
double acceleration = data.optDouble("acceleration", -1);
|
||||
double yawRate = data.optDouble("yawRate", -1);
|
||||
double speed = data.optDouble("speed", -1);
|
||||
long satelliteTime = data.optLong("satelliteTime");
|
||||
long systemTime = data.optLong("systemTime");
|
||||
|
||||
//测试面板状态同步
|
||||
DebugConfig.setStatusData(DebugConfig.sLon, lon);
|
||||
DebugConfig.setStatusData(DebugConfig.sLat, lat);
|
||||
|
||||
CloudLocationInfo cloudLocationInfo = new CloudLocationInfo();
|
||||
cloudLocationInfo.setAlt( alt );
|
||||
cloudLocationInfo.setHeading( heading );
|
||||
cloudLocationInfo.setLat( lat );
|
||||
cloudLocationInfo.setLon( lon );
|
||||
cloudLocationInfo.setSpeed( speed );
|
||||
cloudLocationInfo.setSatelliteTime( satelliteTime );
|
||||
cloudLocationInfo.setSystemTime( systemTime );
|
||||
cloudLocationInfo.setTileId(String.valueOf(MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().getTileId(lon,lat)));
|
||||
cloudLocationInfo.setAlt(alt);
|
||||
cloudLocationInfo.setHeading(heading);
|
||||
cloudLocationInfo.setLat(lat);
|
||||
cloudLocationInfo.setLon(lon);
|
||||
cloudLocationInfo.setSpeed(speed);
|
||||
cloudLocationInfo.setSatelliteTime(satelliteTime);
|
||||
cloudLocationInfo.setSystemTime(systemTime);
|
||||
cloudLocationInfo.setTileId(String.valueOf(MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().getTileId(lon, lat)));
|
||||
mLastLocationInfo = cloudLocationInfo;
|
||||
mMachineCacheList.add( cloudLocationInfo );
|
||||
mMachineCacheList.add(cloudLocationInfo);
|
||||
|
||||
mCurSpeed = cloudLocationInfo.getSpeed();
|
||||
mCurLon = cloudLocationInfo.getLon();
|
||||
@@ -113,29 +119,29 @@ class SnapshotLocationController {
|
||||
*
|
||||
* @return 坐标合集
|
||||
*/
|
||||
public List< CloudLocationInfo > getSendLocationData() {
|
||||
public List<CloudLocationInfo> getSendLocationData() {
|
||||
|
||||
List< CloudLocationInfo > list = null;
|
||||
if ( mMachineCacheList != null ) {
|
||||
List<CloudLocationInfo> list = null;
|
||||
if (mMachineCacheList != null) {
|
||||
mDataAccuracy = 1;
|
||||
list = new ArrayList<>( mMachineCacheList );
|
||||
list = new ArrayList<>(mMachineCacheList);
|
||||
mMachineCacheList.clear();
|
||||
}
|
||||
if ( list == null || list.isEmpty() ) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
mDataAccuracy = 0;
|
||||
if ( mLocationList != null ) {
|
||||
list = new ArrayList<>( mLocationList );
|
||||
if (mLocationList != null) {
|
||||
list = new ArrayList<>(mLocationList);
|
||||
mLocationList.clear();
|
||||
}
|
||||
}
|
||||
if ( list == null || list.isEmpty() ) {
|
||||
if ( mLastLocationInfo != null ) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
if (mLastLocationInfo != null) {
|
||||
list = new ArrayList();
|
||||
list.add( mLastLocationInfo );
|
||||
list.add(mLastLocationInfo);
|
||||
mLastLocationInfo = null;
|
||||
}
|
||||
}
|
||||
Logger.d( TAG, "upload loc size = %s", list == null ? 0 : list.size() );
|
||||
Logger.d(TAG, "upload loc size = %s", list == null ? 0 : list.size());
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -145,7 +151,7 @@ class SnapshotLocationController {
|
||||
* @return 精度
|
||||
*/
|
||||
public int getDataAccuracy() {
|
||||
Logger.d( TAG, "upload loc accuracy = %s", mDataAccuracy );
|
||||
Logger.d(TAG, "upload loc accuracy = %s", mDataAccuracy);
|
||||
return mDataAccuracy;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -15,14 +15,14 @@ import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.module.common.wm.WindowManagerView;
|
||||
import com.mogo.module.service.R;
|
||||
|
||||
public
|
||||
/**
|
||||
|
||||
/*
|
||||
* @author congtaowang
|
||||
* @since 2021/3/17
|
||||
*
|
||||
* 环境状态
|
||||
*/
|
||||
class EnvStatusManager {
|
||||
public class EnvStatusManager {
|
||||
|
||||
private static volatile EnvStatusManager sInstance;
|
||||
|
||||
@@ -30,9 +30,9 @@ class EnvStatusManager {
|
||||
}
|
||||
|
||||
public static EnvStatusManager getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( EnvStatusManager.class ) {
|
||||
if ( sInstance == null ) {
|
||||
if (sInstance == null) {
|
||||
synchronized (EnvStatusManager.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new EnvStatusManager();
|
||||
}
|
||||
}
|
||||
@@ -51,13 +51,13 @@ class EnvStatusManager {
|
||||
|
||||
private WindowManagerView mPanelView;
|
||||
private TextView mStatusTv;
|
||||
private Handler mMainHandler = new Handler( Looper.getMainLooper() ) {
|
||||
private final Handler mMainHandler = new Handler(Looper.getMainLooper()) {
|
||||
@Override
|
||||
public void handleMessage( Message msg ) {
|
||||
super.handleMessage( msg );
|
||||
if ( mPanelView.isShowing() ) {
|
||||
public void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
if (mPanelView.isShowing()) {
|
||||
renderStatus();
|
||||
mMainHandler.sendEmptyMessageDelayed( MSG, 5_000L );
|
||||
mMainHandler.sendEmptyMessageDelayed(MSG, 5_000L);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -69,54 +69,54 @@ class EnvStatusManager {
|
||||
"近景",
|
||||
"下发",
|
||||
"AUTO",
|
||||
"长链"
|
||||
"长链",
|
||||
"经度",
|
||||
"纬度"
|
||||
};
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
for ( int i = 0; i < sStatusName.length; i++ ) {
|
||||
stringBuilder.append( sStatusName[i] ).append( ":" );
|
||||
if ( i != 3 ) {
|
||||
stringBuilder.append( "true".equals( DebugConfig.getStatus( i, true ) ) ? "正常" : "异常" ).append( "\n" );
|
||||
for (int i = 0; i < sStatusName.length; i++) {
|
||||
stringBuilder.append(sStatusName[i]).append(":");
|
||||
if (i == 3) {
|
||||
stringBuilder.append(DebugConfig.getAutoPilotStatus()).append("\n");
|
||||
} else if (i == 5 || i == 6) {
|
||||
stringBuilder.append(DebugConfig.getStatusData(i)).append("\n");
|
||||
} else {
|
||||
stringBuilder.append( DebugConfig.getAutoPilotStatus() ).append( "\n" );
|
||||
stringBuilder.append("true".equals(DebugConfig.getStatus(i, true)) ? "正常" : "异常").append("\n");
|
||||
}
|
||||
}
|
||||
mStatusTv.setText( stringBuilder );
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
mStatusTv.setTextColor( Color.WHITE );
|
||||
mStatusTv.setText(stringBuilder);
|
||||
if (MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode()) {
|
||||
mStatusTv.setTextColor(Color.WHITE);
|
||||
} else {
|
||||
if ( MogoApisHandler.getInstance().getApis().getAdasControllerApi()
|
||||
.getCurrentSkinMode() == EnumMapUI.Type_Light ) {
|
||||
mStatusTv.setTextColor( Color.BLACK );
|
||||
if (MogoApisHandler.getInstance().getApis().getAdasControllerApi()
|
||||
.getCurrentSkinMode() == EnumMapUI.Type_Light) {
|
||||
mStatusTv.setTextColor(Color.BLACK);
|
||||
} else {
|
||||
mStatusTv.setTextColor( Color.WHITE );
|
||||
mStatusTv.setTextColor(Color.WHITE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void showPanel( Context context ) {
|
||||
if ( mPanelView == null ) {
|
||||
mPanelView = new WindowManagerView.Builder( context )
|
||||
.contentView( R.layout.module_services_status_panel )
|
||||
.position( 0, 100 )
|
||||
.size( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT )
|
||||
.gravity( Gravity.TOP )
|
||||
public void showPanel(Context context) {
|
||||
if (mPanelView == null) {
|
||||
mPanelView = new WindowManagerView.Builder(context)
|
||||
.contentView(R.layout.module_services_status_panel)
|
||||
.position(0, 100)
|
||||
.size(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
.gravity(Gravity.TOP)
|
||||
.showInWindowManager();
|
||||
mPanelView.attachTouchEvent( ( ( view, xPos, yPos ) -> {
|
||||
closePanel();
|
||||
} ) );
|
||||
mPanelView.findViewById( R.id.module_services_status_iv ).setOnClickListener( view -> {
|
||||
closePanel();
|
||||
} );
|
||||
mStatusTv = mPanelView.findViewById( R.id.module_services_status_tv );
|
||||
mPanelView.attachTouchEvent(((view, xPos, yPos) -> closePanel()));
|
||||
mPanelView.findViewById(R.id.module_services_status_iv).setOnClickListener(view -> closePanel());
|
||||
mStatusTv = mPanelView.findViewById(R.id.module_services_status_tv);
|
||||
}
|
||||
mPanelView.show();
|
||||
mMainHandler.sendEmptyMessageDelayed( MSG, 0L );
|
||||
mMainHandler.sendEmptyMessageDelayed(MSG, 0L);
|
||||
}
|
||||
|
||||
public void closePanel() {
|
||||
if ( mPanelView != null ) {
|
||||
if (mPanelView != null) {
|
||||
mPanelView.dismiss();
|
||||
mMainHandler.removeMessages( MSG );
|
||||
mMainHandler.removeMessages(MSG);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user