OpenHantek
postprocessing.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 #pragma once
4 
5 #include "dsosamples.h"
6 #include "processor.h"
7 
8 #include <memory>
9 #include <vector>
10 
11 #include <QDebug>
12 #include <QObject>
13 #include <QThread>
14 
20 class PostProcessing : public QObject {
21  Q_OBJECT
22 
23  public:
24  explicit PostProcessing( unsigned channelCount, unsigned verboseLevel = 0 );
31  void registerProcessor( Processor *processor );
32  void stop() { processing = false; }
33 
34 
35  private:
37  const unsigned channelCount;
39  std::vector< Processor * > processors;
41  std::unique_ptr< PPresult > currentData;
42  static void convertData( const DSOsamples *source, PPresult *destination );
43  bool processing = true;
44  unsigned verboseLevel = 0;
45 
46  public slots:
52  void input( const DSOsamples *data );
53 
54  signals:
55  void processingFinished( std::shared_ptr< PPresult > result );
56 };
57 
58 Q_DECLARE_METATYPE( std::shared_ptr< PPresult > )
void stop()
Definition: postprocessing.h:32
std::unique_ptr< PPresult > currentData
Definition: postprocessing.h:41
bool processing
Definition: postprocessing.h:43
static void convertData(const DSOsamples *source, PPresult *destination)
Definition: postprocessing.cpp:15
Definition: dsosamples.h:10
Definition: postprocessing.h:20
void processingFinished(std::shared_ptr< PPresult > result)
Definition: processor.h:7
void input(const DSOsamples *data)
Definition: postprocessing.cpp:46
const unsigned channelCount
A new PPresult is created for each new input. We need to know the channel size.
Definition: postprocessing.h:37
unsigned verboseLevel
Definition: postprocessing.h:44
Post processing results.
Definition: ppresult.h:37
PostProcessing(unsigned channelCount, unsigned verboseLevel=0)
Definition: postprocessing.cpp:5
void registerProcessor(Processor *processor)
Definition: postprocessing.cpp:11
std::vector< Processor *> processors
The list of processors. Processors are not memory managed by this class.
Definition: postprocessing.h:39