C#上位机系列——工控上位机示波器/ 绘图控件(二)

更新一下上位机的进度。

=========================================================================

1.给界面上了颜色。

2.增加至4个通道。

3.添加了放大缩小平移功能。

4.可选采样宽度。

5.添加了数据回显功能。

6.增加暂停显示和复位功能。

822b209005fc49ee8ddf12c0bb616663.gif43df8538bcee4340b6a914561c0753fa.gif

c2f47f82ef4845fc902661b6f534bd8e.gif

949b5d90b9dc406d96447cb3f796c99e.gif

其他功能待开发中。。。。。

此部分的功能代码如下,仅供参考:(全部做完整理完毕上传资源)

/*
 * 作者:zyh
 * qq:526482803
 * 日期:2020.5.12  武汉
 * 
 */


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ScopeDemo
{

    public partial class FrmScope : Form
    {

        Timer tim_Refresh = new Timer();  //示波器刷新定时器


        //示波器参数
        int scopeDataCount = 101;  //示波器显示数据个数(101个数)
        int scopeDataCountMax = 1001; //

        //控制示波器的总分辨率
        private float DrawStepX;//横向默认绘制单位(采样个数改变这个值就可以0.1=8000个 1=800个 10 = 80个)
        private float DrawStepY1; //纵向默认绘制单位
        private float DrawStepY2;
        private float DrawStepY3;
        private float DrawStepY4;
        private float PositionORI_1;    // 默认数值的0点(原点上下偏移)
        private float PositionORI_2;
        private float PositionORI_3;
        private float PositionORI_4;
        private int DataBackNum;  //回显数据个数


        //示波器大小
        private const int X_MaxLength = 800;//X轴最大数值  (X轴线长度)  80*10  固定值  示波器长宽(800,500)
        private const int Y_MaxLength = 440;//Y轴最大数值  (Y轴线长度)  50*10  固定值  (40整数倍数)

        //框1
        //Point P1_Start = new Point(20, 10 + Y_MaxLength);  //示波器1起始坐标(左下角)
        Point P1_Start_Frame = new Point(30, 30 + Y_MaxLength);    //示波器1框起始坐标

        private float Y_ValueMax = 4;   //示波器数据最大值
        private float Y_ValueMin = -4;  //示波器数据最小值


        //坐标轴线颜色  灰色
        private Pen TablePen = new Pen(Color.FromArgb(0x3c, 0x3c, 0x3c));
        Pen Dotpen = new Pen(Color.DarkSlateGray, 1); //虚线


        private Pen LinesPen1 = new Pen(Color.FromArgb(0xff, 0x00, 0x00),1f);//波形颜色  红色
        private Pen LinesPen2 = new Pen(Color.FromArgb(0x00, 0x99, 0xff));//波形颜色  蓝色
        private Pen LinesPen3 = new Pen(Color.FromArgb(0xff, 0x66, 0x00));//波形颜色  橙色
        private Pen LinesPen4 = new Pen(Color.FromArgb(0x66, 0xff, 0x33));//波形颜色  绿色

        //示波器显示用的数组
        public static volatile Queue<int> queCube1 = new Queue<int>(2001);//需要设定一个最大值
        public static volatile Queue<int> queCube2 = new Queue<int>(2001);
        public static volatile Queue<int> queCube3 = new Queue<int>(2001);
        public static volatile Queue<int> queCube4 = new Queue<int>(2001);

        int[] arrCube1 = new int[1001];
        int[] arrCube2 = new int[1001];
        int[] arrCube3 = new int[1001];
        int[] arrCube4 = new int[1001];

        bool enableCH1, enableCH2, enableCH3, enableCH4;
        bool ScopeRun = true; //暂停显示

        public FrmScope()
        {
            InitializeComponent();
            this.cmb_CH1.DataSource = new string[] { "1", "2", "5", "10", "20", "50", "100", "500", "1000" };
            this.cmb_CH2.DataSource = new string[] { "1", "2", "5", "10", "20", "50", "100", "500", "1000" };
            this.cmb_CH3.DataSource = new string[] { "1", "2", "5", "10", "20", "50", "100", "500", "1000" };
            this.cmb_CH4.DataSource = new string[] { "1", "2", "5", "10", "20", "50", "100", "500", "1000" };
            this.cmb_Point.DataSource = new string[] { "10", "20", "50", "100", "200", "500", "1000" };
            
            for (int i = 0; i < 1001; i++)  //必须提前填满,不然容易出BUG
            {
                queCube1.Enqueue(0);
                queCube2.Enqueue(0);
                queCube3.Enqueue(0);
                queCube4.Enqueue(0);
            }
            tim_Refresh.Tick += new System.EventHandler(this.tim_Refresh_Tick);
            //虚线笔设置
            Dotpen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom;
            Dotpen.DashPattern = new float[] { 1, 3 };

            ScopeInit(); //示波器设置参数更新
        }
        private void ScopeInit()
        {
            tim_Refresh.Stop();
            //设置初始化
            this.cmb_CH1.Text = "100";
            this.cmb_CH2.Text = "100";
            this.cmb_CH3.Text = "100";
            this.cmb_CH4.Text = "100";
            this.cmb_Point.Text = "100";  //默认100个点
            this.txt_CH1.Text = "0";
            this.txt_CH2.Text = "0";
            this.txt_CH3.Text = "0";
            this.txt_CH4.Text = "0";
            this.numericUpDown1.Value = 0;
            this.numericUpDown2.Value = 0;
            this.numericUpDown3.Value = 0;
            this.numericUpDown4.Value = 0;
            DataBackNum = 0;

            scopeDataCount = 101;
            Y_ValueMax = 4;   //示波器数据默认最大值
            Y_ValueMin = -4;  //示波器数据默认最小值
            //PositionORI = 0;    // 数值的0点(原点上下偏移)

            //示波器初始化
            //初始化坐标
            //每个数量单位对应像素(每个示波器x轴800像素,y轴500像素)
            DrawStepY1 = (Y_MaxLength) / (Y_ValueMax - Y_ValueMin)/ (float)(Convert.ToInt32(cmb_CH1.Text));  //(y轴长度/(最大值-最小值))
            DrawStepY2 = (Y_MaxLength) / (Y_ValueMax - Y_ValueMin) / (float)(Convert.ToInt32(cmb_CH2.Text));
            DrawStepY3 = (Y_MaxLength) / (Y_ValueMax - Y_ValueMin) / (float)(Convert.ToInt32(cmb_CH3.Text));
            DrawStepY4 = (Y_MaxLength) / (Y_ValueMax - Y_ValueMin) / (float)(Convert.ToInt32(cmb_CH4.Text));
            //根据示波器横轴容纳的采样点个数自适应x轴分辨率
            DrawStepX = X_MaxLength / (scopeDataCount - 1);  //(x轴长度/(数据个数-1))
            //原点偏移量
            PositionORI_1 = Y_MaxLength / 2;
            PositionORI_2 = Y_MaxLength / 2;
            PositionORI_3 = Y_MaxLength / 2;
            PositionORI_4 = Y_MaxLength / 2;
            tim_Refresh.Interval = 10;  //定时器刷新屏幕
            tim_Refresh.Start();

            SetStyle(ControlStyles.DoubleBuffer, true); // 设置双缓冲,防止图像抖动
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 忽略系统消息,防止图像闪烁
        }

        int a = 0;
        private void tim_Refresh_Tick(object sender, EventArgs e) //示波器定时器
        {
            //测试用
            //int a =new Random().Next(-50,50);
            if (a < 100)
            {
                a++;
            }
            else
            { a = 0; }

            //1
            queCube1.Dequeue();
            queCube1.Enqueue(a);
            //2
            queCube2.Dequeue();
            queCube2.Enqueue(a * 2);
            //3
            queCube3.Dequeue();
            queCube3.Enqueue(a * 3);
            //
            queCube4.Dequeue();
            queCube4.Enqueue(a * 4);


            //数据更新
            if (ScopeRun)
            {
                QueToArray(queCube1, arrCube1,cmb_CH1);
                QueToArray(queCube2, arrCube2,cmb_CH2);
                QueToArray(queCube3, arrCube3,cmb_CH3);
                QueToArray(queCube4, arrCube4,cmb_CH4);
            }
            //tim.Stop();  //

            Invalidate();//刷新显示        
        }


        private void QueToArray(Queue<int> que, int[] arr, ComboBox cmb) //把缓存通道数据放进数组
        {
            int i = 0;
            foreach (int num in que)
            {
                if (num > Y_ValueMax * Convert.ToInt32(cmb.Text))
                {
                    arr[i] = (int)Y_ValueMax * Convert.ToInt32(cmb.Text);
                }
                else if (num < -Y_ValueMax * Convert.ToInt32(cmb.Text))
                {
                    arr[i] = -(int)Y_ValueMax * Convert.ToInt32(cmb.Text);
                }
                else
                {
                    arr[i] = num;
                }
                i++;
            }
        }
        private void btn_CH1_Click(object sender, EventArgs e) //CH1btn
        {
            if (enableCH1 == false)
            {
                enableCH1 = true;
                btn_CH1.BackColor = Color.Red;
            }
            else
            {
                enableCH1 = false;
                btn_CH1.BackColor = Color.White;
            }
        }
        private void btn_CH2_Click(object sender, EventArgs e)
        {
            if (enableCH2 == false)
            {
                enableCH2 = true;
                btn_CH2.BackColor = Color.Blue;
            }
            else
            {
                enableCH2 = false;
                btn_CH2.BackColor = Color.White;
            }
        }
        private void btn_CH3_Click(object sender, EventArgs e)
        {
            if (enableCH3 == false)
            {
                enableCH3 = true;
                btn_CH3.BackColor = Color.Orange;
            }
            else
            {
                enableCH3 = false;
                btn_CH3.BackColor = Color.White;
            }
        }
        private void btn_CH4_Click(object sender, EventArgs e)
        {
            if (enableCH4 == false)
            {
                enableCH4 = true;
                btn_CH4.BackColor = Color.Green;
            }
            else
            {
                enableCH4 = false;
                btn_CH4.BackColor = Color.White;
            }
        }



        private void cmb_CHX_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                DrawStepY1 = (Y_MaxLength) / (Y_ValueMax - Y_ValueMin) / (float)(Convert.ToInt32(cmb_CH1.Text));
                DrawStepY2 = (Y_MaxLength) / (Y_ValueMax - Y_ValueMin) / (float)(Convert.ToInt32(cmb_CH2.Text));
                DrawStepY3 = (Y_MaxLength) / (Y_ValueMax - Y_ValueMin) / (float)(Convert.ToInt32(cmb_CH3.Text));
                DrawStepY4 = (Y_MaxLength) / (Y_ValueMax - Y_ValueMin) / (float)(Convert.ToInt32(cmb_CH4.Text));
            }
            catch { }

            string str = cmb_Point.Text;
            if (cmb_Point.Text != "")
            {
                scopeDataCount = Convert.ToInt32(cmb_Point.Text)+1;
                DrawStepX = X_MaxLength / (float)(scopeDataCount-1);  //(x轴长度/(数据个数-1))
            }
        }

        private void btn_Reset_Click_1(object sender, EventArgs e)
        {
            ScopeInit();
        }

        private void btn_Stop_Click(object sender, EventArgs e) //本质上是数据不更新了
        {
            if (btn_Stop.Text == "暂停")
            {
                ScopeRun = false;
                btn_Stop.Text = "继续";
            }
            else
            {
                ScopeRun = true;
                btn_Stop.Text = "暂停";
            }
        }

        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            PositionORI_1 = Y_MaxLength /2+((float)numericUpDown1.Value) * (Convert.ToInt32(txt_CH1.Text));
            PositionORI_2 = Y_MaxLength / 2 + ((float)numericUpDown2.Value) * (Convert.ToInt32(txt_CH2.Text));
            PositionORI_3 = Y_MaxLength / 2 + ((float)numericUpDown3.Value) * (Convert.ToInt32(txt_CH3.Text));
            PositionORI_4 = Y_MaxLength / 2 + ((float)numericUpDown4.Value) * (Convert.ToInt32(txt_CH4.Text));
        }



        private void Form_Paint(object sender, PaintEventArgs e)//画  
        {
            System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
            e.Graphics.FillRectangle(Brushes.Black, e.Graphics.ClipBounds);//背景色
                                                                           //
            float scaleline1 = (float)Y_MaxLength / 40; //纵轴刻线间距
            int scaleline2 = 5; //刻度线长度
            float scaleline3 = (float)X_MaxLength / 100; //横轴刻线间距
            float dotpenlineY = Y_MaxLength / 8; //纵轴线间距
            float dotpenlineX = X_MaxLength / 10; //横轴线间距

            //示波器1
            //Draw  横向轴绘制
            e.Graphics.DrawLine(TablePen, (float)P1_Start_Frame.X, (float)P1_Start_Frame.Y, (float)(P1_Start_Frame.X + X_MaxLength), (float)(P1_Start_Frame.Y));// StartPrint + Y_MaxLength);//画线  颜色  起点坐标 终点坐标 
            e.Graphics.DrawLine(TablePen, (float)P1_Start_Frame.X, (float)P1_Start_Frame.Y - Y_MaxLength, (float)(P1_Start_Frame.X + X_MaxLength), (float)P1_Start_Frame.Y - Y_MaxLength);
            //刻度横向
            for (int i = 1; i < 40; i++)
            {
                e.Graphics.DrawLine(TablePen, (float)P1_Start_Frame.X, (float)P1_Start_Frame.Y - i * scaleline1, (float)(P1_Start_Frame.X + scaleline2), (float)(P1_Start_Frame.Y - i * scaleline1));
                e.Graphics.DrawLine(TablePen, (float)P1_Start_Frame.X+ X_MaxLength, (float)P1_Start_Frame.Y - i * scaleline1, (float)(P1_Start_Frame.X - scaleline2+ X_MaxLength), (float)(P1_Start_Frame.Y - i * scaleline1));
                e.Graphics.DrawLine(TablePen, (float)P1_Start_Frame.X + X_MaxLength/2- (float)scaleline2/2, (float)P1_Start_Frame.Y - i * scaleline1, (float)P1_Start_Frame.X + X_MaxLength / 2 + (float)scaleline2 / 2, (float)(P1_Start_Frame.Y - i * scaleline1));
            }
            for (int i = 1; i <= 7; i++)
            {
                e.Graphics.DrawLine(Dotpen, (float)P1_Start_Frame.X, (float)P1_Start_Frame.Y- dotpenlineY * i, (float)(P1_Start_Frame.X + X_MaxLength), (float)(P1_Start_Frame.Y - dotpenlineY * i));
            }


            //Draw  纵向轴绘制
            e.Graphics.DrawLine(TablePen, (float)P1_Start_Frame.X, (float)P1_Start_Frame.Y, (float)P1_Start_Frame.X, (float)P1_Start_Frame.Y - Y_MaxLength);// StartPrint + Y_MaxLength);//画线  颜色  起点坐标 终点坐标 
            e.Graphics.DrawLine(TablePen, (float)(P1_Start_Frame.X + X_MaxLength), (float)(P1_Start_Frame.Y), (float)(P1_Start_Frame.X + X_MaxLength), (float)P1_Start_Frame.Y - Y_MaxLength);
            //刻度纵向
            for (int i = 1; i < 100; i++)
            {
                e.Graphics.DrawLine(TablePen, (float)P1_Start_Frame.X+ i * scaleline3, (float)P1_Start_Frame.Y, (float)P1_Start_Frame.X + i * scaleline3, (float)P1_Start_Frame.Y- scaleline2);
                e.Graphics.DrawLine(TablePen, (float)P1_Start_Frame.X + i * scaleline3, (float)P1_Start_Frame.Y- Y_MaxLength/2 - scaleline2 / 2, (float)P1_Start_Frame.X + i * scaleline3, (float)P1_Start_Frame.Y-Y_MaxLength / 2 + scaleline2/2);
                e.Graphics.DrawLine(TablePen, (float)P1_Start_Frame.X + i * scaleline3, (float)P1_Start_Frame.Y - Y_MaxLength, (float)P1_Start_Frame.X + i * scaleline3, (float)P1_Start_Frame.Y- Y_MaxLength + scaleline2);
            }
            for (int i = 1; i <= 10; i++)
            {
                e.Graphics.DrawLine(Dotpen, (float)P1_Start_Frame.X+i* dotpenlineX, (float)P1_Start_Frame.Y, (float)P1_Start_Frame.X+i * dotpenlineX, (float)P1_Start_Frame.Y - Y_MaxLength);
            }


            //坐标轴参数
            //gp.AddString(Y_ValueMin.ToString(), this.Font.FontFamily, (int)FontStyle.Regular, 10, new RectangleF(0, P1_Start_Frame.Y, 400, 50), null);//添加文字
            //e.Graphics.DrawPath(Pens.Blue, gp);    //显示文字

            if (enableCH1)
            {
                ShowLine(arrCube1, P1_Start_Frame, e, LinesPen1,DrawStepY1,PositionORI_1);//显示波形
            }
            if (enableCH2)
            {
                ShowLine(arrCube2, P1_Start_Frame, e, LinesPen2, DrawStepY2, PositionORI_2);//显示波形
            }
            if (enableCH3)
            {
                ShowLine(arrCube3, P1_Start_Frame, e, LinesPen3, DrawStepY3, PositionORI_3);//显示波形
            }
            if (enableCH4)
            {
                ShowLine(arrCube4, P1_Start_Frame, e, LinesPen4, DrawStepY4, PositionORI_4);//显示波形
            }
        }

        private void trackBar1_Scroll(object sender, EventArgs e)
        {
            int datanum = scopeDataCountMax - scopeDataCount;  //能够读取的个数
            DataBackNum = trackBar1.Value * datanum / 100;
            if (DataBackNum <= 0)
                DataBackNum = 0;
        }

        //绘制一个通道的波形  通道数组  坐标  事件
        private void ShowLine(int[] arr, Point p, PaintEventArgs e, Pen pen,float drawsy, float posori)
        {
            int k = 0;
            for (int i = scopeDataCountMax - scopeDataCount- DataBackNum; i < scopeDataCountMax - 1- DataBackNum; i++)
            {
                e.Graphics.DrawLine(pen, p.X + (k * DrawStepX), p.Y - (arr[i] * drawsy) - posori, p.X + (k + 1) * DrawStepX, p.Y - (arr[i + 1] * drawsy) - posori);
                k++;
            }
        }


        //复位操作
        private void btn_reset_Click(object sender, EventArgs e)
        {
            ScopeInit();
        }
    }

}

设计部分:

namespace ScopeDemo
{
    partial class FrmScope
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows 窗体设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要修改
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.btn_CH1 = new System.Windows.Forms.Button();
            this.btn_CH2 = new System.Windows.Forms.Button();
            this.btn_CH3 = new System.Windows.Forms.Button();
            this.btn_CH4 = new System.Windows.Forms.Button();
            this.panel1 = new System.Windows.Forms.Panel();
            this.trackBar1 = new System.Windows.Forms.TrackBar();
            this.txt_CH4 = new System.Windows.Forms.TextBox();
            this.txt_CH3 = new System.Windows.Forms.TextBox();
            this.txt_CH2 = new System.Windows.Forms.TextBox();
            this.txt_CH1 = new System.Windows.Forms.TextBox();
            this.numericUpDown4 = new System.Windows.Forms.NumericUpDown();
            this.numericUpDown3 = new System.Windows.Forms.NumericUpDown();
            this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
            this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
            this.label7 = new System.Windows.Forms.Label();
            this.btn_Stop = new System.Windows.Forms.Button();
            this.cmb_Point = new System.Windows.Forms.ComboBox();
            this.label6 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.btn_Reset = new System.Windows.Forms.Button();
            this.cmb_CH4 = new System.Windows.Forms.ComboBox();
            this.cmb_CH3 = new System.Windows.Forms.ComboBox();
            this.cmb_CH2 = new System.Windows.Forms.ComboBox();
            this.cmb_CH1 = new System.Windows.Forms.ComboBox();
            this.label4 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.panel2 = new System.Windows.Forms.Panel();
            this.label8 = new System.Windows.Forms.Label();
            this.label9 = new System.Windows.Forms.Label();
            this.panel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
            this.panel2.SuspendLayout();
            this.SuspendLayout();
            // 
            // btn_CH1
            // 
            this.btn_CH1.Location = new System.Drawing.Point(99, 593);
            this.btn_CH1.Name = "btn_CH1";
            this.btn_CH1.Size = new System.Drawing.Size(126, 102);
            this.btn_CH1.TabIndex = 1;
            this.btn_CH1.Text = "CH1";
            this.btn_CH1.UseVisualStyleBackColor = true;
            this.btn_CH1.Click += new System.EventHandler(this.btn_CH1_Click);
            // 
            // btn_CH2
            // 
            this.btn_CH2.Location = new System.Drawing.Point(258, 593);
            this.btn_CH2.Name = "btn_CH2";
            this.btn_CH2.Size = new System.Drawing.Size(126, 102);
            this.btn_CH2.TabIndex = 2;
            this.btn_CH2.Text = "CH2";
            this.btn_CH2.UseVisualStyleBackColor = true;
            this.btn_CH2.Click += new System.EventHandler(this.btn_CH2_Click);
            // 
            // btn_CH3
            // 
            this.btn_CH3.Location = new System.Drawing.Point(99, 717);
            this.btn_CH3.Name = "btn_CH3";
            this.btn_CH3.Size = new System.Drawing.Size(126, 102);
            this.btn_CH3.TabIndex = 3;
            this.btn_CH3.Text = "CH3";
            this.btn_CH3.UseVisualStyleBackColor = true;
            this.btn_CH3.Click += new System.EventHandler(this.btn_CH3_Click);
            // 
            // btn_CH4
            // 
            this.btn_CH4.Location = new System.Drawing.Point(258, 717);
            this.btn_CH4.Name = "btn_CH4";
            this.btn_CH4.Size = new System.Drawing.Size(126, 102);
            this.btn_CH4.TabIndex = 3;
            this.btn_CH4.Text = "CH4";
            this.btn_CH4.UseVisualStyleBackColor = true;
            this.btn_CH4.Click += new System.EventHandler(this.btn_CH4_Click);
            // 
            // panel1
            // 
            this.panel1.BackColor = System.Drawing.Color.LightBlue;
            this.panel1.Controls.Add(this.label9);
            this.panel1.Controls.Add(this.label8);
            this.panel1.Controls.Add(this.trackBar1);
            this.panel1.Controls.Add(this.txt_CH4);
            this.panel1.Controls.Add(this.txt_CH3);
            this.panel1.Controls.Add(this.txt_CH2);
            this.panel1.Controls.Add(this.txt_CH1);
            this.panel1.Controls.Add(this.numericUpDown4);
            this.panel1.Controls.Add(this.numericUpDown3);
            this.panel1.Controls.Add(this.numericUpDown2);
            this.panel1.Controls.Add(this.numericUpDown1);
            this.panel1.Controls.Add(this.label7);
            this.panel1.Controls.Add(this.btn_Stop);
            this.panel1.Controls.Add(this.cmb_Point);
            this.panel1.Controls.Add(this.label6);
            this.panel1.Controls.Add(this.label5);
            this.panel1.Controls.Add(this.btn_Reset);
            this.panel1.Controls.Add(this.cmb_CH4);
            this.panel1.Controls.Add(this.cmb_CH3);
            this.panel1.Controls.Add(this.cmb_CH2);
            this.panel1.Controls.Add(this.cmb_CH1);
            this.panel1.Controls.Add(this.label4);
            this.panel1.Controls.Add(this.label3);
            this.panel1.Controls.Add(this.label2);
            this.panel1.Controls.Add(this.label1);
            this.panel1.Location = new System.Drawing.Point(0, 1000);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(2150, 290);
            this.panel1.TabIndex = 4;
            // 
            // trackBar1
            // 
            this.trackBar1.Location = new System.Drawing.Point(1408, 137);
            this.trackBar1.Maximum = 100;
            this.trackBar1.Name = "trackBar1";
            this.trackBar1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
            this.trackBar1.Size = new System.Drawing.Size(166, 90);
            this.trackBar1.TabIndex = 12;
            this.trackBar1.Scroll += new System.EventHandler(this.trackBar1_Scroll);
            // 
            // txt_CH4
            // 
            this.txt_CH4.Location = new System.Drawing.Point(1088, 119);
            this.txt_CH4.Name = "txt_CH4";
            this.txt_CH4.Size = new System.Drawing.Size(109, 35);
            this.txt_CH4.TabIndex = 11;
            this.txt_CH4.Text = "0";
            // 
            // txt_CH3
            // 
            this.txt_CH3.Location = new System.Drawing.Point(937, 119);
            this.txt_CH3.Name = "txt_CH3";
            this.txt_CH3.Size = new System.Drawing.Size(120, 35);
            this.txt_CH3.TabIndex = 11;
            this.txt_CH3.Text = "0";
            // 
            // txt_CH2
            // 
            this.txt_CH2.Location = new System.Drawing.Point(790, 119);
            this.txt_CH2.Name = "txt_CH2";
            this.txt_CH2.Size = new System.Drawing.Size(120, 35);
            this.txt_CH2.TabIndex = 11;
            this.txt_CH2.Text = "0";
            // 
            // txt_CH1
            // 
            this.txt_CH1.Location = new System.Drawing.Point(643, 119);
            this.txt_CH1.Name = "txt_CH1";
            this.txt_CH1.Size = new System.Drawing.Size(120, 35);
            this.txt_CH1.TabIndex = 11;
            this.txt_CH1.Text = "0";
            // 
            // numericUpDown4
            // 
            this.numericUpDown4.Location = new System.Drawing.Point(1088, 171);
            this.numericUpDown4.Minimum = new decimal(new int[] {
            20,
            0,
            0,
            -2147483648});
            this.numericUpDown4.Name = "numericUpDown4";
            this.numericUpDown4.Size = new System.Drawing.Size(109, 35);
            this.numericUpDown4.TabIndex = 10;
            this.numericUpDown4.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
            // 
            // numericUpDown3
            // 
            this.numericUpDown3.Location = new System.Drawing.Point(937, 171);
            this.numericUpDown3.Minimum = new decimal(new int[] {
            20,
            0,
            0,
            -2147483648});
            this.numericUpDown3.Name = "numericUpDown3";
            this.numericUpDown3.Size = new System.Drawing.Size(120, 35);
            this.numericUpDown3.TabIndex = 10;
            this.numericUpDown3.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
            // 
            // numericUpDown2
            // 
            this.numericUpDown2.Location = new System.Drawing.Point(789, 171);
            this.numericUpDown2.Minimum = new decimal(new int[] {
            20,
            0,
            0,
            -2147483648});
            this.numericUpDown2.Name = "numericUpDown2";
            this.numericUpDown2.Size = new System.Drawing.Size(120, 35);
            this.numericUpDown2.TabIndex = 10;
            this.numericUpDown2.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
            // 
            // numericUpDown1
            // 
            this.numericUpDown1.Location = new System.Drawing.Point(643, 171);
            this.numericUpDown1.Minimum = new decimal(new int[] {
            20,
            0,
            0,
            -2147483648});
            this.numericUpDown1.Name = "numericUpDown1";
            this.numericUpDown1.Size = new System.Drawing.Size(120, 35);
            this.numericUpDown1.TabIndex = 10;
            this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(518, 70);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(70, 24);
            this.label7.TabIndex = 9;
            this.label7.Text = "纵向Y";
            // 
            // btn_Stop
            // 
            this.btn_Stop.Location = new System.Drawing.Point(1993, 21);
            this.btn_Stop.Name = "btn_Stop";
            this.btn_Stop.Size = new System.Drawing.Size(125, 116);
            this.btn_Stop.TabIndex = 4;
            this.btn_Stop.Text = "暂停";
            this.btn_Stop.UseVisualStyleBackColor = true;
            this.btn_Stop.Click += new System.EventHandler(this.btn_Stop_Click);
            // 
            // cmb_Point
            // 
            this.cmb_Point.FormattingEnabled = true;
            this.cmb_Point.Location = new System.Drawing.Point(1427, 79);
            this.cmb_Point.Name = "cmb_Point";
            this.cmb_Point.Size = new System.Drawing.Size(121, 32);
            this.cmb_Point.TabIndex = 8;
            this.cmb_Point.SelectedIndexChanged += new System.EventHandler(this.cmb_CHX_SelectedIndexChanged);
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(1433, 40);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(166, 24);
            this.label6.TabIndex = 7;
            this.label6.Text = "采样个数<1000";
            // 
            // label5
            // 
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(1230, 70);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(46, 24);
            this.label5.TabIndex = 5;
            this.label5.Text = "/格";
            // 
            // btn_Reset
            // 
            this.btn_Reset.Location = new System.Drawing.Point(1993, 155);
            this.btn_Reset.Name = "btn_Reset";
            this.btn_Reset.Size = new System.Drawing.Size(125, 62);
            this.btn_Reset.TabIndex = 4;
            this.btn_Reset.Text = "初始化";
            this.btn_Reset.UseVisualStyleBackColor = true;
            this.btn_Reset.Click += new System.EventHandler(this.btn_Reset_Click_1);
            // 
            // cmb_CH4
            // 
            this.cmb_CH4.FormattingEnabled = true;
            this.cmb_CH4.Location = new System.Drawing.Point(1088, 67);
            this.cmb_CH4.Name = "cmb_CH4";
            this.cmb_CH4.Size = new System.Drawing.Size(109, 32);
            this.cmb_CH4.TabIndex = 1;
            this.cmb_CH4.SelectedIndexChanged += new System.EventHandler(this.cmb_CHX_SelectedIndexChanged);
            // 
            // cmb_CH3
            // 
            this.cmb_CH3.FormattingEnabled = true;
            this.cmb_CH3.Location = new System.Drawing.Point(937, 67);
            this.cmb_CH3.Name = "cmb_CH3";
            this.cmb_CH3.Size = new System.Drawing.Size(120, 32);
            this.cmb_CH3.TabIndex = 1;
            this.cmb_CH3.SelectedIndexChanged += new System.EventHandler(this.cmb_CHX_SelectedIndexChanged);
            // 
            // cmb_CH2
            // 
            this.cmb_CH2.FormattingEnabled = true;
            this.cmb_CH2.Location = new System.Drawing.Point(789, 67);
            this.cmb_CH2.Name = "cmb_CH2";
            this.cmb_CH2.Size = new System.Drawing.Size(121, 32);
            this.cmb_CH2.TabIndex = 1;
            this.cmb_CH2.SelectedIndexChanged += new System.EventHandler(this.cmb_CHX_SelectedIndexChanged);
            // 
            // cmb_CH1
            // 
            this.cmb_CH1.FormattingEnabled = true;
            this.cmb_CH1.Location = new System.Drawing.Point(642, 67);
            this.cmb_CH1.Name = "cmb_CH1";
            this.cmb_CH1.Size = new System.Drawing.Size(121, 32);
            this.cmb_CH1.TabIndex = 1;
            this.cmb_CH1.SelectedIndexChanged += new System.EventHandler(this.cmb_CHX_SelectedIndexChanged);
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
            this.label4.Location = new System.Drawing.Point(1091, 26);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(46, 24);
            this.label4.TabIndex = 0;
            this.label4.Text = "CH4";
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
            this.label3.Location = new System.Drawing.Point(941, 26);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(46, 24);
            this.label3.TabIndex = 0;
            this.label3.Text = "CH3";
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.ForeColor = System.Drawing.Color.Blue;
            this.label2.Location = new System.Drawing.Point(795, 26);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(46, 24);
            this.label2.TabIndex = 0;
            this.label2.Text = "CH2";
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.ForeColor = System.Drawing.Color.Red;
            this.label1.Location = new System.Drawing.Point(652, 26);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(46, 24);
            this.label1.TabIndex = 0;
            this.label1.Text = "CH1";
            // 
            // panel2
            // 
            this.panel2.BackColor = System.Drawing.Color.Cyan;
            this.panel2.Controls.Add(this.btn_CH1);
            this.panel2.Controls.Add(this.btn_CH2);
            this.panel2.Controls.Add(this.btn_CH4);
            this.panel2.Controls.Add(this.btn_CH3);
            this.panel2.Location = new System.Drawing.Point(1700, 0);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(450, 1000);
            this.panel2.TabIndex = 5;
            // 
            // label8
            // 
            this.label8.AutoSize = true;
            this.label8.Location = new System.Drawing.Point(518, 122);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(106, 24);
            this.label8.TabIndex = 13;
            this.label8.Text = "移动单位";
            // 
            // label9
            // 
            this.label9.AutoSize = true;
            this.label9.Location = new System.Drawing.Point(518, 173);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(82, 24);
            this.label9.TabIndex = 13;
            this.label9.Text = "偏移量";
            // 
            // FrmScope
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.AutoSize = true;
            this.BackColor = System.Drawing.SystemColors.ControlText;
            this.ClientSize = new System.Drawing.Size(2134, 1329);
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.panel1);
            this.MaximizeBox = false;
            this.Name = "FrmScope";
            this.Text = "FrmScope";
            this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form_Paint);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
            this.panel2.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion
        private System.Windows.Forms.Button btn_CH1;
        private System.Windows.Forms.Button btn_CH2;
        private System.Windows.Forms.Button btn_CH3;
        private System.Windows.Forms.Button btn_CH4;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.ComboBox cmb_CH4;
        private System.Windows.Forms.ComboBox cmb_CH3;
        private System.Windows.Forms.ComboBox cmb_CH2;
        private System.Windows.Forms.ComboBox cmb_CH1;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btn_Reset;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.ComboBox cmb_Point;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.Button btn_Stop;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.NumericUpDown numericUpDown1;
        private System.Windows.Forms.TextBox txt_CH4;
        private System.Windows.Forms.TextBox txt_CH3;
        private System.Windows.Forms.TextBox txt_CH2;
        private System.Windows.Forms.TextBox txt_CH1;
        private System.Windows.Forms.NumericUpDown numericUpDown4;
        private System.Windows.Forms.NumericUpDown numericUpDown3;
        private System.Windows.Forms.NumericUpDown numericUpDown2;
        private System.Windows.Forms.TrackBar trackBar1;
        private System.Windows.Forms.Label label9;
        private System.Windows.Forms.Label label8;
    }
}

  • 7
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值