mainwindow.h
865 Bytes
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QUdpSocket>
#include "../oven_control/all_share.h"
namespace Ui {
class MainWindow;
}
typedef struct {
int header;
char body[];
} STRUCT_PACK packet_t;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
QUdpSocket *sock;
oven_control_t control;
oven_state_t state;
private slots:
void readPendingDatagrams();
void processDatagram(QByteArray &datagram);
void processControl(oven_control_t *control);
void processState(oven_state_t *state);
void updateControl(oven_control_t *control);
void updateState(oven_state_t *state);
void on_pushControlButton_clicked();
void on_pushStateButton_clicked();
};
#endif // MAINWINDOW_H