Example #1
0
        private void OKButton_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(DetectorIdTextBox.Text))
            {
                Detector newdet = null;
                if (srtype)
                {
                    newdet = Integ.CreateDetectorWithAssociations(model, DetectorIdTextBox.Text, ElectronicsIdTextBox.Text, DetectorTypeTextBox.Text);
                    IDDShiftRegisterSetup f = new IDDShiftRegisterSetup(newdet); // copies updated SR PAram value to the newdet instance, database persist follows below
                    f.ShowDialog();
                    if (f.DialogResult == System.Windows.Forms.DialogResult.OK)
                    {
                        // new behavior: newdet.SRParams has the changes already;
                    }
                }
                else
                {
                    newdet = Integ.CreateDetectorWithAssociations(model, DetectorIdTextBox.Text, ElectronicsIdTextBox.Text, DetectorTypeTextBox.Text, (InstrType)LMTypes.SelectedItem);

                    AcquireParameters  acq = Integ.GetCurrentAcquireParams();
                    LMConnectionParams f   = new LMConnectionParams(newdet, acq, false);
                    f.StartWithLMDetail();
                    f.ShowDialog();
                    if (f.DialogResult == DialogResult.OK)
                    {
                    }
                }
                Integ.PersistDetectorAndAssociations(newdet);
                RefreshDetectorCombo(); // Assuming the detector was added to the internal detector list by CreateDetectorWithAssociations, this will add a new detector to the detector list

                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
        }
Example #2
0
        private void EditBtn_Click(object sender, EventArgs e)
        {
            AcquireParameters acq = null;

            acq = Integ.GetCurrentAcquireParamsFor(det);

            LMConnectionParams f = new LMConnectionParams(det, acq, false);

            f.StartWithLMDetail();
            f.ShowDialog();
            if (f.DialogResult == DialogResult.OK)  // update performed in OK EH
            {
            }
        }
Example #3
0
        private void OKButton_Click(object sender, EventArgs e)
        {
            //Check for cloning.
            if (CloneCheckbox.Checked)
            {
                //Make sure they selected a clone source
                if (CloneSourceCombo.SelectedIndex != -1)
                {
                    //We have a valid sourc
                    Detector from = (Detector)CloneSourceCombo.SelectedItem;
                }
            }
            if (String.IsNullOrEmpty(DetectorIdTextBox.Text))
            {
                DialogResult = DialogResult.Cancel;
                return;
            }
            Detector newdet = null;

            if (srtype)
            {
                newdet = Integ.CreateDetectorWithAssociations(model, DetectorIdTextBox.Text, ElectronicsIdTextBox.Text, DetectorTypeTextBox.Text);
                IDDShiftRegisterSetup f = new IDDShiftRegisterSetup(newdet); // copies updated SR Param value to the newdet instance, database persist follows below
                f.ShowDialog();
                if (f.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    // new behavior: newdet.SRParams has the changes already;
                }
                Integ.PersistDetectorAndAssociations(newdet);
            }
            else
            {
                newdet = Integ.CreateDetectorWithAssociations(model, DetectorIdTextBox.Text, ElectronicsIdTextBox.Text, DetectorTypeTextBox.Text, (InstrType)LMTypes.SelectedItem);
                Integ.PersistDetectorAndAssociations(newdet);

                AcquireParameters  acq = Integ.GetCurrentAcquireParams();
                LMConnectionParams f   = new LMConnectionParams(newdet, acq, isnew: true);
                f.StartWithLMDetail();
                f.ShowDialog();
                if (f.DialogResult == DialogResult.OK)
                {
                }
            }
            RefreshDetectorCombo(); // Assuming the detector was added to the internal detector list by CreateDetectorWithAssociations, this will add a new detector to the detector list

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
Example #4
0
        private void SetupLMInstConnParamsClick(object sender, RoutedEventArgs e)
        {
            Detector          det = null;
            AcquireParameters acq = null;

            Integ.GetCurrentAcquireDetectorPair(ref acq, ref det);
            if (det.ListMode)
            {
                LMConnectionParams f = new LMConnectionParams(det, acq, false);
                f.StartWithLMDetail();
                f.ShowDialog();
            }
            else
            {
                SetupMeasParamsClick(sender, e);
            }
        }
Example #5
0
        private void toolStripMenuItem3_Click(object sender, EventArgs e)
        {
            Detector          det = null;
            AcquireParameters acq = null;

            Integ.GetCurrentAcquireDetectorPair(ref acq, ref det);
            if (det.ListMode)
            {
                LMConnectionParams f = new LMConnectionParams(det, acq, false);
                f.StartWithLMDetail();
                f.ShowDialog();
            }
            else
            {
                toolStripMenuItem2_Click(sender, e);
            }
        }
        private void EditBtn_Click(object sender, EventArgs e)
        {
            AcquireParameters acq = null;
            acq = Integ.GetCurrentAcquireParamsFor(det);

            LMConnectionParams f = new LMConnectionParams(det, acq, false);
            f.StartWithLMDetail();
            f.ShowDialog();
            if (f.DialogResult == DialogResult.OK)  // update performed in OK EH
            {

            }
        }
Example #7
0
        private void OKButton_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(DetectorIdTextBox.Text))
            {
                DialogResult = DialogResult.Cancel;
                return;
            }
            Detector newdet = null;
            if (srtype)
            {
                newdet = Integ.CreateDetectorWithAssociations(model, DetectorIdTextBox.Text, ElectronicsIdTextBox.Text, DetectorTypeTextBox.Text);
                IDDShiftRegisterSetup f = new IDDShiftRegisterSetup(newdet); // copies updated SR Param value to the newdet instance, database persist follows below
                f.ShowDialog();
                if (f.DialogResult == System.Windows.Forms.DialogResult.OK)
                {
                    // new behavior: newdet.SRParams has the changes already;
                }
                Integ.PersistDetectorAndAssociations(newdet);
            }
            else
            {
                newdet = Integ.CreateDetectorWithAssociations(model, DetectorIdTextBox.Text, ElectronicsIdTextBox.Text, DetectorTypeTextBox.Text, (InstrType)LMTypes.SelectedItem);
                Integ.PersistDetectorAndAssociations(newdet);

                AcquireParameters acq = Integ.GetCurrentAcquireParams();
                LMConnectionParams f = new LMConnectionParams(newdet, acq, isnew:true);
                f.StartWithLMDetail();
                f.ShowDialog();
                if (f.DialogResult == DialogResult.OK)
                {
                }
            }
            RefreshDetectorCombo(); // Assuming the detector was added to the internal detector list by CreateDetectorWithAssociations, this will add a new detector to the detector list

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }
Example #8
0
        private void ReviewDetector_Click(object sender, EventArgs e)
        {
            Detector d = (Detector)Step2BDetectorComboBox.SelectedItem;
            if (d == null)
                return;
            int idx = -1, i = 0;
            if (d != null)
                foreach (object o in this.Step2BDetectorComboBox.Items)
                {
                    if (o.ToString().CompareTo(d.ToString()) == 0)
                    {
                        idx = i;
                        break;
                    }
                    i++;
                }

            if (d.ListMode)
            {
                LMConnectionParams f = new LMConnectionParams(d, ap, false);
                f.StartWithLMDetail();
                f.ShowDialog();
                if (f.DialogResult == DialogResult.OK)
                {
                }
            }
            else
            {
                MeasSetup f = new MeasSetup();
                f.InitialSelection = idx;
                f.ShowDialog();
                if (f.DialogResult == true)
                {

                }
            }
        }
Example #9
0
 private void SetupLMInstConnParamsClick(object sender, RoutedEventArgs e)
 {
     Detector det =null;
     AcquireParameters acq = null;
     Integ.GetCurrentAcquireDetectorPair(ref acq, ref det);
     if (det.ListMode)
     {
         LMConnectionParams f = new LMConnectionParams(det, acq, false);
         f.StartWithLMDetail();
         f.ShowDialog();
     }
     else
     {
         SetupMeasParamsClick(sender, e);
     }
 }
Example #10
0
 private void toolStripMenuItem3_Click(object sender, EventArgs e)
 {
     Detector det =null;
     AcquireParameters acq = null;
     Integ.GetCurrentAcquireDetectorPair(ref acq, ref det);
     if (det.ListMode)
     {
         LMConnectionParams f = new LMConnectionParams(det, acq, false);
         f.StartWithLMDetail();
         f.ShowDialog();
     }
     else
     {
         toolStripMenuItem2_Click(sender, e);
     }
 }