Example #1
0
 /// <summary>
 /// Récupération de la liste des séries
 /// </summary>
 public static List <ESerie> GetESeries()
 {
     return(new List <ESerie>()
     {
         new ESerie()
         {
             Name = ESeries.E6,
             Tolerance = Tolerance.GetTolerances().Where(x => x.Value == 0.2).Single(),
             Values = new List <double>()
             {
                 1.0, 1.5, 2.2, 3.3, 4.7, 6.8
             }
         },
         new ESerie()
         {
             Name = ESeries.E12,
             Tolerance = Tolerance.GetTolerances().Where(x => x.Value == 0.1).Single(),
             Values = new List <double>()
             {
                 1.0, 1.2, 1.5, 1.8, 2.2, 2.7, 3.3, 3.9, 4.7, 5.6, 6.8, 8.2
             }
         },
         new ESerie()
         {
             Name = ESeries.E24,
             Tolerance = Tolerance.GetTolerances().Where(x => x.Value == 0.05).Single(),
             Values = new List <double>()
             {
                 1.0, 1.1, 1.2, 1.3, 1.5, 1.6, 1.8, 2.0, 2.2, 2.4, 2.7, 3.0, 3.3, 3.6, 3.9, 4.3, 4.7, 5.1, 5.6, 6.2, 6.8, 7.5, 8.2, 9.1
             }
         },
         new ESerie()
         {
             Name = ESeries.E48,
             Tolerance = Tolerance.GetTolerances().Where(x => x.Value == 0.02).Single(),
             Values = new List <double>()
             {
                 1.00, 1.05, 1.10, 1.15, 1.21, 1.27, 1.33, 1.40, 1.47, 1.54, 1.62, 1.69, 1.78, 1.87, 1.96, 2.05, 2.15, 2.26,
                 2.37, 2.49, 2.61, 2.74, 2.87, 3.01, 3.16, 3.32, 3.48, 3.65, 3.83, 4.02, 4.22, 4.42, 4.64, 4.87, 5.11, 5.36,
                 5.62, 5.90, 6.19, 6.49, 6.81, 7.15, 7.50, 7.87, 8.25, 8.66, 9.09, 9.53
             }
         },
         new ESerie()
         {
             Name = ESeries.E96,
             Tolerance = Tolerance.GetTolerances().Where(x => x.Value == 0.01).Single(),
             Values = new List <double>()
             {
                 1.00, 1.02, 1.05, 1.07, 1.10, 1.13, 1.15, 1.18, 1.21, 1.24, 1.27, 1.30, 1.33, 1.37, 1.40, 1.43, 1.47, 1.50,
                 1.54, 1, 58, 1.62, 1.65, 1.69, 1.74, 1.78, 1.82, 1.87, 1.91, 1.96, 2.00, 2.05, 2.10, 2.16, 2.21, 2.26, 2.32,
                 2.37, 2.43, 2.49, 2.55, 2.61, 2.67, 2.74, 2.80, 2.87, 2.94, 3.01, 3.09, 3.16, 3.24, 3.32, 3.40, 3.48, 3.57,
                 3.65, 3.74, 3.83, 3.92, 4.02, 4.12, 4.22, 4.32, 4.42, 4.53, 4.64, 4.75, 4.87, 4.99, 5.11, 5.23, 5.36, 5.49,
                 5.62, 5.76, 5.90, 6.04, 6.19, 6.34, 6.49, 6.65, 6, 81, 6.98, 7.15, 7.32, 7.50, 7.68, 7.87, 8.06, 8.25, 8.45,
                 8.66, 8.87, 9.09, 9.31, 9.53, 9.76
             }
         }
     });
 }
Example #2
0
        /// <summary>
        /// Récupération de la liste des anneeux
        /// </summary>
        public static List <Ring> GetRings()
        {
            Color _black       = Colors.Black;
            Color _brown       = (Color)ColorConverter.ConvertFromString("#FFA65858");
            Color _red         = (Color)ColorConverter.ConvertFromString("#FFFF6262");
            Color _orange      = (Color)ColorConverter.ConvertFromString("#FFFFC04C");
            Color _yellow      = (Color)ColorConverter.ConvertFromString("#FFFFFF5E");
            Color _green       = (Color)ColorConverter.ConvertFromString("#FF00DC00");
            Color _blue        = (Color)ColorConverter.ConvertFromString("#FF0080FF");
            Color _purple      = (Color)ColorConverter.ConvertFromString("#FFA805F3");
            Color _gray        = (Color)ColorConverter.ConvertFromString("#FFE2E2E2");
            Color _white       = Colors.White;
            Color _gold        = Colors.Gold;
            Color _silver      = Colors.Silver;
            Color _transparent = Colors.Transparent;

            return(new List <Ring>()
            {
                new Ring()
                {
                    Abbreviation = "BK",
                    Color = new SolidColorBrush(_black),
                    ButtonBorderColor = new SolidColorBrush(Colors.DarkGray),
                    Digit = 0,
                    Multiplicator = Math.Pow(10, 0),
                    Name = "Noir",
                    Tolerance = Tolerance.GetTolerances().Where(x => x.Index == 0).Single(),
                    TemperatureCoefficient = TemperatureCoefficient.GetTemperatureCoefficients().Where(x => x.Index == 0).Single(),
                    DigitOrder = 1,
                    MultiplicatorOrder = 1,
                    ToleranceOrder = 3,
                    TemperatureCoefficientOrder = 1
                },
                new Ring()
                {
                    Abbreviation = "BN",
                    Color = new SolidColorBrush(_brown),
                    ButtonBorderColor = new SolidColorBrush(Colors.DarkGray),
                    Digit = 1,
                    Multiplicator = Math.Pow(10, 1),
                    Name = "Marron",
                    Tolerance = Tolerance.GetTolerances().Where(x => x.Index == 4).Single(),
                    TemperatureCoefficient = TemperatureCoefficient.GetTemperatureCoefficients().Where(x => x.Index == 1).Single(),
                    DigitOrder = 2,
                    MultiplicatorOrder = 2,
                    ToleranceOrder = 4,
                    TemperatureCoefficientOrder = 2
                },
                new Ring()
                {
                    Abbreviation = "RD",
                    Color = new SolidColorBrush(_red),
                    ButtonBorderColor = new SolidColorBrush(Colors.DarkGray),
                    Digit = 2,
                    Multiplicator = Math.Pow(10, 2),
                    Name = "Rouge",
                    Tolerance = Tolerance.GetTolerances().Where(x => x.Index == 3).Single(),
                    TemperatureCoefficient = TemperatureCoefficient.GetTemperatureCoefficients().Where(x => x.Index == 2).Single(),
                    DigitOrder = 3,
                    MultiplicatorOrder = 3,
                    ToleranceOrder = 5,
                    TemperatureCoefficientOrder = 3
                },
                new Ring()
                {
                    Abbreviation = "OG",
                    Color = new SolidColorBrush(_orange),
                    ButtonBorderColor = new SolidColorBrush(Colors.DarkGray),
                    Digit = 3,
                    Multiplicator = Math.Pow(10, 3),
                    Name = "Orange",
                    Tolerance = null,
                    TemperatureCoefficient = TemperatureCoefficient.GetTemperatureCoefficients().Where(x => x.Index == 3).Single(),
                    DigitOrder = 4,
                    MultiplicatorOrder = 4,
                    ToleranceOrder = 0,
                    TemperatureCoefficientOrder = 4
                },
                new Ring()
                {
                    Abbreviation = "YW",
                    Color = new SolidColorBrush(_yellow),
                    ButtonBorderColor = new SolidColorBrush(Colors.DarkGray),
                    Digit = 4,
                    Multiplicator = Math.Pow(10, 4),
                    Name = "Jaune",
                    Tolerance = null,
                    TemperatureCoefficient = TemperatureCoefficient.GetTemperatureCoefficients().Where(x => x.Index == 4).Single(),
                    DigitOrder = 5,
                    MultiplicatorOrder = 5,
                    ToleranceOrder = 0,
                    TemperatureCoefficientOrder = 5
                },
                new Ring()
                {
                    Abbreviation = "GN",
                    Color = new SolidColorBrush(_green),
                    ButtonBorderColor = new SolidColorBrush(Colors.DarkGray),
                    Digit = 5,
                    Multiplicator = Math.Pow(10, 5),
                    Name = "Vert",
                    Tolerance = Tolerance.GetTolerances().Where(x => x.Index == 5).Single(),
                    TemperatureCoefficient = null,
                    DigitOrder = 6,
                    MultiplicatorOrder = 6,
                    ToleranceOrder = 6,
                    TemperatureCoefficientOrder = 0
                },
                new Ring()
                {
                    Abbreviation = "BU",
                    Color = new SolidColorBrush(_blue),
                    ButtonBorderColor = new SolidColorBrush(Colors.DarkGray),
                    Digit = 6,
                    Multiplicator = Math.Pow(10, 6),
                    Name = "Bleu",
                    Tolerance = Tolerance.GetTolerances().Where(x => x.Index == 6).Single(),
                    TemperatureCoefficient = TemperatureCoefficient.GetTemperatureCoefficients().Where(x => x.Index == 5).Single(),
                    DigitOrder = 7,
                    MultiplicatorOrder = 7,
                    ToleranceOrder = 7,
                    TemperatureCoefficientOrder = 6
                },
                new Ring()
                {
                    Abbreviation = "VT",
                    Color = new SolidColorBrush(_purple),
                    ButtonBorderColor = new SolidColorBrush(Colors.DarkGray),
                    Digit = 7,
                    Multiplicator = Math.Pow(10, 7),
                    Name = "Violet",
                    Tolerance = Tolerance.GetTolerances().Where(x => x.Index == 7).Single(),
                    TemperatureCoefficient = TemperatureCoefficient.GetTemperatureCoefficients().Where(x => x.Index == 6).Single(),
                    DigitOrder = 8,
                    MultiplicatorOrder = 8,
                    ToleranceOrder = 8,
                    TemperatureCoefficientOrder = 7
                },
                new Ring()
                {
                    Abbreviation = "GY",
                    Color = new SolidColorBrush(_gray),
                    ButtonBorderColor = new SolidColorBrush(Colors.DarkGray),
                    Digit = 8,
                    Multiplicator = null,
                    Name = "Gris",
                    Tolerance = Tolerance.GetTolerances().Where(x => x.Index == 8).Single(),
                    TemperatureCoefficient = null,
                    DigitOrder = 9,
                    MultiplicatorOrder = 0,
                    ToleranceOrder = 9,
                    TemperatureCoefficientOrder = 0
                },
                new Ring()
                {
                    Abbreviation = "WT",
                    Color = new SolidColorBrush(_white),
                    ButtonBorderColor = new SolidColorBrush(Colors.DarkGray),
                    Digit = 9,
                    Multiplicator = null,
                    Name = "Blanc",
                    Tolerance = null,
                    TemperatureCoefficient = TemperatureCoefficient.GetTemperatureCoefficients().Where(x => x.Index == 7).Single(),
                    DigitOrder = 10,
                    MultiplicatorOrder = 0,
                    ToleranceOrder = 0,
                    TemperatureCoefficientOrder = 8
                },
                new Ring()
                {
                    Abbreviation = "GD",
                    Color = new SolidColorBrush(_gold),
                    ButtonBorderColor = new SolidColorBrush(Colors.DarkGray),
                    Digit = null,
                    Multiplicator = 0.1,
                    Name = "Or",
                    Tolerance = Tolerance.GetTolerances().Where(x => x.Index == 2).Single(),
                    TemperatureCoefficient = null,
                    DigitOrder = 0,
                    MultiplicatorOrder = 10,
                    ToleranceOrder = 2,
                    TemperatureCoefficientOrder = 0
                },
                new Ring()
                {
                    Abbreviation = "SR",
                    Color = new SolidColorBrush(_silver),
                    ButtonBorderColor = new SolidColorBrush(Colors.DarkGray),
                    Digit = null,
                    Multiplicator = 0.01,
                    Name = "Argent",
                    Tolerance = Tolerance.GetTolerances().Where(x => x.Index == 1).Single(),
                    TemperatureCoefficient = null,
                    DigitOrder = 0,
                    MultiplicatorOrder = 9,
                    ToleranceOrder = 1,
                    TemperatureCoefficientOrder = 0
                }
            });
        }