예제 #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();
            }
        }
예제 #2
0
        private void SetupMeasParamsClick(object sender, RoutedEventArgs e)
        {
            Detector det = Integ.GetCurrentAcquireDetector();

            IDDShiftRegisterSetup f = new IDDShiftRegisterSetup(det);

            if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)  // copy SR and SR type/baud params to the current detector obj, then do the DB push
            {
                //det.SRParams.CopyValues(f.sr);
                // only SR values copied here, changes to baud and det type (not on SRParams) already copied in dlg OK event
                // NEXT: if type changed from SR to LMMM, call up the LMMM dialogs now
                //NC.App.DB.UpdateDetector(det);
            }
        }
예제 #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();
        }
예제 #4
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();
        }
예제 #5
0
 private void SetupMeasParamsClick(object sender, RoutedEventArgs e)
 {
     Detector det = Integ.GetCurrentAcquireDetector();
  
     IDDShiftRegisterSetup f = new IDDShiftRegisterSetup(det);
     if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)  // copy SR and SR type/baud params to the current detector obj, then do the DB push
     {
         //det.SRParams.CopyValues(f.sr);
         // only SR values copied here, changes to baud and det type (not on SRParams) already copied in dlg OK event 
         // NEXT: if type changed from SR to LMMM, call up the LMMM dialogs now
         //NC.App.DB.UpdateDetector(det);
     }
     
 }