Example #1
0
        void UpdateIsotopics(bool straight)      // straight means from iso button
        {
            IDDIsotopics f   = new IDDIsotopics(ah.ap.isotopics_id);
            DialogResult dlg = f.ShowDialog();

            if (dlg != DialogResult.OK)
            {
                return;
            }
            ah.RefreshParams();
            Isotopics selected = f.GetSelectedIsotopics;

            if (ah.ap.isotopics_id != selected.id) /* They changed the isotopics id. Isotopics already saved to DB in IDDIsotopics*/
            {
                ah.ap.isotopics_id = selected.id;
                // NEXT: do new item id stuff right after this
            }
            else if (straight)     // same iso name from iso selector but params might have changed, new item id application update occurs elsewhere
            {
                // isotopic settings will be loaded from DB prior to running measurement

                // change the isotopics setting on the current item id state
                ItemId Cur = NC.App.DB.ItemIds.Get(ah.ap.item_id);
                if (Cur == null)                         // blank or unspecified somehow
                {
                    return;
                }
                Cur.IsoApply(NC.App.DB.Isotopics.Get(ah.ap.isotopics_id));           // apply the iso dates to the item
                Cur.modified = true;
            }
        }
Example #2
0
        void UpdateIsotopics(bool straight)      // straight means from iso button
        {
            IDDIsotopics f   = new IDDIsotopics(ah.ap.isotopics_id);
            DialogResult dlg = f.ShowDialog();

            if (dlg != DialogResult.OK)
            {
                return;
            }
            ah.RefreshParams();
            Isotopics selected = f.GetSelectedIsotopics;

            if (ah.ap.isotopics_id != selected.id) /* They changed the isotopics id. Isotopics already saved to DB in IDDIsotopics*/
            {
                ah.ap.isotopics_id = selected.id;
            }
            // change the isotopics setting on the current item id state
            ItemId Cur = NC.App.DB.ItemIds.Get(ah.ap.item_id);

            if (Cur == null)                             // blank or unspecified somehow
            {
                return;
            }
            Cur.IsoApply(NC.App.DB.Isotopics.Get(ah.ap.isotopics_id));               // apply the iso dates to the item
            Cur.modified = true;
        }
Example #3
0
        private void CompositeIsotopicsBtn_Click(object sender, EventArgs e)
        {
            IDDCompositeIsotopics f   = new IDDCompositeIsotopics(ah.ap.comp_isotopics_id);
            DialogResult          dlg = f.ShowDialog();

            if (dlg != DialogResult.OK)
            {
                return;
            }
            ah.RefreshParams();
            CompositeIsotopics selected = f.GetSelectedIsotopics;

            if (ah.ap.isotopics_id != selected.id) /* They changed the isotopics id.  Isotopics already saved to DB in IDDIsotopics*/
            {
                ah.ap.isotopics_id      = selected.id;
                ah.ap.comp_isotopics_id = selected.id;
                // NEXT: do new item id stuff right after this
            }
            else
            {
                // isotopic settings will be loaded from DB prior to running measurement

                // change the isotopics setting on the current item id state
                ItemId Cur = NC.App.DB.ItemIds.Get(ah.ap.item_id);
                if (Cur == null)                         // blank or unspecified somehow
                {
                    return;
                }
                Cur.IsoApply(NC.App.DB.Isotopics.Get(ah.ap.isotopics_id)); // apply the iso dates to the item
                NC.App.DB.ItemIds.Set(Cur);
                NC.App.DB.ItemIds.Refresh();                               // save and update the list of items
            }
        }