SynchroTime
|
The MainWindow class. More...
#include <mainwindow.h>
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 |
Console * | m_pConsole |
SettingsDialog * | m_pSettingsDialog |
QThread * | m_pThread |
RTC * | m_pRTC |
The MainWindow class.
The MainWindow class provides the user with interface methods for the main application window.
|
explicit |
MainWindow::MainWindow Constructor of the main application window.
parent | of 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.
MainWindow::~MainWindow | ( | ) |
MainWindow::~MainWindow Destructor in which the completion of a separate thread is checked.
References m_pThread, ui, and WAIT_FOR_STREAM.
|
privateslot |
MainWindow::about About the app.
Referenced by MainWindow().
|
privateslot |
MainWindow::aboutQt A slot for issuing information about the Qt-Framework used.
Referenced by MainWindow().
|
private |
value | of the type bool: true if connected, false if disconnected. |
References ui.
Referenced by connectRTC(), disconnectRTC(), and MainWindow().
|
protected |
MainWindow::closeEvent Handle program completion event.
Before exiting the program, the user interface parameters are automatically saved.
event | of type QCloseEvent* |
References writeSettings().
|
privateslot |
MainWindow::connectRTC Procedure for creating a separate thread for communication with a device.
References actionsTrigger(), RTC::adjustmentRequestSlot(), RTC::calibrationRequestSlot(), RTC::getData(), RTC::getRate(), handleError(), RTC::informationRequestSlot(), RTC::isConnected(), m_pConsole, m_pRTC, m_pSettingsDialog, m_pThread, RTC::portError(), Console::putData(), putRate(), RTC::resetRequestSlot(), setRegister(), RTC::setRegisterRequestSlot(), SettingsDialog::settings(), showStatusMessage(), ui, and WAIT_FOR_STREAM.
Referenced by MainWindow().
|
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().
|
privateslot |
MainWindow::handleError Slot for handling errors when communicating with a remote device.
error | of the type QString |
References disconnectRTC().
Referenced by connectRTC().
|
privateslot |
MainWindow::help slot Brief description of how to use the application.
Referenced by MainWindow().
|
privateslot |
MainWindow::putRate Displays the time of access to the device through the serial port.
rate | of the type const float |
References Settings::accessRateEnabled, m_pSettingsDialog, and SettingsDialog::settings().
Referenced by connectRTC().
|
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:
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().
|
privateslot |
MainWindow::selectConsoleFont Slot for the font selection dialog.
Selection of the console font. The default font is Monospace, 10 points.
References m_pConsole.
Referenced by MainWindow().
|
signal |
|
privateslot |
MainWindow::setRegisterSlot Slot for writing to the shift register.
References m_pRTC, and setRegister().
Referenced by MainWindow().
|
private |
MainWindow::showStatusMessage.
message |
References status.
Referenced by connectRTC(), and disconnectRTC().
|
privateslot |
MainWindow::tickClock Slot for displaying the time of day.
References clock.
Referenced by MainWindow().
|
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:
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().
|
private |
Referenced by MainWindow(), and tickClock().
|
private |
Referenced by connectRTC(), disconnectRTC(), MainWindow(), readSettings(), selectConsoleFont(), and writeSettings().
|
private |
Referenced by connectRTC(), and setRegisterSlot().
|
private |
Referenced by connectRTC(), MainWindow(), putRate(), readSettings(), and writeSettings().
|
private |
Referenced by connectRTC(), disconnectRTC(), and ~MainWindow().
|
private |
Referenced by MainWindow().
|
private |
Referenced by disconnectRTC(), and MainWindow().
|
private |
Referenced by MainWindow(), and showStatusMessage().
|
private |
Referenced by actionsTrigger(), connectRTC(), MainWindow(), and ~MainWindow().