-
Notifications
You must be signed in to change notification settings - Fork 2
/
hydratooldialog.h
142 lines (99 loc) · 3.24 KB
/
hydratooldialog.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#ifndef HYDRATOOLDIALOG_H
#define HYDRATOOLDIALOG_H
#include <QtCore/QtGlobal>
#include <QDialog>
#include <QtSerialPort/QSerialPort>
#include <QSemaphore>
#include <QTime>
#include <QTimer>
#include <QDockWidget>
#include "console.h"
#include "settingsdialog.h"
#include "terminaldialog.h"
#include "directdiskdialog.h"
#include "sniff/sniff.h"
namespace Ui {
class hydratooldialog;
}
#define SETTINGS_FILENAME "hydratool.ini"
#define TEMP_STRING_LEN (65536*3)
class hydratooldialog : public QDialog
{
Q_OBJECT
public:
explicit hydratooldialog(QWidget *parent = 0,
QDockWidget *dockwidget_hydratool_directdisk = 0,
QDockWidget *dockwidget_terminal_directdisk = 0,
QDockWidget *dockwidget_terminal = 0,
QDockWidget *dockwidget_find = 0);
~hydratooldialog();
private slots:
void hideEvent(QHideEvent* event);
void reject();
void openSerialPort();
void closeSerialPort();
void readData();
void handleError(QSerialPort::SerialPortError error);
void on_actionHex_toggled(bool arg1);
void on_actionClear_triggered();
void on_actionAutoScroll_toggled(bool arg1);
void on_actionAscii_toggled(bool arg1);
void on_actionRaw_toggled(bool arg1);
void on_actionPCdateTime_toggled(bool arg1);
void settings_hide(bool change_settings);
void on_loadFile_clicked();
void on_saveFile_clicked();
void terminal_getData(const QString &text_data);
void on_historyDepthLines_returnPressed();
void serialport_timer_update();
void on_actionChanTerminal_triggered();
void on_actionResync_triggered();
void on_actionConnectDisconnect();
void on_saveDirectToDisk_clicked();
void on_findValue_returnPressed();
void on_findPredefBox_currentIndexChanged(int index);
void on_findLiveRefreshCheckBox_clicked(bool checked);
private:
void readSettings();
void writeSettings();
void initActionsConnections();
void raw_data(void);
void sniff_trace(QIODevice *stream, int decode_nb_frames);
private:
Ui::hydratooldialog *ui;
QPlainTextEdit *console_find; /* console_search */
/* Extern qdockWidget */
QDockWidget *dockwidget_hydratool_directdisk_ext;
QDockWidget *dockwidget_terminal_directdisk_ext;
QDockWidget *dockwidget_find_ext;
QDockWidget *dockwidget_terminal_ext;
Console *console;
SettingsDialog *settingsCom;
QSerialPort *serial;
QSerialPortInfo *serialinfo;
TerminalDialog *terminal_chan;
DirectDiskDialog *directdisk;
t_sniff_frame_state sniff_frame_state;
t_sniff_frame sniff_frame;
QByteArray qb_data;
bool TraceIniEnabled;
bool SYSEnabled;
bool RawEnabled;
bool PCdateTimeEnabled;
bool AsciiEnabled;
bool HexEnabled;
bool AutoScrollEnabled;
char temp_string[TEMP_STRING_LEN+1];
QString loadfile_path;
QString savefile_path;
QSemaphore sem;
bool itsOkToClose;
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 findLiveRefresh;
QString findText;
};
#endif // HYDRATOOLDIALOG_H