OpenHantek
exporterregistry.h
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 #pragma once
4 
5 #include <QObject>
6 #include <memory>
7 #include <set>
8 #include <vector>
9 
10 // Post processing forwards
11 class Processor;
12 class PPresult;
13 
14 // Settings forwards
15 class DsoSettings;
16 namespace Dso {
17 struct ControlSpecification;
18 }
19 
20 // Exporter forwards
21 class ExporterInterface;
22 
23 class ExporterRegistry : public QObject {
24  Q_OBJECT
25  public:
27  QObject *parent = nullptr);
28 
29  // Sample input. This will proably be performed in the post processing
30  // thread context. Do not open GUI dialogs or interrupt the control flow.
31  void addRawSamples(PPresult *data);
32  void input(std::shared_ptr<PPresult> data);
33 
34  void registerExporter(ExporterInterface *exporter);
35  void setExporterEnabled(ExporterInterface *exporter, bool enabled);
36 
37  void checkForWaitingExporters();
38 
39  // Iterate over this class object
40  std::vector<ExporterInterface *>::const_iterator begin();
41  std::vector<ExporterInterface *>::const_iterator end();
42 
45  const DsoSettings *settings;
46 
47  private:
49  std::vector<ExporterInterface *> exporters;
51  std::list<ExporterInterface *> enabledExporters;
53  std::set<ExporterInterface *> waitToSaveExporters;
54 
60  bool processData(std::shared_ptr<PPresult> &data, ExporterInterface *const &exporter);
61  signals:
62  void exporterStatusChanged(const QString &exporterName, const QString &status);
63  void exporterProgressChanged();
64 };
Definition: exporterinterface.h:17
Definition: exporterregistry.h:23
Holds the settings of the program.
Definition: settings.h:16
const Dso::ControlSpecification * deviceSpecification
Device specifications.
Definition: exporterregistry.h:44
Stores the specifications of the currently connected device.
Definition: controlspecification.h:47
Definition: processor.h:5
Post processing results.
Definition: ppresult.h:31
Definition: TriggerDock.h:15