Hotwheels-Cluster 1.2
Creation of Cluster APP for SEA:ME project.
 
Loading...
Searching...
No Matches
VehicleDataManager.cpp
Go to the documentation of this file.
1
15
17#include <QtMath>
18
25 : QObject(parent)
26{}
27
33
34
43{
44 m_rpm = rawRpm;
45 emit canDataProcessed(m_speed, rawRpm);
46}
47
58{
59 float processedSpeed = rawSpeed;
61 processedSpeed *= 0.621371f;
62 }
63 m_speed = processedSpeed;
64 emit canDataProcessed(processedSpeed, m_rpm);
65}
66
75{
76 if (!qFuzzyCompare(m_mileage, mileage)) {
77 m_mileage = mileage;
79 }
80}
81
91{
92 if (m_carDirection != rawDirection) {
93 m_carDirection = rawDirection;
94 emit engineDataProcessed(rawDirection, m_steeringDirection);
95 }
96}
97
98
108{
109 if (m_steeringDirection != rawAngle) {
110 m_steeringDirection = rawAngle;
111 emit engineDataProcessed(m_carDirection, rawAngle);
112 }
113}
Definition of the VehicleDataManager class.
CarDirection
Enum class for the car direction.
Definition enums.hpp:30
void handleRpmData(int rawRpm)
Handle Rotation Per Minute data.
void handleSteeringData(int rawAngle)
Handle Steering data.
void canDataProcessed(float processedSpeed, int processedRpm)
void engineDataProcessed(CarDirection processedDirection, int processedAngle)
void handleSpeedData(float rawSpeed)
Handle Speed data.
~VehicleDataManager()
Destroy the VehicleDataManager::VehicleDataManager object.
ClusterMetrics m_clusterMetrics
void handleDirectionData(CarDirection rawDirection)
Handle Direction data.
VehicleDataManager(QObject *parent=nullptr)
Construct a new VehicleDataManager::VehicleDataManager object.
void handleMileageUpdate(double mileage)
Handle mileage data.
void mileageUpdated(double mileage)