public void Init(string id, AssaySelector.MeasurementOption mo = AssaySelector.MeasurementOption.verification) { MeasDataList = new MeasPointList(); CalibDataList = new CalibList(); DetectorId = id; System.Windows.Input.Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; try { InitSort(); mopt = mo; mlist = N.App.DB.MeasurementsFor(DetectorId, mopt, ""); bGood = PrepList(DetectorId); } finally { System.Windows.Input.Mouse.OverrideCursor = null; } if (AnalysisMethod == AnalysisMethod.Active) { listView1.Columns[2].Text = "Decl U235 Mass"; } if (AnalysisMethod == AnalysisMethod.KnownA) { listView1.Columns[3].Text = "Mult Corr Dbls Rt"; } }
void ApplyMethodCurve(CalibList list, INCCAnalysisParams.CurveEquationVals cev) { for (int i = 0; i < list.NumCalibPoints; i++) { if (AnalysisMethod == AnalysisMethod.KnownA) { list[i].CalCurvDoubles = cev.a + cev.b * list[i].CalCurvMass; } else { switch (cev.cal_curve_equation) { case INCCAnalysisParams.CurveEquation.CUBIC: list[i].CalCurvDoubles = cev.a + cev.b * list[i].CalCurvMass + cev.c * list[i].CalCurvMass * list[i].CalCurvMass + cev.d * list[i].CalCurvMass * list[i].CalCurvMass * list[i].CalCurvMass; break; case INCCAnalysisParams.CurveEquation.POWER: list[i].CalCurvDoubles = cev.a * Math.Pow(list[i].CalCurvMass, cev.b); break; case INCCAnalysisParams.CurveEquation.HOWARDS: list[i].CalCurvDoubles = (cev.a * list[i].CalCurvMass) / (1.0 + cev.b * list[i].CalCurvMass); break; case INCCAnalysisParams.CurveEquation.EXPONENTIAL: list[i].CalCurvDoubles = cev.a * (1.0 - Math.Exp(-cev.b * list[i].CalCurvMass)); break; } } } }
public PlotAssayChart(MeasPointList MeasPoints, CalibList CalibPoints) { InitializeComponent(); chart1.ChartAreas[0].AxisX.ScaleView.Zoomable = true; chart1.ChartAreas[0].AxisY.ScaleView.Zoomable = true; PlotVerificationPoints(MeasPoints); PlotCalibCurveLine(CalibPoints); }
void PlotCalibCurveLine(CalibList CalibPoints) { Series s = chart1.Series["Curve"]; //s.MarkerStyle = MarkerStyle.Square; s.MarkerColor = System.Drawing.Color.NavajoWhite; s.MarkerBorderColor = System.Drawing.Color.DarkCyan; s.Color = System.Drawing.Color.Cyan; int imax = 0; foreach (CalibData p in CalibPoints) { if (p.CalCurvDoubles == 0) { continue; } int i = s.Points.AddXY(p.CalCurvMass, p.CalCurvDoubles); if (p.CalCurvMass == CalibPoints.MaxCalCurvMass) { imax = i; //maxpt.ToolTip = "Max " + p.ToString(); } s.Points[i].ToolTip = p.CurveRep; } // chart1.Annotations.Add(maxpt); //maxpt.AnchorDataPoint = s.Points[imax]; s = chart1.Series["Calib"]; s.MarkerStyle = MarkerStyle.Triangle; s.MarkerColor = System.Drawing.Color.DarkCyan; s.MarkerSize = 10; foreach (CalibData p in CalibPoints) { int i = s.Points.AddXY(p.CalPtsMass, p.CalPtsDoubles); if (p.CalPtsMass == CalibPoints.MaxCalPtsDoubles) { imax = i; //maxpt.ToolTip = "Max " + p.ToString(); } s.Points[i].ToolTip = p.PointRep; } // chart1.Annotations.Add(maxpt); //maxpt.AnchorDataPoint = s.Points[imax] }