X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=blobdiff_plain;f=Client%2Faccelerometer.cpp;h=4336b31139f1dd3f2367d60c70602c43221eec7e;hp=cba6a78fcab71d861ed49eeaeaac3f49a4838b04;hb=59a7180931986f4d9420f6b4f1beb85f078fd309;hpb=e7ab1f1b6219bf316acff1d1a3719cf1f22ec3c0 diff --git a/Client/accelerometer.cpp b/Client/accelerometer.cpp index cba6a78..4336b31 100644 --- a/Client/accelerometer.cpp +++ b/Client/accelerometer.cpp @@ -4,6 +4,7 @@ * @author Rikhard Kuutti * @author Kai Rasilainen * @author Jukka Kurttila + * @author Toni Jussila * @copyright (c) 2010 Speed Freak team * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ @@ -19,9 +20,9 @@ #define kIterations 100 /** - * Default constructor for Accelerometer class - * - */ + * Default constructor for Accelerometer class. + * + */ Accelerometer::Accelerometer() { initValues(); @@ -31,9 +32,9 @@ Accelerometer::Accelerometer() } /** - * Default destructor for Accelerometer class - * - */ + * Default destructor for Accelerometer class. + * Deletes all dynamic objects and sets them to NULL. + */ Accelerometer::~Accelerometer() { if(calibrateDialog) @@ -43,9 +44,9 @@ Accelerometer::~Accelerometer() } /** - * Init class members - * - */ + * Init class members. + * + */ void Accelerometer::initValues() { previousAccelerationX = 0; @@ -114,12 +115,12 @@ void Accelerometer::calibrate(void) } /** - * Smooths Accelerometer data by applying a low pass filter to data - * - * @param x accelerometer's x-axis input - * @param y accelerometer's y-axis input - * @param z accelerometer's z-axis input - */ + * Smooths Accelerometer data by applying a low pass filter to data. + * + * @param x accelerometer's x-axis input + * @param y accelerometer's y-axis input + * @param z accelerometer's z-axis input + */ void Accelerometer::smoothData(qreal &x, qreal &y, qreal &z) { x = (previousAccelerationX * (1 - kFilteringFactor)) + (x * kFilteringFactor); @@ -132,12 +133,12 @@ void Accelerometer::smoothData(qreal &x, qreal &y, qreal &z) } /** - * Gets the raw acceleration data from accelerometer - * - * @param x accelerometer's x-axis input - * @param y accelerometer's y-axis input - * @param z accelerometer's z-axis input - */ + * Gets the raw acceleration data from accelerometer. + * + * @param x accelerometer's x-axis input + * @param y accelerometer's y-axis input + * @param z accelerometer's z-axis input + */ void Accelerometer::getAcceleration(qreal &x, qreal &y, qreal &z) { #ifdef FROM_FILE @@ -157,30 +158,30 @@ void Accelerometer::getAcceleration(qreal &x, qreal &y, qreal &z) } /** - * Get the x calibration component - * - * @return calibrationX x calibration component - */ + * Get the x calibration component. + * + * @return calibrationX x calibration component + */ qreal Accelerometer::getCalibrationX() { return calibrationX; } /** - * Get the y calibration component - * - * @return calibrationY y calibration component - */ + * Get the y calibration component. + * + * @return calibrationY y calibration component + */ qreal Accelerometer::getCalibrationY() { return calibrationY; } /** - * Get the z calibration component - * - * @return calibrationZ z calibration component - */ + * Get the z calibration component. + * + * @return calibrationZ z calibration component + */ qreal Accelerometer::getCalibrationZ() { return calibrationZ;