public ExpAshBurnCalculation Calculate(ExpAshBurns expAshBurns) { ExpAshBurnCalculation result = new ExpAshBurnCalculation(); if (expAshBurns.Row_1 && expAshBurns.Paint1 > 0f) { result.Solid_1 = expAshBurns.Crucible105_1 - expAshBurns.Crucible1; result.Ash450_1 = expAshBurns.Crucible405_1 - expAshBurns.Crucible1; result.Ash900_1 = expAshBurns.Crucible900_1 - expAshBurns.Crucible1; result.Organic_1 = result.Solid_1 - result.Ash450_1; result.Chalk_1 = ((result.Ash450_1 - result.Ash900_1) * 100f) / 44f; result.Chalk_1 = result.Ash450_1 - result.Chalk_1; result.Titanium_1 = result.Ash450_1 - result.Chalk_1; result.Solid_1 = (result.Solid_1 * 100f) / expAshBurns.Paint1; result.Ash450_1 = (result.Ash450_1 * 100) / expAshBurns.Paint1; result.Ash900_1 = (result.Ash900_1 * 100) / expAshBurns.Paint1; result.Organic_1 = (result.Organic_1 * 100) / expAshBurns.Paint1; result.Titanium_1 = (result.Titanium_1 * 100) / expAshBurns.Paint1; result.Chalk_1 = (result.Chalk_1 * 100f) / expAshBurns.Paint1; } if (expAshBurns.Row_2 && expAshBurns.Paint2 > 0f) { result.Solid_2 = expAshBurns.Crucible105_2 - expAshBurns.Crucible2; result.Ash450_2 = expAshBurns.Crucible405_2 - expAshBurns.Crucible2; result.Ash900_2 = expAshBurns.Crucible900_2 - expAshBurns.Crucible2; result.Organic_2 = result.Solid_2 - result.Ash450_2; result.Chalk_2 = ((result.Ash450_2 - result.Ash900_2) * 100f) / 44f; result.Chalk_2 = result.Ash450_2 - result.Chalk_2; result.Titanium_2 = result.Ash450_2 - result.Chalk_2; result.Solid_2 = (result.Solid_2 * 100f) / expAshBurns.Paint2; result.Ash450_2 = (result.Ash450_2 * 100) / expAshBurns.Paint2; result.Ash900_2 = (result.Ash900_2 * 100) / expAshBurns.Paint2; result.Organic_2 = (result.Organic_2 * 100) / expAshBurns.Paint2; result.Titanium_2 = (result.Titanium_2 * 100) / expAshBurns.Paint2; result.Chalk_2 = (result.Chalk_2 * 100f) / expAshBurns.Paint2; } if (expAshBurns.Row_3 && expAshBurns.Paint3 > 0f) { result.Solid_3 = expAshBurns.Crucible105_3 - expAshBurns.Crucible3; result.Ash450_3 = expAshBurns.Crucible405_3 - expAshBurns.Crucible3; result.Ash900_3 = expAshBurns.Crucible900_3 - expAshBurns.Crucible3; result.Organic_3 = result.Solid_3 - result.Ash450_3; result.Chalk_3 = ((result.Ash450_3 - result.Ash900_3) * 100f) / 44f; result.Chalk_3 = result.Ash450_3 - result.Chalk_3; result.Titanium_3 = result.Ash450_3 - result.Chalk_3; result.Solid_3 = (result.Solid_3 * 100f) / expAshBurns.Paint3; result.Ash450_3 = (result.Ash450_3 * 100) / expAshBurns.Paint3; result.Ash900_3 = (result.Ash900_3 * 100) / expAshBurns.Paint3; result.Organic_3 = (result.Organic_3 * 100) / expAshBurns.Paint3; result.Titanium_3 = (result.Titanium_3 * 100) / expAshBurns.Paint3; result.Chalk_3 = (result.Chalk_3 * 100f) / expAshBurns.Paint3; } return(result); }
public void Calculate() { _calculationResult = _service.Calculate(Model); OnPropertyChanged( nameof(CalcSolids), nameof(CalcAsh450), nameof(CalcAsh900), nameof(CalcOrganic), nameof(CalcTitan), nameof(CalcChalk) ); }
public ExpAshBurnCalculation CalculateAverage(ExpAshBurns expAshBurns) { ExpAshBurnCalculation result = Calculate(expAshBurns); result.SolidAvr = Math.Round(CalcAverage(result.Solid_1, result.Solid_2, result.Solid_3), 2); result.Ash450Avr = Math.Round(CalcAverage(result.Ash450_1, result.Ash450_2, result.Ash450_3), 2); result.Ash900Avr = Math.Round(CalcAverage(result.Ash900_1, result.Ash900_2, result.Ash900_3), 2); result.OrganicAvr = Math.Round(CalcAverage(result.Organic_1, result.Organic_2, result.Organic_3), 2); result.ChalkAvr = Math.Round(CalcAverage(result.Chalk_1, result.Chalk_2, result.Chalk_3), 2); result.TitaniumAvr = Math.Round(CalcAverage(result.Titanium_1, result.Titanium_2, result.Titanium_3), 2); return(result); }
public void CalculateAndSave() { _calculationResult = _service.CalculateAverage(Model); Solids = _calculationResult.SolidAvr; Ash450 = _calculationResult.Ash450Avr; Ash900 = _calculationResult.Ash900Avr; Organic = _calculationResult.OrganicAvr; Titanium = _calculationResult.TitaniumAvr; Chalk = _calculationResult.ChalkAvr; Others = 0f; OnPropertyChanged( nameof(Solids), nameof(Ash450), nameof(Ash900), nameof(Organic), nameof(Titanium), nameof(Chalk), nameof(Others) ); }