38#define RES_EQUIV_CALC_FIRST_VALUE 10 
   42#define RES_EQUIV_CALC_LAST_VALUE 1e6 
   51    RESISTANCE( 
double aValue, 
const std::string& aName, std::vector<double> aParts = {} ) :
 
   57            parts.push_back( aValue );
 
 
 
   99    void NewCalc( 
double aTargetValue );
 
  144    std::pair<RESISTANCE&, RESISTANCE&> 
findIn2RBuffer( 
double aTargetValue );
 
 
std::array< std::optional< RESISTANCE >, NUMBER_OF_LEVELS > m_results
 
RESISTANCE calculate2RSolution()
Calculate the best combination consisting of exactly 2, 3 or 4 resistors.
 
std::vector< RESISTANCE > m_buffer_2R
 
RESISTANCE calculate3RSolution()
 
std::pair< RESISTANCE &, RESISTANCE & > findIn2RBuffer(double aTargetValue)
Find in 2R buffer two values nearest to the given value (one smaller and one larger).
 
std::vector< RESISTANCE > m_buffer_1R
 
std::vector< RESISTANCE > buildSeriesData(const ESERIES::ESERIES_VALUES &aList)
Add values from aList to m_e_series tables.
 
void Exclude(double aValue)
If any value of the selected E-series not available, it can be entered as an exclude value.
 
RESISTANCE calculate4RSolution()
 
const std::array< std::optional< RESISTANCE >, NUMBER_OF_LEVELS > & GetResults()
Accessor to calculation results.
 
void SetSeries(uint32_t aSeries)
Set E-series to be used in calculations.
 
std::vector< std::vector< RESISTANCE > > m_e_series
 
void prepare1RBuffer()
Build 1R buffer, which is selected E-series table with excluded values removed.
 
void Calculate()
Executes all the calculations.
 
void NewCalc(double aTargetValue)
Initialize next calculation, clear exclusion mask and erase results from previous calculation.
 
void prepare2RBuffer()
Build 2R buffer, which consists of all possible combinations of two resistors from 1R buffer (serial ...
 
std::vector< bool > m_exclude_mask
 
std::vector< double > parts
 
RESISTANCE(double aValue, const std::string &aName, std::vector< double > aParts={})