This commit is contained in:
wangcongtao
2021-04-07 16:39:23 +08:00
parent 93c3b76380
commit ef0c0e1bba
5 changed files with 43 additions and 13 deletions

View File

@@ -48,6 +48,7 @@ import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
import com.mogo.utils.storage.SharedPrefsMgr;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.BufferedReader;
@@ -840,16 +841,22 @@ public class MockIntentHandler implements IntentHandler {
}
}
List< ADASRecognizedResult > allList = new ArrayList<>();
// List< ADASRecognizedResult > allList = new ArrayList<>();
JSONArray jsonArray = new JSONArray( );
for ( BufferedReader reader : readers ) {
String line = reader.readLine();
ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class );
if ( adasRecognizedResult != null ) {
allList.add( adasRecognizedResult );
}
// ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class );
jsonArray.put( line );
// if ( adasRecognizedResult != null ) {
// allList.add( adasRecognizedResult );
// }
}
AdasRecognizedResultDrawer.getInstance().renderAdasRecognizedResult( allList );
JSONObject object = new JSONObject();
object.put( "action", "view" );
object.put( "models", jsonArray );
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized( object.toString() );
Log.i( "mock-timer-adas", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
return true;
}