-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
91 lines (76 loc) · 1.79 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QFileSystemWatcher>
#include <QDebug>
#include <QObject>
namespace Ui {
class MainWindow;
}
class q_num : public QObject
{
Q_OBJECT
Q_PROPERTY( int value READ getValue WRITE setValue NOTIFY valueChanged )
public:
explicit q_num( QObject* parent = nullptr ) :
QObject{ parent }, i_{ 0 } {}
virtual ~q_num() {}
int getValue() const { return i_; }
public slots:
void setValue( int value )
{
if ( value != i_ ) {
i_ = value;
emit valueChanged( i_ );
}
}
signals:
void valueChanged( int value );
private:
int i_;
};
class q_bool : public QObject
{
Q_OBJECT
Q_PROPERTY( bool value READ getValue WRITE setValue NOTIFY valueChanged )
public:
explicit q_bool( QObject* parent = nullptr ) :
QObject{ parent }, i_{ 0 } {}
virtual ~q_bool() {}
int getValue() const { return i_; }
public slots:
void setValue( bool value )
{
if ( value != i_ ) {
i_ = value;
emit valueChanged( i_ );
}
}
signals:
void valueChanged( bool value );
private:
int i_;
};
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
public slots:
void readplatformbat();
void readplatformforward();
void readplatformbackward();
void readplatformcw();
void readplatformccw();
private slots:
void on_debugButton_clicked();
private:
Ui::MainWindow *ui;
q_num *platform_bat;
q_bool *platform_forward;
q_bool *platform_backward;
q_bool *platform_cw;
q_bool *platform_ccw;
};
#endif // MAINWINDOW_H