org.android.activityminer.logic.util
Class AbstractLinearAccelerationUpdateThread<T extends Enum<T> & Dimensions>

Package class diagram package AbstractLinearAccelerationUpdateThread
java.lang.Object
  extended by java.lang.Thread
      extended by de.unikassel.android.sdcframework.util.AbstractWorkerThread
          extended by org.android.activityminer.app.util.ObservableWorkerThreadWithProgressNotification
              extended by org.android.activityminer.logic.util.AbstractLinearAccelerationUpdateThread<T>
Type Parameters:
T - the enumeration type for the dimensions
All Implemented Interfaces:
ObservableEventSource<TaskFinishedEvent>, ObserverRegistration<TaskFinishedEvent>, WorkerThread, Runnable
Direct Known Subclasses:
LinearAccelerationUpdateThread, RawRecordingDataExportThread

public abstract class AbstractLinearAccelerationUpdateThread<T extends Enum<T> & Dimensions>
extends ObservableWorkerThreadWithProgressNotification

Base type for threads in need to update the linear acceleration data by reapplying the gravitation filter.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
private  T accGXId
          Dimension id for gravitation vector x value.
private  T accGYId
          Dimension id for gravitation vector y value.
private  T accGZId
          Dimension id for gravitation vector z value.
private  T accXId
          Dimension id for x acceleration.
private  T accYId
          Dimension id for y acceleration.
private  T accZId
          Dimension id for z acceleration.
protected  Context context
          The context.
private  GravitationFilter filter
          The gravitation component filter.
protected  boolean isUseOwnLinAcc
          The flag if own accelerometer data source is activated.
private  long sampleRate
          The sample rate of the recordings.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AbstractLinearAccelerationUpdateThread(Context context, long sampleRate, RuntimeConfiguration config, AbstractFeatureFactory<T> factory, Class<? extends Activity> intentReceiver, CharSequence progressTitle)
          Constructor
 
Method Summary
protected  long updateLinearAccelerations(SensorObservationCutout<T,Double> cutOut, long lastTs)
          Linear acceleration update in a cut-out.
 
Methods inherited from class org.android.activityminer.app.util.ObservableWorkerThreadWithProgressNotification
broadcastProgress, doCleanUp, getApplicationContext, getErrorNotificationMsg, getFinalResult, getMaxProgress, getNotification, getNotificationId, getResultNotificationMsg, getTaskTitle, hasObservers, hasSucceeded, incrementAndNotifyProgress, incrementAndNotifyProgress, notify, notifyProgress, notifyProgress, registerEventObserver, removeAllObservers, setMaxProgress, unregisterEventObserver
 
Methods inherited from class de.unikassel.android.sdcframework.util.AbstractWorkerThread
doTerminate, doWork, hasTerminated, isLogging, isWorking, logMessage, run, setLogging, start, startWork, stopWork
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isUseOwnLinAcc

protected final boolean isUseOwnLinAcc
The flag if own accelerometer data source is activated.


accXId

private T extends Enum<T> & Dimensions accXId
Dimension id for x acceleration.


accYId

private T extends Enum<T> & Dimensions accYId
Dimension id for y acceleration.


accZId

private T extends Enum<T> & Dimensions accZId
Dimension id for z acceleration.


accGXId

private T extends Enum<T> & Dimensions accGXId
Dimension id for gravitation vector x value.


accGYId

private T extends Enum<T> & Dimensions accGYId
Dimension id for gravitation vector y value.


accGZId

private T extends Enum<T> & Dimensions accGZId
Dimension id for gravitation vector z value.


context

protected final Context context
The context.


filter

private final GravitationFilter filter
The gravitation component filter.


sampleRate

private final long sampleRate
The sample rate of the recordings.

Constructor Detail

AbstractLinearAccelerationUpdateThread

public AbstractLinearAccelerationUpdateThread(Context context,
                                              long sampleRate,
                                              RuntimeConfiguration config,
                                              AbstractFeatureFactory<T> factory,
                                              Class<? extends Activity> intentReceiver,
                                              CharSequence progressTitle)
Constructor

Parameters:
context - the application context
sampleRate - a the system sample rate
config - the current runtime configuration
factory - the feature factory to determine dimension entry positions
intentReceiver - the intent receiver class
progressTitle - the progress title
Method Detail

updateLinearAccelerations

protected long updateLinearAccelerations(SensorObservationCutout<T,Double> cutOut,
                                         long lastTs)
Linear acceleration update in a cut-out.

Parameters:
cutOut - the sensor observation cut-out to update linear acceleration values in
lastTs - the last timeStamp in sequence processing
Returns:
the time stamp of the last processed observation