ArbitrationLawPointStyleDialog.cs 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856
  1. using PaintDotNet.Base.CommTool;
  2. using PaintDotNet.Base.SettingModel;
  3. using System;
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.Data;
  8. using System.Drawing;
  9. using System.IO;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using System.Windows.Forms;
  14. namespace PaintDotNet.DedicatedAnalysis.GrainSize.GBT6394_2017
  15. {
  16. public partial class ArbitrationLawPointStyleDialog : Form
  17. {//参数保存
  18. #region 控件
  19. private GroupBox groupBox1;
  20. private Button button2;
  21. private GroupBox groupBox2;
  22. private Label label6;
  23. private Label label5;
  24. private Label label4;
  25. private Label label3;
  26. private Label label2;
  27. private Label label1;
  28. private Panel panel1;
  29. private RadioButton radioButton1;
  30. private RadioButton radioButton2;
  31. private Panel panel2;
  32. private RadioButton radioButton3;
  33. private RadioButton radioButton4;
  34. private Panel panel3;
  35. private GroupBox groupBox3;
  36. private Panel panel4;
  37. private Panel panel5;
  38. private RadioButton radioButton5;
  39. private RadioButton radioButton6;
  40. private Panel panel6;
  41. private RadioButton radioButton7;
  42. private RadioButton radioButton8;
  43. private Label label7;
  44. private Label label8;
  45. private Label label9;
  46. private Label label10;
  47. private Label label11;
  48. private Label label12;
  49. private Button button1;
  50. #endregion
  51. /// <summary>
  52. /// 调色板
  53. /// </summary>
  54. PaintDotNet.ColorsForm colorsForm1;
  55. /// <summary>
  56. /// 调色板
  57. /// </summary>
  58. PaintDotNet.ColorsForm colorsForm2;
  59. private TrackBar trackBar9;
  60. private TrackBar trackBar2;
  61. private TrackBar trackBar1;
  62. private TrackBar trackBar5;
  63. private TrackBar trackBar4;
  64. private TrackBar trackBar3;
  65. private TextBox textBox9;
  66. private TextBox textBox2;
  67. private TextBox textBox1;
  68. private TextBox textBox5;
  69. private TextBox textBox3;
  70. private TextBox textBox4;
  71. /// <summary>
  72. /// 调色板
  73. /// </summary>
  74. PaintDotNet.ColorsForm colorsForm3;
  75. public ArbitrationLawPointStyleDialog()
  76. {
  77. InitializeComponent();
  78. InitializeLanguageText();
  79. GetFromXml();
  80. //调色板
  81. this.colorsForm1 = new ColorsForm();
  82. this.colorsForm1.StartPosition = FormStartPosition.CenterScreen;
  83. this.colorsForm1.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  84. //调色板
  85. this.colorsForm2 = new ColorsForm();
  86. this.colorsForm2.StartPosition = FormStartPosition.CenterScreen;
  87. this.colorsForm2.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  88. //调色板
  89. this.colorsForm3 = new ColorsForm();
  90. this.colorsForm3.StartPosition = FormStartPosition.CenterScreen;
  91. this.colorsForm3.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  92. }
  93. #region 初始化
  94. private void InitializeLanguageText()
  95. {
  96. this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
  97. this.button2.Text = PdnResources.GetString("CommonAction.Save");
  98. this.button1.Text = PdnResources.GetString("Menu.File.Close.Text");
  99. this.groupBox2.Text = PdnResources.GetString("Menu.0.5sectionstyle.text");
  100. this.radioButton3.Text = PdnResources.GetString("Menu.Square.text");
  101. this.radioButton4.Text = PdnResources.GetString("Menu.circular.Text");
  102. this.radioButton2.Text = PdnResources.GetString("Menu.solid.text");
  103. this.radioButton1.Text = PdnResources.GetString("Menu.Hollow.text");
  104. this.label6.Text = PdnResources.GetString("Menu.shape.text") + ":";
  105. this.label5.Text = PdnResources.GetString("Menu.style.text") + ":";
  106. this.label4.Text = PdnResources.GetString("Menu.Intercepterror.text") + ":";
  107. this.label3.Text = PdnResources.GetString("Menu.Linewidth.text") + ":";
  108. this.label2.Text = PdnResources.GetString("Menu.size.text") + ":";
  109. this.label1.Text = PdnResources.GetString("Menu.color.text") + ":";
  110. this.groupBox3.Text = PdnResources.GetString("Menu.1sectionstyle.text");
  111. this.radioButton5.Text = PdnResources.GetString("Menu.Square.text");
  112. this.radioButton6.Text = PdnResources.GetString("Menu.circular.Text");
  113. this.radioButton7.Text = PdnResources.GetString("Menu.solid.text");
  114. this.radioButton8.Text = PdnResources.GetString("Menu.Hollow.text");
  115. this.label7.Text = PdnResources.GetString("Menu.shape.text") + ":";
  116. this.label8.Text = PdnResources.GetString("Menu.style.text") + ":";
  117. this.label9.Text = PdnResources.GetString("Menu.Intercepterror.text") + ":";
  118. this.label10.Text = PdnResources.GetString("Menu.Linewidth.text") + ":";
  119. this.label11.Text = PdnResources.GetString("Menu.size.text") + ":";
  120. this.label12.Text = PdnResources.GetString("Menu.color.text") + ":";
  121. this.Text = PdnResources.GetString("Menu.sectionsstylesettings.text");
  122. }
  123. private void InitializeComponent()
  124. {
  125. this.groupBox1 = new System.Windows.Forms.GroupBox();
  126. this.button2 = new System.Windows.Forms.Button();
  127. this.button1 = new System.Windows.Forms.Button();
  128. this.groupBox2 = new System.Windows.Forms.GroupBox();
  129. this.textBox9 = new System.Windows.Forms.TextBox();
  130. this.trackBar9 = new System.Windows.Forms.TrackBar();
  131. this.panel3 = new System.Windows.Forms.Panel();
  132. this.panel2 = new System.Windows.Forms.Panel();
  133. this.radioButton3 = new System.Windows.Forms.RadioButton();
  134. this.radioButton4 = new System.Windows.Forms.RadioButton();
  135. this.panel1 = new System.Windows.Forms.Panel();
  136. this.radioButton2 = new System.Windows.Forms.RadioButton();
  137. this.radioButton1 = new System.Windows.Forms.RadioButton();
  138. this.label6 = new System.Windows.Forms.Label();
  139. this.textBox2 = new System.Windows.Forms.TextBox();
  140. this.label5 = new System.Windows.Forms.Label();
  141. this.trackBar2 = new System.Windows.Forms.TrackBar();
  142. this.label4 = new System.Windows.Forms.Label();
  143. this.textBox1 = new System.Windows.Forms.TextBox();
  144. this.trackBar1 = new System.Windows.Forms.TrackBar();
  145. this.label3 = new System.Windows.Forms.Label();
  146. this.label2 = new System.Windows.Forms.Label();
  147. this.label1 = new System.Windows.Forms.Label();
  148. this.groupBox3 = new System.Windows.Forms.GroupBox();
  149. this.panel4 = new System.Windows.Forms.Panel();
  150. this.panel5 = new System.Windows.Forms.Panel();
  151. this.radioButton5 = new System.Windows.Forms.RadioButton();
  152. this.radioButton6 = new System.Windows.Forms.RadioButton();
  153. this.panel6 = new System.Windows.Forms.Panel();
  154. this.radioButton7 = new System.Windows.Forms.RadioButton();
  155. this.radioButton8 = new System.Windows.Forms.RadioButton();
  156. this.textBox5 = new System.Windows.Forms.TextBox();
  157. this.trackBar5 = new System.Windows.Forms.TrackBar();
  158. this.textBox3 = new System.Windows.Forms.TextBox();
  159. this.textBox4 = new System.Windows.Forms.TextBox();
  160. this.trackBar4 = new System.Windows.Forms.TrackBar();
  161. this.trackBar3 = new System.Windows.Forms.TrackBar();
  162. this.label7 = new System.Windows.Forms.Label();
  163. this.label8 = new System.Windows.Forms.Label();
  164. this.label9 = new System.Windows.Forms.Label();
  165. this.label10 = new System.Windows.Forms.Label();
  166. this.label11 = new System.Windows.Forms.Label();
  167. this.label12 = new System.Windows.Forms.Label();
  168. this.groupBox1.SuspendLayout();
  169. this.groupBox2.SuspendLayout();
  170. ((System.ComponentModel.ISupportInitialize)(this.trackBar9)).BeginInit();
  171. this.panel2.SuspendLayout();
  172. this.panel1.SuspendLayout();
  173. ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).BeginInit();
  174. ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
  175. this.groupBox3.SuspendLayout();
  176. this.panel5.SuspendLayout();
  177. this.panel6.SuspendLayout();
  178. ((System.ComponentModel.ISupportInitialize)(this.trackBar5)).BeginInit();
  179. ((System.ComponentModel.ISupportInitialize)(this.trackBar4)).BeginInit();
  180. ((System.ComponentModel.ISupportInitialize)(this.trackBar3)).BeginInit();
  181. this.SuspendLayout();
  182. //
  183. // groupBox1
  184. //
  185. this.groupBox1.Controls.Add(this.button2);
  186. this.groupBox1.Controls.Add(this.button1);
  187. this.groupBox1.Location = new System.Drawing.Point(12, 12);
  188. this.groupBox1.Name = "groupBox1";
  189. this.groupBox1.Size = new System.Drawing.Size(500, 54);
  190. this.groupBox1.TabIndex = 2;
  191. this.groupBox1.TabStop = false;
  192. //
  193. // button2
  194. //
  195. this.button2.Location = new System.Drawing.Point(414, 16);
  196. this.button2.Name = "button2";
  197. this.button2.Size = new System.Drawing.Size(70, 28);
  198. this.button2.TabIndex = 1;
  199. this.button2.UseVisualStyleBackColor = true;
  200. this.button2.Click += new System.EventHandler(this.button2_Click);
  201. //
  202. // button1
  203. //
  204. this.button1.Location = new System.Drawing.Point(325, 16);
  205. this.button1.Name = "button1";
  206. this.button1.Size = new System.Drawing.Size(70, 28);
  207. this.button1.TabIndex = 0;
  208. this.button1.UseVisualStyleBackColor = true;
  209. this.button1.Click += new System.EventHandler(this.button1_Click);
  210. //
  211. // groupBox2
  212. //
  213. this.groupBox2.Controls.Add(this.textBox9);
  214. this.groupBox2.Controls.Add(this.trackBar9);
  215. this.groupBox2.Controls.Add(this.panel3);
  216. this.groupBox2.Controls.Add(this.panel2);
  217. this.groupBox2.Controls.Add(this.panel1);
  218. this.groupBox2.Controls.Add(this.label6);
  219. this.groupBox2.Controls.Add(this.textBox2);
  220. this.groupBox2.Controls.Add(this.label5);
  221. this.groupBox2.Controls.Add(this.trackBar2);
  222. this.groupBox2.Controls.Add(this.label4);
  223. this.groupBox2.Controls.Add(this.textBox1);
  224. this.groupBox2.Controls.Add(this.trackBar1);
  225. this.groupBox2.Controls.Add(this.label3);
  226. this.groupBox2.Controls.Add(this.label2);
  227. this.groupBox2.Controls.Add(this.label1);
  228. this.groupBox2.Location = new System.Drawing.Point(12, 72);
  229. this.groupBox2.Name = "groupBox2";
  230. this.groupBox2.Size = new System.Drawing.Size(500, 120);
  231. this.groupBox2.TabIndex = 3;
  232. this.groupBox2.TabStop = false;
  233. //
  234. // textBox9
  235. //
  236. this.textBox9.Location = new System.Drawing.Point(129, 67);
  237. this.textBox9.Name = "textBox9";
  238. this.textBox9.Size = new System.Drawing.Size(31, 21);
  239. this.textBox9.TabIndex = 37;
  240. this.textBox9.TextChanged += new System.EventHandler(this.textBox9_TextChanged);
  241. //
  242. // trackBar9
  243. //
  244. this.trackBar9.LargeChange = 1;
  245. this.trackBar9.Location = new System.Drawing.Point(55, 68);
  246. this.trackBar9.Maximum = 500;
  247. this.trackBar9.Name = "trackBar9";
  248. this.trackBar9.Size = new System.Drawing.Size(78, 45);
  249. this.trackBar9.TabIndex = 37;
  250. this.trackBar9.TickStyle = System.Windows.Forms.TickStyle.None;
  251. this.trackBar9.Value = 1;
  252. this.trackBar9.ValueChanged += new System.EventHandler(this.trackBar9_ValueChanged);
  253. //
  254. // panel3
  255. //
  256. this.panel3.Location = new System.Drawing.Point(62, 24);
  257. this.panel3.Name = "panel3";
  258. this.panel3.Size = new System.Drawing.Size(102, 22);
  259. this.panel3.TabIndex = 25;
  260. this.panel3.Click += new System.EventHandler(this.panel3_Click);
  261. //
  262. // panel2
  263. //
  264. this.panel2.Controls.Add(this.radioButton3);
  265. this.panel2.Controls.Add(this.radioButton4);
  266. this.panel2.Location = new System.Drawing.Point(368, 64);
  267. this.panel2.Name = "panel2";
  268. this.panel2.Size = new System.Drawing.Size(115, 30);
  269. this.panel2.TabIndex = 24;
  270. //
  271. // radioButton3
  272. //
  273. this.radioButton3.AutoSize = true;
  274. this.radioButton3.Location = new System.Drawing.Point(62, 6);
  275. this.radioButton3.Name = "radioButton3";
  276. this.radioButton3.Size = new System.Drawing.Size(47, 16);
  277. this.radioButton3.TabIndex = 1;
  278. this.radioButton3.TabStop = true;
  279. this.radioButton3.UseVisualStyleBackColor = true;
  280. //
  281. // radioButton4
  282. //
  283. this.radioButton4.AutoSize = true;
  284. this.radioButton4.Location = new System.Drawing.Point(9, 6);
  285. this.radioButton4.Name = "radioButton4";
  286. this.radioButton4.Size = new System.Drawing.Size(47, 16);
  287. this.radioButton4.TabIndex = 0;
  288. this.radioButton4.TabStop = true;
  289. this.radioButton4.UseVisualStyleBackColor = true;
  290. //
  291. // panel1
  292. //
  293. this.panel1.Controls.Add(this.radioButton2);
  294. this.panel1.Controls.Add(this.radioButton1);
  295. this.panel1.Location = new System.Drawing.Point(368, 20);
  296. this.panel1.Name = "panel1";
  297. this.panel1.Size = new System.Drawing.Size(115, 30);
  298. this.panel1.TabIndex = 23;
  299. //
  300. // radioButton2
  301. //
  302. this.radioButton2.AutoSize = true;
  303. this.radioButton2.Location = new System.Drawing.Point(62, 6);
  304. this.radioButton2.Name = "radioButton2";
  305. this.radioButton2.Size = new System.Drawing.Size(47, 16);
  306. this.radioButton2.TabIndex = 1;
  307. this.radioButton2.TabStop = true;
  308. this.radioButton2.UseVisualStyleBackColor = true;
  309. //
  310. // radioButton1
  311. //
  312. this.radioButton1.AutoSize = true;
  313. this.radioButton1.Location = new System.Drawing.Point(9, 6);
  314. this.radioButton1.Name = "radioButton1";
  315. this.radioButton1.Size = new System.Drawing.Size(47, 16);
  316. this.radioButton1.TabIndex = 0;
  317. this.radioButton1.TabStop = true;
  318. this.radioButton1.UseVisualStyleBackColor = true;
  319. //
  320. // label6
  321. //
  322. this.label6.AutoSize = true;
  323. this.label6.Location = new System.Drawing.Point(332, 71);
  324. this.label6.Name = "label6";
  325. this.label6.Size = new System.Drawing.Size(41, 12);
  326. this.label6.TabIndex = 22;
  327. //
  328. // textBox2
  329. //
  330. this.textBox2.Location = new System.Drawing.Point(299, 68);
  331. this.textBox2.Name = "textBox2";
  332. this.textBox2.Size = new System.Drawing.Size(31, 21);
  333. this.textBox2.TabIndex = 30;
  334. this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
  335. //
  336. // label5
  337. //
  338. this.label5.AutoSize = true;
  339. this.label5.Location = new System.Drawing.Point(332, 28);
  340. this.label5.Name = "label5";
  341. this.label5.Size = new System.Drawing.Size(41, 12);
  342. this.label5.TabIndex = 21;
  343. //
  344. // trackBar2
  345. //
  346. this.trackBar2.LargeChange = 1;
  347. this.trackBar2.Location = new System.Drawing.Point(225, 68);
  348. this.trackBar2.Maximum = 500;
  349. this.trackBar2.Name = "trackBar2";
  350. this.trackBar2.Size = new System.Drawing.Size(78, 45);
  351. this.trackBar2.TabIndex = 30;
  352. this.trackBar2.TickStyle = System.Windows.Forms.TickStyle.None;
  353. this.trackBar2.Value = 1;
  354. this.trackBar2.ValueChanged += new System.EventHandler(this.trackBar2_ValueChanged);
  355. //
  356. // label4
  357. //
  358. this.label4.AutoSize = true;
  359. this.label4.Location = new System.Drawing.Point(170, 71);
  360. this.label4.Name = "label4";
  361. this.label4.Size = new System.Drawing.Size(65, 12);
  362. this.label4.TabIndex = 20;
  363. //
  364. // textBox1
  365. //
  366. this.textBox1.Location = new System.Drawing.Point(299, 24);
  367. this.textBox1.Name = "textBox1";
  368. this.textBox1.Size = new System.Drawing.Size(31, 21);
  369. this.textBox1.TabIndex = 29;
  370. this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
  371. //
  372. // trackBar1
  373. //
  374. this.trackBar1.LargeChange = 1;
  375. this.trackBar1.Location = new System.Drawing.Point(225, 24);
  376. this.trackBar1.Maximum = 500;
  377. this.trackBar1.Name = "trackBar1";
  378. this.trackBar1.Size = new System.Drawing.Size(78, 45);
  379. this.trackBar1.TabIndex = 29;
  380. this.trackBar1.TickStyle = System.Windows.Forms.TickStyle.None;
  381. this.trackBar1.Value = 1;
  382. this.trackBar1.ValueChanged += new System.EventHandler(this.trackBar1_ValueChanged);
  383. //
  384. // label3
  385. //
  386. this.label3.AutoSize = true;
  387. this.label3.Location = new System.Drawing.Point(194, 28);
  388. this.label3.Name = "label3";
  389. this.label3.Size = new System.Drawing.Size(41, 12);
  390. this.label3.TabIndex = 19;
  391. //
  392. // label2
  393. //
  394. this.label2.AutoSize = true;
  395. this.label2.Location = new System.Drawing.Point(23, 71);
  396. this.label2.Name = "label2";
  397. this.label2.Size = new System.Drawing.Size(41, 12);
  398. this.label2.TabIndex = 18;
  399. //
  400. // label1
  401. //
  402. this.label1.AutoSize = true;
  403. this.label1.Location = new System.Drawing.Point(23, 28);
  404. this.label1.Name = "label1";
  405. this.label1.Size = new System.Drawing.Size(41, 12);
  406. this.label1.TabIndex = 17;
  407. //
  408. // groupBox3
  409. //
  410. this.groupBox3.Controls.Add(this.panel4);
  411. this.groupBox3.Controls.Add(this.panel5);
  412. this.groupBox3.Controls.Add(this.panel6);
  413. this.groupBox3.Controls.Add(this.textBox5);
  414. this.groupBox3.Controls.Add(this.trackBar5);
  415. this.groupBox3.Controls.Add(this.textBox3);
  416. this.groupBox3.Controls.Add(this.textBox4);
  417. this.groupBox3.Controls.Add(this.trackBar4);
  418. this.groupBox3.Controls.Add(this.trackBar3);
  419. this.groupBox3.Controls.Add(this.label7);
  420. this.groupBox3.Controls.Add(this.label8);
  421. this.groupBox3.Controls.Add(this.label9);
  422. this.groupBox3.Controls.Add(this.label10);
  423. this.groupBox3.Controls.Add(this.label11);
  424. this.groupBox3.Controls.Add(this.label12);
  425. this.groupBox3.Location = new System.Drawing.Point(12, 198);
  426. this.groupBox3.Name = "groupBox3";
  427. this.groupBox3.Size = new System.Drawing.Size(500, 116);
  428. this.groupBox3.TabIndex = 28;
  429. this.groupBox3.TabStop = false;
  430. //
  431. // panel4
  432. //
  433. this.panel4.Location = new System.Drawing.Point(62, 24);
  434. this.panel4.Name = "panel4";
  435. this.panel4.Size = new System.Drawing.Size(102, 22);
  436. this.panel4.TabIndex = 25;
  437. this.panel4.Click += new System.EventHandler(this.panel4_Click);
  438. //
  439. // panel5
  440. //
  441. this.panel5.Controls.Add(this.radioButton5);
  442. this.panel5.Controls.Add(this.radioButton6);
  443. this.panel5.Location = new System.Drawing.Point(368, 65);
  444. this.panel5.Name = "panel5";
  445. this.panel5.Size = new System.Drawing.Size(115, 30);
  446. this.panel5.TabIndex = 24;
  447. //
  448. // radioButton5
  449. //
  450. this.radioButton5.AutoSize = true;
  451. this.radioButton5.Location = new System.Drawing.Point(62, 6);
  452. this.radioButton5.Name = "radioButton5";
  453. this.radioButton5.Size = new System.Drawing.Size(47, 16);
  454. this.radioButton5.TabIndex = 1;
  455. this.radioButton5.TabStop = true;
  456. this.radioButton5.UseVisualStyleBackColor = true;
  457. //
  458. // radioButton6
  459. //
  460. this.radioButton6.AutoSize = true;
  461. this.radioButton6.Location = new System.Drawing.Point(9, 6);
  462. this.radioButton6.Name = "radioButton6";
  463. this.radioButton6.Size = new System.Drawing.Size(47, 16);
  464. this.radioButton6.TabIndex = 0;
  465. this.radioButton6.TabStop = true;
  466. this.radioButton6.UseVisualStyleBackColor = true;
  467. //
  468. // panel6
  469. //
  470. this.panel6.Controls.Add(this.radioButton7);
  471. this.panel6.Controls.Add(this.radioButton8);
  472. this.panel6.Location = new System.Drawing.Point(368, 20);
  473. this.panel6.Name = "panel6";
  474. this.panel6.Size = new System.Drawing.Size(115, 30);
  475. this.panel6.TabIndex = 23;
  476. //
  477. // radioButton7
  478. //
  479. this.radioButton7.AutoSize = true;
  480. this.radioButton7.Location = new System.Drawing.Point(62, 6);
  481. this.radioButton7.Name = "radioButton7";
  482. this.radioButton7.Size = new System.Drawing.Size(47, 16);
  483. this.radioButton7.TabIndex = 1;
  484. this.radioButton7.TabStop = true;
  485. this.radioButton7.UseVisualStyleBackColor = true;
  486. //
  487. // radioButton8
  488. //
  489. this.radioButton8.AutoSize = true;
  490. this.radioButton8.Location = new System.Drawing.Point(9, 6);
  491. this.radioButton8.Name = "radioButton8";
  492. this.radioButton8.Size = new System.Drawing.Size(47, 16);
  493. this.radioButton8.TabIndex = 0;
  494. this.radioButton8.TabStop = true;
  495. this.radioButton8.UseVisualStyleBackColor = true;
  496. //
  497. // textBox5
  498. //
  499. this.textBox5.Location = new System.Drawing.Point(129, 68);
  500. this.textBox5.Name = "textBox5";
  501. this.textBox5.Size = new System.Drawing.Size(31, 21);
  502. this.textBox5.TabIndex = 33;
  503. this.textBox5.TextChanged += new System.EventHandler(this.textBox5_TextChanged);
  504. //
  505. // trackBar5
  506. //
  507. this.trackBar5.LargeChange = 1;
  508. this.trackBar5.Location = new System.Drawing.Point(55, 68);
  509. this.trackBar5.Maximum = 500;
  510. this.trackBar5.Name = "trackBar5";
  511. this.trackBar5.Size = new System.Drawing.Size(78, 45);
  512. this.trackBar5.TabIndex = 33;
  513. this.trackBar5.TickStyle = System.Windows.Forms.TickStyle.None;
  514. this.trackBar5.Value = 1;
  515. this.trackBar5.ValueChanged += new System.EventHandler(this.trackBar5_ValueChanged);
  516. //
  517. // textBox3
  518. //
  519. this.textBox3.Location = new System.Drawing.Point(299, 68);
  520. this.textBox3.Name = "textBox3";
  521. this.textBox3.Size = new System.Drawing.Size(31, 21);
  522. this.textBox3.TabIndex = 31;
  523. this.textBox3.TextChanged += new System.EventHandler(this.textBox3_TextChanged);
  524. //
  525. // textBox4
  526. //
  527. this.textBox4.Location = new System.Drawing.Point(299, 23);
  528. this.textBox4.Name = "textBox4";
  529. this.textBox4.Size = new System.Drawing.Size(31, 21);
  530. this.textBox4.TabIndex = 32;
  531. this.textBox4.TextChanged += new System.EventHandler(this.textBox4_TextChanged);
  532. //
  533. // trackBar4
  534. //
  535. this.trackBar4.LargeChange = 1;
  536. this.trackBar4.Location = new System.Drawing.Point(225, 23);
  537. this.trackBar4.Maximum = 500;
  538. this.trackBar4.Name = "trackBar4";
  539. this.trackBar4.Size = new System.Drawing.Size(78, 45);
  540. this.trackBar4.TabIndex = 32;
  541. this.trackBar4.TickStyle = System.Windows.Forms.TickStyle.None;
  542. this.trackBar4.Value = 1;
  543. this.trackBar4.ValueChanged += new System.EventHandler(this.trackBar4_ValueChanged);
  544. //
  545. // trackBar3
  546. //
  547. this.trackBar3.LargeChange = 1;
  548. this.trackBar3.Location = new System.Drawing.Point(225, 68);
  549. this.trackBar3.Maximum = 500;
  550. this.trackBar3.Name = "trackBar3";
  551. this.trackBar3.Size = new System.Drawing.Size(78, 45);
  552. this.trackBar3.TabIndex = 31;
  553. this.trackBar3.TickStyle = System.Windows.Forms.TickStyle.None;
  554. this.trackBar3.Value = 1;
  555. this.trackBar3.ValueChanged += new System.EventHandler(this.trackBar3_ValueChanged);
  556. //
  557. // label7
  558. //
  559. this.label7.AutoSize = true;
  560. this.label7.Location = new System.Drawing.Point(332, 72);
  561. this.label7.Name = "label7";
  562. this.label7.Size = new System.Drawing.Size(41, 12);
  563. this.label7.TabIndex = 22;
  564. //
  565. // label8
  566. //
  567. this.label8.AutoSize = true;
  568. this.label8.Location = new System.Drawing.Point(332, 28);
  569. this.label8.Name = "label8";
  570. this.label8.Size = new System.Drawing.Size(41, 12);
  571. this.label8.TabIndex = 21;
  572. //
  573. // label9
  574. //
  575. this.label9.AutoSize = true;
  576. this.label9.Location = new System.Drawing.Point(170, 72);
  577. this.label9.Name = "label9";
  578. this.label9.Size = new System.Drawing.Size(65, 12);
  579. this.label9.TabIndex = 20;
  580. //
  581. // label10
  582. //
  583. this.label10.AutoSize = true;
  584. this.label10.Location = new System.Drawing.Point(194, 28);
  585. this.label10.Name = "label10";
  586. this.label10.Size = new System.Drawing.Size(41, 12);
  587. this.label10.TabIndex = 19;
  588. //
  589. // label11
  590. //
  591. this.label11.AutoSize = true;
  592. this.label11.Location = new System.Drawing.Point(23, 72);
  593. this.label11.Name = "label11";
  594. this.label11.Size = new System.Drawing.Size(41, 12);
  595. this.label11.TabIndex = 18;
  596. //
  597. // label12
  598. //
  599. this.label12.AutoSize = true;
  600. this.label12.Location = new System.Drawing.Point(23, 28);
  601. this.label12.Name = "label12";
  602. this.label12.Size = new System.Drawing.Size(41, 12);
  603. this.label12.TabIndex = 17;
  604. //
  605. // ArbitrationLawPointStyleDialog
  606. //
  607. this.ClientSize = new System.Drawing.Size(522, 323);
  608. this.Controls.Add(this.groupBox3);
  609. this.Controls.Add(this.groupBox2);
  610. this.Controls.Add(this.groupBox1);
  611. this.MaximumSize = new System.Drawing.Size(538, 362);
  612. this.MinimumSize = new System.Drawing.Size(538, 362);
  613. this.Name = "ArbitrationLawPointStyleDialog";
  614. this.groupBox1.ResumeLayout(false);
  615. this.groupBox2.ResumeLayout(false);
  616. this.groupBox2.PerformLayout();
  617. ((System.ComponentModel.ISupportInitialize)(this.trackBar9)).EndInit();
  618. this.panel2.ResumeLayout(false);
  619. this.panel2.PerformLayout();
  620. this.panel1.ResumeLayout(false);
  621. this.panel1.PerformLayout();
  622. ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).EndInit();
  623. ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
  624. this.groupBox3.ResumeLayout(false);
  625. this.groupBox3.PerformLayout();
  626. this.panel5.ResumeLayout(false);
  627. this.panel5.PerformLayout();
  628. this.panel6.ResumeLayout(false);
  629. this.panel6.PerformLayout();
  630. ((System.ComponentModel.ISupportInitialize)(this.trackBar5)).EndInit();
  631. ((System.ComponentModel.ISupportInitialize)(this.trackBar4)).EndInit();
  632. ((System.ComponentModel.ISupportInitialize)(this.trackBar3)).EndInit();
  633. this.ResumeLayout(false);
  634. }
  635. #endregion
  636. /// <summary>
  637. /// Xml获取初始数据
  638. /// </summary>
  639. private void GetFromXml()
  640. {
  641. ArbitrationLawCutOffPointModel grainCutOffPointStyleModel = XmlSerializeHelper.DESerializer<ArbitrationLawCutOffPointModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\ArbitrationLawCutOffPointModel.xml", FileMode.Open));
  642. if (grainCutOffPointStyleModel.CutOffPointStyle1 != null
  643. && grainCutOffPointStyleModel.CutOffPointStyle2 != null)
  644. {
  645. // 0.5截点
  646. this.panel3.BackColor = Color.FromArgb(grainCutOffPointStyleModel.CutOffPointStyle1.pointColor);
  647. this.trackBar1.Value = grainCutOffPointStyleModel.CutOffPointStyle1.pointWidth;
  648. this.textBox1.Text = grainCutOffPointStyleModel.CutOffPointStyle1.pointWidth.ToString();
  649. if (grainCutOffPointStyleModel.CutOffPointStyle1.pointStyle == 0)
  650. this.radioButton1.Checked = true;
  651. else
  652. this.radioButton2.Checked = true;
  653. this.trackBar9.Value = grainCutOffPointStyleModel.CutOffPointStyle1.pointDiameter;
  654. this.textBox9.Text = grainCutOffPointStyleModel.CutOffPointStyle1.pointDiameter.ToString();
  655. this.trackBar2.Value = grainCutOffPointStyleModel.CutOffPointStyle1.pointError;
  656. this.textBox2.Text = grainCutOffPointStyleModel.CutOffPointStyle1.pointError.ToString();
  657. if (grainCutOffPointStyleModel.CutOffPointStyle1.pointshape == 0)
  658. this.radioButton4.Checked = true;
  659. else
  660. this.radioButton3.Checked = true;
  661. // 1截点
  662. this.panel4.BackColor = Color.FromArgb(grainCutOffPointStyleModel.CutOffPointStyle2.pointColor);
  663. this.trackBar4.Value = grainCutOffPointStyleModel.CutOffPointStyle2.pointWidth;
  664. this.textBox4.Text = grainCutOffPointStyleModel.CutOffPointStyle2.pointWidth.ToString();
  665. if (grainCutOffPointStyleModel.CutOffPointStyle2.pointStyle == 0)
  666. this.radioButton8.Checked = true;
  667. else
  668. this.radioButton7.Checked = true;
  669. this.trackBar5.Value = grainCutOffPointStyleModel.CutOffPointStyle2.pointDiameter;
  670. this.textBox5.Text = grainCutOffPointStyleModel.CutOffPointStyle2.pointDiameter.ToString();
  671. this.trackBar3.Value = grainCutOffPointStyleModel.CutOffPointStyle2.pointError;
  672. this.textBox3.Text = grainCutOffPointStyleModel.CutOffPointStyle2.pointError.ToString();
  673. if (grainCutOffPointStyleModel.CutOffPointStyle2.pointshape == 0)
  674. this.radioButton6.Checked = true;
  675. else
  676. this.radioButton5.Checked = true;
  677. }
  678. }
  679. private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
  680. {
  681. }
  682. private void panel3_Click(object sender, EventArgs e)
  683. {
  684. this.colorsForm1.UserPrimaryColor = ColorBgra.FromColor(this.panel3.BackColor);
  685. this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.panel3Changed));
  686. this.colorsForm1.ShowDialog();
  687. }
  688. private void panel3Changed(object sender, EventArgs e)
  689. {
  690. this.panel3.BackColor = this.colorsForm1.UserPrimaryColor.ToColor();
  691. this.colorsForm1.Close();
  692. }
  693. private void panel4_Click(object sender, EventArgs e)
  694. {
  695. this.colorsForm2.UserPrimaryColor = ColorBgra.FromColor(this.panel4.BackColor);
  696. this.colorsForm2.setSaveBtn_Click(new System.EventHandler(this.panel4Changed));
  697. this.colorsForm2.ShowDialog();
  698. }
  699. private void panel4Changed(object sender, EventArgs e)
  700. {
  701. this.panel4.BackColor = this.colorsForm2.UserPrimaryColor.ToColor();
  702. this.colorsForm2.Close();
  703. }
  704. /// <summary>
  705. /// 关闭按钮
  706. /// </summary>
  707. /// <param name="sender"></param>
  708. /// <param name="e"></param>
  709. private void button1_Click(object sender, EventArgs e)
  710. {
  711. this.Close();
  712. }
  713. /// <summary>
  714. /// 保存按钮
  715. /// </summary>
  716. /// <param name="sender"></param>
  717. /// <param name="e"></param>
  718. private void button2_Click(object sender, EventArgs e)
  719. {
  720. ArbitrationLawCutOffPointModel grainCutOffPointStyleModel = new ArbitrationLawCutOffPointModel();
  721. grainCutOffPointStyleModel.CutOffPointStyle1 = new ArbitrationLawCutOffPointModel.CutOffPointStyle();
  722. grainCutOffPointStyleModel.CutOffPointStyle2 = new ArbitrationLawCutOffPointModel.CutOffPointStyle();
  723. // 0.5截点
  724. grainCutOffPointStyleModel.CutOffPointStyle1.pointColor = Convert.ToInt32(this.panel3.BackColor.ToArgb());
  725. grainCutOffPointStyleModel.CutOffPointStyle1.pointWidth = Convert.ToInt32(this.trackBar1.Value);
  726. if (this.radioButton1.Checked)
  727. grainCutOffPointStyleModel.CutOffPointStyle1.pointStyle = 0;
  728. else if (this.radioButton2.Checked)
  729. grainCutOffPointStyleModel.CutOffPointStyle1.pointStyle = 1;
  730. grainCutOffPointStyleModel.CutOffPointStyle1.pointDiameter = Convert.ToInt32(this.trackBar9.Value);
  731. grainCutOffPointStyleModel.CutOffPointStyle1.pointError = Convert.ToInt32(this.trackBar2.Value);
  732. if (this.radioButton4.Checked)
  733. grainCutOffPointStyleModel.CutOffPointStyle1.pointshape = 0;
  734. else if (this.radioButton3.Checked)
  735. grainCutOffPointStyleModel.CutOffPointStyle1.pointshape = 1;
  736. // 1截点
  737. grainCutOffPointStyleModel.CutOffPointStyle2.pointColor = Convert.ToInt32(this.panel4.BackColor.ToArgb());
  738. grainCutOffPointStyleModel.CutOffPointStyle2.pointWidth = Convert.ToInt32(this.trackBar4.Value);
  739. if (this.radioButton8.Checked)
  740. grainCutOffPointStyleModel.CutOffPointStyle2.pointStyle = 0;
  741. else if (this.radioButton7.Checked)
  742. grainCutOffPointStyleModel.CutOffPointStyle2.pointStyle = 1;
  743. grainCutOffPointStyleModel.CutOffPointStyle2.pointDiameter = Convert.ToInt32(this.trackBar5.Value);
  744. grainCutOffPointStyleModel.CutOffPointStyle2.pointError = Convert.ToInt32(this.trackBar3.Value);
  745. if (this.radioButton6.Checked)
  746. grainCutOffPointStyleModel.CutOffPointStyle2.pointshape = 0;
  747. else if (this.radioButton5.Checked)
  748. grainCutOffPointStyleModel.CutOffPointStyle2.pointshape = 1;
  749. //以下保存xml文件信息
  750. string stageModelXml = XmlSerializeHelper.XmlSerialize<ArbitrationLawCutOffPointModel>(grainCutOffPointStyleModel);
  751. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\ArbitrationLawCutOffPointModel.xml";
  752. if( FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create))
  753. {
  754. MessageBox.Show(PdnResources.GetString("Menu.Successfullysaved.text")+"!");
  755. }
  756. GrainSizeArbitrationLawDialog grainSizeArbitrationLawDialog = (GrainSizeArbitrationLawDialog)this.Owner;
  757. grainSizeArbitrationLawDialog.UpdateCupOffPointStyle();
  758. }
  759. private void trackBar1_ValueChanged(object sender, EventArgs e)
  760. {
  761. this.textBox1.Text = this.trackBar1.Value.ToString();
  762. }
  763. private void trackBar9_ValueChanged(object sender, EventArgs e)
  764. {
  765. this.textBox9.Text = this.trackBar9.Value.ToString();
  766. }
  767. private void trackBar2_ValueChanged(object sender, EventArgs e)
  768. {
  769. this.textBox2.Text = this.trackBar2.Value.ToString();
  770. }
  771. private void trackBar4_ValueChanged(object sender, EventArgs e)
  772. {
  773. this.textBox4.Text = this.trackBar4.Value.ToString();
  774. }
  775. private void trackBar5_ValueChanged(object sender, EventArgs e)
  776. {
  777. this.textBox5.Text = this.trackBar5.Value.ToString();
  778. }
  779. private void trackBar3_ValueChanged(object sender, EventArgs e)
  780. {
  781. this.textBox3.Text = this.trackBar3.Value.ToString();
  782. }
  783. private void textBox1_TextChanged(object sender, EventArgs e)
  784. {
  785. if (string.IsNullOrEmpty(this.textBox1.Text) || Convert.ToInt32(this.textBox1.Text) < 0)
  786. this.textBox1.Text = "0";
  787. if (Convert.ToInt32(this.textBox1.Text) > 500)
  788. this.textBox1.Text = "500";
  789. this.trackBar1.Value = Convert.ToInt32(this.textBox1.Text);
  790. }
  791. private void textBox9_TextChanged(object sender, EventArgs e)
  792. {
  793. if (string.IsNullOrEmpty(this.textBox9.Text) || Convert.ToInt32(this.textBox9.Text) < 0)
  794. this.textBox9.Text = "0";
  795. if (Convert.ToInt32(this.textBox9.Text) > 500)
  796. this.textBox9.Text = "500";
  797. this.trackBar9.Value = Convert.ToInt32(this.textBox9.Text);
  798. }
  799. private void textBox2_TextChanged(object sender, EventArgs e)
  800. {
  801. if (string.IsNullOrEmpty(this.textBox2.Text) || Convert.ToInt32(this.textBox2.Text) < 0)
  802. this.textBox2.Text = "0";
  803. if (Convert.ToInt32(this.textBox2.Text) > 500)
  804. this.textBox2.Text = "500";
  805. this.trackBar2.Value = Convert.ToInt32(this.textBox2.Text);
  806. }
  807. private void textBox4_TextChanged(object sender, EventArgs e)
  808. {
  809. if (string.IsNullOrEmpty(this.textBox4.Text) || Convert.ToInt32(this.textBox4.Text) < 0)
  810. this.textBox4.Text = "0";
  811. if (Convert.ToInt32(this.textBox4.Text) > 500)
  812. this.textBox4.Text = "500";
  813. this.trackBar4.Value = Convert.ToInt32(this.textBox4.Text);
  814. }
  815. private void textBox5_TextChanged(object sender, EventArgs e)
  816. {
  817. if (string.IsNullOrEmpty(this.textBox5.Text) || Convert.ToInt32(this.textBox5.Text) < 0)
  818. this.textBox5.Text = "0";
  819. if (Convert.ToInt32(this.textBox5.Text) > 500)
  820. this.textBox5.Text = "500";
  821. this.trackBar5.Value = Convert.ToInt32(this.textBox5.Text);
  822. }
  823. private void textBox3_TextChanged(object sender, EventArgs e)
  824. {
  825. if (string.IsNullOrEmpty(this.textBox3.Text) || Convert.ToInt32(this.textBox3.Text) < 0)
  826. this.textBox3.Text = "0";
  827. if (Convert.ToInt32(this.textBox3.Text) > 500)
  828. this.textBox3.Text = "500";
  829. this.trackBar3.Value = Convert.ToInt32(this.textBox3.Text);
  830. }
  831. }
  832. }