public MeasPointData GetTheDataPoints(Measurement m) { MeasPointData p = new MeasPointData(m.MeasDate); MultiplicityCountingRes mcr = (MultiplicityCountingRes)m.CountingAnalysisResults[m.Detector.MultiplicityParams]; INCCMethodResult imr = m.INCCAnalysisResults.LookupMethodResults(m.Detector.MultiplicityParams, m.INCCAnalysisState.Methods.selector, AnalysisMethod, create: false); switch (AnalysisMethod) { case AnalysisMethod.CalibrationCurve: INCCMethodResults.results_cal_curve_rec ccres = (INCCMethodResults.results_cal_curve_rec)imr; p.Doubles = mcr.DeadtimeCorrectedDoublesRate.v; p.Mass = ccres.dcl_pu240e_mass; break; case AnalysisMethod.KnownA: INCCMethodResults.results_known_alpha_rec kares = (INCCMethodResults.results_known_alpha_rec)imr; p.Doubles = (kares.mult_corr_doubles.v == 0 ? mcr.DeadtimeCorrectedDoublesRate.v : kares.mult_corr_doubles.v); p.Mass = kares.dcl_pu240e_mass; break; case AnalysisMethod.AddASource: INCCMethodResults.results_add_a_source_rec aares = (INCCMethodResults.results_add_a_source_rec)imr; p.Doubles = mcr.DeadtimeCorrectedDoublesRate.v; p.Mass = aares.dcl_pu240e_mass; break; case AnalysisMethod.Active: INCCMethodResults.results_active_rec acres = (INCCMethodResults.results_active_rec)imr; p.Doubles = mcr.DeadtimeCorrectedDoublesRate.v; p.Mass = acres.dcl_u235_mass; break; } return(p); }
void LoadList() { listView1.ShowItemToolTips = true; int mlistIndex = 0; foreach (Measurement m in mlist) { MeasPointData p = GetTheDataPoints(m); p.number = mlistIndex + 1; string ItemWithNumber = string.IsNullOrEmpty(m.MeasurementId.Item.item) ? "-" : m.AcquireState.ItemId.item; ListViewItem lvi = new ListViewItem(new string[] { ItemWithNumber, m.MeasDate.DateTime.ToString("yy.MM.dd HH:mm:ss"), p.Mass.ToString("F2"), p.Doubles.ToString("F2"), mlistIndex.ToString(), // subitem at index 4 has the original mlist index of this element }); listView1.Items.Add(lvi); lvi.Tag = p; // for proper column sorting lvi.ToolTipText = "Using " + m.INCCAnalysisState.Methods.selector.ToString(); mlistIndex++; } MCount.Text = listView1.Items.Count.ToString() + " measurements"; if (listView1.SelectedItems.Count > 0) { MCountSel.Text = listView1.SelectedItems.Count.ToString(); } else { MCountSel.Text = string.Empty; } }