//void Form_CoarsePositioner_KeyPress(object sender, KeyPressEventArgs e)
        //{
        //    if (e.KeyChar >= 48 && e.KeyChar <= 57)
        //    {
        //        //MessageBox.Show("Form.KeyPress: '" +
        //        //    e.KeyChar.ToString() + "' pressed.");

        //        //switch (e.KeyChar)
        //        //{
        //        //    case (char)49:
        //        //    case (char)52:
        //        //    case (char)55:
        //        //        MessageBox.Show("Form.KeyPress: '" +
        //        //            e.KeyChar.ToString() + "' consumed.");
        //        //        e.Handled = true;
        //        //        break;
        //        //}
        //    }
        //}
        uint GetGuiFrequency()
        {
            uint f = Convert.ToUInt32(textBox_Frequency.Text);

            f = pParent.MIN_MAX(f, 1, 2000);
            textBox_Frequency.Text = f.ToString();
            return(f);
        }
Beispiel #2
0
        private void button_P_Click(object sender, EventArgs e)
        {
            int    axis     = listBox_ScannerAxis.SelectedIndex;
            double value_01 = Convert.ToDouble(textBox_Position_Value.Text);

            value_01 += 0.1;
            value_01  = pParent.MIN_MAX(value_01, 0, 1);
            textBox_Position_Value.Text = value_01.ToString();
            pParent.set_output_Position_Value_01(axis + 100, value_01);
        }
        public double[,] Calculate_Line(double[,] mImageArray, int point_now_y, int fit_order = 1, int index_base_point = 1)
        {
            //ref double[,] line_show,
            try
            {
                int L = mImageArray.GetLength(0);
                double[,] line_in = new double[1, L];
                if (point_now_y > 1)
                {
                    point_now_y--;                 // show last line
                }
                point_now_y = pParent.MIN_MAX(point_now_y, 1, mImageArray.GetLength(1));
                for (int k = 0; k < L; k++)
                {
                    line_in[0, k] = mImageArray[k, point_now_y - 1];
                }



                object Oline_show        = null;// (object)line_show;
                object Oline_in          = (object)line_in;
                object Ofit_order        = (object)fit_order;
                object Oindex_base_point = (object)index_base_point;

                pParent.mKernelClass.AFM_line_for_show(1, ref Oline_show, Oline_in, Ofit_order, Oindex_base_point);

                double[,] line_show = (double[, ])Oline_show;
                return(line_show);
            }
            catch
            {
                double[,] line_show = new double[1, 512];
                return(line_show);
            }
        }