public class TraceVehicleDataSource extends ContextualVehicleDataSource implements java.lang.Runnable
BaseVehicleDataSource.setCallback(SourceCallback)
function.Constructor and Description |
---|
TraceVehicleDataSource(android.content.Context context,
java.lang.String filename) |
TraceVehicleDataSource(android.content.Context context,
java.net.URI filename) |
TraceVehicleDataSource(android.content.Context context,
java.net.URI filename,
boolean loop) |
TraceVehicleDataSource(SourceCallback callback,
android.content.Context context,
java.net.URI filename)
Construct a trace data source with the given context, callback and
trace file resource URI.
|
TraceVehicleDataSource(SourceCallback callback,
android.content.Context context,
java.net.URI filename,
boolean loop) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getTag()
Return a string suitable as a tag for logging.
|
boolean |
isConnected()
Consider the trace source "connected" if it's running and at least 1
measurement was parsed successfully from the file.
|
void |
run()
While running, continuously read from the trace file and send messages
to the callback.
|
boolean |
sameFilename(java.lang.String filename) |
void |
start() |
void |
startThread(SourceCallback userCallback,
android.content.Context context) |
void |
stop()
Stop trace file playback and the playback thread.
|
java.lang.String |
toString() |
static boolean |
validatePath(java.lang.String path) |
getContext
connected, disconnected, getCallback, handleMessage, onPipelineActivated, onPipelineDeactivated, setCallback, waitForCallback
public TraceVehicleDataSource(SourceCallback callback, android.content.Context context, java.net.URI filename) throws DataSourceException
context
- the Activity or Service context, used to access the raw
trace file resource via Android.callback
- An object implementing the SourceCallback interface that
should receive data as it is received and parsed.filename
- a raw file resource URI of the format
"resource://resource_id"DataSourceException
- if no filename is specifiedpublic TraceVehicleDataSource(SourceCallback callback, android.content.Context context, java.net.URI filename, boolean loop) throws DataSourceException
DataSourceException
public TraceVehicleDataSource(android.content.Context context, java.net.URI filename) throws DataSourceException
DataSourceException
public TraceVehicleDataSource(android.content.Context context, java.lang.String filename) throws DataSourceException
DataSourceException
public TraceVehicleDataSource(android.content.Context context, java.net.URI filename, boolean loop) throws DataSourceException
DataSourceException
public boolean isConnected()
isConnected
in interface VehicleDataSource
isConnected
in class BaseVehicleDataSource
public void stop()
stop
in interface VehicleDataSource
stop
in class BaseVehicleDataSource
public void start()
public void startThread(SourceCallback userCallback, android.content.Context context)
public void run()
run
in interface java.lang.Runnable
public static boolean validatePath(java.lang.String path)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean sameFilename(java.lang.String filename)
protected java.lang.String getTag()
BaseVehicleDataSource
getTag
in class BaseVehicleDataSource