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

Class that provides system information to the display manager. More...

#include <SystemInfoProvider.hpp>

Public Member Functions

 SystemInfoProvider (ISystemCommandExecutor *executor=nullptr)
 Constructor for the SystemInfoProvider class.
 
 ~SystemInfoProvider () override
 Destructor for the SystemInfoProvider class.
 
QString getWifiStatus (QString &wifiName) const override
 Gets the current WiFi status.
 
QString getTemperature () const override
 Gets the current temperature in degrees Celsius.
 
QString getIpAddress () const override
 Gets the current IP address of the WiFi interface.
 
- Public Member Functions inherited from ISystemInfoProvider
virtual ~ISystemInfoProvider ()=default
 

Private Attributes

ISystemCommandExecutorm_executor
 
bool m_ownExecutor
 

Detailed Description

Class that provides system information to the display manager.

Definition at line 26 of file SystemInfoProvider.hpp.

Constructor & Destructor Documentation

◆ SystemInfoProvider()

SystemInfoProvider::SystemInfoProvider ( ISystemCommandExecutor * executor = nullptr)
explicit

Constructor for the SystemInfoProvider class.

Allocates a SystemCommandExecutor if the one provided is nullptr.

Parameters
executorThe executor to use. If nullptr, a new SystemCommandExecutor is allocated.

Definition at line 25 of file SystemInfoProvider.cpp.

◆ ~SystemInfoProvider()

SystemInfoProvider::~SystemInfoProvider ( )
override

Destructor for the SystemInfoProvider class.

Deletes the executor if it was allocated by the SystemInfoProvider.

Definition at line 34 of file SystemInfoProvider.cpp.

Member Function Documentation

◆ getIpAddress()

QString SystemInfoProvider::getIpAddress ( ) const
overridevirtual

Gets the current IP address of the WiFi interface.

Returns
The current IP address as a QString. If no IP address is available, returns "No IP address".

Implements ISystemInfoProvider.

Definition at line 87 of file SystemInfoProvider.cpp.

◆ getTemperature()

QString SystemInfoProvider::getTemperature ( ) const
overridevirtual

Gets the current temperature in degrees Celsius.

Returns
The current temperature as a QString, e.g. "45.6°C". If no temperature is available, returns "N/A".

Implements ISystemInfoProvider.

Definition at line 73 of file SystemInfoProvider.cpp.

◆ getWifiStatus()

QString SystemInfoProvider::getWifiStatus ( QString & wifiName) const
overridevirtual

Gets the current WiFi status.

Parameters
wifiNameThe name of the WiFi network we are connected to, or an empty string if not connected.
Returns
The current WiFi status as a QString:
  • "Connected" if connected to a network
  • "Disconnected" if not connected to a network
  • "No interface detected" if no wlan interface is detected

Implements ISystemInfoProvider.

Definition at line 49 of file SystemInfoProvider.cpp.

Field Documentation

◆ m_executor

ISystemCommandExecutor* SystemInfoProvider::m_executor
private

Definition at line 37 of file SystemInfoProvider.hpp.

◆ m_ownExecutor

bool SystemInfoProvider::m_ownExecutor
private

Definition at line 38 of file SystemInfoProvider.hpp.


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