|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.drismo.logic.MonitorController
public class MonitorController
A singleton controller responsible of maintaining and controlling everything related to a monitor activity.
MonitorActivityTemplate
,
AccelerationHandler
,
LocationHandler
,
QualityRater
,
Calibration
Field Summary | |
---|---|
private AccelerationHandler |
accelerationHandler
|
private android.media.AudioManager |
AM
|
private android.content.Context |
c
|
private Calibration |
calibrator
|
private static MonitorController |
CONTROLLER
|
private int |
CURRENT_STATE
|
private LocationHandler |
locationHandler
|
private MonitorActivityTemplate |
monitorActivity
|
private int |
notifyVibrate
|
private android.content.pm.PackageManager |
PM
|
private QualityToSpeech |
qtsEngine
|
private QualityRater |
qualityRater
|
private int |
ringerVibrate
|
static int |
STATE_CALIBRATING
|
static int |
STATE_IDLE
|
static int |
STATE_MONITORING
|
private TripLogger |
tripLogger
|
Constructor Summary | |
---|---|
private |
MonitorController(android.location.LocationManager lm,
android.hardware.SensorManager sm,
android.content.Context c)
Constructor initiating all the necessary objects to control the actual monitor activity. |
Method Summary | |
---|---|
void |
cancelCalibration()
Cancels the calibration, if calibrating. |
java.lang.String |
getLogFileName()
Call this function to get the filename of the file currently beeing logged. |
void |
initiateCalibration()
Initiates the calibration. |
private void |
initiateMonitorActivity()
Initiates the monitor activity by registering it as a listener in the required handlers. |
boolean |
isMonitoring()
Check to see if we are monitoring at the moment. |
void |
onCalibrationCompleted()
This method is fired when the calibration is done, which means that we got valid yaw ,
roll and pitch angles (we successfully can rotate the acceleration). |
void |
onOffsetCalculationComplete()
This method is fired when the offset calibration is completed. |
private void |
purgeActivityListener()
Purges the monitor activity by removing it in all the required handlers. |
static MonitorController |
requestMonitorController(MonitorActivityTemplate a)
Returns the monitor controller, and set the given monitor activity as the current. |
private void |
setMonitorActivity(MonitorActivityTemplate a)
Set the new monitor activity by purging the old and initiating the new. |
void |
setUpMessenger()
Sets up the on call/sms response, based on the preferences. |
void |
startMonitoring()
Start monitoring. |
void |
stopMonitoring()
Stop monitoring. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private android.content.Context c
private static volatile MonitorController CONTROLLER
private android.content.pm.PackageManager PM
private android.media.AudioManager AM
public static final int STATE_IDLE
public static final int STATE_CALIBRATING
public static final int STATE_MONITORING
private int CURRENT_STATE
private int ringerVibrate
private int notifyVibrate
private Calibration calibrator
private AccelerationHandler accelerationHandler
private LocationHandler locationHandler
private QualityRater qualityRater
private MonitorActivityTemplate monitorActivity
private TripLogger tripLogger
private QualityToSpeech qtsEngine
Constructor Detail |
---|
private MonitorController(android.location.LocationManager lm, android.hardware.SensorManager sm, android.content.Context c)
lm
- LocationManager provided by the monitor activity.sm
- SensorManager provided by the monitor activity.c
- Application context provided by the monitor activity.requestMonitorController(com.drismo.gui.monitor.MonitorActivityTemplate)
Method Detail |
---|
public static MonitorController requestMonitorController(MonitorActivityTemplate a)
a
- The monitor activity.
private void setMonitorActivity(MonitorActivityTemplate a)
a
- The give monitor activity.private void initiateMonitorActivity()
private void purgeActivityListener()
public void initiateCalibration()
public void cancelCalibration()
public void onOffsetCalculationComplete()
CalibrationListener
roll
and pitch
angles.
onOffsetCalculationComplete
in interface CalibrationListener
public void onCalibrationCompleted()
CalibrationListener
yaw
,
roll
and pitch
angles (we successfully can rotate the acceleration).
vectors.
onCalibrationCompleted
in interface CalibrationListener
public void startMonitoring()
public void setUpMessenger()
public void stopMonitoring()
public boolean isMonitoring()
public java.lang.String getLogFileName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |