2018-12-29 00:46:47 +08:00
|
|
|
#pragma once
|
|
|
|
#include <array>
|
|
|
|
#include <random>
|
|
|
|
#include <chrono>
|
2022-08-25 21:17:50 +08:00
|
|
|
#include <QList>
|
2022-08-24 04:12:53 +08:00
|
|
|
#include <QMenu>
|
|
|
|
#include <QActionGroup>
|
2018-12-29 00:46:47 +08:00
|
|
|
#include "jkqtplotter/jkqtplotter.h"
|
|
|
|
|
|
|
|
|
2022-08-24 04:12:53 +08:00
|
|
|
class JKQTPXYLineGraph; // forward
|
2018-12-29 00:46:47 +08:00
|
|
|
|
2019-01-20 23:15:10 +08:00
|
|
|
class SpeedTestPlot: public JKQTPlotter {
|
2018-12-29 00:46:47 +08:00
|
|
|
Q_OBJECT
|
|
|
|
protected:
|
2022-08-24 04:12:53 +08:00
|
|
|
std::array<double, 10000> X, Y, Y2;
|
|
|
|
double dx;
|
2018-12-29 00:46:47 +08:00
|
|
|
double x0;
|
2022-08-24 04:12:53 +08:00
|
|
|
size_t NDATA;
|
2018-12-29 00:46:47 +08:00
|
|
|
std::chrono::system_clock::time_point t_lastplot;
|
2019-11-18 23:46:15 +08:00
|
|
|
QAction* actAntiAliase;
|
|
|
|
QAction* actTwoGraphs;
|
|
|
|
QAction* actFixedXAxis;
|
2022-08-24 04:12:53 +08:00
|
|
|
QAction* actLines;
|
|
|
|
QAction* actSymbols;
|
2022-08-25 21:17:50 +08:00
|
|
|
QAction* actUseNonvisibleLineCompression;
|
|
|
|
QMenu* menuUseNonvisibleLineCompressionAgressiveness;
|
|
|
|
QAction* actUseClipping;
|
|
|
|
QAction* actAnimation;
|
|
|
|
QAction* actStepAnimation;
|
2022-08-24 04:12:53 +08:00
|
|
|
QMenu* menuSizes;
|
|
|
|
JKQTPXYLineGraph* graph;
|
|
|
|
JKQTPXYLineGraph* graph2;
|
2022-08-25 21:17:50 +08:00
|
|
|
QList<double> calctimes;
|
2018-12-29 00:46:47 +08:00
|
|
|
public:
|
|
|
|
SpeedTestPlot();
|
|
|
|
|
|
|
|
virtual ~SpeedTestPlot();
|
2022-08-24 04:12:53 +08:00
|
|
|
protected slots:
|
2018-12-29 00:46:47 +08:00
|
|
|
void plotNewData();
|
2022-08-25 21:17:50 +08:00
|
|
|
void updateDataSize(size_t newSize, bool updatePlots=true);
|
|
|
|
static double addOutlier(double prob, double height);
|
2019-11-18 23:46:15 +08:00
|
|
|
|
2018-12-29 00:46:47 +08:00
|
|
|
};
|