KiCad PCB EDA Suite
|
#include "resistor_substitution_utils.h"
#include <algorithm>
#include <cmath>
#include <functional>
#include <stdexcept>
Go to the source code of this file.
Classes | |
class | SolutionCollector |
Helper class that collects solutions and keeps one with the best deviation. More... | |
Functions | |
bool | operator< (const RESISTANCE &aLhs, double aRhs) |
bool | operator< (const RESISTANCE &aLhs, const RESISTANCE &aRhs) |
static std::string | maybeEmbrace (const std::string &aText, char aRequiredSymbol) |
If aText contains aRequiredSymbol as top-level (i.e. | |
static double | serialValue (double aR1, double aR2) |
Functions calculating values and text representations of serial and parallel combinations. | |
static double | parallelValue (double aR1, double aR2) |
static RESISTANCE | serialResistance (const RESISTANCE &aR1, const RESISTANCE &aR2) |
static RESISTANCE | parallelResistance (const RESISTANCE &aR1, const RESISTANCE &aR2) |
static RESISTANCE | serialResistanceSimple (const RESISTANCE &aR1, const RESISTANCE &aR2) |
static RESISTANCE | parallelResistanceSimple (const RESISTANCE &aR1, const RESISTANCE &aR2) |
static std::string | strValue (double aValue) |
|
static |
If aText contains aRequiredSymbol as top-level (i.e.
not in parentheses) operator, return aText enclosed in parentheses. Otherwise, return aText unmodified.
Definition at line 113 of file resistor_substitution_utils.cpp.
Referenced by parallelResistance(), and serialResistance().
bool operator< | ( | const RESISTANCE & | aLhs, |
const RESISTANCE & | aRhs | ||
) |
Definition at line 40 of file resistor_substitution_utils.cpp.
References RESISTANCE::value.
bool operator< | ( | const RESISTANCE & | aLhs, |
double | aRhs | ||
) |
Definition at line 35 of file resistor_substitution_utils.cpp.
References RESISTANCE::value.
|
inlinestatic |
Definition at line 158 of file resistor_substitution_utils.cpp.
References maybeEmbrace(), name, RESISTANCE::name, parallelValue(), and RESISTANCE::value.
Referenced by RES_EQUIV_CALC::calculate3RSolution(), and RES_EQUIV_CALC::calculate4RSolution().
|
inlinestatic |
Definition at line 170 of file resistor_substitution_utils.cpp.
References name, RESISTANCE::name, parallelValue(), and RESISTANCE::value.
Referenced by RES_EQUIV_CALC::prepare2RBuffer().
|
inlinestatic |
Definition at line 147 of file resistor_substitution_utils.cpp.
Referenced by RES_EQUIV_CALC::calculate3RSolution(), RES_EQUIV_CALC::calculate4RSolution(), parallelResistance(), and parallelResistanceSimple().
|
inlinestatic |
Definition at line 152 of file resistor_substitution_utils.cpp.
References maybeEmbrace(), name, RESISTANCE::name, serialValue(), and RESISTANCE::value.
Referenced by RES_EQUIV_CALC::calculate3RSolution(), and RES_EQUIV_CALC::calculate4RSolution().
|
inlinestatic |
Definition at line 164 of file resistor_substitution_utils.cpp.
References name, RESISTANCE::name, serialValue(), and RESISTANCE::value.
Referenced by RES_EQUIV_CALC::prepare2RBuffer().
|
inlinestatic |
Functions calculating values and text representations of serial and parallel combinations.
Functions marked as 'Simple' do not care about parentheses, which makes them faster.
Definition at line 142 of file resistor_substitution_utils.cpp.
Referenced by RES_EQUIV_CALC::calculate3RSolution(), RES_EQUIV_CALC::calculate4RSolution(), serialResistance(), and serialResistanceSimple().
|
static |
Definition at line 182 of file resistor_substitution_utils.cpp.
Referenced by RES_EQUIV_CALC::buildSeriesData(), SCH_IO_DATABASE::loadSymbolFromRow(), SIM_STRING_PROPERTY::OnEvent(), IbisParser::readTypMinMaxValue(), and PG_RATIO_EDITOR::UpdateControl().