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 class wxBitmap;
16 class wxString;
17 
23 };
24 
26 {
27 protected:
29 public:
30  wxString m_Name; // Identifier for config
31  int m_ResultCount; // Number of value to calculate, and therefore display
32  bool m_Error; // Set to true if values acnnot be calculated
33  double m_Zin; // Impedance of source
34  bool m_Zin_Enable; // Set to true when impedance of source has meaning
35  double m_Zout; // Impedance of load
36  double m_Attenuation; // Attenuation in dB
37  bool m_Attenuation_Enable; // Set to true when Attenuatiopn has meaning
38  double m_MinimumATT; // Minimun attenuation in dB from parameters
39  double m_R1; // value of R1
40  double m_R2; // value of R2
41  double m_R3; // value of R3 (if any)
42  wxBitmap* m_SchBitMap; // The schema of this attenuator
43  wxString* m_FormulaName; // The HTML/markdown text name of the formula
44 
45 protected:
46  double Lmin, L, A; // internal variable for temporary use
47 
48 
49 protected:
50  // The constructor is protected, because this class is not intended to be instancied
51  ATTENUATOR( ATTENUATORS_TYPE Topology );
52 public:
53  virtual ~ATTENUATOR();
54 
60  virtual bool Calculate();
61 
66  void ReadConfig();
67 
72  void WriteConfig();
73 };
74 
75 class ATTENUATOR_PI : public ATTENUATOR
76 {
77 public:
78  ATTENUATOR_PI();
80  virtual bool Calculate() override;
81 };
82 
83 class ATTENUATOR_TEE : public ATTENUATOR
84 {
85 public:
88  virtual bool Calculate() override;
89 };
90 
92 {
93 public:
96  virtual bool Calculate() override;
97 };
98 
100 {
101 public:
104  virtual bool Calculate() override;
105 };
106 
107 #endif // ATTENUATORFUNC_H
ATTENUATORS_TYPE
virtual bool Calculate() override
Function Calculate calculates the values of components in attenuator.
virtual bool Calculate() override
Function Calculate calculates the values of components in attenuator.
virtual ~ATTENUATOR()
bool m_Attenuation_Enable
ATTENUATORS_TYPE m_Topology
wxBitmap * m_SchBitMap
virtual bool Calculate()
Function Calculate calculates the values of components in attenuator.
ATTENUATOR(ATTENUATORS_TYPE Topology)
void ReadConfig()
Function ReadConfig Read values stored in config for this attenuator.
void WriteConfig()
Function WriteConfig Read values stored in config for this attenuator.
virtual bool Calculate() override
Function Calculate calculates the values of components in attenuator.
wxString * m_FormulaName
virtual bool Calculate() override
Function Calculate calculates the values of components in attenuator.
double m_Attenuation