-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
133 lines (112 loc) · 3.09 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
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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <qfile.h>
#include "versiondialog.h"
#include "resultwindow.h"
#include "readmeweb.h"
#include <QtCharts/QChartGlobal>
#include <QComboBox>
#include <QtWidgets/QFormLayout>
#include <QtWidgets/QGridLayout>
QT_BEGIN_NAMESPACE
class QComboBox;
class QCheckBox;
QT_END_NAMESPACE
QT_CHARTS_BEGIN_NAMESPACE
class QChartView;
class QChart;
QT_CHARTS_END_NAMESPACE
QT_CHARTS_USE_NAMESPACE
#define MAX_DIV_PLAYBACK_NUM 500
#define DATA_RAW_MAX 5000
namespace Ui {
class MainWindow;
}
enum {
AXISX_USE_TIME,
AXISX_USE_PTS,
};
enum {
AXISY_NONE,
AXISY_CK_KEEP,
AXISY_IN_PTS,
AXISY_OUT_PTS,
AXISY_AUD_IN_PTS,
AXISY_AUD_OUT_PTS,
AXISY_DMS_FLIP,
AXISY_RENDER_FRAME,
AXISY_SHOW_PTS,
};
/*
* TODO: omx's get and push msg
*/
static const struct {
const int num;
const char *name;
const char *searchWord;
const char *searchWord2;
} ptsTypeTable[] = {
{ AXISY_NONE, "NONE", "NONE", NULL },
{ AXISY_CK_KEEP, "ck_keep", "ck_keep, pts:", NULL },
{ AXISY_IN_PTS, "in_pts", " in_pts:", NULL },
{ AXISY_OUT_PTS, "out_pts", " out_pts:", NULL },
{ AXISY_AUD_IN_PTS, "aud_in_pts", " aud_in_pts: ", NULL },
{ AXISY_AUD_OUT_PTS, "aud_out_pts", " aud_out_pts: ", NULL },
{ AXISY_DMS_FLIP, "dms_flip", " dms_flip [", " pts = " },
{ AXISY_RENDER_FRAME, "render_frame", "render_frame ", " pts = " },
{ AXISY_SHOW_PTS, "showInPts", "showPts", NULL },
};
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_actionABOUT_triggered();
void on_fileOpenButton_clicked();
void on_startButton_clicked();
void on_outResultButton_clicked();
void on_inDataButton_clicked();
void on_outDiagramButton_clicked();
private Q_SLOTS:
void freshChartsUI();
void on_actionREADME_triggered();
private:
//私有的class 变量命名之前要加m_prfix
//布尔型变量建议不要使用否定定义 bFound // SUGGESTED
//common words 禁止缩写 comp instead of compute
//get/set, add/remove, create/destroy, start/stop, insert/delete
Ui::MainWindow *ui;
VersionDialog *verDlg;
resultWindow *keywordWin;
resultWindow *rltWin;
ReadMeWeb *readMeWin;
QWidget *chartsWin;
QFile logFile;
QFile keyWordFile;
QFile playbackLogFile[MAX_DIV_PLAYBACK_NUM];
bool bLogNoError[MAX_DIV_PLAYBACK_NUM];
QString strResult;
int intPlayTime;
QComboBox *axisX;
QComboBox *axisY;
QComboBox *axisY2;
QComboBox *axisY3;
QChartView *ptsChartView;
QGridLayout *baseLayout;
QHBoxLayout *settingsLayout;
QPushButton *btn;
bool openLogFile();
bool openKeywordXML();
bool playbackIntegrityCheck(QFile *logFile, int playbackNo, int allPlayTime);
bool analyzeLogFile();
int getLogPtsData(int data[][2], const int ptsType);
QChart *createLineChart();
void showDiagram();
long long logTimeConvertMs(const QString logTimeStr);
void initCharts();
void clearAllStatus();
};
#endif // MAINWINDOW_H