1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#include <algorithm>
void Resistor::setArray (void) {
//EIA Standard array element sizes per tolerance class
const int E12 = 12; //E12 10% tolerance
const int E24 = 24; //E24 5% tolerance
const int E48 = 48; //E48 2% tolerance
const int E96 = 96; //E96 1% tolerance
// 10% standard values
const int nominalE12Values[E12] =
{ 100, 120, 150, 180, 220, 270,
330, 390, 470, 560, 680, 820};
//5% standard values
const int nominalE24Values[E24] =
{ 100, 110, 120, 130, 150, 160, 180, 200, 220, 240,
270, 300, 330, 360, 390, 430, 470, 510, 560, 620,
680, 750, 820, 910};
//2% standard values
const int nominalE48Values[E48] =
{ 100, 105, 110, 115, 121, 127, 133, 140, 147, 154,
162, 169, 178, 187, 196, 205, 215, 226, 237, 249,
261, 274, 287, 301, 316, 332, 348, 365, 383, 402,
422, 442, 464, 487, 511, 536, 562, 590, 619, 649,
681, 715, 750, 787, 825, 866, 909, 953};
std::copy(nominalE12Values, nominalE12Values+E12, this->nominalE12Values) ;
std::copy(nominalE24Values, nominalE24Values+E24, this->nominalE24Values) ;
std::copy(nominalE48Values, nominalE48Values+E48, this->nominalE48Values) ;
}
|