|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.content.Context
android.content.ContextWrapper
android.view.ContextThemeWrapper
android.app.Activity
org.android.activityminer.app.util.SharedPreferenceChangeAwareActivity
org.android.activityminer.app.recording.AbstractRecordingActivity<AccSensorObservationDimensions>
org.android.activityminer.app.filter.FilterTestActivity
public class FilterTestActivity
A test activity for the different low pass filter types.
Nested Class Summary | |
---|---|
private class |
FilterTestActivity.StopTask
The automatic stop task. |
Field Summary | |
---|---|
private ObservableAccSensorScanner |
accScanner
The observable accelerometer scanner. |
private AbstractAccelerometerDataSource |
accSource
The accelerometer data source |
private AdaptiveLowPassFilter |
adaptiveLowPassFilter
The adaptive low pass filter. |
private FilterAxisView[] |
axisViews
The views for the raw and filtered data graphs. |
private ButterworthLowPassFilter |
bwLowPassFilter
The butterworth low pass filter. |
private int[] |
colors
Graph colors for the different filter types. |
private List<SensorObservationCutout<AccSensorObservationDimensions,Double>> |
cutOuts
The lists to store observed and filtered accelerometer samples in. |
private AtomicBoolean[] |
filterIsVisible
The filter visibility flags. |
private LowPassFilter[] |
knownFilters
The filter list. |
private LinearLayout[] |
layouts
The linear layouts holding the graph views |
private long |
maxRecordingTime
The maximum duration in milliseconds for a recording. |
private FilterTestActivity.StopTask |
stopTask
The task to stop recording. |
private TextView[] |
textViews
The etxt views with the layout labels |
Fields inherited from class android.app.Activity |
---|
DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK |
Fields inherited from interface android.content.ComponentCallbacks2 |
---|
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN |
Constructor Summary | |
---|---|
FilterTestActivity()
Constructor |
Method Summary | |
---|---|
private void |
applyFilter(FilterTypes filterType)
Method to invoke a single filter on the raw data. |
private void |
changeFilterState(FilterTypes filterType,
boolean enabled)
Does change the enabled state for a filter with the given type. |
protected long |
getCutOutSize()
Getter for the cut-out window size in milliseconds |
private Double[] |
getValuesForAxis(SensorObservationCutout<AccSensorObservationDimensions,Double> filterDataFrame,
FilterAxisView.AxisTypes axisType)
Method to get the time series data for a specific axis from a filter data frame. |
protected boolean |
onAboutToStartRecording()
Call-back method for recording start preparation. |
void |
onBetaPreferenceChange(double beta)
The handler for beta value preference changes. |
void |
onBWCutOffPreferenceChanged(double cf)
The handler for Butterworth filter cut-off frequency preference changes. |
void |
onBWFilterOrderPreferenceChanged(int order)
The handler for Butterworth filter order changes. |
protected void |
onCreate(Bundle savedInstanceState)
|
boolean |
onCreateOptionsMenu(Menu menu)
|
protected void |
onDestroy()
|
private boolean |
onEnableFilter1(boolean enabled)
Option menu handler for filter1 enabled state changes. |
private boolean |
onEnableFilter2(boolean enabled)
Option menu handler for filter2 enabled state changes. |
private boolean |
onFilterConfiguration()
Option menu handler for filter configuration. |
void |
onMinCutOffPreferenceChanged(double minCutOff)
The handler for minimum cut-off frequency preference changes. |
protected void |
onNewCutOut(SensorObservationCutout<AccSensorObservationDimensions,Double> cutOut)
Event handler for new extracted sensor observation cut-outs |
boolean |
onOptionsItemSelected(MenuItem item)
|
protected ObservableSensorScanner<AccSensorObservationDimensions,Double> |
onPrepare()
Call-back method for load preparation. |
protected void |
onRecordingStopped(boolean wasStoppedByUser,
long stopTime)
Call-back method for recording stopped post processing. |
private void |
setBeta(double beta)
Does update the beta value. |
private void |
setBWCutOffFrequency(double cf)
|
private void |
setBWFilterOrder(int order)
|
private void |
setMinCutOffFreq(double minCutOff)
Does update the minimum cut off frequency value. |
private void |
updateFilterSeries(FilterTypes filterType)
Method to recalculate the filter values for specific filter types and to update the related series in the graph views for the axis data. |
private void |
updateViewForNewSamples()
Method to update the whole view for new sample data. |
Methods inherited from class org.android.activityminer.app.recording.AbstractRecordingActivity |
---|
doStartRecording, doStopRecording, enableRecordingButton, getActualObservationTime, getLastCutout, getMinRecordingTime, getRemainingTimeForMinRecordingLength, getSampleRate, isInterestedInLimitViolations, isRecording, isRecordingButtonEnabled, onBackPressed, onConfigurationChanged, onDefaultRecordingTimeChange, onPause, postDelayed, removeCallbacks, setMinRecordingTime, startRecording |
Methods inherited from class android.view.ContextThemeWrapper |
---|
applyOverrideConfiguration, attachBaseContext, getResources, getTheme, setTheme |
Methods inherited from class android.content.Context |
---|
getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private ObservableAccSensorScanner accScanner
private AdaptiveLowPassFilter adaptiveLowPassFilter
private ButterworthLowPassFilter bwLowPassFilter
private List<SensorObservationCutout<AccSensorObservationDimensions,Double>> cutOuts
private final FilterAxisView[] axisViews
private final LinearLayout[] layouts
private final TextView[] textViews
private final int[] colors
private LowPassFilter[] knownFilters
private AtomicBoolean[] filterIsVisible
private FilterTestActivity.StopTask stopTask
private final long maxRecordingTime
private AbstractAccelerometerDataSource accSource
Constructor Detail |
---|
public FilterTestActivity()
Method Detail |
---|
protected final ObservableSensorScanner<AccSensorObservationDimensions,Double> onPrepare()
AbstractRecordingActivity
onPrepare
in class AbstractRecordingActivity<AccSensorObservationDimensions>
private final void setBWCutOffFrequency(double cf)
cf
- the cut-off frequency to setprivate final void setBWFilterOrder(int order)
order
- private final void setMinCutOffFreq(double minCutOff)
minCutOff
- the minimum cut off frequency value to set.private final void setBeta(double beta)
beta
- the beta value to set.protected final void onCreate(Bundle savedInstanceState)
onCreate
in class AbstractRecordingActivity<AccSensorObservationDimensions>
protected void onDestroy()
onDestroy
in class AbstractRecordingActivity<AccSensorObservationDimensions>
protected final boolean onAboutToStartRecording()
AbstractRecordingActivity
onAboutToStartRecording
in class AbstractRecordingActivity<AccSensorObservationDimensions>
AbstractRecordingActivity.startRecording()
Method by your own as soon as you
are ready.protected final void onRecordingStopped(boolean wasStoppedByUser, long stopTime)
AbstractRecordingActivity
onRecordingStopped
in class AbstractRecordingActivity<AccSensorObservationDimensions>
wasStoppedByUser
- flag is recording was stopped manually by the userstopTime
- the time the recording was stopped in millisecondsprivate final void updateViewForNewSamples()
private final void updateFilterSeries(FilterTypes filterType)
filterType
- the filter typeprivate final Double[] getValuesForAxis(SensorObservationCutout<AccSensorObservationDimensions,Double> filterDataFrame, FilterAxisView.AxisTypes axisType)
filterDataFrame
- the frame to retrieve time series fromaxisType
- the axis to retrieve time series for
private final void applyFilter(FilterTypes filterType)
filterType
- the filter type identifierpublic final boolean onCreateOptionsMenu(Menu menu)
onCreateOptionsMenu
in class Activity
public final boolean onOptionsItemSelected(MenuItem item)
onOptionsItemSelected
in class Activity
private final void changeFilterState(FilterTypes filterType, boolean enabled)
filterType
- the filter typeenabled
- enabled state for the filterprivate final boolean onEnableFilter2(boolean enabled)
enabled
- enabled state for the filter
private final boolean onEnableFilter1(boolean enabled)
enabled
- enabled state for the filter
private final boolean onFilterConfiguration()
public final void onBWCutOffPreferenceChanged(double cf)
SharedPreferenceChangeObserver
onBWCutOffPreferenceChanged
in interface SharedPreferenceChangeObserver
onBWCutOffPreferenceChanged
in class SharedPreferenceChangeAwareActivity
cf
- the new cut-off frequency valuepublic final void onBWFilterOrderPreferenceChanged(int order)
SharedPreferenceChangeObserver
onBWFilterOrderPreferenceChanged
in interface SharedPreferenceChangeObserver
onBWFilterOrderPreferenceChanged
in class SharedPreferenceChangeAwareActivity
order
- the new filter orderpublic final void onMinCutOffPreferenceChanged(double minCutOff)
SharedPreferenceChangeObserver
onMinCutOffPreferenceChanged
in interface SharedPreferenceChangeObserver
onMinCutOffPreferenceChanged
in class SharedPreferenceChangeAwareActivity
minCutOff
- the new minimum cut-off frequency valuepublic final void onBetaPreferenceChange(double beta)
SharedPreferenceChangeObserver
onBetaPreferenceChange
in interface SharedPreferenceChangeObserver
onBetaPreferenceChange
in class SharedPreferenceChangeAwareActivity
beta
- the new beta valueprotected void onNewCutOut(SensorObservationCutout<AccSensorObservationDimensions,Double> cutOut)
AbstractRecordingActivity
onNewCutOut
in class AbstractRecordingActivity<AccSensorObservationDimensions>
cutOut
- the new cut-outprotected long getCutOutSize()
AbstractRecordingActivity
getCutOutSize
in class AbstractRecordingActivity<AccSensorObservationDimensions>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |