123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using PaintDotNet.Annotation.ImageCollect;
- using PaintDotNet.ImageCollect.CameraEDOF;
- using StageController;
- namespace PaintDotNet.ImageCollect.MultiDimensiona
- {
- public partial class ZAxisSettingDialog : Form
- {
- public event Action<ZScanParameter, int> ZAxisSetting;
- private ParameterOneControl m_zscanSetting;
- private int m_index;
- private AxisController m_Stage;
- public ZAxisSettingDialog( int index, ZScanParameter zscan)
- {
- InitializeComponent();
- InitializeLanguageText();
- m_index = index;
- m_Stage = AxisController.GetInstance();
- m_zscanSetting = new ParameterOneControl(m_Stage, zscan);
- m_zscanSetting.Location = new Point(40, 30);
- groupBox2.Controls.Add(m_zscanSetting);
- }
- #region 控件
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
- // Windows Form Designer generated code
- private void InitializeLanguageText()
- {
- this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
- this.button3.Text = PdnResources.GetString("Menu.cancel.text");
- this.btnOK.Text = PdnResources.GetString("Menu.ensure.text");
- this.btnAllOK.Text = PdnResources.GetString("Menu.Alluse.Text");
- this.groupBox2.Text = PdnResources.GetString("Menu.paramssettings.text");
- this.Text = PdnResources.GetString("Menu.Zaxis.text") + PdnResources.GetString("Menu.Setting.Text");
- }
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.button3 = new System.Windows.Forms.Button();
- this.btnOK = new System.Windows.Forms.Button();
- this.btnAllOK = new System.Windows.Forms.Button();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.groupBox1.SuspendLayout();
- this.SuspendLayout();
- //
- // groupBox1
- //
- this.groupBox1.Controls.Add(this.button3);
- this.groupBox1.Controls.Add(this.btnOK);
- this.groupBox1.Controls.Add(this.btnAllOK);
- this.groupBox1.Location = new System.Drawing.Point(12, 12);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(483, 83);
- this.groupBox1.TabIndex = 0;
- this.groupBox1.TabStop = false;
- //
- // button3
- //
- this.button3.Location = new System.Drawing.Point(372, 30);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(91, 33);
- this.button3.TabIndex = 2;
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += new System.EventHandler(this.button3_Click);
- //
- // btnOK
- //
- this.btnOK.Location = new System.Drawing.Point(264, 30);
- this.btnOK.Name = "btnOK";
- this.btnOK.Size = new System.Drawing.Size(91, 33);
- this.btnOK.TabIndex = 1;
- this.btnOK.UseVisualStyleBackColor = true;
- this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
- //
- // btnAllOK
- //
- this.btnAllOK.Location = new System.Drawing.Point(154, 30);
- this.btnAllOK.Name = "btnAllOK";
- this.btnAllOK.Size = new System.Drawing.Size(91, 33);
- this.btnAllOK.TabIndex = 0;
- this.btnAllOK.UseVisualStyleBackColor = true;
- this.btnAllOK.Click += new System.EventHandler(this.btnAllOK_Click);
- //
- // groupBox2
- //
- this.groupBox2.Location = new System.Drawing.Point(12, 101);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(483, 435);
- this.groupBox2.TabIndex = 1;
- this.groupBox2.TabStop = false;
- //
- // ZAxisSettingDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(507, 544);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox1);
- this.Name = "ZAxisSettingDialog";
- this.groupBox1.ResumeLayout(false);
- this.ResumeLayout(false);
- }
- private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.Button button3;
- private System.Windows.Forms.Button btnOK;
- private System.Windows.Forms.Button btnAllOK;
- private System.Windows.Forms.GroupBox groupBox2;
- #endregion
- private void button3_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void btnAllOK_Click(object sender, EventArgs e)
- {
- m_index = 999999;
- this.Callback();
- }
- private void btnOK_Click(object sender, EventArgs e)
- {
- this.Callback();
- }
- private void Callback()
- {
- if (ZAxisSetting != null)
- {
- var zscanparm = m_zscanSetting.ZScanParameter;
- ZAxisSetting(zscanparm, m_index);
- }
- this.Close();
- }
- }
- }
|