优化显示逻辑

This commit is contained in:
wangcongtao
2021-03-08 10:10:22 +08:00
parent fec7879df3
commit 79638fac6f
8 changed files with 8457 additions and 47 deletions

View File

@@ -560,6 +560,7 @@ public class MockIntentHandler implements IntentHandler {
// mLocationMockHandler.sendEmptyMessageDelayed( 2, 0 );
// mLocationMockHandler.sendEmptyMessageDelayed( 21, 200 );
mLocationMockHandler.sendEmptyMessageDelayed( 3, 0L );
// mLocationMockHandler.sendEmptyMessageDelayed( 5, 0L );
break;
}
}
@@ -613,18 +614,18 @@ public class MockIntentHandler implements IntentHandler {
}
br2 = null;
}
} else if( msg.what == 21 ) {
} else if ( msg.what == 21 ) {
try {
handleMockSnapshotIntent2();
} catch (Exception e) {
} catch ( Exception e ) {
try {
br4.close();
} catch (IOException ex) {
} catch ( IOException ex ) {
ex.printStackTrace();
}
}
}else if ( msg.what == 3 ) {
} else if ( msg.what == 3 ) {
try {
handleMockAdasIntent();
} catch ( Exception e ) {
@@ -635,6 +636,17 @@ public class MockIntentHandler implements IntentHandler {
}
br3 = null;
}
} else if ( msg.what == 5 ) {
try {
handleMockAdasLocIntent();
} catch ( Exception e ) {
try {
br5.close();
} catch ( IOException ex ) {
ex.printStackTrace();
}
br5 = null;
}
}
}
};
@@ -653,7 +665,7 @@ public class MockIntentHandler implements IntentHandler {
JSONObject jo = new JSONObject( line );
MarkerServiceHandler.getApis().getMapServiceApi().getMapUIController().syncLocation2Map( jo );
Log.i( "mock-timer-loc", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
mLocationMockHandler.sendEmptyMessageDelayed( 1, 100L );
mLocationMockHandler.sendEmptyMessageDelayed( 1, 50L );
return true;
}
@@ -703,7 +715,7 @@ public class MockIntentHandler implements IntentHandler {
return false;
}
// double[] coor = CoordinateUtils.transformWgsToGcj( cloudRoadData.getLat(), cloudRoadData.getLon() );
cloudRoadData.setUuid("1_21");
cloudRoadData.setUuid( "1_21" );
// cloudRoadData.setLon( coor[0] );
// cloudRoadData.setLat( coor[1] );
allList.add( cloudRoadData );
@@ -743,4 +755,22 @@ public class MockIntentHandler implements IntentHandler {
return true;
}
private BufferedReader br5;
private boolean handleMockAdasLocIntent() throws Exception {
if ( br5 == null ) {
br5 = new BufferedReader( new InputStreamReader( AbsMogoApplication.getApp().getAssets().open( "adas-loc.txt" ) ) );
}
String line = br5.readLine();
if ( line == null ) {
throw new Exception( "end of file 3." );
}
MogoApisHandler.getInstance()
.getApis()
.getAdasControllerApi()
.mockAdasLoc( line );
mLocationMockHandler.sendEmptyMessageDelayed( 5, 50L );
return true;
}
}