private void SetWeightController() { oew = new WeightTextBoxController(oewTxtBox, oewLbl); payload = new WeightTextBoxController(payloadTxtBox, payloadLbl); Zfw = new WeightTextBoxController(zfwTxtBox, zfwLbl); Extra = new WeightTextBoxController(extraFuelTxtBox, extraFuelLbl); WeightControl = new WeightController(oew, payload, Zfw, payloadTrackBar); WeightControl.Enable(); }
private static double TryGetWeightKg(WeightTextBoxController c) { try { return(c.GetWeightKg()); } catch { return(0.0); } }
public WeightController( WeightTextBoxController oew, WeightTextBoxController payload, WeightTextBoxController zfw, MetroTrackBar payloadTrackBar) { this.oew = oew; this.payload = payload; this.zfw = zfw; this.payloadTrackBar = payloadTrackBar; _enabled = false; _monitorWeightChange = false; }
private static double ImportRequireNonNegative( WeightTextBoxController weightControl, string exceptionMsg) { double weightKg; try { weightKg = weightControl.GetWeightKg(); } catch { throw new InvalidUserInputException(exceptionMsg); } if (weightKg < 0.0) { throw new InvalidUserInputException(exceptionMsg); } return(weightKg); }