📄 frmtestmodesel.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace SmartE1Analyzer
{
/// <summary>
/// frmTestModeSel 的摘要说明。
/// </summary>
public class frmTestModeSel : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox txtTestPattern;
private System.Windows.Forms.Button btnTestPattern;
private System.Windows.Forms.ComboBox comboTestSequence;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.RadioButton radioOutServiceSel;
private System.Windows.Forms.RadioButton radioInServiceSel;
private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.Button btnCancel;
private frmMain m_ParentFrm;
public frmTestModeSel(frmMain frm)
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
this.m_ParentFrm = frm;
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.txtTestPattern = new System.Windows.Forms.TextBox();
this.btnTestPattern = new System.Windows.Forms.Button();
this.comboTestSequence = new System.Windows.Forms.ComboBox();
this.label4 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.radioOutServiceSel = new System.Windows.Forms.RadioButton();
this.radioInServiceSel = new System.Windows.Forms.RadioButton();
this.btnOk = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
//
// txtTestPattern
//
this.txtTestPattern.Location = new System.Drawing.Point(104, 144);
this.txtTestPattern.Size = new System.Drawing.Size(88, 21);
this.txtTestPattern.Text = "";
//
// btnTestPattern
//
this.btnTestPattern.Location = new System.Drawing.Point(32, 144);
this.btnTestPattern.Size = new System.Drawing.Size(64, 24);
this.btnTestPattern.Text = "测试图案";
//
// comboTestSequence
//
this.comboTestSequence.Items.Add("8bit可编程图案");
this.comboTestSequence.Items.Add("10-9伪随机序列");
this.comboTestSequence.Items.Add("10-15伪随机序列");
this.comboTestSequence.Location = new System.Drawing.Point(104, 120);
this.comboTestSequence.Size = new System.Drawing.Size(88, 20);
//
// label4
//
this.label4.Location = new System.Drawing.Point(32, 120);
this.label4.Size = new System.Drawing.Size(56, 16);
this.label4.Text = "测试序列";
//
// label1
//
this.label1.Location = new System.Drawing.Point(32, 16);
this.label1.Size = new System.Drawing.Size(160, 16);
this.label1.Text = "测试模式选择:";
//
// radioOutServiceSel
//
this.radioOutServiceSel.Checked = true;
this.radioOutServiceSel.Location = new System.Drawing.Point(40, 40);
this.radioOutServiceSel.Size = new System.Drawing.Size(152, 24);
this.radioOutServiceSel.Text = "中断业务测试";
this.radioOutServiceSel.CheckedChanged += new System.EventHandler(this.radioOutServiceSel_CheckedChanged);
//
// radioInServiceSel
//
this.radioInServiceSel.Location = new System.Drawing.Point(40, 72);
this.radioInServiceSel.Size = new System.Drawing.Size(152, 24);
this.radioInServiceSel.Text = "在业务测试";
this.radioInServiceSel.CheckedChanged += new System.EventHandler(this.radioInServiceSel_CheckedChanged);
//
// btnOk
//
this.btnOk.Location = new System.Drawing.Point(72, 200);
this.btnOk.Size = new System.Drawing.Size(64, 24);
this.btnOk.Text = "确定[&Y]";
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// btnCancel
//
this.btnCancel.Location = new System.Drawing.Point(160, 200);
this.btnCancel.Size = new System.Drawing.Size(64, 24);
this.btnCancel.Text = "取消[&C]";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// frmTestModeSel
//
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOk);
this.Controls.Add(this.radioInServiceSel);
this.Controls.Add(this.radioOutServiceSel);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtTestPattern);
this.Controls.Add(this.btnTestPattern);
this.Controls.Add(this.comboTestSequence);
this.Controls.Add(this.label4);
this.Text = "测试 模式和测试图案选择";
this.Load += new System.EventHandler(this.frmTestModeSel_Load);
}
#endregion
private void frmTestModeSel_Load(object sender, System.EventArgs e)
{
comboTestSequence.Text = "8bit可编程图案";
txtTestPattern.Text = "170";//10101010
//
Rectangle screen = Screen.PrimaryScreen.Bounds;
this.Location = new Point((screen.Width - this.Width) / 2,
(screen.Height - this.Height ) / 2);
}
private void btnOk_Click(object sender, System.EventArgs e)
{
if(this.radioOutServiceSel.Checked == true)
this.m_ParentFrm.m_EquipAndPerformInfo.m_CirConfigParam.TestMode = 1;//zhongduan
else
this.m_ParentFrm.m_EquipAndPerformInfo.m_CirConfigParam.TestMode = 2;//zai yewu
this.m_ParentFrm.m_EquipAndPerformInfo.m_CirConfigParam.TestSequence = (byte)comboTestSequence.SelectedIndex;//测试序列
this.m_ParentFrm.m_EquipAndPerformInfo.m_CirConfigParam.TestPattern = (byte)decimal.Parse(txtTestPattern.Text);//测试图案
this.DialogResult = DialogResult.OK;
this.Close();
}
private void radioOutServiceSel_CheckedChanged(object sender, System.EventArgs e)
{
/*
if(radioOutServiceSel.Checked == true)
{
//radioOutServiceSel.Checked = false;
radioInServiceSel.Checked = true;
}
else
{
//radioOutServiceSel.Checked = true;
radioInServiceSel.Checked = false;
}
*/
}
private void radioInServiceSel_CheckedChanged(object sender, System.EventArgs e)
{
if(radioInServiceSel.Checked == true)
{
radioOutServiceSel.Checked = false;
//radioInServiceSel.Checked = false;
}
else
{
radioOutServiceSel.Checked = true;
//radioInServiceSel.Checked = true;
}
}
private void btnCancel_Click(object sender, System.EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -