Example #1
0
        void LoadList()
        {
            listView1.ShowItemToolTips = true;
            int mlistIndex = 0;

            foreach (Measurement m in mlist)
            {
                DoublesDclMass dl             = GetTheDataPoints(m);
                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"),
                    dl.Mass.v.ToString("F2"),
                    dl.Doubles.v.ToString("F2"),
                    mlistIndex.ToString(),                      // subitem at index 4 has the original mlist index of this element
                });
                listView1.Items.Add(lvi);
                lvi.Tag         = dl;          // 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;
            }
        }
Example #2
0
        public DoublesDclMass GetTheDataPoints(Measurement m)
        {
            DoublesDclMass dl = new DoublesDclMass();

            dl.dt = m.MeasDate;
            MultiplicityCountingRes mcr = (MultiplicityCountingRes)m.CountingAnalysisResults[m.Detector.MultiplicityParams];

            dl.Doubles = mcr.DeadtimeCorrectedDoublesRate;
            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;
                dl.Mass = ccres.pu240e_mass;
                break;

            case AnalysisMethod.KnownA:
                INCCMethodResults.results_known_alpha_rec kares = (INCCMethodResults.results_known_alpha_rec)imr;
                dl.Mass = kares.pu240e_mass;
                break;

            case AnalysisMethod.AddASource:
                INCCMethodResults.results_add_a_source_rec aares = (INCCMethodResults.results_add_a_source_rec)imr;
                dl.Mass = aares.pu240e_mass;
                break;

            case AnalysisMethod.Active:
                INCCMethodResults.results_active_rec acres = (INCCMethodResults.results_active_rec)imr;
                dl.Mass = acres.u235_mass;
                break;
            }
            return(dl);
        }
Example #3
0
        void SaveCurveXYValues(CalibrationCurveList list)
        {
            CalcDataList = new CalibrationCurveList();
            if (list.Count < 1)
            {
                return;
            }

            // save the data-points for use in the Get file op that replaces the deming
            System.Collections.IEnumerator _iter = list.GetEnumerator();
            while (_iter.MoveNext())
            {
                DoublesDclMass dl = (DoublesDclMass)_iter.Current;
                CalcDataList.Add(dl);
            }
            CalcDataList.CalcLowerUpper();                              // compute upper and lower mass limits from the data points,

            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter           = "DMD files (*.dmd)|*.dmd|in files (*.in)|*.in|All files (*.*)|*.*";
            dlg.DefaultExt       = ".in";
            dlg.FileName         = "deming.in";
            dlg.InitialDirectory = N.App.AppContext.ResultsFilePath;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    StreamWriter tx = File.CreateText(dlg.FileName);
                    System.Collections.IEnumerator iter = list.GetEnumerator();
                    while (iter.MoveNext())
                    {
                        string entry = iter.Current.ToString();
                        tx.WriteLine(entry);
                    }
                    tx.Close();
                    N.App.Loggers.Logger(LMLoggers.AppSection.Control).TraceInformation("Fitting data written to " + dlg.FileName);
                } catch (IOException ex)
                {
                    MessageBox.Show(ex.Message, "Error on " + dlg.FileName);
                }
            }
        }
Example #4
0
        public void BuildRep()
        {
            disprows.Add(new DataLoad("a", Coefficients.a));
            disprows.Add(new DataLoad("b", Coefficients.b));
            disprows.Add(new DataLoad("c", Coefficients.c));
            disprows.Add(new DataLoad("d", Coefficients.d));
            disprows.Add(new DataLoad("variance a", Coefficients.var_a));
            disprows.Add(new DataLoad("variance b", Coefficients.var_b));
            disprows.Add(new DataLoad("variance c", Coefficients.var_c));
            disprows.Add(new DataLoad("variance d", Coefficients.var_d));
            disprows.Add(new DataLoad("covariance ab", Coefficients.covar(Coeff.a, Coeff.b)));
            disprows.Add(new DataLoad("covariance ac", Coefficients.covar(Coeff.a, Coeff.c)));
            disprows.Add(new DataLoad("covariance ad", Coefficients.covar(Coeff.a, Coeff.d)));
            disprows.Add(new DataLoad("covariance bc", Coefficients.covar(Coeff.b, Coeff.c)));
            disprows.Add(new DataLoad("covariance bd", Coefficients.covar(Coeff.b, Coeff.d)));
            disprows.Add(new DataLoad("covariance cd", Coefficients.covar(Coeff.c, Coeff.d)));

            for (int i = 0; i < CalcDataList.Count; i++)
            {
                DoublesDclMass ddm = CalcDataList[i];
                disprows.Add(new DataLoad(ddm.Mass.v, ddm.Doubles.v));
            }
        }