📄 mainform.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Threading;
namespace Cluster_Validations
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class MainForm : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.GroupBox groupBox4;
private System.Windows.Forms.CheckBox checkBoxGDI;
private System.Windows.Forms.Button buttonDBIdelete;
private System.Windows.Forms.Button buttonDBIadd;
private System.Windows.Forms.CheckBox checkBoxSDI;
private System.Windows.Forms.CheckBox checkBoxDBI;
private System.Windows.Forms.NumericUpDown numericUpDownSetNumber;
private System.Windows.Forms.TextBox textBoxOpenFile;
private System.Windows.Forms.Button buttonOpenFile;
private System.Windows.Forms.TabControl tabControl;
private System.Windows.Forms.NumericUpDown numericUpDownDBIq;
private System.Windows.Forms.NumericUpDown numericUpDownDBIt;
private System.Windows.Forms.Button buttonValidate;
private System.Windows.Forms.Button buttonExit;
private System.Windows.Forms.Button buttonSave;
private System.Windows.Forms.ListView listViewRawData;
private System.Windows.Forms.ListView listViewGDIResult;
private System.Windows.Forms.ListView listViewDBIResult;
private System.Windows.Forms.ListView listViewSDIResult;
private System.Windows.Forms.OpenFileDialog openFileDialog;
private System.Windows.Forms.TreeView treeViewDBI;
private Excel.Application objExcel = null;
private Excel.Worksheet m_worksheet = null;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public MainForm()
{
InitializeComponent();
// Excel Application 矫累
try{
if ( this.objExcel == null) {
this.objExcel = new Excel.Application();
}
}
catch( System.Exception e ){
System.Windows.Forms.MessageBox.Show( e.StackTrace );
System.Windows.Forms.MessageBox.Show( e.ToString() );
System.Windows.Forms.MessageBox.Show("ERROR: EXCEL couldn't be started!");
System.Windows.Forms.Application.Exit();
}
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
// Excel Application阑 刚历 磷牢促
if ( this.objExcel != null )
this.objExcel.Quit();
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
this.checkBoxGDI = new System.Windows.Forms.CheckBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.treeViewDBI = new System.Windows.Forms.TreeView();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.numericUpDownDBIt = new System.Windows.Forms.NumericUpDown();
this.numericUpDownDBIq = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.checkBoxSDI = new System.Windows.Forms.CheckBox();
this.checkBoxDBI = new System.Windows.Forms.CheckBox();
this.buttonDBIadd = new System.Windows.Forms.Button();
this.buttonDBIdelete = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.numericUpDownSetNumber = new System.Windows.Forms.NumericUpDown();
this.label2 = new System.Windows.Forms.Label();
this.textBoxOpenFile = new System.Windows.Forms.TextBox();
this.buttonOpenFile = new System.Windows.Forms.Button();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.listViewRawData = new System.Windows.Forms.ListView();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.listViewGDIResult = new System.Windows.Forms.ListView();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.listViewDBIResult = new System.Windows.Forms.ListView();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.listViewSDIResult = new System.Windows.Forms.ListView();
this.tabControl = new System.Windows.Forms.TabControl();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.buttonValidate = new System.Windows.Forms.Button();
this.buttonExit = new System.Windows.Forms.Button();
this.buttonSave = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDBIt)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownDBIq)).BeginInit();
this.groupBox3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownSetNumber)).BeginInit();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
this.tabControl.SuspendLayout();
this.groupBox4.SuspendLayout();
this.SuspendLayout();
//
// openFileDialog
//
this.openFileDialog.Filter = "*.xls | *.xls";
this.openFileDialog.Title = "Cluster 单捞磐 佬扁";
this.openFileDialog.FileOk += new System.ComponentModel.CancelEventHandler(this.openFileDialog_FileOk);
//
// checkBoxGDI
//
this.checkBoxGDI.Location = new System.Drawing.Point(16, 24);
this.checkBoxGDI.Name = "checkBoxGDI";
this.checkBoxGDI.Size = new System.Drawing.Size(176, 40);
this.checkBoxGDI.TabIndex = 1;
this.checkBoxGDI.Text = "Dunn\'s Index (GDI) ";
this.checkBoxGDI.CheckedChanged += new System.EventHandler(this.checkBoxGDI_CheckedChanged);
//
// groupBox1
//
this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.treeViewDBI,
this.groupBox2,
this.checkBoxSDI,
this.checkBoxDBI,
this.checkBoxGDI,
this.buttonDBIadd,
this.buttonDBIdelete});
this.groupBox1.Location = new System.Drawing.Point(8, 144);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(280, 240);
this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Validator";
//
// treeViewDBI
//
this.treeViewDBI.ImageIndex = -1;
this.treeViewDBI.Location = new System.Drawing.Point(208, 104);
this.treeViewDBI.Name = "treeViewDBI";
this.treeViewDBI.SelectedImageIndex = -1;
this.treeViewDBI.ShowLines = false;
this.treeViewDBI.ShowPlusMinus = false;
this.treeViewDBI.ShowRootLines = false;
this.treeViewDBI.Size = new System.Drawing.Size(56, 80);
this.treeViewDBI.Sorted = true;
this.treeViewDBI.TabIndex = 6;
//
// groupBox2
//
this.groupBox2.Controls.AddRange(new System.Windows.Forms.Control[] {
this.numericUpDownDBIt,
this.numericUpDownDBIq,
this.label4,
this.label3});
this.groupBox2.Location = new System.Drawing.Point(56, 96);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(144, 56);
this.groupBox2.TabIndex = 4;
this.groupBox2.TabStop = false;
//
// numericUpDownDBIt
//
this.numericUpDownDBIt.Enabled = false;
this.numericUpDownDBIt.Location = new System.Drawing.Point(96, 24);
this.numericUpDownDBIt.Minimum = new System.Decimal(new int[] {
1,
0,
0,
0});
this.numericUpDownDBIt.Name = "numericUpDownDBIt";
this.numericUpDownDBIt.Size = new System.Drawing.Size(40, 21);
this.numericUpDownDBIt.TabIndex = 4;
this.numericUpDownDBIt.Value = new System.Decimal(new int[] {
1,
0,
0,
0});
//
// numericUpDownDBIq
//
this.numericUpDownDBIq.Enabled = false;
this.numericUpDownDBIq.Location = new System.Drawing.Point(24, 24);
this.numericUpDownDBIq.Minimum = new System.Decimal(new int[] {
1,
0,
0,
0});
this.numericUpDownDBIq.Name = "numericUpDownDBIq";
this.numericUpDownDBIq.Size = new System.Drawing.Size(40, 21);
this.numericUpDownDBIq.TabIndex = 3;
this.numericUpDownDBIq.Value = new System.Decimal(new int[] {
1,
0,
0,
0});
//
// label4
//
this.label4.Location = new System.Drawing.Point(80, 24);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(24, 23);
this.label4.TabIndex = 1;
this.label4.Text = "t:";
//
// label3
//
this.label3.Location = new System.Drawing.Point(8, 24);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(24, 23);
this.label3.TabIndex = 0;
this.label3.Text = "q:";
//
// checkBoxSDI
//
this.checkBoxSDI.Location = new System.Drawing.Point(16, 192);
this.checkBoxSDI.Name = "checkBoxSDI";
this.checkBoxSDI.Size = new System.Drawing.Size(160, 32);
this.checkBoxSDI.TabIndex = 3;
this.checkBoxSDI.Text = "Scat-Dis Index (SDI)";
this.checkBoxSDI.CheckedChanged += new System.EventHandler(this.checkBoxSDI_CheckedChanged);
//
// checkBoxDBI
//
this.checkBoxDBI.Location = new System.Drawing.Point(16, 56);
this.checkBoxDBI.Name = "checkBoxDBI";
this.checkBoxDBI.Size = new System.Drawing.Size(184, 48);
this.checkBoxDBI.TabIndex = 2;
this.checkBoxDBI.Text = "Davies-Bouldin Index (DBI)";
this.checkBoxDBI.CheckedChanged += new System.EventHandler(this.checkBoxDBI_CheckedChanged);
//
// buttonDBIadd
//
this.buttonDBIadd.Enabled = false;
this.buttonDBIadd.Location = new System.Drawing.Point(72, 160);
this.buttonDBIadd.Name = "buttonDBIadd";
this.buttonDBIadd.Size = new System.Drawing.Size(56, 23);
this.buttonDBIadd.TabIndex = 0;
this.buttonDBIadd.Text = "Add";
this.buttonDBIadd.Click += new System.EventHandler(this.buttonDBIadd_Click);
//
// buttonDBIdelete
//
this.buttonDBIdelete.Enabled = false;
this.buttonDBIdelete.Location = new System.Drawing.Point(144, 160);
this.buttonDBIdelete.Name = "buttonDBIdelete";
this.buttonDBIdelete.Size = new System.Drawing.Size(56, 23);
this.buttonDBIdelete.TabIndex = 1;
this.buttonDBIdelete.Text = "Delete";
this.buttonDBIdelete.Click += new System.EventHandler(this.buttonDBIdelete_Click);
//
// groupBox3
//
this.groupBox3.Controls.AddRange(new System.Windows.Forms.Control[] {
this.numericUpDownSetNumber,
this.label2});
this.groupBox3.Location = new System.Drawing.Point(8, 88);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(280, 40);
this.groupBox3.TabIndex = 4;
this.groupBox3.TabStop = false;
//
// numericUpDownSetNumber
//
this.numericUpDownSetNumber.Location = new System.Drawing.Point(232, 16);
this.numericUpDownSetNumber.Minimum = new System.Decimal(new int[] {
1,
0,
0,
0});
this.numericUpDownSetNumber.Name = "numericUpDownSetNumber";
this.numericUpDownSetNumber.Size = new System.Drawing.Size(40, 21);
this.numericUpDownSetNumber.TabIndex = 1;
this.numericUpDownSetNumber.Value = new System.Decimal(new int[] {
1,
0,
0,
0});
//
// label2
//
this.label2.Location = new System.Drawing.Point(8, 16);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(224, 16);
this.label2.TabIndex = 0;
this.label2.Text = "How many clustering was performed?";
//
// textBoxOpenFile
//
this.textBoxOpenFile.Font = new System.Drawing.Font("Gulim", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(129)));
this.textBoxOpenFile.Location = new System.Drawing.Point(8, 24);
this.textBoxOpenFile.Name = "textBoxOpenFile";
this.textBoxOpenFile.ReadOnly = true;
this.textBoxOpenFile.Size = new System.Drawing.Size(224, 22);
this.textBoxOpenFile.TabIndex = 5;
this.textBoxOpenFile.Text = "";
//
// buttonOpenFile
//
this.buttonOpenFile.Location = new System.Drawing.Point(240, 24);
this.buttonOpenFile.Name = "buttonOpenFile";
this.buttonOpenFile.Size = new System.Drawing.Size(32, 23);
this.buttonOpenFile.TabIndex = 7;
this.buttonOpenFile.Text = "...";
this.buttonOpenFile.Click += new System.EventHandler(this.buttonOpenFile_Click);
//
// tabPage1
//
this.tabPage1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.listViewRawData});
this.tabPage1.Location = new System.Drawing.Point(4, 21);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(480, 410);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Raw 单捞磐";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -