예제 #1
0
        private void clear_sample()
        {
            timerDraw.Stop();
            timerDrawI = 0;

            x1.Clear();
            y1.Clear();
            LGraphTest.f_ClearAllPix();
            lbl_status.Text = "SAMPLING DATA CLEARED.";
        }
예제 #2
0
        private void Btn_start_sample_Click(object sender, EventArgs e)   //   Button1_Click
        {
            btn_start_sample.Enabled = false;
            Thread.Sleep(100);

            if (checkBox_manul.Checked)
            {
                sendCount = 1;
                ToggleControls(true);
                btn_start_sample.Enabled = false;
                btn_stop_sample.Enabled  = true;
                lbl_test_time.Visible    = true;


                this.Focus();


                x1.Clear();
                y1.Clear();

                // x2.Clear();
                // y2.Clear();
                //  x3.Clear();
                //  y3.Clear();
                //  x4.Clear();
                //  y4.Clear();
                LGraphTest.f_ClearAllPix();
                LGraphTest.f_reXY();
                if (checkBox_scatter.Checked)
                {
                    LGraphTest.f_LoadOnePix(ref x1, ref y1, Color.Red, 2, LineJoin.Round, LineCap.NoAnchor, LILEI.UI.LGraph.DrawStyle.dot);
                }                                                                                                                                                           // scatter
                else
                {
                    LGraphTest.f_LoadOnePix(ref x1, ref y1, Color.Red, 2);
                }                                                                  //curve

                //    LGraphTest.f_AddPix(ref x2, ref y2, Color.Blue, 3);
                //  LGraphTest.f_AddPix(ref x3, ref y3, Color.FromArgb(0, 128, 192), 2);
                //  LGraphTest.f_AddPix(ref x4, ref y4, Color.Yellow, 3);

                f_timerDrawStart(); //start sample timer



                lbl_status.Text = "SAMPLING[Period " + tb_sample_frequency.Text + "s]";

                //test timer label
                //开始计时
                test_timer.Start();
                TimeCount = 0;
            }
            else      //采样周期
            {
                //ToggleControls(true);
                lbl_test_time.Visible = false;

                //list add serial data

                this.Focus();

                tb_sample_frequency.Text = "";
                //  tb_sample_frequency.Enabled = false;


                // x1.Clear();
                // y1.Clear();
                // LGraphTest.f_ClearAllPix();
                LGraphTest.f_reXY();
                if (checkBox_scatter.Checked)
                {
                    LGraphTest.f_LoadOnePix(ref x1, ref y1, Color.Red, 2, LineJoin.Round, LineCap.NoAnchor, LILEI.UI.LGraph.DrawStyle.dot);
                }                                                                                                                                                           // scatter
                else
                {
                    LGraphTest.f_LoadOnePix(ref x1, ref y1, Color.Red, 2);
                }


                foh100_state();
                Thread.Sleep(500);
                foh100_onu();
                btn_start_sample.Enabled = true;
            }


            btn_clear_graph.Enabled = true;
        }