Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
PowerCombiningTool.h
1/*
2 * Copyright (C) 2019-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 POWERCOMBININGTOOL_H
19#define POWERCOMBININGTOOL_H
20#include <QCheckBox>
21#include <QComboBox>
22#include <QGridLayout>
23#include <QGroupBox>
24#include <QHBoxLayout>
25#include <QLabel>
26#include <QLineEdit>
27#include <QMessageBox>
28#include <QRadioButton>
29#include <QSpinBox>
30#include <QVBoxLayout>
31#include <QValidator>
32#include <QWidget>
33
34#include "../../Schematic/Network.h"
35
36#include "Wilkinson2Way.h"
37#include "MultistageWilkinson.h"
38#include "TJunction.h"
39#include "Branchline.h"
40#include "DoubleBoxBranchline.h"
41#include "Bagley.h"
42#include "Gysel.h"
43#include "Lim_Eom.h"
44#include "Wilkinson3way_ImprovedIsolation.h"
45#include "Recombinant3WayWilkinson.h"
46
47
48#define WILKINSON 0
49#define MULTISTAGE_WILKINSON 1
50#define T_JUNCTION 2
51#define BRANCHLINE 3
52#define DOUBLE_BOX_BRANCHLINE 4
53#define BAGLEY 5
54#define GYSEL 6
55#define LIM_EOM 7
56#define WILKINSON_3_WAY_IMPROVED_ISO 8
57#define RECOMBINANT_3_WAY_WILKINSON 9
58#define TRAVELLING_WAVE 10
59#define TREE 11
60
61
62
63class BagleyValidator : public QValidator {
64 Q_OBJECT
65public:
66 BagleyValidator(QObject* parent = 0) : QValidator(parent){};
67 virtual State validate(QString& input, int& /*pos*/) const {
68 if (input.isEmpty()) {
69 return Acceptable;
70 }
71
72 bool b;
73 int val = input.toInt(&b);
74
75 if ((b == true) && (val % 2 != 0)) {
76 return Acceptable;
77 }
78 return Invalid;
79 }
80};
81
82class PowerCombiningTool : public QWidget {
83 Q_OBJECT
84public:
85 PowerCombiningTool(QWidget* parent = nullptr);
87 void design();
88 SchematicContent getSchematic();
89
90private slots:
91 void UpdateDesignParameters();
92 void on_TopoCombo_currentIndexChanged(int);
93
94private:
95 QLabel *OhmLabel, *K1LabeldB, *NStagesLabel, *K1Label, *FreqLabel, *RefImp,
96 *TopoLabel;
97 QLabel *AlphaLabel, *AlphadBLabel, *UnitsLabel;
98 QDoubleSpinBox *RefImpSpinbox, *FreqSpinbox, *AlphaSpinbox;
99 QDoubleSpinBox *K1Spinbox, *K2Spinbox, *K3Spinbox;
100 QSpinBox* NStagesSpinbox;
101 QComboBox* BranchesCombo;
102 QLabel* number_Output_Label;
103 QComboBox *TopoCombo, *FreqScaleCombo, *UnitsCombo;
104 double getScaleFreq();
105 QString netlist;
106
108 SchematicContent SchContent; // Schematic representation
109
110 // Transmission line implementation
111 QLabel* TL_Implementation_Label;
112 QComboBox* TL_Implementation_Combo;
113
114 // Input validation
115 QValidator* Bagley_Validator;
116
117 // Add trace to simulate
118 QLabel* traceNameLabel;
119 QLineEdit* traceNameLineEdit;
120
121 void synthesize();
122
123 // Functions for changing the default settings based on the topology
124 void setSettings_Wilkinson();
125 void setSettings_MultistageWilkinson();
126 void setSettings_T_Junction();
127 void setSettings_Branchline();
128 void setSettings_DoubleBoxBranchline();
129 void setSettings_Bagley();
130 void setSettings_Gysel();
131 void setSettings_LimEom();
132 void setSettings_Wilkinson_3_Way_Improved_Isolation();
133 void setSettings_Recombinant_3_Way_Wilkinson();
134 void setSettings_Travelling_Wave();
135 void setSettings_Tree();
136 void setDefaultSettings();
137
138
139signals:
140 void updateSchematic(SchematicContent);
141 void updateSimulation(SchematicContent);
142};
143
144#endif // POWERCOMBININGTOOL_H
Definition PowerCombiningTool.h:63
Definition PowerCombiningTool.h:82
Definition SchematicContent.h:33
Definition structures.h:189