de.Android_Seminar.backend
Interface SensorConfiguration

All Known Implementing Classes:
SensorConfigurationImpl

public interface SensorConfiguration

An interface to set up some parameter for the different sensors. The parameters will be saved in a configuration file on the sd card. If there is no such file on the sd card, a new file with default values will be created. This interface can be used to prefill some fields in the GUI with the last values that where used.

Author:
jonas

Method Summary
 java.util.Map<SensorType,SampleRate> getLastSampleRates()
          Receives the last for a specified sensor.
 float getLastStartDelay()
          Receives the last start delay.
 float getLastTimeout()
           
 java.util.Set<SensorType> getLastUsedSensors()
          Receives a list of all sensors that have been used during the last recording.
 boolean getLocationSaving()
           
 boolean getTimeSaving()
           
 void setLastSampleRates(java.util.Map<SensorType,SampleRate> rates)
          Saves the last sample rate to the configuration file.
 void setLastStartDelay(float delay)
          Saves the last start delay to the configuration file.
 void setLastTimeout(float timeout)
          The timeout value determines when a data recording will stop.
 void setLastUsedSensors(java.util.Set<SensorType> sensors)
          Saves all sensors that have been used for the last recording to the configuration file.
 void setLocationSaving(boolean saving)
          determines whether the current location should be saved within an 'activity' in the xml file or not
 void setTimeSaving(boolean saving)
          determines whether the current time should be saved within an 'activity' in the xml file or not
 

Method Detail

getLastUsedSensors

java.util.Set<SensorType> getLastUsedSensors()
Receives a list of all sensors that have been used during the last recording. If the application just started, the list will be obtained from the configuration file.

Returns:
the sensors that have been used during the last recording.
See Also:
SensorType

setLastUsedSensors

void setLastUsedSensors(java.util.Set<SensorType> sensors)
Saves all sensors that have been used for the last recording to the configuration file.

Parameters:
sensors - all sensors that have been used for the last recording
See Also:
SensorType

getLastStartDelay

float getLastStartDelay()
Receives the last start delay. If the application just started, the start delay will be obtained from the configuration file.

Returns:
the last start delay time.
See Also:
SensorController#startRecording(String, String, float)

setLastStartDelay

void setLastStartDelay(float delay)
Saves the last start delay to the configuration file.

Parameters:
delay - the time the application has to wait until the recording will start after executing the SensorController#startRecording(String, String, float) method.
See Also:
SensorController#startRecording(String, String, float)

getLastSampleRates

java.util.Map<SensorType,SampleRate> getLastSampleRates()
Receives the last for a specified sensor. If the application just started, the last sample rate will be obtained from the configuration file.

Parameters:
sensor - the sensor for which the last sample rate should be returned
Returns:
the last sample rate used for specified sensor
See Also:
SensorType

setLastSampleRates

void setLastSampleRates(java.util.Map<SensorType,SampleRate> rates)
Saves the last sample rate to the configuration file.

Parameters:
rates - the sample rate and the sensor for which the last sample rate should be set
See Also:
SampleRate, SensorType

getLastTimeout

float getLastTimeout()
Returns:
the last timeout value (in seconds). This value determines when a data recording will stop. if this value is negative, the recording will never stop.

setLastTimeout

void setLastTimeout(float timeout)
The timeout value determines when a data recording will stop. if this value is negative, the recording will never stop.

Parameters:
timeout - the timeout in seconds

setLocationSaving

void setLocationSaving(boolean saving)
determines whether the current location should be saved within an 'activity' in the xml file or not

Parameters:
saving - if this is true, the location will be saved

getLocationSaving

boolean getLocationSaving()
Returns:
true, if the location will be saved, false otherwise.
See Also:
SensorController#setLocationSaving(boolean)

setTimeSaving

void setTimeSaving(boolean saving)
determines whether the current time should be saved within an 'activity' in the xml file or not

Parameters:
saving - if this is true, the time will be saved

getTimeSaving

boolean getTimeSaving()
Returns:
true, if the time will be saved, false otherwise.
See Also:
SensorController#setTimeSaving(boolean)