|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectandroid.os.AsyncTask<Void,Integer,Long>
org.android.activityminer.app.util.MaximumSampleFrequencyDeterminationTask
public class MaximumSampleFrequencyDeterminationTask
The asynchronous task for determination of the maximum sample frequency.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class android.os.AsyncTask |
|---|
AsyncTask.Status |
| Field Summary | |
|---|---|
private AbstractAccelerometerDataSource |
accelerometerDevice
The accelerometer device. |
private long |
bestRate
The old frequency value. |
private RuntimeConfiguration |
config
The runtime configuration to use. |
private Context |
context
The activity context. |
private GenericObservableCutoutCreator<SensorObservationDimensions,Double> |
cutoutCreator
The cut-out creator. |
private List<SensorObservationCutout<SensorObservationDimensions,Double>> |
cutoutList
The list to hold the observed cut-outs. |
private DeviceManager |
deviceManager
The device manager |
private EventObserver<TaskFinishedEvent> |
finishedObserver
The finished observer to be notified for success. |
private ProgressDialog |
progressDialog
The progress dialog. |
private ObservableSensorScanner<SensorObservationDimensions,Double> |
sensorScanner
The sensor scanner to use. |
private static int |
TEST_REPEATION_COUNT
The count of repetitive test runs, where the maximum sample frequency is averaged for. |
| Fields inherited from class android.os.AsyncTask |
|---|
SERIAL_EXECUTOR, THREAD_POOL_EXECUTOR |
| Constructor Summary | |
|---|---|
private |
MaximumSampleFrequencyDeterminationTask(Context context,
RuntimeConfiguration config,
EventObserver<TaskFinishedEvent> finishedObserver,
DeviceManager deviceManager)
Constructor |
| Method Summary | |
|---|---|
static void |
createAndRunTask(Context context,
RuntimeConfiguration config,
EventObserver<TaskFinishedEvent> finishedObserver)
Does create and execute a the asynchronous task in the given context. |
protected Long |
doInBackground(Void... params)
|
void |
execute()
An execution wrapper. |
private void |
notify(boolean success)
Notification method. |
private void |
notifyForResult(long result)
Does notify the user about the result. |
void |
onEvent(ObservableEventSource<? extends SensorObservationCutout<SensorObservationDimensions,Double>> eventSource,
SensorObservationCutout<SensorObservationDimensions,Double> observedEvent)
|
protected void |
onPostExecute(Long result)
|
protected void |
onPreExecute()
|
private void |
saveResult(long sampleRate)
Does save the resulting sample rate to the preferences. |
| Methods inherited from class android.os.AsyncTask |
|---|
cancel, execute, execute, executeOnExecutor, get, get, getStatus, isCancelled, onCancelled, onCancelled, onProgressUpdate, publishProgress |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int TEST_REPEATION_COUNT
private ProgressDialog progressDialog
private final Context context
private final RuntimeConfiguration config
private final EventObserver<TaskFinishedEvent> finishedObserver
private ObservableSensorScanner<SensorObservationDimensions,Double> sensorScanner
private final GenericObservableCutoutCreator<SensorObservationDimensions,Double> cutoutCreator
private final List<SensorObservationCutout<SensorObservationDimensions,Double>> cutoutList
private long bestRate
private AbstractAccelerometerDataSource accelerometerDevice
private final DeviceManager deviceManager
| Constructor Detail |
|---|
private MaximumSampleFrequencyDeterminationTask(Context context,
RuntimeConfiguration config,
EventObserver<TaskFinishedEvent> finishedObserver,
DeviceManager deviceManager)
context - the application contextconfig - the runtime configurationfinishedObserver - the finished observerdeviceManager - the device manager to use| Method Detail |
|---|
protected final void onPreExecute()
onPreExecute in class AsyncTask<Void,Integer,Long>protected final void onPostExecute(Long result)
onPostExecute in class AsyncTask<Void,Integer,Long>private void notifyForResult(long result)
result - the resultprivate void notify(boolean success)
success - success stateprivate final void saveResult(long sampleRate)
sampleRate - the sample rateprotected final Long doInBackground(Void... params)
doInBackground in class AsyncTask<Void,Integer,Long>public final void execute()
public static final void createAndRunTask(Context context,
RuntimeConfiguration config,
EventObserver<TaskFinishedEvent> finishedObserver)
context - the context of the callerconfig - the runtime configuration to usefinishedObserver - the finished event observer
public void onEvent(ObservableEventSource<? extends SensorObservationCutout<SensorObservationDimensions,Double>> eventSource,
SensorObservationCutout<SensorObservationDimensions,Double> observedEvent)
onEvent in interface EventObserver<SensorObservationCutout<SensorObservationDimensions,Double>>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||