MethodCutOffDialog.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. using OpenCvSharp;
  2. using PaintDotNet.Base.CommTool;
  3. using PaintDotNet.Base.SettingModel;
  4. using System;
  5. using System.Collections;
  6. using System.Collections.Generic;
  7. using System.ComponentModel;
  8. using System.Drawing;
  9. using System.Drawing.Drawing2D;
  10. using System.IO;
  11. using System.Windows.Forms;
  12. using Point = System.Drawing.Point;
  13. using PaintDotNet.Base.Functionodel;
  14. using PaintDotNet.Base.Enum;
  15. using PaintDotNet.Annotation.Enum;
  16. using PaintDotNet.CustomControl;
  17. using Application = System.Windows.Forms.Application;
  18. using GroupBox = System.Windows.Forms.GroupBox;
  19. using CheckBox = System.Windows.Forms.CheckBox;
  20. using Button = System.Windows.Forms.Button;
  21. using Label = System.Windows.Forms.Label;
  22. using TextBox = System.Windows.Forms.TextBox;
  23. using System.Data;
  24. using PaintDotNet.DbOpreate.DbModel;
  25. using PaintDotNet.Annotation;
  26. using PaintDotNet.DedicatedAnalysis.GrainSizeStandard.IntegrationClass;
  27. namespace PaintDotNet.DedicatedAnalysis.GrainSizeStandard.GBT4335
  28. {
  29. internal class MethodCutOffDialog : GrainSizeStandardDialog
  30. {
  31. /// <summary>
  32. /// 测定结果暂存
  33. /// </summary>
  34. private List<DataTable> dataTable1s = new List<DataTable>();
  35. /// <summary>
  36. /// 储存点击保存结果后的所有原图与分析图
  37. /// </summary>
  38. private Dictionary<string, List<Bitmap>> bitCeDingDic = new Dictionary<string, List<Bitmap>>();
  39. #region 组件
  40. private GroupBox groupBox10;
  41. private Button button10;
  42. private Button button7_0;
  43. private GroupBox groupBox11;
  44. private CheckBox checkBox5_0;
  45. private CheckBox checkBox4;
  46. private CheckBox checkBox3_0;
  47. private DataGridViewTextBoxColumn ColumnTotal1;
  48. private DataGridViewTextBoxColumn ColumnTotal2;
  49. private DataGridViewTextBoxColumn ColumnTotal3;
  50. private DataGridViewTextBoxColumn ColumnTotal4;
  51. private DataGridViewTextBoxColumn ColumnTotal5;
  52. private DataGridViewTextBoxColumn ColumnTotal6;
  53. private DataGridViewTextBoxColumn Column1;
  54. private DataGridViewTextBoxColumn Column2;
  55. private DataGridViewTextBoxColumn Column3;
  56. private DataGridViewTextBoxColumn Column4;
  57. private DataGridViewTextBoxColumn Column5;
  58. private DataGridViewTextBoxColumn Column6;
  59. private Button button8;
  60. private Button button6_0;
  61. #endregion 组件
  62. #region 构造函数
  63. public MethodCutOffDialog(AppWorkspace appWorkspace, PdnMenuItem menuItem) : base(appWorkspace, menuItem, null, 0)
  64. {
  65. }
  66. #endregion 构造函数
  67. #region 初始化组件
  68. private void InitializeLanguageText()
  69. {
  70. this.groupBox10.Text = PdnResources.GetString("Menu.sectionoperation.text");
  71. this.button8.Text = PdnResources.GetString("Menu.1.5/2section.text");
  72. this.button6_0.Text = PdnResources.GetString("Menu.0.5section.text");
  73. this.button10.Text = PdnResources.GetString("Menu.Setting.Text");
  74. this.button7_0.Text = PdnResources.GetString("Menu.1section.text");
  75. this.groupBox11.Text = PdnResources.GetString("Menu.Displayparamssettings.text");
  76. this.checkBox5_0.Text = PdnResources.GetString("Menu.displaysections.text");
  77. this.checkBox4.Text = PdnResources.GetString("Menu.displaygrid.text");
  78. this.checkBox3_0.Text = PdnResources.GetString("Menu.displaygrainboundaries.text");
  79. this.ColumnTotal1.HeaderText = PdnResources.GetString("Menu.Intersectinggrainnumber.Text");
  80. this.ColumnTotal2.HeaderText = PdnResources.GetString("Menu.Numberofgrainsingrid.Text");
  81. this.ColumnTotal3.HeaderText = PdnResources.GetString("Menu.Totalmeshlength.Text") + "(μm)";
  82. this.ColumnTotal4.HeaderText = PdnResources.GetString("Menu.umberofpoints.Text");
  83. this.ColumnTotal5.HeaderText = PdnResources.GetString("Menu.averageintercept.text") + "(μm)";
  84. this.ColumnTotal6.HeaderText = PdnResources.GetString("Menu.Averagegrainsizegrade.text");
  85. this.Column1.HeaderText = PdnResources.GetString("Menu.picture.Text");
  86. this.Column2.HeaderText = PdnResources.GetString("Menu.Tools.GridLine.Text");
  87. this.Column3.HeaderText = PdnResources.GetString("Menu.Gridlength.text") + "(μm)";
  88. this.Column4.HeaderText = PdnResources.GetString("Menu.Thenumberofsections.text");
  89. this.Column5.HeaderText = PdnResources.GetString("Menu.averageintercept.text") + "(μm)";
  90. this.Column6.HeaderText = PdnResources.GetString("Menu.Averagegrainsizegrade.text");
  91. this.Text = "GBT4335_2013(" + PdnResources.GetString("Menu.Dedicatedanalysis.blackmetal.Three-circleinterceptmethod.text") + ")";
  92. }
  93. private void InitializeComponent()
  94. {
  95. this.groupBox10 = new System.Windows.Forms.GroupBox();
  96. this.button8 = new System.Windows.Forms.Button();
  97. this.button6_0 = new System.Windows.Forms.Button();
  98. this.button10 = new System.Windows.Forms.Button();
  99. this.button7_0 = new System.Windows.Forms.Button();
  100. this.groupBox11 = new System.Windows.Forms.GroupBox();
  101. this.checkBox5_0 = new System.Windows.Forms.CheckBox();
  102. this.checkBox4 = new System.Windows.Forms.CheckBox();
  103. this.checkBox3_0 = new System.Windows.Forms.CheckBox();
  104. this.ColumnTotal1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  105. this.ColumnTotal2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  106. this.ColumnTotal3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  107. this.ColumnTotal4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  108. this.ColumnTotal5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  109. this.ColumnTotal6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  110. this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  111. this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  112. this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  113. this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  114. this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  115. this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  116. this.groupBox_analysisResult1.SuspendLayout();
  117. this.groupBox10.SuspendLayout();
  118. this.groupBox11.SuspendLayout();
  119. this.SuspendLayout();
  120. //
  121. // groupBox10
  122. //
  123. this.groupBox10.Controls.Add(this.button8);
  124. this.groupBox10.Controls.Add(this.button6_0);
  125. this.groupBox10.Controls.Add(this.button10);
  126. this.groupBox10.Controls.Add(this.button7_0);
  127. this.groupBox10.Location = new System.Drawing.Point(179, 370);
  128. this.groupBox10.Name = "groupBox10";
  129. this.groupBox10.Size = new System.Drawing.Size(208, 74);
  130. this.groupBox10.TabIndex = 38;
  131. this.groupBox10.TabStop = false;
  132. //
  133. // button8
  134. //
  135. this.button8.BackColor = System.Drawing.SystemColors.Control;
  136. this.button8.Location = new System.Drawing.Point(107, 42);
  137. this.button8.Name = "button8";
  138. this.button8.Size = new System.Drawing.Size(95, 26);
  139. this.button8.TabIndex = 13;
  140. this.button8.UseVisualStyleBackColor = false;
  141. this.button8.Click += new System.EventHandler(this.button8_Click);
  142. //
  143. // button6_0
  144. //
  145. this.button6_0.BackColor = System.Drawing.SystemColors.Control;
  146. this.button6_0.Location = new System.Drawing.Point(6, 43);
  147. this.button6_0.Name = "button6_0";
  148. this.button6_0.Size = new System.Drawing.Size(95, 26);
  149. this.button6_0.TabIndex = 12;
  150. this.button6_0.UseVisualStyleBackColor = false;
  151. this.button6_0.Click += new System.EventHandler(this.button6_0_Click);
  152. //
  153. // button10
  154. //
  155. this.button10.BackColor = System.Drawing.SystemColors.Control;
  156. this.button10.Location = new System.Drawing.Point(107, 15);
  157. this.button10.Name = "button10";
  158. this.button10.Size = new System.Drawing.Size(95, 26);
  159. this.button10.TabIndex = 11;
  160. this.button10.UseVisualStyleBackColor = false;
  161. this.button10.Click += new System.EventHandler(this.button10_Click);
  162. //
  163. // button7_0
  164. //
  165. this.button7_0.BackColor = System.Drawing.SystemColors.Control;
  166. this.button7_0.Location = new System.Drawing.Point(6, 15);
  167. this.button7_0.Name = "button7_0";
  168. this.button7_0.Size = new System.Drawing.Size(95, 26);
  169. this.button7_0.TabIndex = 8;
  170. this.button7_0.UseVisualStyleBackColor = false;
  171. this.button7_0.Click += new System.EventHandler(this.button7_0_Click);
  172. //
  173. // groupBox11
  174. //
  175. this.groupBox11.Controls.Add(this.checkBox5_0);
  176. this.groupBox11.Controls.Add(this.checkBox4);
  177. this.groupBox11.Controls.Add(this.checkBox3_0);
  178. this.groupBox11.Location = new System.Drawing.Point(393, 370);
  179. this.groupBox11.Name = "groupBox11";
  180. this.groupBox11.Size = new System.Drawing.Size(142, 74);
  181. this.groupBox11.TabIndex = 39;
  182. this.groupBox11.TabStop = false;
  183. //
  184. // checkBox5_0
  185. //
  186. this.checkBox5_0.AutoSize = true;
  187. this.checkBox5_0.Checked = true;
  188. this.checkBox5_0.CheckState = System.Windows.Forms.CheckState.Checked;
  189. this.checkBox5_0.Location = new System.Drawing.Point(15, 53);
  190. this.checkBox5_0.Name = "checkBox5_0";
  191. this.checkBox5_0.Size = new System.Drawing.Size(72, 16);
  192. this.checkBox5_0.TabIndex = 2;
  193. this.checkBox5_0.UseVisualStyleBackColor = true;
  194. this.checkBox5_0.CheckedChanged += new System.EventHandler(this.checkBox5_0_CheckedChanged);
  195. //
  196. // checkBox4
  197. //
  198. this.checkBox4.AutoSize = true;
  199. this.checkBox4.Checked = true;
  200. this.checkBox4.CheckState = System.Windows.Forms.CheckState.Checked;
  201. this.checkBox4.Location = new System.Drawing.Point(15, 35);
  202. this.checkBox4.Name = "checkBox4";
  203. this.checkBox4.Size = new System.Drawing.Size(72, 16);
  204. this.checkBox4.TabIndex = 1;
  205. this.checkBox4.UseVisualStyleBackColor = true;
  206. this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged);
  207. //
  208. // checkBox3_0
  209. //
  210. this.checkBox3_0.AutoSize = true;
  211. this.checkBox3_0.Checked = true;
  212. this.checkBox3_0.CheckState = System.Windows.Forms.CheckState.Checked;
  213. this.checkBox3_0.Location = new System.Drawing.Point(15, 17);
  214. this.checkBox3_0.Name = "checkBox3_0";
  215. this.checkBox3_0.Size = new System.Drawing.Size(72, 16);
  216. this.checkBox3_0.TabIndex = 0;
  217. this.checkBox3_0.UseVisualStyleBackColor = true;
  218. this.checkBox3_0.CheckedChanged += new System.EventHandler(this.checkBox3_0_CheckedChanged);
  219. this.dataGridView_Total.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
  220. this.ColumnTotal3,
  221. this.ColumnTotal4,
  222. this.ColumnTotal5,
  223. this.ColumnTotal6});
  224. //
  225. // ColumnTotal1
  226. //
  227. this.ColumnTotal1.Name = "ColumnTotal1";
  228. this.ColumnTotal1.ReadOnly = true;
  229. //
  230. // ColumnTotal2
  231. //
  232. this.ColumnTotal2.Name = "ColumnTotal2";
  233. this.ColumnTotal2.ReadOnly = true;
  234. //
  235. // ColumnTotal3
  236. //
  237. this.ColumnTotal3.Name = "ColumnTotal3";
  238. this.ColumnTotal3.ReadOnly = true;
  239. //
  240. // ColumnTotal4
  241. //
  242. this.ColumnTotal4.Name = "ColumnTotal4";
  243. this.ColumnTotal4.ReadOnly = true;
  244. //
  245. // ColumnTotal5
  246. //
  247. this.ColumnTotal5.Name = "ColumnTotal5";
  248. this.ColumnTotal5.ReadOnly = true;
  249. //
  250. // ColumnTotal6
  251. //
  252. this.ColumnTotal6.Name = "ColumnTotal6";
  253. this.ColumnTotal6.ReadOnly = true;
  254. this.dataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
  255. this.Column1,
  256. this.Column2,
  257. this.Column3,
  258. this.Column4,
  259. this.Column5,
  260. this.Column6});
  261. //
  262. // Column1
  263. //
  264. this.Column1.Name = "Column1";
  265. this.Column1.ReadOnly = true;
  266. //
  267. // Column2
  268. //
  269. this.Column2.Name = "Column2";
  270. this.Column2.ReadOnly = true;
  271. //
  272. // Column3
  273. //
  274. this.Column3.Name = "Graisize";
  275. this.Column3.ReadOnly = true;
  276. //
  277. // Column4
  278. //
  279. this.Column4.Name = "Grainnumber";
  280. this.Column4.ReadOnly = true;
  281. //
  282. // Column5
  283. //
  284. this.Column5.Name = "Grainintercept";
  285. this.Column5.ReadOnly = true;
  286. //
  287. // Column6
  288. //
  289. this.Column6.Name = "Graingrade";
  290. this.Column6.ReadOnly = true;
  291. //
  292. // MethodCutOffDialog
  293. //
  294. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  295. this.ClientSize = new System.Drawing.Size(1127, 810);
  296. this.Controls.Add(this.groupBox10);
  297. this.Controls.Add(this.groupBox11);
  298. this.Name = "MethodCutOffDialog";
  299. this.Load += new System.EventHandler(this.MethodCutOffDialog_Load);
  300. this.Controls.SetChildIndex(this.groupBox11, 0);
  301. this.Controls.SetChildIndex(this.groupBox10, 0);
  302. this.Controls.SetChildIndex(this.groupBox6groupBox_analysisResult2, 0);
  303. this.Controls.SetChildIndex(this.groupBox_img, 0);
  304. this.Controls.SetChildIndex(this.groupBox_review, 0);
  305. this.Controls.SetChildIndex(this.groupBox_analysisResult1, 0);
  306. this.Controls.SetChildIndex(this.groupBox_report, 0);
  307. this.groupBox_analysisResult1.ResumeLayout(false);
  308. this.groupBox10.ResumeLayout(false);
  309. this.groupBox11.ResumeLayout(false);
  310. this.groupBox11.PerformLayout();
  311. this.ResumeLayout(false);
  312. }
  313. #endregion 初始化组件
  314. #region 需继承方法
  315. /// <summary>
  316. /// 是否显示晶界
  317. /// </summary>
  318. /// <returns></returns>
  319. protected override Boolean ShowGrainBoundryChecked()
  320. {
  321. return checkBox3_0.Checked;
  322. }
  323. //是否绘制辅助线
  324. protected override bool showGridChecked()
  325. {
  326. return checkBox4.Checked;
  327. }
  328. //是否绘制截点
  329. protected override bool drawGuidePoints()
  330. {
  331. return (matOrg != null && this.checkBox5_0.Checked);
  332. }
  333. //是否显示截点
  334. protected override Boolean drawDisplaySections()//##1
  335. {
  336. return this.checkBox5_0.Checked;
  337. }
  338. //辅助线类型
  339. protected override string[] getTypeNames()
  340. {
  341. return new string[] {
  342. PdnResources.GetString("Menu.Three-circleauxiliaryline.text")};
  343. }
  344. protected override string getTemplateName()
  345. {
  346. return "Template.Manager.item3.GrainSizeCutOff4335Method";
  347. }
  348. protected override string getProjectEngineeringName()
  349. {
  350. return "Menu.DedicatedAnalysis.BlackMetal.GrainSize.Text";
  351. }
  352. protected override string getModelName()
  353. {
  354. return "GrainGBT4335SizeGuideStyleModel.xml";//#####################################// "GrainSizeGuideStyleModel.xml";
  355. }
  356. protected override void SubclassInitialize()
  357. {
  358. InitializeComponent();
  359. DetailListNotDoubleIndex.Add(0);
  360. DetailListNotDoubleIndex.Add(1);
  361. InitializeLanguageText();
  362. }
  363. #endregion
  364. protected override void refreshWhileImgChanged()
  365. {
  366. object ShowGrainBoundry;
  367. if (GetParamValue1(ParamKey_displaygrainboundaries, out ShowGrainBoundry))//显示晶界
  368. this.checkBox3_0.Checked = (bool)ShowGrainBoundry;
  369. if (GetParamValue1(ParamKey_displaygrid, out ShowGrainBoundry))//显示网格
  370. this.checkBox4.Checked = (bool)ShowGrainBoundry;
  371. if (GetParamValue1(ParamKey_displaysections, out ShowGrainBoundry))//显示截点
  372. this.checkBox5_0.Checked = (bool)ShowGrainBoundry;
  373. }
  374. private void MethodCutOffDialog_Load(object sender, EventArgs e)
  375. {
  376. object ShowGrainBoundry;
  377. if (GetParamValue1(ParamKey_displaygrainboundaries, out ShowGrainBoundry))//显示晶界
  378. this.checkBox3_0.Checked = (bool)ShowGrainBoundry;
  379. if (GetParamValue1(ParamKey_displaygrid, out ShowGrainBoundry))//显示网格
  380. this.checkBox4.Checked = (bool)ShowGrainBoundry;
  381. if (GetParamValue1(ParamKey_displaysections, out ShowGrainBoundry))//显示截点
  382. this.checkBox5_0.Checked = (bool)ShowGrainBoundry;
  383. //this.groupBox_img.Size = new System.Drawing.Size(158, 722);
  384. //this.groupBox_review.Size = new System.Drawing.Size(575, 722);
  385. //this.groupBox_analysisResult1.Location = new System.Drawing.Point(12, 800);
  386. //this.groupBox6groupBox_analysisResult2.Location = new System.Drawing.Point(242, 800);
  387. //this.groupBox_report.Location = new System.Drawing.Point(974, 800);
  388. }
  389. /// <summary>
  390. /// 是否显示网格
  391. /// </summary>
  392. /// <param name="sender"></param>
  393. /// <param name="e"></param>
  394. private void checkBox4_CheckedChanged(object sender, EventArgs e)
  395. {
  396. this.documentWorkspace.Refresh();
  397. }
  398. /// <summary>
  399. /// 是否显示截点
  400. /// </summary>
  401. /// <param name="sender"></param>
  402. /// <param name="e"></param>
  403. private void checkBox5_0_CheckedChanged(object sender, EventArgs e)
  404. {
  405. if (!this.checkBox4.Checked)
  406. MessageBox.Show(PdnResources.GetString("Menu.Nogrid.text")+"!");
  407. this.documentWorkspace.Refresh();
  408. }
  409. /// <summary>
  410. /// 是否显示晶界
  411. /// </summary>
  412. /// <param name="sender"></param>
  413. /// <param name="e"></param>
  414. private void checkBox3_0_CheckedChanged(object sender, EventArgs e)
  415. {
  416. if (!bcOriginChecked() && getGrainBoundryChecked() && checkBox3_0.Checked)
  417. {
  418. this.documentWorkspace.PhaseModels[1].choise = true;
  419. }
  420. else
  421. {
  422. this.documentWorkspace.PhaseModels[1].choise = false;
  423. }
  424. this.documentWorkspace.Refresh();
  425. }
  426. /// <summary>
  427. /// 设置截点样式
  428. /// </summary>
  429. /// <param name="sender"></param>
  430. /// <param name="e"></param>
  431. private void button10_Click(object sender, EventArgs e)
  432. {
  433. ShowGrainSurveyPointStyleSettingDialog();
  434. }
  435. /// <summary>
  436. /// 鼠标按下
  437. /// </summary>
  438. /// <param name="drawArea"></param>
  439. /// <param name="e"></param>
  440. protected override void OnMouseDown(object sender, MouseEventArgs e)
  441. {
  442. if (this.documentWorkspace.CompositionSurface == null)
  443. return;
  444. // 换算后的点
  445. PointF point1 = documentWorkspace.GetScalePoint(e.Location);
  446. if (point1.X <= this.documentWorkspace.CompositionSurface.Width
  447. && point1.X >= 0
  448. && point1.Y >= 0
  449. && point1.Y <= this.documentWorkspace.CompositionSurface.Height)
  450. {
  451. RectangleF rectangleF;
  452. // 复合辅助线
  453. int add = GSSClass.GuideClass.getAddOfRStyle(point1, this.comboBox1.SelectedItem, out rectangleF);
  454. if (add == 0 && GSSClass.styleClass.PointKb > 0)
  455. rectangleF = GSSClass.GuideClass.guideModel.RectangleFLine;
  456. //手动添加截点
  457. if (this.documentWorkspace.ActiveTool == Annotation.Enum.DrawToolType.InclusionNoEffect && GSSClass.styleClass.OnMouseDownNext(point1, sender, e))
  458. GSSClass.styleClass.OnMouseDownFirst(point1, rectangleF, GSSClass.standardModel.linePointList, e);
  459. }
  460. if (GSSClass.styleClass.PointKb == 0)
  461. {
  462. //辅助线缩放
  463. GSSClass.GuideClass.OnMouseDown(point1, sender, e);
  464. //辅助线移动
  465. base.OnMouseDown(sender, e);//##
  466. }
  467. ////手动删除截点或取消添加截点
  468. //GSSClass.styleClass.OnMouseDownNext(point1, sender, e);
  469. }
  470. private void AllShow()
  471. {
  472. this.dataGridView2.Rows.Clear();
  473. for (int i = 0; i < this.dataTables.Count; i++)
  474. {
  475. DataGridViewRow dgvr = new DataGridViewRow();
  476. dgvr.Tag = this.dataTables[i].TableName;
  477. foreach (DataGridViewColumn Column in this.dataGridView2.Columns)
  478. {
  479. dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
  480. }
  481. for (int c = 0; c < this.dataTables[i].Columns.Count; c++)
  482. {
  483. //if (c > 2 && c < 4)
  484. // dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.dataTables[i].Rows[0][c]), Convert.ToInt32(this.numericUpDown1_0.Value)).ToString();
  485. //else
  486. dgvr.Cells[c].Value = this.dataTables[i].Rows[0][c].ToString();
  487. }
  488. this.dataGridView2.Rows.Add(dgvr);
  489. }
  490. }
  491. private void button6_0_Click(object sender, EventArgs e)
  492. {
  493. if (this.matOrg != null)
  494. {
  495. //MessageBox.Show(PdnResources.GetString("Menu.ftbuttontoaddainterceptadd.Text")+"!");
  496. GSSClass.styleClass.PointKb = 1;
  497. }
  498. else
  499. {
  500. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
  501. }
  502. }
  503. /// <summary>
  504. /// 1截点添加
  505. /// </summary>
  506. /// <param name="sender"></param>
  507. /// <param name="e"></param>
  508. private void button7_0_Click(object sender, EventArgs e)
  509. {
  510. if (this.matOrg != null)
  511. {
  512. //MessageBox.Show(PdnResources.GetString("Menu.ftbuttontoaddainterceptadd.Text")+"!");
  513. GSSClass.styleClass.PointKb = 2;
  514. }
  515. else
  516. {
  517. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
  518. }
  519. }
  520. private void button8_Click(object sender, EventArgs e)
  521. {
  522. if (this.matOrg != null)
  523. {
  524. //MessageBox.Show(PdnResources.GetString("Menu.ftbuttontoaddainterceptadd.Text")+"!");
  525. GSSClass.styleClass.PointKb = 3;
  526. }
  527. else
  528. {
  529. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
  530. }
  531. }
  532. }
  533. }