SynchroTime
mainwindow.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // Home Office
3 // Nürnberg, Germany
4 // E-Mail: sergej1@email.ua
5 //
6 // Copyright (C) 2020 free Project SynchroTime RTC DS3231. All rights reserved.
7 //------------------------------------------------------------------------------
8 // Project SynchroTime: Command-line client for adjust the exact time and
9 // calibrating the RTC DS3231 module via the serial interface (UART).
10 //------------------------------------------------------------------------------
11 #ifndef MAINWINDOW_H
12 #define MAINWINDOW_H
13 
14 //------------------------------------------------------------------------------
15 // Includes
16 //------------------------------------------------------------------------------
17 #include <QMainWindow>
18 
19 //------------------------------------------------------------------------------
20 // Preprocessor
21 //------------------------------------------------------------------------------
22 
23 //------------------------------------------------------------------------------
24 // Enums
25 //------------------------------------------------------------------------------
26 
27 //------------------------------------------------------------------------------
28 // Types
29 //------------------------------------------------------------------------------
30 class Console;
31 class SettingsDialog;
32 class QLCDNumber;
33 class QLabel;
34 class QThread;
35 class QTimer;
36 class RTC;
37 
38 namespace Ui {
39 class MainWindow;
40 }
41 
47 class MainWindow : public QMainWindow
48 {
49  Q_OBJECT
50 
51 public:
52  explicit MainWindow(QWidget *parent = 0);
53  ~MainWindow();
54 
55 signals:
56  void setRegister( const float value );
57 
58 protected:
59  void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
60 
61 private slots:
62  void connectRTC();
63  void disconnectRTC();
64  void selectConsoleFont();
65  void setRegisterSlot();
66  void tickClock();
67  void help();
68  void aboutQt();
69  void about();
70 
71  void putRate( const float rate );
72  void handleError( const QString &error );
73 
74 private:
75  Ui::MainWindow *ui;
76  QLabel *rate;
77  QLabel *status;
78  QLCDNumber *clock;
79  QTimer *m_pTimer;
82  // RTC and a separate thread in which it will work.
83  QThread *m_pThread;
85 
86  void readSettings( void );
87  void writeSettings( void ) const;
88  void actionsTrigger( bool value ) const;
89  void showStatusMessage(const QString &message) const;
90 };
91 
92 #endif // MAINWINDOW_H
Ui::MainWindow * ui
Definition: mainwindow.h:75
SettingsDialog * m_pSettingsDialog
Definition: mainwindow.h:81
QLabel * rate
Definition: mainwindow.h:76
The Console class.
Definition: console.h:36
Definition: mainwindow.h:38
RTC * m_pRTC
Definition: mainwindow.h:84
Console * m_pConsole
Definition: mainwindow.h:80
QLCDNumber * clock
Definition: mainwindow.h:78
QThread * m_pThread
Definition: mainwindow.h:83
The SettingsDialog class.
Definition: settingsdialog.h:43
QTimer * m_pTimer
Definition: mainwindow.h:79
QLabel * status
Definition: mainwindow.h:77
The MainWindow class.
Definition: mainwindow.h:47
The RTC class.
Definition: rtc.h:70