OpenHantek
mainwindow.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 
3 #pragma once
4 #include "iconfont/QtAwesome.h"
5 #include "post/ppresult.h"
6 #include <QElapsedTimer>
7 #include <QLineEdit>
8 #include <QMainWindow>
9 #include <memory>
10 
11 #include "scopesettings.h"
12 
13 class SpectrumGenerator;
14 class HantekDsoControl;
15 class DsoSettings;
16 class ExporterRegistry;
17 class DsoWidget;
18 class HorizontalDock;
19 class TriggerDock;
20 class SpectrumDock;
21 class VoltageDock;
22 
23 namespace Ui {
24 class MainWindow;
25 }
26 
30 class MainWindow : public QMainWindow {
31  Q_OBJECT
32 
33  public:
35  QWidget *parent = nullptr );
36  ~MainWindow() override;
37  QElapsedTimer elapsedTime;
38 
39  public slots:
40  void showNewData( std::shared_ptr< PPresult > newData );
41  void exporterStatusChanged( const QString &exporterName, const QString &status );
43 
44  protected:
45  void closeEvent( QCloseEvent *event ) override;
46 
47  private:
48  Ui::MainWindow *ui;
49  QIcon iconPause;
50  QIcon iconPlay;
51  QLineEdit *commandEdit;
53 
54  // Central widgets
56 
57  // Settings used for the whole program
60 
61  // Taking screenshots
64  void screenShot( screenshotType_t screenshotType = SCREENSHOT, bool autoSave = false );
65 
66  bool openDocument( QString docName );
67 
68  signals:
69  void settingsLoaded( DsoSettingsScope *scope, const Dso::ControlSpecification *spec );
70 };
Definition: mainwindow.h:62
QElapsedTimer elapsedTime
Definition: mainwindow.h:37
void closeEvent(QCloseEvent *event) override
Save the settings before exiting.
Definition: mainwindow.cpp:682
Ui::MainWindow * ui
Definition: mainwindow.h:48
Definition: mainwindow.h:62
Definition: exporterregistry.h:23
void showNewData(std::shared_ptr< PPresult > newData)
Definition: mainwindow.cpp:545
Definition: mainwindow.h:23
The widget for the oszilloscope-screen This widget contains the scopes and all level sliders...
Definition: dsowidget.h:23
void screenShot(screenshotType_t screenshotType=SCREENSHOT, bool autoSave=false)
Definition: mainwindow.cpp:571
Definition: QtAwesome.h:28
bool openDocument(QString docName)
Definition: mainwindow.cpp:668
Holds the settings of the program.
Definition: dsosettings.h:20
QLineEdit * commandEdit
Definition: mainwindow.h:51
void settingsLoaded(DsoSettingsScope *scope, const Dso::ControlSpecification *spec)
Stores the specifications of the currently connected device.
Definition: controlspecification.h:42
QIcon iconPlay
Definition: mainwindow.h:50
~MainWindow() override
Definition: mainwindow.cpp:538
void exporterProgressChanged()
Definition: mainwindow.cpp:559
QIcon iconPause
Definition: mainwindow.h:49
Dock window for the trigger settings. It contains the settings for the trigger mode, source and slope.
Definition: TriggerDock.h:21
DsoWidget * dsoWidget
Definition: mainwindow.h:55
Dock window for the voltage channel settings. It contains the settings for gain and coupling for both...
Definition: VoltageDock.h:24
Definition: mainwindow.h:62
screenshotType_t screenshotType
Definition: mainwindow.h:63
DsoSettings * dsoSettings
Definition: mainwindow.h:58
MainWindow(HantekDsoControl *dsoControl, DsoSettings *dsoSettings, ExporterRegistry *exporterRegistry, QWidget *parent=nullptr)
Definition: mainwindow.cpp:38
Holds the settings for the oscilloscope.
Definition: scopesettings.h:88
screenshotType_t
Definition: mainwindow.h:62
Dock window for the spectrum view. It contains the magnitude for all channels and allows to enable/di...
Definition: SpectrumDock.h:19
Dock window for the horizontal axis. It contains the settings for the timebase and the display format...
Definition: HorizontalDock.h:27
void exporterStatusChanged(const QString &exporterName, const QString &status)
Definition: mainwindow.cpp:552
Analyzes the data from the dso. Calculates the spectrum and various data about the signal and saves t...
Definition: spectrumgenerator.h:26
QtAwesome * iconFont
Definition: mainwindow.h:52
The main window of the application. The main window contains the classic oszilloscope-screen and the ...
Definition: mainwindow.h:30
The DsoControl abstraction layer for Hantek USB DSOs. TODO Please anyone, refactor this class into sm...
Definition: hantekdsocontrol.h:50
ExporterRegistry * exporterRegistry
Definition: mainwindow.h:59