MethodCutOffDialog.cs 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030
  1. using OpenCvSharp;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Drawing.Drawing2D;
  7. using System.Windows.Forms;
  8. namespace PaintDotNet.DedicatedAnalysis.GrainSizeStandard.YST347
  9. {
  10. internal class MethodCutOffDialog : GrainSizeStandardDialog
  11. {
  12. /// <summary>
  13. /// 测定结果暂存
  14. /// </summary>
  15. private List<DataTable> dataTable1s = new List<DataTable>();
  16. /// <summary>
  17. /// 储存点击保存结果后的所有原图与分析图
  18. /// </summary>
  19. private Dictionary<string, List<Bitmap>> bitCeDingDic = new Dictionary<string, List<Bitmap>>();
  20. #region 组件
  21. private GroupBox groupBox10;
  22. private Button button10;
  23. private Button button7_0;
  24. private GroupBox groupBox11;
  25. private CheckBox checkBox5_0;
  26. private CheckBox checkBox4;
  27. private CheckBox checkBox3_0;
  28. private DataGridViewTextBoxColumn ColumnTotal1;
  29. private DataGridViewTextBoxColumn ColumnTotal2;
  30. private DataGridViewTextBoxColumn ColumnTotal3;
  31. private Button button1;
  32. private Button button4;
  33. private DataGridView dataGridView1;
  34. private GroupBox groupBox5;
  35. private DataGridViewTextBoxColumn Column11;
  36. private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
  37. private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
  38. private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
  39. private Button button8;
  40. private Button button6_0;
  41. #endregion 组件
  42. /// <summary>
  43. /// 构造函数
  44. /// </summary>
  45. /// <param name="appWorkspace"></param>
  46. /// <param name="dialogText"></param>
  47. public MethodCutOffDialog(AppWorkspace appWorkspace, PdnMenuItem menuItem) : base(appWorkspace, menuItem, null, 0)
  48. {
  49. }
  50. #region 初始化组件
  51. private void InitializeLanguageText()
  52. {
  53. // ColumnTotal1
  54. this.ColumnTotal1.HeaderText = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Gridsize.text") + "(μm)";
  55. // ColumnTotal2
  56. this.ColumnTotal2.HeaderText = PdnResources.GetString("Menu.Numberofgrains.text");
  57. // ColumnTotal3
  58. this.ColumnTotal3.HeaderText = PdnResources.GetString("Menu.Averagegrainsizegrade.text");
  59. this.groupBox10.Text = PdnResources.GetString("Menu.sectionoperation.text");
  60. this.button8.Text = PdnResources.GetString("Menu.1.5/2section.text");
  61. this.button6_0.Text = PdnResources.GetString("Menu.0.5sectionstyle.text");
  62. this.button10.Text = PdnResources.GetString("Menu.Setting.Text");
  63. this.button7_0.Text = PdnResources.GetString("Menu.1section.text");
  64. this.groupBox11.Text = PdnResources.GetString("Menu.Displayparamssettings.text");
  65. this.checkBox5_0.Text = PdnResources.GetString("Menu.displaysections.text");
  66. this.checkBox4.Text = PdnResources.GetString("Menu.displaygrid.text");
  67. this.checkBox3_0.Text = PdnResources.GetString("Menu.displaygrainboundaries.text");
  68. this.button1.Text = PdnResources.GetString("Menu.Savemeasurementresults.text");
  69. this.button4.Text = PdnResources.GetString("Menu.Deletemeasurementresult.text");
  70. this.Column11.HeaderText = PdnResources.GetString("Menu.Tools.GridLine.Text");
  71. this.dataGridViewTextBoxColumn1.HeaderText = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Lengthofdetectionline.text");
  72. this.dataGridViewTextBoxColumn2.HeaderText = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Nnlines.text");
  73. this.dataGridViewTextBoxColumn4.HeaderText = PdnResources.GetString("Menu.Thenumberofsections.text");
  74. this.groupBox5.Text = PdnResources.GetString("Menu.measurementresults.text");
  75. this.Text = "YST347(" + PdnResources.GetString("Menu.Interceptmethod.text") + ")";
  76. }
  77. private void InitializeComponent()
  78. {
  79. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
  80. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
  81. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
  82. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
  83. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
  84. this.groupBox10 = new System.Windows.Forms.GroupBox();
  85. this.button8 = new System.Windows.Forms.Button();
  86. this.button6_0 = new System.Windows.Forms.Button();
  87. this.button10 = new System.Windows.Forms.Button();
  88. this.button7_0 = new System.Windows.Forms.Button();
  89. this.groupBox11 = new System.Windows.Forms.GroupBox();
  90. this.checkBox5_0 = new System.Windows.Forms.CheckBox();
  91. this.checkBox4 = new System.Windows.Forms.CheckBox();
  92. this.checkBox3_0 = new System.Windows.Forms.CheckBox();
  93. this.ColumnTotal1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  94. this.ColumnTotal2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  95. this.ColumnTotal3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  96. this.button1 = new System.Windows.Forms.Button();
  97. this.button4 = new System.Windows.Forms.Button();
  98. this.dataGridView1 = new System.Windows.Forms.DataGridView();
  99. this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  100. this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  101. this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  102. this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  103. this.groupBox5 = new System.Windows.Forms.GroupBox();
  104. this.groupBox_analysisResult1.SuspendLayout();
  105. this.groupBox10.SuspendLayout();
  106. this.groupBox11.SuspendLayout();
  107. ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
  108. this.groupBox5.SuspendLayout();
  109. this.SuspendLayout();
  110. //
  111. // groupBox_img
  112. //
  113. this.groupBox_img.Size = new System.Drawing.Size(158, 428);
  114. //
  115. // groupBox_review
  116. //
  117. this.groupBox_review.Size = new System.Drawing.Size(575, 428);
  118. //
  119. // groupBox_report
  120. //
  121. this.groupBox_report.Location = new System.Drawing.Point(974, 506);
  122. //
  123. // groupBox6groupBox_analysisResult2
  124. //
  125. this.groupBox6groupBox_analysisResult2.Location = new System.Drawing.Point(242, 506);
  126. //
  127. // groupBox_analysisResult1
  128. //
  129. this.groupBox_analysisResult1.Location = new System.Drawing.Point(12, 506);
  130. //
  131. // groupBox10
  132. //
  133. this.groupBox10.Controls.Add(this.button8);
  134. this.groupBox10.Controls.Add(this.button6_0);
  135. this.groupBox10.Controls.Add(this.button10);
  136. this.groupBox10.Controls.Add(this.button7_0);
  137. this.groupBox10.Location = new System.Drawing.Point(179, 375);
  138. this.groupBox10.Name = "groupBox10";
  139. this.groupBox10.Size = new System.Drawing.Size(208, 89);
  140. this.groupBox10.TabIndex = 38;
  141. this.groupBox10.TabStop = false;
  142. //
  143. // button8
  144. //
  145. this.button8.BackColor = System.Drawing.SystemColors.Control;
  146. this.button8.Location = new System.Drawing.Point(109, 52);
  147. this.button8.Name = "button8";
  148. this.button8.Size = new System.Drawing.Size(95, 26);
  149. this.button8.TabIndex = 13;
  150. this.button8.UseVisualStyleBackColor = false;
  151. this.button8.Click += new System.EventHandler(this.button8_Click);
  152. //
  153. // button6_0
  154. //
  155. this.button6_0.BackColor = System.Drawing.SystemColors.Control;
  156. this.button6_0.Location = new System.Drawing.Point(8, 53);
  157. this.button6_0.Name = "button6_0";
  158. this.button6_0.Size = new System.Drawing.Size(95, 26);
  159. this.button6_0.TabIndex = 12;
  160. this.button6_0.UseVisualStyleBackColor = false;
  161. this.button6_0.Click += new System.EventHandler(this.button6_0_Click);
  162. //
  163. // button10
  164. //
  165. this.button10.BackColor = System.Drawing.SystemColors.Control;
  166. this.button10.Location = new System.Drawing.Point(107, 20);
  167. this.button10.Name = "button10";
  168. this.button10.Size = new System.Drawing.Size(95, 26);
  169. this.button10.TabIndex = 11;
  170. this.button10.UseVisualStyleBackColor = false;
  171. this.button10.Click += new System.EventHandler(this.button10_Click);
  172. //
  173. // button7_0
  174. //
  175. this.button7_0.BackColor = System.Drawing.SystemColors.Control;
  176. this.button7_0.Location = new System.Drawing.Point(6, 20);
  177. this.button7_0.Name = "button7_0";
  178. this.button7_0.Size = new System.Drawing.Size(95, 26);
  179. this.button7_0.TabIndex = 8;
  180. this.button7_0.UseVisualStyleBackColor = false;
  181. this.button7_0.Click += new System.EventHandler(this.button7_0_Click);
  182. //
  183. // groupBox11
  184. //
  185. this.groupBox11.Controls.Add(this.checkBox5_0);
  186. this.groupBox11.Controls.Add(this.checkBox4);
  187. this.groupBox11.Controls.Add(this.checkBox3_0);
  188. this.groupBox11.Location = new System.Drawing.Point(393, 375);
  189. this.groupBox11.Name = "groupBox11";
  190. this.groupBox11.Size = new System.Drawing.Size(142, 89);
  191. this.groupBox11.TabIndex = 39;
  192. this.groupBox11.TabStop = false;
  193. //
  194. // checkBox5_0
  195. //
  196. this.checkBox5_0.AutoSize = true;
  197. this.checkBox5_0.Checked = true;
  198. this.checkBox5_0.CheckState = System.Windows.Forms.CheckState.Checked;
  199. this.checkBox5_0.Location = new System.Drawing.Point(15, 59);
  200. this.checkBox5_0.Name = "checkBox5_0";
  201. this.checkBox5_0.Size = new System.Drawing.Size(15, 14);
  202. this.checkBox5_0.TabIndex = 2;
  203. this.checkBox5_0.UseVisualStyleBackColor = true;
  204. this.checkBox5_0.CheckedChanged += new System.EventHandler(this.checkBox5_0_CheckedChanged);
  205. //
  206. // checkBox4
  207. //
  208. this.checkBox4.AutoSize = true;
  209. this.checkBox4.Checked = true;
  210. this.checkBox4.CheckState = System.Windows.Forms.CheckState.Checked;
  211. this.checkBox4.Location = new System.Drawing.Point(15, 37);
  212. this.checkBox4.Name = "checkBox4";
  213. this.checkBox4.Size = new System.Drawing.Size(15, 14);
  214. this.checkBox4.TabIndex = 1;
  215. this.checkBox4.UseVisualStyleBackColor = true;
  216. this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged);
  217. //
  218. // checkBox3_0
  219. //
  220. this.checkBox3_0.AutoSize = true;
  221. this.checkBox3_0.Checked = true;
  222. this.checkBox3_0.CheckState = System.Windows.Forms.CheckState.Checked;
  223. this.checkBox3_0.Location = new System.Drawing.Point(15, 15);
  224. this.checkBox3_0.Name = "checkBox3_0";
  225. this.checkBox3_0.Size = new System.Drawing.Size(15, 14);
  226. this.checkBox3_0.TabIndex = 0;
  227. this.checkBox3_0.UseVisualStyleBackColor = true;
  228. this.checkBox3_0.CheckedChanged += new System.EventHandler(this.checkBox3_0_CheckedChanged);
  229. this.dataGridView_Total.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
  230. this.ColumnTotal1,
  231. this.ColumnTotal2,
  232. this.ColumnTotal3});
  233. //
  234. // ColumnTotal1
  235. //
  236. this.ColumnTotal1.HeaderText = "";
  237. this.ColumnTotal1.Name = "ColumnTotal1";
  238. this.ColumnTotal1.ReadOnly = true;
  239. //
  240. // ColumnTotal2
  241. //
  242. this.ColumnTotal2.HeaderText = "";
  243. this.ColumnTotal2.Name = "ColumnTotal2";
  244. this.ColumnTotal2.ReadOnly = true;
  245. //
  246. // ColumnTotal3
  247. //
  248. this.ColumnTotal3.HeaderText = "";
  249. this.ColumnTotal3.Name = "ColumnTotal3";
  250. this.ColumnTotal3.ReadOnly = true;
  251. //
  252. // button1
  253. //
  254. this.button1.BackColor = System.Drawing.SystemColors.Control;
  255. this.button1.Location = new System.Drawing.Point(139, 11);
  256. this.button1.Name = "button1";
  257. this.button1.Size = new System.Drawing.Size(101, 23);
  258. this.button1.TabIndex = 5;
  259. this.button1.UseVisualStyleBackColor = false;
  260. this.button1.Click += new System.EventHandler(this.button1_Click);
  261. //
  262. // button4
  263. //
  264. this.button4.BackColor = System.Drawing.SystemColors.Control;
  265. this.button4.Location = new System.Drawing.Point(246, 11);
  266. this.button4.Name = "button4";
  267. this.button4.Size = new System.Drawing.Size(101, 23);
  268. this.button4.TabIndex = 4;
  269. this.button4.UseVisualStyleBackColor = false;
  270. this.button4.Click += new System.EventHandler(this.button4_Click);
  271. //
  272. // dataGridView1
  273. //
  274. this.dataGridView1.AllowUserToAddRows = false;
  275. this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
  276. dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
  277. dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
  278. dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  279. dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
  280. dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
  281. dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
  282. dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
  283. this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
  284. this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
  285. this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
  286. this.Column11,
  287. this.dataGridViewTextBoxColumn1,
  288. this.dataGridViewTextBoxColumn2,
  289. this.dataGridViewTextBoxColumn4});
  290. this.dataGridView1.Location = new System.Drawing.Point(6, 36);
  291. this.dataGridView1.MultiSelect = false;
  292. this.dataGridView1.Name = "dataGridView1";
  293. this.dataGridView1.ReadOnly = true;
  294. this.dataGridView1.RowHeadersVisible = false;
  295. this.dataGridView1.RowTemplate.Height = 23;
  296. this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
  297. this.dataGridView1.Size = new System.Drawing.Size(341, 103);
  298. this.dataGridView1.TabIndex = 29;
  299. //
  300. // Column11
  301. //
  302. dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
  303. this.Column11.DefaultCellStyle = dataGridViewCellStyle2;
  304. this.Column11.Name = "Column11";
  305. this.Column11.ReadOnly = true;
  306. this.Column11.Width = 66;
  307. //
  308. // dataGridViewTextBoxColumn1
  309. //
  310. dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
  311. this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle3;
  312. this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
  313. this.dataGridViewTextBoxColumn1.ReadOnly = true;
  314. //
  315. // dataGridViewTextBoxColumn2
  316. //
  317. dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
  318. this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle4;
  319. this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
  320. this.dataGridViewTextBoxColumn2.ReadOnly = true;
  321. //
  322. // dataGridViewTextBoxColumn4
  323. //
  324. dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
  325. this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle5;
  326. this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
  327. this.dataGridViewTextBoxColumn4.ReadOnly = true;
  328. this.dataGridViewTextBoxColumn4.Width = 72;
  329. //
  330. // groupBox5
  331. //
  332. this.groupBox5.Controls.Add(this.dataGridView1);
  333. this.groupBox5.Controls.Add(this.button4);
  334. this.groupBox5.Controls.Add(this.button1);
  335. this.groupBox5.Location = new System.Drawing.Point(179, 472);
  336. this.groupBox5.Name = "groupBox5";
  337. this.groupBox5.Size = new System.Drawing.Size(355, 145);
  338. this.groupBox5.TabIndex = 40;
  339. this.groupBox5.TabStop = false;
  340. //
  341. // MethodCutOffDialog
  342. //
  343. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  344. this.ClientSize = new System.Drawing.Size(1127, 980);
  345. this.Controls.Add(this.groupBox5);
  346. this.Controls.Add(this.groupBox10);
  347. this.Controls.Add(this.groupBox11);
  348. this.Name = "MethodCutOffDialog";
  349. this.Load += new System.EventHandler(this.MethodCutOffDialog_Load);
  350. this.Controls.SetChildIndex(this.groupBox11, 0);
  351. this.Controls.SetChildIndex(this.groupBox10, 0);
  352. this.Controls.SetChildIndex(this.groupBox5, 0);
  353. this.Controls.SetChildIndex(this.groupBox6groupBox_analysisResult2, 0);
  354. this.Controls.SetChildIndex(this.groupBox_img, 0);
  355. this.Controls.SetChildIndex(this.groupBox_review, 0);
  356. this.Controls.SetChildIndex(this.groupBox_analysisResult1, 0);
  357. this.Controls.SetChildIndex(this.groupBox_report, 0);
  358. this.groupBox_analysisResult1.ResumeLayout(false);
  359. this.groupBox10.ResumeLayout(false);
  360. this.groupBox11.ResumeLayout(false);
  361. this.groupBox11.PerformLayout();
  362. ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
  363. this.groupBox5.ResumeLayout(false);
  364. this.ResumeLayout(false);
  365. }
  366. #endregion 初始化组件
  367. #region 需继承方法
  368. protected override void refreshWhileImgChanged()
  369. {
  370. object ShowGrainBoundry;
  371. if (GetParamValue1(ParamKey_displaygrainboundaries, out ShowGrainBoundry))//显示晶界
  372. this.checkBox3_0.Checked = (bool)ShowGrainBoundry;
  373. if (GetParamValue1(ParamKey_displaygrid, out ShowGrainBoundry))//显示网格
  374. this.checkBox4.Checked = (bool)ShowGrainBoundry;
  375. if (GetParamValue1(ParamKey_displaysections, out ShowGrainBoundry))//显示截点
  376. this.checkBox5_0.Checked = (bool)ShowGrainBoundry;
  377. if (this.dataGridView1.Rows.Count > 0)
  378. {
  379. foreach (DataGridViewRow gridViewRow in this.dataGridView1.Rows)
  380. {
  381. foreach (var dataTable in this.dataTable1s)
  382. {
  383. if (dataTable.TableName.Equals(gridViewRow.Tag))
  384. {
  385. this.dataTable1s.Remove(dataTable);
  386. break;
  387. }
  388. }
  389. if (bitCeDingDic.ContainsKey((string)gridViewRow.Tag))
  390. bitCeDingDic.Remove((string)gridViewRow.Tag);
  391. }
  392. this.dataGridView1.Rows.Clear();
  393. }
  394. }
  395. /// <summary>
  396. /// 保存结果
  397. /// </summary>
  398. protected override void buildListBox_analysisResult(string imagesKey, int analysisPicture, bool saveAll = false)
  399. {
  400. if (this.matOrg == null)
  401. {
  402. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
  403. return;
  404. }
  405. if (this.dataGridView1.Rows.Count == 0)
  406. {
  407. MessageBox.Show(PdnResources.GetString("Menu.Nomeasurementresult.text"));
  408. return;
  409. }
  410. double value4Total = 0;
  411. foreach (DataGridViewRow Row in this.dataGridView1.Rows)
  412. {
  413. value4Total += double.Parse(Row.Cells[3].Value.ToString());//交点个数
  414. }
  415. if (value4Total == 0)
  416. {
  417. MessageBox.Show("请添加截点后保存结果"/*PdnResources.GetString("Menu.Nomeasurementresult.text")*/);
  418. return;
  419. }
  420. //if (this.comboBox1.SelectedItem == null || PdnResources.GetString("Menu.Pleaseselecttheauxiliarylineused.text").Equals(this.comboBox1.SelectedItem))
  421. //{
  422. // MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectauxiliaryline.text") + "!");
  423. // return;
  424. //}
  425. string imgName = getCurrentWorkspace().GetFriendlyName();
  426. string tag = getCurrentWorkTag();
  427. DataTable dataTable = new DataTable();
  428. bool replace = false;
  429. int add = 0;
  430. foreach (ListViewItem item in this.listView2.Items)
  431. {
  432. if (item.Tag.Equals(tag))
  433. {
  434. add++;
  435. DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Theresuethertoreplace.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
  436. if (dr == DialogResult.OK)
  437. {
  438. replace = true;
  439. }
  440. break;
  441. }
  442. }
  443. if (replace || this.listView2.Items.Count == 0 || add == 0)
  444. {
  445. if (!replace)
  446. {
  447. ListViewItem listViewItem = new ListViewItem();
  448. listViewItem.SubItems[0].Text = imgName;
  449. listViewItem.Tag = "" + tag;
  450. if (this.listView2.Items.Count == 0)
  451. this.listView2.Items.Add(listViewItem);
  452. else
  453. this.listView2.Items.Insert(0, listViewItem);
  454. }
  455. this.dataGridView2.Rows.Clear();
  456. DataGridViewRow dgvr = new DataGridViewRow();
  457. dgvr.Tag = tag;
  458. foreach (DataGridViewColumn c in this.dataGridView2.Columns)
  459. {
  460. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  461. }
  462. dgvr.Cells[0].Value = imgName;
  463. DataGridViewRow firRow = this.dataGridView1.Rows[0];
  464. object value1 = firRow.Cells[0].Value;//网格
  465. object value2 = firRow.Cells[1].Value;//网格长度
  466. object value3 = firRow.Cells[2].Value;//网格条数
  467. double value2Total = 0;
  468. foreach (DataGridViewRow Row in this.dataGridView1.Rows)
  469. {
  470. value2Total += (double.Parse(Row.Cells[1].Value.ToString()) * double.Parse(Row.Cells[2].Value.ToString()));//网格总长度
  471. }
  472. //double value4Total = 0;
  473. //foreach (DataGridViewRow Row in this.dataGridView1.Rows)
  474. //{
  475. // value4Total += double.Parse(Row.Cells[3].Value.ToString());//交点个数
  476. //}
  477. //if (value4Total == 0)
  478. //{
  479. // MessageBox.Show(PdnResources.GetString("Menu.Nomeasurementresult.text"));
  480. // return;
  481. //}
  482. ////double value4Per = value4Total / this.dataGridView1.Rows.Count;
  483. dgvr.Cells[1].Value = value1;
  484. dgvr.Cells[2].Value = value2Total;
  485. dgvr.Cells[3].Value = value4Total;
  486. //dgvr.Cells[4].Value = value4Per;//级别
  487. decimal M = 1;// this.getGainMultiple();
  488. dgvr.Cells[4].Value = 6.6439 * Math.Log10((value4Total * (double)M) / (value2Total * 0.001)) - 3.2877;
  489. this.dataGridView2.Rows.Add(dgvr);
  490. dataTable.TableName = tag;
  491. foreach (System.Data.DataTable dataTable1 in dataTables)
  492. {
  493. if (dataTable1.TableName.Equals(dataTable.TableName))
  494. {
  495. dataTables.Remove(dataTable1);
  496. break;
  497. }
  498. }
  499. for (int i = 0; i < this.dataGridView2.Columns.Count; i++)
  500. {
  501. dataTable.Columns.Add("" + i);
  502. }
  503. DataRow dataRow = dataTable.NewRow();
  504. dataRow["0"] = imgName;
  505. dataRow["1"] = dgvr.Cells[1].Value;// "网格1";
  506. dataRow["2"] = dgvr.Cells[2].Value;
  507. dataRow["3"] = dgvr.Cells[3].Value;
  508. dataRow["4"] = dgvr.Cells[4].Value;
  509. dataTable.Rows.Add(dataRow);
  510. this.dataTables.Add(dataTable);
  511. if (this.allShow)
  512. AllShow();
  513. this.RefreshDataGridView4();
  514. //保存处理后的图片
  515. double pantographRatio = (double)this.appWorkspace.DocumentWorkspaces[this.selectPicture].GetRulerMultiple(MeasurementUnit.Micron);//标尺*放大倍数
  516. List<Bitmap> tempBit = new List<Bitmap>();
  517. //Bitmap originalBit = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreateAliasedBitmap();
  518. //tempBit.Add(originalBit);
  519. //Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
  520. //Graphics graphics = Graphics.FromImage(newBit);
  521. //Draw(graphics);
  522. //tempBit.Add(newBit);
  523. foreach (KeyValuePair<string, List<Bitmap>> kv in this.bitCeDingDic)
  524. {
  525. kv.Value[0].Tag = pantographRatio;
  526. kv.Value[1].Tag = pantographRatio;
  527. tempBit.Add(kv.Value[0]);
  528. tempBit.Add(kv.Value[1]);
  529. }
  530. if (bitDic.ContainsKey(tag))
  531. bitDic[tag] = tempBit;
  532. else
  533. bitDic.Add(tag, tempBit);
  534. //中间数据-拼接中间数据
  535. List<List<string>> dataList = new List<List<string>>();
  536. List<string> columnName = new List<string>();
  537. columnName.Add(PdnResources.GetString("Menu.Tools.GridLine.Text"));
  538. columnName.Add(PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Lengthofdetectionline.text"));
  539. columnName.Add(PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Nnlines.text"));
  540. columnName.Add(PdnResources.GetString("Menu.Thenumberofsections.text"));
  541. dataList.Add(columnName);
  542. foreach (DataGridViewRow Row in this.dataGridView1.Rows)
  543. {
  544. List<string> strList = new List<string>();
  545. strList.Add(Row.Cells[0].Value.ToString());
  546. strList.Add(Row.Cells[1].Value.ToString());
  547. strList.Add(Row.Cells[2].Value.ToString());
  548. strList.Add(Row.Cells[3].Value.ToString());
  549. dataList.Add(strList);
  550. }
  551. bool isExist = false;//是否已存在进行替换
  552. int modelIndex = -1;//要替换的下标
  553. for (int j = 0; j < tempDataModel.Count; j++)
  554. {
  555. if (tempDataModel[j].tagName.Equals(tag))
  556. {
  557. isExist = true;
  558. modelIndex = j;
  559. break;
  560. }
  561. }
  562. if (isExist && modelIndex > -1)
  563. tempDataModel[modelIndex].dataList = dataList;
  564. else
  565. {
  566. Base.Functionodel.ExportProjectModel newModel = new Base.Functionodel.ExportProjectModel();
  567. newModel.tagName = tag;
  568. newModel.picName = imgName;
  569. newModel.dataList = dataList;
  570. tempDataModel.Add(newModel);
  571. }
  572. }
  573. }
  574. /// <summary>
  575. /// 是否显示晶界
  576. /// </summary>
  577. /// <returns></returns>
  578. protected override Boolean ShowGrainBoundryChecked()
  579. {
  580. return checkBox3_0.Checked;
  581. }
  582. //是否绘制辅助线
  583. protected override bool showGridChecked()
  584. {
  585. return checkBox4.Checked;
  586. }
  587. //是否绘制截点
  588. protected override bool drawGuidePoints()
  589. {
  590. return (matOrg != null && this.checkBox5_0.Checked);
  591. }
  592. //是否显示截点
  593. protected override Boolean drawDisplaySections()//##1
  594. {
  595. return this.checkBox5_0.Checked;
  596. }
  597. //辅助线类型
  598. protected override string[] getTypeNames()
  599. {
  600. return new string[] {
  601. PdnResources.GetString("Menu.Verticalauxiliaryline.text"),
  602. PdnResources.GetString("Menu.Horizontalauxiliaryline.text")};
  603. }
  604. protected override string getTemplateName()
  605. {
  606. return "Template.Manager.item3.GrainSizeCutOff_YST347";
  607. }
  608. protected override string getProjectEngineeringName()
  609. {
  610. return "Menu.DedicatedAnalysis.NonferrousMetal.CopperAlloy.Text";
  611. }
  612. protected override string getModelName()
  613. {
  614. return "GrainGBT32461CutOffMethodModel.xml";
  615. }
  616. protected override void SubclassInitialize()
  617. {
  618. InitializeComponent();
  619. InitializeLanguageText();
  620. }
  621. #endregion
  622. private DataGridViewTextBoxColumn Column1;
  623. private DataGridViewTextBoxColumn Column2;
  624. private DataGridViewTextBoxColumn Column3;
  625. private DataGridViewTextBoxColumn Column4;
  626. private DataGridViewTextBoxColumn Column5;
  627. private void MethodCutOffDialog_Load(object sender, EventArgs e)
  628. {
  629. this.button_ApplyToAll.Visible = false;
  630. this.button_SaveAll.Visible = false;
  631. this.btn_Grainboundarytoreproduce.Location = new System.Drawing.Point(912, 20);
  632. this.btn_saveresult.Location = new System.Drawing.Point(993, 20);
  633. object ShowGrainBoundry;
  634. if (GetParamValue1(ParamKey_displaygrainboundaries, out ShowGrainBoundry))//显示晶界
  635. this.checkBox3_0.Checked = (bool)ShowGrainBoundry;
  636. if (GetParamValue1(ParamKey_displaygrid, out ShowGrainBoundry))//显示网格
  637. this.checkBox4.Checked = (bool)ShowGrainBoundry;
  638. if (GetParamValue1(ParamKey_displaysections, out ShowGrainBoundry))//显示截点
  639. this.checkBox5_0.Checked = (bool)ShowGrainBoundry;
  640. this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  641. this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  642. this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  643. this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  644. this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  645. this.Column1.Name = "Column1";
  646. this.Column1.ReadOnly = true;
  647. //
  648. // Column2
  649. //
  650. this.Column2.Name = "Column2";
  651. this.Column2.ReadOnly = true;
  652. //
  653. // Column3
  654. //
  655. this.Column3.Name = "Column3";
  656. this.Column3.ReadOnly = true;
  657. //
  658. // Column4
  659. //
  660. this.Column4.Name = "Column4";
  661. this.Column4.ReadOnly = true;
  662. //
  663. // Column5
  664. //
  665. this.Column5.Name = "Column5";
  666. this.Column5.ReadOnly = true;
  667. this.Column5.HeaderText = PdnResources.GetString("Menu.Averagegrainsizegrade.text");
  668. this.Column4.HeaderText = PdnResources.GetString("Menu.Numberofgrains.text");
  669. this.Column3.HeaderText = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Gridsize.text") + "(μm)";
  670. this.Column2.HeaderText = PdnResources.GetString("Menu.Tools.GridLine.Text");
  671. this.Column1.HeaderText = PdnResources.GetString("Menu.picture.Text");
  672. this.dataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
  673. this.Column1,
  674. this.Column2,
  675. this.Column3,
  676. this.Column4,
  677. this.Column5});
  678. this.groupBox_img.Size = new System.Drawing.Size(158, 672);
  679. this.groupBox_review.Size = new System.Drawing.Size(575, 672);
  680. this.groupBox_analysisResult1.Location = new System.Drawing.Point(12, 750);
  681. this.groupBox6groupBox_analysisResult2.Location = new System.Drawing.Point(242, 750);
  682. this.groupBox_report.Location = new System.Drawing.Point(974, 750);
  683. DetailListStringIndex.Add(0);
  684. DetailListStringIndex.Add(1);
  685. DetailListStringIndex.Add(3);
  686. //DetailListStringIndex.Add(4);
  687. DetailListNotDoubleIndex.Add(0);
  688. DetailListNotDoubleIndex.Add(1);
  689. DetailListNotDoubleIndex.Add(3);
  690. IndexChangedFromIndex.Clear();
  691. IndexChangedToIndex.Clear();
  692. IndexChangedFromIndex.Add(2);
  693. IndexChangedFromIndex.Add(3);
  694. IndexChangedToIndex.Add(0, new int[] { 2, 0 });//平均
  695. IndexChangedToIndex.Add(1, new int[] { 2/*1*/, 1 });//平均<-求和
  696. IndexChangedToIndex.Add(2, new int[] { 3, -1 });//级别
  697. }
  698. /// <summary>
  699. /// 计算汇总列表的平均晶粒度级别
  700. /// </summary>
  701. /// <returns></returns>
  702. protected override string getGradeTotalCal(DataGridViewRow dgvr, int digits)
  703. {
  704. double value2Total = double.Parse(dgvr.Cells[0].Value.ToString());
  705. double value4Total = double.Parse(dgvr.Cells[1].Value.ToString());
  706. decimal M = 1;// this.getGainMultiple();
  707. return "" + Math.Round(6.6439 * Math.Log10((value4Total * (double)M) / (value2Total * 0.001)) - 3.2877, digits);
  708. }
  709. /// <summary>
  710. /// 是否显示网格
  711. /// </summary>
  712. /// <param name="sender"></param>
  713. /// <param name="e"></param>
  714. private void checkBox4_CheckedChanged(object sender, EventArgs e)
  715. {
  716. this.documentWorkspace.Refresh();
  717. }
  718. /// <summary>
  719. /// 是否显示截点
  720. /// </summary>
  721. /// <param name="sender"></param>
  722. /// <param name="e"></param>
  723. private void checkBox5_0_CheckedChanged(object sender, EventArgs e)
  724. {
  725. if (!this.checkBox4.Checked)
  726. MessageBox.Show(PdnResources.GetString("Menu.Nogrid.text")+"!");
  727. this.documentWorkspace.Refresh();
  728. }
  729. /// <summary>
  730. /// 是否显示晶界
  731. /// </summary>
  732. /// <param name="sender"></param>
  733. /// <param name="e"></param>
  734. private void checkBox3_0_CheckedChanged(object sender, EventArgs e)
  735. {
  736. if (!showOrimat() && getGrainBoundryChecked() && checkBox3_0.Checked)
  737. {
  738. this.documentWorkspace.PhaseModels[1].choise = true;
  739. }
  740. else
  741. {
  742. this.documentWorkspace.PhaseModels[1].choise = false;
  743. }
  744. this.documentWorkspace.Refresh();
  745. }
  746. /// <summary>
  747. /// 设置截点样式
  748. /// </summary>
  749. /// <param name="sender"></param>
  750. /// <param name="e"></param>
  751. private void button10_Click(object sender, EventArgs e)
  752. {//###
  753. GrainSizeStandard.IntegrationClass.GrainSurveyPointStyleSettingDialog grainSurveyPointStyleSettingDialog = new GrainSizeStandard.IntegrationClass.GrainSurveyPointStyleSettingDialog();//###
  754. grainSurveyPointStyleSettingDialog.StartPosition = FormStartPosition.CenterScreen;
  755. grainSurveyPointStyleSettingDialog.ShowDialog(this);
  756. }
  757. /// <summary>
  758. /// 鼠标按下
  759. /// </summary>
  760. /// <param name="drawArea"></param>
  761. /// <param name="e"></param>
  762. protected override void OnMouseDown(object sender, MouseEventArgs e)
  763. {
  764. if (this.documentWorkspace.CompositionSurface == null)
  765. return;
  766. // 换算后的点
  767. PointF point1 = documentWorkspace.GetScalePoint(e.Location);
  768. if (point1.X <= this.documentWorkspace.CompositionSurface.Width
  769. && point1.X >= 0
  770. && point1.Y >= 0
  771. && point1.Y <= this.documentWorkspace.CompositionSurface.Height)
  772. {
  773. RectangleF rectangleF;
  774. // 复合辅助线
  775. int add = GSSClass.GuideClass.getAddOfRStyle(point1, this.comboBox1.SelectedItem, out rectangleF);
  776. if (add == 0 && GSSClass.styleClass.PointKb > 0)
  777. rectangleF = GSSClass.GuideClass.guideModel.RectangleFLine;
  778. //手动添加截点
  779. if (this.documentWorkspace.ActiveTool == Annotation.Enum.DrawToolType.InclusionNoEffect && GSSClass.styleClass.OnMouseDownNext(point1, sender, e))
  780. GSSClass.styleClass.OnMouseDownFirst(point1, rectangleF, GSSClass.standardModel.linePointList, sender, e);
  781. }
  782. if (GSSClass.styleClass.PointKb == 0)
  783. {
  784. //辅助线缩放
  785. GSSClass.GuideClass.OnMouseDown(point1, sender, e);
  786. //辅助线移动
  787. base.OnMouseDown(sender, e);//##
  788. }
  789. ////手动删除截点或取消添加截点
  790. //GSSClass.styleClass.OnMouseDownNext(point1, sender, e);
  791. }
  792. private int dataTable1sTagInc = 0;
  793. /// <summary>
  794. /// 保存测定结果
  795. /// </summary>
  796. /// <param name="sender"></param>
  797. /// <param name="e"></param>
  798. private void button1_Click(object sender, EventArgs e)
  799. {
  800. if (this.matOrg == null)
  801. {
  802. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
  803. return;
  804. }
  805. if (this.comboBox1.SelectedItem == null || PdnResources.GetString("Menu.Pleaseselecttheauxiliarylineused.text").Equals(this.comboBox1.SelectedItem))
  806. {
  807. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectauxiliaryline.text") + "!");
  808. return;
  809. }
  810. DataTable dataTable = new DataTable();
  811. //this.dataGridView111114.Rows.Clear();
  812. DataGridViewRow dgvr = new DataGridViewRow();
  813. dataTable1sTagInc++;
  814. dgvr.Tag = dataTable1sTagInc + "";
  815. foreach (DataGridViewColumn c in this.dataGridView1.Columns)
  816. {
  817. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  818. }
  819. dgvr.Cells[0].Value = this.comboBox1.SelectedItem;
  820. dgvr.Cells[1].Value = GSSClass.GuideClass.LineLength;
  821. dgvr.Cells[2].Value = GSSClass.GuideClass.LineDec;
  822. double countPoints = GSSClass.styleClass.styleModel.getCountPoints();
  823. dgvr.Cells[3].Value = countPoints;// (float)this.p1RectangleFs.Count + (float)this.p2RectangleFs.Count / 2;
  824. this.dataGridView1.Rows.Add(dgvr);
  825. dataTable.TableName = (string)dgvr.Tag;
  826. for (int i = 0; i < this.dataGridView1.Columns.Count; i++)
  827. {
  828. dataTable.Columns.Add("" + i);
  829. }
  830. DataRow dataRow = dataTable.NewRow();
  831. dataRow["0"] = dgvr.Cells[0].Value;
  832. dataRow["1"] = dgvr.Cells[1].Value;
  833. dataRow["2"] = dgvr.Cells[2].Value;
  834. dataRow["3"] = countPoints;// Convert.ToDecimal(this.p1RectangleFs.Count) + Convert.ToDecimal(this.p2RectangleFs.Count) / 2;
  835. dataTable.Rows.Add(dataRow);
  836. this.dataTable1s.Add(dataTable);
  837. //保存处理后的图片
  838. List<Bitmap> tempBit = new List<Bitmap>();
  839. Bitmap originalBit = this.bitmap;// this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreateAliasedBitmap();
  840. tempBit.Add(originalBit);
  841. Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
  842. Graphics graphics = Graphics.FromImage(newBit);
  843. if (this.documentWorkspace.PhaseModels[0].choise && this.documentWorkspace.PhaseModels[0].mat != null)
  844. {
  845. Mat targetMat = this.documentWorkspace.PhaseModels[0].mat;
  846. graphics.DrawImage(OpenCvSharp.Extensions.BitmapConverter.ToBitmap(targetMat), 0, 0, targetMat.Width, targetMat.Height);
  847. }
  848. if (this.documentWorkspace.PhaseModels[1].choise && this.documentWorkspace.PhaseModels[1].mat != null)
  849. {
  850. Mat targetMat = this.documentWorkspace.PhaseModels[1].mat;
  851. graphics.DrawImage(OpenCvSharp.Extensions.BitmapConverter.ToBitmap(targetMat), 0, 0, targetMat.Width, targetMat.Height);
  852. }
  853. graphics.SmoothingMode = SmoothingMode.AntiAlias;
  854. drawSubclass/*Draw*/(graphics);
  855. tempBit.Add(newBit);
  856. if (bitCeDingDic.ContainsKey((string)dgvr.Tag))
  857. bitCeDingDic[(string)dgvr.Tag] = tempBit;
  858. else
  859. bitCeDingDic.Add((string)dgvr.Tag, tempBit);
  860. }
  861. /// <summary>
  862. /// 删除测定结果
  863. /// </summary>
  864. /// <param name="sender"></param>
  865. /// <param name="e"></param>
  866. private void button4_Click(object sender, EventArgs e)
  867. {
  868. if (this.dataGridView1.Rows.Count > 0)
  869. {
  870. if (this.dataGridView1.SelectedRows.Count > 0)
  871. {
  872. DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretcteddata.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
  873. if (dr == DialogResult.OK)
  874. {
  875. DataGridViewRow gridViewRow = this.dataGridView1.SelectedRows[0];
  876. int selectIndex = gridViewRow.Index;
  877. foreach (var dataTable in this.dataTable1s)
  878. {
  879. if (dataTable.TableName.Equals(gridViewRow.Tag))
  880. {
  881. this.dataTable1s.Remove(dataTable);
  882. break;
  883. }
  884. }
  885. if (bitCeDingDic.ContainsKey((string)gridViewRow.Tag))
  886. bitCeDingDic.Remove((string)gridViewRow.Tag);
  887. this.dataGridView1.Rows.RemoveAt(selectIndex);
  888. //RefreshDataGridView1();
  889. }
  890. }
  891. else
  892. {
  893. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectthedatatobedeleted.text")+"!");
  894. }
  895. }
  896. else
  897. {
  898. MessageBox.Show(PdnResources.GetString("Menu.nodata.text")+"!");
  899. }
  900. }
  901. private void AllShow()
  902. {
  903. this.dataGridView2.Rows.Clear();
  904. for (int i = 0; i < this.dataTables.Count; i++)
  905. {
  906. DataGridViewRow dgvr = new DataGridViewRow();
  907. dgvr.Tag = this.dataTables[i].TableName;
  908. foreach (DataGridViewColumn Column in this.dataGridView2.Columns)
  909. {
  910. dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
  911. }
  912. for (int c = 0; c < this.dataTables[i].Columns.Count; c++)
  913. {
  914. //if (c > 2 && c < 4)
  915. // dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.dataTables[i].Rows[0][c]), Convert.ToInt32(this.numericUpDown1_0.Value)).ToString();
  916. //else
  917. dgvr.Cells[c].Value = this.dataTables[i].Rows[0][c].ToString();
  918. }
  919. this.dataGridView2.Rows.Add(dgvr);
  920. }
  921. }
  922. private void button6_0_Click(object sender, EventArgs e)
  923. {
  924. if (this.matOrg != null)
  925. {
  926. //MessageBox.Show(PdnResources.GetString("Menu.ftbuttontoaddainterceptadd.Text")+"!");
  927. GSSClass.styleClass.PointKb = 1;
  928. }
  929. else
  930. {
  931. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
  932. }
  933. }
  934. /// <summary>
  935. /// 1截点添加
  936. /// </summary>
  937. /// <param name="sender"></param>
  938. /// <param name="e"></param>
  939. private void button7_0_Click(object sender, EventArgs e)
  940. {
  941. if (this.matOrg != null)
  942. {
  943. //MessageBox.Show(PdnResources.GetString("Menu.ftbuttontoaddainterceptadd.Text")+"!");
  944. GSSClass.styleClass.PointKb = 2;
  945. }
  946. else
  947. {
  948. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
  949. }
  950. }
  951. private void button8_Click(object sender, EventArgs e)
  952. {
  953. if (this.matOrg != null)
  954. {
  955. //MessageBox.Show(PdnResources.GetString("Menu.ftbuttontoaddainterceptadd.Text")+"!");
  956. GSSClass.styleClass.PointKb = 3;
  957. }
  958. else
  959. {
  960. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
  961. }
  962. }
  963. }
  964. }