-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.h
executable file
·69 lines (50 loc) · 1.36 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
// Qt
#include <QVector>
#include <QSpinBox>
#include <QLineEdit>
#include <QComboBox>
#include <QMainWindow>
// QCustomPlot
#include <qcustomplot.h>
// This
#include <SinusConfigLine.h>
// Maximum number of sinus lines
#define MAX_SINUS_LINES 5
//!
//!
class MainWindow : public QMainWindow
{
Q_OBJECT
QSplitter* mCentralWidget;
qint32 mCurrNbOfSinusConfigLines;
QComboBox* mNumberOfSinusConfigLines;
QVector<SinusConfigLine*> mSinusConfigLines;
QCustomPlot* mPlotSignal;
QCustomPlot* mPlotSamples;
QCustomPlot* mPlotFrequencies;
QDoubleSpinBox* mFreqToMesure;
QDoubleSpinBox* mFreqToSample;
QSpinBox* mNumberOfPoints;
QDoubleSpinBox* mSpectralAccurancy;
QVector<double> mSamples;
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
void updatePlotSignal();
void updatePlotSample();
void updatePlotFrequencies();
double sinVal(double x);
//! Return the greatest periodes among mSinusConfigLines
double maxSinPeriode();
//!
void sampleSignal();
private slots:
void onNumberOfSinusConfigLinesChange(const QString &text);
void onFmChange(double v);
void onFeChange(double v);
void onNChange(int v);
};
#endif // MAINWINDOW_H