public void _0009_Max_SegmentsToCustomBaudRateValue()
        {
            var calc = new BaudrateCalculator();

            calc.Calculate(1024, 16, 8, 4);
            var target = calc.GetCustomBaudRateValue();

            Assert.AreEqual("B007FFFF", target);
        }
        public void _0007_Default_SegmentsToCustomBaudRateValue()
        {
            var calc = new BaudrateCalculator();

            calc.Calculate(1, 1, 1, 1);
            var target = calc.GetCustomBaudRateValue();

            Assert.AreEqual("B0000000", target);
        }
        public void _0008_250kBaud_SegmentsToCustomBaudRateValue()
        {
            var calc = new BaudrateCalculator();

            calc.Calculate(8, 16, 4, 3);
            var target = calc.GetCustomBaudRateValue();

            Assert.AreEqual("B003F807", target);
        }
        public void _0005_250KBaud_PCLK42MHz()
        {
            var calc = new BaudrateCalculator();

            calc.Calculate(42000000, 8, 16, 4, 3);

            foreach (var line in calc.GetCalculateDetails)
            {
                Console.WriteLine(line);
            }
            Assert.AreEqual(249999.99999999997d, calc.Baudrate);
            Assert.AreEqual("B003F807", calc.GetCustomBaudRateValue());
        }
        /// <summary>
        /// Változott a Brp, Tseg1, Tseg2, Sjw
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void customBaudrateView1_ParameterChanged(object sender, EventArgs e)
        {
            cbrc.Calculate(view.Brp, view.Tseg1, view.Tseg2, view.Sjw);

            view.SmaplePoint      = cbrc.SamplePoint;
            view.Baudrate         = cbrc.Baudrate;
            view.CalculateDetails = cbrc.GetCalculateDetails;

            view.BaudratAbsError  = cbrc.GetBaudrateAbsoluteError(view.ExpectedBaudrate);
            view.BaudrateRelError = cbrc.GetBaudrateRealtiveError(view.ExpectedBaudrate);

            view.CustomBaudrateValue = cbrc.GetCustomBaudRateValue().ToString();
        }