| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064 |
- using OpenCvSharp;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Windows.Forms;
- namespace PaintDotNet.DedicatedAnalysis.GrainSizeStandard.GBT4296
- {
- internal class MethodCutOffDialog : GrainSizeStandardDialog
- {
- /// <summary>
- /// 测定结果暂存
- /// </summary>
- private List<DataTable> dataTable1s = new List<DataTable>();
- /// <summary>
- /// 储存点击保存结果后的所有原图与分析图
- /// </summary>
- private Dictionary<string, List<Bitmap>> bitCeDingDic = new Dictionary<string, List<Bitmap>>();
- #region 组件
- private GroupBox groupBox10;
- private Button button10;
- private Button button7_0;
- private GroupBox groupBox11;
- private CheckBox checkBox5_0;
- private CheckBox checkBox4;
- private CheckBox checkBox3_0;
- private DataGridViewTextBoxColumn ColumnTotal1;
- private DataGridViewTextBoxColumn ColumnTotal2;
- private DataGridViewTextBoxColumn ColumnTotal3;
- private Button button1;
- private Button button4;
- private DataGridView dataGridView1;
- private GroupBox groupBox5;
- private DataGridViewTextBoxColumn Column11;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
- private Button button8;
- private Button button6_0;
- #endregion 组件
- /// <summary>
- /// 构造函数
- /// </summary>
- /// <param name="appWorkspace"></param>
- /// <param name="dialogText"></param>
- public MethodCutOffDialog(AppWorkspace appWorkspace, PdnMenuItem menuItem) : base(appWorkspace, menuItem, null, 0)
- {
- }
- #region 初始化组件
- private void InitializeLanguageText()
- {
- this.groupBox10.Text = PdnResources.GetString("Menu.sectionoperation.text");
- this.button8.Text = PdnResources.GetString("Menu.1.5/2section.text");
- this.button6_0.Text = PdnResources.GetString("Menu.0.5sectionstyle.text");
- this.button10.Text = PdnResources.GetString("Menu.Setting.Text");
- this.button7_0.Text = PdnResources.GetString("Menu.1section.text");
- this.groupBox11.Text = PdnResources.GetString("Menu.Displayparamssettings.text");
- this.checkBox5_0.Text = PdnResources.GetString("Menu.displaysections.text");
- this.checkBox4.Text = PdnResources.GetString("Menu.displaygrid.text");
- this.checkBox3_0.Text = PdnResources.GetString("Menu.displaygrainboundaries.text");
- this.button1.Text = PdnResources.GetString("Menu.Savemeasurementresults.text");
- this.button4.Text = PdnResources.GetString("Menu.Deletemeasurementresult.text");
- this.Column11.HeaderText = PdnResources.GetString("Menu.Tools.GridLine.Text");
- this.dataGridViewTextBoxColumn1.HeaderText = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Lengthofdetectionline.text");
- this.dataGridViewTextBoxColumn2.HeaderText = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Nnlines.text");
- this.dataGridViewTextBoxColumn4.HeaderText = PdnResources.GetString("Menu.Thenumberofsections.text");
- this.groupBox5.Text = PdnResources.GetString("Menu.measurementresults.text");
- this.Text = "GBT4296(" + PdnResources.GetString("Menu.Interceptmethod.text") + ")";
- this.ColumnTotal1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.ColumnTotal2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.ColumnTotal3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridView_Total.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.ColumnTotal1,
- this.ColumnTotal2,
- this.ColumnTotal3});
- //
- // ColumnTotal1
- //
- this.ColumnTotal1.HeaderText = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Gridsize.text") + "(μm)";
- this.ColumnTotal1.Name = "ColumnTotal1";
- this.ColumnTotal1.ReadOnly = true;
- //
- // ColumnTotal2
- //
- this.ColumnTotal2.HeaderText = PdnResources.GetString("Menu.Numberofgrains.text");
- this.ColumnTotal2.Name = "ColumnTotal2";
- this.ColumnTotal2.ReadOnly = true;
- //
- // ColumnTotal3
- //
- this.ColumnTotal3.HeaderText = PdnResources.GetString("Menu.Averagegrainsizegrade.text");
- this.ColumnTotal3.Name = "ColumnTotal3";
- this.ColumnTotal3.ReadOnly = true;
- }
- private void InitializeComponent()
- {
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
- this.groupBox10 = new System.Windows.Forms.GroupBox();
- this.button8 = new System.Windows.Forms.Button();
- this.button6_0 = new System.Windows.Forms.Button();
- this.button10 = new System.Windows.Forms.Button();
- this.button7_0 = new System.Windows.Forms.Button();
- this.groupBox11 = new System.Windows.Forms.GroupBox();
- this.checkBox5_0 = new System.Windows.Forms.CheckBox();
- this.checkBox4 = new System.Windows.Forms.CheckBox();
- this.checkBox3_0 = new System.Windows.Forms.CheckBox();
- this.button1 = new System.Windows.Forms.Button();
- this.button4 = new System.Windows.Forms.Button();
- this.dataGridView1 = new System.Windows.Forms.DataGridView();
- this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.groupBox5 = new System.Windows.Forms.GroupBox();
- this.groupBox_analysisResult1.SuspendLayout();
- this.groupBox10.SuspendLayout();
- this.groupBox11.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
- this.groupBox5.SuspendLayout();
- this.SuspendLayout();
- //
- // groupBox10
- //
- this.groupBox10.Controls.Add(this.button8);
- this.groupBox10.Controls.Add(this.button6_0);
- this.groupBox10.Controls.Add(this.button10);
- this.groupBox10.Controls.Add(this.button7_0);
- this.groupBox10.Location = new System.Drawing.Point(179, 375);
- this.groupBox10.Name = "groupBox10";
- this.groupBox10.Size = new System.Drawing.Size(208, 89);
- this.groupBox10.TabIndex = 38;
- this.groupBox10.TabStop = false;
- //
- // button8
- //
- this.button8.BackColor = System.Drawing.SystemColors.Control;
- this.button8.Location = new System.Drawing.Point(107, 52);
- this.button8.Name = "button8";
- this.button8.Size = new System.Drawing.Size(95, 26);
- this.button8.TabIndex = 13;
- this.button8.UseVisualStyleBackColor = false;
- this.button8.Click += new System.EventHandler(this.button8_Click);
- //
- // button6_0
- //
- this.button6_0.BackColor = System.Drawing.SystemColors.Control;
- this.button6_0.Location = new System.Drawing.Point(6, 53);
- this.button6_0.Name = "button6_0";
- this.button6_0.Size = new System.Drawing.Size(95, 26);
- this.button6_0.TabIndex = 12;
- this.button6_0.UseVisualStyleBackColor = false;
- this.button6_0.Click += new System.EventHandler(this.button6_0_Click);
- //
- // button10
- //
- this.button10.BackColor = System.Drawing.SystemColors.Control;
- this.button10.Location = new System.Drawing.Point(107, 20);
- this.button10.Name = "button10";
- this.button10.Size = new System.Drawing.Size(95, 26);
- this.button10.TabIndex = 11;
- this.button10.UseVisualStyleBackColor = false;
- this.button10.Click += new System.EventHandler(this.button10_Click);
- //
- // button7_0
- //
- this.button7_0.BackColor = System.Drawing.SystemColors.Control;
- this.button7_0.Location = new System.Drawing.Point(6, 20);
- this.button7_0.Name = "button7_0";
- this.button7_0.Size = new System.Drawing.Size(95, 26);
- this.button7_0.TabIndex = 8;
- this.button7_0.UseVisualStyleBackColor = false;
- this.button7_0.Click += new System.EventHandler(this.button7_0_Click);
- //
- // groupBox11
- //
- this.groupBox11.Controls.Add(this.checkBox5_0);
- this.groupBox11.Controls.Add(this.checkBox4);
- this.groupBox11.Controls.Add(this.checkBox3_0);
- this.groupBox11.Location = new System.Drawing.Point(393, 375);
- this.groupBox11.Name = "groupBox11";
- this.groupBox11.Size = new System.Drawing.Size(142, 89);
- this.groupBox11.TabIndex = 39;
- this.groupBox11.TabStop = false;
- //
- // checkBox5_0
- //
- this.checkBox5_0.AutoSize = true;
- this.checkBox5_0.Checked = true;
- this.checkBox5_0.CheckState = System.Windows.Forms.CheckState.Checked;
- this.checkBox5_0.Location = new System.Drawing.Point(15, 59);
- this.checkBox5_0.Name = "checkBox5_0";
- this.checkBox5_0.Size = new System.Drawing.Size(15, 14);
- this.checkBox5_0.TabIndex = 2;
- this.checkBox5_0.UseVisualStyleBackColor = true;
- this.checkBox5_0.CheckedChanged += new System.EventHandler(this.checkBox5_0_CheckedChanged);
- //
- // checkBox4
- //
- this.checkBox4.AutoSize = true;
- this.checkBox4.Checked = true;
- this.checkBox4.CheckState = System.Windows.Forms.CheckState.Checked;
- this.checkBox4.Location = new System.Drawing.Point(15, 37);
- this.checkBox4.Name = "checkBox4";
- this.checkBox4.Size = new System.Drawing.Size(15, 14);
- this.checkBox4.TabIndex = 1;
- this.checkBox4.UseVisualStyleBackColor = true;
- this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged);
- //
- // checkBox3_0
- //
- this.checkBox3_0.AutoSize = true;
- this.checkBox3_0.Checked = true;
- this.checkBox3_0.CheckState = System.Windows.Forms.CheckState.Checked;
- this.checkBox3_0.Location = new System.Drawing.Point(15, 15);
- this.checkBox3_0.Name = "checkBox3_0";
- this.checkBox3_0.Size = new System.Drawing.Size(15, 14);
- this.checkBox3_0.TabIndex = 0;
- this.checkBox3_0.UseVisualStyleBackColor = true;
- this.checkBox3_0.CheckedChanged += new System.EventHandler(this.checkBox3_0_CheckedChanged);
- //
- // button1
- //
- this.button1.BackColor = System.Drawing.SystemColors.Control;
- this.button1.Location = new System.Drawing.Point(139, 11);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(101, 23);
- this.button1.TabIndex = 5;
- this.button1.UseVisualStyleBackColor = false;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // button4
- //
- this.button4.BackColor = System.Drawing.SystemColors.Control;
- this.button4.Location = new System.Drawing.Point(246, 11);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(101, 23);
- this.button4.TabIndex = 4;
- this.button4.UseVisualStyleBackColor = false;
- this.button4.Click += new System.EventHandler(this.button4_Click);
- //
- // dataGridView1
- //
- this.dataGridView1.AllowUserToAddRows = false;
- this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
- dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
- dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
- this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.Column11,
- this.dataGridViewTextBoxColumn1,
- this.dataGridViewTextBoxColumn2,
- this.dataGridViewTextBoxColumn4});
- this.dataGridView1.Location = new System.Drawing.Point(6, 36);
- this.dataGridView1.MultiSelect = false;
- this.dataGridView1.Name = "dataGridView1";
- this.dataGridView1.ReadOnly = true;
- this.dataGridView1.RowHeadersVisible = false;
- this.dataGridView1.RowTemplate.Height = 23;
- this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
- this.dataGridView1.Size = new System.Drawing.Size(341, 103);
- this.dataGridView1.TabIndex = 29;
- //
- // Column11
- //
- dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.Column11.DefaultCellStyle = dataGridViewCellStyle2;
- this.Column11.Name = "Column11";
- this.Column11.ReadOnly = true;
- this.Column11.Width = 66;
- //
- // dataGridViewTextBoxColumn1
- //
- dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle3;
- this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
- this.dataGridViewTextBoxColumn1.ReadOnly = true;
- //
- // dataGridViewTextBoxColumn2
- //
- dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle4;
- this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
- this.dataGridViewTextBoxColumn2.ReadOnly = true;
- //
- // dataGridViewTextBoxColumn4
- //
- dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle5;
- this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
- this.dataGridViewTextBoxColumn4.ReadOnly = true;
- this.dataGridViewTextBoxColumn4.Width = 72;
- //
- // groupBox5
- //
- this.groupBox5.Controls.Add(this.dataGridView1);
- this.groupBox5.Controls.Add(this.button4);
- this.groupBox5.Controls.Add(this.button1);
- this.groupBox5.Location = new System.Drawing.Point(179, 472);
- this.groupBox5.Name = "groupBox5";
- this.groupBox5.Size = new System.Drawing.Size(355, 145);
- this.groupBox5.TabIndex = 40;
- this.groupBox5.TabStop = false;
- //
- // MethodCutOffDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
- this.ClientSize = new System.Drawing.Size(1127, 980);
- this.Controls.Add(this.groupBox5);
- this.Controls.Add(this.groupBox10);
- this.Controls.Add(this.groupBox11);
- this.Name = "MethodCutOffDialog";
- this.Load += new System.EventHandler(this.MethodCutOffDialog_Load);
- this.Controls.SetChildIndex(this.groupBox11, 0);
- this.Controls.SetChildIndex(this.groupBox10, 0);
- this.Controls.SetChildIndex(this.groupBox5, 0);
- this.Controls.SetChildIndex(this.groupBox6groupBox_analysisResult2, 0);
- this.Controls.SetChildIndex(this.groupBox_img, 0);
- this.Controls.SetChildIndex(this.groupBox_review, 0);
- this.Controls.SetChildIndex(this.groupBox_analysisResult1, 0);
- this.Controls.SetChildIndex(this.groupBox_report, 0);
- this.groupBox_analysisResult1.ResumeLayout(false);
- this.groupBox10.ResumeLayout(false);
- this.groupBox11.ResumeLayout(false);
- this.groupBox11.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
- this.groupBox5.ResumeLayout(false);
- this.ResumeLayout(false);
- }
- #endregion 初始化组件
- #region 需继承方法
- protected override void refreshWhileImgChanged()
- {
- object ShowGrainBoundry;
- if (GetParamValue1(ParamKey_displaygrainboundaries, out ShowGrainBoundry))//显示晶界
- this.checkBox3_0.Checked = (bool)ShowGrainBoundry;
- if (GetParamValue1(ParamKey_displaygrid, out ShowGrainBoundry))//显示网格
- this.checkBox4.Checked = (bool)ShowGrainBoundry;
- if (GetParamValue1(ParamKey_displaysections, out ShowGrainBoundry))//显示截点
- this.checkBox5_0.Checked = (bool)ShowGrainBoundry;
- if (this.dataGridView1.Rows.Count > 0)
- {
- foreach (DataGridViewRow gridViewRow in this.dataGridView1.Rows)
- {
- foreach (var dataTable in this.dataTable1s)
- {
- if (dataTable.TableName.Equals(gridViewRow.Tag))
- {
- this.dataTable1s.Remove(dataTable);
- break;
- }
- }
- if (bitCeDingDic.ContainsKey((string)gridViewRow.Tag))
- bitCeDingDic.Remove((string)gridViewRow.Tag);
- }
- this.dataGridView1.Rows.Clear();
- }
- }
- /// <summary>
- /// 保存结果
- /// </summary>
- protected override void buildListBox_analysisResult(string imagesKey, int analysisPicture, bool saveAll = false)
- {
- if (this.imageMat == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
- return;
- }
- if (this.dataGridView1.Rows.Count == 0)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Nomeasurementresult.text"));
- return;
- }
- double value4Total = 0;
- foreach (DataGridViewRow Row in this.dataGridView1.Rows)
- {
- value4Total += double.Parse(Row.Cells[3].Value.ToString());//交点个数
- }
- if (value4Total == 0)
- {
- MessageBox.Show("请添加截点后保存结果"/*PdnResources.GetString("Menu.Nomeasurementresult.text")*/);
- return;
- }
- //if (this.comboBox1.SelectedItem == null || PdnResources.GetString("Menu.Pleaseselecttheauxiliarylineused.text").Equals(this.comboBox1.SelectedItem))
- //{
- // MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectauxiliaryline.text") + "!");
- // return;
- //}
- string imgName = getCurrentWorkspace().GetFriendlyName();
- string tag = getCurrentWorkTag();
- DataTable dataTable = new DataTable();
- bool replace = false;
- int add = 0;
- foreach (ListViewItem item in this.listView2.Items)
- {
- if (item.Tag.Equals(tag))
- {
- add++;
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Theresuethertoreplace.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
- if (dr == DialogResult.OK)
- {
- replace = true;
- }
- break;
- }
- }
- if (replace || this.listView2.Items.Count == 0 || add == 0)
- {
- if (!replace)
- {
- ListViewItem listViewItem = new ListViewItem();
- listViewItem.SubItems[0].Text = imgName;
- listViewItem.Tag = "" + tag;
- if (this.listView2.Items.Count == 0)
- this.listView2.Items.Add(listViewItem);
- else
- this.listView2.Items.Insert(0, listViewItem);
- }
- this.dataGridView2.Rows.Clear();
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = tag;
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = imgName;
- DataGridViewRow firRow = this.dataGridView1.Rows[0];
- object value1 = firRow.Cells[0].Value;//网格
- object value2 = firRow.Cells[1].Value;//网格长度
- object value3 = firRow.Cells[2].Value;//网格条数
- double value2Total = 0;
- foreach (DataGridViewRow Row in this.dataGridView1.Rows)
- {
- value2Total += (double.Parse(Row.Cells[1].Value.ToString()) * double.Parse(Row.Cells[2].Value.ToString()));//网格总长度
- }
- //double value4Total = 0;
- //foreach (DataGridViewRow Row in this.dataGridView1.Rows)
- //{
- // value4Total += double.Parse(Row.Cells[3].Value.ToString());//交点个数
- //}
- //if (value4Total == 0)
- //{
- // MessageBox.Show(PdnResources.GetString("Menu.Nomeasurementresult.text"));
- // return;
- //}
- ////double value4Per = value4Total / this.dataGridView1.Rows.Count;
- dgvr.Cells[1].Value = value1;
- dgvr.Cells[2].Value = value2Total;
- dgvr.Cells[3].Value = value4Total;
- decimal M = 1;// this.getGainMultiple();
- double small_l = value2Total / (value4Total * (double)M);
- //毫米转微米
- decimal A = Convert.ToDecimal(small_l * 1);
- double[] lengths = {453, 320 , 269, 226, 190, 177, 160, 135, 113, 106,
- 95.0, 89.0, 80.0, 67.3, 62.0, 56.6, 53.2, 47.6, 44.3, 40.0, 35.4, 33.6, 31.0,
- 28.3, 26.6 , 23.8, 22.2, 20.0, 17.7, 16.8, 14.1, 13.3, 11.9,
- 10.0, 8.86, 8.41, 7.98, 7.07, 6.20, 5.95, 5.32, 5.00, 4.43, 4.20, 3.54, 2.97
- , 2.66, 2.50, 2.22};
- // 差值
- decimal differenceNew;
- decimal differenceOld = Math.Abs(Convert.ToDecimal(Math.Max((double)A - 1.22, (double)A - 454)));
- int first = 0;
- if ((double)A < lengths[lengths.Length - 1])
- first = lengths.Length - 1;
- else
- for (int firstI = 0; firstI < lengths.Length; firstI++)
- {
- double item = lengths[firstI];
- differenceNew = Math.Abs(A - Convert.ToDecimal(item));
- if (differenceNew < differenceOld)
- {
- differenceOld = Math.Abs(A - Convert.ToDecimal(item));
- first = firstI;
- }
- }
- string[] valueG = {"00A", "0" , "0.5", "1.0", "1.5", "1.5", "2.0", "2.5", "3.0", "3.0",
- "3.5", "3.5", "4.0", "4.5", "4.5", "5.0", "5.0", "5.5", "5.5", "6.0", "6.0", "6.5", "6.5",
- "7.0", "7.0" , "7.5", "7.5", "8.0", "8.0", "8.5", "9.0", "9.0", "9.5",
- "10.0", "10.0", "10.5", "10.5", "11.0", "11.0", "11.5", "11.5", "12.0", "12.0", "12.5", "13.0", "13.5"
- , "13.5", "14.0", "14.0"};
- dgvr.Cells[4].Value = valueG[first];
- this.dataGridView2.Rows.Add(dgvr);
- dataTable.TableName = tag;
- foreach (System.Data.DataTable dataTable1 in dataTables)
- {
- if (dataTable1.TableName.Equals(dataTable.TableName))
- {
- dataTables.Remove(dataTable1);
- break;
- }
- }
- for (int i = 0; i < this.dataGridView2.Columns.Count; i++)
- {
- dataTable.Columns.Add("" + i);
- }
- DataRow dataRow = dataTable.NewRow();
- dataRow["0"] = imgName;
- dataRow["1"] = dgvr.Cells[1].Value;// "网格1";
- dataRow["2"] = dgvr.Cells[2].Value;
- dataRow["3"] = dgvr.Cells[3].Value;
- dataRow["4"] = dgvr.Cells[4].Value;
- dataTable.Rows.Add(dataRow);
- this.dataTables.Add(dataTable);
- if (this.allShow)
- AllShow();
- this.RefreshDataGridView4();
- //保存处理后的图片
- double pantographRatio = this.appWorkspace.DocumentWorkspaces[this.selectPicture].GetRulerMultiple(MeasurementUnit.Micron);//标尺*放大倍数
- List<Bitmap> tempBit = new List<Bitmap>();
- //Bitmap originalBit = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreateAliasedBitmap();
- //tempBit.Add(originalBit);
- //Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- //Graphics graphics = Graphics.FromImage(newBit);
- //Draw(graphics);
- //tempBit.Add(newBit);
- foreach (KeyValuePair<string, List<Bitmap>> kv in this.bitCeDingDic)
- {
- kv.Value[0].Tag = pantographRatio;
- kv.Value[1].Tag = pantographRatio;
- tempBit.Add(kv.Value[0]);
- tempBit.Add(kv.Value[1]);
- }
- if (bitDic.ContainsKey(tag))
- bitDic[tag] = tempBit;
- else
- bitDic.Add(tag, tempBit);
- //中间数据-拼接中间数据
- List<List<string>> dataList = new List<List<string>>();
- List<string> columnName = new List<string>();
- columnName.Add(PdnResources.GetString("Menu.Tools.GridLine.Text"));
- columnName.Add(PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Lengthofdetectionline.text"));
- columnName.Add(PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Nnlines.text"));
- columnName.Add(PdnResources.GetString("Menu.Thenumberofsections.text"));
- dataList.Add(columnName);
- foreach (DataGridViewRow Row in this.dataGridView1.Rows)
- {
- List<string> strList = new List<string>();
- strList.Add(Row.Cells[0].Value.ToString());
- strList.Add(Row.Cells[1].Value.ToString());
- strList.Add(Row.Cells[2].Value.ToString());
- strList.Add(Row.Cells[3].Value.ToString());
- dataList.Add(strList);
- }
- bool isExist = false;//是否已存在进行替换
- int modelIndex = -1;//要替换的下标
- for (int j = 0; j < tempDataModel.Count; j++)
- {
- if (tempDataModel[j].tagName.Equals(tag))
- {
- isExist = true;
- modelIndex = j;
- break;
- }
- }
- if (isExist && modelIndex > -1)
- tempDataModel[modelIndex].dataList = dataList;
- else
- {
- Base.Functionodel.ExportProjectModel newModel = new Base.Functionodel.ExportProjectModel();
- newModel.tagName = tag;
- newModel.picName = imgName;
- newModel.dataList = dataList;
- tempDataModel.Add(newModel);
- }
- }
- }
- /// <summary>
- /// 是否显示晶界
- /// </summary>
- /// <returns></returns>
- protected override Boolean ShowGrainBoundryChecked()
- {
- return checkBox3_0.Checked;
- }
- //是否绘制辅助线
- protected override bool showGridChecked()
- {
- return checkBox4.Checked;
- }
- //是否绘制截点
- protected override bool drawGuidePoints()
- {
- return (imageMat != null && this.checkBox5_0.Checked);
- }
- //是否显示截点
- protected override Boolean drawDisplaySections()//##1
- {
- return this.checkBox5_0.Checked;
- }
- //辅助线类型
- protected override string[] getTypeNames()
- {
- return new string[] {
- PdnResources.GetString("Menu.Verticalauxiliaryline.text"),
- PdnResources.GetString("Menu.Horizontalauxiliaryline.text")};
- }
- protected override string getTemplateName()
- {
- return "Template.Manager.item3.GrainSizeCutOff_GBT4296";
- }
- protected override string getProjectEngineeringName()
- {
- return "Menu.DedicatedAnalysis.NonferrousMetal.MagnesiumAlloy.Text";
- }
- protected override string getModelName()
- {
- return "GrainGBT32461CutOffMethodModel.xml";
- }
- protected override void SubclassInitialize()
- {
- InitializeComponent();
- InitializeLanguageText();
- }
- #endregion
- private DataGridViewTextBoxColumn Column1;
- private DataGridViewTextBoxColumn Column2;
- private DataGridViewTextBoxColumn Column3;
- private DataGridViewTextBoxColumn Column4;
- private DataGridViewTextBoxColumn Column5;
- private void MethodCutOffDialog_Load(object sender, EventArgs e)
- {
- this.button_ApplyToAll.Visible = false;
- this.button_SaveAll.Visible = false;
- this.btn_Grainboundarytoreproduce.Location = new System.Drawing.Point(912, 20);
- this.btn_saveresult.Location = new System.Drawing.Point(993, 20);
- object ShowGrainBoundry;
- if (GetParamValue1(ParamKey_displaygrainboundaries, out ShowGrainBoundry))//显示晶界
- this.checkBox3_0.Checked = (bool)ShowGrainBoundry;
- if (GetParamValue1(ParamKey_displaygrid, out ShowGrainBoundry))//显示网格
- this.checkBox4.Checked = (bool)ShowGrainBoundry;
- if (GetParamValue1(ParamKey_displaysections, out ShowGrainBoundry))//显示截点
- this.checkBox5_0.Checked = (bool)ShowGrainBoundry;
- this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column1.Name = "Column1";
- this.Column1.ReadOnly = true;
- //
- // Column2
- //
- this.Column2.Name = "Column2";
- this.Column2.ReadOnly = true;
- //
- // Column3
- //
- this.Column3.Name = "Column3";
- this.Column3.ReadOnly = true;
- //
- // Column4
- //
- this.Column4.Name = "Column4";
- this.Column4.ReadOnly = true;
- //
- // Column5
- //
- this.Column5.Name = "Column5";
- this.Column5.ReadOnly = true;
- this.Column5.HeaderText = PdnResources.GetString("Menu.Averagegrainsizegrade.text");
- this.Column4.HeaderText = PdnResources.GetString("Menu.Numberofgrains.text");
- this.Column3.HeaderText = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Gridsize.text") + "(μm)";
- this.Column2.HeaderText = PdnResources.GetString("Menu.Tools.GridLine.Text");
- this.Column1.HeaderText = PdnResources.GetString("Menu.picture.Text");
- this.dataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.Column1,
- this.Column2,
- this.Column3,
- this.Column4,
- this.Column5});
- this.groupBox_img.Size = new System.Drawing.Size(158, 672);
- this.groupBox_review.Size = new System.Drawing.Size(575, 672);
- this.groupBox_analysisResult1.Location = new System.Drawing.Point(12, 750);
- this.groupBox6groupBox_analysisResult2.Location = new System.Drawing.Point(242, 750);
- this.groupBox_report.Location = new System.Drawing.Point(974, 750);
- DetailListStringIndex.Add(0);
- DetailListStringIndex.Add(1);
- DetailListStringIndex.Add(3);
- DetailListStringIndex.Add(4/*5*/);//##############
- DetailListNotDoubleIndex.Add(0);
- DetailListNotDoubleIndex.Add(1);
- DetailListNotDoubleIndex.Add(3);
- DetailListNotDoubleIndex.Add(4);
- IndexChangedFromIndex.Clear();
- IndexChangedToIndex.Clear();
- IndexChangedFromIndex.Add(2);
- IndexChangedFromIndex.Add(3);
- IndexChangedToIndex.Add(0, new int[] { 2/*1*/, 0 });//求和
- IndexChangedToIndex.Add(1, new int[] { 2/*1*/, 1 });//求和
- //IndexChangedToIndex.Add(2, new int[] { 2, 2 });//平均
- IndexChangedToIndex.Add(2, new int[] { 3, -1/*0*/ });//级别
- }
- /// <summary>
- /// 计算汇总列表的平均晶粒度级别
- /// </summary>
- /// <returns></returns>
- protected override string getGradeTotalCal(DataGridViewRow dgvr, int digits)
- {
- double value2Total = double.Parse(dgvr.Cells[0].Value.ToString());
- double value4Total = double.Parse(dgvr.Cells[1].Value.ToString());
- decimal M = 1;// this.getGainMultiple();
- double small_l = value2Total / (value4Total * (double)M);
- //毫米转微米
- decimal A = Convert.ToDecimal(small_l * 1);
- double[] lengths = {453, 320 , 269, 226, 190, 177, 160, 135, 113, 106,
- 95.0, 89.0, 80.0, 67.3, 62.0, 56.6, 53.2, 47.6, 44.3, 40.0, 35.4, 33.6, 31.0,
- 28.3, 26.6 , 23.8, 22.2, 20.0, 17.7, 16.8, 14.1, 13.3, 11.9,
- 10.0, 8.86, 8.41, 7.98, 7.07, 6.20, 5.95, 5.32, 5.00, 4.43, 4.20, 3.54, 2.97
- , 2.66, 2.50, 2.22};
- // 差值
- decimal differenceNew;
- decimal differenceOld = Math.Abs(Convert.ToDecimal(Math.Max((double)A - 1.22, (double)A - 454)));
- int first = 0;
- if ((double)A < lengths[lengths.Length - 1])
- first = lengths.Length - 1;
- else
- for (int firstI = 0; firstI < lengths.Length; firstI++)
- {
- double item = lengths[firstI];
- differenceNew = Math.Abs(A - Convert.ToDecimal(item));
- if (differenceNew < differenceOld)
- {
- differenceOld = Math.Abs(A - Convert.ToDecimal(item));
- first = firstI;
- }
- }
- string[] valueG = {"00A", "0" , "0.5", "1.0", "1.5", "1.5", "2.0", "2.5", "3.0", "3.0",
- "3.5", "3.5", "4.0", "4.5", "4.5", "5.0", "5.0", "5.5", "5.5", "6.0", "6.0", "6.5", "6.5",
- "7.0", "7.0" , "7.5", "7.5", "8.0", "8.0", "8.5", "9.0", "9.0", "9.5",
- "10.0", "10.0", "10.5", "10.5", "11.0", "11.0", "11.5", "11.5", "12.0", "12.0", "12.5", "13.0", "13.5"
- , "13.5", "14.0", "14.0"};
- return valueG[first];
- }
- /// <summary>
- /// 是否显示网格
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void checkBox4_CheckedChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 是否显示截点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void checkBox5_0_CheckedChanged(object sender, EventArgs e)
- {
- if (!this.checkBox4.Checked)
- MessageBox.Show(PdnResources.GetString("Menu.Nogrid.text")+"!");
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 是否显示晶界
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void checkBox3_0_CheckedChanged(object sender, EventArgs e)
- {
- if (!showOrimat() && getGrainBoundryChecked() && checkBox3_0.Checked)
- {
- this.documentWorkspace.PhaseModels[1].choise = true;
- }
- else
- {
- this.documentWorkspace.PhaseModels[1].choise = false;
- }
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 设置截点样式
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button10_Click(object sender, EventArgs e)
- {//###
- GrainSizeStandard.IntegrationClass.GrainSurveyPointStyleSettingDialog grainSurveyPointStyleSettingDialog = new GrainSizeStandard.IntegrationClass.GrainSurveyPointStyleSettingDialog();//###
- grainSurveyPointStyleSettingDialog.StartPosition = FormStartPosition.CenterScreen;
- grainSurveyPointStyleSettingDialog.ShowDialog(this);
- }
- /// <summary>
- /// 鼠标按下
- /// </summary>
- /// <param name="drawArea"></param>
- /// <param name="e"></param>
- protected override void OnMouseDown(object sender, MouseEventArgs e)
- {
- if (this.documentWorkspace.CompositionSurface == null)
- return;
- // 换算后的点
- PointF point1 = documentWorkspace.GetScalePoint(e.Location);
- if (point1.X <= this.documentWorkspace.CompositionSurface.Width
- && point1.X >= 0
- && point1.Y >= 0
- && point1.Y <= this.documentWorkspace.CompositionSurface.Height)
- {
- RectangleF rectangleF = new RectangleF();
- // 复合辅助线
- int add = GSSClass.GuideClass.getAddOfRStyle(point1, this.comboBox1.SelectedItem, out rectangleF);
- if (add == 0 && GSSClass.styleClass.PointKb > 0)
- rectangleF = GSSClass.GuideClass.guideModel.RectangleFLine;
- //手动添加截点
- if (this.documentWorkspace.ActiveTool == Annotation.Enum.DrawToolType.InclusionNoEffect && GSSClass.styleClass.OnMouseDownNext(point1, sender, e))
- GSSClass.styleClass.OnMouseDownFirst(point1, rectangleF, GSSClass.standardModel.linePointList, sender, e);
- }
- if (GSSClass.styleClass.PointKb == 0)
- {
- //辅助线缩放
- GSSClass.GuideClass.OnMouseDown(point1, sender, e);
- //辅助线移动
- base.OnMouseDown(sender, e);//##
- }
- ////手动删除截点或取消添加截点
- //GSSClass.styleClass.OnMouseDownNext(point1, sender, e);
- }
- private int dataTable1sTagInc = 0;
- /// <summary>
- /// 保存测定结果
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button1_Click(object sender, EventArgs e)
- {
- if (this.imageMat == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
- return;
- }
- if (this.comboBox1.SelectedItem == null || PdnResources.GetString("Menu.Pleaseselecttheauxiliarylineused.text").Equals(this.comboBox1.SelectedItem))
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectauxiliaryline.text") + "!");
- return;
- }
- DataTable dataTable = new DataTable();
- //this.dataGridView111114.Rows.Clear();
- DataGridViewRow dgvr = new DataGridViewRow();
- dataTable1sTagInc++;
- dgvr.Tag = dataTable1sTagInc + "";
- foreach (DataGridViewColumn c in this.dataGridView1.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = this.comboBox1.SelectedItem;
- dgvr.Cells[1].Value = GSSClass.GuideClass.LineLength;
- dgvr.Cells[2].Value = GSSClass.GuideClass.LineDec;
- double countPoints = GSSClass.styleClass.styleModel.getCountPoints();
- dgvr.Cells[3].Value = countPoints;
- this.dataGridView1.Rows.Add(dgvr);
- dataTable.TableName = (string)dgvr.Tag;
- for (int i = 0; i < this.dataGridView1.Columns.Count; i++)
- {
- dataTable.Columns.Add("" + i);
- }
- DataRow dataRow = dataTable.NewRow();
- dataRow["0"] = dgvr.Cells[0].Value;
- dataRow["1"] = dgvr.Cells[1].Value;
- dataRow["2"] = dgvr.Cells[2].Value;
- dataRow["3"] = countPoints;
- dataTable.Rows.Add(dataRow);
- this.dataTable1s.Add(dataTable);
- //保存处理后的图片
- List<Bitmap> tempBit = new List<Bitmap>();
- Bitmap originalBit = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(this.imageMat);// this.bitmap;
- tempBit.Add(originalBit);
- Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- Graphics graphics = Graphics.FromImage(newBit);
- if (this.documentWorkspace.PhaseModels[0].choise && this.documentWorkspace.PhaseModels[0].mat != null)
- {
- Mat targetMat = this.documentWorkspace.PhaseModels[0].mat;
- graphics.DrawImage(OpenCvSharp.Extensions.BitmapConverter.ToBitmap(targetMat), 0, 0, targetMat.Width, targetMat.Height);
- }
- if (this.documentWorkspace.PhaseModels[1].choise && this.documentWorkspace.PhaseModels[1].mat != null)
- {
- Mat targetMat = this.documentWorkspace.PhaseModels[1].mat;
- graphics.DrawImage(OpenCvSharp.Extensions.BitmapConverter.ToBitmap(targetMat), 0, 0, targetMat.Width, targetMat.Height);
- }
- graphics.SmoothingMode = SmoothingMode.AntiAlias;
- drawSubclass/*Draw*/(graphics);
- tempBit.Add(newBit);
- if (bitCeDingDic.ContainsKey((string)dgvr.Tag))
- bitCeDingDic[(string)dgvr.Tag] = tempBit;
- else
- bitCeDingDic.Add((string)dgvr.Tag, tempBit);
- }
- /// <summary>
- /// 删除测定结果
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button4_Click(object sender, EventArgs e)
- {
- if (this.dataGridView1.Rows.Count > 0)
- {
- if (this.dataGridView1.SelectedRows.Count > 0)
- {
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretcteddata.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
- if (dr == DialogResult.OK)
- {
- DataGridViewRow gridViewRow = this.dataGridView1.SelectedRows[0];
- int selectIndex = gridViewRow.Index;
- foreach (var dataTable in this.dataTable1s)
- {
- if (dataTable.TableName.Equals(gridViewRow.Tag))
- {
- this.dataTable1s.Remove(dataTable);
- break;
- }
- }
- if (bitCeDingDic.ContainsKey((string)gridViewRow.Tag))
- bitCeDingDic.Remove((string)gridViewRow.Tag);
- this.dataGridView1.Rows.RemoveAt(selectIndex);
- //RefreshDataGridView1();
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectthedatatobedeleted.text")+"!");
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.nodata.text")+"!");
- }
- }
- private void AllShow()
- {
- this.dataGridView2.Rows.Clear();
- for (int i = 0; i < this.dataTables.Count; i++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = this.dataTables[i].TableName;
- foreach (DataGridViewColumn Column in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < this.dataTables[i].Columns.Count; c++)
- {
- //if (c > 2 && c < 4)
- // dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.dataTables[i].Rows[0][c]), Convert.ToInt32(this.numericUpDown1_0.Value)).ToString();
- //else
- dgvr.Cells[c].Value = this.dataTables[i].Rows[0][c].ToString();
- }
- this.dataGridView2.Rows.Add(dgvr);
- }
- }
- private void button6_0_Click(object sender, EventArgs e)
- {
- if (this.imageMat != null)
- {
- //MessageBox.Show(PdnResources.GetString("Menu.ftbuttontoaddainterceptadd.Text")+"!");
- GSSClass.styleClass.PointKb = 1;
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
- }
- }
- /// <summary>
- /// 1截点添加
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button7_0_Click(object sender, EventArgs e)
- {
- if (this.imageMat != null)
- {
- //MessageBox.Show(PdnResources.GetString("Menu.ftbuttontoaddainterceptadd.Text")+"!");
- GSSClass.styleClass.PointKb = 2;
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
- }
- }
- private void button8_Click(object sender, EventArgs e)
- {
- if (this.imageMat != null)
- {
- //MessageBox.Show(PdnResources.GetString("Menu.ftbuttontoaddainterceptadd.Text")+"!");
- GSSClass.styleClass.PointKb = 3;
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
- }
- }
- }
- }
|