init: 导入项目到 meswork Gitea
This commit is contained in:
135
DataMirrorTools_Simulator/P_SignalViewer/SignalRegion.cs
Normal file
135
DataMirrorTools_Simulator/P_SignalViewer/SignalRegion.cs
Normal file
@@ -0,0 +1,135 @@
|
||||
using DTTest;
|
||||
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 DataMirrorToolsPage
|
||||
{
|
||||
public partial class SignalRegion : Form
|
||||
{
|
||||
public string region = "Q";
|
||||
|
||||
public SignalRegion()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public SignalRegion(string regionAnalysis)
|
||||
{
|
||||
InitializeComponent();
|
||||
if (regionAnalysis.Contains("I"))
|
||||
{
|
||||
rb_I.Checked = true;
|
||||
}
|
||||
if (regionAnalysis.Contains("Q"))
|
||||
{
|
||||
rb_Q.Checked = true;
|
||||
}
|
||||
if (regionAnalysis.Contains("M"))
|
||||
{
|
||||
rb_M.Checked = true;
|
||||
}
|
||||
if (regionAnalysis.Contains("T"))
|
||||
{
|
||||
rb_T.Checked = true;
|
||||
}
|
||||
if (regionAnalysis.Contains("C"))
|
||||
{
|
||||
rb_C.Checked = true;
|
||||
}
|
||||
if (regionAnalysis.Contains("D"))
|
||||
{
|
||||
rb_D.Checked = true;
|
||||
}
|
||||
if (regionAnalysis.Contains("H"))
|
||||
{
|
||||
rb_H.Checked = true;
|
||||
}
|
||||
if (regionAnalysis.Contains("W"))
|
||||
{
|
||||
rb_W.Checked = true;
|
||||
}
|
||||
if (regionAnalysis.Contains("DB"))
|
||||
{
|
||||
txt_DB_Index.Text = regionAnalysis.Substring(2);
|
||||
rb_DB.Checked = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ShowAccomplish()
|
||||
{
|
||||
base.OnShown(new EventArgs());
|
||||
}
|
||||
|
||||
|
||||
private void btn_Sure_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (rb_I.Checked)
|
||||
{
|
||||
region = "I";
|
||||
}
|
||||
if (rb_Q.Checked)
|
||||
{
|
||||
region = "Q";
|
||||
}
|
||||
if (rb_M.Checked)
|
||||
{
|
||||
region = "M";
|
||||
}
|
||||
if (rb_T.Checked)
|
||||
{
|
||||
region = "T";
|
||||
}
|
||||
if (rb_C.Checked)
|
||||
{
|
||||
region = "C";
|
||||
}
|
||||
if (rb_D.Checked)
|
||||
{
|
||||
region = "D";
|
||||
}
|
||||
if (rb_W.Checked)
|
||||
{
|
||||
region = "W";
|
||||
}
|
||||
if (rb_H.Checked)
|
||||
{
|
||||
region = "H";
|
||||
}
|
||||
if (rb_CC.Checked)
|
||||
{
|
||||
region = "C";
|
||||
}
|
||||
if (rb_DB.Checked)
|
||||
{
|
||||
var dbIndex = txt_DB_Index.Text.Trim();
|
||||
if (dbIndex.Length < 1)
|
||||
{
|
||||
MessageBox.Show("请填写数据块索引!");
|
||||
return;
|
||||
}
|
||||
region = "DB" + dbIndex;
|
||||
}
|
||||
this.DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
}
|
||||
private void btn_Cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
private void rb_DB_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
txt_DB_Index.Enabled = rb_DB.Checked;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user