adas识别模拟数据使用adas通道
This commit is contained in:
@@ -841,23 +841,25 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
}
|
||||
|
||||
// List< ADASRecognizedResult > allList = new ArrayList<>();
|
||||
JSONArray jsonArray = new JSONArray( );
|
||||
List< ADASRecognizedResult > allList = new ArrayList<>();
|
||||
for ( BufferedReader reader : readers ) {
|
||||
String line = reader.readLine();
|
||||
// ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class );
|
||||
jsonArray.put( line );
|
||||
// if ( adasRecognizedResult != null ) {
|
||||
// allList.add( adasRecognizedResult );
|
||||
// }
|
||||
ADASRecognizedResult adasRecognizedResult = GsonUtil.objectFromJson( line, ADASRecognizedResult.class );
|
||||
if ( adasRecognizedResult != null ) {
|
||||
allList.add( adasRecognizedResult );
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject object = new JSONObject();
|
||||
object.put( "action", "view" );
|
||||
object.put( "models", jsonArray );
|
||||
AdasRec adasRec = new AdasRec();
|
||||
adasRec.models = allList;
|
||||
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized( object.toString() );
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().mockAdasRecognized( GsonUtil.jsonFromObject( adasRec ) );
|
||||
Log.i( "mock-timer-adas", "cost " + ( System.currentTimeMillis() - start ) + "ms" );
|
||||
return true;
|
||||
}
|
||||
|
||||
public static class AdasRec{
|
||||
public String action = "view";
|
||||
public List<ADASRecognizedResult> models;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user