-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathterminaldialog.h
103 lines (76 loc) · 2.35 KB
/
terminaldialog.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
92
93
94
95
96
97
98
99
100
101
102
103
#ifndef TERMINALDIALOG_H
#define TERMINALDIALOG_H
#include <QDialog>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include <QSemaphore>
#include <QTimer>
#include <QDockWidget>
#include "settingsdialog.h"
#include "directdiskdialog.h"
namespace Ui {
class TerminalDialog;
}
class TerminalDialog : public QDialog
{
Q_OBJECT
public:
explicit TerminalDialog(QWidget *parent = 0);
~TerminalDialog();
void txData(const QString &text_data);
void displayData(const QString &data_string);
void clear(void);
Qt::CheckState PCdateTimeCheckState(void);
void setPCdateTimeCheckState(Qt::CheckState checked);
private slots:
void hideEvent(QHideEvent* event);
void reject();
void openSerialPort();
void closeSerialPort();
void raw_data();
void rxData();
void handleError(QSerialPort::SerialPortError error);
void settings_hide(bool change_settings);
void on_clearButton_clicked();
void on_saveButton_clicked();
void on_lineEdit_lineExecuted(QString text);
void on_checkBoxPCdateTime_clicked(bool checked);
void on_lineEdit_returnPressed();
void keyPressEvent(QKeyEvent *e);
void on_ConfigureButton_clicked();
void on_actionConnect_clicked(bool checked);
void serialport_timer_update();
void on_saveDirectToDisk_clicked();
void on_checkBoxHexAsc_clicked(bool checked);
void on_sendFileButton_clicked();
private:
Ui::TerminalDialog *ui;
SettingsDialog *settingsCom;
QSerialPort *serial;
QSerialPortInfo *serialinfo;
DirectDiskDialog *directdisk;
/* Extern qdockWidget */
QDockWidget *dockwidget_directdisk_ext;
QString savefile_path;
QString lineEdit_text;
bool PCdateTimeEnabled;
QString FullTextLine;
QSemaphore sem;
QTimer serialport_timer;
QSemaphore serialport_timer_sem;
unsigned long serialport_nb_bytes_tx;
unsigned long serialport_nb_bytes_rx;
unsigned long serialport_nb_packets_rx;
bool AutoScrollEnabled;
bool itsOkToClose;
bool HexAscii;
QString loadfile_path;
private:
void readSettings();
void writeSettings();
bool readBase(const char * str, int * value, int base, int size);
int convExtendedToString(const char* str_in, char* str_out, int str_in_len);
signals:
void getData(const QString text_data);
};
#endif // TERMINALDIALOG_H