private void OKBtn_Click(object sender, EventArgs e) { if (CurrentDetectorRadioButton.Checked) { IDDSaveCampaignId f = new IDDSaveCampaignId(); DialogResult r = f.ShowDialog(); if (r == DialogResult.OK) { string dest = UIIntegration.GetUsersFolder("Select Directory for Saving Measurement Data", string.Empty); if (string.IsNullOrEmpty(dest)) return; IDDMeasurementList measlist = new IDDMeasurementList(); measlist.Init(f.FilteredList, AssaySelector.MeasurementOption.unspecified, lmonly: false, goal: IDDMeasurementList.EndGoal.Transfer, inspnum: f.inspnum, detector: f.det); DialogResult dr = DialogResult.None; if (measlist.bGood) measlist.ShowDialog(); dr = measlist.DialogResult; if (dr != DialogResult.OK) return; List<Measurement> mlist = measlist.GetSelectedMeas(); foreach (Measurement m in mlist) { CycleList cl = NC.App.DB.GetCycles(f.det, m.MeasurementId, m.AcquireState.data_src); // APluralityOfMultiplicityAnalyzers: // URGENT: get all the cycles associated with each analyzer, restoring into the correct key->result pair m.Cycles.AddRange(cl); // NEXT: m.CFCyles for AAS not used for INCC6 created measurements, only INCC5 transfer measurements have them m.Add(c, i); m.INCCAnalysisResults.TradResultsRec = NC.App.DB.ResultsRecFor(m.MeasurementId); } List<INCCTransferFile> itdl = INCCKnew.XFerFromMeasurements(mlist); foreach (INCCTransferFile itd in itdl) { itd.Save(dest); } } } else if (AllDetectorsRadioButton.Checked) { string dest = UIIntegration.GetUsersFolder("Select Directory for Saving Measurement Data", string.Empty); if (string.IsNullOrEmpty(dest)) return; List<Detector> l = NC.App.DB.Detectors; foreach (Detector det in l) { List<Measurement> mlist = NC.App.DB.MeasurementsFor(det.Id.DetectorId); foreach (Measurement m in mlist) { CycleList cl = NC.App.DB.GetCycles(det, m.MeasurementId, m.AcquireState.data_src); // APluralityOfMultiplicityAnalyzers: // URGENT: get all the cycles associated with each analyzer, restoring into the correct key->result pair m.Add(cl); m.INCCAnalysisResults.TradResultsRec = NC.App.DB.ResultsRecFor(m.MeasurementId); } List<INCCTransferFile> itdl = INCCKnew.XFerFromMeasurements(mlist); foreach (INCCTransferFile itd in itdl) { itd.Save(dest); } } } }
private void OKBtn_Click(object sender, EventArgs e) { if (CurrentDetectorRadioButton.Checked) { IDDSaveCampaignId f = new IDDSaveCampaignId(); DialogResult r = f.ShowDialog(); if (r == DialogResult.OK) { string dest = UIIntegration.GetUsersFolder("Select Directory for Saving Measurement Data", string.Empty); if (string.IsNullOrEmpty(dest)) { return; } IDDMeasurementList measlist = new IDDMeasurementList(); measlist.Init(f.FilteredList, AssaySelector.MeasurementOption.unspecified, lmonly: false, goal: IDDMeasurementList.EndGoal.Transfer, inspnum: f.inspnum, detector: f.det); DialogResult dr = DialogResult.None; if (measlist.bGood) { measlist.ShowDialog(); } dr = measlist.DialogResult; if (dr != DialogResult.OK) { return; } List <Measurement> mlist = measlist.GetSelectedMeas(); foreach (Measurement m in mlist) { CycleList cl = NC.App.DB.GetCycles(f.det, m.MeasurementId, m.AcquireState.data_src); // APluralityOfMultiplicityAnalyzers: // URGENT: get all the cycles associated with each analyzer, restoring into the correct key->result pair m.Cycles.AddRange(cl); // NEXT: m.CFCyles for AAS not used for INCC6 created measurements, only INCC5 transfer measurements have them m.Add(c, i); m.INCCAnalysisResults.TradResultsRec = NC.App.DB.ResultsRecFor(m.MeasurementId); m.ReportRecalc(); // dev note: not strictly from INCC5, but based on usage complaint from LANL } List <INCCTransferFile> itdl = INCCKnew.XFerFromMeasurements(mlist); foreach (INCCTransferFile itd in itdl) { itd.Save(dest); } } } else if (AllDetectorsRadioButton.Checked) { string dest = UIIntegration.GetUsersFolder("Select Directory for Saving Measurement Data", string.Empty); if (string.IsNullOrEmpty(dest)) { return; } List <Detector> l = NC.App.DB.Detectors; foreach (Detector det in l) { List <Measurement> mlist = NC.App.DB.MeasurementsFor(det.Id.DetectorId); foreach (Measurement m in mlist) { CycleList cl = NC.App.DB.GetCycles(det, m.MeasurementId, m.AcquireState.data_src); // APluralityOfMultiplicityAnalyzers: // URGENT: get all the cycles associated with each analyzer, restoring into the correct key->result pair m.Add(cl); if (m.MeasOption == AssaySelector.MeasurementOption.rates) { return; } else { m.INCCAnalysisResults.TradResultsRec = NC.App.DB.ResultsRecFor(m.MeasurementId); } } List <INCCTransferFile> itdl = INCCKnew.XFerFromMeasurements(mlist); foreach (INCCTransferFile itd in itdl) { itd.Save(dest); } } } }