Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
freq_wavelength_converter.h
Go to the documentation of this file.
1
7
8#ifndef FREQ_WAVELENGTH_CONVERTER_H
9#define FREQ_WAVELENGTH_CONVERTER_H
10
11#include <QDialog>
13#include "Misc/general.h"
14
16class QLabel;
17class QPushButton;
18class QComboBox;
19class QGroupBox;
20class QRadioButton;
21class QTableWidget;
22
30class FreqWavelengthConverterDialog : public QDialog {
31 Q_OBJECT
32public:
35 explicit FreqWavelengthConverterDialog(QWidget *parent = nullptr);
36
37private slots:
39 void computeConversion();
40
42 void on_modeChanged();
43
45 void on_inputChanged();
46
48 void showDocumentation() {
49 QString path = QString("/Calculators/FrequencyToWavelength/index.html");
50 showHTMLDocs(path);
51 }
52
53private:
54 // ========== Mode Selection ==========
55
57 QRadioButton *radioFreqToWavelength;
58
60 QRadioButton *radioWavelengthToFreq;
61
62 // ========== Input Widgets ==========
63
65 CustomDoubleSpinBox *spinFrequency;
66
68 QComboBox *comboFreqUnits;
69
71 CustomDoubleSpinBox *spinWavelength;
72
74 QComboBox *comboWavelengthUnits;
75
77 CustomDoubleSpinBox *spinPermittivity;
78
79 // ========== Output Display ==========
80
82 QTableWidget *resultsTable;
83
85 QGroupBox *freqInputGroup;
86
88 QGroupBox *wavelengthInputGroup;
89
91 QPushButton* docsButton;
92
93 // ========== Helper Functions ==========
94
99 double convertFrequencyToHz(double freq, const QString &units) const;
100
105 double convertFrequencyFromHz(double freqHz, const QString &units) const;
106
111 double convertWavelengthToMeters(double wavelength, const QString &units) const;
112
117 double convertWavelengthFromMeters(double wavelengthM, const QString &units) const;
118
122 QString formatFrequency(double freqHz) const;
123
127 QString formatWavelength(double wavelengthM) const;
128
129
130};
131
132#endif // FREQ_WAVELENGTH_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 between frequency and wavelength.
Definition freq_wavelength_converter.h:30
Utility functions needed across the whole project.
void showHTMLDocs(QString path)
Show HTML documentation in the web browser.
Definition showHTMLDocs.cpp:17