Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
swr_s11_calculator.h
Go to the documentation of this file.
1
8#ifndef SWR_S11_CALCULATOR_H
9#define SWR_S11_CALCULATOR_H
10
11#include <QDialog>
13#include "Misc/general.h"
14
16class QLabel;
17class QPushButton;
18class QTableWidget;
19class QGroupBox;
20class QComboBox;
21
22
31class SwrS11CalculatorDialog : public QDialog {
32 Q_OBJECT
33
34public:
37 explicit SwrS11CalculatorDialog(QWidget *parent = nullptr);
38
39private slots:
41 void computeResults();
42
44 void on_inputChanged();
45
47 void on_modeChanged(int index);
48
50 void showDocumentation() {
51 QString path = QString("/Calculators/ReflectionCoefficientTools/index.html");
52 showHTMLDocs(path);
53 }
54
55private:
57 enum CalculationMode {
58 FROM_VSWR = 0,
59 FROM_S11_DB = 1,
60 FROM_GAMMA = 2
61 };
62
63 // ========== Input Widgets ==========
64
71 QComboBox *comboMode;
72
74 CustomDoubleSpinBox *spinVSWR;
75
77 CustomDoubleSpinBox *spinS11dB;
78
79
81 CustomDoubleSpinBox *spinGammaMag;
82
84 QLabel *labelInput;
85
87 QGroupBox *inputGroup;
88
90 QFormLayout *inputForm;
91
92 // ========== Output Widget ==========
93
95 QTableWidget *resultsTable;
96
97 // ========== Helper Methods ==========
98
100 void updateUIForMode();
101
105 double gammaFromVSWR(double vswr) const;
106
110 double vswrFromGamma(double gamma) const;
111
115 double s11dBFromGamma(double gamma) const;
116
120 double gammaFromS11dB(double s11db) const;
121};
122
123#endif // SWR_S11_CALCULATOR_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 bidirectional conversion between SWR, S11, and reflection coefficient magnitude.
Definition swr_s11_calculator.h:31
Utility functions needed across the whole project.
void showHTMLDocs(QString path)
Show HTML documentation in the web browser.
Definition showHTMLDocs.cpp:17