⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.cs

📁 简易的震动波形绘制工具
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.Drawing.Imaging;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Configuration;
using System.CodeDom;
using System.Data.SqlClient;
using System.IO;

namespace nanwin
{
	/// <summary>
	/// Form1 的摘要说明。
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.Button button2;
		private System.Windows.Forms.Button button3;
		private System.Windows.Forms.ComboBox comboBox1;
		public System.Windows.Forms.Timer timer1;
		private System.Windows.Forms.TextBox textBox1;
		private System.ComponentModel.IContainer components;
		public int pos=0;
		private System.Windows.Forms.Button button1;
		public Pen pen=new Pen(Color.Blue,1);
		private System.Windows.Forms.Button button4;
		private System.Windows.Forms.Button button5;
		private System.Data.SqlClient.SqlConnection sqlConnection1;
		public int ttt;
		private System.Windows.Forms.TextBox textBox2;
		private System.Windows.Forms.Button button6;
		private System.Windows.Forms.Button button7;
		private System.Windows.Forms.Timer timer2;
		private System.Windows.Forms.Button button8;
		private System.Windows.Forms.Timer timer3;
		private System.Windows.Forms.TextBox textBox3;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		public int d=700;

		public Form1()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();
//			SqlConnection con=new SqlConnection(conn.cn);
//			SqlCommand com=new SqlCommand("",con);
//			SqlDataAdapter adp=new SqlDataAdapter(com);
//			DataTable dt=new DataTable("mytable1");
			//int i;
			//adp.Fill(dt);
//			for (i=0;i<dt.Rows.Count;i++)
//			{
//				comboBox1.Items.Add(i);
//			}
			comboBox1.Items.Add("X通道");
			comboBox1.Items.Add("Y通道");
//			Graphics gg=this.CreateGraphics();
//			gg.DrawRectangle(Pens.Blue, 200, 300, 199, 99);
//			gg.DrawString("Legend", new Font("Tahoma", 12, FontStyle.Bold), Brushes.Black, new PointF(200, 300));
//			gg.Clear(Color.AntiqueWhite);


			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/*public shuzu()
		{
			string ss,s;
			int j,p,b,m;
			s=null;
			p=0;
			int []a=new int[400000];
			ss=dt.Rows[0]["data"].ToString();
			if(ss.Length==0)
				TextBox1.Text="数据为空!";

				//TextBox1.Text=Convert.ToString(ss.Length);
			else 
			{
				
				for(j=1;j<(ss.Length-1);j++)
				{
				
					b=Convert.ToInt16(ss[j]);
					if(b!=13&&b!=10)
						s=s+ss[j].ToString();
					else
					{
						try
						{//s=null+ss[1].ToString()+ss[2].ToString();
							a[p]=Convert.ToInt32(s);
							p++;
						}
						catch(Exception ex)
						{ 
							Response.Write(ex.Message);
						}
						b=Convert.ToInt16(ss[j+1]);
						if(b!=10&&b!=13)
							s=null; //如果下一个数据还不是数字,则保留s值,如果是数字刷新s
					}
				}
			}
		}*/

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.button5 = new System.Windows.Forms.Button();
			this.button4 = new System.Windows.Forms.Button();
			this.comboBox1 = new System.Windows.Forms.ComboBox();
			this.button3 = new System.Windows.Forms.Button();
			this.button2 = new System.Windows.Forms.Button();
			this.button1 = new System.Windows.Forms.Button();
			this.textBox1 = new System.Windows.Forms.TextBox();
			this.textBox2 = new System.Windows.Forms.TextBox();
			this.button6 = new System.Windows.Forms.Button();
			this.textBox3 = new System.Windows.Forms.TextBox();
			this.button7 = new System.Windows.Forms.Button();
			this.button8 = new System.Windows.Forms.Button();
			this.timer1 = new System.Windows.Forms.Timer(this.components);
			this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
			this.timer2 = new System.Windows.Forms.Timer(this.components);
			this.timer3 = new System.Windows.Forms.Timer(this.components);
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.groupBox1.SuspendLayout();
			this.SuspendLayout();
			// 
			// groupBox1
			// 
			this.groupBox1.BackColor = System.Drawing.SystemColors.ScrollBar;
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Controls.Add(this.button5);
			this.groupBox1.Controls.Add(this.button4);
			this.groupBox1.Controls.Add(this.comboBox1);
			this.groupBox1.Controls.Add(this.button3);
			this.groupBox1.Controls.Add(this.button2);
			this.groupBox1.Controls.Add(this.button1);
			this.groupBox1.Controls.Add(this.textBox1);
			this.groupBox1.Controls.Add(this.textBox2);
			this.groupBox1.Controls.Add(this.button6);
			this.groupBox1.Controls.Add(this.textBox3);
			this.groupBox1.Controls.Add(this.button7);
			this.groupBox1.Controls.Add(this.button8);
			this.groupBox1.Location = new System.Drawing.Point(0, 456);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(632, 100);
			this.groupBox1.TabIndex = 1;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "groupBox1";
			// 
			// button5
			// 
			this.button5.Location = new System.Drawing.Point(280, 64);
			this.button5.Name = "button5";
			this.button5.TabIndex = 5;
			this.button5.Text = "speed down";
			this.button5.Click += new System.EventHandler(this.button5_Click);
			// 
			// button4
			// 
			this.button4.Location = new System.Drawing.Point(144, 64);
			this.button4.Name = "button4";
			this.button4.TabIndex = 4;
			this.button4.Text = "speed up";
			this.button4.Click += new System.EventHandler(this.button4_Click);
			// 
			// comboBox1
			// 
			this.comboBox1.Location = new System.Drawing.Point(8, 64);
			this.comboBox1.Name = "comboBox1";
			this.comboBox1.Size = new System.Drawing.Size(121, 20);
			this.comboBox1.TabIndex = 3;
			this.comboBox1.Text = "comboBox1";
			// 
			// button3
			// 
			this.button3.Location = new System.Drawing.Point(280, 24);
			this.button3.Name = "button3";
			this.button3.TabIndex = 2;
			this.button3.Text = "go on";
			this.button3.Click += new System.EventHandler(this.button3_Click);
			// 
			// button2
			// 
			this.button2.Location = new System.Drawing.Point(144, 24);
			this.button2.Name = "button2";
			this.button2.TabIndex = 1;
			this.button2.Text = "pause";
			this.button2.Click += new System.EventHandler(this.button2_Click);
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(8, 24);
			this.button1.Name = "button1";
			this.button1.TabIndex = 0;
			this.button1.Text = "start new";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// textBox1
			// 
			this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
			this.textBox1.Location = new System.Drawing.Point(360, 80);
			this.textBox1.Name = "textBox1";
			this.textBox1.Size = new System.Drawing.Size(136, 14);
			this.textBox1.TabIndex = 3;
			this.textBox1.Text = "textBox1";
			// 
			// textBox2
			// 
			this.textBox2.Location = new System.Drawing.Point(368, 24);
			this.textBox2.Name = "textBox2";
			this.textBox2.TabIndex = 4;
			this.textBox2.Text = "textBox2";
			// 
			// button6
			// 
			this.button6.Location = new System.Drawing.Point(368, 48);
			this.button6.Name = "button6";
			this.button6.TabIndex = 5;
			this.button6.Text = "find";
			this.button6.Click += new System.EventHandler(this.button6_Click);
			// 
			// textBox3
			// 
			this.textBox3.Location = new System.Drawing.Point(472, 24);
			this.textBox3.Name = "textBox3";
			this.textBox3.TabIndex = 8;
			this.textBox3.Text = "textBox3";
			// 
			// button7
			// 
			this.button7.Location = new System.Drawing.Point(456, 48);
			this.button7.Name = "button7";
			this.button7.TabIndex = 6;
			this.button7.Text = "paint center";
			this.button7.Click += new System.EventHandler(this.button7_Click);
			// 
			// button8
			// 
			this.button8.Location = new System.Drawing.Point(544, 48);
			this.button8.Name = "button8";
			this.button8.TabIndex = 7;
			this.button8.Text = "frequency";
			this.button8.Click += new System.EventHandler(this.button8_Click);
			// 
			// timer1
			// 
			this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
			// 
			// sqlConnection1
			// 
			this.sqlConnection1.ConnectionString = "workstation id=NEUMECH;packet size=4096;integrated security=SSPI;data source=NEUM" +
				"ECH;persist security info=False;initial catalog=wava";
			// 
			// timer2
			// 
			this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
			// 
			// timer3
			// 
			this.timer3.Tick += new System.EventHandler(this.timer3_Tick);
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(472, 8);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(100, 15);
			this.label1.TabIndex = 9;
			this.label1.Text = "数据量";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(368, 8);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(100, 16);
			this.label2.TabIndex = 10;
			this.label2.Text = "图象查找精度";
			// 
			// Form1
			// 
			this.AllowDrop = true;
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.AutoScroll = true;
			this.BackColor = System.Drawing.SystemColors.ActiveBorder;
			this.ClientSize = new System.Drawing.Size(896, 557);
			this.Controls.Add(this.groupBox1);
			this.Name = "Form1";
			this.Text = "震动波形动态显示软件";
			this.Load += new System.EventHandler(this.Form1_Load);
			this.groupBox1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		/// <summary>
		/// 应用程序的主入口点。
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());

		}
		public void paint()
		{
			string str;
			int ch=1;
			if( comboBox1.SelectedIndex == 0 )
			{
				str="select * from Health4";
				ch=2;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -