KiCad PCB EDA Suite
attenuator_classes.h
Go to the documentation of this file.
1 
5 /*
6  * Attenuator Synthesis
7  *
8  * From Qucs
9  * Modified for KiCad
10  */
11 
12 #ifndef ATTENUATORFUNC_H
13 #define ATTENUATORFUNC_H
14 
15 // Forward declare the bitmaps enum from bitmaps/bitmap_list.h
16 enum class BITMAPS : unsigned int;
17 
18 class wxString;
19 
25 };
26 
28 {
29 public:
30  virtual ~ATTENUATOR();
31 
37  virtual bool Calculate();
38 
42  void ReadConfig();
43 
47  void WriteConfig();
48 
49 protected:
50  // The constructor is protected, because this class is not intended to be instantiated.
51  ATTENUATOR( ATTENUATORS_TYPE Topology );
52 
53 public:
54  wxString m_Name; // Identifier for configuration.
55  int m_ResultCount; // Number of value to calculate, and therefore display
56  bool m_Error; // Set to true if values cannot be calculated
57  double m_Zin; // Impedance of source
58  bool m_Zin_Enable; // Set to true when impedance of source has meaning
59  double m_Zout; // Impedance of load
60  double m_Attenuation; // Attenuation in dB
61  bool m_Attenuation_Enable; // Set to true when Attenuation has meaning
62  double m_MinimumATT; // Minimum attenuation in dB from parameters
63  double m_R1; // value of R1
64  double m_R2; // value of R2
65  double m_R3; // value of R3 (if any)
66  BITMAPS m_SchBitmapName; // The schema of this attenuator
67  wxString* m_FormulaName; // The HTML/markdown text name of the formula
68 
69 protected:
71  double Lmin, L, A; // internal variable for temporary use
72 };
73 
74 class ATTENUATOR_PI : public ATTENUATOR
75 {
76 public:
77  ATTENUATOR_PI();
79  virtual bool Calculate() override;
80 };
81 
82 class ATTENUATOR_TEE : public ATTENUATOR
83 {
84 public:
87  virtual bool Calculate() override;
88 };
89 
91 {
92 public:
95  virtual bool Calculate() override;
96 };
97 
99 {
100 public:
103  virtual bool Calculate() override;
104 };
105 
106 #endif // ATTENUATORFUNC_H
ATTENUATORS_TYPE
virtual bool Calculate() override
Calculates the values of components in attenuator.
virtual bool Calculate() override
Calculates the values of components in attenuator.
virtual ~ATTENUATOR()
bool m_Attenuation_Enable
BITMAPS m_SchBitmapName
ATTENUATORS_TYPE m_Topology
virtual bool Calculate()
Calculates the values of components in attenuator.
ATTENUATOR(ATTENUATORS_TYPE Topology)
void ReadConfig()
Read values stored in config for this attenuator.
void WriteConfig()
Read values stored in config for this attenuator.
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:32
virtual bool Calculate() override
Calculates the values of components in attenuator.
wxString * m_FormulaName
virtual bool Calculate() override
Calculates the values of components in attenuator.
double m_Attenuation