using PaintDotNet.Base.SettingModel;
using PaintDotNet.Base.CommTool;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using PaintDotNet.DedicatedAnalysis.GrainSizeStandard;
namespace PaintDotNet.DedicatedAnalysis
{
///
/// 晶粒度辅助线设置
///
public partial class GrainGuideSettingsDialog : Form
{
#region 控件
private GroupBox groupBox2;
private GroupBox groupBox3;
private Button button1;
private Button button2;
private Label label3;
private Label label2;
private Label label1;
private Panel panel1;
private Panel panel2;
private GroupBox groupBox1;
///
/// 线宽
///
private NumericUpDown numericUpDown2;
private GroupBox groupBox4;
private Button button5;
private Button button4;
private Button button3;
private Label label7;
private TextBox textBox1;
private ComboBox comboBox1;
///
/// 截点法-垂直辅助线-辅助线长度
///
private NumericUpDown numericUpDown1;
private Panel panel3;
private Panel panel4;
///
/// 截点法-水平辅助线-辅助线长度
///
private NumericUpDown numericUpDown3;
private Label label4;
private Panel panel5;
private NumericUpDown numericUpDown4;
private Label label5;
private Panel panel6;
private NumericUpDown numericUpDown6;
private Label label8;
private NumericUpDown numericUpDown5;
private Label label6;
private Panel panel7;
///
/// 水平线长度
///
private NumericUpDown numericUpDown7;
private Label label9;
///
/// 垂线长度
///
private NumericUpDown numericUpDown8;
private Label label10;
///
/// 边距
///
private NumericUpDown numericUpDown10;
private Label label12;
///
/// 直径
///
private NumericUpDown numericUpDown9;
private Label label11;
///
/// 左下到右上斜线长度
///
private NumericUpDown numericUpDown11;
private Label label13;
///
/// 左上到右下斜线长度
///
private NumericUpDown numericUpDown12;
private Label label14;
private DataGridView dataGridView1;
private DataGridViewTextBoxColumn GuideName;
private DataGridViewTextBoxColumn Column1;
private DataGridViewTextBoxColumn GrainType;
private Label label16;
private Label label15;
///
/// 水平线到圆距离
///
private NumericUpDown numericUpDown14;
///
/// 垂线到圆距离
///
private NumericUpDown numericUpDown13;
private Panel panel8;
///
/// 面积法-矩形-高
///
private NumericUpDown numericUpDown15;
private Label label17;
///
/// 面积法-矩形-宽
///
private NumericUpDown numericUpDown16;
private Label label18;
private Panel panel9;
///
/// 面积法-圆形-直径
///
private NumericUpDown numericUpDown18;
private Label label20;
///
/// 面积法-辅助线类型
///
private ComboBox comboBox2;
///
/// 截点法-水平辅助线-辅助线数量
///
private NumericUpDown numericUpDown19;
private Label label21;
///
/// 截点法-水平辅助线-辅助线间距
///
private NumericUpDown numericUpDown17;
private Label label19;
///
/// 截点法-垂直辅助线-辅助线数量
///
private NumericUpDown numericUpDown20;
private Label label22;
///
/// 截点法-垂直辅助线-辅助线间距
///
private NumericUpDown numericUpDown21;
private Label label23;
private CheckBox checkBox1;
#endregion
///
/// 调色板
///
PaintDotNet.ColorsForm colorsForm;
///
/// 操作区分(0 :添加 1 :编辑)
///
private int operation = -1;
///
/// 临时数据
///
private List arrayLists = new List();
///
/// 跳转画面 0:截点法 1:面积法
///
private int picture;
///
/// 配置文件名称
///
private string xmlModelName;
//##考虑放在父类中声明属性,这样就不用创建这个dialog了
private string[] typeListNames = new string[] { "", "" };
//{
// return new string[] {
// PdnResources.GetString("Menu.Verticalauxiliaryline.text"),
// PdnResources.GetString("Menu.Horizontalauxiliaryline.text")};
//}
///
/// 直径
///
public int diameter;
///
/// 边距
///
public int margin;
///
/// 长度(垂线)
///
public int vLineLength;
///
/// 长度(水平线)
///
public int hLineLength;
///
/// 左上到右下斜线长度
///
public int TopleftLineLength;
///
/// 左下到右上斜线长度
///
public int ToprightLineLength;
///
/// 垂线到圆距离
///
public int VLineToCDistance;
///
/// 水平线到圆距离
///
public int HLineToCDistance;
///
/// 线宽
///
public int lineWidth;
/// %
///
public decimal percentage;
private Label label24;
private ToolTip toolTip1;
private IContainer components;
///
/// 选择的图片
///
private OpenCvSharp.Mat imageMat;
private Bitmap bitmap;
///
/// 选择标尺的物理长度(1倍下的 微米/像素)
///
double physical_length = 1;
///
/// 选择标尺的物理长度(1倍下的 微米/像素)
///
double physical_area_length_Micron = 1;
///
/// 排列顺序
///
private int index = 0;
public GrainGuideSettingsDialog(int picture, string xmlModelName, string[] typeListNames, OpenCvSharp.Mat imageMat, double physical_Micron = 1.0)
{
this.picture = picture;
this.xmlModelName = xmlModelName;
this.typeListNames = typeListNames;
this.imageMat = imageMat/*.Clone()*/;
this.bitmap = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(this.imageMat);
//Dictionary measurementUnitDictionary = Startup.instance.rules;
physical_length = physical_Micron;//;this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].GetRuler(MeasurementUnit.Micron)// measurementUnitDictionary[MeasurementUnit.Micron];
physical_area_length_Micron = physical_Micron;//;this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].GetRuler(MeasurementUnit.Micron) measurementUnitDictionary[MeasurementUnit.Micron];
//physical_area_length_Millimeter = measurementUnitDictionary[MeasurementUnit.Millimeter];
//double physical_area_length_Micron = getCurrentWorkspace().GetRuler(MeasurementUnit.Micron);
InitializeComponent();
InitializeLanguageText();
InitializeButtonBackgroudImage();
InitializeToolTip();
InitializeData();
//调色板
this.colorsForm = new ColorsForm();
this.colorsForm.StartPosition = FormStartPosition.CenterScreen;
this.colorsForm.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
}
#region 初始化
private void InitializeLanguageText()
{
this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
this.button2.Text = PdnResources.GetString("CommonAction.Save");
this.button1.Text = PdnResources.GetString("Menu.File.Close.Text");
this.groupBox2.Text = PdnResources.GetString("Menu.Tools.AuxiliaryLine.Text");
this.label21.Text = PdnResources.GetString("Menu.Numberoflines.text") + ":";
this.label19.Text = PdnResources.GetString("Menu.spacing.text") + ":";
this.label4.Text = PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text") + ":";
this.label20.Text = PdnResources.GetString("Menu.diameter.text") + ":";
this.label5.Text = PdnResources.GetString("Menu.diameter.text") + ":";
this.label8.Text = PdnResources.GetString("Menu.margin.Text") + ":";
this.label6.Text = PdnResources.GetString("Menu.Innercirclediameter.Text") + ":";
this.label17.Text = PdnResources.GetString("Menu.Rectheight.text") + ":";
this.label18.Text = PdnResources.GetString("Menu.Rectwidth.text") + ":";
this.label22.Text = PdnResources.GetString("Menu.Numberoflines.text") + ":";
this.label23.Text = PdnResources.GetString("Menu.spacing.text") + ":";
this.label1.Text = PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text") + ":";
this.label3.Text = PdnResources.GetString("Menu.Linewidth.text") + ":";
this.checkBox1.Text = PdnResources.GetString("Menu.Geometricscaling.Text");
this.label16.Text = PdnResources.GetString("Menu.Thedistancefromthehorizontothecircle.Text");
this.label15.Text = PdnResources.GetString("Menu.theperpendiculartothecircl.Text") + ":";
this.label13.Text = PdnResources.GetString("Menu.gonallinefrombottomlefttotopright.Text") + ":";
this.label14.Text = PdnResources.GetString("Menu.nalfromtoplefttob.Text") + ":";
this.label12.Text = PdnResources.GetString("Menu.margin.Text") + ":";
this.label11.Text = PdnResources.GetString("Menu.Innercirclediameter.Text") + ":";
this.label9.Text = PdnResources.GetString("Menu.Horizontallength.Text") + ":";
this.label10.Text = PdnResources.GetString("Menu.Set.Rulersettings.lengthofperpendicular.text") + ":";
this.label7.Text = PdnResources.GetString("Menu.name.text") + ":";
this.label2.Text = PdnResources.GetString("Menu.color.text") + ":";
this.label24.Text = PdnResources.GetString("Menu.Type.text") + ":";
this.groupBox3.Text = PdnResources.GetString("Menu.Preview.text");
this.groupBox4.Text = PdnResources.GetString("Menu.Preview.text");
this.Text = PdnResources.GetString("Menu.Auxiliarylinestylesettings.text");
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.panel4 = new System.Windows.Forms.Panel();
this.numericUpDown19 = new System.Windows.Forms.NumericUpDown();
this.label21 = new System.Windows.Forms.Label();
this.numericUpDown17 = new System.Windows.Forms.NumericUpDown();
this.label19 = new System.Windows.Forms.Label();
this.numericUpDown3 = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label();
this.panel9 = new System.Windows.Forms.Panel();
this.numericUpDown18 = new System.Windows.Forms.NumericUpDown();
this.label20 = new System.Windows.Forms.Label();
this.panel5 = new System.Windows.Forms.Panel();
this.numericUpDown4 = new System.Windows.Forms.NumericUpDown();
this.label5 = new System.Windows.Forms.Label();
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.panel6 = new System.Windows.Forms.Panel();
this.numericUpDown6 = new System.Windows.Forms.NumericUpDown();
this.label8 = new System.Windows.Forms.Label();
this.numericUpDown5 = new System.Windows.Forms.NumericUpDown();
this.label6 = new System.Windows.Forms.Label();
this.panel8 = new System.Windows.Forms.Panel();
this.numericUpDown15 = new System.Windows.Forms.NumericUpDown();
this.label17 = new System.Windows.Forms.Label();
this.numericUpDown16 = new System.Windows.Forms.NumericUpDown();
this.label18 = new System.Windows.Forms.Label();
this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
this.panel3 = new System.Windows.Forms.Panel();
this.numericUpDown20 = new System.Windows.Forms.NumericUpDown();
this.label22 = new System.Windows.Forms.Label();
this.numericUpDown21 = new System.Windows.Forms.NumericUpDown();
this.label23 = new System.Windows.Forms.Label();
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.label1 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.panel2 = new System.Windows.Forms.Panel();
this.panel7 = new System.Windows.Forms.Panel();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.numericUpDown14 = new System.Windows.Forms.NumericUpDown();
this.numericUpDown13 = new System.Windows.Forms.NumericUpDown();
this.label16 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.numericUpDown11 = new System.Windows.Forms.NumericUpDown();
this.label13 = new System.Windows.Forms.Label();
this.numericUpDown12 = new System.Windows.Forms.NumericUpDown();
this.label14 = new System.Windows.Forms.Label();
this.numericUpDown10 = new System.Windows.Forms.NumericUpDown();
this.label12 = new System.Windows.Forms.Label();
this.numericUpDown9 = new System.Windows.Forms.NumericUpDown();
this.label11 = new System.Windows.Forms.Label();
this.numericUpDown7 = new System.Windows.Forms.NumericUpDown();
this.label9 = new System.Windows.Forms.Label();
this.numericUpDown8 = new System.Windows.Forms.NumericUpDown();
this.label10 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label24 = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.panel1 = new System.Windows.Forms.Panel();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.GuideName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.GrainType = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.button5 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.panel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown19)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown17)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit();
this.panel9.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown18)).BeginInit();
this.panel5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit();
this.panel6.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).BeginInit();
this.panel8.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown15)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown16)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
this.panel3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown20)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown21)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
this.panel7.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown14)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown13)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown11)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown12)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown10)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown9)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown7)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown8)).BeginInit();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.button2);
this.groupBox1.Controls.Add(this.button1);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(500, 54);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
//
// button2
//
this.button2.Location = new System.Drawing.Point(414, 16);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(70, 28);
this.button2.TabIndex = 1;
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(325, 16);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(70, 28);
this.button1.TabIndex = 0;
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// groupBox2
//
this.groupBox2.Controls.Add(this.panel4);
this.groupBox2.Controls.Add(this.panel9);
this.groupBox2.Controls.Add(this.panel5);
this.groupBox2.Controls.Add(this.comboBox2);
this.groupBox2.Controls.Add(this.panel6);
this.groupBox2.Controls.Add(this.panel8);
this.groupBox2.Controls.Add(this.numericUpDown2);
this.groupBox2.Controls.Add(this.panel3);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.comboBox1);
this.groupBox2.Controls.Add(this.textBox1);
this.groupBox2.Controls.Add(this.panel2);
this.groupBox2.Controls.Add(this.panel7);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.label24);
this.groupBox2.Location = new System.Drawing.Point(193, 72);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(319, 260);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
//
// panel4
//
this.panel4.Controls.Add(this.numericUpDown19);
this.panel4.Controls.Add(this.label21);
this.panel4.Controls.Add(this.numericUpDown17);
this.panel4.Controls.Add(this.label19);
this.panel4.Controls.Add(this.numericUpDown3);
this.panel4.Controls.Add(this.label4);
this.panel4.Location = new System.Drawing.Point(21, 75);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(272, 107);
this.panel4.TabIndex = 23;
//
// numericUpDown19
//
this.numericUpDown19.Location = new System.Drawing.Point(56, 42);
this.numericUpDown19.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown19.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown19.Name = "numericUpDown19";
this.numericUpDown19.Size = new System.Drawing.Size(82, 21);
this.numericUpDown19.TabIndex = 25;
this.numericUpDown19.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown19.ValueChanged += new System.EventHandler(this.numericUpDown19_ValueChanged);
//
// label21
//
this.label21.AutoSize = true;
this.label21.Location = new System.Drawing.Point(6, 47);
this.label21.Name = "label21";
this.label21.Size = new System.Drawing.Size(53, 12);
this.label21.TabIndex = 24;
//
// numericUpDown17
//
this.numericUpDown17.Location = new System.Drawing.Point(179, 15);
this.numericUpDown17.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown17.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown17.Name = "numericUpDown17";
this.numericUpDown17.Size = new System.Drawing.Size(82, 21);
this.numericUpDown17.TabIndex = 23;
this.numericUpDown17.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown17.ValueChanged += new System.EventHandler(this.numericUpDown17_ValueChanged);
//
// label19
//
this.label19.AutoSize = true;
this.label19.Location = new System.Drawing.Point(136, 18);
this.label19.Name = "label19";
this.label19.Size = new System.Drawing.Size(41, 12);
this.label19.TabIndex = 22;
//
// numericUpDown3
//
this.numericUpDown3.Location = new System.Drawing.Point(48, 15);
this.numericUpDown3.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown3.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown3.Name = "numericUpDown3";
this.numericUpDown3.Size = new System.Drawing.Size(82, 21);
this.numericUpDown3.TabIndex = 21;
this.numericUpDown3.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown3.ValueChanged += new System.EventHandler(this.numericUpDown3_ValueChanged);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(6, 18);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(41, 12);
this.label4.TabIndex = 0;
//
// panel9
//
this.panel9.Controls.Add(this.numericUpDown18);
this.panel9.Controls.Add(this.label20);
this.panel9.Location = new System.Drawing.Point(21, 75);
this.panel9.Name = "panel9";
this.panel9.Size = new System.Drawing.Size(272, 107);
this.panel9.TabIndex = 28;
//
// numericUpDown18
//
this.numericUpDown18.Location = new System.Drawing.Point(52, 13);
this.numericUpDown18.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown18.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown18.Name = "numericUpDown18";
this.numericUpDown18.Size = new System.Drawing.Size(82, 21);
this.numericUpDown18.TabIndex = 21;
this.numericUpDown18.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown18.ValueChanged += new System.EventHandler(this.numericUpDown18_ValueChanged);
//
// label20
//
this.label20.AutoSize = true;
this.label20.Location = new System.Drawing.Point(6, 18);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(41, 12);
this.label20.TabIndex = 0;
//
// panel5
//
this.panel5.Controls.Add(this.numericUpDown4);
this.panel5.Controls.Add(this.label5);
this.panel5.Location = new System.Drawing.Point(21, 75);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(272, 107);
this.panel5.TabIndex = 24;
//
// numericUpDown4
//
this.numericUpDown4.Location = new System.Drawing.Point(52, 13);
this.numericUpDown4.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown4.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown4.Name = "numericUpDown4";
this.numericUpDown4.Size = new System.Drawing.Size(82, 21);
this.numericUpDown4.TabIndex = 21;
this.numericUpDown4.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown4.ValueChanged += new System.EventHandler(this.numericUpDown4_ValueChanged);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(6, 18);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(41, 12);
this.label5.TabIndex = 0;
//
// comboBox2
//
this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox2.FormattingEnabled = true;
this.comboBox2.Items.AddRange(new object[] {
"",
""});
this.comboBox2.Location = new System.Drawing.Point(55, 49);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(241, 20);
this.comboBox2.TabIndex = 26;
this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged);
//
// panel6
//
this.panel6.Controls.Add(this.numericUpDown6);
this.panel6.Controls.Add(this.label8);
this.panel6.Controls.Add(this.numericUpDown5);
this.panel6.Controls.Add(this.label6);
this.panel6.Location = new System.Drawing.Point(21, 75);
this.panel6.Name = "panel6";
this.panel6.Size = new System.Drawing.Size(272, 107);
this.panel6.TabIndex = 25;
//
// numericUpDown6
//
this.numericUpDown6.Location = new System.Drawing.Point(172, 13);
this.numericUpDown6.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown6.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown6.Name = "numericUpDown6";
this.numericUpDown6.Size = new System.Drawing.Size(75, 21);
this.numericUpDown6.TabIndex = 23;
this.numericUpDown6.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown6.ValueChanged += new System.EventHandler(this.numericUpDown6_ValueChanged);
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(135, 18);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(41, 12);
this.label8.TabIndex = 22;
//
// numericUpDown5
//
this.numericUpDown5.Location = new System.Drawing.Point(65, 13);
this.numericUpDown5.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown5.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown5.Name = "numericUpDown5";
this.numericUpDown5.Size = new System.Drawing.Size(69, 21);
this.numericUpDown5.TabIndex = 21;
this.numericUpDown5.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown5.ValueChanged += new System.EventHandler(this.numericUpDown5_ValueChanged);
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(6, 18);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(65, 12);
this.label6.TabIndex = 0;
//
// panel8
//
this.panel8.Controls.Add(this.numericUpDown15);
this.panel8.Controls.Add(this.label17);
this.panel8.Controls.Add(this.numericUpDown16);
this.panel8.Controls.Add(this.label18);
this.panel8.Location = new System.Drawing.Point(21, 75);
this.panel8.Name = "panel8";
this.panel8.Size = new System.Drawing.Size(272, 107);
this.panel8.TabIndex = 27;
//
// numericUpDown15
//
this.numericUpDown15.Location = new System.Drawing.Point(181, 13);
this.numericUpDown15.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown15.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown15.Name = "numericUpDown15";
this.numericUpDown15.Size = new System.Drawing.Size(82, 21);
this.numericUpDown15.TabIndex = 23;
this.numericUpDown15.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown15.ValueChanged += new System.EventHandler(this.numericUpDown15_ValueChanged);
//
// label17
//
this.label17.AutoSize = true;
this.label17.Location = new System.Drawing.Point(135, 18);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(53, 12);
this.label17.TabIndex = 22;
//
// numericUpDown16
//
this.numericUpDown16.Location = new System.Drawing.Point(52, 13);
this.numericUpDown16.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown16.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown16.Name = "numericUpDown16";
this.numericUpDown16.Size = new System.Drawing.Size(82, 21);
this.numericUpDown16.TabIndex = 21;
this.numericUpDown16.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown16.ValueChanged += new System.EventHandler(this.numericUpDown16_ValueChanged);
//
// label18
//
this.label18.AutoSize = true;
this.label18.Location = new System.Drawing.Point(6, 18);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(53, 12);
this.label18.TabIndex = 0;
//
// numericUpDown2
//
this.numericUpDown2.Location = new System.Drawing.Point(197, 235);
this.numericUpDown2.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown2.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown2.Name = "numericUpDown2";
this.numericUpDown2.Size = new System.Drawing.Size(82, 21);
this.numericUpDown2.TabIndex = 14;
this.numericUpDown2.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown2.ValueChanged += new System.EventHandler(this.numericUpDown2_ValueChanged);
//
// panel3
//
this.panel3.Controls.Add(this.numericUpDown20);
this.panel3.Controls.Add(this.label22);
this.panel3.Controls.Add(this.numericUpDown21);
this.panel3.Controls.Add(this.label23);
this.panel3.Controls.Add(this.numericUpDown1);
this.panel3.Controls.Add(this.label1);
this.panel3.Location = new System.Drawing.Point(21, 75);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(272, 107);
this.panel3.TabIndex = 22;
//
// numericUpDown20
//
this.numericUpDown20.Location = new System.Drawing.Point(58, 42);
this.numericUpDown20.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown20.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown20.Name = "numericUpDown20";
this.numericUpDown20.Size = new System.Drawing.Size(82, 21);
this.numericUpDown20.TabIndex = 29;
this.numericUpDown20.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown20.ValueChanged += new System.EventHandler(this.numericUpDown20_ValueChanged);
//
// label22
//
this.label22.AutoSize = true;
this.label22.Location = new System.Drawing.Point(7, 47);
this.label22.Name = "label22";
this.label22.Size = new System.Drawing.Size(53, 12);
this.label22.TabIndex = 28;
//
// numericUpDown21
//
this.numericUpDown21.Location = new System.Drawing.Point(183, 14);
this.numericUpDown21.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown21.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown21.Name = "numericUpDown21";
this.numericUpDown21.Size = new System.Drawing.Size(82, 21);
this.numericUpDown21.TabIndex = 27;
this.numericUpDown21.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown21.ValueChanged += new System.EventHandler(this.numericUpDown21_ValueChanged);
//
// label23
//
this.label23.AutoSize = true;
this.label23.Location = new System.Drawing.Point(140, 18);
this.label23.Name = "label23";
this.label23.Size = new System.Drawing.Size(41, 12);
this.label23.TabIndex = 26;
//
// numericUpDown1
//
this.numericUpDown1.Location = new System.Drawing.Point(50, 14);
this.numericUpDown1.Maximum = new decimal(new int[] {
9999999,
0,
0,
0});
this.numericUpDown1.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(82, 21);
this.numericUpDown1.TabIndex = 21;
this.numericUpDown1.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 18);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.TabIndex = 0;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(154, 240);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(41, 12);
this.label3.TabIndex = 2;
//
// comboBox1
//
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(55, 49);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(241, 20);
this.comboBox1.TabIndex = 20;
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged_1);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(55, 17);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(241, 21);
this.textBox1.TabIndex = 19;
//
// panel2
//
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel2.Location = new System.Drawing.Point(63, 235);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(81, 21);
this.panel2.TabIndex = 12;
this.panel2.BackColorChanged += new System.EventHandler(this.panel2_BackColorChanged);
this.panel2.Click += new System.EventHandler(this.panel2_Click);
//
// panel7
//
this.panel7.Controls.Add(this.checkBox1);
this.panel7.Controls.Add(this.numericUpDown14);
this.panel7.Controls.Add(this.numericUpDown13);
this.panel7.Controls.Add(this.label16);
this.panel7.Controls.Add(this.label15);
this.panel7.Controls.Add(this.numericUpDown11);
this.panel7.Controls.Add(this.label13);
this.panel7.Controls.Add(this.numericUpDown12);
this.panel7.Controls.Add(this.label14);
this.panel7.Controls.Add(this.numericUpDown10);
this.panel7.Controls.Add(this.label12);
this.panel7.Controls.Add(this.numericUpDown9);
this.panel7.Controls.Add(this.label11);
this.panel7.Controls.Add(this.numericUpDown7);
this.panel7.Controls.Add(this.label9);
this.panel7.Controls.Add(this.numericUpDown8);
this.panel7.Controls.Add(this.label10);
this.panel7.Location = new System.Drawing.Point(21, 75);
this.panel7.Name = "panel7";
this.panel7.Size = new System.Drawing.Size(272, 154);
this.panel7.TabIndex = 26;
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(191, 132);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(72, 16);
this.checkBox1.TabIndex = 36;
this.checkBox1.UseVisualStyleBackColor = true;
//
// numericUpDown14
//
this.numericUpDown14.Location = new System.Drawing.Point(101, 130);
this.numericUpDown14.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown14.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown14.Name = "numericUpDown14";
this.numericUpDown14.Size = new System.Drawing.Size(64, 21);
this.numericUpDown14.TabIndex = 35;
this.numericUpDown14.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
//
// numericUpDown13
//
this.numericUpDown13.Location = new System.Drawing.Point(91, 107);
this.numericUpDown13.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown13.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown13.Name = "numericUpDown13";
this.numericUpDown13.Size = new System.Drawing.Size(63, 21);
this.numericUpDown13.TabIndex = 34;
this.numericUpDown13.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(6, 133);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(101, 12);
this.label16.TabIndex = 33;
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(6, 109);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(89, 12);
this.label15.TabIndex = 32;
//
// numericUpDown11
//
this.numericUpDown11.Location = new System.Drawing.Point(129, 83);
this.numericUpDown11.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown11.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown11.Name = "numericUpDown11";
this.numericUpDown11.Size = new System.Drawing.Size(63, 21);
this.numericUpDown11.TabIndex = 31;
this.numericUpDown11.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(6, 86);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(125, 12);
this.label13.TabIndex = 30;
//
// numericUpDown12
//
this.numericUpDown12.Location = new System.Drawing.Point(129, 57);
this.numericUpDown12.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown12.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown12.Name = "numericUpDown12";
this.numericUpDown12.Size = new System.Drawing.Size(63, 21);
this.numericUpDown12.TabIndex = 29;
this.numericUpDown12.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(6, 61);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(125, 12);
this.label14.TabIndex = 28;
//
// numericUpDown10
//
this.numericUpDown10.Location = new System.Drawing.Point(200, 32);
this.numericUpDown10.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown10.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown10.Name = "numericUpDown10";
this.numericUpDown10.Size = new System.Drawing.Size(63, 21);
this.numericUpDown10.TabIndex = 27;
this.numericUpDown10.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(167, 36);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(41, 12);
this.label12.TabIndex = 26;
//
// numericUpDown9
//
this.numericUpDown9.Location = new System.Drawing.Point(66, 32);
this.numericUpDown9.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown9.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown9.Name = "numericUpDown9";
this.numericUpDown9.Size = new System.Drawing.Size(65, 21);
this.numericUpDown9.TabIndex = 25;
this.numericUpDown9.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(6, 36);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(65, 12);
this.label11.TabIndex = 24;
//
// numericUpDown7
//
this.numericUpDown7.Location = new System.Drawing.Point(200, 6);
this.numericUpDown7.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown7.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown7.Name = "numericUpDown7";
this.numericUpDown7.Size = new System.Drawing.Size(63, 21);
this.numericUpDown7.TabIndex = 23;
this.numericUpDown7.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(131, 11);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(77, 12);
this.label9.TabIndex = 22;
//
// numericUpDown8
//
this.numericUpDown8.Location = new System.Drawing.Point(66, 6);
this.numericUpDown8.Maximum = new decimal(new int[] {
99999999,
0,
0,
0});
this.numericUpDown8.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown8.Name = "numericUpDown8";
this.numericUpDown8.Size = new System.Drawing.Size(63, 21);
this.numericUpDown8.TabIndex = 21;
this.numericUpDown8.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(6, 11);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(65, 12);
this.label10.TabIndex = 0;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(19, 23);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(41, 12);
this.label7.TabIndex = 18;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(19, 240);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 12);
this.label2.TabIndex = 1;
//
// label24
//
this.label24.AutoSize = true;
this.label24.Location = new System.Drawing.Point(19, 52);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(41, 12);
this.label24.TabIndex = 29;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.panel1);
this.groupBox3.Location = new System.Drawing.Point(193, 338);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(319, 213);
this.groupBox3.TabIndex = 1;
this.groupBox3.TabStop = false;
//
// panel1
//
this.panel1.Location = new System.Drawing.Point(6, 17);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(307, 190);
this.panel1.TabIndex = 0;
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
//
// groupBox4
//
this.groupBox4.Controls.Add(this.dataGridView1);
this.groupBox4.Controls.Add(this.button5);
this.groupBox4.Controls.Add(this.button4);
this.groupBox4.Controls.Add(this.button3);
this.groupBox4.Location = new System.Drawing.Point(12, 72);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(175, 473);
this.groupBox4.TabIndex = 2;
this.groupBox4.TabStop = false;
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.ColumnHeadersVisible = false;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.GuideName,
this.Column1,
this.GrainType});
this.dataGridView1.Location = new System.Drawing.Point(6, 53);
this.dataGridView1.MultiSelect = false;
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.RowHeadersVisible = false;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView1.Size = new System.Drawing.Size(162, 414);
this.dataGridView1.TabIndex = 4;
this.dataGridView1.SelectionChanged += new System.EventHandler(this.dataGridView1_SelectionChanged);
//
// GuideName
//
this.GuideName.HeaderText = "";
this.GuideName.Name = "GuideName";
//
// Column1
//
this.Column1.HeaderText = "Column1";
this.Column1.Name = "Column1";
this.Column1.Visible = false;
//
// GrainType
//
this.GrainType.HeaderText = "Column1";
this.GrainType.Name = "GrainType";
this.GrainType.Visible = false;
//
// button5
//
this.button5.Location = new System.Drawing.Point(138, 18);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(30, 25);
this.button5.TabIndex = 3;
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// button4
//
this.button4.Location = new System.Drawing.Point(104, 18);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(30, 25);
this.button4.TabIndex = 2;
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(70, 18);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(30, 25);
this.button3.TabIndex = 1;
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// GrainGuideSettingsDialog
//
this.ClientSize = new System.Drawing.Size(521, 553);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(537, 592);
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(537, 592);
this.Name = "GrainGuideSettingsDialog";
this.ShowInTaskbar = false;
this.Load += new System.EventHandler(this.GrainGuideSettingsDialog_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.panel4.ResumeLayout(false);
this.panel4.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown19)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown17)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
this.panel9.ResumeLayout(false);
this.panel9.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown18)).EndInit();
this.panel5.ResumeLayout(false);
this.panel5.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();
this.panel6.ResumeLayout(false);
this.panel6.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).EndInit();
this.panel8.ResumeLayout(false);
this.panel8.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown15)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown16)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
this.panel3.ResumeLayout(false);
this.panel3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown20)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown21)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
this.panel7.ResumeLayout(false);
this.panel7.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown14)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown13)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown11)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown12)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown10)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown9)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown7)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown8)).EndInit();
this.groupBox3.ResumeLayout(false);
this.groupBox4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private void InitializeToolTip()
{
this.toolTip1 = new ToolTip();
this.toolTip1.SetToolTip(this.button3, PdnResources.GetString("Menu.Addto.text"));
this.toolTip1.SetToolTip(this.button4, PdnResources.GetString("Menu.Edit.Text"));
this.toolTip1.SetToolTip(this.button5, PdnResources.GetString("Menu.Edit.Delete.Text"));
this.toolTip1.ShowAlways = true;
}
private void InitializeButtonBackgroudImage()
{
this.button3.FlatStyle = FlatStyle.Flat;
this.button3.FlatAppearance.BorderSize = 0;
this.button3.BackgroundImageLayout = ImageLayout.Center;
this.button3.BackgroundImage = PdnResources.GetImageResource("Icons.MenuRulesListAddIcon.png").Reference;
this.button4.FlatStyle = FlatStyle.Flat;
this.button4.FlatAppearance.BorderSize = 0;
this.button4.BackgroundImageLayout = ImageLayout.Center;
this.button4.BackgroundImage = PdnResources.GetImageResource("Icons.MenuRulesListEditIcon.png").Reference;
this.button5.FlatStyle = FlatStyle.Flat;
this.button5.FlatAppearance.BorderSize = 0;
this.button5.BackgroundImageLayout = ImageLayout.Center;
this.button5.BackgroundImage = PdnResources.GetImageResource("Icons.MenuRulesListDeleteIcon.png").Reference;
}
///
/// 初始化数据
///
private void InitializeData()
{
if (this.comboBox1.Items.Count > 0)
this.comboBox1.SelectedIndex = 0;
this.comboBox2.SelectedIndex = 0;
if(this.picture == 0)
{
this.comboBox1.Visible = true;
this.comboBox2.Visible = false;
}
else if (this.picture == 1)
{
this.comboBox1.Visible = false;
this.comboBox2.Visible = true;
}
this.groupBox2.Enabled = false;
this.dataGridView1.ReadOnly = true;
this.numericUpDown15.Maximum = 999999;
this.numericUpDown15.Minimum = 1;
this.numericUpDown16.Maximum = 999999;
this.numericUpDown16.Minimum = 1;
if (this.picture == 0)
{
GrainSizeGuideStyleModel grainSizeGuideStyleModel = XmlSerializeHelper.DESerializer(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\" + this.xmlModelName, FileMode.Open));
// 垂直辅助线
if (grainSizeGuideStyleModel.vGuideStyles != null)//###
{
foreach (var vGuideStyle in grainSizeGuideStyleModel.vGuideStyles)
{
index++;
DataGridViewRow row = new DataGridViewRow();
foreach (DataGridViewColumn c in this.dataGridView1.Columns)
{
row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
}
row.Cells[0].Value = vGuideStyle.tag;
row.Cells[1].Value = PdnResources.GetString("Menu.Verticalauxiliaryline.text");
row.Cells[2].Value = vGuideStyle.index;
this.dataGridView1.Rows.Add(row);
ArrayList arrayList = new ArrayList();
arrayList.Add(vGuideStyle.tag);
arrayList.Add(PdnResources.GetString("Menu.Verticalauxiliaryline.text"));
arrayList.Add(vGuideStyle.lineLength);
arrayList.Add(vGuideStyle.lineSpacing);
arrayList.Add(vGuideStyle.lineDec);
arrayList.Add(vGuideStyle.lineColor);
arrayList.Add(vGuideStyle.lineWidth);
arrayList.Add(vGuideStyle.index);
this.arrayLists.Add(arrayList);
}
}
// 水平辅助线
if (grainSizeGuideStyleModel.hGuideStyles != null)
{
foreach (var hGuideStyle in grainSizeGuideStyleModel.hGuideStyles)
{
index++;
DataGridViewRow row = new DataGridViewRow();
foreach (DataGridViewColumn c in this.dataGridView1.Columns)
{
row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
}
row.Cells[0].Value = hGuideStyle.tag;
row.Cells[1].Value = PdnResources.GetString("Menu.Horizontalauxiliaryline.text");
row.Cells[2].Value = hGuideStyle.index;
this.dataGridView1.Rows.Add(row);
ArrayList arrayList = new ArrayList();
arrayList.Add(hGuideStyle.tag);
arrayList.Add(PdnResources.GetString("Menu.Horizontalauxiliaryline.text"));
arrayList.Add(hGuideStyle.lineLength);
arrayList.Add(hGuideStyle.lineSpacing);
arrayList.Add(hGuideStyle.lineDec);
arrayList.Add(hGuideStyle.lineColor);
arrayList.Add(hGuideStyle.lineWidth);
arrayList.Add(hGuideStyle.index);
this.arrayLists.Add(arrayList);
}
}
// 单圆辅助线
if (grainSizeGuideStyleModel.cGuideStyles != null/* && this.gbtType != 1*/)//###
{
foreach (var cGuideStyle in grainSizeGuideStyleModel.cGuideStyles)
{
index++;
DataGridViewRow row = new DataGridViewRow();
foreach (DataGridViewColumn c in this.dataGridView1.Columns)
{
row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
}
row.Cells[0].Value = cGuideStyle.tag;
row.Cells[1].Value = PdnResources.GetString("Menu.Singlecircleauxiliaryline.text");
row.Cells[2].Value = cGuideStyle.index;
this.dataGridView1.Rows.Add(row);
ArrayList arrayList = new ArrayList();
arrayList.Add(cGuideStyle.tag);
arrayList.Add(PdnResources.GetString("Menu.Singlecircleauxiliaryline.text"));
arrayList.Add(cGuideStyle.diameter);
arrayList.Add(cGuideStyle.lineColor);
arrayList.Add(cGuideStyle.lineWidth);
arrayList.Add(cGuideStyle.index);
this.arrayLists.Add(arrayList);
}
}
// 三圆辅助线
if (grainSizeGuideStyleModel.tCGuideStyles != null)
{
foreach (var tCGuideStyle in grainSizeGuideStyleModel.tCGuideStyles)
{
index++;
DataGridViewRow row = new DataGridViewRow();
foreach (DataGridViewColumn c in this.dataGridView1.Columns)
{
row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
}
row.Cells[0].Value = tCGuideStyle.tag;
row.Cells[1].Value = PdnResources.GetString("Menu.Three-circleauxiliaryline.text");
row.Cells[2].Value = tCGuideStyle.index;
this.dataGridView1.Rows.Add(row);
ArrayList arrayList = new ArrayList();
arrayList.Add(tCGuideStyle.tag);
arrayList.Add(PdnResources.GetString("Menu.Three-circleauxiliaryline.text"));
arrayList.Add(tCGuideStyle.diameter);
arrayList.Add(tCGuideStyle.margin);
arrayList.Add(tCGuideStyle.lineColor);
arrayList.Add(tCGuideStyle.lineWidth);
arrayList.Add(tCGuideStyle.index);
this.arrayLists.Add(arrayList);
}
}
// 复合辅助线
if (grainSizeGuideStyleModel.rGuideStyles != null/* && this.gbtType != 1 && this.gbtType != 13*/)//###
{
foreach (var rGuideStyle in grainSizeGuideStyleModel.rGuideStyles)
{
index++;
DataGridViewRow row = new DataGridViewRow();
foreach (DataGridViewColumn c in this.dataGridView1.Columns)
{
row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
}
row.Cells[0].Value = rGuideStyle.tag;
row.Cells[1].Value = PdnResources.GetString("Menu.Compositeauxiliaryline.text");
row.Cells[2].Value = rGuideStyle.index;
this.dataGridView1.Rows.Add(row);
ArrayList arrayList = new ArrayList();
arrayList.Add(rGuideStyle.tag);
arrayList.Add(PdnResources.GetString("Menu.Compositeauxiliaryline.text"));
arrayList.Add(rGuideStyle.vLineLength);
arrayList.Add(rGuideStyle.hLineLength);
arrayList.Add(rGuideStyle.diameter);
arrayList.Add(rGuideStyle.margin);
arrayList.Add(rGuideStyle.TopleftLineLength);
arrayList.Add(rGuideStyle.ToprightLineLength);
arrayList.Add(rGuideStyle.VLineToCDistance);
arrayList.Add(rGuideStyle.HLineToCDistance);
arrayList.Add(rGuideStyle.lineColor);
arrayList.Add(rGuideStyle.lineWidth);
arrayList.Add(rGuideStyle.index);
this.arrayLists.Add(arrayList);
}
}
}
else if(this.picture == 1)
{
GrainSizeGuideAreaMethodModel grainSizeGuideAreaMethodModel = XmlSerializeHelper.DESerializer(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\" + this.xmlModelName, FileMode.Open));
// 圆形
if (grainSizeGuideAreaMethodModel.circularGuideStyles != null)
{
foreach (var circularGuideStyle in grainSizeGuideAreaMethodModel.circularGuideStyles)
{
index++;
DataGridViewRow row = new DataGridViewRow();
foreach (DataGridViewColumn c in this.dataGridView1.Columns)
{
row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
}
row.Cells[0].Value = circularGuideStyle.tag;
row.Cells[1].Value = PdnResources.GetString("Menu.circular.Text");
row.Cells[2].Value = circularGuideStyle.index;
this.dataGridView1.Rows.Add(row);
ArrayList arrayList = new ArrayList();
arrayList.Add(circularGuideStyle.tag);
arrayList.Add(PdnResources.GetString("Menu.circular.Text"));
arrayList.Add(circularGuideStyle.lineDiameter);
arrayList.Add(circularGuideStyle.lineColor);
arrayList.Add(circularGuideStyle.lineWidth);
arrayList.Add(circularGuideStyle.index);
this.arrayLists.Add(arrayList);
}
}
// 矩形
if (grainSizeGuideAreaMethodModel.rectangleGuideStyles != null)//###
{
foreach (var rectangleGuideStyle in grainSizeGuideAreaMethodModel.rectangleGuideStyles)
{
index++;
DataGridViewRow row = new DataGridViewRow();
foreach (DataGridViewColumn c in this.dataGridView1.Columns)
{
row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
}
row.Cells[0].Value = rectangleGuideStyle.tag;
row.Cells[1].Value = PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text");
row.Cells[2].Value = rectangleGuideStyle.index;
this.dataGridView1.Rows.Add(row);
ArrayList arrayList = new ArrayList();
arrayList.Add(rectangleGuideStyle.tag);
arrayList.Add(PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text"));
arrayList.Add(rectangleGuideStyle.lineRectangleWidth);
arrayList.Add(rectangleGuideStyle.lineRectangleHeight);
arrayList.Add(rectangleGuideStyle.lineColor);
arrayList.Add(rectangleGuideStyle.lineWidth);
arrayList.Add(rectangleGuideStyle.index);
this.arrayLists.Add(arrayList);
}
}
}
dataGridView1.Sort(dataGridView1.Columns[2], ListSortDirection.Ascending);
}
///
/// 保存到配置文件
///
private void SaveXmlFile()
{
if (this.picture == 0)
{
GrainSizeGuideStyleModel grainSizeGuideStyleModel = new GrainSizeGuideStyleModel();
grainSizeGuideStyleModel.vGuideStyles = new List();
grainSizeGuideStyleModel.hGuideStyles = new List();
grainSizeGuideStyleModel.cGuideStyles = new List();
grainSizeGuideStyleModel.tCGuideStyles = new List();
grainSizeGuideStyleModel.rGuideStyles = new List();
foreach (ArrayList arrayList1 in this.arrayLists)
{
if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(arrayList1[1]))
{
GrainSizeGuideStyleModel.VGuideStyle vGuideStyle = new GrainSizeGuideStyleModel.VGuideStyle();
vGuideStyle.tag = arrayList1[0].ToString();
vGuideStyle.lineLength = Convert.ToInt32(arrayList1[2]);
vGuideStyle.lineSpacing = Convert.ToInt32(arrayList1[3]);
vGuideStyle.lineDec = Convert.ToInt32(arrayList1[4]);
vGuideStyle.lineColor = Convert.ToInt32(arrayList1[5]);
vGuideStyle.lineWidth = Convert.ToInt32(arrayList1[6]);
vGuideStyle.index = Convert.ToInt32(arrayList1[7]);
grainSizeGuideStyleModel.vGuideStyles.Add(vGuideStyle);
}
else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(arrayList1[1]))
{
GrainSizeGuideStyleModel.HGuideStyle hGuideStyle = new GrainSizeGuideStyleModel.HGuideStyle();
hGuideStyle.tag = arrayList1[0].ToString();
hGuideStyle.lineLength = Convert.ToInt32(arrayList1[2]);
hGuideStyle.lineSpacing = Convert.ToInt32(arrayList1[3]);
hGuideStyle.lineDec = Convert.ToInt32(arrayList1[4]);
hGuideStyle.lineColor = Convert.ToInt32(arrayList1[5]);
hGuideStyle.lineWidth = Convert.ToInt32(arrayList1[6]);
hGuideStyle.index = Convert.ToInt32(arrayList1[7]);
grainSizeGuideStyleModel.hGuideStyles.Add(hGuideStyle);
}
else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(arrayList1[1]))
{
GrainSizeGuideStyleModel.CGuideStyle cGuideStyle = new GrainSizeGuideStyleModel.CGuideStyle();
cGuideStyle.tag = arrayList1[0].ToString();
cGuideStyle.diameter = Convert.ToInt32(arrayList1[2]);
cGuideStyle.lineColor = Convert.ToInt32(arrayList1[3]);
cGuideStyle.lineWidth = Convert.ToInt32(arrayList1[4]);
cGuideStyle.index = Convert.ToInt32(arrayList1[5]);
grainSizeGuideStyleModel.cGuideStyles.Add(cGuideStyle);
}
else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(arrayList1[1]))
{
GrainSizeGuideStyleModel.TCGuideStyle tCGuideStyle = new GrainSizeGuideStyleModel.TCGuideStyle();
tCGuideStyle.tag = arrayList1[0].ToString();
tCGuideStyle.diameter = Convert.ToInt32(arrayList1[2]);
tCGuideStyle.margin = Convert.ToInt32(arrayList1[3]);
tCGuideStyle.lineColor = Convert.ToInt32(arrayList1[4]);
tCGuideStyle.lineWidth = Convert.ToInt32(arrayList1[5]);
tCGuideStyle.index = Convert.ToInt32(arrayList1[6]);
grainSizeGuideStyleModel.tCGuideStyles.Add(tCGuideStyle);
}
else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(arrayList1[1]))
{
GrainSizeGuideStyleModel.RGuideStyle rGuideStyle = new GrainSizeGuideStyleModel.RGuideStyle();
rGuideStyle.tag = arrayList1[0].ToString();
rGuideStyle.vLineLength = Convert.ToInt32(arrayList1[2]);
rGuideStyle.hLineLength = Convert.ToInt32(arrayList1[3]);
rGuideStyle.diameter = Convert.ToInt32(arrayList1[4]);
rGuideStyle.margin = Convert.ToInt32(arrayList1[5]);
rGuideStyle.TopleftLineLength = Convert.ToInt32(arrayList1[6]);
rGuideStyle.ToprightLineLength = Convert.ToInt32(arrayList1[7]);
rGuideStyle.VLineToCDistance = Convert.ToInt32(arrayList1[8]);
rGuideStyle.HLineToCDistance = Convert.ToInt32(arrayList1[9]);
rGuideStyle.lineColor = Convert.ToInt32(arrayList1[10]);
rGuideStyle.lineWidth = Convert.ToInt32(arrayList1[11]);
rGuideStyle.index = Convert.ToInt32(arrayList1[12]);
grainSizeGuideStyleModel.rGuideStyles.Add(rGuideStyle);
}
}
//以下保存xml文件信息
string stageModelXml = XmlSerializeHelper.XmlSerialize(grainSizeGuideStyleModel);
string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\" + this.xmlModelName;
FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create);
}
else if (this.picture == 1)
{
GrainSizeGuideAreaMethodModel grainSizeGuideAreaMethodModel = new GrainSizeGuideAreaMethodModel();
grainSizeGuideAreaMethodModel.circularGuideStyles = new List();
grainSizeGuideAreaMethodModel.rectangleGuideStyles = new List();
foreach (ArrayList arrayList1 in this.arrayLists)
{
if (PdnResources.GetString("Menu.circular.Text").Equals(arrayList1[1]))
{
GrainSizeGuideAreaMethodModel.circular circular = new GrainSizeGuideAreaMethodModel.circular();
circular.tag = arrayList1[0].ToString();
circular.lineDiameter = Convert.ToInt32(arrayList1[2]);
circular.lineColor = Convert.ToInt32(arrayList1[3]);
circular.lineWidth = Convert.ToInt32(arrayList1[4]);
circular.index = Convert.ToInt32(arrayList1[5]);
grainSizeGuideAreaMethodModel.circularGuideStyles.Add(circular);
}
else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(arrayList1[1]))
{
GrainSizeGuideAreaMethodModel.rectangle rectangle = new GrainSizeGuideAreaMethodModel.rectangle();
rectangle.tag = arrayList1[0].ToString();
rectangle.lineRectangleWidth = Convert.ToInt32(arrayList1[2]);
rectangle.lineRectangleHeight = Convert.ToInt32(arrayList1[3]);
rectangle.lineColor = Convert.ToInt32(arrayList1[4]);
rectangle.lineWidth = Convert.ToInt32(arrayList1[5]);
rectangle.index = Convert.ToInt32(arrayList1[6]);
grainSizeGuideAreaMethodModel.rectangleGuideStyles.Add(rectangle);
}
}
//以下保存xml文件信息
string stageModelXml = XmlSerializeHelper.XmlSerialize(grainSizeGuideAreaMethodModel);
string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\" + this.xmlModelName;
FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create);
}
}
///
/// 页面关闭
///
///
///
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
{
}
private void panel2_Click(object sender, EventArgs e)
{
this.colorsForm.UserPrimaryColor = ColorBgra.FromColor(this.panel2.BackColor);
this.colorsForm.setSaveBtn_Click(new System.EventHandler(this.panel2Changed));
this.colorsForm.ShowDialog();
}
private void panel2Changed(object sender, EventArgs e)
{
this.panel2.BackColor = this.colorsForm.UserPrimaryColor.ToColor();
this.colorsForm.Close();
}
private void InitGroupbox2()
{
this.textBox1.Clear();
if (this.comboBox1.Items.Count > 0)
this.comboBox1.SelectedIndex = 0;
this.comboBox2.SelectedIndex = 0;
this.numericUpDown1.Value = 1;
this.numericUpDown2.Value = 1;
this.numericUpDown3.Value = 1;
this.numericUpDown4.Value = 1;
this.numericUpDown5.Value = 1;
this.numericUpDown6.Value = 1;
this.numericUpDown7.Value = 1;
this.numericUpDown8.Value = 1;
this.numericUpDown9.Value = 1;
this.numericUpDown10.Value = 1;
this.numericUpDown11.Value = 1;
this.numericUpDown12.Value = 1;
this.numericUpDown13.Value = 1;
this.numericUpDown14.Value = 1;
this.numericUpDown15.Value = 1;
this.numericUpDown16.Value = 1;
this.numericUpDown18.Value = 1;
this.numericUpDown17.Value = 1;
this.numericUpDown19.Value = 1;
this.numericUpDown20.Value = 1;
this.numericUpDown21.Value = 1;
}
///
/// 返回维护的辅助线
///
/// 操作区分(0 :添加 1 :编辑 2 :删除)
private void ReturnGrainSize(int currentOperation = -1)
{
ArrayList arrayList = new ArrayList();
for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
{
arrayList.Add(this.dataGridView1.Rows[i].Cells[0].Value);
}
if (this.Owner is GrainSizeStandardDialog)
{
GrainSizeStandardDialog grainSizeMethodDialog = (GrainSizeStandardDialog)this.Owner;
if (currentOperation == 0)//#21794
grainSizeMethodDialog.AddComboboxValue(arrayList);
else
{
grainSizeMethodDialog.comboboxChange = false;
grainSizeMethodDialog.InitComboboxValue(arrayList);
}
}
//if (this.picture == 0)//###
//{
// ArrayList arrayList = new ArrayList();
// for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
// {
// arrayList.Add(this.dataGridView1.Rows[i].Cells[0].Value);
// }
// GrainSizeStandardDialog grainSizeMethodDialog = (GrainSizeStandardDialog)this.Owner;
// grainSizeMethodDialog.comboboxChange = false;
// grainSizeMethodDialog.InitComboboxValue(arrayList);
//}
//else if(this.picture == 1)
//{
// ArrayList arrayList = new ArrayList();
// for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
// {
// arrayList.Add(this.dataGridView1.Rows[i].Cells[0].Value);
// }
// GrainSizeStandardDialog grainSizeMethodDialog = (GrainSizeStandardDialog)this.Owner;
// grainSizeMethodDialog.comboboxChange = false;
// grainSizeMethodDialog.InitComboboxValue(arrayList);
//}
}
///
/// 保存按钮
///
///
///
private void button2_Click(object sender, EventArgs e)
{
int currentOperation = this.operation;
if (this.picture == 0)
{
// 添加
if (this.operation == 0)
{
if (string.IsNullOrEmpty(this.textBox1.Text))
{
MessageBox.Show(PdnResources.GetString("Menu.namecannotbeEmpty.text")+"!");
}
else
{
bool next = true;
for (int r = 0; r < this.dataGridView1.Rows.Count; r++)
{
if (this.dataGridView1.Rows[r].Cells[0].Value.Equals(this.textBox1.Text))
{
MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
next = false;
break;
}
}
if (next)
{
index++;
ArrayList arrayList = new ArrayList();
if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
arrayList.Add(this.textBox1.Text);
arrayList.Add(this.comboBox1.SelectedItem);
arrayList.Add(Convert.ToInt32(this.numericUpDown1.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown21.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown20.Value));
arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
arrayList.Add(index);
}
else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
arrayList.Add(this.textBox1.Text);
arrayList.Add(this.comboBox1.SelectedItem);
arrayList.Add(Convert.ToInt32(this.numericUpDown3.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown17.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown19.Value));
arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
arrayList.Add(index);
}
else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
arrayList.Add(this.textBox1.Text);
arrayList.Add(this.comboBox1.SelectedItem);
arrayList.Add(Convert.ToInt32(this.numericUpDown4.Value));
arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
arrayList.Add(index);
}
else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
arrayList.Add(this.textBox1.Text);
arrayList.Add(this.comboBox1.SelectedItem);
arrayList.Add(Convert.ToInt32(this.numericUpDown5.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown6.Value));
arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
arrayList.Add(index);
}
else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
arrayList.Add(this.textBox1.Text);
arrayList.Add(this.comboBox1.SelectedItem);
arrayList.Add(Convert.ToInt32(this.numericUpDown8.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown7.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown9.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown10.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown12.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown11.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown13.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown14.Value));
arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
arrayList.Add(index);
}
this.arrayLists.Add(arrayList);
DataGridViewRow row = new DataGridViewRow();
foreach (DataGridViewColumn c in this.dataGridView1.Columns)
{
row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
}
row.Cells[0].Value = this.textBox1.Text;
row.Cells[1].Value = this.comboBox1.SelectedItem;
this.dataGridView1.Rows.Add(row);
SaveXmlFile();
//MessageBox.Show(PdnResources.GetString("Menu.Addsuccessfully.text")+"!");//###20506
operation = -1;
this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Selected = true;
}
}
}
// 编辑
else if (this.operation == 1)
{
if (string.IsNullOrEmpty(this.textBox1.Text))
{
MessageBox.Show(PdnResources.GetString("Menu.namecannotbeEmpty.text")+"!");
}
else
{
bool next = true;
for (int r = 0; r < this.dataGridView1.Rows.Count; r++)
{
if (this.dataGridView1.Rows[r].Cells[0].Value.Equals(this.textBox1.Text) && this.dataGridView1.SelectedRows[0].Index != r)
{
MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
next = false;
break;
}
}
if (next)
{
int updIndex = 0;
foreach (var arrayList1 in this.arrayLists)
{
if (arrayList1[0].ToString().Equals(this.dataGridView1.SelectedRows[0].Cells[0].Value))
{
updIndex = Convert.ToInt32(arrayList1[arrayList1.Count - 1]);
this.arrayLists.Remove(arrayList1);
break;
}
}
ArrayList arrayList = new ArrayList();
if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
arrayList.Add(this.textBox1.Text);
arrayList.Add(this.comboBox1.SelectedItem);
arrayList.Add(Convert.ToInt32(this.numericUpDown1.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown21.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown20.Value));
arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
arrayList.Add(updIndex);
}
else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
arrayList.Add(this.textBox1.Text);
arrayList.Add(this.comboBox1.SelectedItem);
arrayList.Add(Convert.ToInt32(this.numericUpDown3.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown17.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown19.Value));
arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
arrayList.Add(updIndex);
}
else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
arrayList.Add(this.textBox1.Text);
arrayList.Add(this.comboBox1.SelectedItem);
arrayList.Add(Convert.ToInt32(this.numericUpDown4.Value));
arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
arrayList.Add(updIndex);
}
else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
arrayList.Add(this.textBox1.Text);
arrayList.Add(this.comboBox1.SelectedItem);
arrayList.Add(Convert.ToInt32(this.numericUpDown5.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown6.Value));
arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
arrayList.Add(updIndex);
}
else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
arrayList.Add(this.textBox1.Text);
arrayList.Add(this.comboBox1.SelectedItem);
arrayList.Add(Convert.ToInt32(this.numericUpDown8.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown7.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown9.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown10.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown12.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown11.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown13.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown14.Value));
arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
arrayList.Add(updIndex);
}
this.arrayLists.Add(arrayList);
this.dataGridView1.SelectedRows[0].Cells[0].Value = this.textBox1.Text;
this.dataGridView1.SelectedRows[0].Cells[1].Value = this.comboBox1.SelectedItem;
SaveXmlFile();
//MessageBox.Show(PdnResources.GetString("Menu.Editsuccessfully.text")+"!");//###20506
operation = -1;
this.groupBox2.Enabled = false;
}
}
}
}
else if(this.picture == 1)
{
// 添加
if (this.operation == 0)
{
if (string.IsNullOrEmpty(this.textBox1.Text))
{
MessageBox.Show(PdnResources.GetString("Menu.namecannotbeEmpty.text")+"!");
}
else
{
bool next = true;
for (int r = 0; r < this.dataGridView1.Rows.Count; r++)
{
if (this.dataGridView1.Rows[r].Cells[0].Value.Equals(this.textBox1.Text))
{
MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
next = false;
break;
}
}
if (next)
{
index++;
ArrayList arrayList = new ArrayList();
if (PdnResources.GetString("Menu.circular.Text").Equals(this.comboBox2.SelectedItem))
{
arrayList.Add(this.textBox1.Text);
arrayList.Add(this.comboBox2.SelectedItem);
arrayList.Add(Convert.ToInt32(this.numericUpDown18.Value));
arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
arrayList.Add(index);
}
else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.comboBox2.SelectedItem))
{
arrayList.Add(this.textBox1.Text);
arrayList.Add(this.comboBox2.SelectedItem);
arrayList.Add(Convert.ToInt32(this.numericUpDown16.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown15.Value));
arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
arrayList.Add(index);
}
this.arrayLists.Add(arrayList);
DataGridViewRow row = new DataGridViewRow();
foreach (DataGridViewColumn c in this.dataGridView1.Columns)
{
row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
}
row.Cells[0].Value = this.textBox1.Text;
row.Cells[1].Value = this.comboBox2.SelectedItem;
this.dataGridView1.Rows.Add(row);
SaveXmlFile();
//MessageBox.Show(PdnResources.GetString("Menu.Addsuccessfully.text")+"!");//###20506
operation = -1;
this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Selected = true;
}
}
}
// 编辑
else if (this.operation == 1)
{
if (string.IsNullOrEmpty(this.textBox1.Text))
{
MessageBox.Show(PdnResources.GetString("Menu.namecannotbeEmpty.text")+"!");
}
else
{
bool next = true;
for (int r = 0; r < this.dataGridView1.Rows.Count; r++)
{
if (this.dataGridView1.Rows[r].Cells[0].Value.Equals(this.textBox1.Text) && this.dataGridView1.SelectedRows[0].Index != r)
{
MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
next = false;
break;
}
}
if (next)
{
int updIndex = 0;
foreach (var arrayList1 in this.arrayLists)
{
if (arrayList1[0].ToString().Equals(this.dataGridView1.SelectedRows[0].Cells[0].Value))
{
updIndex = Convert.ToInt32(arrayList1[arrayList1.Count - 1]);
this.arrayLists.Remove(arrayList1);
break;
}
}
ArrayList arrayList = new ArrayList();
if (PdnResources.GetString("Menu.circular.Text").Equals(this.comboBox2.SelectedItem))
{
arrayList.Add(this.textBox1.Text);
arrayList.Add(this.comboBox2.SelectedItem);
arrayList.Add(Convert.ToInt32(this.numericUpDown18.Value));
arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
arrayList.Add(index);
}
else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.comboBox2.SelectedItem))
{
arrayList.Add(this.textBox1.Text);
arrayList.Add(this.comboBox2.SelectedItem);
arrayList.Add(Convert.ToInt32(this.numericUpDown16.Value));
arrayList.Add(Convert.ToInt32(this.numericUpDown15.Value));
arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
arrayList.Add(index);
}
this.arrayLists.Add(arrayList);
this.dataGridView1.SelectedRows[0].Cells[0].Value = this.textBox1.Text;
this.dataGridView1.SelectedRows[0].Cells[1].Value = this.comboBox2.SelectedItem;
SaveXmlFile();
//MessageBox.Show(PdnResources.GetString("Menu.Editsuccessfully.text")+"!");//###20506
operation = -1;
this.groupBox2.Enabled = false;
}
}
}
}
ReturnGrainSize(currentOperation);//优化方向:如果选择的不是当前辅助线,不调用更新界面方法
}
///
/// 辅助线样式预览
///
///
///
private void panel1_Paint(object sender, PaintEventArgs e)
{
if (this.picture == 0)
{
GuideStylePreviewCapOffPoint(e.Graphics);
}
else if(this.picture == 1)
{
GuideStylePreviewArea(e.Graphics);
}
}
private void setNumericUpDownValue(NumericUpDown numericUp, int value)//###
{
if (value > numericUp.Maximum)
numericUp.Value = numericUp.Maximum;
else if (value < numericUp.Minimum)
numericUp.Value = numericUp.Minimum;
else
numericUp.Value = value;
}
///
/// 辅助线样式预览是(截点法)
///
private void GuideStylePreviewCapOffPoint(Graphics g)
{
this.panel1.BackColor = Color.Black;
double scaleWidth = imageMat.Width / (double)this.panel1.Width;
double scaleHeight = imageMat.Height / (double)this.panel1.Height;
double scaleSize;
int originX;
int originY;
int drawWidth;
int drawHeight;
if (scaleWidth > scaleHeight)
{
scaleSize = scaleWidth;
originX = 0;
drawWidth = panel1.Width;
originY = (int)((panel1.Height - imageMat.Height / scaleWidth) / 2.0);
drawHeight = (int)(imageMat.Height / scaleWidth);
}
else
{
scaleSize = scaleHeight;
originY = 0;
drawHeight = panel1.Height;
originX = (int)((panel1.Width - imageMat.Width / scaleHeight) / 2.0);
drawWidth = (int)(imageMat.Width / scaleHeight);
}
g.DrawImage(this.bitmap, originX, originY, drawWidth, drawHeight);//绘制的方法需要测试
double maxSize = Math.Min(imageMat.Width, imageMat.Height);
Pen linePen = new Pen(this.panel2.BackColor, Math.Max(1, (int)(Convert.ToInt32(numericUpDown2.Value) / scaleSize)));
Font textfont = new Font(this.comboBox1.Text, Convert.ToInt32(numericUpDown3.Value));
SizeF size = g.MeasureString("abc", textfont);
if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
bool autosized = false;
double maxSizeCurrent = imageMat.Height;
double multiple = this.physicalGainMultiple(Convert.ToInt32(this.numericUpDown1.Value) / this.physical_length, maxSizeCurrent);
if (multiple < 1)
autosized = true;
int mat_lineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown1.Value) / this.physical_length);
int mat_lineSpacing = (int)(multiple * Convert.ToInt32(this.numericUpDown21.Value) / this.physical_length);
int lineDec = Convert.ToInt32(this.numericUpDown20.Value);
if (autosized && operation > 0)
{
this.numericUpDown1.ValueChanged -= new System.EventHandler(this.numericUpDown1_ValueChanged);
setNumericUpDownValue(this.numericUpDown1, (int)(multiple * Convert.ToInt32(this.numericUpDown1.Value)));
this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
this.numericUpDown21.ValueChanged -= new System.EventHandler(this.numericUpDown21_ValueChanged);
setNumericUpDownValue(this.numericUpDown21, (int)(multiple * Convert.ToInt32(this.numericUpDown21.Value)));
this.numericUpDown21.ValueChanged += new System.EventHandler(this.numericUpDown21_ValueChanged);
}
mat_lineLength = (int)(mat_lineLength / scaleSize);
mat_lineSpacing = (int)(mat_lineSpacing / scaleSize);
float originLineTop = (float)((this.panel1.Height - mat_lineLength) / 2.0);
float originLineBottom = (float)(mat_lineLength + (this.panel1.Height - mat_lineLength) / 2.0);
if (Convert.ToInt32(this.numericUpDown20.Value) % 2 == 0)
{
float Spacing = (float)(mat_lineSpacing / 2.0);
for (int i = 0; i < (float)this.numericUpDown20.Value / 2; i++)
{
g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2 - Spacing, originLineTop)
, new PointF((float)this.panel1.Width / 2 - Spacing, originLineBottom));
g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2 + Spacing, originLineTop)
, new PointF((float)this.panel1.Width / 2 + Spacing, originLineBottom));
Spacing += mat_lineSpacing;
}
}
else
{
if (Convert.ToInt32(this.numericUpDown20.Value) == 1)
g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2, originLineTop)
, new PointF((float)this.panel1.Width / 2, originLineBottom));
else
{
float Spacing = (float)(mat_lineSpacing);
for (int i = 0; i < (this.numericUpDown20.Value - 1) / 2; i++)
{
if (i == 0)
g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2, originLineTop)
, new PointF((float)this.panel1.Width / 2, originLineBottom));
g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2 + Spacing, originLineTop)
, new PointF((float)this.panel1.Width / 2 + Spacing, originLineBottom));
g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2 - Spacing, originLineTop)
, new PointF((float)this.panel1.Width / 2 - Spacing, originLineBottom));
Spacing += mat_lineSpacing;
}
}
}
}
else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
bool autosized = false;
double maxSizeCurrent = imageMat.Width;
double multiple = this.physicalGainMultiple(Convert.ToInt32(this.numericUpDown3.Value) / this.physical_length, maxSizeCurrent);
if (multiple < 1)
autosized = true;
int mat_lineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown3.Value) / this.physical_length);
int mat_lineSpacing = (int)(multiple * Convert.ToInt32(this.numericUpDown17.Value) / this.physical_length);
int lineDec = Convert.ToInt32(this.numericUpDown19.Value);
if (autosized && operation > 0)
{
this.numericUpDown3.ValueChanged -= new System.EventHandler(this.numericUpDown3_ValueChanged);
setNumericUpDownValue(this.numericUpDown3, (int)(multiple * Convert.ToInt32(this.numericUpDown3.Value)));
this.numericUpDown3.ValueChanged += new System.EventHandler(this.numericUpDown3_ValueChanged);
this.numericUpDown17.ValueChanged -= new System.EventHandler(this.numericUpDown17_ValueChanged);
setNumericUpDownValue(this.numericUpDown17, (int)(multiple * Convert.ToInt32(this.numericUpDown17.Value)));
this.numericUpDown17.ValueChanged += new System.EventHandler(this.numericUpDown17_ValueChanged);
}
mat_lineLength = (int)(mat_lineLength / scaleSize);
mat_lineSpacing = (int)(mat_lineSpacing / scaleSize);
float originLineLeft = (float)((this.panel1.Width - mat_lineLength) / 2.0);
float originLineRight = (float)(mat_lineLength + (this.panel1.Width - mat_lineLength) / 2.0);
if (Convert.ToInt32(this.numericUpDown19.Value) % 2 == 0)
{
float Spacing = (float)(mat_lineSpacing / 2.0);
for (int i = 0; i < (float)this.numericUpDown19.Value / 2; i++)
{
g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2 - Spacing)
, new PointF(originLineRight, (float)this.panel1.Height / 2 - Spacing));
g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2 + Spacing)
, new PointF(originLineRight, (float)this.panel1.Height / 2 + Spacing));
Spacing += mat_lineSpacing;
}
}
else
{
if (Convert.ToInt32(this.numericUpDown19.Value) == 1)
g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2)
, new PointF(originLineRight, (float)this.panel1.Height / 2));
else
{
float Spacing = (float)(mat_lineSpacing);
for (int i = 0; i < (Convert.ToInt32(this.numericUpDown19.Value) - 1) / 2; i++)
{
if (i == 0)
g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2)
, new PointF(originLineRight, (float)this.panel1.Height / 2));
g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2 - Spacing)
, new PointF(originLineRight, (float)this.panel1.Height / 2 - Spacing));
g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2 + Spacing)
, new PointF(originLineRight, (float)this.panel1.Height / 2 + Spacing));
Spacing += mat_lineSpacing;
}
}
}
}
else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
bool autosized = false;
double multiple = this.physicalGainMultiple(Convert.ToInt32(this.numericUpDown4.Value) / this.physical_length, maxSize);
if (multiple < 1)
autosized = true;
int mat_diameter = (int)(multiple * Convert.ToInt32(this.numericUpDown4.Value) / this.physical_length);
if (autosized && operation > 0)
{
this.numericUpDown4.ValueChanged -= new System.EventHandler(this.numericUpDown4_ValueChanged);
setNumericUpDownValue(this.numericUpDown4, (int)(multiple * Convert.ToInt32(this.numericUpDown4.Value)));
this.numericUpDown4.ValueChanged += new System.EventHandler(this.numericUpDown4_ValueChanged);
}
mat_diameter = (int)(mat_diameter / scaleSize);
g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0), (float)((this.panel1.Height - mat_diameter) / 2.0), mat_diameter, mat_diameter);
}
else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
bool autosized = false;
int diameter11 = Convert.ToInt32(this.numericUpDown5.Value);
int margin11 = Convert.ToInt32(this.numericUpDown6.Value);
double multiple = this.physicalGainMultiple((diameter11 + margin11 * 4) / this.physical_length, maxSize);
if (multiple < 1)
autosized = true;
int mat_diameter = (int)(multiple * diameter11 / this.physical_length);
int mat_margin = (int)(multiple * margin11 / this.physical_length);
if (autosized && operation > 0)
{
this.numericUpDown5.ValueChanged -= new System.EventHandler(this.numericUpDown5_ValueChanged);
setNumericUpDownValue(this.numericUpDown5, (int)(multiple * Convert.ToInt32(this.numericUpDown5.Value)));
this.numericUpDown5.ValueChanged += new System.EventHandler(this.numericUpDown5_ValueChanged);
this.numericUpDown6.ValueChanged -= new System.EventHandler(this.numericUpDown6_ValueChanged);
setNumericUpDownValue(this.numericUpDown6, (int)(multiple * Convert.ToInt32(this.numericUpDown6.Value)));
this.numericUpDown6.ValueChanged += new System.EventHandler(this.numericUpDown6_ValueChanged);
}
mat_diameter = (int)(mat_diameter / scaleSize);
mat_margin = (int)(mat_margin / scaleSize);
g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0), (float)((this.panel1.Height - mat_diameter) / 2.0), mat_diameter, mat_diameter);
g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0 - mat_margin), (float)((this.panel1.Height - mat_diameter) / 2.0 - mat_margin), mat_diameter + mat_margin * 2, mat_diameter + mat_margin * 2);
g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0 - mat_margin * 2), (float)((this.panel1.Height - mat_diameter) / 2.0 - mat_margin * 2), mat_diameter + mat_margin * 4, mat_diameter + mat_margin * 4);
}
else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
bool autosized = false;
double maxSizeCurrent = 0;//Math.Min(imageMat.Width, imageMat.Height);
int num_vLineLength = Convert.ToInt32(this.numericUpDown8.Value);//垂线长度
int num_hLineLength = Convert.ToInt32(this.numericUpDown7.Value);//水平线长度
int num_diameter = Convert.ToInt32(this.numericUpDown9.Value);//直径
int num_margin = Convert.ToInt32(this.numericUpDown10.Value);//边距
int num_TopleftLineLength = Convert.ToInt32(this.numericUpDown12.Value);//左上到右下斜线长度
int num_ToprightLineLength = Convert.ToInt32(this.numericUpDown11.Value);//左下到右上斜线长度
int num_VLineToCDistance = Convert.ToInt32(this.numericUpDown13.Value);//垂线到圆距离
int num_HLineToCDistance = Convert.ToInt32(this.numericUpDown14.Value);//水平线到圆距离
if (num_vLineLength / this.physical_length > maxSizeCurrent)
{
maxSizeCurrent = num_vLineLength / this.physical_length;
}
if (num_hLineLength / this.physical_length > maxSizeCurrent)
{
maxSizeCurrent = num_hLineLength / this.physical_length;
}
if ((num_diameter + num_margin * 4 + num_VLineToCDistance) / this.physical_length > maxSizeCurrent)
{
maxSizeCurrent = (num_diameter + num_margin * 4 + num_VLineToCDistance) / this.physical_length;
}
if ((num_diameter + num_margin * 4 + num_HLineToCDistance) / this.physical_length > maxSizeCurrent)
{
maxSizeCurrent = (num_diameter + num_margin * 4 + num_HLineToCDistance) / this.physical_length;
}
if ((num_TopleftLineLength / Math.Sqrt(2.0)) / this.physical_length > maxSizeCurrent)
{
maxSizeCurrent = (num_TopleftLineLength / Math.Sqrt(2.0)) / this.physical_length;
}
if ((num_ToprightLineLength / Math.Sqrt(2.0)) / this.physical_length > maxSizeCurrent)
{
maxSizeCurrent = (num_ToprightLineLength / Math.Sqrt(2.0)) / this.physical_length;
}
double multiple = this.physicalGainMultiple(maxSizeCurrent, maxSize);
if (multiple < 1)
autosized = true;
int mat_vLineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown8.Value) / this.physical_length);//垂线长度
int mat_hLineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown7.Value) / this.physical_length);//水平线长度
int mat_diameter = (int)(multiple * Convert.ToInt32(this.numericUpDown9.Value) / this.physical_length);//直径
int mat_margin = (int)(multiple * Convert.ToInt32(this.numericUpDown10.Value) / this.physical_length);//边距
int mat_TopleftLineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown12.Value) / this.physical_length);//左上到右下斜线长度
int mat_ToprightLineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown11.Value) / this.physical_length);//左下到右上斜线长度
int mat_VLineToCDistance = (int)(multiple * Convert.ToInt32(this.numericUpDown13.Value) / this.physical_length);//垂线到圆距离
int mat_HLineToCDistance = (int)(multiple * Convert.ToInt32(this.numericUpDown14.Value) / this.physical_length);//水平线到圆距离
if (autosized && operation > 0)
{
this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
setNumericUpDownValue(this.numericUpDown8, (int)(multiple * Convert.ToInt32(this.numericUpDown8.Value)));
this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
setNumericUpDownValue(this.numericUpDown7, (int)(multiple * Convert.ToInt32(this.numericUpDown7.Value)));
this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
setNumericUpDownValue(this.numericUpDown9, (int)(multiple * Convert.ToInt32(this.numericUpDown9.Value)));
this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
setNumericUpDownValue(this.numericUpDown10, (int)(multiple * Convert.ToInt32(this.numericUpDown10.Value)));
this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
setNumericUpDownValue(this.numericUpDown11, (int)(multiple * Convert.ToInt32(this.numericUpDown11.Value)));
this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
setNumericUpDownValue(this.numericUpDown12, (int)(multiple * Convert.ToInt32(this.numericUpDown12.Value)));
this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
setNumericUpDownValue(this.numericUpDown13, (int)(multiple * Convert.ToInt32(this.numericUpDown13.Value)));
this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
setNumericUpDownValue(this.numericUpDown14, (int)(multiple * Convert.ToInt32(this.numericUpDown14.Value)));
this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
}
mat_vLineLength = (int)(mat_vLineLength / scaleSize);
mat_hLineLength = (int)(mat_hLineLength / scaleSize);
mat_diameter = (int)(mat_diameter / scaleSize);
mat_margin = (int)(mat_margin / scaleSize);
mat_TopleftLineLength = (int)(mat_TopleftLineLength / scaleSize);
mat_ToprightLineLength = (int)(mat_ToprightLineLength / scaleSize);
mat_VLineToCDistance = (int)(mat_VLineToCDistance / scaleSize);
mat_HLineToCDistance = (int)(mat_HLineToCDistance / scaleSize);
g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0), (float)((this.panel1.Height - mat_diameter) / 2.0), mat_diameter, mat_diameter);
g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0 - mat_margin), (float)((this.panel1.Height - mat_diameter) / 2.0 - mat_margin), mat_diameter + mat_margin * 2, mat_diameter + mat_margin * 2);
g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0 - mat_margin * 2), (float)((this.panel1.Height - mat_diameter) / 2.0 - mat_margin * 2), mat_diameter + mat_margin * 4, mat_diameter + mat_margin * 4);
//g.DrawEllipse(linePen, (float)(this.panel1.Width / 2 - 60), (float)(this.panel1.Height / 2 - 60), 120, 120);
//左下到右上斜线
g.DrawLine(linePen, new PointF(this.panel1.Width / 2 - (float)(mat_ToprightLineLength / Math.Sqrt(8.0)), this.panel1.Height / 2 + (float)(mat_ToprightLineLength / Math.Sqrt(8.0))), new PointF(this.panel1.Width / 2 + (float)(mat_ToprightLineLength / Math.Sqrt(8.0)), this.panel1.Height / 2 - (float)(mat_ToprightLineLength / Math.Sqrt(8.0))));
//左上到右下斜线
g.DrawLine(linePen, new PointF(this.panel1.Width / 2 - (float)(mat_TopleftLineLength / Math.Sqrt(8.0)), this.panel1.Height / 2 - (float)(mat_TopleftLineLength / Math.Sqrt(8.0))), new PointF(this.panel1.Width / 2 + (float)(mat_TopleftLineLength / Math.Sqrt(8.0)), this.panel1.Height / 2 + (float)(mat_TopleftLineLength / Math.Sqrt(8.0))));
//水平线
g.DrawLine(linePen, new PointF(this.panel1.Width / 2 - (float)(mat_hLineLength / 2.0), (float)((this.panel1.Height + mat_diameter) / 2.0 + mat_margin * 2) + mat_HLineToCDistance), new PointF(this.panel1.Width / 2 + (float)(mat_hLineLength / 2.0), (float)((this.panel1.Height + mat_diameter) / 2.0 + mat_margin * 2) + mat_HLineToCDistance));
//垂线
g.DrawLine(linePen, new PointF((float)((this.panel1.Width - mat_diameter) / 2.0 - mat_margin * 2) - mat_VLineToCDistance, this.panel1.Height / 2 + (float)(mat_vLineLength / 2.0)), new PointF((float)((this.panel1.Width - mat_diameter) / 2.0 - mat_margin * 2) - mat_VLineToCDistance, this.panel1.Height / 2 - (float)(mat_vLineLength / 2.0)));
}
}
///
/// 获取辅助线缩放比例
///
/// 设置的数值
/// 限制最大值
///
private double physicalGainMultiple(double gridSize, double maxSize)
{
double multiple = 1.0;
if (gridSize > maxSize)
{
multiple = maxSize / gridSize;
}
return multiple;
}
///
/// 辅助线样式预览是(面积法)
///
private void GuideStylePreviewArea(Graphics g)
{
this.panel1.BackColor = Color.Black;
double scaleWidth = imageMat.Width / (double)this.panel1.Width;
double scaleHeight = imageMat.Height / (double)this.panel1.Height;
double scaleSize;
int originX;
int originY;
int drawWidth;
int drawHeight;
if (scaleWidth > scaleHeight)
{
scaleSize = scaleWidth;
originX = 0;
drawWidth = panel1.Width;
originY = (int)((panel1.Height - imageMat.Height / scaleWidth) / 2.0);
drawHeight = (int)(imageMat.Height / scaleWidth);
}
else
{
scaleSize = scaleHeight;
originY = 0;
drawHeight = panel1.Height;
originX = (int)((panel1.Width - imageMat.Width / scaleHeight) / 2.0);
drawWidth = (int)(imageMat.Width / scaleHeight);
}
g.DrawImage(this.bitmap, originX, originY, drawWidth, drawHeight);
double maxSize = Math.Min(imageMat.Width, imageMat.Height);
Pen linePen = new Pen(this.panel2.BackColor, Math.Max(1, (int)(Convert.ToInt32(numericUpDown2.Value) / scaleSize)));
if (PdnResources.GetString("Menu.circular.Text").Equals(this.comboBox2.SelectedItem))
{
if (Convert.ToInt32(numericUpDown18.Value) / this.physical_area_length_Micron > maxSize)
{
if (operation > 0)
{
this.numericUpDown18.ValueChanged -= new System.EventHandler(this.numericUpDown18_ValueChanged);
setNumericUpDownValue(this.numericUpDown18, (int)(maxSize * this.physical_area_length_Micron));
this.numericUpDown18.ValueChanged += new System.EventHandler(this.numericUpDown18_ValueChanged);
}
int drawvalue1 = (int)(maxSize / scaleSize);
g.DrawEllipse(linePen, (int)(this.panel1.Width - maxSize / scaleSize) / 2, (int)(this.panel1.Height - maxSize / scaleSize) / 2, drawvalue1, drawvalue1);
}
else
{
int bitmapvalue1 = (int)(Convert.ToInt32(numericUpDown18.Value) / this.physical_area_length_Micron);
int drawvalue1 = (int)(bitmapvalue1 / scaleSize);
g.DrawEllipse(linePen, (int)(this.panel1.Width - bitmapvalue1 / scaleSize) / 2, (int)(this.panel1.Height - bitmapvalue1 / scaleSize) / 2, drawvalue1, drawvalue1);
}
}
else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.comboBox2.SelectedItem))
{
int bitmapvalue1 = (int)(Convert.ToInt32(numericUpDown16.Value) / this.physical_area_length_Micron);
int bitmapvalue2 = (int)(Convert.ToInt32(numericUpDown15.Value) / this.physical_area_length_Micron);
if (bitmapvalue1 > imageMat.Width || bitmapvalue2 > imageMat.Height)
{
double scalevalue1 = bitmapvalue1 / (double)imageMat.Width;
double scalevalue2 = bitmapvalue2 / (double)imageMat.Height;
if (scalevalue2 > scalevalue1)
{
bitmapvalue1 = (int)(bitmapvalue1 / scalevalue2);
bitmapvalue2 = imageMat.Height;
}
else if (scalevalue1 > scalevalue2)
{
bitmapvalue2 = (int)(bitmapvalue2 / scalevalue1);
bitmapvalue1 = imageMat.Width;
}
if (operation > 0)
{
if (bitmapvalue1 == imageMat.Width)
{
this.numericUpDown16.ValueChanged -= new System.EventHandler(this.numericUpDown16_ValueChanged);
setNumericUpDownValue(this.numericUpDown16, (int)(imageMat.Width * this.physical_area_length_Micron));
this.numericUpDown16.ValueChanged += new System.EventHandler(this.numericUpDown16_ValueChanged);
this.numericUpDown15.ValueChanged -= new System.EventHandler(this.numericUpDown15_ValueChanged);
setNumericUpDownValue(this.numericUpDown15, (int)(bitmapvalue2 * this.physical_area_length_Micron));
this.numericUpDown15.ValueChanged += new System.EventHandler(this.numericUpDown15_ValueChanged);
}
if (bitmapvalue2 == imageMat.Height)
{
this.numericUpDown15.ValueChanged -= new System.EventHandler(this.numericUpDown15_ValueChanged);
setNumericUpDownValue(this.numericUpDown15, (int)(imageMat.Height * this.physical_area_length_Micron));
this.numericUpDown15.ValueChanged += new System.EventHandler(this.numericUpDown15_ValueChanged);
this.numericUpDown16.ValueChanged -= new System.EventHandler(this.numericUpDown16_ValueChanged);
setNumericUpDownValue(this.numericUpDown16, (int)(bitmapvalue1 * this.physical_area_length_Micron));
this.numericUpDown16.ValueChanged += new System.EventHandler(this.numericUpDown16_ValueChanged);
}
}
}
int drawvalue1 = (int)(bitmapvalue1 / scaleSize);
int drawvalue2 = (int)(bitmapvalue2 / scaleSize);
g.DrawRectangle(linePen, (int)(this.panel1.Width - bitmapvalue1 / scaleSize) / 2, (int)(this.panel1.Height - bitmapvalue2 / scaleSize) / 2, drawvalue1, drawvalue2);
//g.DrawRectangle(linePen, this.panel1.Width / 2 - 80, this.panel1.Height / 2 - 50, 160, 100);
}
}
///
/// 线颜色改变
///
///
///
private void panel2_BackColorChanged(object sender, EventArgs e)
{
this.panel1.Refresh();
}
///
/// 切换辅助线类型
///
///
///
private void comboBox1_SelectedIndexChanged_1(object sender, EventArgs e)
{
if(this.picture == 0)
{
if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
this.panel3.Visible = true;
this.panel4.Visible = false;
this.panel5.Visible = false;
this.panel6.Visible = false;
this.panel7.Visible = false;
this.panel8.Visible = false;
this.panel9.Visible = false;
}
else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
this.panel3.Visible = false;
this.panel4.Visible = true;
this.panel5.Visible = false;
this.panel6.Visible = false;
this.panel7.Visible = false;
this.panel8.Visible = false;
this.panel9.Visible = false;
}
else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
this.panel3.Visible = false;
this.panel4.Visible = false;
this.panel5.Visible = true;
this.panel6.Visible = false;
this.panel7.Visible = false;
this.panel8.Visible = false;
this.panel9.Visible = false;
}
else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
this.panel3.Visible = false;
this.panel4.Visible = false;
this.panel5.Visible = false;
this.panel6.Visible = true;
this.panel7.Visible = false;
this.panel8.Visible = false;
this.panel9.Visible = false;
}
else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
{
this.panel3.Visible = false;
this.panel4.Visible = false;
this.panel5.Visible = false;
this.panel6.Visible = false;
this.panel7.Visible = true;
this.panel8.Visible = false;
this.panel9.Visible = false;
}
this.panel1.Refresh();
}
}
///
/// 切换辅助图形
///
///
///
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
if(this.picture == 1)
{
if (PdnResources.GetString("Menu.circular.Text").Equals(this.comboBox2.SelectedItem))
{
this.panel3.Visible = false;
this.panel4.Visible = false;
this.panel5.Visible = false;
this.panel6.Visible = false;
this.panel7.Visible = false;
this.panel8.Visible = false;
this.panel9.Visible = true;
}
else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.comboBox2.SelectedItem))
{
this.panel3.Visible = false;
this.panel4.Visible = false;
this.panel5.Visible = false;
this.panel6.Visible = false;
this.panel7.Visible = false;
this.panel8.Visible = true;
this.panel9.Visible = false;
}
this.panel1.Refresh();
}
}
///
/// 添加辅助线
///
///
///
private void button3_Click(object sender, EventArgs e)
{
// 添加
this.textBox1.Focus();
this.dataGridView1.ClearSelection();
operation = 0;
this.groupBox2.Enabled = true;
InitGroupbox2();
}
///
/// 编辑辅助线
///
///
///
private void button4_Click(object sender, EventArgs e)
{
if(this.dataGridView1.Rows.Count > 0)
{
if(this.dataGridView1.SelectedRows.Count > 0)
{
// 编辑
operation = 1;
this.groupBox2.Enabled = true;
}
else
{
MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttheauxiliarylinetoedit.text")+"!");
}
}
else
{
MessageBox.Show(PdnResources.GetString("Menu.Pleaseaddauxiliarylines.text")+"!");
}
}
///
/// 切换辅助线
///
///
///
private void dataGridView1_SelectionChanged(object sender, EventArgs e)
{
this.groupBox2.Enabled = false;
operation = -1;
if (this.dataGridView1.SelectedRows.Count > 0)
{
if (this.picture == 0)
{
ArrayList arrayList1 = new ArrayList();
foreach (var arrayList in this.arrayLists)
{
if (this.dataGridView1.SelectedRows[0].Cells[0].Value.Equals(arrayList[0]))
arrayList1 = arrayList;
}
if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
{
this.textBox1.Text = arrayList1[0].ToString();
this.comboBox1.SelectedItem = arrayList1[1];
this.numericUpDown1.Value = Convert.ToInt32(arrayList1[2]);
this.numericUpDown21.Value = Convert.ToInt32(arrayList1[3]);
this.numericUpDown20.Value = Convert.ToInt32(arrayList1[4]);
this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[5]));
this.numericUpDown2.Value = Convert.ToInt32(arrayList1[6]);
}
else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
{
this.textBox1.Text = arrayList1[0].ToString();
this.comboBox1.SelectedItem = arrayList1[1];
this.numericUpDown3.Value = Convert.ToInt32(arrayList1[2]);
this.numericUpDown17.Value = Convert.ToInt32(arrayList1[3]);
this.numericUpDown19.Value = Convert.ToInt32(arrayList1[4]);
this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[5]));
this.numericUpDown2.Value = Convert.ToInt32(arrayList1[6]);
}
else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
{
this.textBox1.Text = arrayList1[0].ToString();
this.comboBox1.SelectedItem = arrayList1[1];
this.numericUpDown4.Value = Convert.ToInt32(arrayList1[2]);
this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[3]));
this.numericUpDown2.Value = Convert.ToInt32(arrayList1[4]);
}
else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
{
this.textBox1.Text = arrayList1[0].ToString();
this.comboBox1.SelectedItem = arrayList1[1];
this.numericUpDown5.Value = Convert.ToInt32(arrayList1[2]);
this.numericUpDown6.Value = Convert.ToInt32(arrayList1[3]);
this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[4]));
this.numericUpDown2.Value = Convert.ToInt32(arrayList1[5]);
}
else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
{
this.textBox1.Text = arrayList1[0].ToString();
this.comboBox1.SelectedItem = arrayList1[1];
this.numericUpDown8.Value = Convert.ToInt32(arrayList1[2]);
this.numericUpDown7.Value = Convert.ToInt32(arrayList1[3]);
this.numericUpDown9.Value = Convert.ToInt32(arrayList1[4]);
this.numericUpDown10.Value = Convert.ToInt32(arrayList1[5]);
this.numericUpDown12.Value = Convert.ToInt32(arrayList1[6]);
this.numericUpDown11.Value = Convert.ToInt32(arrayList1[7]);
this.numericUpDown13.Value = Convert.ToInt32(arrayList1[8]);
this.numericUpDown14.Value = Convert.ToInt32(arrayList1[9]);
this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[10]));
this.numericUpDown2.Value = Convert.ToInt32(arrayList1[11]);
this.vLineLength = Convert.ToInt32(arrayList1[2]);
this.hLineLength = Convert.ToInt32(arrayList1[3]);
this.diameter = Convert.ToInt32(arrayList1[4]);
this.margin = Convert.ToInt32(arrayList1[5]);
this.TopleftLineLength = Convert.ToInt32(arrayList1[6]);
this.ToprightLineLength = Convert.ToInt32(arrayList1[7]);
this.VLineToCDistance = Convert.ToInt32(arrayList1[8]);
this.HLineToCDistance = Convert.ToInt32(arrayList1[9]);
this.lineWidth = Convert.ToInt32(arrayList1[11]);
}
}
else if(this.picture == 1)
{
ArrayList arrayList1 = new ArrayList();
foreach (var arrayList in this.arrayLists)
{
if (this.dataGridView1.SelectedRows[0].Cells[0].Value.Equals(arrayList[0]))
arrayList1 = arrayList;
}
if (PdnResources.GetString("Menu.circular.Text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
{
this.textBox1.Text = arrayList1[0].ToString();
this.comboBox2.SelectedItem = arrayList1[1];
this.numericUpDown18.Value = Convert.ToInt32(arrayList1[2]);
this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[3]));
this.numericUpDown2.Value = Convert.ToInt32(arrayList1[4]);
}
else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
{
this.textBox1.Text = arrayList1[0].ToString();
this.comboBox2.SelectedItem = arrayList1[1];
this.numericUpDown16.Value = Convert.ToInt32(arrayList1[2]);
this.numericUpDown15.Value = Convert.ToInt32(arrayList1[3]);
this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[4]));
this.numericUpDown2.Value = Convert.ToInt32(arrayList1[5]);
}
}
this.panel1.Refresh();
}
}
///
/// 删除辅助线
///
///
///
private void button5_Click(object sender, EventArgs e)
{
if(this.dataGridView1.SelectedRows.Count > 0)
{
DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretodeletetheauxiliaryline?.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (dr == DialogResult.OK)
{
foreach (var arrayList in this.arrayLists)
{
if (this.dataGridView1.SelectedRows[0].Cells[0].Value.Equals(arrayList[0]))
{
this.arrayLists.Remove(arrayList);
break;
}
}
SaveXmlFile();
this.dataGridView1.Rows.Remove(this.dataGridView1.SelectedRows[0]);
if (this.dataGridView1.Rows.Count == 0)
InitGroupbox2();
ReturnGrainSize(2);
}
this.panel1.Refresh();
}
else
{
MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttheauxiliarylinetodelete.text")+"!");
}
}
///
/// 截点法-垂直辅助线-辅助线长度
///
///
///
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
{
this.panel1.Refresh();
}
///
/// 截点法-水平辅助线-辅助线长度
///
///
///
private void numericUpDown3_ValueChanged(object sender, EventArgs e)
{
this.panel1.Refresh();
}
///
/// 截点法-圆辅助线-直径
///
///
///
private void numericUpDown4_ValueChanged(object sender, EventArgs e)
{
this.panel1.Refresh();
}
///
/// 截点法-三圆辅助线-直径
///
///
///
private void numericUpDown5_ValueChanged(object sender, EventArgs e)
{
this.panel1.Refresh();
}
///
/// 截点法-三圆辅助线-边距
///
///
///
private void numericUpDown6_ValueChanged(object sender, EventArgs e)
{
this.panel1.Refresh();
}
///
/// 间距
///
///
///
private void numericUpDown21_ValueChanged(object sender, EventArgs e)
{
this.panel1.Refresh();
}
///
/// 线条数
///
///
///
private void numericUpDown20_ValueChanged(object sender, EventArgs e)
{
this.panel1.Refresh();
}
///
/// 面积法-矩形-宽
///
///
///
private void numericUpDown15_ValueChanged(object sender, EventArgs e)
{
this.panel1.Refresh();
}
///
/// 面积法-矩形-高
///
///
///
private void numericUpDown16_ValueChanged(object sender, EventArgs e)
{
this.panel1.Refresh();
}
///
/// 间距
///
///
///
private void numericUpDown17_ValueChanged(object sender, EventArgs e)
{
this.panel1.Refresh();
}
///
/// 面积法-圆-直径
///
///
///
private void numericUpDown18_ValueChanged(object sender, EventArgs e)
{
this.panel1.Refresh();
}
///
/// 线条数
///
///
///
private void numericUpDown19_ValueChanged(object sender, EventArgs e)
{
this.panel1.Refresh();
}
///
/// 线宽改变
///
///
///
private void numericUpDown2_ValueChanged(object sender, EventArgs e)
{
this.panel1.Refresh();
}
///
/// 垂线长度改变
///
///
///
private void numericUpDown8_ValueChanged(object sender, EventArgs e)
{
if (this.checkBox1.Checked && this.groupBox2.Enabled)
{
this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
this.percentage = this.numericUpDown8.Value / this.vLineLength;
this.vLineLength = Convert.ToInt32(this.numericUpDown8.Value);
setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
}
this.panel1.Refresh();
}
///
/// 水平线长度改变
///
///
///
private void numericUpDown7_ValueChanged(object sender, EventArgs e)
{
if (this.checkBox1.Checked && this.groupBox2.Enabled)
{
this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
this.percentage = this.numericUpDown7.Value / this.hLineLength;
this.hLineLength = Convert.ToInt32(this.numericUpDown7.Value);
setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
}
this.panel1.Refresh();
}
///
/// 内圆直径改变
///
///
///
private void numericUpDown9_ValueChanged(object sender, EventArgs e)
{
if (this.checkBox1.Checked && this.groupBox2.Enabled)
{
this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
this.percentage = this.numericUpDown9.Value / this.diameter;
this.diameter = Convert.ToInt32(this.numericUpDown9.Value);
setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
}
this.panel1.Refresh();
}
///
/// 边距改变
///
///
///
private void numericUpDown10_ValueChanged(object sender, EventArgs e)
{
if (this.checkBox1.Checked && this.groupBox2.Enabled)
{
this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
this.percentage = this.numericUpDown10.Value / this.margin;
this.margin = Convert.ToInt32(this.numericUpDown10.Value);
//##19847
setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
}
this.panel1.Refresh();
}
///
/// 左上到右下斜线长度改变
///
///
///
private void numericUpDown12_ValueChanged(object sender, EventArgs e)
{
if (this.checkBox1.Checked && this.groupBox2.Enabled)
{
this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
this.percentage = this.numericUpDown12.Value / this.TopleftLineLength;
this.TopleftLineLength = Convert.ToInt32(this.numericUpDown12.Value);
setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
}
this.panel1.Refresh();
}
///
/// 左下到右上斜线长度改变
///
///
///
private void numericUpDown11_ValueChanged(object sender, EventArgs e)
{
if (this.checkBox1.Checked && this.groupBox2.Enabled)
{
this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
this.percentage = this.numericUpDown11.Value / this.ToprightLineLength;
this.ToprightLineLength = Convert.ToInt32(this.numericUpDown11.Value);
setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
}
this.panel1.Refresh();
}
///
/// 垂线到圆距离改变
///
///
///
private void numericUpDown13_ValueChanged(object sender, EventArgs e)
{
if (this.checkBox1.Checked && this.groupBox2.Enabled)
{
this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
this.percentage = this.numericUpDown13.Value / this.VLineToCDistance;
this.VLineToCDistance = Convert.ToInt32(this.numericUpDown13.Value);
setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
}
this.panel1.Refresh();
}
///
/// 水平线到圆距离改变
///
///
///
private void numericUpDown14_ValueChanged(object sender, EventArgs e)
{
if (this.checkBox1.Checked && this.groupBox2.Enabled)
{
this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
this.percentage = this.numericUpDown14.Value / this.HLineToCDistance;
this.HLineToCDistance = Convert.ToInt32(this.numericUpDown14.Value);
setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
}
this.panel1.Refresh();
}
private void GrainGuideSettingsDialog_Load(object sender, EventArgs e)
{
if (this.picture == 0)
{
this.comboBox1.Items.Clear();
this.comboBox1.Items.AddRange(getTypeNames());
if (this.comboBox1.Items.Count > 0)
this.comboBox1.SelectedIndex = 0;
}
else if (this.picture == 1)
{
this.comboBox2.Items.Clear();
this.comboBox2.Items.AddRange(getTypeNames());
if (this.comboBox2.Items.Count > 0)
this.comboBox2.SelectedIndex = 0;
dataGridView1_SelectionChanged(sender, e);
}
}
#region 需继承方法
protected virtual string[] getTypeNames()
{
return this.typeListNames;
}
#endregion
}
}