ZAxisSettingDialog.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using PaintDotNet.Annotation.ImageCollect;
  11. using PaintDotNet.ImageCollect.CameraEDOF;
  12. using StageController;
  13. namespace PaintDotNet.ImageCollect.MultiDimensiona
  14. {
  15. public partial class ZAxisSettingDialog : Form
  16. {
  17. public event Action<ZScanParameter, int> ZAxisSetting;
  18. private ParameterOneControl m_zscanSetting;
  19. private int m_index;
  20. private AxisController m_Stage;
  21. public ZAxisSettingDialog( int index, ZScanParameter zscan)
  22. {
  23. InitializeComponent();
  24. InitializeLanguageText();
  25. m_index = index;
  26. m_Stage = AxisController.GetInstance();
  27. m_zscanSetting = new ParameterOneControl(m_Stage, zscan);
  28. m_zscanSetting.Location = new Point(40, 30);
  29. groupBox2.Controls.Add(m_zscanSetting);
  30. }
  31. #region 控件
  32. /// <summary>
  33. /// Required designer variable.
  34. /// </summary>
  35. private System.ComponentModel.IContainer components = null;
  36. /// <summary>
  37. /// Clean up any resources being used.
  38. /// </summary>
  39. /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
  40. protected override void Dispose(bool disposing)
  41. {
  42. if (disposing && (components != null))
  43. {
  44. components.Dispose();
  45. }
  46. base.Dispose(disposing);
  47. }
  48. // Windows Form Designer generated code
  49. private void InitializeLanguageText()
  50. {
  51. this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
  52. this.button3.Text = PdnResources.GetString("Menu.cancel.text");
  53. this.btnOK.Text = PdnResources.GetString("Menu.ensure.text");
  54. this.btnAllOK.Text = PdnResources.GetString("Menu.Alluse.Text");
  55. this.groupBox2.Text = PdnResources.GetString("Menu.paramssettings.text");
  56. this.Text = PdnResources.GetString("Menu.Zaxis.text") + PdnResources.GetString("Menu.Setting.Text");
  57. }
  58. /// <summary>
  59. /// Required method for Designer support - do not modify
  60. /// the contents of this method with the code editor.
  61. /// </summary>
  62. private void InitializeComponent()
  63. {
  64. this.groupBox1 = new System.Windows.Forms.GroupBox();
  65. this.button3 = new System.Windows.Forms.Button();
  66. this.btnOK = new System.Windows.Forms.Button();
  67. this.btnAllOK = new System.Windows.Forms.Button();
  68. this.groupBox2 = new System.Windows.Forms.GroupBox();
  69. this.groupBox1.SuspendLayout();
  70. this.SuspendLayout();
  71. //
  72. // groupBox1
  73. //
  74. this.groupBox1.Controls.Add(this.button3);
  75. this.groupBox1.Controls.Add(this.btnOK);
  76. this.groupBox1.Controls.Add(this.btnAllOK);
  77. this.groupBox1.Location = new System.Drawing.Point(12, 12);
  78. this.groupBox1.Name = "groupBox1";
  79. this.groupBox1.Size = new System.Drawing.Size(483, 83);
  80. this.groupBox1.TabIndex = 0;
  81. this.groupBox1.TabStop = false;
  82. //
  83. // button3
  84. //
  85. this.button3.Location = new System.Drawing.Point(372, 30);
  86. this.button3.Name = "button3";
  87. this.button3.Size = new System.Drawing.Size(91, 33);
  88. this.button3.TabIndex = 2;
  89. this.button3.UseVisualStyleBackColor = true;
  90. this.button3.Click += new System.EventHandler(this.button3_Click);
  91. //
  92. // btnOK
  93. //
  94. this.btnOK.Location = new System.Drawing.Point(264, 30);
  95. this.btnOK.Name = "btnOK";
  96. this.btnOK.Size = new System.Drawing.Size(91, 33);
  97. this.btnOK.TabIndex = 1;
  98. this.btnOK.UseVisualStyleBackColor = true;
  99. this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
  100. //
  101. // btnAllOK
  102. //
  103. this.btnAllOK.Location = new System.Drawing.Point(154, 30);
  104. this.btnAllOK.Name = "btnAllOK";
  105. this.btnAllOK.Size = new System.Drawing.Size(91, 33);
  106. this.btnAllOK.TabIndex = 0;
  107. this.btnAllOK.UseVisualStyleBackColor = true;
  108. this.btnAllOK.Click += new System.EventHandler(this.btnAllOK_Click);
  109. //
  110. // groupBox2
  111. //
  112. this.groupBox2.Location = new System.Drawing.Point(12, 101);
  113. this.groupBox2.Name = "groupBox2";
  114. this.groupBox2.Size = new System.Drawing.Size(483, 435);
  115. this.groupBox2.TabIndex = 1;
  116. this.groupBox2.TabStop = false;
  117. //
  118. // ZAxisSettingDialog
  119. //
  120. this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
  121. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  122. this.ClientSize = new System.Drawing.Size(507, 544);
  123. this.Controls.Add(this.groupBox2);
  124. this.Controls.Add(this.groupBox1);
  125. this.Name = "ZAxisSettingDialog";
  126. this.groupBox1.ResumeLayout(false);
  127. this.ResumeLayout(false);
  128. }
  129. private System.Windows.Forms.GroupBox groupBox1;
  130. private System.Windows.Forms.Button button3;
  131. private System.Windows.Forms.Button btnOK;
  132. private System.Windows.Forms.Button btnAllOK;
  133. private System.Windows.Forms.GroupBox groupBox2;
  134. #endregion
  135. private void button3_Click(object sender, EventArgs e)
  136. {
  137. this.Close();
  138. }
  139. private void btnAllOK_Click(object sender, EventArgs e)
  140. {
  141. m_index = 999999;
  142. this.Callback();
  143. }
  144. private void btnOK_Click(object sender, EventArgs e)
  145. {
  146. this.Callback();
  147. }
  148. private void Callback()
  149. {
  150. if (ZAxisSetting != null)
  151. {
  152. var zscanparm = m_zscanSetting.ZScanParameter;
  153. ZAxisSetting(zscanparm, m_index);
  154. }
  155. this.Close();
  156. }
  157. }
  158. }