Hotwheels-Cluster 1.2
Creation of Cluster APP for SEA:ME project.
 
Loading...
Searching...
No Matches
VehicleDataManager Class Reference

Class that manages the data received from the car's systems. QObject. More...

#include <VehicleDataManager.hpp>

Public Slots

void handleRpmData (int rawRpm)
 Handle Rotation Per Minute data.
 
void handleSpeedData (float rawSpeed)
 Handle Speed data.
 
void handleDirectionData (CarDirection rawDirection)
 Handle Direction data.
 
void handleSteeringData (int rawAngle)
 Handle Steering data.
 
void handleMileageUpdate (double mileage)
 Handle mileage data.
 

Signals

void canDataProcessed (float processedSpeed, int processedRpm)
 
void engineDataProcessed (CarDirection processedDirection, int processedAngle)
 
void mileageUpdated (double mileage)
 

Public Member Functions

 VehicleDataManager (QObject *parent=nullptr)
 Construct a new VehicleDataManager::VehicleDataManager object.
 
 ~VehicleDataManager ()
 Destroy the VehicleDataManager::VehicleDataManager object.
 

Private Attributes

float m_speed = 0.0f
 
int m_rpm = 0
 
CarDirection m_carDirection = CarDirection::Stop
 
int m_steeringDirection = 0
 
double m_mileage = 0.0
 
ClusterMetrics m_clusterMetrics = ClusterMetrics::Kilometers
 

Detailed Description

Class that manages the data received from the car's systems. QObject.

Definition at line 27 of file VehicleDataManager.hpp.

Constructor & Destructor Documentation

◆ VehicleDataManager()

VehicleDataManager::VehicleDataManager ( QObject * parent = nullptr)
explicit

Construct a new VehicleDataManager::VehicleDataManager object.

Parameters
parentThe parent QObject.

This constructor initializes the VehicleDataManager object.

Definition at line 24 of file VehicleDataManager.cpp.

◆ ~VehicleDataManager()

VehicleDataManager::~VehicleDataManager ( )

Destroy the VehicleDataManager::VehicleDataManager object.

This destructor cleans up the resources used by the VehicleDataManager.

Definition at line 32 of file VehicleDataManager.cpp.

Member Function Documentation

◆ canDataProcessed

void VehicleDataManager::canDataProcessed ( float processedSpeed,
int processedRpm )
signal
Here is the caller graph for this function:

◆ engineDataProcessed

void VehicleDataManager::engineDataProcessed ( CarDirection processedDirection,
int processedAngle )
signal
Here is the caller graph for this function:

◆ handleDirectionData

void VehicleDataManager::handleDirectionData ( CarDirection rawDirection)
slot

Handle Direction data.

Parameters
rawDirectionThe raw direction data.

This function processes the direction data by updating the internal direction value and emitting an engineDataProcessed signal if the value has changed.

See also
VehicleDataManager::engineDataProcessed

Definition at line 90 of file VehicleDataManager.cpp.

Here is the call graph for this function:

◆ handleMileageUpdate

void VehicleDataManager::handleMileageUpdate ( double mileage)
slot

Handle mileage data.

Parameters
mileageThe mileage data.

This function processes the mileage data by updating the internal mileage value and emitting a mileageUpdated signal if the value has changed.

See also
VehicleDataManager::mileageUpdated

Definition at line 74 of file VehicleDataManager.cpp.

Here is the call graph for this function:

◆ handleRpmData

void VehicleDataManager::handleRpmData ( int rawRpm)
slot

Handle Rotation Per Minute data.

Parameters
rawRpmThe raw rotation per minute data.

This function processes the RPM data by forwarding it to the canDataProcessed signal.

See also
VehicleDataManager::canDataProcessed

Definition at line 42 of file VehicleDataManager.cpp.

Here is the call graph for this function:

◆ handleSpeedData

void VehicleDataManager::handleSpeedData ( float rawSpeed)
slot

Handle Speed data.

Parameters
rawSpeedThe raw speed data.

This function processes the speed data by forwarding it to the canDataProcessed signal. The speed data is converted to the current cluster metrics (either kilometers or miles).

See also
VehicleDataManager::canDataProcessed
VehicleDataManager::setClusterMetrics

Definition at line 57 of file VehicleDataManager.cpp.

Here is the call graph for this function:

◆ handleSteeringData

void VehicleDataManager::handleSteeringData ( int rawAngle)
slot

Handle Steering data.

Parameters
rawAngleThe raw steering angle data.

This function processes the steering data by updating the internal steering direction value and emitting an engineDataProcessed signal if the value has changed.

See also
VehicleDataManager::engineDataProcessed

Definition at line 107 of file VehicleDataManager.cpp.

Here is the call graph for this function:

◆ mileageUpdated

void VehicleDataManager::mileageUpdated ( double mileage)
signal
Here is the caller graph for this function:

Field Documentation

◆ m_carDirection

CarDirection VehicleDataManager::m_carDirection = CarDirection::Stop
private

Definition at line 50 of file VehicleDataManager.hpp.

◆ m_clusterMetrics

ClusterMetrics VehicleDataManager::m_clusterMetrics = ClusterMetrics::Kilometers
private

Definition at line 53 of file VehicleDataManager.hpp.

◆ m_mileage

double VehicleDataManager::m_mileage = 0.0
private

Definition at line 52 of file VehicleDataManager.hpp.

◆ m_rpm

int VehicleDataManager::m_rpm = 0
private

Definition at line 49 of file VehicleDataManager.hpp.

◆ m_speed

float VehicleDataManager::m_speed = 0.0f
private

Definition at line 48 of file VehicleDataManager.hpp.

◆ m_steeringDirection

int VehicleDataManager::m_steeringDirection = 0
private

Definition at line 51 of file VehicleDataManager.hpp.


The documentation for this class was generated from the following files: