/// <summary> /// Коэффициент разницы двух диаметров /// </summary> ///<param name="originalTyre">Original Tyre</param> /// <param name="newTyre">New Tyre</param> /// <returns>K</returns> public static float CalcK(TyreParams originalTyre, TyreParams newTyre) { if (originalTyre == null || newTyre == null) { throw new NullReferenceException(); } return(newTyre.Diameter / originalTyre.Diameter); }
public UserControlTyreParams() { _tyre = new TyreParams(_defaultTyre); InitializeComponent(); InitializeInterface(); UpdateInterface(); }
public UserControlTyreParams(TyreParams tyre) { if (tyre == null) _tyre = new TyreParams(_defaultTyre); InitializeComponent(); InitializeInterface(); UpdateInterface(); }
private void MenuTyreCalculatorEventHandler(object sender, EventArgs e) { FormTyreCalc frmTyreCalc = new FormTyreCalc(cfg.cfgTyreOrigin, cfg.cfgTyreCurrent); if (frmTyreCalc.ShowDialog() == System.Windows.Forms.DialogResult.OK) { cfg.cfgTyreOrigin = frmTyreCalc._tOrigin; cfg.cfgTyreCurrent = frmTyreCalc._tNew; cfg.Save(); ConversionFunctions.SpeedCorrectCoefficient = TyreParams.CalcK(frmTyreCalc._tOrigin, frmTyreCalc._tNew); } }
public FormTyreCalc(TyreParams origin = null, TyreParams current = null) { InitializeComponent(); _tOrigin = (origin == null) ? UserControlTyreParams.DefaultTyre : origin; _tNew = (current == null) ? UserControlTyreParams.DefaultTyre : current; ctlTyresOriginal.Tyre = _tOrigin; ctlTyresNew.Tyre = _tNew; CalcAcurancy(); this.VisibleChanged += new EventHandler(FormTyreCalc_VisibleChanged); }
private void ctlTyresOriginal_SizesChanged(object sender, TyreParams e) { _tOrigin = e; CalcAcurancy(); }
private void ctlTyresNew_SizesChanged(object sender, TyreParams e) { _tNew = e; CalcAcurancy(); }
public TyreParams(TyreParams t) { Profile = t.Profile; Width = t.Width; Radius = t.Radius; }
/// <summary> /// Коэффициент разницы двух диаметров /// </summary> ///<param name="originalTyre">Original Tyre</param> /// <param name="newTyre">New Tyre</param> /// <returns>K</returns> public static float CalcK(TyreParams originalTyre, TyreParams newTyre) { if (originalTyre == null || newTyre == null) throw new NullReferenceException(); return newTyre.Diameter / originalTyre.Diameter; }