/// <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(); }
public void _0004_Vamosnak() { var calc = new BaudrateCalculator(); calc.Calculate(15, 6, 3, 1); Assert.AreEqual(280000, calc.Baudrate); Assert.AreEqual(3520.0d, calc.GetBaudrateAbsoluteError(276480)); Assert.AreEqual(1.2731481481481481d, calc.GetBaudrateRealtiveError(276480)); }