public bool CalculateMerkel(bool isElevation, out string errorMessage) { try { MerkelData = new MerkelData(); if (!FillMerkelData(isElevation, out errorMessage)) { return(false); } if (!MerkelCalculationLibrary.MerkelCalculation(MerkelData, out errorMessage)) { return(false); } // output data in MerkelOutputData MerkelOutputData.NameValueUnitsDataTable.DataTable.Clear(); //data.BarometricPressure = truncit(data.BarometricPressure, 5); MerkelOutputData.NameValueUnitsDataTable.AddRow("KaV/L", MerkelData.KaV_L.ToString("F5"), string.Empty); return(true); } catch (Exception exception) { errorMessage = string.Format("Error in Merkel calculation. Please check your input values. Exception Message: {0}", exception.Message); return(false); } }
public MerkelViewModel(bool isDemo, bool isInternationalSystemOfUnits_IS_) { MerkelInputData = new MerkelInputData(isDemo, isInternationalSystemOfUnits_IS_); MerkelOutputData = new MerkelOutputData(isInternationalSystemOfUnits_IS_); IsInternationalSystemOfUnits_IS = isInternationalSystemOfUnits_IS_; MerkelCalculationLibrary = new MerkelCalculationLibrary(); }