KiCad PCB EDA Suite
Loading...
Searching...
No Matches
E_SERIES Class Reference

#include <eseries.h>

Public Member Functions

 E_SERIES ()
 
void Exclude (double aValue)
 If any value of the selected E-series 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 buildSeriesData (const double aList[])
 Add values from aList to m_tables. More...
 
uint32_t combine2 ()
 Build all 2R combinations from the selected E-series 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_tables
 
std::vector< R_DATAm_combined_table
 
std::array< R_DATA, S4R+1 > m_results
 
uint32_t m_series = E6
 
double m_required_value = 0.0
 

Detailed Description

Definition at line 89 of file eseries.h.

Constructor & Destructor Documentation

◆ E_SERIES()

E_SERIES::E_SERIES ( )

Member Function Documentation

◆ buildSeriesData()

int E_SERIES::buildSeriesData ( const double  aList[])
private

Add values from aList to m_tables.

Covers all decades between FIRST_VALUE and LAST_VALUE.

Returns
the count of items added to m_tables.

Definition at line 109 of file eseries.cpp.

References FIRST_VALUE, LAST_VALUE, m_tables, and strValue().

Referenced by E_SERIES().

◆ Calculate()

void E_SERIES::Calculate ( )

called on calculate button to execute all the 2R, 3R and 4R calculations

Definition at line 333 of file eseries.cpp.

References combine2(), combine3(), m_results, S2R, simple_solution(), strip3(), and strip4().

Referenced by PANEL_E_SERIES::OnCalculateESeries().

◆ combine2()

uint32_t E_SERIES::combine2 ( )
private

Build all 2R combinations from the selected E-series values.

Pre-calculated value combinations are saved in intermediate look up table m_combined_table

Returns
is the number of found combinations what also depends from exclude values

Definition at line 245 of file eseries.cpp.

References m_combined_table, m_series, and m_tables.

Referenced by Calculate().

◆ combine3()

void E_SERIES::combine3 ( uint32_t  aSize)
private

Check if there is a better 3 R solution than previous one using only two components.

Parameters
aSizegives the number of available combinations to be checked inside m_combined_table. Therefore m_combined_table is combined with the primary E-series look up table. The 3R result with smallest deviation will be saved in results if better than 2R

Definition at line 278 of file eseries.cpp.

References std::abs(), combine4(), m_combined_table, m_required_value, m_results, m_series, m_tables, S2R, and S3R.

Referenced by Calculate().

◆ combine4()

void E_SERIES::combine4 ( uint32_t  aSize)
private

Check if there is a better four component solution.

Parameters
aSsizegives the number of 2R combinations to be checked inside m_combined_table Occupied calculation time depends from number of available E-series 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 176 of file eseries.cpp.

References std::abs(), m_combined_table, m_required_value, m_results, PROF_TIMER::msecs(), S3R, and S4R.

Referenced by combine3().

◆ Exclude()

void E_SERIES::Exclude ( double  aValue)

If any value of the selected E-series not available, it can be entered as an exclude value.

Parameters
aValueis the value to exclude from calculation Values to exclude are set to false in the selected E-series source lookup table

Definition at line 145 of file eseries.cpp.

References m_series, and m_tables.

Referenced by PANEL_E_SERIES::OnCalculateESeries().

◆ GetResults()

const std::array< R_DATA, S4R+1 > & E_SERIES::GetResults ( )
inline

Definition at line 119 of file eseries.h.

References m_results.

Referenced by PANEL_E_SERIES::OnCalculateESeries().

◆ NewCalc()

void E_SERIES::NewCalc ( )

initialize next calculation and erase results from previous calculation

Definition at line 232 of file eseries.cpp.

References m_combined_table, m_results, m_series, and m_tables.

Referenced by PANEL_E_SERIES::OnCalculateESeries().

◆ SetRequiredValue()

void E_SERIES::SetRequiredValue ( double  aValue)
inline

Definition at line 116 of file eseries.h.

References m_required_value.

Referenced by PANEL_E_SERIES::OnCalculateESeries().

◆ SetSeries()

void E_SERIES::SetSeries ( uint32_t  aSeries)
inline

Interface for CheckBox, RadioButton, RequriedResistor and calculated Results.

Definition at line 115 of file eseries.h.

References m_series.

Referenced by PANEL_E_SERIES::OnESeriesSelection().

◆ simple_solution()

void E_SERIES::simple_solution ( uint32_t  aSize)
private

Search for closest two component solution.

Parameters
aSizeis the number of valid 2R combinations in m_combined_table on where to search The 2R result with smallest deviation will be saved in results

Definition at line 158 of file eseries.cpp.

References std::abs(), m_combined_table, m_required_value, m_results, and S2R.

Referenced by Calculate().

◆ strip3()

void E_SERIES::strip3 ( )
private

Definition at line 348 of file eseries.cpp.

References m_results, and S3R.

Referenced by Calculate().

◆ strip4()

void E_SERIES::strip4 ( )
private

Definition at line 367 of file eseries.cpp.

References m_results, and S4R.

Referenced by Calculate().

Member Data Documentation

◆ m_combined_table

std::vector<R_DATA> E_SERIES::m_combined_table
private

Definition at line 195 of file eseries.h.

Referenced by combine2(), combine3(), combine4(), E_SERIES(), NewCalc(), and simple_solution().

◆ m_required_value

double E_SERIES::m_required_value = 0.0
private

Definition at line 199 of file eseries.h.

Referenced by combine3(), combine4(), SetRequiredValue(), and simple_solution().

◆ m_results

std::array<R_DATA, S4R+1> E_SERIES::m_results
private

Definition at line 197 of file eseries.h.

Referenced by Calculate(), combine3(), combine4(), GetResults(), NewCalc(), simple_solution(), strip3(), and strip4().

◆ m_series

uint32_t E_SERIES::m_series = E6
private

Definition at line 198 of file eseries.h.

Referenced by combine2(), combine3(), Exclude(), NewCalc(), and SetSeries().

◆ m_tables

std::vector<std::vector<R_DATA> > E_SERIES::m_tables
private

Definition at line 183 of file eseries.h.

Referenced by buildSeriesData(), combine2(), combine3(), Exclude(), and NewCalc().


The documentation for this class was generated from the following files: