OpenHantek
Loading...
Searching...
No Matches
exporterregistry.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2
3#pragma once
4
5#include <QObject>
6#include <memory>
7#include <set>
8#include <vector>
9
10// Post processing forwards
11class Processor;
12class PPresult;
13
14// Settings forwards
15class DsoSettings;
16namespace Dso {
18}
19
20// Exporter forwards
22
23class ExporterRegistry : public QObject {
24 Q_OBJECT
25
26 public:
28 QObject *parent = nullptr );
29
30 // Sample input. This will probably be performed in the post processing
31 // thread context. Do not open GUI dialogs or interrupt the control flow.
32 void addRawSamples( PPresult *data );
33 void input( std::shared_ptr< PPresult > data );
34
35 void registerExporter( ExporterInterface *exporter );
36 void setExporterEnabled( ExporterInterface *exporter, bool enabled );
37
39
40 // Iterate over this class object
41 std::vector< ExporterInterface * >::const_iterator begin();
42 std::vector< ExporterInterface * >::const_iterator end();
43
47
48 private:
50 std::vector< ExporterInterface * > exporters;
52 std::list< ExporterInterface * > enabledExporters;
54 std::set< ExporterInterface * > waitToSaveExporters;
55
61 bool processData( std::shared_ptr< PPresult > &data, ExporterInterface *const &exporter );
62
63 signals:
64 void exporterStatusChanged( const QString &exporterName, const QString &status );
66};
Holds the settings of the program.
Definition dsosettings.h:20
Definition exporterinterface.h:18
void exporterStatusChanged(const QString &exporterName, const QString &status)
void registerExporter(ExporterInterface *exporter)
Definition exporterregistry.cpp:37
bool processData(std::shared_ptr< PPresult > &data, ExporterInterface *const &exporter)
Definition exporterregistry.cpp:15
std::vector< ExporterInterface * > exporters
List of all available exporters.
Definition exporterregistry.h:50
const Dso::ControlSpecification * deviceSpecification
Device specifications.
Definition exporterregistry.h:45
std::list< ExporterInterface * > enabledExporters
List of exporters that collect samples at the moment.
Definition exporterregistry.h:52
void addRawSamples(PPresult *data)
Definition exporterregistry.cpp:24
std::vector< ExporterInterface * >::const_iterator begin()
Definition exporterregistry.cpp:83
ExporterRegistry(const Dso::ControlSpecification *deviceSpecification, DsoSettings *settings, QObject *parent=nullptr)
Definition exporterregistry.cpp:12
const DsoSettings * settings
Definition exporterregistry.h:46
void checkForWaitingExporters()
Definition exporterregistry.cpp:71
void setExporterEnabled(ExporterInterface *exporter, bool enabled)
Definition exporterregistry.cpp:42
void exporterProgressChanged()
void input(std::shared_ptr< PPresult > data)
Definition exporterregistry.cpp:31
std::vector< ExporterInterface * >::const_iterator end()
Definition exporterregistry.cpp:85
std::set< ExporterInterface * > waitToSaveExporters
List of exporters that wait to be called back by the user to save their work.
Definition exporterregistry.h:54
Post processing results.
Definition ppresult.h:43
Definition processor.h:7
Definition TriggerDock.h:15
Stores the specifications of the currently connected device.
Definition controlspecification.h:42