diff options
| author | Christoph Berg <myon@debian.org> | 2020-05-11 22:18:20 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2020-05-11 22:18:20 +0200 |
| commit | a8edac06b534058e52126c4d55e23b217df2df91 (patch) | |
| tree | f2c3567fae58aad676d544ee8f07ac78dd2eb1ec /plots/mainwindow.cpp | |
| parent | 4f6c0156a70e8f2ff70fe5a1a39f5e9b22ffd026 (diff) | |
| parent | 32a41b1abe1a4aab0892c9c2051be6ba5b379f1e (diff) | |
Update upstream source from tag 'upstream/2.2.0_rc1+repack'
Update to upstream version '2.2.0~rc1+repack'
with Debian dir fe177bc6cd2d4c1256a3775504f6010be54e7463
Diffstat (limited to 'plots/mainwindow.cpp')
| -rw-r--r-- | plots/mainwindow.cpp | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/plots/mainwindow.cpp b/plots/mainwindow.cpp deleted file mode 100644 index 775f1f35..00000000 --- a/plots/mainwindow.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "mainwindow.h" -#include "ui_mainwindow.h" -#include <QDebug> -#include <QDesktopWidget> -#include <QScreen> -#include <QMessageBox> -#include <QMetaEnum> - -#include <fstream> -#include <iostream> - -using namespace std; -#define NPTS 3456 - -MainWindow::MainWindow(QWidget *parent) : - QMainWindow(parent), - ui(new Ui::MainWindow) -{ - ui->setupUi(this); - setGeometry(400, 250, 542, 390); - - setupPlot(); -} - -MainWindow::~MainWindow() -{ - delete ui; -} - -void MainWindow::setupPlot() -{ - plotspec(ui->customPlot); - setWindowTitle("Reference Spectrum"); - statusBar()->clearMessage(); - ui->customPlot->replot(); -} - -void MainWindow::plotspec(QCustomPlot *customPlot) -{ - QVector<double> x(NPTS), y1(NPTS), y2(NPTS), y3(NPTS), y4(NPTS); - ifstream inFile; - double ymin=1.0e30; - double ymax=-ymin; - inFile.open("c:/users/joe/appdata/local/WSJT-X/refspec.dat"); - - for (int i = 0; i < NPTS; i++) { - inFile >> x[i] >> y1[i] >> y2[i] >> y3[3] >> y4[4]; - if(y2[i]>ymax) ymax=y2[i]; - if(y2[i]<ymin) ymin=y2[i]; - } - - customPlot->addGraph(); - customPlot->graph(0)->setData(x, y2); - customPlot->xAxis->setLabel("Frequency (Hz)"); - customPlot->yAxis->setLabel("Relative power (dB)"); - customPlot->xAxis->setRange(0, 6000); - customPlot->yAxis->setRange(ymin, ymax); -} |
