![]() |
KiCad PCB EDA Suite
|
#include <eserie.h>
Public Member Functions | |
E_SERIE () | |
void | Exclude (double aValue) |
If any value of the selected E-serie not available, it can be entered as an exclude value. More... | |
void | NewCalc () |
initialize next calculation and erase results from previous calculation More... | |
void | Calculate () |
called on calculate button to execute all the 2R, 3R and 4R calculations More... | |
void | SetSeries (uint32_t aSeries) |
Interface for CheckBox, RadioButton, RequriedResistor and calculated Results. More... | |
void | SetRequiredValue (double aValue) |
const std::array< R_DATA, S4R+1 > & | GetResults () |
Private Member Functions | |
int | buildSerieData (int aEserie, double aList[]) |
Build the list of R_DATA existing for a given serie Series are E1, E6 . More... | |
uint32_t | combine2 () |
Build all 2R combinations from the selected E-serie values. More... | |
void | simple_solution (uint32_t aSize) |
Search for closest two component solution. More... | |
void | combine3 (uint32_t aSize) |
Check if there is a better 3 R solution than previous one using only two components. More... | |
void | combine4 (uint32_t aSize) |
Check if there is a better four component solution. More... | |
void | strip3 () |
void | strip4 () |
Private Attributes | |
std::vector< std::vector< R_DATA > > | m_luts |
std::vector< R_DATA > | m_cmb_lut |
std::array< R_DATA, S4R+1 > | m_results |
uint32_t | m_series = E6 |
uint32_t | m_enable_4R = false |
double | m_required_value = 0.0 |
E_SERIE::E_SERIE | ( | ) |
Definition at line 86 of file eserie.cpp.
References buildSerieData(), E1, E12, E12_VALUES, E1_VALUES, E24, E24_VALUES, E3, E3_VALUES, E6, E6_VALUES, and m_cmb_lut.
|
private |
Build the list of R_DATA existing for a given serie Series are E1, E6 .
The values are extracted from the E96_VALUES list
Definition at line 114 of file eserie.cpp.
References FIRST_VALUE, LAST_VALUE, m_luts, and strValue().
Referenced by E_SERIE().
void E_SERIE::Calculate | ( | ) |
called on calculate button to execute all the 2R, 3R and 4R calculations
Definition at line 338 of file eserie.cpp.
References combine2(), combine3(), m_results, S2R, simple_solution(), strip3(), and strip4().
Referenced by PANEL_E_SERIE::OnCalculateESeries().
|
private |
Build all 2R combinations from the selected E-serie values.
Pre-calculated value combinations are saved in intermediate look up table m_cmb_lut
Definition at line 251 of file eserie.cpp.
References m_cmb_lut, m_luts, and m_series.
Referenced by Calculate().
|
private |
Check if there is a better 3 R solution than previous one using only two components.
aSize | gives the number of available combinations to be checked inside m_cmb_lut Therefore m_cmb_lut is combinated with the primary E-serie look up table The 3R result with smallest deviation will be saved in results if better than 2R |
Definition at line 284 of file eserie.cpp.
References combine4(), m_cmb_lut, m_luts, m_required_value, m_results, m_series, S2R, and S3R.
Referenced by Calculate().
|
private |
Check if there is a better four component solution.
aSsize | gives the number of 2R combinations to be checked inside m_cmb_lut Occupied calculation time depends from number of available E-serie values with the power of 4 why execution for E12 is conditional with 4R check box for the case the previously found 3R solution is already exact |
Definition at line 181 of file eserie.cpp.
References m_cmb_lut, m_required_value, m_results, S3R, and S4R.
Referenced by combine3().
void E_SERIE::Exclude | ( | double | aValue | ) |
If any value of the selected E-serie not available, it can be entered as an exclude value.
aValue | is the value to exclude from calculation Values to exclude are set to false in the selected E-serie source lookup table |
Definition at line 150 of file eserie.cpp.
References m_luts, and m_series.
Referenced by PANEL_E_SERIE::OnCalculateESeries().
Definition at line 118 of file eserie.h.
References m_results.
Referenced by PANEL_E_SERIE::OnCalculateESeries().
void E_SERIE::NewCalc | ( | ) |
initialize next calculation and erase results from previous calculation
Definition at line 238 of file eserie.cpp.
References m_cmb_lut, m_luts, m_results, and m_series.
Referenced by PANEL_E_SERIE::OnCalculateESeries().
|
inline |
Definition at line 115 of file eserie.h.
References m_required_value.
Referenced by PANEL_E_SERIE::OnCalculateESeries().
|
inline |
Interface for CheckBox, RadioButton, RequriedResistor and calculated Results.
Definition at line 114 of file eserie.h.
References m_series.
Referenced by PANEL_E_SERIE::OnESeriesSelection().
|
private |
Search for closest two component solution.
aSize | is the number of valid 2R combinations in m_cmb_lut on where to search The 2R result with smallest deviation will be saved in results |
Definition at line 163 of file eserie.cpp.
References m_cmb_lut, m_required_value, m_results, and S2R.
Referenced by Calculate().
|
private |
Definition at line 353 of file eserie.cpp.
References m_results, and S3R.
Referenced by Calculate().
|
private |
Definition at line 372 of file eserie.cpp.
References m_results, and S4R.
Referenced by Calculate().
|
private |
Definition at line 195 of file eserie.h.
Referenced by combine2(), combine3(), combine4(), E_SERIE(), NewCalc(), and simple_solution().
|
private |
Definition at line 183 of file eserie.h.
Referenced by buildSerieData(), combine2(), combine3(), Exclude(), and NewCalc().
|
private |
Definition at line 200 of file eserie.h.
Referenced by combine3(), combine4(), SetRequiredValue(), and simple_solution().
Definition at line 197 of file eserie.h.
Referenced by Calculate(), combine3(), combine4(), GetResults(), NewCalc(), simple_solution(), strip3(), and strip4().
|
private |
Definition at line 198 of file eserie.h.
Referenced by combine2(), combine3(), Exclude(), NewCalc(), and SetSeries().