Пример #1
0
        private void OKBtn_Click(object sender, EventArgs e)
        {
            DialogResult r = DialogResult.Ignore;

            switch (np.biasMode)
            {
            case NormTest.AmLiSingles:
                IDDAmLiNormalization dlg = new IDDAmLiNormalization(np);
                r = dlg.ShowDialog(this);
                break;

            case NormTest.Cf252Doubles:
                IDDCf252Normalization dlg2 = new IDDCf252Normalization(np);
                r = dlg2.ShowDialog(this);
                break;

            case NormTest.Cf252Singles:
                IDDCf252SinglesNorm dlg3 = new IDDCf252SinglesNorm(np);
                r = dlg3.ShowDialog(this);
                break;

            case NormTest.Collar:
                IDDCollarNormalization dlg4 = new IDDCollarNormalization(np);
                r = dlg4.ShowDialog(this);
                break;
            }
            if (r == DialogResult.OK)
            {
                /* if normalization constant or error has changed then set
                 *  the measured rate and error to zero. */
                //This was blowing chunks and I don't know why.
                NormParameters onp = NC.App.DB.NormParameters.GetMap()[det];
                if ((onp.currNormalizationConstant.v != np.currNormalizationConstant.v) ||
                    onp.currNormalizationConstant.err != np.currNormalizationConstant.err)
                {
                    np.measRate.Zero();
                }
                // copy changes back to original on user affirmation
                NC.App.DB.NormParameters.GetMap()[det] = np; // in the in-memory map
                NC.App.DB.NormParameters.Set(det, np);       // in the database

                np.modified = false;
                this.Close();
            }
        }
Пример #2
0
        private void OKBtn_Click(object sender, EventArgs e)
        {
            DialogResult r = DialogResult.Ignore; 
            switch (np.biasMode)
            {
                case NormTest.AmLiSingles:
                    IDDAmLiNormalization dlg = new IDDAmLiNormalization(np);
                    r = dlg.ShowDialog(this);
                    break;
                case NormTest.Cf252Doubles:
                    IDDCf252Normalization dlg2 = new IDDCf252Normalization(np);
                    r = dlg2.ShowDialog(this);
                    break;
                case NormTest.Cf252Singles:
                    IDDCf252SinglesNorm dlg3 = new IDDCf252SinglesNorm(np);
                    r = dlg3.ShowDialog(this);
                    break;
                case NormTest.Collar:
                    IDDCollarNormalization dlg4 = new IDDCollarNormalization(np);
                    r = dlg4.ShowDialog(this);
                    break;
            }
            if (r == DialogResult.OK)
            {
                /* if normalization constant or error has changed then set
                    the measured rate and error to zero. */
                NormParameters onp = NC.App.DB.NormParameters.GetMap()[det];
                if ((onp.currNormalizationConstant.v != np.currNormalizationConstant.v) ||
                        onp.currNormalizationConstant.err != np.currNormalizationConstant.err)
                {
                    np.measRate.Zero();
                }
                // copy changes back to original on user affirmation
                NC.App.DB.NormParameters.GetMap()[det] = np;  // in the in-memory map
                NC.App.DB.NormParameters.Set(det,np);  // in the database

                np.modified = false;
                this.Close();
            }
        }