Exemplo n.º 1
0
 private void LMAnalyzers_SelectedIndexChanged(object sender, EventArgs e)
 {
     string s = (string)((CheckedListBox)sender).SelectedItem;
     AWAnalysisType at = CheckBoxTextMap(s);
     if (at != AnalysisType)
     {
         AnalysisType = at;
         ShowCurrentAnalzyerSelection(); // do refresh here
     }
 }
Exemplo n.º 2
0
        private void UpdateUI()
        {
            if (state == AWSteps.Step1)
            {
                this.Step1ControlsPanel.Visible = true;
            }
            else
            {
                this.Step1ControlsPanel.Visible = false;
            }

            if (state == AWSteps.Step2A)
            {
                LoadParams(state);
                this.Step2APanel.Left = 4;
                this.Step2APanel.Top = 6;
                this.Step2APanel.Visible = true;
                if (det != null)
                {
                    Step2ADetCB.SelectedItem = det;
                }
            }
            else
            {
                this.Step2APanel.Visible = false;
            }

            if (state == AWSteps.Step2B)
            {
                LoadParams(state);
                this.Step2BPanel.Visible = true;
                if (det != null)
                {
                    Step2BDetectorComboBox.SelectedItem = det;
                    Step2BNextBtn.Enabled = true;
                }
                else Step2BNextBtn.Enabled = false;
            }
            else
            {
                this.Step2BPanel.Visible = false;
            }

            if (state == AWSteps.Step3)
            {
                if (AnalysisType == AWAnalysisType.NullType)
                    AnalysisType = AWAnalysisType.Feynman;  // default when nothing else known
                this.DescriptionLabel.Text = "Select an analysis method.";
                this.DiagramPanel.BackgroundImage = null;
                this.CMCCCTimingParamsGroupBox.Visible = false;
                this.FeynmanTimingParamsGroupBox.Visible = false;
                this.MultFastAccTimingParamsGroupBox.Visible = false;
                this.DescriptionLabel.Top = 150;
                this.Step3Panel.Visible = true;
                this.LMAnalyzers.Visible = true;
                LoadParams(state);

                this.Step3NextBtn.Enabled = true;   // enable this because there are always valid useful values now

            }
            else
            {
                this.Step3Panel.Visible = false;
            }

            if (state == AWSteps.Step4)
            {
                this.Step4Panel.Visible = true;
                this.Step4SaveAndExit.Enabled = true;
                // Fill in data source and output
                if (ap.data_src.Live())
                {
                    this.Step4DataSourceTextBox.Text = this.Step2BDetectorComboBox.Text;
                    this.Step4OutputDirTextBox.Text = this.Step2BOutputDirectoryTextBox.Text;
                    // Do something like this if you want the detector configuration to come after analysis setup rather than as part of detector definition during Step 2B.
                    // this.Step4NextBtn.Text = "Configure Detector";   
                }
                else
                {
                    // Fill in the input location text box, starting with the file type
                    if (this.Step2NCDRadioBtn.Checked)
                    {
                        this.Step4DataSourceTextBox.Text = "NCD files in ";
                    }
                    else if (this.Step2SortedPulseRadioBtn.Checked)
                    {
                        this.Step4DataSourceTextBox.Text = "Sorted pulse files in ";
                        if (this.Step2ConvertSPtoNCDCheckBox.Checked)
                        {
                            converting = true;
                        }
                    }
                    else if (this.Step2PTR32RadioBtn.Checked)
                    {
                        this.Step4DataSourceTextBox.Text = "PTR32 dual file streams in ";
                        if (this.Step2ConvertPTR32toNCDCheckBox.Checked)
                        {
                            converting = true;
                        }
                    }
                    else if (this.Step2NILA2RadioBtn.Checked)
                    {
                        this.Step4DataSourceTextBox.Text = "NILA dual file streams in ";
                        if (this.Step2ConvertNILAtoNCDCheckBox.Checked)
                        {
                            converting = true;
                        }
                    }
                    else
                    {
                        this.Step4DataSourceTextBox.Text = "";
                    }

                    // Add the input file directory string
                    this.Step4DataSourceTextBox.Text += this.Step2InputDirectoryTextBox.Text;

                    // Make note of any input file special handling checkboxes
                    if (this.Step2RecurseCheckBox.Checked)
                    {
                        this.Step4DataSourceTextBox.Text += " (recursive)";
                    }

                    if (converting)
                    {
                        this.Step4DataSourceTextBox.Text += ", converting input files to NCD";
                    }

                    // Fill in the output location text box
                    this.Step4OutputDirTextBox.Text = this.Step2OutputDirectoryTextBox.Text;
                }

                // Fill in analysis method and parameters 
                switch (AnalysisType)
                {
                    case AWAnalysisType.CoinMat:
                        this.Step4AnalysisMethodTextBox.Text = "Coincidence Matrix Channel Correlation Counting";
                        this.Step4Param1TextBox.Text = this.CMCCCInitDelayTextBox.Text;
                        this.Step4Param2TextBox.Text = this.CMCCCGateWidthTextBox.Text;
                        this.Step4Param3TextBox.Text = this.CMCCCLongDelayTextBox.Text;
                        this.Step4Param2TextBox.Visible = true;
                        this.Step4Param2Label.Visible = true;
                        this.Step4Param3TextBox.Visible = true;
                        this.Step4Param3Label.Visible = true;
                        this.Step4Param2UnitsLabel.Visible = true;
                        this.Step4Param3UnitsLabel.Visible = true;
                        break;
                    case AWAnalysisType.Event:
                        this.Step4AnalysisMethodTextBox.Text = "Event Spacing Analysis";
                        this.Step4Param1TextBox.Text = this.SharedGateWidthTextBox.Text;
                        this.Step4Param2TextBox.Visible = false;
                        this.Step4Param2Label.Visible = false;
                        this.Step4Param3TextBox.Visible = false;
                        this.Step4Param3Label.Visible = false;
                        this.Step4Param2UnitsLabel.Visible = false;
                        this.Step4Param3UnitsLabel.Visible = false;
                        break;
                    case AWAnalysisType.Feynman:
                        this.Step4AnalysisMethodTextBox.Text = "Feynman Analysis";
                        this.Step4Param1TextBox.Text = this.SharedGateWidthTextBox.Text;
                        this.Step4Param2TextBox.Visible = false;
                        this.Step4Param2Label.Visible = false;
                        this.Step4Param3TextBox.Visible = false;
                        this.Step4Param3Label.Visible = false;
                        this.Step4Param2UnitsLabel.Visible = false;
                        this.Step4Param3UnitsLabel.Visible = false;
                        break;
                    case AWAnalysisType.Mult:
                        this.Step4AnalysisMethodTextBox.Text = "Multiplicity Analysis with Conventional Accidentals";
                        this.Step4Param1TextBox.Text = this.MultConvAccInitDelayTextBox.Text;
                        this.Step4Param2TextBox.Text = this.MultConvAccGateWidthTextBox.Text;
                        this.Step4Param3TextBox.Text = this.MultConvAccClockWidthTextBox.Text;
                        this.Step4Param2TextBox.Visible = true;
                        this.Step4Param2Label.Visible = true;
                        this.Step4Param3TextBox.Visible = true;
                        this.Step4Param3Label.Visible = true;
                        this.Step4Param2UnitsLabel.Visible = true;
                        this.Step4Param3UnitsLabel.Visible = true;
                        break;
                    case AWAnalysisType.MultFast:
                        this.Step4AnalysisMethodTextBox.Text = "Multiplicity Analysis with Fast Accidentals";
                        this.Step4Param1TextBox.Text = this.MultFastAccInitDelayTextBox.Text;
                        this.Step4Param2TextBox.Text = this.MultFastAccGateWidthTextBox.Text;
                        this.Step4Param3TextBox.Text = this.MultFastAccClockWidthTextBox.Text;
                        this.Step4Param2TextBox.Visible = true;
                        this.Step4Param2Label.Visible = true;
                        this.Step4Param3TextBox.Visible = true;
                        this.Step4Param3Label.Visible = true;
                        this.Step4Param2UnitsLabel.Visible = true;
                        this.Step4Param3UnitsLabel.Visible = true;
                        break;
                    case AWAnalysisType.Rossi:
                        this.Step4AnalysisMethodTextBox.Text = "Rossi-Alpha Analysis";
                        this.Step4Param1TextBox.Text = this.SharedGateWidthTextBox.Text;
                        this.Step4Param2TextBox.Visible = false;
                        this.Step4Param2Label.Visible = false;
                        this.Step4Param3TextBox.Visible = false;
                        this.Step4Param3Label.Visible = false;
                        this.Step4Param2UnitsLabel.Visible = false;
                        this.Step4Param3UnitsLabel.Visible = false;
                        break;
                    case AWAnalysisType.Rates:
                        this.Step4AnalysisMethodTextBox.Text = "Rates Analysis";
                        this.Step4Param1TextBox.Text = this.SharedGateWidthTextBox.Text;
                        this.Step4Param2TextBox.Visible = false;
                        this.Step4Param2Label.Visible = false;
                        this.Step4Param3TextBox.Visible = false;
                        this.Step4Param3Label.Visible = false;
                        this.Step4Param2UnitsLabel.Visible = false;
                        this.Step4Param3UnitsLabel.Visible = false;
                        break;
                    default:
                        break;
                }
            }
            else
            {
                this.Step4Panel.Visible = false;
            }
        }