예제 #1
0
        private void CreateMultiplicityAnalyzer()
        {
            //Make sure we have a default analyzer for the LM instrument with parms as set in measurement parameters.
            ah.det.MultiplicityParams.gateWidthTics = (ulong)ah.det.SRParams.gateLengthMS * 10;
            if (ah.det.MultiplicityParams.FA == FAType.FAOn)
            {
                ah.det.MultiplicityParams.BackgroundGateTimeStepInTics = 10;
                ah.det.MultiplicityParams.AccidentalsGateDelayInTics   = 10;
            }
            else
            {
                //Default long delay = 4096 for slow.
                ah.det.MultiplicityParams.BackgroundGateTimeStepInTics = 40960;
                ah.det.MultiplicityParams.AccidentalsGateDelayInTics   = 40960;
            }
            // prepare analyzer params from detector SR params and only activate the SRParms analyzer for rates only
            CountingAnalysisParameters AnalysisParams = NCC.CentralizedState.App.LMBD.CountingParameters(ah.det, true);

            foreach (SpecificCountingAnalyzerParams existing in AnalysisParams)
            {
                existing.Active = false;
            }
            if (!AnalysisParams.Exists(w => { return((w is Multiplicity) && (w as Multiplicity).Equals(ah.det.MultiplicityParams)); }))
            {
                AnalysisParams.Insert(0, ah.det.MultiplicityParams);
            }
            SpecificCountingAnalyzerParams currentParms = AnalysisParams.Find(w => { return((w is Multiplicity) && (w as Multiplicity).Equals(ah.det.MultiplicityParams)); });

            currentParms.Active = true;
            currentParms.Rank   = 0;
            NCC.CentralizedState.App.DB.UpdateDetectorParams(ah.det);
            NCC.CentralizedState.App.DB.UpdateAcquireParams(ah.det);
            NCC.CentralizedState.App.LMBD.UpdateCounters(ah.det, AnalysisParams);
        }
예제 #2
0
        public IDDAcquireRatesOnly()
        {
            InitializeComponent();

            // Generate an instance of the generic acquire dialog event handlers object (this now includes the AcquireParameters object used for change tracking)
            ah    = new AcquireHandlers();
            ah.mo = AssaySelector.MeasurementOption.rates;
            Text += " for detector " + ah.det.Id.DetectorName;

            // Populate the UI fields with values from the local AcquireParameters object
            QCTestsCheckbox.Checked      = ah.ap.qc_tests;
            PrintResultsCheckBox.Checked = ah.ap.print;
            CommentAtEndCheckBox.Checked = ah.ap.ending_comment;
            NumCyclesTextBox.Text        = Format.Rend(ah.ap.num_runs);
            CommentTextBox.Text          = ah.ap.comment;
            CountTimeTextBox.Text        = Format.Rend(ah.ap.run_count_time);
            ItemIdTextBox.Text           = ah.ap.item_id;
            MeasPrecisionTextBox.Text    = ah.ap.meas_precision.ToString("F2");
            MinNumCyclesTextBox.Text     = Format.Rend(ah.ap.min_num_runs);
            MaxNumCyclesTextBox.Text     = Format.Rend(ah.ap.max_num_runs);
            if (ah.det.ListMode)
            {
                //Make sure we have a default analyzer for the LM instrument with parms as set in measurement parameters.
                ah.det.MultiplicityParams.gateWidthTics = (ulong)ah.det.SRParams.gateLengthMS * 10;
                if (ah.det.MultiplicityParams.FA == FAType.FAOn)
                {
                    ah.det.MultiplicityParams.AccidentalsGateDelayInTics = 10;
                }
                else
                {
                    ah.det.MultiplicityParams.AccidentalsGateDelayInTics = 40960;
                }
                // prepare analyzer params from detector SR params and only activate the SRParms analyzer for rates only
                CountingAnalysisParameters AnalysisParams = NCC.CentralizedState.App.LMBD.CountingParameters(ah.det, true);
                foreach (SpecificCountingAnalyzerParams existing in AnalysisParams)
                {
                    existing.Active = false;
                }
                if (!AnalysisParams.Exists(w => { return((w is Multiplicity) && (w as Multiplicity).Equals(ah.det.MultiplicityParams)); }))
                {
                    AnalysisParams.Insert(0, ah.det.MultiplicityParams);
                }
                SpecificCountingAnalyzerParams currentParms = AnalysisParams.Find(w => { return((w is Multiplicity) && (w as Multiplicity).Equals(ah.det.MultiplicityParams)); });
                currentParms.Active = true;
                currentParms.Rank   = 0;
                NCC.CentralizedState.App.DB.UpdateDetectorParams(ah.det);
                NCC.CentralizedState.App.DB.UpdateAcquireParams(ah.det);
                NCC.CentralizedState.App.LMBD.UpdateCounters(ah.det, AnalysisParams);
            }

            DataSourceComboBox.Items.Clear();
            foreach (ConstructedSource cs in Enum.GetValues(typeof(ConstructedSource)))
            {
                if (cs.AcquireChoices() || cs.LMFiles(ah.det.Id.SRType))
                {
                    DataSourceComboBox.Items.Add(cs.NameForViewing(ah.det.Id.SRType));
                }
            }

            if (ah.ap.acquire_type == AcquireConvergence.CycleCount)
            {
                UseNumCyclesRadioButton.Checked = true;
            }
            else if (ah.ap.acquire_type == AcquireConvergence.DoublesPrecision)
            {
                UseDoublesRadioButton.Checked = true;
            }
            else if (ah.ap.acquire_type == AcquireConvergence.TriplesPrecision)
            {
                UseTriplesRadioButton.Checked = true;
            }
            DataSourceComboBox.SelectedItem = ah.ap.data_src.NameForViewing(ah.det.Id.SRType);
            SetHelp();
        }