Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
RF_power_converter.h
Go to the documentation of this file.
1
7
8#ifndef RF_POWER_CONVERTER_H
9#define RF_POWER_CONVERTER_H
10
11#include <QDialog>
13#include "Misc/general.h"
14
16class QLabel;
17class QPushButton;
18class QComboBox;
19class QGroupBox;
20
31class RFPowerConverterDialog : public QDialog {
32 Q_OBJECT
33public:
36 explicit RFPowerConverterDialog(QWidget *parent = nullptr);
37
38private slots:
40 void computeConversion();
41
43 void on_inputChanged();
44
46 void showDocumentation() {
47 QString path = QString("/Calculators/RFPowerUnitConverter/index.html");
48 showHTMLDocs(path);
49 }
50
51
52private:
53 // ========== Input Widgets ==========
54
56 CustomDoubleSpinBox *spinPower;
57
59 QComboBox *comboOldUnits;
60
62 QComboBox *comboNewUnits;
63
65 QLabel *labelResult;
66
71 double convertToWatts(double power, const QString &units) const;
72
77 double convertFromWatts(double powerW, const QString &units) const;
78
83 QString formatResult(double value, const QString &units) const;
84};
85
86#endif // RF_POWER_CONVERTER_H
Custom QDoubleSpinBox. It includes a context menu (right-click) for setting the minimum,...
A QDoubleSpinBox subclass that provides a context menu for configuring range and step.
Definition CustomDoubleSpinBox.h:28
Dialog for converting RF power between different units.
Definition RF_power_converter.h:31
Utility functions needed across the whole project.
void showHTMLDocs(QString path)
Show HTML documentation in the web browser.
Definition showHTMLDocs.cpp:17