Hotwheels-Cluster 1.2
Creation of Cluster APP for SEA:ME project.
 
Loading...
Searching...
No Matches
MileageCalculator.hpp
Go to the documentation of this file.
1
16
17#ifndef MILEAGECALCULATOR_HPP
18#define MILEAGECALCULATOR_HPP
19
20#include <QElapsedTimer>
21#include <QList>
23
29{
30public:
32 ~MileageCalculator() = default;
33 void addSpeed(float speed) override;
34 double calculateDistance() override;
35
36private:
37 QList<QPair<float, qint64>> m_speedValues;
38 QElapsedTimer m_intervalTimer;
39};
40
41#endif // MILEAGECALCULATOR_HPP
Definition of the IMileageCalculator interface.
Interface for calculating the mileage of a vehicle.
double calculateDistance() override
Calculate the distance traveled by the vehicle.
QElapsedTimer m_intervalTimer
QList< QPair< float, qint64 > > m_speedValues
void addSpeed(float speed) override
Add a speed value to the calculator.
~MileageCalculator()=default
MileageCalculator()
Construct a new MileageCalculator object.