123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379 |
- using PaintDotNet.Base.DedicatedAnalysis.Inclusions;
- using PaintDotNet.Base.DedicatedAnalysis.Inclusions.Standard.EN10247_2007.TypesOfAssessment;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace PaintDotNet.DedicatedAnalysis.Inclusions.EN10247_2007
- {
- internal class MethodPDialog : InclusionsStandardDialog
- {
- #region 组件
- private RadioButton radioButton_DarkGray;
- private RadioButton radioButton_Gray;
- private RadioButton radioButton_Colored;
- private RadioButton radioButton_Black;
- private Panel panel_displaySetting_EA;
- private Button label_displaySetting_EA;
- private Button label_displaySetting_EB;
- private Panel panel_displaySetting_EB;
- private Button label_displaySetting_EC;
- private Panel panel_displaySetting_EC;
- private Button label_displaySetting_ED;
- private Panel panel_displaySetting_ED;
- private Button label_displaySetting_EAD;
- private Panel panel_displaySetting_EAD;
- private Button label_displaySetting_EF;
- private Panel panel_displaySetting_EF;
- #endregion 组件
- #region 构造函数
- public MethodPDialog(AppWorkspace appWorkspace, string dialogText, PdnMenuItem menuItem) : base(appWorkspace, dialogText, menuItem)
- {
- }
- #endregion 构造函数
- #region 初始化组件
- private void InitializeComponent()
- {
- this.radioButton_DarkGray = new System.Windows.Forms.RadioButton();
- this.radioButton_Gray = new System.Windows.Forms.RadioButton();
- this.radioButton_Colored = new System.Windows.Forms.RadioButton();
- this.radioButton_Black = new System.Windows.Forms.RadioButton();
- this.label_displaySetting_EAD = new System.Windows.Forms.Button();
- this.panel_displaySetting_EA = new System.Windows.Forms.Panel();
- this.panel_displaySetting_EC = new System.Windows.Forms.Panel();
- this.label_displaySetting_ED = new System.Windows.Forms.Button();
- this.panel_displaySetting_EB = new System.Windows.Forms.Panel();
- this.panel_displaySetting_EF = new System.Windows.Forms.Panel();
- this.label_displaySetting_EF = new System.Windows.Forms.Button();
- this.panel_displaySetting_ED = new System.Windows.Forms.Panel();
- this.label_displaySetting_EC = new System.Windows.Forms.Button();
- this.panel_displaySetting_EAD = new System.Windows.Forms.Panel();
- this.label_displaySetting_EA = new System.Windows.Forms.Button();
- this.label_displaySetting_EB = new System.Windows.Forms.Button();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).BeginInit();
- this.groupBox_colorSetting.SuspendLayout();
- this.groupBox_displaySetting.SuspendLayout();
- this.SuspendLayout();
- //
- // numericUpDown_lwRatioLimit
- //
- this.numericUpDown_lwRatioLimit.Value = new decimal(new int[] {
- 13,
- 0,
- 0,
- 65536});
- //
- // groupBox_colorSetting
- //
- this.groupBox_colorSetting.Controls.Add(this.radioButton_DarkGray);
- this.groupBox_colorSetting.Controls.Add(this.radioButton_Gray);
- this.groupBox_colorSetting.Controls.Add(this.radioButton_Colored);
- this.groupBox_colorSetting.Controls.Add(this.radioButton_Black);
- this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_Black, 0);
- this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_Colored, 0);
- this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_Gray, 0);
- this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_DarkGray, 0);
- //
- // groupBox_displaySetting
- //
- this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_EAD);
- this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_EA);
- this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_EC);
- this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_ED);
- this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_EB);
- this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_EF);
- this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_EF);
- this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_ED);
- this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_EC);
- this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_EAD);
- this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_EA);
- this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_EB);
- //
- // radioButton_DarkGray
- //
- this.radioButton_DarkGray.AutoSize = true;
- this.radioButton_DarkGray.Location = new System.Drawing.Point(200, 20);
- this.radioButton_DarkGray.Name = "radioButton_DarkGray";
- this.radioButton_DarkGray.Size = new System.Drawing.Size(59, 16);
- this.radioButton_DarkGray.TabIndex = 38;
- this.radioButton_DarkGray.TabStop = true;
- this.radioButton_DarkGray.Text = PdnResources.GetString("Menu.Darkgray.text");
- this.radioButton_DarkGray.UseVisualStyleBackColor = true;
- //
- // radioButton_Gray
- //
- this.radioButton_Gray.AutoSize = true;
- this.radioButton_Gray.Location = new System.Drawing.Point(145, 20);
- this.radioButton_Gray.Name = "radioButton_Gray";
- this.radioButton_Gray.Size = new System.Drawing.Size(47, 16);
- this.radioButton_Gray.TabIndex = 37;
- this.radioButton_Gray.TabStop = true;
- this.radioButton_Gray.Text = PdnResources.GetString("Menu.gray.text");
- this.radioButton_Gray.UseVisualStyleBackColor = true;
- //
- // radioButton_Colored
- //
- this.radioButton_Colored.AutoSize = true;
- this.radioButton_Colored.Location = new System.Drawing.Point(60, 20);
- this.radioButton_Colored.Name = "radioButton_Colored";
- this.radioButton_Colored.Size = new System.Drawing.Size(47, 16);
- this.radioButton_Colored.TabIndex = 36;
- this.radioButton_Colored.TabStop = true;
- this.radioButton_Colored.Text = PdnResources.GetString("Menu.Dedicatedanalysis.blackmetal.non-ferrous.text");
- this.radioButton_Colored.UseVisualStyleBackColor = true;
- //
- // radioButton_Black
- //
- this.radioButton_Black.AutoSize = true;
- this.radioButton_Black.Location = new System.Drawing.Point(7, 20);
- this.radioButton_Black.Name = "radioButton_Black";
- this.radioButton_Black.Size = new System.Drawing.Size(47, 16);
- this.radioButton_Black.TabIndex = 35;
- this.radioButton_Black.TabStop = true;
- this.radioButton_Black.Text = PdnResources.GetString("Menu.black.text");
- this.radioButton_Black.UseVisualStyleBackColor = true;
- //
- // label_displaySetting_EAD
- //
- this.label_displaySetting_EAD.AutoSize = true;
- this.label_displaySetting_EAD.Location = new System.Drawing.Point(233, 25);
- this.label_displaySetting_EAD.Name = "label_displaySetting_EAD";
- this.label_displaySetting_EAD.Size = new System.Drawing.Size(33, 22);
- this.label_displaySetting_EAD.TabIndex = 42;
- this.label_displaySetting_EAD.Text = "EAD";
- //
- // panel_displaySetting_EA
- //
- this.panel_displaySetting_EA.Location = new System.Drawing.Point(36, 25);
- this.panel_displaySetting_EA.Name = "panel_displaySetting_EA";
- this.panel_displaySetting_EA.Size = new System.Drawing.Size(21, 21);
- this.panel_displaySetting_EA.TabIndex = 34;
- //
- // panel_displaySetting_EC
- //
- this.panel_displaySetting_EC.BackColor = System.Drawing.SystemColors.Control;
- this.panel_displaySetting_EC.Location = new System.Drawing.Point(146, 25);
- this.panel_displaySetting_EC.Name = "panel_displaySetting_EC";
- this.panel_displaySetting_EC.Size = new System.Drawing.Size(21, 21);
- this.panel_displaySetting_EC.TabIndex = 35;
- //
- // label_displaySetting_ED
- //
- this.label_displaySetting_ED.AutoSize = true;
- this.label_displaySetting_ED.Location = new System.Drawing.Point(173, 25);
- this.label_displaySetting_ED.Name = "label_displaySetting_ED";
- this.label_displaySetting_ED.Size = new System.Drawing.Size(27, 22);
- this.label_displaySetting_ED.TabIndex = 41;
- this.label_displaySetting_ED.Text = "ED";
- //
- // panel_displaySetting_EB
- //
- this.panel_displaySetting_EB.BackColor = System.Drawing.SystemColors.Control;
- this.panel_displaySetting_EB.Location = new System.Drawing.Point(88, 25);
- this.panel_displaySetting_EB.Name = "panel_displaySetting_EB";
- this.panel_displaySetting_EB.Size = new System.Drawing.Size(21, 21);
- this.panel_displaySetting_EB.TabIndex = 33;
- //
- // panel_displaySetting_EF
- //
- this.panel_displaySetting_EF.BackColor = System.Drawing.SystemColors.Control;
- this.panel_displaySetting_EF.Location = new System.Drawing.Point(332, 25);
- this.panel_displaySetting_EF.Name = "panel_displaySetting_EF";
- this.panel_displaySetting_EF.Size = new System.Drawing.Size(21, 21);
- this.panel_displaySetting_EF.TabIndex = 33;
- //
- // label_displaySetting_EF
- //
- this.label_displaySetting_EF.AutoSize = true;
- this.label_displaySetting_EF.Location = new System.Drawing.Point(299, 25);
- this.label_displaySetting_EF.Name = "label_displaySetting_EF";
- this.label_displaySetting_EF.Size = new System.Drawing.Size(27, 22);
- this.label_displaySetting_EF.TabIndex = 45;
- this.label_displaySetting_EF.Text = "EF";
- //
- // panel_displaySetting_ED
- //
- this.panel_displaySetting_ED.BackColor = System.Drawing.SystemColors.Control;
- this.panel_displaySetting_ED.Location = new System.Drawing.Point(206, 25);
- this.panel_displaySetting_ED.Name = "panel_displaySetting_ED";
- this.panel_displaySetting_ED.Size = new System.Drawing.Size(21, 21);
- this.panel_displaySetting_ED.TabIndex = 36;
- //
- // label_displaySetting_EC
- //
- this.label_displaySetting_EC.AutoSize = true;
- this.label_displaySetting_EC.Location = new System.Drawing.Point(113, 25);
- this.label_displaySetting_EC.Name = "label_displaySetting_EC";
- this.label_displaySetting_EC.Size = new System.Drawing.Size(27, 22);
- this.label_displaySetting_EC.TabIndex = 40;
- this.label_displaySetting_EC.Text = "EC";
- //
- // panel_displaySetting_EAD
- //
- this.panel_displaySetting_EAD.BackColor = System.Drawing.SystemColors.Control;
- this.panel_displaySetting_EAD.Location = new System.Drawing.Point(272, 25);
- this.panel_displaySetting_EAD.Name = "panel_displaySetting_EAD";
- this.panel_displaySetting_EAD.Size = new System.Drawing.Size(21, 21);
- this.panel_displaySetting_EAD.TabIndex = 37;
- //
- // label_displaySetting_EA
- //
- this.label_displaySetting_EA.AutoSize = true;
- this.label_displaySetting_EA.Location = new System.Drawing.Point(6, 25);
- this.label_displaySetting_EA.Name = "label_displaySetting_EA";
- this.label_displaySetting_EA.Size = new System.Drawing.Size(27, 22);
- this.label_displaySetting_EA.TabIndex = 38;
- this.label_displaySetting_EA.Text = "EA";
- //
- // label_displaySetting_EB
- //
- this.label_displaySetting_EB.AutoSize = true;
- this.label_displaySetting_EB.Location = new System.Drawing.Point(60, 25);
- this.label_displaySetting_EB.Name = "label_displaySetting_EB";
- this.label_displaySetting_EB.Size = new System.Drawing.Size(27, 22);
- this.label_displaySetting_EB.TabIndex = 39;
- this.label_displaySetting_EB.Text = "EB";
- //
- // MethodPDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
- this.ClientSize = new System.Drawing.Size(1177, 908);
- this.Name = "MethodPDialog";
- this.Text = "EN10247_2007_MethodP("+ PdnResources.GetString("Menu.DedicatedAnalysis.BlackMetal.Inclusion.Text")+ ")";
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).EndInit();
- this.groupBox_colorSetting.ResumeLayout(false);
- this.groupBox_colorSetting.PerformLayout();
- this.groupBox_displaySetting.ResumeLayout(false);
- this.groupBox_displaySetting.PerformLayout();
- this.ResumeLayout(false);
- }
- #endregion 初始化组件
- #region 需继承方法
- protected override void SubclassInitialize()
- {
- InitializeComponent();
- }
- protected override MethodOfAssessment getMethodOfAssessment()
- {
- return new MethodP(this.imgPxPerUnit);
- }
- protected override void initColorSetting()
- {
- this.radioButton_Black.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
- this.radioButton_Gray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
- this.radioButton_Colored.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
- this.radioButton_DarkGray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
- }
- protected override void initDisplaySetting()
- {
- this.panel_displaySetting_EA.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["EA"].showColor);
- this.panel_displaySetting_EB.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["EB"].showColor);
- this.panel_displaySetting_EC.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["EC"].showColor);
- this.panel_displaySetting_ED.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["ED"].showColor);
- this.panel_displaySetting_EAD.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["EAD"].showColor);
- this.panel_displaySetting_EF.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["EF"].showColor);
- }
- protected override void getInclusionParameters()
- {
- switch (whichChecked)
- {
- case 0:
- radioButton_Black.Checked = true;
- this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Black"];
- break;
- case 1:
- radioButton_Black.Checked = true;
- this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Black"];
- break;
- case 2:
- radioButton_Colored.Checked = true;
- this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Colored"];
- break;
- case 3:
- radioButton_Gray.Checked = true;
- this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Gray"];
- break;
- case 4:
- radioButton_DarkGray.Checked = true;
- this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["DarkGray"];
- break;
- }
- }
- protected override void saveInclusionParameters()
- {
- if (radioButton_Black.Checked)
- {
- thisParameters.parameter3 = 1;
- }
- else if (radioButton_Colored.Checked)
- {
- thisParameters.parameter3 = 2;
- }
- else if (radioButton_Gray.Checked)
- {
- thisParameters.parameter3 = 3;
- }
- else if (radioButton_DarkGray.Checked)
- {
- thisParameters.parameter3 = 4;
- }
- }
- protected override void getOldCheck()
- {
- this.radioButton_Black.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);
- this.radioButton_Gray.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);
- this.radioButton_Colored.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);
- this.radioButton_DarkGray.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);
- switch (colorName)
- {
- case "Black":
- radioButton_Black.Checked = true;
- break;
- case "Gray":
- radioButton_Gray.Checked = true;
- break;
- case "DarkGray":
- radioButton_DarkGray.Checked = true;
- break;
- case "Colored":
- radioButton_Colored.Checked = true;
- break;
- }
- this.radioButton_Black.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
- this.radioButton_Gray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
- this.radioButton_Colored.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
- this.radioButton_DarkGray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
- }
- #endregion 需继承方法
- }
- }
|