Beispiel #1
0
 private void OKBtn_Click(object sender, EventArgs e)
 {
     if (modified)
     {
         AnalysisMethod am = AnalysisMethod.CalibrationCurve;
         INCCAnalysisParams.INCCMethodDescriptor c = ams.GetMethodParameters(am);
         ((INCCAnalysisParams.cal_curve_rec)c).percent_u235 = percent;
         INCCSelector sel = new INCCSelector(acq.detector_id, acq.item_type);
         NC.App.DB.UpdateAnalysisMethod(sel, ams);  // flush changes on internal map to the DB
     }
     DialogResult = System.Windows.Forms.DialogResult.OK;
     Close();
 }
Beispiel #2
0
        private void FillForm()
        {
            AnalysisMethods am = Integ.GetMethodSelections(ap);
            col = new INCCAnalysisParams.collar_combined_rec();
            if (am != null)
            {
                // Grab the settings.
                if (am.HasMethod(AnalysisMethod.CollarAmLi))
                    col = (INCCAnalysisParams.collar_combined_rec)am.GetMethodParameters(AnalysisMethod.CollarAmLi);
            }

            // Default is to request passive measurement info. Once that is entered or pulled from a measurement, we 
            // can enable the active, then the calculation. HN 5/3/2017
            ModeComboBox.SelectedIndex = col.collar.collar_mode;
            PassiveMeasurementRadioButton.Checked = true;
            PassiveMeasurementRadioButton.Enabled = false;
            ActiveMeasurementRadioButton.Checked = false;
            ActiveMeasurementRadioButton.Enabled = false;
            CalculateResultsRadioButton.Checked = false;
            CalculateResultsRadioButton.Enabled = false;

            //These are all filled based on 1) a live measurement or 2) a stored measurement
            ActiveSinglesTextBox.ReadOnly = true;
            ActiveSinglesTextBox.NumberFormat = NumericTextBox.Formatter.F3;
            ActiveSinglesErrorTextBox.ReadOnly = true;
            ActiveSinglesErrorTextBox.NumberFormat = NumericTextBox.Formatter.F3;
            ActiveDoublesTextBox.ReadOnly = true;
            ActiveDoublesTextBox.NumberFormat = NumericTextBox.Formatter.F3;
            ActiveDoublesErrorTextBox.ReadOnly = true;
            ActiveDoublesErrorTextBox.NumberFormat = NumericTextBox.Formatter.F3;

            PassiveSinglesTextBox.ReadOnly = true;
            PassiveSinglesTextBox.NumberFormat = NumericTextBox.Formatter.F3;
            PassiveSinglesErrorTextBox.ReadOnly = true;
            PassiveSinglesErrorTextBox.NumberFormat = NumericTextBox.Formatter.F3;
            PassiveDoublesTextBox.ReadOnly = true;
            PassiveDoublesTextBox.NumberFormat = NumericTextBox.Formatter.F3;
            PassiveDoublesErrorTextBox.ReadOnly = true;
            PassiveDoublesErrorTextBox.NumberFormat = NumericTextBox.Formatter.F3;
        }
Beispiel #3
0
 public void Persist()
 {
     if (imd.modified)
     {
         if (ams == null) // HN No analysis methods existed.
         {
             ams = new AnalysisMethods();
             ams.AddMethod(am, imd);
         }
         if (ams.HasMethod(am)) // if found, update the existing parameter values
         {
             INCCAnalysisParams.INCCMethodDescriptor c = ams.GetMethodParameters(am);
             imd.CopyTo(c);  // This a virtual so imd can be the primary type
         }
         else // add the new method params under the current method key
         {
             ams.AddMethod(am, imd);
         }
         INCCSelector sel = new INCCSelector(acq.detector_id, acq.item_type);
         N.App.DB.UpdateAnalysisMethod(sel, ams);  // flush changes on internal map to the DB
     }
 }
Beispiel #4
0
        void PrepareCalibList()
        {
            CalibDataList.Clear();
            CalibDataList.am = AnalysisMethod;
            AnalysisMethods ams = Integ.GetMethodSelections(DetectorId, Material);

            INCCAnalysisParams.INCCMethodDescriptor imd = ams.GetMethodParameters(AnalysisMethod);
            INCCAnalysisParams.CurveEquationVals    cev = null;
            double[] doubles = null; double[] decl_mass = null;
            GetCalCurve(imd, ref cev, ref doubles, ref decl_mass);

            for (int i = 0; i < doubles.Length; i++)
            {
                CalibData p = new CalibData();
                p.CalPtsMass    = decl_mass[i];
                p.CalPtsDoubles = doubles[i];
                p.number        = i + 1;
                CalibDataList.Add(p);
            }
            CalibDataList.CalcLowerUpper();
            CalibDataList.CalculateMassBasis(cev);
            ApplyMethodCurve(CalibDataList, cev);
        }
Beispiel #5
0
        private bool GetAdditionalParameters()
        {
            bool res = false;

            AnalysisMethods am = Integ.GetMethodSelections(ah.ap);

            if (am != null)
            {
                DialogResult dlgres = DialogResult.OK;
                // if Verif + cal curve get U235 percent/get heavy metal data
                if (am.Has(AnalysisMethod.CalibrationCurve))
                {
                    INCCAnalysisParams.cal_curve_rec cal_curve = (INCCAnalysisParams.cal_curve_rec)am.GetMethodParameters(AnalysisMethod.CalibrationCurve);
                    if (cal_curve.CalCurveType == INCCAnalysisParams.CalCurveType.U)
                    {
                        dlgres = (new IDDPercentU235(am, cal_curve).ShowDialog());
                    }
                    else if (cal_curve.CalCurveType == INCCAnalysisParams.CalCurveType.HM)
                    {
                        dlgres = (new IDDHeavyMetalItemData(am, ah.ap.ItemId).ShowDialog());
                    }
                }
                // if Verif + (cal curve or KA) get heavy metal data
                if (am.Has(AnalysisMethod.KnownA))
                {
                    INCCAnalysisParams.known_alpha_rec ka = (INCCAnalysisParams.known_alpha_rec)am.GetMethodParameters(AnalysisMethod.KnownA);
                    if (ka.known_alpha_type == INCCAnalysisParams.KnownAlphaVariant.HeavyMetalCorrection)
                    {
                        dlgres = (new IDDHeavyMetalItemData(am, ah.ap.ItemId).ShowDialog());
                    }
                }
                // if Verif + curium ratio, get cm_pu_ratio w dlg;
                if (am.Has(AnalysisMethod.CuriumRatio))
                {
                    dlgres = (new IDDCmPuRatio(ah.ap).ShowDialog());
                }
                res = (dlgres == DialogResult.OK);
            }
            else
            {
                MessageBox.Show(string.Format("No analysis methods specified for detector {0} and material {1}", ah.ap.detector_id, ah.ap.item_type),
                                "Verification", MessageBoxButtons.OK);
            }
            return(res);
        }
Beispiel #6
0
        private void OKBtn_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            //If they didn't load a passive measurement from the DB, so measure it.

            if (passive == null)
            {
                ItemId Cur = NC.App.DB.ItemIds.Get(ap.item_id);
                Cur.IsoApply(NC.App.DB.Isotopics.Get(ap.isotopics_id));           // apply the iso dates to the item

                NC.App.DB.ItemIds.Set();  // writes any new or modified item ids to the DB
                NC.App.DB.ItemIds.Refresh();    // save and update the in-memory item list 

                if (DialogResult == DialogResult.OK)
                {
                    Visible = false;
                    // Add strata update to measurement object.    HN 9.23.2015              
                    UIIntegration.Controller.SetAssay();  // tell the controller to do an assay operation using the current measurement state
                    UIIntegration.Controller.Perform();  // start the measurement file or DAQ thread
                }
                DialogResult = DialogResult.None;
                passive = NCC.CentralizedState.App.Opstate.Measurement;
            }
            else // We've got the passive data, go ahead and get the active cycles
            {
                Visible = false;
                INCCAnalysisParams.collar_combined_rec ka = (INCCAnalysisParams.collar_combined_rec)am.GetMethodParameters(AnalysisMethod.CollarAmLi);
                Integ.BuildMeasurement(ap, Integ.GetCurrentAcquireDetector(), AssaySelector.MeasurementOption.verification);
                Integ.PersistDetectorAndAssociations(Integ.GetCurrentAcquireDetector());
                //active = new Measurement(AssaySelector.MeasurementOption.verification, NC.App.Loggers.DataLogger);
                //active.InitializeResultsSummarizers();
                //active.InitializeContext(true);
                //active.Persist();
                // Add strata update to measurement object.    HN 9.23.2015              
                UIIntegration.Controller.SetAssay();  // tell the controller to do an assay operation using the current measurement state
                UIIntegration.Controller.Perform();  // start the measurement file or DAQ thread
                Close();
            }
        }