using PaintDotNet.Base.CommTool; using PaintDotNet.Base.DedicatedAnalysis.Porosity.Model; using PaintDotNet.DedicatedAnalysis.Porosity.PV6093; using PaintDotNet.DedicatedAnalysis.Porosity.VDGP202; using PaintDotNet.DedicatedAnalysis.Porosity.VW50093; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace PaintDotNet.DedicatedAnalysis.Porosity { internal class PorosityMoreChoose : PdnBaseForm { protected PorosityConfig porosityConfig; private Label label_lwRatioLimit; private PV6093Dialog pform; private VDGP202Dialog vDGform; private VW50093Dialog vWform; protected NumericUpDown numericUpDown_lwRatioLimit; private Label label2; protected NumericUpDown numericUpDown1; private Label label3; protected NumericUpDown numericUpDown2; private Label label4; protected NumericUpDown numericUpDown3; private Label label5; protected NumericUpDown numericUpDown4; private Label label6; protected NumericUpDown numericUpDown5; private Button button2; private Button button1; private GroupBox groupBox1; private GroupBox groupBox2; public PorosityMoreChoose(PorosityConfig porosityConfig, PV6093Dialog pform, VDGP202Dialog vDGform, VW50093Dialog vWform) { this.porosityConfig = porosityConfig; this.pform = pform; this.vDGform = vDGform; this.vWform = vWform; InitializeComponent(); InitializeLanguageText(); getData(); } private void InitializeLanguageText() { this.label_lwRatioLimit.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Maporosity.text") + ":"; this.label2.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Maximumallberofpores.text") + ":"; this.label3.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Distancefactor.text") + ":"; this.label4.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.roughsurface.text") + ":"; this.label5.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Allowablemmeter.text") + ":"; this.label6.Text = PdnResources.GetString("Menu.minimumdiameter.text") + ":"; this.button2.Text = PdnResources.GetString("Form.OkButton.Text"); this.button1.Text = PdnResources.GetString("ConfirmLanguageDialog.CancelTB.ActionText"); this.groupBox1.Text = PdnResources.GetString("Menu.operation.text"); this.groupBox2.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Options.text"); this.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.moreoptions.text"); } private void InitializeComponent() { this.label_lwRatioLimit = new System.Windows.Forms.Label(); this.numericUpDown_lwRatioLimit = new System.Windows.Forms.NumericUpDown(); this.label2 = new System.Windows.Forms.Label(); this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); this.label3 = new System.Windows.Forms.Label(); this.numericUpDown2 = new System.Windows.Forms.NumericUpDown(); this.label4 = new System.Windows.Forms.Label(); this.numericUpDown3 = new System.Windows.Forms.NumericUpDown(); this.label5 = new System.Windows.Forms.Label(); this.numericUpDown4 = new System.Windows.Forms.NumericUpDown(); this.label6 = new System.Windows.Forms.Label(); this.numericUpDown5 = new System.Windows.Forms.NumericUpDown(); this.button2 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).BeginInit(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.SuspendLayout(); // // label_lwRatioLimit // this.label_lwRatioLimit.AutoSize = true; this.label_lwRatioLimit.Location = new System.Drawing.Point(44, 41); this.label_lwRatioLimit.Name = "label_lwRatioLimit"; this.label_lwRatioLimit.Size = new System.Drawing.Size(101, 12); this.label_lwRatioLimit.TabIndex = 19; // // numericUpDown_lwRatioLimit // this.numericUpDown_lwRatioLimit.DecimalPlaces = 2; this.numericUpDown_lwRatioLimit.Location = new System.Drawing.Point(151, 39); this.numericUpDown_lwRatioLimit.Maximum = new decimal(new int[] { 10000, 0, 0, 0}); this.numericUpDown_lwRatioLimit.Name = "numericUpDown_lwRatioLimit"; this.numericUpDown_lwRatioLimit.Size = new System.Drawing.Size(56, 21); this.numericUpDown_lwRatioLimit.TabIndex = 18; this.numericUpDown_lwRatioLimit.Value = new decimal(new int[] { 3, 0, 0, 0}); // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(32, 132); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(113, 12); this.label2.TabIndex = 23; // // numericUpDown1 // this.numericUpDown1.DecimalPlaces = 2; this.numericUpDown1.Location = new System.Drawing.Point(151, 128); this.numericUpDown1.Maximum = new decimal(new int[] { 1000000000, 0, 0, 0}); this.numericUpDown1.Name = "numericUpDown1"; this.numericUpDown1.Size = new System.Drawing.Size(56, 21); this.numericUpDown1.TabIndex = 22; this.numericUpDown1.Value = new decimal(new int[] { 3, 0, 0, 0}); // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(277, 85); this.label3.Name = "label3"; this.label3.RightToLeft = System.Windows.Forms.RightToLeft.No; this.label3.Size = new System.Drawing.Size(65, 12); this.label3.TabIndex = 25; // // numericUpDown2 // this.numericUpDown2.DecimalPlaces = 2; this.numericUpDown2.Location = new System.Drawing.Point(348, 81); this.numericUpDown2.Maximum = new decimal(new int[] { 100000, 0, 0, 0}); this.numericUpDown2.Minimum = new decimal(new int[] { 1, 0, 0, 131072}); this.numericUpDown2.Name = "numericUpDown2"; this.numericUpDown2.Size = new System.Drawing.Size(56, 21); this.numericUpDown2.TabIndex = 24; this.numericUpDown2.Value = new decimal(new int[] { 3, 0, 0, 0}); // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(277, 41); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(65, 12); this.label4.TabIndex = 27; // // numericUpDown3 // this.numericUpDown3.Location = new System.Drawing.Point(348, 38); this.numericUpDown3.Maximum = new decimal(new int[] { 100000, 0, 0, 0}); this.numericUpDown3.Name = "numericUpDown3"; this.numericUpDown3.Size = new System.Drawing.Size(56, 21); this.numericUpDown3.TabIndex = 26; this.numericUpDown3.Value = new decimal(new int[] { 3, 0, 0, 0}); // // label5 // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(44, 83); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(89, 12); this.label5.TabIndex = 29; // // numericUpDown4 // this.numericUpDown4.DecimalPlaces = 2; this.numericUpDown4.Location = new System.Drawing.Point(151, 83); this.numericUpDown4.Maximum = new decimal(new int[] { 1410065408, 2, 0, 0}); this.numericUpDown4.Name = "numericUpDown4"; this.numericUpDown4.Size = new System.Drawing.Size(56, 21); this.numericUpDown4.TabIndex = 28; this.numericUpDown4.Value = new decimal(new int[] { 3, 0, 0, 0}); // // label6 // this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(277, 132); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(65, 12); this.label6.TabIndex = 31; // // numericUpDown5 // this.numericUpDown5.DecimalPlaces = 2; this.numericUpDown5.Location = new System.Drawing.Point(348, 128); this.numericUpDown5.Maximum = new decimal(new int[] { 1000000000, 0, 0, 0}); this.numericUpDown5.Minimum = new decimal(new int[] { 1, 0, 0, 131072}); this.numericUpDown5.Name = "numericUpDown5"; this.numericUpDown5.Size = new System.Drawing.Size(56, 21); this.numericUpDown5.TabIndex = 30; this.numericUpDown5.Value = new decimal(new int[] { 3, 0, 0, 0}); // // button2 // this.button2.Location = new System.Drawing.Point(381, 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(279, 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); // // groupBox1 // this.groupBox1.Controls.Add(this.button2); this.groupBox1.Controls.Add(this.button1); this.groupBox1.Location = new System.Drawing.Point(12, 3); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(472, 54); this.groupBox1.TabIndex = 32; this.groupBox1.TabStop = false; // // groupBox2 // this.groupBox2.Controls.Add(this.label_lwRatioLimit); this.groupBox2.Controls.Add(this.numericUpDown_lwRatioLimit); this.groupBox2.Controls.Add(this.label2); this.groupBox2.Controls.Add(this.numericUpDown1); this.groupBox2.Controls.Add(this.label3); this.groupBox2.Controls.Add(this.numericUpDown2); this.groupBox2.Controls.Add(this.label4); this.groupBox2.Controls.Add(this.numericUpDown3); this.groupBox2.Controls.Add(this.label5); this.groupBox2.Controls.Add(this.numericUpDown4); this.groupBox2.Controls.Add(this.label6); this.groupBox2.Controls.Add(this.numericUpDown5); this.groupBox2.Location = new System.Drawing.Point(12, 63); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(472, 204); this.groupBox2.TabIndex = 33; this.groupBox2.TabStop = false; // // PorosityMoreChoose // this.ClientSize = new System.Drawing.Size(496, 273); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "PorosityMoreChoose"; ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).EndInit(); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); this.ResumeLayout(false); } #region [页面事件] /// /// 初始化赋值 /// /// /// private void getData() { //this.comboBox3.SelectedItem = this.porosityConfig.stressType; //this.comboBox1.SelectedItem = this.porosityConfig.diameterType; this.numericUpDown3.Value = Convert.ToDecimal(this.porosityConfig.roughSurface); this.numericUpDown_lwRatioLimit.Value = Convert.ToDecimal(this.porosityConfig.maxPorosityPercent); this.numericUpDown2.Value = Convert.ToDecimal(this.porosityConfig.distanceFactor); this.numericUpDown4.Value = Convert.ToDecimal(this.porosityConfig.maxDiameter); this.numericUpDown5.Value = Convert.ToDecimal(this.porosityConfig.minDiameter); this.numericUpDown1.Value = Convert.ToDecimal(this.porosityConfig.maxPorosityNum); } /// /// 取消关闭弹窗 /// /// /// private void button1_Click(object sender, EventArgs e) { this.Close(); } /// /// 确定保存数据 /// /// /// private void button2_Click(object sender, EventArgs e) { //this.porosityConfig.diameterType = this.comboBox1.SelectedItem.ToString(); //this.porosityConfig.stressType = this.comboBox3.SelectedItem.ToString(); this.porosityConfig.roughSurface = Convert.ToDouble(this.numericUpDown3.Value); this.porosityConfig.maxPorosityPercent = Convert.ToDouble(this.numericUpDown_lwRatioLimit.Value); this.porosityConfig.distanceFactor = Convert.ToDouble(this.numericUpDown2.Value); this.porosityConfig.maxDiameter = Convert.ToDouble(this.numericUpDown4.Value); this.porosityConfig.minDiameter = Convert.ToDouble(this.numericUpDown5.Value); this.porosityConfig.maxPorosityNum = Convert.ToDouble(this.numericUpDown1.Value); string porosityInfoXml = XmlSerializeHelper.XmlSerialize(this.porosityConfig); FileOperationHelper.WriteStringToFile(porosityInfoXml, Application.StartupPath + "\\PorosityConfig\\6093Config.xml", FileMode.Create); MessageBox.Show(PdnResources.GetString("Menu.Paramsmodifiedsuccessfully.text")); if (pform != null) { this.pform.getChange(this.porosityConfig); } else if (vDGform != null) { } else if (vWform != null) { } this.Close(); } #endregion } }