protected override void UpdateLevelsValues(List<List<SamplePrimitive>> primitives, MobileObservableCollection<SampleUnit> samples) { Mean = samples.Any(x => x.SampleValue != null) ? Math.Round(samples.Where(x => x.SampleValue != null).Average(x => (double)x.SampleValue), 2) : 0; UCL = Math.Round(Mean * StatisticConstants.D4(ParentPanel.SubgroupSize), 2); LCL = Math.Round(Math.Max(Mean * StatisticConstants.D3(ParentPanel.SubgroupSize), 0), 2); foreach (var sample in samples) { sample.SetUCL(UCL); sample.SetMean(Mean); sample.SetLCL(LCL); sample.SetUCL(ParentPanel.CustomUCL, true); sample.SetLCL(ParentPanel.CustomLCL, true); sample.SetUSL(ParentPanel.USL); sample.SetLSL(ParentPanel.LSL); } }