Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
MatchingNetworkParametersWidget.h
1/*
2 * Copyright (C) 2025 Andrés Martínez Mera - andresmmera@protonmail.com
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#ifndef MATCHINGNETWORKPARAMETERSWIDGET_H
19#define MATCHINGNETWORKPARAMETERSWIDGET_H
20
21#include <QCheckBox>
22#include <QComboBox>
23#include <QDoubleSpinBox>
24#include <QGridLayout>
25#include <QGroupBox>
26#include <QHBoxLayout>
27#include <QLabel>
28#include <QLineEdit>
29#include <QMessageBox>
30#include <QMouseEvent>
31#include <QPushButton>
32#include <QRadioButton>
33#include <QSpinBox>
34#include <QWidget>
35#include <complex>
36
37#include "../../Schematic/structures.h"
38
39class MatchingNetworkParametersWidget : public QGroupBox {
40 Q_OBJECT
41
42public:
43 explicit MatchingNetworkParametersWidget(QWidget* parent = nullptr);
45
46 // Public method to get the design parameters
47 MatchingNetworkDesignParameters getDesignParameters() const;
48
49 // Public method to get the current topology index
50 int getCurrentTopologyIndex() const;
51
52 // Public method to get the frequency scaling
53 double getScaleFreq(int index) const;
54
55 bool isCollapsed() const { return m_isCollapsed; }
56 void setCollapsed(bool collapsed);
57 void setTitle(QString title);
58
59protected:
60 void mousePressEvent(QMouseEvent* event) override;
61
62public slots:
63 void onTopologyChanged(int index);
64
65private slots:
66 void onParameterChanged();
67 void onToggleCollapse();
68
69 // Required to adjust the visility of the ripple in the Chebyshev transformer
70 void adjustChebyshevRippleVisibility();
71
72private:
73 // UI Components
74
75 QGridLayout* m_mainLayout;
76 QWidget* m_contentWidget;
77 QPushButton* m_toggleButton;
78
79 QLabel* titleLabel;
80
81 QLabel* Topology_Label;
82 QComboBox* Topology_Combo;
83
84 QWidget* SolutionWidget;
85 QRadioButton* Solution1_RB;
86 QRadioButton* Solution2_RB;
87
88 QLabel* StubTermination_Label;
89 QComboBox* StubTermination_ComboBox;
90
91 QGroupBox* Weighting_GroupBox;
92 QComboBox* Weighting_Combo;
93 QLabel* Ripple_Label;
94 QDoubleSpinBox* Ripple_SpinBox;
95
96 QLabel* Sections_Label;
97 QSpinBox* Sections_SpinBox;
98
99 QLabel* Zin_Label;
100 QDoubleSpinBox* ZinRSpinBox;
101 QLabel* Ohm_Zin_Label;
102
103 QGroupBox* groupBox;
104
105 // Transmission line implementation
106 QLabel* TL_Implementation_Label;
107 QComboBox* TL_Implementation_Combo;
108
109 // Layout
110 QGridLayout* mainLayout;
111
112 void setupUI();
113 void connectSignals();
114
115 // State
116 bool m_isCollapsed;
117
118signals:
119 void parametersChanged();
120 void topologyChanged(int index);
121 void collapsedStateChanged(bool collapsed);
122};
123
124#endif // MATCHINGNETWORKPARAMETERSWIDGET_H
Definition MatchingNetworkParametersWidget.h:39
Definition structures.h:146