Roomba App  1.0
MainWindow Class Reference

The class connecting all modules through the UI interface. More...

#include <mainwindow.hh>

Inheritance diagram for MainWindow:
Collaboration diagram for MainWindow:

Public Member Functions

 MainWindow (QWidget *parent=nullptr)
 Construct a new MainWindow object. More...
 
 ~MainWindow ()
 Destroy the MainWindow object. More...
 

Protected Member Functions

void closeEvent (QCloseEvent *event) override
 Closing event function. More...
 

Private Slots

void on_actionClose_triggered ()
 Slot triggered when the closing signal was emitted. More...
 
void on_actionDisconnect_triggered ()
 Slot triggered when the disconnecting signal was emitted. More...
 
void on_actionSearch_triggered ()
 Slot triggered when the searching signal was emitted. More...
 
void connectSerialDevice (const QString &actionName)
 Connect to the serial device. More...
 
void serialTimeout ()
 Update information read from the serial port. More...
 
void showErrorMessage (const QString &message)
 Show error message as status bar message. More...
 
void addMessageToLogs (const QString &message)
 Add a message to the logs widget. More...
 
void addValueSpeedL (const QString &message)
 Set the value of the left motor speed. More...
 
void addValueSpeedR (const QString &message)
 Set the value of the right motor speed. More...
 
void addValueGSpeedL (const QString &message)
 Set the value of the left motor given speed. More...
 
void addValueGSpeedR (const QString &message)
 Set the value of the right motor given speed. More...
 
void addValueAccelerationL (const QString &message)
 Set the value of the left motor acceleration. More...
 
void addValueAccelerationR (const QString &message)
 Set the value of the right motor acceleration. More...
 
void addValueBattery (const int message)
 Set the battery voltage value. More...
 
void setSerialStatus (const QString &message)
 Set the connection status with the serial port on the status bar. More...
 
void setObstacleCloseStatus ()
 Set the close distance status with the obstacle on the motor information widget. More...
 
void resetObstacleCloseStatus ()
 Set the normal distance status with the obstacle on the motor information widget. More...
 
void on_actionPolish_triggered ()
 Change UI language to Polish. More...
 
void on_actionEnglish_US_triggered ()
 Change UI language to English (US). More...
 

Private Member Functions

void addDropShadow (QGroupBox *group, int xOffset, int yOffset, int radius)
 Add drop shadow under given GroupBox widget. More...
 

Private Attributes

Ui::MainWindow * ui
 Pointer to all UI widgets. More...
 
Communication_communication
 Communication handle. More...
 
QTimer _serialTimer
 Serial data updating timer. More...
 
FrameThread_frameThread
 Handle for communicating on different thread. More...
 
Parser_parser
 Serial data processor. More...
 
QTranslator _translator
 Handle to translator object. More...
 

Detailed Description

Definition at line 40 of file mainwindow.hh.

Constructor & Destructor Documentation

◆ MainWindow()

MainWindow::MainWindow ( QWidget *  parent = nullptr)
Parameters
[in,out]parentPointer to the parent QWidget object.

Definition at line 29 of file mainwindow.cpp.

Here is the call graph for this function:

◆ ~MainWindow()

MainWindow::~MainWindow ( )

Deallocate all dynamic memory.

Definition at line 89 of file mainwindow.cpp.

Member Function Documentation

◆ addDropShadow()

void MainWindow::addDropShadow ( QGroupBox *  group,
int  xOffset,
int  yOffset,
int  radius 
)
private
Parameters
[in]groupThe handle of the groupbox widget to which the effect is to be added.
[in]xOffsetShadow offset on the x axis.
[in]yOffsetShadow offset on the y axis.
[in]radiusShadow radius.

Definition at line 187 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ addMessageToLogs

void MainWindow::addMessageToLogs ( const QString &  message)
privateslot
Parameters
[in]messageInfo message string.

Definition at line 180 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ addValueAccelerationL

void MainWindow::addValueAccelerationL ( const QString &  message)
privateslot

Slot linked to the signal emitted when the values read from the serial port about the value of the left motor acceleration have been processed.

Parameters
[in]messageValue of the left motor acceleration.

Definition at line 205 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ addValueAccelerationR

void MainWindow::addValueAccelerationR ( const QString &  message)
privateslot

Slot linked to the signal emitted when the values read from the serial port about the value of the right motor acceleration have been processed.

Parameters
[in]messageValue of the right motor acceleration.

Definition at line 220 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ addValueBattery

void MainWindow::addValueBattery ( const int  message)
privateslot

Slot linked to the signal emitted when the values read from the serial port about the value of the battery voltage have been processed.

Parameters
[in]messageValue of the battery voltage.

Definition at line 225 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ addValueGSpeedL

void MainWindow::addValueGSpeedL ( const QString &  message)
privateslot

Slot linked to the signal emitted when the values read from the serial port about the value of the left motor given speed have been processed.

Parameters
[in]messageValue of the left motor given speed.

Definition at line 200 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ addValueGSpeedR

void MainWindow::addValueGSpeedR ( const QString &  message)
privateslot

Slot linked to the signal emitted when the values read from the serial port about the value of the right motor given speed have been processed.

Parameters
[in]messageValue of the right motor given speed.

Definition at line 215 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ addValueSpeedL

void MainWindow::addValueSpeedL ( const QString &  message)
privateslot

Slot linked to the signal emitted when the values read from the serial port about the value of the left motor speed have been processed.

Parameters
[in]messageValue of the left motor speed.

Definition at line 195 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ addValueSpeedR

void MainWindow::addValueSpeedR ( const QString &  message)
privateslot

Slot linked to the signal emitted when the values read from the serial port about the value of the right motor speed have been processed.

Parameters
[in]messageValue of the right motor speed.

Definition at line 210 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ closeEvent()

void MainWindow::closeEvent ( QCloseEvent *  event)
overrideprotected

Reimplemented to ensure that the serial port was properly closed.

Parameters
[in]eventClosing event.

Definition at line 94 of file mainwindow.cpp.

Here is the call graph for this function:

◆ connectSerialDevice

void MainWindow::connectSerialDevice ( const QString &  actionName)
privateslot

Slot triggered when the connect signal was emmitted.

Parameters
[in]actionNameName of the action that have been clicked (action name represents device name).

Definition at line 136 of file mainwindow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_actionClose_triggered

void MainWindow::on_actionClose_triggered ( )
privateslot

Definition at line 101 of file mainwindow.cpp.

Here is the call graph for this function:

◆ on_actionDisconnect_triggered

void MainWindow::on_actionDisconnect_triggered ( )
privateslot

Definition at line 108 of file mainwindow.cpp.

Here is the call graph for this function:

◆ on_actionEnglish_US_triggered

void MainWindow::on_actionEnglish_US_triggered ( )
privateslot

Definition at line 256 of file mainwindow.cpp.

◆ on_actionPolish_triggered

void MainWindow::on_actionPolish_triggered ( )
privateslot

Definition at line 247 of file mainwindow.cpp.

◆ on_actionSearch_triggered

void MainWindow::on_actionSearch_triggered ( )
privateslot

Definition at line 114 of file mainwindow.cpp.

Here is the call graph for this function:

◆ resetObstacleCloseStatus

void MainWindow::resetObstacleCloseStatus ( )
privateslot

Definition at line 241 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ serialTimeout

void MainWindow::serialTimeout ( )
privateslot

Slot triggered when the timer run out.

Definition at line 154 of file mainwindow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setObstacleCloseStatus

void MainWindow::setObstacleCloseStatus ( )
privateslot

Definition at line 235 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ setSerialStatus

void MainWindow::setSerialStatus ( const QString &  message)
privateslot
Parameters
[in]messageSerial status message.

Definition at line 230 of file mainwindow.cpp.

Here is the caller graph for this function:

◆ showErrorMessage

void MainWindow::showErrorMessage ( const QString &  message)
privateslot
Parameters
[in]messageError message string.

Definition at line 175 of file mainwindow.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ _communication

Communication* MainWindow::_communication
private

Definition at line 219 of file mainwindow.hh.

◆ _frameThread

FrameThread* MainWindow::_frameThread
private

Definition at line 221 of file mainwindow.hh.

◆ _parser

Parser* MainWindow::_parser
private

Definition at line 222 of file mainwindow.hh.

◆ _serialTimer

QTimer MainWindow::_serialTimer
private

Definition at line 220 of file mainwindow.hh.

◆ _translator

QTranslator MainWindow::_translator
private

Definition at line 223 of file mainwindow.hh.

◆ ui

Ui::MainWindow* MainWindow::ui
private

Definition at line 218 of file mainwindow.hh.


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