private void UpdateControlLimits(ChartBase dataContext) { Mean = dataContext.Mean; if (_meanSeries == null) _meanSeries = RunChart.Find(x => x.Name == "meanSeries") as LineSeries; if (_meanSeries != null) _meanSeries.ValueBinding = new PropertyNameDataPointBinding("Mean"); dataContext.UpdateChartBoundaries(); UpdateDataPointTemplates(this); }
private void UpdateControlLimits(ChartBase dataContext) { if (dataContext.UseCustomCLs) { UCL = dataContext.ParentPanel.CustomUCL; LCL = dataContext.ParentPanel.CustomLCL; Mean = (UCL + LCL) / 2; if (_meanSeries == null) _meanSeries = PChart.Find(x => x.Name == "meanSeries") as LineSeries; if (_meanSeries != null) _meanSeries.ValueBinding = new PropertyNameDataPointBinding("CustomMean"); DynamicUclData = PerSampleControlLimitsHelper.BuildStaticUclLimit(dataContext, false); DynamicLclData = PerSampleControlLimitsHelper.BuildStaticLclLimit(dataContext, false); OnPropertyChanged("DynamicUclData"); OnPropertyChanged("DynamicLclData"); } else { UCL = dataContext.UCL; Mean = dataContext.Mean; LCL = dataContext.LCL; if (_meanSeries == null) _meanSeries = PChart.Find(x => x.Name == "meanSeries") as LineSeries; if (_meanSeries != null) _meanSeries.ValueBinding = new PropertyNameDataPointBinding("Mean"); if (dataContext.AverageLimits) { DynamicUclData = PerSampleControlLimitsHelper.BuildStaticUclLimit(dataContext, true); DynamicLclData = PerSampleControlLimitsHelper.BuildStaticLclLimit(dataContext, true); } else { DynamicUclData = PerSampleControlLimitsHelper.BuildUclLimits(dataContext.DataSource); DynamicLclData = PerSampleControlLimitsHelper.BuildLclLimits(dataContext.DataSource); } OnPropertyChanged("DynamicUclData"); OnPropertyChanged("DynamicLclData"); } dataContext.UpdateChartBoundaries(); UpdateDataPointTemplates(this); }
private void UpdateControlLimits(ChartBase dataContext) { if (dataContext.UseCustomCLs) { UCL = dataContext.ParentPanel.CustomUCL; LCL = dataContext.ParentPanel.CustomLCL; Mean = (UCL + LCL) / 2; if (_uclSeries == null) _uclSeries = RChart.Find(x => x.Name == "uclSeries") as LineSeries; if (_uclSeries != null) _uclSeries.ValueBinding = new PropertyNameDataPointBinding("CustomUCL"); if (_meanSeries == null) _meanSeries = RChart.Find(x => x.Name == "meanSeries") as LineSeries; if (_meanSeries != null) _meanSeries.ValueBinding = new PropertyNameDataPointBinding("CustomMean"); if (_lclSeries == null) _lclSeries = RChart.Find(x => x.Name == "lclSeries") as LineSeries; if (_lclSeries != null) _lclSeries.ValueBinding = new PropertyNameDataPointBinding("CustomLCL"); } else { UCL = dataContext.UCL; Mean = dataContext.Mean; LCL = dataContext.LCL; if (_uclSeries == null) _uclSeries = RChart.Find(x => x.Name == "uclSeries") as LineSeries; if (_uclSeries != null) _uclSeries.ValueBinding = new PropertyNameDataPointBinding("UCL"); if (_meanSeries == null) _meanSeries = RChart.Find(x => x.Name == "meanSeries") as LineSeries; if (_meanSeries != null) _meanSeries.ValueBinding = new PropertyNameDataPointBinding("Mean"); if (_lclSeries == null) _lclSeries = RChart.Find(x => x.Name == "lclSeries") as LineSeries; if (_lclSeries != null) _lclSeries.ValueBinding = new PropertyNameDataPointBinding("LCL"); } dataContext.UpdateChartBoundaries(); UpdateDataPointTemplates(this); }
private void UpdateControlLimits(ChartBase dataContext) { if (dataContext.DataSource == null || dataContext.DataSource.Count == 0) { UclData = null; OnPropertyChanged("UclData"); MeanData = null; OnPropertyChanged("MeanData"); LclData = null; OnPropertyChanged("LclData"); LslData = null; OnPropertyChanged("LslData"); UslData = null; OnPropertyChanged("UslData"); dataContext.BellCurveData = null; return; } if (dataContext.UseCustomCLs) { UCL = dataContext.ParentPanel.CustomUCL; LCL = dataContext.ParentPanel.CustomLCL; Mean = (UCL + LCL) / 2; UclData = PerSampleControlLimitsHelper.BuildHistogramControlLimit(UCL); OnPropertyChanged("UclData"); MeanData = PerSampleControlLimitsHelper.BuildHistogramControlLimit(Mean); OnPropertyChanged("MeanData"); LclData = PerSampleControlLimitsHelper.BuildHistogramControlLimit(LCL); OnPropertyChanged("LclData"); } else { UCL = dataContext.UCL; Mean = dataContext.Mean; LCL = dataContext.LCL; UclData = PerSampleControlLimitsHelper.BuildHistogramControlLimit(UCL); OnPropertyChanged("UclData"); MeanData = PerSampleControlLimitsHelper.BuildHistogramControlLimit(Mean); OnPropertyChanged("MeanData"); LclData = PerSampleControlLimitsHelper.BuildHistogramControlLimit(LCL); OnPropertyChanged("LclData"); } var minimum = dataContext.MinXValue; var maximum = dataContext.MaxXValue; var chartIndex = dataContext.ParentPanel.Charts.IndexOf(dataContext); UpdateLevelValuesCommand.BeginExecute(dataContext.ParentPanel, chartIndex, false, (sender, result) => { if (result.Error == null && result.Object != null) { if (!minimum.Equals(result.Object.Panel.Charts[chartIndex].MinXValue) || !maximum.Equals(result.Object.Panel.Charts[chartIndex].MaxXValue)) { dataContext.DataSource = result.Object.Panel.Charts[chartIndex].DataSource; dataContext.BellCurveData = result.Object.Panel.Charts[chartIndex].BellCurveData; dataContext.MinXValue = result.Object.Panel.Charts[chartIndex].MinXValue; dataContext.MaxXValue = result.Object.Panel.Charts[chartIndex].MaxXValue; dataContext.XStep = result.Object.Panel.Charts[chartIndex].XStep; dataContext.Sigma = result.Object.Panel.Charts[chartIndex].Sigma; dataContext.ParentPanel.Exponent = result.Object.Panel.Charts[chartIndex].ParentPanel.Exponent; AdjustLabelsAndTicks(HistogramChart, result.Object.Panel.Charts[chartIndex]); } } }); dataContext.UpdateChartBoundaries(); }