예제 #1
0
        private void MakeED()
        {
            //Fill Rho array
            try
            {
                RhoCalc.IsOneSigma      = Holdsigma.Checked;
                RhoCalc.ZOffset         = Zoffset.ToDouble();
                RhoCalc.GetSubRoughness = SubRough.ToDouble();
                RhoCalc.BoxCount        = BoxCount.ToInt();
                RhoCalc.SubphaseSLD     = SubphaseSLD.ToDouble();
                RhoCalc.SuperphaseSLD   = SupSLDTB.ToDouble();

                //Blank our Rho data from the previous iteration
                RhoCalc.RhoArray.Clear();
                RhoCalc.LengthArray.Clear();
                RhoCalc.SigmaArray.Clear();

                BoxRhoArray.ForEach(p => RhoCalc.RhoArray.Add(p.ToDouble()));
                BoxLengthArray.ForEach(p => RhoCalc.LengthArray.Add(p.ToDouble()));
                BoxSigmaArray.ForEach(p => RhoCalc.SigmaArray.Add(p.ToDouble()));

                if (Holdsigma.Checked)
                {
                    ChangeRoughnessArray();
                }

                GreyFields();

                RhoCalc.UpdateProfile();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
예제 #2
0
 private void GreyFields()
 {
     for (int i = 0; i < 6; i++)
     {
         if (i < BoxCount.ToInt())
         {
             BoxRhoArray[i].Enabled   = BoxLengthArray[i].Enabled = true;
             BoxSigmaArray[i].Enabled = !Holdsigma.Checked;
         }
         else
         {
             BoxRhoArray[i].Enabled   = BoxLengthArray[i].Enabled = false;
             BoxSigmaArray[i].Enabled = false;
         }
     }
 }
예제 #3
0
        /// <summary>
        /// Checks to verify that the Textbox has valid numerical input. This check respects cultural variations
        /// in number entry.
        /// </summary>
        /// <param name="sender">A textbox is expected as input</param>
        /// <param name="e">return true if the number can be cast to an integer or false if not</param>
        protected void ValidateIntegerInput(object sender, System.ComponentModel.CancelEventArgs e)
        {
            try
            {
                base.OnValidating(e);

                HelperFunctions.ValidateIntegerInput(sender, e);

                if (((TextBox)sender).Name == "BoxCount")
                {
                    if (BoxCount.ToInt() > 6)
                    {
                        MessageBox.Show("Six is the maximum number of boxes");
                        e.Cancel = true;
                    }
                }
            }
            catch { }
        }
예제 #4
0
        private void MakeReflectivity()
        {
            //Fill Rho array
            try
            {
                ReflCalc.IsOneSigma          = Holdsigma.Checked;
                ReflCalc.ZOffset             = 25;
                ReflCalc.GetSubRoughness     = SubRough.ToDouble();
                ReflCalc.BoxCount            = BoxCount.ToInt();
                ReflCalc.SubphaseSLD         = SubphaseSLD.ToDouble();
                ReflCalc.SuperphaseSLD       = SupSLDTB.ToDouble();
                ReflCalc.HighQOffset         = Rightoffset.ToInt();
                ReflCalc.LowQOffset          = CritOffset.ToInt();
                ReflCalc.NormalizationFactor = NormCorrectTB.ToDouble();
                ReflCalc.ImpNormCB           = ImpNormCB.Checked;
                ReflCalc.QSpreadTB           = QSpreadTB.ToDouble();
                //Blank our Rho data from the previous iteration
                ReflCalc.RhoArray.Clear();
                ReflCalc.LengthArray.Clear();
                ReflCalc.SigmaArray.Clear();

                RhoArray.ForEach(p => ReflCalc.RhoArray.Add(p.ToDouble()));
                LengthArray.ForEach(p => ReflCalc.LengthArray.Add(p.ToDouble()));
                SigmaArray.ForEach(p => ReflCalc.SigmaArray.Add(p.ToDouble()));

                if (Holdsigma.Checked)
                {
                    ChangeRoughnessArray();
                }

                ReflCalc.UpdateProfile();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }