Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
AttenuatorDesignTool.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 ATTENUATORDESIGNTOOL_H
19#define ATTENUATORDESIGNTOOL_H
20
21#include <QCheckBox>
22#include <QComboBox>
23#include <QDoubleSpinBox>
24#include <QGridLayout>
25#include <QGroupBox>
26#include <QLabel>
27#include <QLineEdit>
28#include <QRadioButton>
29#include <QWidget>
30
31#include "../../Schematic/Network.h"
32
33#include "BridgedTeeAttenuator.h"
34#include "L_pad_1st_series.h"
35#include "L_pad_1st_shunt.h"
36#include "PiAttenuator.h"
37#include "QW_SeriesAttenuator.h"
38#include "QW_ShuntAttenuator.h"
39#include "RSeriesAttenuator.h"
40#include "ReflectionAttenuator.h"
41#include "RshuntAttenuator.h"
42#include "TeeAttenuator.h"
43
44
45#define PI_ATTENUATOR 0
46#define TEE_ATTENUATOR 1
47#define BRIDGED_TEE 2
48#define REFLECTION_ATTENUATOR 3
49#define QW_SERIES 4
50#define QW_SHUNT 5
51#define LPAD_1ST_SERIES 6
52#define LPAD_1ST_SHUNT 7
53#define RSERIES 8
54#define RSHUNT 9
55
56class AttenuatorDesignTool : public QWidget {
57 Q_OBJECT
58public:
59 AttenuatorDesignTool(QWidget* parent = nullptr);
61 void design();
62 void synthesize();
63
64private slots:
65 void UpdateDesignParameters();
66 void UpdatePowerDissipationData();
67 void on_TopoCombo_currentIndexChanged(int);
68
69private:
70 QLabel *Topology_Label, *Attenuation_Label, *dBLabelAtt, *Zin_Label,
71 *Ohm_Zin_Label, *Zout_Label, *Ohm_Zout_Label, *Pin_Label, *Pdiss_R1_Label,
72 *Pdiss_R2_Label, *Pdiss_R3_Label, *Pdiss_R4_Label, *freqLabel;
73 QDoubleSpinBox *AttenuationSpinBox, *ZinSpinBox, *ZoutSpinBox, *Pin_SpinBox,
74 *freqSpinBox;
75 QComboBox *Topology_Combo, *Pin_units_Combo, *R1_Pdiss_Units_Combo,
76 *R2_Pdiss_Units_Combo, *R3_Pdiss_Units_Combo, *R4_Pdiss_Units_Combo,
77 *FreqScaleCombo;
78 QLineEdit *Pdiss_R1_Lineedit, *Pdiss_R2_Lineedit, *Pdiss_R3_Lineedit,
79 *Pdiss_R4_Lineedit;
80
81 double getFreq();
82 double getPowerW(double, unsigned int);
83 double ConvertPowerFromW(double, unsigned int);
84
85 // Transmission line implementation
86 QLabel* TL_Implementation_Label;
87 QComboBox* TL_Implementation_Combo;
88
89 // Add trace to simulate
90 QLabel* traceNameLabel;
91 QLineEdit* traceNameLineEdit;
92
94
96 // This info is calculated in the synthesis functions and then passed to the tool class
97 SchematicContent SchContent; // Schematic information of the attenuator
98 QMap<QString, double> Pdiss; // Power dissipated in the resistors.
99
100signals:
101 void updateSchematic(SchematicContent);
102 void updateSimulation(SchematicContent);
103};
104
105#endif // ATTENUATORDESIGNTOOL_H
Definition AttenuatorDesignTool.h:56
Definition SchematicContent.h:33
Definition structures.h:204