Merge branch 'changes/UI'
[speedfreak] / Client / calculate.h
index 0008a87..34fcaec 100644 (file)
@@ -1,8 +1,17 @@
+/*
+ * Calculate class to process accelerometer data
+ *
+ * @author      Kai Rasilainen
+ * @copyright   (c) 2010 Speed Freak team
+ * @license     http://opensource.org/licenses/gpl-license.php GNU Public License
+ */
+
 #ifndef CALCULATE_H
 #define CALCULATE_H
 
 #include <QObject>
 #include <QTime>
+#include <QList>
 
 class Calculate : public QObject
 {
@@ -13,34 +22,44 @@ public:
     ~Calculate();
 
     void reset();
-    void CalculateParameters(double currentAcceleration, double seconds);
+    void calculateParameters(double currentAcceleration, double seconds);
+    void accelStoppedCheck(double currentAcceleration);
+
+    double getAverageSpeed();
+    void setAverageSpeed(double value);
+
+    double getCurrentSpeed();
+    void setCurrentSpeed(double value);
 
-    double AverageSpeed();
-    void AverageSpeed(double value);
+    double getDistanceTraveled();
+    void setDistanceTraveled(double value);
 
-    double CurrentSpeed();
-    void CurrentSpeed(double value);
+    double getLastAcceleration();
+    void setLastAcceleration(double value);
 
-    double DistanceTraveled();
-    void DistanceTraveled(double value);
+    double getLastCheckpoint();
+    void setLastCheckpoint(double value);
 
-    double LastAcceleration();
-    void LastAcceleration(double value);
+    double getLastDistance();
+    void setLastDistance(double value);
 
-    double LastCheckpoint();
-    void LastCheckpoint(double value);
+    double getLastSpeed();
+    void setLastSpeed(double value);
 
-    double LastDistance();
-    void LastDistance(double value);
+    long getNumOfIterations();
+    void setNumOfIterations(long value);
 
-    double LastSpeed();
-    void LastSpeed(double value);
+    double getTotalTime();
+    void setTotalTime(double value);
 
-    long NumOfIterations();
-    void NumOfIterations(long value);
+    double getCurrentPower();
+    void setCurrentPower(double value);
 
-    double TotalTime();
-    void TotalTime(double value);
+    double getPeakPower();
+    void setPeakPower(double value);
+
+    double getAveragePower();
+    void setAveragePower(double value);
 
 private:
     double averageSpeed;
@@ -52,7 +71,14 @@ private:
     double lastSpeed;
     long numOfIterations;
     double totalTime;
-
+    int count;
+    double peakPower;
+    double currentPower;
+    double averagePower;
+    QList<int> speedCheckPoints;
+
+signals:
+    void checkPointReached(double totalTime, double currentSpeed);
 
 };