Beispiel #1
0
        private void OKBtn_Click(object sender, EventArgs e)
        {
            NCCReporter.LMLoggers.LognLM applog = NC.App.Logger(NCCReporter.LMLoggers.AppSection.App);
            string dest = UIIntegration.GetUsersFolder("Select Destination", string.Empty);

            if (string.IsNullOrEmpty(dest))
            {
                return;
            }
            if (DetectorCurrentRadioButton.Checked)
            {
                List <Detector> l = new List <Detector>();
                l.Add(Integ.GetCurrentAcquireDetector());
                INCCInitialDataDetectorFile iddf = INCCKnew.FromDetectors(l);
                iddf.Save(dest);
            }
            else if (DetectorAllRadioButton.Checked)
            {
                List <Detector>             l    = NC.App.DB.Detectors;
                INCCInitialDataDetectorFile iddf = INCCKnew.FromDetectors(l);
                iddf.Save(dest);
            }
            else if (CalibrationCurrentRadioButton.Checked)
            {
                List <Detector> l = new List <Detector>();
                l.Add(Integ.GetCurrentAcquireDetector());
                List <INCCInitialDataCalibrationFile> lidcf = INCCKnew.CalibFromDetectors(l);
                if (lidcf.Count > 0)
                {
                    if (!lidcf[0].Save(dest))
                    {
                        applog.TraceEvent(NCCReporter.LogLevels.Warning, 33154, "No calibration parameters for " + lidcf[0].Name);
                    }
                }
            }
            else if (CalibrationAllRadioButton.Checked)
            {
                List <Detector> l = NC.App.DB.Detectors;
                List <INCCInitialDataCalibrationFile> lidcf = INCCKnew.CalibFromDetectors(l);
                foreach (INCCInitialDataCalibrationFile idcf in lidcf)
                {
                    if (!idcf.Save(dest))
                    {
                        applog.TraceEvent(NCCReporter.LogLevels.Warning, 33154, "No calibration parameters for " + idcf.Name);
                    }
                }
            }
            Close();
        }
Beispiel #2
0
 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);
             }
         }
     }
 }