MethodPDialog.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. using PaintDotNet.Base.DedicatedAnalysis.Inclusions;
  2. using PaintDotNet.Base.DedicatedAnalysis.Inclusions.Standard.EN10247_2007.TypesOfAssessment;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. namespace PaintDotNet.DedicatedAnalysis.Inclusions.EN10247_2007
  13. {
  14. internal class MethodPDialog : InclusionsStandardDialog
  15. {
  16. #region 组件
  17. private RadioButton radioButton_DarkGray;
  18. private RadioButton radioButton_Gray;
  19. private RadioButton radioButton_Colored;
  20. private RadioButton radioButton_Black;
  21. private Panel panel_displaySetting_EA;
  22. private Button label_displaySetting_EA;
  23. private Button label_displaySetting_EB;
  24. private Panel panel_displaySetting_EB;
  25. private Button label_displaySetting_EC;
  26. private Panel panel_displaySetting_EC;
  27. private Button label_displaySetting_ED;
  28. private Panel panel_displaySetting_ED;
  29. private Button label_displaySetting_EAD;
  30. private Panel panel_displaySetting_EAD;
  31. private Button label_displaySetting_EF;
  32. private Panel panel_displaySetting_EF;
  33. #endregion 组件
  34. #region 构造函数
  35. public MethodPDialog(AppWorkspace appWorkspace, string dialogText, PdnMenuItem menuItem) : base(appWorkspace, dialogText, menuItem)
  36. {
  37. }
  38. #endregion 构造函数
  39. #region 初始化组件
  40. private void InitializeComponent()
  41. {
  42. this.radioButton_DarkGray = new System.Windows.Forms.RadioButton();
  43. this.radioButton_Gray = new System.Windows.Forms.RadioButton();
  44. this.radioButton_Colored = new System.Windows.Forms.RadioButton();
  45. this.radioButton_Black = new System.Windows.Forms.RadioButton();
  46. this.label_displaySetting_EAD = new System.Windows.Forms.Button();
  47. this.panel_displaySetting_EA = new System.Windows.Forms.Panel();
  48. this.panel_displaySetting_EC = new System.Windows.Forms.Panel();
  49. this.label_displaySetting_ED = new System.Windows.Forms.Button();
  50. this.panel_displaySetting_EB = new System.Windows.Forms.Panel();
  51. this.panel_displaySetting_EF = new System.Windows.Forms.Panel();
  52. this.label_displaySetting_EF = new System.Windows.Forms.Button();
  53. this.panel_displaySetting_ED = new System.Windows.Forms.Panel();
  54. this.label_displaySetting_EC = new System.Windows.Forms.Button();
  55. this.panel_displaySetting_EAD = new System.Windows.Forms.Panel();
  56. this.label_displaySetting_EA = new System.Windows.Forms.Button();
  57. this.label_displaySetting_EB = new System.Windows.Forms.Button();
  58. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).BeginInit();
  59. this.groupBox_colorSetting.SuspendLayout();
  60. this.groupBox_displaySetting.SuspendLayout();
  61. this.SuspendLayout();
  62. //
  63. // numericUpDown_lwRatioLimit
  64. //
  65. this.numericUpDown_lwRatioLimit.Value = new decimal(new int[] {
  66. 13,
  67. 0,
  68. 0,
  69. 65536});
  70. //
  71. // groupBox_colorSetting
  72. //
  73. this.groupBox_colorSetting.Controls.Add(this.radioButton_DarkGray);
  74. this.groupBox_colorSetting.Controls.Add(this.radioButton_Gray);
  75. this.groupBox_colorSetting.Controls.Add(this.radioButton_Colored);
  76. this.groupBox_colorSetting.Controls.Add(this.radioButton_Black);
  77. this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_Black, 0);
  78. this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_Colored, 0);
  79. this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_Gray, 0);
  80. this.groupBox_colorSetting.Controls.SetChildIndex(this.radioButton_DarkGray, 0);
  81. //
  82. // groupBox_displaySetting
  83. //
  84. this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_EAD);
  85. this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_EA);
  86. this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_EC);
  87. this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_ED);
  88. this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_EB);
  89. this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_EF);
  90. this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_EF);
  91. this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_ED);
  92. this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_EC);
  93. this.groupBox_displaySetting.Controls.Add(this.panel_displaySetting_EAD);
  94. this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_EA);
  95. this.groupBox_displaySetting.Controls.Add(this.label_displaySetting_EB);
  96. //
  97. // radioButton_DarkGray
  98. //
  99. this.radioButton_DarkGray.AutoSize = true;
  100. this.radioButton_DarkGray.Location = new System.Drawing.Point(200, 20);
  101. this.radioButton_DarkGray.Name = "radioButton_DarkGray";
  102. this.radioButton_DarkGray.Size = new System.Drawing.Size(59, 16);
  103. this.radioButton_DarkGray.TabIndex = 38;
  104. this.radioButton_DarkGray.TabStop = true;
  105. this.radioButton_DarkGray.Text = PdnResources.GetString("Menu.Darkgray.text");
  106. this.radioButton_DarkGray.UseVisualStyleBackColor = true;
  107. //
  108. // radioButton_Gray
  109. //
  110. this.radioButton_Gray.AutoSize = true;
  111. this.radioButton_Gray.Location = new System.Drawing.Point(145, 20);
  112. this.radioButton_Gray.Name = "radioButton_Gray";
  113. this.radioButton_Gray.Size = new System.Drawing.Size(47, 16);
  114. this.radioButton_Gray.TabIndex = 37;
  115. this.radioButton_Gray.TabStop = true;
  116. this.radioButton_Gray.Text = PdnResources.GetString("Menu.gray.text");
  117. this.radioButton_Gray.UseVisualStyleBackColor = true;
  118. //
  119. // radioButton_Colored
  120. //
  121. this.radioButton_Colored.AutoSize = true;
  122. this.radioButton_Colored.Location = new System.Drawing.Point(60, 20);
  123. this.radioButton_Colored.Name = "radioButton_Colored";
  124. this.radioButton_Colored.Size = new System.Drawing.Size(47, 16);
  125. this.radioButton_Colored.TabIndex = 36;
  126. this.radioButton_Colored.TabStop = true;
  127. this.radioButton_Colored.Text = PdnResources.GetString("Menu.Dedicatedanalysis.blackmetal.non-ferrous.text");
  128. this.radioButton_Colored.UseVisualStyleBackColor = true;
  129. //
  130. // radioButton_Black
  131. //
  132. this.radioButton_Black.AutoSize = true;
  133. this.radioButton_Black.Location = new System.Drawing.Point(7, 20);
  134. this.radioButton_Black.Name = "radioButton_Black";
  135. this.radioButton_Black.Size = new System.Drawing.Size(47, 16);
  136. this.radioButton_Black.TabIndex = 35;
  137. this.radioButton_Black.TabStop = true;
  138. this.radioButton_Black.Text = PdnResources.GetString("Menu.black.text");
  139. this.radioButton_Black.UseVisualStyleBackColor = true;
  140. //
  141. // label_displaySetting_EAD
  142. //
  143. this.label_displaySetting_EAD.AutoSize = true;
  144. this.label_displaySetting_EAD.Location = new System.Drawing.Point(233, 25);
  145. this.label_displaySetting_EAD.Name = "label_displaySetting_EAD";
  146. this.label_displaySetting_EAD.Size = new System.Drawing.Size(33, 22);
  147. this.label_displaySetting_EAD.TabIndex = 42;
  148. this.label_displaySetting_EAD.Text = "EAD";
  149. //
  150. // panel_displaySetting_EA
  151. //
  152. this.panel_displaySetting_EA.Location = new System.Drawing.Point(36, 25);
  153. this.panel_displaySetting_EA.Name = "panel_displaySetting_EA";
  154. this.panel_displaySetting_EA.Size = new System.Drawing.Size(21, 21);
  155. this.panel_displaySetting_EA.TabIndex = 34;
  156. //
  157. // panel_displaySetting_EC
  158. //
  159. this.panel_displaySetting_EC.BackColor = System.Drawing.SystemColors.Control;
  160. this.panel_displaySetting_EC.Location = new System.Drawing.Point(146, 25);
  161. this.panel_displaySetting_EC.Name = "panel_displaySetting_EC";
  162. this.panel_displaySetting_EC.Size = new System.Drawing.Size(21, 21);
  163. this.panel_displaySetting_EC.TabIndex = 35;
  164. //
  165. // label_displaySetting_ED
  166. //
  167. this.label_displaySetting_ED.AutoSize = true;
  168. this.label_displaySetting_ED.Location = new System.Drawing.Point(173, 25);
  169. this.label_displaySetting_ED.Name = "label_displaySetting_ED";
  170. this.label_displaySetting_ED.Size = new System.Drawing.Size(27, 22);
  171. this.label_displaySetting_ED.TabIndex = 41;
  172. this.label_displaySetting_ED.Text = "ED";
  173. //
  174. // panel_displaySetting_EB
  175. //
  176. this.panel_displaySetting_EB.BackColor = System.Drawing.SystemColors.Control;
  177. this.panel_displaySetting_EB.Location = new System.Drawing.Point(88, 25);
  178. this.panel_displaySetting_EB.Name = "panel_displaySetting_EB";
  179. this.panel_displaySetting_EB.Size = new System.Drawing.Size(21, 21);
  180. this.panel_displaySetting_EB.TabIndex = 33;
  181. //
  182. // panel_displaySetting_EF
  183. //
  184. this.panel_displaySetting_EF.BackColor = System.Drawing.SystemColors.Control;
  185. this.panel_displaySetting_EF.Location = new System.Drawing.Point(332, 25);
  186. this.panel_displaySetting_EF.Name = "panel_displaySetting_EF";
  187. this.panel_displaySetting_EF.Size = new System.Drawing.Size(21, 21);
  188. this.panel_displaySetting_EF.TabIndex = 33;
  189. //
  190. // label_displaySetting_EF
  191. //
  192. this.label_displaySetting_EF.AutoSize = true;
  193. this.label_displaySetting_EF.Location = new System.Drawing.Point(299, 25);
  194. this.label_displaySetting_EF.Name = "label_displaySetting_EF";
  195. this.label_displaySetting_EF.Size = new System.Drawing.Size(27, 22);
  196. this.label_displaySetting_EF.TabIndex = 45;
  197. this.label_displaySetting_EF.Text = "EF";
  198. //
  199. // panel_displaySetting_ED
  200. //
  201. this.panel_displaySetting_ED.BackColor = System.Drawing.SystemColors.Control;
  202. this.panel_displaySetting_ED.Location = new System.Drawing.Point(206, 25);
  203. this.panel_displaySetting_ED.Name = "panel_displaySetting_ED";
  204. this.panel_displaySetting_ED.Size = new System.Drawing.Size(21, 21);
  205. this.panel_displaySetting_ED.TabIndex = 36;
  206. //
  207. // label_displaySetting_EC
  208. //
  209. this.label_displaySetting_EC.AutoSize = true;
  210. this.label_displaySetting_EC.Location = new System.Drawing.Point(113, 25);
  211. this.label_displaySetting_EC.Name = "label_displaySetting_EC";
  212. this.label_displaySetting_EC.Size = new System.Drawing.Size(27, 22);
  213. this.label_displaySetting_EC.TabIndex = 40;
  214. this.label_displaySetting_EC.Text = "EC";
  215. //
  216. // panel_displaySetting_EAD
  217. //
  218. this.panel_displaySetting_EAD.BackColor = System.Drawing.SystemColors.Control;
  219. this.panel_displaySetting_EAD.Location = new System.Drawing.Point(272, 25);
  220. this.panel_displaySetting_EAD.Name = "panel_displaySetting_EAD";
  221. this.panel_displaySetting_EAD.Size = new System.Drawing.Size(21, 21);
  222. this.panel_displaySetting_EAD.TabIndex = 37;
  223. //
  224. // label_displaySetting_EA
  225. //
  226. this.label_displaySetting_EA.AutoSize = true;
  227. this.label_displaySetting_EA.Location = new System.Drawing.Point(6, 25);
  228. this.label_displaySetting_EA.Name = "label_displaySetting_EA";
  229. this.label_displaySetting_EA.Size = new System.Drawing.Size(27, 22);
  230. this.label_displaySetting_EA.TabIndex = 38;
  231. this.label_displaySetting_EA.Text = "EA";
  232. //
  233. // label_displaySetting_EB
  234. //
  235. this.label_displaySetting_EB.AutoSize = true;
  236. this.label_displaySetting_EB.Location = new System.Drawing.Point(60, 25);
  237. this.label_displaySetting_EB.Name = "label_displaySetting_EB";
  238. this.label_displaySetting_EB.Size = new System.Drawing.Size(27, 22);
  239. this.label_displaySetting_EB.TabIndex = 39;
  240. this.label_displaySetting_EB.Text = "EB";
  241. //
  242. // MethodPDialog
  243. //
  244. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  245. this.ClientSize = new System.Drawing.Size(1177, 908);
  246. this.Name = "MethodPDialog";
  247. this.Text = "EN10247_2007_MethodP("+ PdnResources.GetString("Menu.DedicatedAnalysis.BlackMetal.Inclusion.Text")+ ")";
  248. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).EndInit();
  249. this.groupBox_colorSetting.ResumeLayout(false);
  250. this.groupBox_colorSetting.PerformLayout();
  251. this.groupBox_displaySetting.ResumeLayout(false);
  252. this.groupBox_displaySetting.PerformLayout();
  253. this.ResumeLayout(false);
  254. }
  255. #endregion 初始化组件
  256. #region 需继承方法
  257. protected override void SubclassInitialize()
  258. {
  259. InitializeComponent();
  260. }
  261. protected override MethodOfAssessment getMethodOfAssessment()
  262. {
  263. return new MethodP(this.imgPxPerUnit);
  264. }
  265. protected override void initColorSetting()
  266. {
  267. this.radioButton_Black.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  268. this.radioButton_Gray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  269. this.radioButton_Colored.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  270. this.radioButton_DarkGray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  271. }
  272. protected override void initDisplaySetting()
  273. {
  274. this.panel_displaySetting_EA.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["EA"].showColor);
  275. this.panel_displaySetting_EB.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["EB"].showColor);
  276. this.panel_displaySetting_EC.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["EC"].showColor);
  277. this.panel_displaySetting_ED.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["ED"].showColor);
  278. this.panel_displaySetting_EAD.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["EAD"].showColor);
  279. this.panel_displaySetting_EF.BackColor = Color.FromArgb(MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.typeDics["EF"].showColor);
  280. }
  281. protected override void getInclusionParameters()
  282. {
  283. switch (whichChecked)
  284. {
  285. case 0:
  286. radioButton_Black.Checked = true;
  287. this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Black"];
  288. break;
  289. case 1:
  290. radioButton_Black.Checked = true;
  291. this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Black"];
  292. break;
  293. case 2:
  294. radioButton_Colored.Checked = true;
  295. this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Colored"];
  296. break;
  297. case 3:
  298. radioButton_Gray.Checked = true;
  299. this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["Gray"];
  300. break;
  301. case 4:
  302. radioButton_DarkGray.Checked = true;
  303. this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions["DarkGray"];
  304. break;
  305. }
  306. }
  307. protected override void saveInclusionParameters()
  308. {
  309. if (radioButton_Black.Checked)
  310. {
  311. thisParameters.parameter3 = 1;
  312. }
  313. else if (radioButton_Colored.Checked)
  314. {
  315. thisParameters.parameter3 = 2;
  316. }
  317. else if (radioButton_Gray.Checked)
  318. {
  319. thisParameters.parameter3 = 3;
  320. }
  321. else if (radioButton_DarkGray.Checked)
  322. {
  323. thisParameters.parameter3 = 4;
  324. }
  325. }
  326. protected override void getOldCheck()
  327. {
  328. this.radioButton_Black.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);
  329. this.radioButton_Gray.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);
  330. this.radioButton_Colored.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);
  331. this.radioButton_DarkGray.CheckedChanged -= new System.EventHandler(colorSettingRadioButton);
  332. switch (colorName)
  333. {
  334. case "Black":
  335. radioButton_Black.Checked = true;
  336. break;
  337. case "Gray":
  338. radioButton_Gray.Checked = true;
  339. break;
  340. case "DarkGray":
  341. radioButton_DarkGray.Checked = true;
  342. break;
  343. case "Colored":
  344. radioButton_Colored.Checked = true;
  345. break;
  346. }
  347. this.radioButton_Black.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  348. this.radioButton_Gray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  349. this.radioButton_Colored.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  350. this.radioButton_DarkGray.CheckedChanged += new System.EventHandler(colorSettingRadioButton);
  351. }
  352. #endregion 需继承方法
  353. }
  354. }