SynchroTime
Signals | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
MainWindow Class Reference

The MainWindow class. More...

#include <mainwindow.h>

Inheritance diagram for MainWindow:
Inheritance graph
Collaboration diagram for MainWindow:
Collaboration graph

Signals

void setRegister (const float value)
 

Public Member Functions

 MainWindow (QWidget *parent=0)
 MainWindow::MainWindow Constructor of the main application window. More...
 
 ~MainWindow ()
 MainWindow::~MainWindow Destructor in which the completion of a separate thread is checked. More...
 

Protected Member Functions

void closeEvent (QCloseEvent *event) Q_DECL_OVERRIDE
 MainWindow::closeEvent Handle program completion event. More...
 

Private Slots

void connectRTC ()
 MainWindow::connectRTC Procedure for creating a separate thread for communication with a device. More...
 
void disconnectRTC ()
 MainWindow::disconnectRTC The procedure performs a correct disconnection from the device. More...
 
void selectConsoleFont ()
 MainWindow::selectConsoleFont Slot for the font selection dialog. More...
 
void setRegisterSlot ()
 MainWindow::setRegisterSlot Slot for writing to the shift register. More...
 
void tickClock ()
 MainWindow::tickClock Slot for displaying the time of day. More...
 
void help ()
 MainWindow::help slot Brief description of how to use the application. More...
 
void aboutQt ()
 MainWindow::aboutQt A slot for issuing information about the Qt-Framework used. More...
 
void about ()
 MainWindow::about About the app. More...
 
void putRate (const float rate)
 MainWindow::putRate Displays the time of access to the device through the serial port. More...
 
void handleError (const QString &error)
 MainWindow::handleError Slot for handling errors when communicating with a remote device. More...
 

Private Member Functions

void readSettings (void)
 MainWindow::readSettings The function reads the parameters necessary for the user interface that were saved in the previous session. More...
 
void writeSettings (void) const
 MainWindow::writeSettings The function saves the user interface parameters that have been changed by the user in the current session. More...
 
void actionsTrigger (bool value) const
 MainWindow::actionsTrigger. More...
 
void showStatusMessage (const QString &message) const
 MainWindow::showStatusMessage. More...
 

Private Attributes

Ui::MainWindow * ui
 
QLabel * rate
 
QLabel * status
 
QLCDNumber * clock
 
QTimer * m_pTimer
 
Consolem_pConsole
 
SettingsDialogm_pSettingsDialog
 
QThread * m_pThread
 
RTCm_pRTC
 

Detailed Description

The MainWindow class.

The MainWindow class provides the user with interface methods for the main application window.

Constructor & Destructor Documentation

MainWindow::MainWindow ( QWidget *  parent = 0)
explicit

MainWindow::MainWindow Constructor of the main application window.

Parameters
parentof the type QWidget

References about(), aboutQt(), actionsTrigger(), clock, connectRTC(), disconnectRTC(), SettingsDialog::fillSettingsUi(), help(), m_pConsole, m_pSettingsDialog, m_pTimer, rate, readSettings(), selectConsoleFont(), setRegisterSlot(), SettingsDialog::show(), status, tickClock(), and ui.

Here is the call graph for this function:

MainWindow::~MainWindow ( )

MainWindow::~MainWindow Destructor in which the completion of a separate thread is checked.

References m_pThread, ui, and WAIT_FOR_STREAM.

Member Function Documentation

void MainWindow::about ( )
privateslot

MainWindow::about About the app.

Referenced by MainWindow().

Here is the caller graph for this function:

void MainWindow::aboutQt ( )
privateslot

MainWindow::aboutQt A slot for issuing information about the Qt-Framework used.

Referenced by MainWindow().

Here is the caller graph for this function:

void MainWindow::actionsTrigger ( bool  value) const
private

MainWindow::actionsTrigger.

Parameters
valueof the type bool: true if connected, false if disconnected.

References ui.

Referenced by connectRTC(), disconnectRTC(), and MainWindow().

Here is the caller graph for this function:

void MainWindow::closeEvent ( QCloseEvent *  event)
protected

MainWindow::closeEvent Handle program completion event.

Before exiting the program, the user interface parameters are automatically saved.

Parameters
eventof type QCloseEvent*

References writeSettings().

Here is the call graph for this function:

void MainWindow::connectRTC ( )
privateslot
void MainWindow::disconnectRTC ( )
privateslot

MainWindow::disconnectRTC The procedure performs a correct disconnection from the device.

References actionsTrigger(), m_pConsole, m_pThread, rate, showStatusMessage(), and WAIT_FOR_STREAM.

Referenced by handleError(), and MainWindow().

Here is the call graph for this function:

Here is the caller graph for this function:

void MainWindow::handleError ( const QString &  error)
privateslot

MainWindow::handleError Slot for handling errors when communicating with a remote device.

Parameters
errorof the type QString

References disconnectRTC().

Referenced by connectRTC().

Here is the call graph for this function:

Here is the caller graph for this function:

void MainWindow::help ( )
privateslot

MainWindow::help slot Brief description of how to use the application.

Referenced by MainWindow().

Here is the caller graph for this function:

void MainWindow::putRate ( const float  rate)
privateslot

MainWindow::putRate Displays the time of access to the device through the serial port.

Parameters
rateof the type const float

References Settings::accessRateEnabled, m_pSettingsDialog, and SettingsDialog::settings().

Referenced by connectRTC().

Here is the call graph for this function:

Here is the caller graph for this function:

void MainWindow::readSettings ( void  )
private

MainWindow::readSettings The function reads the parameters necessary for the user interface that were saved in the previous session.

The following important parameters will be read as:

  • the position of the window on the screen and window size,
  • interface font and its size,
  • the user interface settings (overwrite of the data, recurse of dir's, etc.),
  • the serial port options,
  • and other additional parameters.

References Settings::accessRateEnabled, Settings::baudRate, Settings::correctionFactor, m_pConsole, m_pSettingsDialog, Settings::name, Settings::requestRate, SettingsDialog::serialPortSettings(), SETTINGS_FILE, Settings::statusControlEnabled, Settings::stringBaudRate, Settings::stringDataBits, Settings::stringFlowControl, Settings::stringParity, and Settings::stringStopBits.

Referenced by MainWindow().

Here is the call graph for this function:

Here is the caller graph for this function:

void MainWindow::selectConsoleFont ( void  )
privateslot

MainWindow::selectConsoleFont Slot for the font selection dialog.

Selection of the console font. The default font is Monospace, 10 points.

Note
The font is installed only for the console window, i.s. not for all graphic forms!

References m_pConsole.

Referenced by MainWindow().

Here is the caller graph for this function:

void MainWindow::setRegister ( const float  value)
signal

Referenced by connectRTC(), and setRegisterSlot().

Here is the caller graph for this function:

void MainWindow::setRegisterSlot ( )
privateslot

MainWindow::setRegisterSlot Slot for writing to the shift register.

References m_pRTC, and setRegister().

Referenced by MainWindow().

Here is the caller graph for this function:

void MainWindow::showStatusMessage ( const QString &  message) const
private

MainWindow::showStatusMessage.

Parameters
message

References status.

Referenced by connectRTC(), and disconnectRTC().

Here is the caller graph for this function:

void MainWindow::tickClock ( )
privateslot

MainWindow::tickClock Slot for displaying the time of day.

References clock.

Referenced by MainWindow().

Here is the caller graph for this function:

void MainWindow::writeSettings ( void  ) const
private

MainWindow::writeSettings The function saves the user interface parameters that have been changed by the user in the current session.

The following important parameters will be updated as:

  • the position of the window on the screen and window size,
  • interface font and its size,
  • the user interface settings (overwrite of the data, recurse of dir's, etc.),
  • the serial port options,
  • and other additional parameters.

References Settings::accessRateEnabled, Settings::baudRate, Settings::correctionFactor, Settings::isChanged, m_pConsole, m_pSettingsDialog, Settings::name, Settings::requestRate, SettingsDialog::settings(), SETTINGS_FILE, Settings::statusControlEnabled, Settings::stringDataBits, Settings::stringFlowControl, Settings::stringParity, and Settings::stringStopBits.

Referenced by closeEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

QLCDNumber* MainWindow::clock
private

Referenced by MainWindow(), and tickClock().

Console* MainWindow::m_pConsole
private
RTC* MainWindow::m_pRTC
private

Referenced by connectRTC(), and setRegisterSlot().

SettingsDialog* MainWindow::m_pSettingsDialog
private
QThread* MainWindow::m_pThread
private
QTimer* MainWindow::m_pTimer
private

Referenced by MainWindow().

QLabel* MainWindow::rate
private

Referenced by disconnectRTC(), and MainWindow().

QLabel* MainWindow::status
private

Referenced by MainWindow(), and showStatusMessage().

Ui::MainWindow* MainWindow::ui
private

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