KiCad PCB EDA Suite
|
#include "resistor_substitution_utils.h"
#include <algorithm>
#include <cmath>
#include <functional>
#include <stdexcept>
#include <optional>
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 149 of file resistor_substitution_utils.cpp.
Referenced by parallelResistance(), and serialResistance().
bool operator< | ( | const RESISTANCE & | aLhs, |
const RESISTANCE & | aRhs | ||
) |
Definition at line 41 of file resistor_substitution_utils.cpp.
References RESISTANCE::value.
bool operator< | ( | const RESISTANCE & | aLhs, |
double | aRhs | ||
) |
Definition at line 36 of file resistor_substitution_utils.cpp.
References RESISTANCE::value.
|
inlinestatic |
Definition at line 196 of file resistor_substitution_utils.cpp.
References maybeEmbrace(), name, RESISTANCE::name, parallelValue(), RESISTANCE::parts, and RESISTANCE::value.
Referenced by RES_EQUIV_CALC::calculate3RSolution(), and RES_EQUIV_CALC::calculate4RSolution().
|
inlinestatic |
Definition at line 212 of file resistor_substitution_utils.cpp.
References name, RESISTANCE::name, parallelValue(), RESISTANCE::parts, and RESISTANCE::value.
Referenced by RES_EQUIV_CALC::prepare2RBuffer().
|
inlinestatic |
Definition at line 183 of file resistor_substitution_utils.cpp.
Referenced by RES_EQUIV_CALC::calculate3RSolution(), RES_EQUIV_CALC::calculate4RSolution(), parallelResistance(), and parallelResistanceSimple().
|
inlinestatic |
Definition at line 188 of file resistor_substitution_utils.cpp.
References maybeEmbrace(), name, RESISTANCE::name, RESISTANCE::parts, serialValue(), and RESISTANCE::value.
Referenced by RES_EQUIV_CALC::calculate3RSolution(), and RES_EQUIV_CALC::calculate4RSolution().
|
inlinestatic |
Definition at line 204 of file resistor_substitution_utils.cpp.
References name, RESISTANCE::name, RESISTANCE::parts, 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 178 of file resistor_substitution_utils.cpp.
Referenced by RES_EQUIV_CALC::calculate3RSolution(), RES_EQUIV_CALC::calculate4RSolution(), serialResistance(), and serialResistanceSimple().
|
static |
Definition at line 226 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().