add lat lon in test panel
This commit is contained in:
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