Ejemplo n.º 1
0
        /// <summary>
        /// This constructor method will set the ohms value property, as well as low and high tolerance values properties from passed variable length collection of band color codes.
        /// </summary>
        /// <param name="bandColors"></param>
        // public LaResistance(List<string> bandColors)
        public LaResistance(OhmBandsListModel model)
        {
            _bandColors = model.bandColors;

            CodedResistance calc = new CodedResistance();

            calc.CalculateOhmValue(_bandColors, out _ohms, out _tolerance, out _ohmsLow, out _ohmsHigh);
            ohms      = _ohms;
            tolerance = _tolerance * 100; //for outputting pct
            ohmsLow   = _ohmsLow;
            ohmsHigh  = _ohmsHigh;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// This constructor method will only set ohms value property
        /// </summary>
        /// <param name="model"></param>
        public LaResistance(OhmBandsModel model)
        {
            CodedResistance calc = new CodedResistance();

            ohms = calc.CalculateOhmValue(model.bandAColor, model.bandBColor, model.bandCColor, model.bandDColor);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// This constructor method is the most basic and only sets ohms value from passed four band color codes.
        /// </summary>
        /// <param name="bandAColor"></param>
        /// <param name="bandBcolor"></param>
        /// <param name="bandCColor"></param>
        /// <param name="bandDcolor"></param>
        public LaResistance(string bandAColor, string bandBcolor, string bandCColor, string bandDcolor)
        {
            CodedResistance calc = new CodedResistance();

            ohms = calc.CalculateOhmValue(bandAColor, bandBcolor, bandCColor, bandDcolor);
        }