OpenHantek
graphgenerator.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 #pragma once
4 
5 #include <deque>
6 
7 #include <QObject>
8 #include <QVector3D>
9 
10 #include "hantekdso/enums.h"
11 #include "hantekprotocol/types.h"
12 #include "processor.h"
13 
14 struct DsoSettingsScope;
15 struct DsoSettingsView;
16 class PPresult;
17 namespace Dso {
18 struct ControlSpecification;
19 }
20 
22 class GraphGenerator : public QObject, public Processor {
23  Q_OBJECT
24 
25  public:
27 
28  private:
29  void generateGraphsTYvoltage( PPresult *result );
30  void generateGraphsTYspectrum( PPresult *result );
31  void generateGraphsXY( PPresult *result );
32 
33  bool ready = false;
36 
37  void prepareSinc( void ); // setup the sinc table used for upsampling
38  std::vector< double > sinc; // sinc function table for convolution
39  const unsigned int sincWidth = 2; // two periods
40  const unsigned int oversample = 5; // 5 time oversample
41  const unsigned int sincSize = sincWidth * oversample; // size of the table
42  std::vector< double > resample; // destination for overampled data
43 
44  // Processor interface
45  void process( PPresult *data ) override;
46 };
void generateGraphsTYspectrum(PPresult *result)
Definition: graphgenerator.cpp:187
void prepareSinc(void)
Definition: graphgenerator.cpp:39
bool ready
Definition: graphgenerator.h:33
Generates ready to be used vertex arrays.
Definition: graphgenerator.h:22
const DsoSettingsView * view
Definition: graphgenerator.h:35
std::vector< double > resample
Definition: graphgenerator.h:42
const DsoSettingsScope * scope
Definition: graphgenerator.h:34
void generateGraphsXY(PPresult *result)
Definition: graphgenerator.cpp:225
void process(PPresult *data) override
Definition: graphgenerator.cpp:53
Definition: processor.h:7
Holds all view settings.
Definition: viewsettings.h:35
const unsigned int sincSize
Definition: graphgenerator.h:41
std::vector< double > sinc
Definition: graphgenerator.h:38
const unsigned int oversample
Definition: graphgenerator.h:40
Holds the settings for the oscilloscope.
Definition: scopesettings.h:82
const unsigned int sincWidth
Definition: graphgenerator.h:39
Post processing results.
Definition: ppresult.h:37
Definition: TriggerDock.h:15
void generateGraphsTYvoltage(PPresult *result)
Definition: graphgenerator.cpp:65
GraphGenerator(const DsoSettingsScope *scope, const DsoSettingsView *view)
Definition: graphgenerator.cpp:32