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

📄 frmoutservicetestctrl.cs

📁 该项目实现在.net 2003上
💻 CS
📖 第 1 页 / 共 2 页
字号:
		}

		private void btnInsertSingleErr_Click(object sender, System.EventArgs e)
		{
			byte param = 0;
			if(sender == btnInsertSingleErr)
			{
				//Debug.WriteLine(sender.ToString());
				param = 0;
			}
			else if(sender == btnStartIns103)//
			{
				param = 1;
				//
				btnInsertSingleErr.Enabled = false;
				btnStartIns103.Enabled = false;
				btnStopIns103.Enabled = true;
				btnStopIns103.BackColor = Color.FromArgb(255,0,0);

				btnStartIns106.Enabled = false;
				btnStopIns106.Enabled = false;
				btnStartInsAlmLos.Enabled = false;
				btnStopInsAlmLos.Enabled = false;
				btnStartInsAlmAis.Enabled = false;
				btnStopInsAlmAis.Enabled = false;
				btnStartInsAlmLof.Enabled = false;
				btnStopInsAlmLof.Enabled = false;
				//
				//lbl103.BackColor = Color.GreenYellow;

			}
			else if(sender == btnStopIns103)
			{
				param = 0x41;
				//
				btnInsertSingleErr.Enabled = true;
				btnStartIns103.Enabled = true;
				btnStopIns103.Enabled = false;
				btnStopIns103.BackColor = Color.LightGray;
				btnStartIns106.Enabled = true;
				btnStopIns106.Enabled = false;
				btnStartInsAlmLos.Enabled = true;
				btnStopInsAlmLos.Enabled = false;
				btnStartInsAlmAis.Enabled = true;
				btnStopInsAlmAis.Enabled = false;
				btnStartInsAlmLof.Enabled = true;
				btnStopInsAlmLof.Enabled = false;
				//
				//lbl103.BackColor = Color.LightGray;
			}
			else if(sender == btnStartIns106)//
			{
				param = 2;

				btnInsertSingleErr.Enabled = false;
				btnStartIns103.Enabled = false;
				btnStopIns103.Enabled = false;
				btnStartIns106.Enabled = false;
				btnStopIns106.Enabled = true;
				btnStopIns106.BackColor = Color.GreenYellow;
				btnStartInsAlmLos.Enabled = false;
				btnStopInsAlmLos.Enabled = false;
				btnStartInsAlmAis.Enabled = false;
				btnStopInsAlmAis.Enabled = false;
				btnStartInsAlmLof.Enabled = false;
				btnStopInsAlmLof.Enabled = false;
				//
				//lbl106.BackColor = Color.GreenYellow;
			    
			}
			else if(sender == btnStopIns106)
			{
				param = 0x42;
				//
				btnInsertSingleErr.Enabled = true;
				btnStartIns103.Enabled = true;
				btnStopIns103.Enabled = false;
				btnStartIns106.Enabled = true;
				btnStopIns106.Enabled = false;
				btnStopIns106.BackColor = Color.LightGray;
				btnStartInsAlmLos.Enabled = true;
				btnStopInsAlmLos.Enabled = false;
				btnStartInsAlmAis.Enabled = true;
				btnStopInsAlmAis.Enabled = false;
				btnStartInsAlmLof.Enabled = true;
				btnStopInsAlmLof.Enabled = false;
				//
				//lbl106.BackColor = Color.LightGray;
			}
			else if(sender == btnStartInsAlmLos)
			{
				//
				param = 0x80;
				//
				btnInsertSingleErr.Enabled = false;
				btnStartIns103.Enabled = false;
				btnStopIns103.Enabled = false;
				btnStartIns106.Enabled = false;
				btnStopIns106.Enabled = false;
				btnStartInsAlmLos.Enabled = false;
				btnStopInsAlmLos.Enabled = true;
				btnStopInsAlmLos.BackColor = Color.GreenYellow;
				btnStartInsAlmAis.Enabled = false;
				btnStopInsAlmAis.Enabled = false;
				btnStartInsAlmLof.Enabled = false;
				btnStopInsAlmLof.Enabled = false;
				//
				//lblLos.BackColor = Color.GreenYellow;
			}
			else if(sender == btnStopInsAlmLos)
			{
				//
				param = 0xc0;
				//
				btnInsertSingleErr.Enabled = true;
				btnStartIns103.Enabled = true;
				btnStopIns103.Enabled = false;
				btnStartIns106.Enabled = true;
				btnStopIns106.Enabled = false;
				btnStartInsAlmLos.Enabled = true;
				btnStopInsAlmLos.Enabled = false;
				btnStopInsAlmLos.BackColor = Color.LightGray;
				btnStartInsAlmAis.Enabled = true;
				btnStopInsAlmAis.Enabled = false;
				btnStartInsAlmLof.Enabled = true;
				btnStopInsAlmLof.Enabled = false;
				//
				//lblLos.BackColor = Color.LightGray;
			}
			else if(sender == btnStartInsAlmAis)
			{
				//
				param = 0x81;
				//
				btnInsertSingleErr.Enabled = false;
				btnStartIns103.Enabled = false;
				btnStopIns103.Enabled = false;
				btnStartIns106.Enabled = false;
				btnStopIns106.Enabled = false;
				btnStartInsAlmLos.Enabled = false;
				btnStopInsAlmLos.Enabled = false;
				btnStartInsAlmAis.Enabled = false;
				btnStopInsAlmAis.Enabled = true;
				btnStopInsAlmAis.BackColor = Color.GreenYellow;
				btnStartInsAlmLof.Enabled = false;
				btnStopInsAlmLof.Enabled = false;
				//
				//lblAis.BackColor = Color.GreenYellow;
			}
			else if(sender == btnStopInsAlmAis)
			{
				//
				param = 0xc1;
				//
				btnInsertSingleErr.Enabled = true;
				btnStartIns103.Enabled = true;
				btnStopIns103.Enabled = false;
				btnStartIns106.Enabled = true;
				btnStopIns106.Enabled = false;
				btnStartInsAlmLos.Enabled = true;
				btnStopInsAlmLos.Enabled = false;
				btnStartInsAlmAis.Enabled = true;
				btnStopInsAlmAis.Enabled = false;
				btnStopInsAlmAis.BackColor = Color.LightGray;
				btnStartInsAlmLof.Enabled = true;
				btnStopInsAlmLof.Enabled = false;
				//
				//lblAis.BackColor = Color.LightGray;
			}
			else if(sender == btnStartInsAlmLof)
			{
				//
				param = 0x82;
				//
				btnInsertSingleErr.Enabled = false;
				btnStartIns103.Enabled = false;
				btnStopIns103.Enabled = false;
				btnStartIns106.Enabled = false;
				btnStopIns106.Enabled = false;
				btnStartInsAlmLos.Enabled = false;
				btnStopInsAlmLos.Enabled = false;
				btnStartInsAlmAis.Enabled = false;
				btnStopInsAlmAis.Enabled = false;
				btnStartInsAlmLof.Enabled = false;
				btnStopInsAlmLof.Enabled = true;
				btnStopInsAlmLof.BackColor = Color.GreenYellow;
				//
				//lblLof.BackColor = Color.GreenYellow;
			}
			else if(sender == btnStopInsAlmLof)
			{
				//
				param = 0xc2;
				//
				btnInsertSingleErr.Enabled = true;
				btnStartIns103.Enabled = true;
				btnStopIns103.Enabled = false;
				btnStartIns106.Enabled = true;
				btnStopIns106.Enabled = false;
				btnStartInsAlmLos.Enabled = true;
				btnStopInsAlmLos.Enabled = false;
				btnStartInsAlmAis.Enabled = true;
				btnStopInsAlmAis.Enabled = false;
				btnStartInsAlmLof.Enabled = true;
				btnStopInsAlmLof.Enabled = false;
				btnStopInsAlmLof.BackColor = Color.LightGray;
				//
				//lblLof.BackColor = Color.LightGray;
			}
			//
			byte [] data = new byte[10];
			data[0] = 0;
			data[1] = MsgCommandId.OUT_SERVICE_TEST_CTRL;
			data[2] = param;
			data[3] = (byte)DateTime.Now.Year;
			data[4] = (byte)(DateTime.Now.Year>>8);
			data[5] = (byte)DateTime.Now.Month;
			data[6] = (byte)DateTime.Now.Day;
			data[7] = (byte)DateTime.Now.Hour;
			data[8] = (byte)DateTime.Now.Minute;
			data[9] = (byte)DateTime.Now.Second;
			DataEntry dataEntry = new DataEntry(10);
			dataEntry.szData = data;
			this.m_ParentFrm.m_DataHandler.AddOneFrameToSndDataList(dataEntry);
//#if DEBUG
			this.m_ParentFrm.InsertItemToDataList(1,data);
//#endif
		}

		private void btnCancel_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}
	}
}

⌨️ 快捷键说明

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