using OpenCvSharp;
using PaintDotNet.Adjust.BaseImage;
using PaintDotNet.Annotation;
using PaintDotNet.Annotation.Enum;
using PaintDotNet.Annotation.ImageCollect;
using PaintDotNet.Base.CommTool;
using PaintDotNet.Base.SettingModel;
using PaintDotNet.CustomControl;
using PaintDotNet.Setting;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Linq;
using System.Management;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using System.Windows.Interop;
using PaintDotNet.Hardware;
using PaintDotNet.ImageCollect.ListOfLocation;
using OpenCvSharp.Extensions;
namespace PaintDotNet.ImageCollect
{
internal class ListOfLocationsDialog : HardwareBaseDialog
{
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
private new void InitializeLanguageText()
{
this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
this.btnDelete.Text = PdnResources.GetString("Menu.Edit.Delete.Text");
this.btnSave.Text = PdnResources.GetString("Menu.File.Save.Text");
this.btnSaveAs.Text = PdnResources.GetString("Menu.File.SaveAs.Text");
this.btnStop.Text = PdnResources.GetString("Menu.stop.text");
this.btnCreatImgFile.Text = PdnResources.GetString("Menu.Createpicture.text");
this.btnWorking.Text = PdnResources.GetString("Menu.Started.text");
this.groupBox2.Text = PdnResources.GetString("Menu.ImageCollection.CameraSetting.Text");
this.btnWhiteBalance.Text = PdnResources.GetString("Menu.auto.text") + PdnResources.GetString("Menu.Image.WhiteBalance.Text");
this.chkAutoExposure.Text = PdnResources.GetString("Menu.auto-exposure.text");
this.btnOther.Text = PdnResources.GetString("Menu.othersettings.text");
this.label6.Text = PdnResources.GetString("Menu.Exposurepercentage.text") + ":";
this.label5.Text = PdnResources.GetString("Menu.timeofexposure.text") + ":";
this.groupBox6.Text = PdnResources.GetString("Menu.HardwareControl.Text");
this.label4.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.speed.text") + ":";
this.groupBox12.Text = PdnResources.GetString("Menu.Fixedlength.text");
this.groupBox11.Text = PdnResources.GetString("Menu.continuous.text");
this.groupBox10.Text = PdnResources.GetString("Menu.viewmode.text");
this.groupBox9.Text = PdnResources.GetString("Menu.movementmode.text");
this.groupBox13.Text = PdnResources.GetString("Menu.Puzzleeffect.text");
this.groupBox3.Text = PdnResources.GetString("Menu.Addtheposition.Text");
this.btnAddCross.Text = PdnResources.GetString("Menu.Addalist.Text");
this.rdoCenter.Text = PdnResources.GetString("Menu.center.text");
this.rdoLeftTop.Text = PdnResources.GetString("Menu.Upperleft.text");
this.groupBox4.Text = PdnResources.GetString("Menu.ImageCollection.ListOfLocations.Text");
this.btnModify.Text = PdnResources.GetString("Menu.change.Text");
this.btnDel.Text = PdnResources.GetString("Menu.delete.Text");
this.id.HeaderText = PdnResources.GetString("Menu.Dedicatedanalysis.Non-ferrousmetals.serialnumber.text");
this.Text = PdnResources.GetString("Menu.ImageCollection.ListOfLocations.Text");
base.InitializeLanguageText();
}
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btnDelete = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.btnSaveAs = new System.Windows.Forms.Button();
this.cmbFile = new System.Windows.Forms.ComboBox();
this.btnStop = new System.Windows.Forms.Button();
this.btnCreatImgFile = new System.Windows.Forms.Button();
this.btnWorking = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.btnWhiteBalance = new System.Windows.Forms.Button();
this.label16 = new System.Windows.Forms.Label();
this.lblUnit = new System.Windows.Forms.Label();
this.chkAutoExposure = new System.Windows.Forms.CheckBox();
this.txtPercentage = new System.Windows.Forms.TextBox();
this.txtTime = new System.Windows.Forms.TextBox();
this.trackPercentage = new System.Windows.Forms.TrackBar();
this.trackTime = new System.Windows.Forms.TrackBar();
this.btnOther = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.label18 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.pnlSpeed = new System.Windows.Forms.Panel();
this.label4 = new System.Windows.Forms.Label();
this.cmbStepUnit = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.groupBox12 = new System.Windows.Forms.GroupBox();
this.groupBox11 = new System.Windows.Forms.GroupBox();
this.groupBox10 = new System.Windows.Forms.GroupBox();
this.panelVision = new System.Windows.Forms.Panel();
this.groupBox9 = new System.Windows.Forms.GroupBox();
this.panelMotion = new System.Windows.Forms.Panel();
this.panelControl = new System.Windows.Forms.Panel();
this.groupBox13 = new System.Windows.Forms.GroupBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.picEffect = new System.Windows.Forms.PictureBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.btnAddCross = new System.Windows.Forms.Button();
this.label10 = new System.Windows.Forms.Label();
this.txtLY = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.txtNY = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.txtLX = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.txtNX = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.rdoCenter = new System.Windows.Forms.RadioButton();
this.rdoLeftTop = new System.Windows.Forms.RadioButton();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.btnModify = new System.Windows.Forms.Button();
this.btnDel = new System.Windows.Forms.Button();
this.dgvRegionTeb = new System.Windows.Forms.DataGridView();
this.id = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.x = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.y = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.z = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.trackPercentage)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.trackTime)).BeginInit();
this.groupBox6.SuspendLayout();
this.groupBox12.SuspendLayout();
this.groupBox11.SuspendLayout();
this.groupBox10.SuspendLayout();
this.groupBox9.SuspendLayout();
this.groupBox13.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picEffect)).BeginInit();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvRegionTeb)).BeginInit();
this.SuspendLayout();
//
// lblXPosition
//
this.lblXPosition.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lblXPosition.AutoSize = true;
this.lblXPosition.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblXPosition.Location = new System.Drawing.Point(429, 642);
this.lblXPosition.Size = new System.Drawing.Size(28, 14);
this.lblXPosition.TabIndex = 42;
this.lblXPosition.Text = "X:0";
//
// lblYPosition
//
this.lblYPosition.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lblYPosition.AutoSize = true;
this.lblYPosition.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblYPosition.Location = new System.Drawing.Point(429, 668);
this.lblYPosition.Size = new System.Drawing.Size(28, 14);
this.lblYPosition.TabIndex = 43;
this.lblYPosition.Text = "Y:0";
//
// lblZPosition
//
this.lblZPosition.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lblZPosition.AutoSize = true;
this.lblZPosition.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblZPosition.Location = new System.Drawing.Point(429, 693);
this.lblZPosition.Size = new System.Drawing.Size(28, 14);
this.lblZPosition.TabIndex = 44;
this.lblZPosition.Text = "Z:0";
//
// btnLockloadstage
//
this.btnFreeloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnFreeloadstage.Location = new System.Drawing.Point(72, 684);
this.btnFreeloadstage.Size = new System.Drawing.Size(59, 31);
this.btnFreeloadstage.TabIndex = 31;
this.btnFreeloadstage.Text = "锁定";
this.btnFreeloadstage.UseVisualStyleBackColor = true;
//
// btnStoploadstage
//
this.btnStoploadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnStoploadstage.Location = new System.Drawing.Point(72, 639);
this.btnStoploadstage.Size = new System.Drawing.Size(59, 33);
this.btnStoploadstage.TabIndex = 30;
this.btnStoploadstage.Text = "停止";
this.btnStoploadstage.UseVisualStyleBackColor = true;
//
// btnResetloadstage
//
this.btnResetloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnResetloadstage.Location = new System.Drawing.Point(7, 639);
this.btnResetloadstage.Size = new System.Drawing.Size(60, 33);
this.btnResetloadstage.TabIndex = 29;
this.btnResetloadstage.Text = "复位";
this.btnResetloadstage.UseVisualStyleBackColor = true;
//
// btnCenterloadstage
//
this.btnCenterloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCenterloadstage.Location = new System.Drawing.Point(7, 684);
this.btnCenterloadstage.Size = new System.Drawing.Size(60, 31);
this.btnCenterloadstage.TabIndex = 28;
this.btnCenterloadstage.Text = "中心";
this.btnCenterloadstage.UseVisualStyleBackColor = true;
//
// btnInloadstage
//
this.btnInloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnInloadstage.Location = new System.Drawing.Point(72, 592);
this.btnInloadstage.Size = new System.Drawing.Size(61, 33);
this.btnInloadstage.TabIndex = 27;
this.btnInloadstage.Text = "进片";
this.btnInloadstage.UseVisualStyleBackColor = true;
//
// btnOutloadstage
//
this.btnOutloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnOutloadstage.Location = new System.Drawing.Point(7, 592);
this.btnOutloadstage.Size = new System.Drawing.Size(60, 33);
this.btnOutloadstage.TabIndex = 26;
this.btnOutloadstage.Text = "出片";
this.btnOutloadstage.UseVisualStyleBackColor = true;
//
// btnZStop
//
this.btnZStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnZStop.Location = new System.Drawing.Point(346, 682);
this.btnZStop.Size = new System.Drawing.Size(59, 33);
this.btnZStop.TabIndex = 41;
this.btnZStop.Text = "停止";
this.btnZStop.UseVisualStyleBackColor = true;
//
// btnZLock
//
this.btnZFree.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnZFree.Location = new System.Drawing.Point(346, 641);
this.btnZFree.Size = new System.Drawing.Size(59, 31);
this.btnZFree.TabIndex = 40;
this.btnZFree.Text = "锁定";
this.btnZFree.UseVisualStyleBackColor = true;
//
// txtXStep
//
this.txtXStep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtXStep.Location = new System.Drawing.Point(160, 592);
this.txtXStep.Size = new System.Drawing.Size(68, 21);
this.txtXStep.TabIndex = 35;
this.txtXStep.Text = "1000";
//
// txtYStep
//
this.txtYStep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtYStep.Location = new System.Drawing.Point(256, 592);
this.txtYStep.Size = new System.Drawing.Size(68, 21);
this.txtYStep.TabIndex = 36;
this.txtYStep.Text = "1000";
//
// txtZStep
//
this.txtZStep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txtZStep.Location = new System.Drawing.Point(353, 592);
this.txtZStep.Size = new System.Drawing.Size(68, 21);
this.txtZStep.TabIndex = 37;
this.txtZStep.Text = "200";
//
// btnContinuityLower
//
this.btnContinuityLower.Location = new System.Drawing.Point(5, 89);
this.btnContinuityLower.Size = new System.Drawing.Size(46, 59);
this.btnContinuityLower.TabIndex = 1;
this.btnContinuityLower.UseVisualStyleBackColor = true;
//
// btnContinuityUp
//
this.btnContinuityUp.Location = new System.Drawing.Point(5, 24);
this.btnContinuityUp.Size = new System.Drawing.Size(46, 59);
this.btnContinuityUp.TabIndex = 1;
this.btnContinuityUp.UseVisualStyleBackColor = true;
//
// btnFixedLower
//
this.btnFixedLower.Location = new System.Drawing.Point(5, 89);
this.btnFixedLower.Size = new System.Drawing.Size(46, 59);
this.btnFixedLower.TabIndex = 2;
this.btnFixedLower.UseVisualStyleBackColor = true;
//
// btnFixedUp
//
this.btnFixedUp.Location = new System.Drawing.Point(5, 24);
this.btnFixedUp.Size = new System.Drawing.Size(46, 59);
this.btnFixedUp.TabIndex = 3;
this.btnFixedUp.UseVisualStyleBackColor = true;
//
// btnCenterDisplay
//
this.btnCenterDisplay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCenterDisplay.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCenterDisplay.Location = new System.Drawing.Point(427, 522);
this.btnCenterDisplay.Size = new System.Drawing.Size(74, 33);
this.btnCenterDisplay.TabIndex = 49;
this.btnCenterDisplay.Text = "中心显示";
this.btnCenterDisplay.UseVisualStyleBackColor = true;
//
// btnStopall
//
this.btnStopall.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnStopall.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnStopall.Location = new System.Drawing.Point(427, 483);
this.btnStopall.Size = new System.Drawing.Size(74, 33);
this.btnStopall.TabIndex = 48;
this.btnStopall.Text = "全部停止";
this.btnStopall.UseVisualStyleBackColor = true;
//
// btnDsRocker
//
this.btnDsRocker.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnDsRocker.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnDsRocker.Location = new System.Drawing.Point(427, 444);
this.btnDsRocker.Size = new System.Drawing.Size(74, 33);
this.btnDsRocker.TabIndex = 47;
this.btnDsRocker.Text = "禁用摇杆";
this.btnDsRocker.UseVisualStyleBackColor = true;
//
// btnSetting
//
this.btnSetting.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnSetting.Location = new System.Drawing.Point(796, 11);
this.btnSetting.Size = new System.Drawing.Size(92, 30);
this.btnSetting.TabIndex = 3;
this.btnSetting.Text = "串口设置";
this.btnSetting.UseVisualStyleBackColor = true;
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.btnDelete);
this.groupBox1.Controls.Add(this.btnSave);
this.groupBox1.Controls.Add(this.btnSaveAs);
this.groupBox1.Controls.Add(this.cmbFile);
this.groupBox1.Controls.Add(this.btnSetting);
this.groupBox1.Controls.Add(this.btnStop);
this.groupBox1.Controls.Add(this.btnCreatImgFile);
this.groupBox1.Controls.Add(this.btnWorking);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(1235, 47);
this.groupBox1.TabIndex = 3;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "操作";
this.groupBox1.Controls.SetChildIndex(this.btnWorking, 0);
this.groupBox1.Controls.SetChildIndex(this.btnCreatImgFile, 0);
this.groupBox1.Controls.SetChildIndex(this.btnStop, 0);
this.groupBox1.Controls.SetChildIndex(this.btnSetting, 0);
this.groupBox1.Controls.SetChildIndex(this.cmbFile, 0);
this.groupBox1.Controls.SetChildIndex(this.btnSaveAs, 0);
this.groupBox1.Controls.SetChildIndex(this.btnSave, 0);
this.groupBox1.Controls.SetChildIndex(this.btnDelete, 0);
//
// btnDelete
//
this.btnDelete.Location = new System.Drawing.Point(482, 11);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(92, 30);
this.btnDelete.TabIndex = 7;
this.btnDelete.Text = "删除";
this.btnDelete.UseVisualStyleBackColor = true;
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
//
// btnSave
//
this.btnSave.Location = new System.Drawing.Point(384, 11);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(92, 30);
this.btnSave.TabIndex = 6;
this.btnSave.Text = "保存";
this.btnSave.UseVisualStyleBackColor = true;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// btnSaveAs
//
this.btnSaveAs.Location = new System.Drawing.Point(286, 11);
this.btnSaveAs.Name = "btnSaveAs";
this.btnSaveAs.Size = new System.Drawing.Size(92, 30);
this.btnSaveAs.TabIndex = 5;
this.btnSaveAs.Text = "另存为";
this.btnSaveAs.UseVisualStyleBackColor = true;
this.btnSaveAs.Click += new System.EventHandler(this.btnSaveAs_Click);
//
// cmbFile
//
this.cmbFile.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbFile.FormattingEnabled = true;
this.cmbFile.Location = new System.Drawing.Point(17, 18);
this.cmbFile.Name = "cmbFile";
this.cmbFile.Size = new System.Drawing.Size(255, 20);
this.cmbFile.TabIndex = 4;
this.cmbFile.SelectedIndexChanged += new System.EventHandler(this.cmbFile_SelectedIndexChanged);
//
// btnStop
//
this.btnStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnStop.Location = new System.Drawing.Point(1015, 11);
this.btnStop.Name = "btnStop";
this.btnStop.Size = new System.Drawing.Size(89, 30);
this.btnStop.TabIndex = 2;
this.btnStop.Text = "停止";
this.btnStop.UseVisualStyleBackColor = true;
this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
//
// btnCreatImgFile
//
this.btnCreatImgFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnCreatImgFile.Location = new System.Drawing.Point(1123, 11);
this.btnCreatImgFile.Name = "btnCreatImgFile";
this.btnCreatImgFile.Size = new System.Drawing.Size(92, 30);
this.btnCreatImgFile.TabIndex = 1;
this.btnCreatImgFile.Text = "创建图片";
this.btnCreatImgFile.UseVisualStyleBackColor = true;
this.btnCreatImgFile.Click += new System.EventHandler(this.btnCreatImgFile_Click);
//
// btnWorking
//
this.btnWorking.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnWorking.Location = new System.Drawing.Point(907, 11);
this.btnWorking.Name = "btnWorking";
this.btnWorking.Size = new System.Drawing.Size(89, 30);
this.btnWorking.TabIndex = 0;
this.btnWorking.Text = "开始";
this.btnWorking.UseVisualStyleBackColor = true;
this.btnWorking.Click += new System.EventHandler(this.btnWorking_Click);
//
// groupBox2
//
this.groupBox2.Controls.Add(this.btnWhiteBalance);
this.groupBox2.Controls.Add(this.label16);
this.groupBox2.Controls.Add(this.lblUnit);
this.groupBox2.Controls.Add(this.chkAutoExposure);
this.groupBox2.Controls.Add(this.txtPercentage);
this.groupBox2.Controls.Add(this.txtTime);
this.groupBox2.Controls.Add(this.trackPercentage);
this.groupBox2.Controls.Add(this.trackTime);
this.groupBox2.Controls.Add(this.btnOther);
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Location = new System.Drawing.Point(12, 65);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(280, 114);
this.groupBox2.TabIndex = 18;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "相机设置";
//
// btnWhiteBalance
//
this.btnWhiteBalance.Location = new System.Drawing.Point(96, 85);
this.btnWhiteBalance.Name = "btnWhiteBalance";
this.btnWhiteBalance.Size = new System.Drawing.Size(96, 23);
this.btnWhiteBalance.TabIndex = 40;
this.btnWhiteBalance.Text = "自动白平衡";
this.btnWhiteBalance.UseVisualStyleBackColor = true;
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(257, 47);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(11, 12);
this.label16.TabIndex = 39;
this.label16.Text = "%";
//
// lblUnit
//
this.lblUnit.AutoSize = true;
this.lblUnit.Location = new System.Drawing.Point(257, 19);
this.lblUnit.Name = "lblUnit";
this.lblUnit.Size = new System.Drawing.Size(17, 12);
this.lblUnit.TabIndex = 0;
this.lblUnit.Text = "ms";
//
// chkAutoExposure
//
this.chkAutoExposure.AutoSize = true;
this.chkAutoExposure.Location = new System.Drawing.Point(10, 88);
this.chkAutoExposure.Name = "chkAutoExposure";
this.chkAutoExposure.Size = new System.Drawing.Size(72, 16);
this.chkAutoExposure.TabIndex = 0;
this.chkAutoExposure.Text = "自动曝光";
this.chkAutoExposure.UseVisualStyleBackColor = true;
this.chkAutoExposure.Click += new System.EventHandler(this.chkAutoExposure_Click);
//
// txtPercentage
//
this.txtPercentage.Location = new System.Drawing.Point(214, 44);
this.txtPercentage.Name = "txtPercentage";
this.txtPercentage.Size = new System.Drawing.Size(42, 21);
this.txtPercentage.TabIndex = 37;
//
// txtTime
//
this.txtTime.Location = new System.Drawing.Point(214, 17);
this.txtTime.Name = "txtTime";
this.txtTime.Size = new System.Drawing.Size(42, 21);
this.txtTime.TabIndex = 36;
//
// trackPercentage
//
this.trackPercentage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.trackPercentage.AutoSize = false;
this.trackPercentage.Location = new System.Drawing.Point(78, 45);
this.trackPercentage.Maximum = 200;
this.trackPercentage.Minimum = 5;
this.trackPercentage.Name = "trackPercentage";
this.trackPercentage.Size = new System.Drawing.Size(141, 25);
this.trackPercentage.TabIndex = 5;
this.trackPercentage.TickStyle = System.Windows.Forms.TickStyle.None;
this.trackPercentage.Value = 5;
//
// trackTime
//
this.trackTime.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.trackTime.AutoSize = false;
this.trackTime.Location = new System.Drawing.Point(78, 19);
this.trackTime.Maximum = 1000000;
this.trackTime.Name = "trackTime";
this.trackTime.Size = new System.Drawing.Size(141, 25);
this.trackTime.TabIndex = 4;
this.trackTime.TickStyle = System.Windows.Forms.TickStyle.None;
//
// btnOther
//
this.btnOther.Location = new System.Drawing.Point(202, 85);
this.btnOther.Name = "btnOther";
this.btnOther.Size = new System.Drawing.Size(75, 23);
this.btnOther.TabIndex = 3;
this.btnOther.Text = "其他设置";
this.btnOther.UseVisualStyleBackColor = true;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(7, 47);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(77, 12);
this.label6.TabIndex = 1;
this.label6.Text = "曝光百分比:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(7, 20);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(65, 12);
this.label5.TabIndex = 0;
this.label5.Text = "曝光时间:";
//
// groupBox6
//
this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox6.Controls.Add(this.label18);
this.groupBox6.Controls.Add(this.label17);
this.groupBox6.Controls.Add(this.label15);
this.groupBox6.Controls.Add(this.pnlSpeed);
this.groupBox6.Controls.Add(this.btnCenterDisplay);
this.groupBox6.Controls.Add(this.btnStopall);
this.groupBox6.Controls.Add(this.btnDsRocker);
this.groupBox6.Controls.Add(this.lblZPosition);
this.groupBox6.Controls.Add(this.lblYPosition);
this.groupBox6.Controls.Add(this.lblXPosition);
this.groupBox6.Controls.Add(this.btnZStop);
this.groupBox6.Controls.Add(this.btnZFree);
this.groupBox6.Controls.Add(this.label4);
this.groupBox6.Controls.Add(this.cmbStepUnit);
this.groupBox6.Controls.Add(this.txtZStep);
this.groupBox6.Controls.Add(this.txtYStep);
this.groupBox6.Controls.Add(this.txtXStep);
this.groupBox6.Controls.Add(this.label3);
this.groupBox6.Controls.Add(this.label2);
this.groupBox6.Controls.Add(this.label1);
this.groupBox6.Controls.Add(this.btnOutloadstage);
this.groupBox6.Controls.Add(this.groupBox12);
this.groupBox6.Controls.Add(this.btnFreeloadstage);
this.groupBox6.Controls.Add(this.groupBox11);
this.groupBox6.Controls.Add(this.groupBox10);
this.groupBox6.Controls.Add(this.btnInloadstage);
this.groupBox6.Controls.Add(this.groupBox9);
this.groupBox6.Controls.Add(this.btnStoploadstage);
this.groupBox6.Controls.Add(this.panelControl);
this.groupBox6.Controls.Add(this.btnResetloadstage);
this.groupBox6.Controls.Add(this.btnCenterloadstage);
this.groupBox6.Location = new System.Drawing.Point(298, 65);
this.groupBox6.Name = "groupBox6";
this.groupBox6.Size = new System.Drawing.Size(512, 731);
this.groupBox6.TabIndex = 19;
this.groupBox6.TabStop = false;
this.groupBox6.Text = "硬件控制";
this.groupBox6.Controls.SetChildIndex(this.btnCenterloadstage, 0);
this.groupBox6.Controls.SetChildIndex(this.btnResetloadstage, 0);
this.groupBox6.Controls.SetChildIndex(this.panelControl, 0);
this.groupBox6.Controls.SetChildIndex(this.btnStoploadstage, 0);
this.groupBox6.Controls.SetChildIndex(this.groupBox9, 0);
this.groupBox6.Controls.SetChildIndex(this.btnInloadstage, 0);
this.groupBox6.Controls.SetChildIndex(this.groupBox10, 0);
this.groupBox6.Controls.SetChildIndex(this.groupBox11, 0);
this.groupBox6.Controls.SetChildIndex(this.btnFreeloadstage, 0);
this.groupBox6.Controls.SetChildIndex(this.groupBox12, 0);
this.groupBox6.Controls.SetChildIndex(this.btnOutloadstage, 0);
this.groupBox6.Controls.SetChildIndex(this.label1, 0);
this.groupBox6.Controls.SetChildIndex(this.label2, 0);
this.groupBox6.Controls.SetChildIndex(this.label3, 0);
this.groupBox6.Controls.SetChildIndex(this.txtXStep, 0);
this.groupBox6.Controls.SetChildIndex(this.txtYStep, 0);
this.groupBox6.Controls.SetChildIndex(this.txtZStep, 0);
this.groupBox6.Controls.SetChildIndex(this.cmbStepUnit, 0);
this.groupBox6.Controls.SetChildIndex(this.label4, 0);
this.groupBox6.Controls.SetChildIndex(this.btnZFree, 0);
this.groupBox6.Controls.SetChildIndex(this.btnZStop, 0);
this.groupBox6.Controls.SetChildIndex(this.lblXPosition, 0);
this.groupBox6.Controls.SetChildIndex(this.lblYPosition, 0);
this.groupBox6.Controls.SetChildIndex(this.lblZPosition, 0);
this.groupBox6.Controls.SetChildIndex(this.btnDsRocker, 0);
this.groupBox6.Controls.SetChildIndex(this.btnStopall, 0);
this.groupBox6.Controls.SetChildIndex(this.btnCenterDisplay, 0);
this.groupBox6.Controls.SetChildIndex(this.pnlSpeed, 0);
this.groupBox6.Controls.SetChildIndex(this.label15, 0);
this.groupBox6.Controls.SetChildIndex(this.label17, 0);
this.groupBox6.Controls.SetChildIndex(this.label18, 0);
//
// label18
//
this.label18.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label18.AutoSize = true;
this.label18.Font = new System.Drawing.Font("宋体", 10.5F);
this.label18.Location = new System.Drawing.Point(411, 693);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(21, 14);
this.label18.TabIndex = 53;
this.label18.Text = "Z:";
//
// label17
//
this.label17.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label17.AutoSize = true;
this.label17.Font = new System.Drawing.Font("宋体", 10.5F);
this.label17.Location = new System.Drawing.Point(411, 668);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(21, 14);
this.label17.TabIndex = 54;
this.label17.Text = "Y:";
//
// label15
//
this.label15.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label15.AutoSize = true;
this.label15.Font = new System.Drawing.Font("宋体", 10.5F);
this.label15.Location = new System.Drawing.Point(411, 642);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(21, 14);
this.label15.TabIndex = 55;
this.label15.Text = "X:";
//
// pnlSpeed
//
this.pnlSpeed.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.pnlSpeed.Location = new System.Drawing.Point(185, 623);
this.pnlSpeed.Name = "pnlSpeed";
this.pnlSpeed.Size = new System.Drawing.Size(146, 102);
this.pnlSpeed.TabIndex = 50;
//
// label4
//
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(138, 642);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(49, 14);
this.label4.TabIndex = 39;
this.label4.Text = "速度:";
//
// cmbStepUnit
//
this.cmbStepUnit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.cmbStepUnit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmbStepUnit.FormattingEnabled = true;
this.cmbStepUnit.Items.AddRange(new object[] {
"μm",
"mm",
"cm"});
this.cmbStepUnit.Location = new System.Drawing.Point(427, 594);
this.cmbStepUnit.Name = "cmbStepUnit";
this.cmbStepUnit.Size = new System.Drawing.Size(69, 20);
this.cmbStepUnit.TabIndex = 38;
//
// label3
//
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(328, 595);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(21, 14);
this.label3.TabIndex = 34;
this.label3.Text = "Z:";
//
// label2
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(231, 595);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(21, 14);
this.label2.TabIndex = 33;
this.label2.Text = "Y:";
//
// label1
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(138, 595);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(21, 14);
this.label1.TabIndex = 32;
this.label1.Text = "X:";
//
// groupBox12
//
this.groupBox12.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.groupBox12.Controls.Add(this.btnFixedLower);
this.groupBox12.Controls.Add(this.btnFixedUp);
this.groupBox12.Location = new System.Drawing.Point(370, 420);
this.groupBox12.Name = "groupBox12";
this.groupBox12.Size = new System.Drawing.Size(56, 162);
this.groupBox12.TabIndex = 25;
this.groupBox12.TabStop = false;
//
// groupBox11
//
this.groupBox11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.groupBox11.Controls.Add(this.btnContinuityLower);
this.groupBox11.Controls.Add(this.btnContinuityUp);
this.groupBox11.Location = new System.Drawing.Point(312, 420);
this.groupBox11.Name = "groupBox11";
this.groupBox11.Size = new System.Drawing.Size(56, 162);
this.groupBox11.TabIndex = 24;
this.groupBox11.TabStop = false;
//
// groupBox10
//
this.groupBox10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.groupBox10.Controls.Add(this.panelVision);
this.groupBox10.Location = new System.Drawing.Point(160, 420);
this.groupBox10.Name = "groupBox10";
this.groupBox10.Size = new System.Drawing.Size(150, 162);
this.groupBox10.TabIndex = 23;
this.groupBox10.TabStop = false;
this.groupBox10.Text = "视场模式";
//
// panelVision
//
this.panelVision.Location = new System.Drawing.Point(2, 14);
this.panelVision.Name = "panelVision";
this.panelVision.Size = new System.Drawing.Size(144, 144);
this.panelVision.TabIndex = 2;
//
// groupBox9
//
this.groupBox9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.groupBox9.Controls.Add(this.panelMotion);
this.groupBox9.Location = new System.Drawing.Point(6, 420);
this.groupBox9.Name = "groupBox9";
this.groupBox9.Size = new System.Drawing.Size(150, 162);
this.groupBox9.TabIndex = 22;
this.groupBox9.TabStop = false;
this.groupBox9.Text = "运动模式";
//
// panelMotion
//
this.panelMotion.Location = new System.Drawing.Point(2, 14);
this.panelMotion.Name = "panelMotion";
this.panelMotion.Size = new System.Drawing.Size(144, 144);
this.panelMotion.TabIndex = 1;
//
// panelControl
//
this.panelControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panelControl.AutoScroll = true;
this.panelControl.BackColor = System.Drawing.SystemColors.Control;
this.panelControl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelControl.Location = new System.Drawing.Point(6, 17);
this.panelControl.Name = "panelControl";
this.panelControl.Size = new System.Drawing.Size(500, 394);
this.panelControl.TabIndex = 14;
//
// groupBox13
//
this.groupBox13.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox13.Controls.Add(this.pictureBox1);
this.groupBox13.Controls.Add(this.picEffect);
this.groupBox13.Location = new System.Drawing.Point(816, 65);
this.groupBox13.Name = "groupBox13";
this.groupBox13.Size = new System.Drawing.Size(431, 731);
this.groupBox13.TabIndex = 23;
this.groupBox13.TabStop = false;
this.groupBox13.Text = "拼图效果";
//
// pictureBox1
//
this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox1.Location = new System.Drawing.Point(14, 164);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(404, 349);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 1;
this.pictureBox1.TabStop = false;
//
// picEffect
//
this.picEffect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.picEffect.Location = new System.Drawing.Point(14, 17);
this.picEffect.Name = "picEffect";
this.picEffect.Size = new System.Drawing.Size(404, 708);
this.picEffect.TabIndex = 0;
this.picEffect.TabStop = false;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.btnAddCross);
this.groupBox3.Controls.Add(this.label10);
this.groupBox3.Controls.Add(this.txtLY);
this.groupBox3.Controls.Add(this.label11);
this.groupBox3.Controls.Add(this.txtNY);
this.groupBox3.Controls.Add(this.label12);
this.groupBox3.Controls.Add(this.label9);
this.groupBox3.Controls.Add(this.txtLX);
this.groupBox3.Controls.Add(this.label8);
this.groupBox3.Controls.Add(this.txtNX);
this.groupBox3.Controls.Add(this.label7);
this.groupBox3.Controls.Add(this.rdoCenter);
this.groupBox3.Controls.Add(this.rdoLeftTop);
this.groupBox3.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.groupBox3.Location = new System.Drawing.Point(12, 185);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(280, 160);
this.groupBox3.TabIndex = 2;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "添加位置";
//
// btnAddCross
//
this.btnAddCross.Location = new System.Drawing.Point(197, 113);
this.btnAddCross.Name = "btnAddCross";
this.btnAddCross.Size = new System.Drawing.Size(73, 23);
this.btnAddCross.TabIndex = 0;
this.btnAddCross.Text = "添加列表";
this.btnAddCross.UseVisualStyleBackColor = true;
this.btnAddCross.Click += new System.EventHandler(this.btnAddCross_Click);
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(168, 120);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(17, 12);
this.label10.TabIndex = 4;
this.label10.Text = "px";
//
// txtLY
//
this.txtLY.Location = new System.Drawing.Point(124, 110);
this.txtLY.Name = "txtLY";
this.txtLY.Size = new System.Drawing.Size(43, 21);
this.txtLY.TabIndex = 7;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(97, 113);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(29, 12);
this.label11.TabIndex = 8;
this.label11.Text = "间距";
//
// txtNY
//
this.txtNY.Location = new System.Drawing.Point(43, 110);
this.txtNY.Name = "txtNY";
this.txtNY.Size = new System.Drawing.Size(43, 21);
this.txtNY.TabIndex = 5;
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(16, 113);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(29, 12);
this.label12.TabIndex = 6;
this.label12.Text = "行数";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(168, 78);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(17, 12);
this.label9.TabIndex = 0;
this.label9.Text = "px";
//
// txtLX
//
this.txtLX.Location = new System.Drawing.Point(124, 68);
this.txtLX.Name = "txtLX";
this.txtLX.Size = new System.Drawing.Size(41, 21);
this.txtLX.TabIndex = 2;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(97, 71);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(29, 12);
this.label8.TabIndex = 3;
this.label8.Text = "间距";
//
// txtNX
//
this.txtNX.Location = new System.Drawing.Point(43, 68);
this.txtNX.Name = "txtNX";
this.txtNX.Size = new System.Drawing.Size(41, 21);
this.txtNX.TabIndex = 0;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(16, 71);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(29, 12);
this.label7.TabIndex = 0;
this.label7.Text = "列数";
//
// rdoCenter
//
this.rdoCenter.AutoSize = true;
this.rdoCenter.Location = new System.Drawing.Point(108, 35);
this.rdoCenter.Name = "rdoCenter";
this.rdoCenter.Size = new System.Drawing.Size(47, 16);
this.rdoCenter.TabIndex = 1;
this.rdoCenter.Text = "中心";
this.rdoCenter.UseVisualStyleBackColor = true;
//
// rdoLeftTop
//
this.rdoLeftTop.AutoSize = true;
this.rdoLeftTop.Checked = true;
this.rdoLeftTop.Location = new System.Drawing.Point(17, 35);
this.rdoLeftTop.Name = "rdoLeftTop";
this.rdoLeftTop.Size = new System.Drawing.Size(47, 16);
this.rdoLeftTop.TabIndex = 0;
this.rdoLeftTop.TabStop = true;
this.rdoLeftTop.Text = "左上";
this.rdoLeftTop.UseVisualStyleBackColor = true;
//
// groupBox4
//
this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox4.Controls.Add(this.btnModify);
this.groupBox4.Controls.Add(this.btnDel);
this.groupBox4.Controls.Add(this.dgvRegionTeb);
this.groupBox4.Location = new System.Drawing.Point(12, 351);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(280, 445);
this.groupBox4.TabIndex = 0;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "位置列表";
//
// btnModify
//
this.btnModify.Location = new System.Drawing.Point(233, 24);
this.btnModify.Name = "btnModify";
this.btnModify.Size = new System.Drawing.Size(37, 23);
this.btnModify.TabIndex = 2;
this.btnModify.Text = "改";
this.btnModify.UseVisualStyleBackColor = true;
this.btnModify.Click += new System.EventHandler(this.btnModify_Click);
//
// btnDel
//
this.btnDel.Location = new System.Drawing.Point(182, 24);
this.btnDel.Name = "btnDel";
this.btnDel.Size = new System.Drawing.Size(37, 23);
this.btnDel.TabIndex = 0;
this.btnDel.Text = "删";
this.btnDel.UseVisualStyleBackColor = true;
this.btnDel.Click += new System.EventHandler(this.btnDel_Click);
//
// dgvRegionTeb
//
this.dgvRegionTeb.AllowUserToAddRows = false;
this.dgvRegionTeb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.dgvRegionTeb.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvRegionTeb.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvRegionTeb.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.id,
this.x,
this.y,
this.z});
this.dgvRegionTeb.Location = new System.Drawing.Point(3, 53);
this.dgvRegionTeb.Name = "dgvRegionTeb";
this.dgvRegionTeb.RowHeadersVisible = false;
this.dgvRegionTeb.RowHeadersWidth = 51;
this.dgvRegionTeb.RowTemplate.Height = 23;
this.dgvRegionTeb.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvRegionTeb.Size = new System.Drawing.Size(274, 380);
this.dgvRegionTeb.TabIndex = 1;
this.dgvRegionTeb.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvRegionTeb_CellMouseClick);
this.dgvRegionTeb.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvRegionTeb_CellMouseDoubleClick);
//
// id
//
this.id.FillWeight = 50F;
this.id.MinimumWidth = 6;
this.id.Name = "id";
this.id.ReadOnly = true;
this.id.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// x
//
this.x.FillWeight = 60F;
this.x.HeaderText = "X";
this.x.MinimumWidth = 6;
this.x.Name = "x";
this.x.ReadOnly = true;
this.x.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// y
//
this.y.FillWeight = 60F;
this.y.HeaderText = "Y";
this.y.MinimumWidth = 6;
this.y.Name = "y";
this.y.ReadOnly = true;
this.y.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// z
//
this.z.FillWeight = 60F;
this.z.HeaderText = "Z";
this.z.MinimumWidth = 6;
this.z.Name = "z";
this.z.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// ListOfLocationsDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1253, 804);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox13);
this.Controls.Add(this.groupBox6);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.MinimumSize = new System.Drawing.Size(1269, 843);
this.Name = "ListOfLocationsDialog";
this.Text = "位置列表";
this.Load += new System.EventHandler(this.ListOfLocationsDialog_Load);
this.Controls.SetChildIndex(this.groupBox1, 0);
this.Controls.SetChildIndex(this.groupBox2, 0);
this.Controls.SetChildIndex(this.groupBox6, 0);
this.Controls.SetChildIndex(this.groupBox13, 0);
this.Controls.SetChildIndex(this.groupBox3, 0);
this.Controls.SetChildIndex(this.groupBox4, 0);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.trackPercentage)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.trackTime)).EndInit();
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
this.groupBox12.ResumeLayout(false);
this.groupBox11.ResumeLayout(false);
this.groupBox10.ResumeLayout(false);
this.groupBox9.ResumeLayout(false);
this.groupBox13.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picEffect)).EndInit();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox4.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvRegionTeb)).EndInit();
this.ResumeLayout(false);
}
#endregion
#region 控件
private GroupBox groupBox1;
private GroupBox groupBox2;
private GroupBox groupBox6;
private GroupBox groupBox12;
private GroupBox groupBox11;
private GroupBox groupBox10;
private GroupBox groupBox9;
private GroupBox groupBox4;
private GroupBox groupBox3;
private GroupBox groupBox13;
private Label label6;
private Label label5;
private Label label3;
private Label label2;
private Label label1;
private Label lblUnit;
private Button btnStop;
private Button btnCreatImgFile;
private Button btnWorking;
private Button btnWhiteBalance;
private CheckBox chkAutoExposure;
private TextBox txtPercentage;
private TextBox txtTime;
private TrackBar trackPercentage;
private TrackBar trackTime;
private Button btnOther;
private Label label16;
private Panel pnlSpeed;
private Label label4;
private ComboBox cmbStepUnit;
private Panel panelVision;
private Panel panelMotion;
private Panel panelControl;
private PictureBox pictureBox1;
private PictureBox picEffect;
private RadioButton rdoCenter;
private RadioButton rdoLeftTop;
private TextBox txtLX;
private Label label8;
private TextBox txtNX;
private Label label7;
private Button btnAddCross;
private Label label10;
private TextBox txtLY;
private Label label11;
private TextBox txtNY;
private Label label12;
private Label label9;
private Label label18;
private Label label17;
private Label label15;
private DataGridView dgvRegionTeb;
private Button btnDelete;
private Button btnSave;
private Button btnSaveAs;
private ComboBox cmbFile;
private Button btnDel;
private Button btnModify;
private DataGridViewTextBoxColumn id;
private DataGridViewTextBoxColumn x;
private DataGridViewTextBoxColumn y;
private DataGridViewTextBoxColumn z;
private CircleControl circleControl;
private CircleControl circleSportControl;
#endregion
private System.Timers.Timer m_aeTimer;
private Mat m_merge;
private Thread m_stitchingThread;
private double m_scale = 1;
private bool m_isDoing;
///
/// Y轴單次进长度
///
protected override double StepLenthX
{
get
{
string text = txtXStep.Text.Trim();
if (string.IsNullOrEmpty(text))
{
throw new Exception("Y" + PdnResources.GetString("Menu.TheXaxismovestepannotbeempty0.Text"));
}
var value = double.Parse(text);
if (cmbStepUnit.SelectedItem.ToString().Equals("mm"))
{
value *= 1000;
}
return value;
}
}
///
/// Y轴單次进长度
///
protected override double StepLenthY
{
get
{
string text = txtYStep.Text.Trim();
if (string.IsNullOrEmpty(text))
{
throw new Exception("Y" + PdnResources.GetString("Menu.TheXaxismovestepannotbeempty0.Text"));
}
var value = double.Parse(text);
if (cmbStepUnit.SelectedItem.ToString().Equals("mm"))
{
value *= 1000;
}
return value;
}
}
///
/// Z轴步进长度
///
protected override double StepLenthZ
{
get
{
string text = txtZStep.Text.Trim();
if (string.IsNullOrEmpty(text))
{
throw new Exception("Z" + PdnResources.GetString("Menu.TheXaxismovestepannotbeempty0.Text"));
}
var value = double.Parse(text);
if (cmbStepUnit.SelectedItem.ToString().Equals("mm"))
{
value *= 1000;
}
return value;
}
}
public ListOfLocationsDialog() : base()
{
InitializeComponent();
}
public ListOfLocationsDialog(AppWorkspace appWorkspace) : base(appWorkspace)
{
InitializeComponent();
InitializeLanguageText();
m_aeTimer = new System.Timers.Timer(1000);
m_aeTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimerAutoExposure);
m_aeTimer.AutoReset = true;
m_aeTimer.SynchronizingObject = this;
this.panelControl.Controls.Add(m_documentWorkspace);
this.m_documentWorkspace.GraphicsList.SelectChanged += GraphicsList_SelectChanged;
circleControl = initViewCircal(71);
circleSportControl = initSportCircal(71);
this.panelVision.Controls.Add(this.circleControl);
this.panelMotion.Controls.Add(this.circleSportControl);
this.InitComFile(null);
// 初始化步长单位
this.cmbStepUnit.Items.Clear();
this.cmbStepUnit.Items.AddRange(m_unit);
this.cmbStepUnit.SelectedIndex = 1;
//this.UpdateBtnState();
this.btnStop.Enabled = false;
}
#region 相机设置
///
/// 初始化相机设置相关控件
///
protected override void initCameraSetting()
{
int exposureVal = (int)(m_cameraParamModel.parame.LNExposure);
if (exposureVal >= trackTime.Minimum && exposureVal <= trackTime.Maximum)
{
trackTime.Value = exposureVal;
}
UpdateExposureUI(m_cameraParamModel.parame.ATExposure);
}
protected override void GetMouseLeftClickPoint(object sender, EventArgs e)
{
if (!this.m_isReset)
{
MessageBox.Show(PdnResources.GetString("Menu.Pleaseresetfirst.Text"));
return;
}
PointF pointF = (PointF)sender;
List graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
int count = graphicsList.Count;
for (int i = 0; i < count; i++)
{
List points = ((DrawLocationCross)graphicsList[i]).GetRulerPoints();
RectangleF rectangleF = new RectangleF(points[0], new SizeF(points[1].X - points[0].X, points[1].Y - points[0].Y));
if (rectangleF.Contains(pointF))
{
pointF = (PointF)points[0];
}
}
// 移动操作台和视图
// 移动X轴
var x = ConvertPXToUm((int)(pointF.X));
var y = ConvertPXToUm((int)(pointF.Y));
m_Stage.To(x, y);
}
///
/// 自动曝光
///
///
///
private void chkAutoExposure_Click(object sender, EventArgs e)
{
int autoExposure = chkAutoExposure.Checked ? 1 : 0;
m_cameraParamModel.parame.ATExposure = autoExposure;
if (autoExposure == 0)
{
trackPercentage.Value = 100;
}
UpdateExposureUI(autoExposure);
}
private void UpdateExposureUI(int autoExposure)
{
if (autoExposure == 1)
{
// 自动曝光
trackTime.Enabled = false;
txtTime.Enabled = false;
trackPercentage.Enabled = false;
txtPercentage.Enabled = false;
chkAutoExposure.Checked = true;
trackPercentage.Value = 100;
m_aeTimer.Start();
}
else
{
trackTime.Enabled = true;
txtTime.Enabled = true;
trackPercentage.Enabled = true;
txtPercentage.Enabled = true;
chkAutoExposure.Checked = false;
m_aeTimer.Stop();
}
}
public void OnTimerAutoExposure(object source, System.Timers.ElapsedEventArgs e)
{
double paramValue = m_camera.ExposureTime;
int expValue = (int)(paramValue * 1000);
if (expValue < 137)
{
expValue = 130;
}
if (expValue > 15000000)
{
expValue = 15000000;
}
trackTime.Value = expValue;
this.txtTime.Text = paramValue.ToString();
}
#endregion
protected override void ReinitSpeedUI()
{
InitGroupSpeed(pnlSpeed, SpeedChanged);
}
protected void SpeedChanged(object sender, EventArgs e)
{
RadioButton radio = (RadioButton)sender;
if (radio.Checked)
{
int index = (int)radio.Tag;
m_Stage.SetSpeedXY(m_speedLists[index].LSpeed);
m_Stage.SetSpeedZ(m_speedLists[index].ZSpeed);
}
}
private void UpdateBtnState()
{
if (m_isDoing)
{
this.Invoke(new Action(() =>
{
btnWorking.Enabled = false;
btnStop.Enabled = true;
}));
}
else
{
this.Invoke(new Action(() =>
{
btnWorking.Enabled = true;
btnStop.Enabled = false;
}));
}
}
private void btnStop_Click(object sender, EventArgs e)
{
m_isDoing = false;
this.UpdateBtnState();
}
private void btnCreatImgFile_Click(object sender, EventArgs e)
{
if (m_mergeBitMap == null)
{
MessageBox.Show(PdnResources.GetString("Menu.NoMosaicimagefound.Text"));
return;
}
//获取命名
string photoName;
if (Startup.instance.ruleDB == null)
{
photoName = NamingRuleHelper.GetNameFromXml(Startup.instance.configModel, "默认标尺", "0");
}
else
{
photoName = NamingRuleHelper.GetNameFromXml(Startup.instance.configModel, Startup.instance.ruleDB.ruler_name, Startup.instance.ruleDB.gain_multiple.ToString());
}
DocumentWorkspace dw = m_appWorkspace.AddNewDocumentWorkspace();
Document document = Document.FromImageMat(Camera.Tools.ToMat(m_mergeBitMap));
document.Dirty = true;
dw.Document = document;
dw.fileText = photoName;
//dw.rules = new Dictionary(Startup.instance.rules);
dw.xmlSaveModel = Startup.instance.ruleDB;
dw.InitRulerInfo();
//激活
m_appWorkspace.ActiveDocumentWorkspace = dw;
//锁定扩缩
if (m_appWorkspace.isLockZoom && m_appWorkspace.lockScaleRatio > 0)
{
m_appWorkspace.ActiveDocumentWorkspace.ZoomBasis = ZoomBasis.ScaleFactor;
m_appWorkspace.ActiveDocumentWorkspace.ScaleFactor = ScaleFactor.FromDouble(m_appWorkspace.lockScaleRatio);
m_appWorkspace.SetZoonTrackValue(m_appWorkspace.ActiveDocumentWorkspace.ScaleFactor);
}
else
{
m_appWorkspace.ActiveDocumentWorkspace.ZoomBasis = ZoomBasis.FitToWindow;
}
m_appWorkspace.Refresh();
}
private void ListOfLocationsDialog_Load(object sender, EventArgs e)
{
this.panelControl.AutoScrollPosition = new System.Drawing.Point(0, 0);
}
///
/// 添加列表(创建十字线)
///
///
///
private void btnAddCross_Click(object sender, EventArgs e)
{
//m_documentWorkspace.GraphicsList.Clear();
if (txtNX.Text.Trim().Length == 0)
{
MessageBox.Show("NX" + PdnResources.GetString("Menu.Cantbeempty.Text"));
return;
}
if (txtLX.Text.Trim().Length == 0)
{
MessageBox.Show("LX" + PdnResources.GetString("Menu.Cantbeempty.Text"));
return;
}
if (txtNY.Text.Trim().Length == 0)
{
MessageBox.Show("NY" + PdnResources.GetString("Menu.Cantbeempty.Text"));
return;
}
if (txtLY.Text.Trim().Length == 0)
{
MessageBox.Show("LY" + PdnResources.GetString("Menu.Cantbeempty.Text"));
return;
}
int nx = int.Parse(txtNX.Text);
int ny = int.Parse(txtNY.Text);
int lx = int.Parse(txtLX.Text);
int ly = int.Parse(txtLY.Text);
System.Drawing.Point start = new System.Drawing.Point();
if (rdoLeftTop.Checked)
{
start.X = m_viewWidth / 2;
start.Y = m_viewHeight / 2;
}
else
{
start.X = 0;
start.Y = 0;
}
for (int i = 0; i < ny; i++)
{
for (int j = 0; j < nx; j++)
{
m_documentWorkspace.ActiveTool = DrawToolType.DrawLocationCross;
int x = start.X + j * lx;
int y = start.Y + i * ly;
m_documentWorkspace.CreateLocationCross(x, y, m_viewWidth, m_viewHeight, 0);
}
}
m_documentWorkspace.Refresh();
}
private void dgvRegionTeb_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
this.m_documentWorkspace.GraphicsList.UnselectAll();
for (int i = 0; i < dgvRegionTeb.Rows.Count; i++)
{
if (dgvRegionTeb.Rows[i].Selected)
{
this.m_documentWorkspace.GraphicsList[i].Selected = true;
}
else
{
this.m_documentWorkspace.GraphicsList[i].Selected = false;
}
}
this.m_documentWorkspace.Refresh();
}
private void GraphicsList_SelectChanged(object sender, EventArgs e)
{
this.DgvRegionTebRefresh();
}
private void DgvRegionTebRefresh()
{
dgvRegionTeb.Rows.Clear();
List graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
int count = graphicsList.Count;
for (int i = 0; i < count; i++)
{
Dictionary point = ((DrawLocationCross)graphicsList[i]).GetViewPoints();
if (point.Count > 0)
{
PointF pointF = (PointF)point[0];
string z = m_Stage.Z.ToString("F2");
if (point.Count == 2)
{
z = point[1].ToString();
}
else
{
point[1] = z;
}
dgvRegionTeb.Rows.Add(i, pointF.X, pointF.Y, z);
if (graphicsList[i].Selected)
{
dgvRegionTeb.Rows[i].Selected = true;
dgvRegionTeb.CurrentCell = dgvRegionTeb.Rows[i].Cells[0];
}
}
}
}
private void btnDel_Click(object sender, EventArgs e)
{
if (dgvRegionTeb.SelectedRows.Count <= 0)
{
MessageBox.Show(PdnResources.GetString("Menu.Selectthedatatoelete0.Text"));
return;
}
DialogResult result = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretodelete.Text") + "?", PdnResources.GetString("Menu.Tips.text"), MessageBoxButtons.OKCancel);
if (result == DialogResult.OK)
{
//执行删除
foreach (DataGridViewRow r in dgvRegionTeb.SelectedRows)
{
if (!r.IsNewRow)
{
this.m_documentWorkspace.GraphicsList.RemoveAt(r.Index);
}
}
this.DgvRegionTebRefresh();
foreach (DataGridViewRow r in dgvRegionTeb.SelectedRows)
{
if (!r.IsNewRow)
{
this.m_documentWorkspace.GraphicsList[r.Index].Selected = true;
}
}
this.m_documentWorkspace.Refresh();
}
}
private void OpenZModifyDialog(int index, Dictionary point)
{
ZModifyDialog dg = new ZModifyDialog(index, point);
dg.Modified += ZModifyDialog_Modified;
dg.ShowDialog();
}
private void ZModifyDialog_Modified(int vIndex, Dictionary point)
{
List graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
int count = graphicsList.Count;
for (int i = 0; i < count; i++)
{
if (i == vIndex)
{
((DrawLocationCross)graphicsList[i]).SetZPostion(point);
}
}
this.DgvRegionTebRefresh();
}
private void dgvRegionTeb_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{
List graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
int count = graphicsList.Count;
for (int i = 0; i < count; i++)
{
if (i == e.RowIndex)
{
this.OpenZModifyDialog(i, ((DrawLocationCross)graphicsList[i]).GetViewPoints());
}
}
}
private void btnModify_Click(object sender, EventArgs e)
{
if (dgvRegionTeb.SelectedRows.Count != 1)
{
MessageBox.Show(PdnResources.GetString("Menu.Selectwofdata.text"));
return;
}
foreach (DataGridViewRow r in dgvRegionTeb.SelectedRows)
{
if (!r.IsNewRow)
{
List graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
this.OpenZModifyDialog(r.Index, ((DrawLocationCross)graphicsList[r.Index]).GetViewPoints());
}
}
}
List m_items = new List();
private void CreatModelList()
{
m_items.Clear();
List graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
int count = graphicsList.Count;
for (int i = 0; i < count; i++)
{
List pointFs = ((DrawLocationCross)graphicsList[i]).GetRulerPoints();
Dictionary point = ((DrawLocationCross)graphicsList[i]).GetViewPoints();
if (point.Count > 0)
{
PointF pointF = (PointF)pointFs[0];
string z = m_Stage.Z.ToString("F2");
if (point.Count == 2)
{
z = point[1].ToString();
}
LocationModel.Item item = new LocationModel.Item();
item.x = pointF.X;
item.y = pointF.Y;
item.z = long.Parse(z);
m_items.Add(item);
}
}
}
private void InitComFile(string name)
{
cmbFile.Items.Clear();
string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Location\\";
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
List files = FileOperationHelper.GetFileList(filePath);
foreach (string file in files)
{
string fileName = file.Replace(".xml", "");
cmbFile.Items.Add(fileName);
}
if (name != null && name.Length > 0)
{
cmbFile.Text = name;
}
else
{
cmbFile.Text = "";
}
}
LocationModel m_locationModel;
private void cmbFile_SelectedIndexChanged(object sender, EventArgs e)
{
string fileName = cmbFile.Text.Trim();
if (fileName.Length != 0)
{
m_locationModel = XmlSerializeHelper.DESerializer(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Location\\" + fileName + ".xml", FileMode.Open));
m_documentWorkspace.GraphicsList.Clear();
for (int i = 0; i < m_locationModel.items.Count; i++)
{
m_documentWorkspace.ActiveTool = DrawToolType.DrawLocationCross;
int x = (int)m_locationModel.items[i].x;
int y = (int)m_locationModel.items[i].y;
m_documentWorkspace.CreateLocationCross(x, y, m_viewWidth, m_viewHeight, (int)m_locationModel.items[i].z);
}
this.m_documentWorkspace.Refresh();
this.DgvRegionTebRefresh();
}
}
///
/// 保存
///
///
///
private void btnSave_Click(object sender, EventArgs e)
{
CreatModelList();
if (cmbFile.Text.Trim().Length == 0)
{
SaveAsDialog dg = new SaveAsDialog(m_items);
dg.Saved += InitComFile;
dg.ShowDialog();
}
else
{
string name = cmbFile.Text.Trim();
string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Location\\";
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
m_locationModel = new LocationModel();
m_locationModel.items = m_items;
string stageModelXml = XmlSerializeHelper.XmlSerialize(m_locationModel);
filePath = filePath + name + ".xml";
if (!FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create))
{
MessageBox.Show(PdnResources.GetString("Menu.Savefailed.text"));
}
}
}
///
/// 另存为
///
///
///
private void btnSaveAs_Click(object sender, EventArgs e)
{
CreatModelList();
SaveAsDialog dg = new SaveAsDialog(m_items);
dg.Saved += InitComFile;
dg.ShowDialog();
}
///
/// 删除
///
///
///
private void btnDelete_Click(object sender, EventArgs e)
{
if (cmbFile.Text.Trim().Length == 0)
{
MessageBox.Show(PdnResources.GetString("Menu.Pleasselectthesavedfilefirst.Text"));
return;
}
DialogResult result = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretodelete.Text") + "?", PdnResources.GetString("Menu.Tips.text"), MessageBoxButtons.OKCancel);
if (result == DialogResult.OK)
{
string name = cmbFile.Text.Trim();
string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Location\\" + name + ".xml";
if (System.IO.File.Exists(filePath))
{
System.IO.File.Delete(filePath);
InitComFile(null);
this.m_documentWorkspace.GraphicsList.Clear();
this.m_documentWorkspace.Refresh();
this.dgvRegionTeb.Rows.Clear();
MessageBox.Show(PdnResources.GetString("Menu.successfullydeleted.text"));
}
else
{
MessageBox.Show(PdnResources.GetString("Menu.Nodeletedfilesfound.Text"));
}
}
}
private void btnWorking_Click(object sender, EventArgs e)
{
if (!m_camera.IsOpen())
{
MessageBox.Show(PdnResources.GetString("Menu.Pleaseconfirmwhetherthecameraisconnected.Text"));
return;
}
if (!m_isReset)
{
MessageBox.Show(PdnResources.GetString("Menu.Pleaseresetfirst.Text"));
return;
}
if (this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch).Count <= 0)
{
MessageBox.Show(PdnResources.GetString("Menu.Pleasereatethepuzzleareafirst.Text"));
return;
}
m_isDoing = true;
this.UpdateBtnState();
m_stitchingThread = new Thread(new ThreadStart(WaitForStitchingThreadEntry));
m_stitchingThread.Start();
}
//private string m_filePath = Application.StartupPath + "\\Picture\\";
private Bitmap m_mergeBitMap;
private PointF m_pointFStart;
private void WaitForStitchingThreadEntry()
{
List graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
int count = graphicsList.Count;
for (int i = 0; i < count; i++)
{
if (!m_isDoing)
{
return;
}
List points = ((DrawLocationCross)graphicsList[i]).GetRulerPoints();
PointF nextP = points[0];
var x = ConvertPXToUm((int)(nextP.X));
var y = ConvertPXToUm((int)(nextP.Y));
base.m_Stage.To(x, y);
do
{
Thread.Sleep(250);
}
while (m_Stage.StateX > 1 || m_Stage.StateY > 1);
Thread.Sleep(100);
//m_camera.m_bufHandler -= CallbackDraw;
m_merge = PaintDotNet.Camera.Tools.ToMat(m_BitmapCurrent);
//m_camera.m_bufHandler += CallbackDraw;
var Image = this.MatchPic(i, m_merge, nextP);
m_mergeBitMap = (Bitmap)Image.Clone();
pictureBox1.Image = Image;
if (m_pointFStart.X > nextP.X)
{
m_pointFStart.X = nextP.X;
}
if (m_pointFStart.Y > nextP.Y)
{
m_pointFStart.Y = nextP.Y;
}
}
m_isDoing = false;
this.UpdateBtnState();
}
private Bitmap MatchPic(int index, Mat mat, PointF currentPointF)
{
Bitmap bitmap;
if (index == 0)
{
bitmap = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat);
m_pointFStart = currentPointF;
}
else
{
int width;
int height;
if (m_pointFStart.X > currentPointF.X)
{
width = (int)Math.Ceiling((m_pointFStart.X - currentPointF.X) + m_mergeBitMap.Width);
width = width > m_mergeBitMap.Width ? width : m_mergeBitMap.Width;
}
else
{
width = (int)Math.Ceiling((currentPointF.X - m_pointFStart.X) + mat.Width);
width = width > m_mergeBitMap.Width ? width : m_mergeBitMap.Width;
}
if (m_pointFStart.Y > currentPointF.Y)
{
height = (int)Math.Ceiling((m_pointFStart.Y - currentPointF.Y) + m_mergeBitMap.Height);
height = height > m_mergeBitMap.Height ? height : m_mergeBitMap.Height;
}
else
{
height = (int)Math.Ceiling((currentPointF.Y - m_pointFStart.Y) + mat.Height);
height = height > m_mergeBitMap.Height ? height : m_mergeBitMap.Height;
}
PointF point = new PointF();
if (m_pointFStart.X > currentPointF.X)
{
point.X = currentPointF.X;
}
else
{
point.X = m_pointFStart.X;
}
if (m_pointFStart.Y > currentPointF.Y)
{
point.Y = currentPointF.Y;
}
else
{
point.Y = m_pointFStart.Y;
}
if (width > 30000 || height > 30000)
{
m_scale = m_scale * 0.5;
width = width / 2;
height = height / 2;
OpenCvSharp.Cv2.Resize(mat, mat, new OpenCvSharp.Size(mat.Width * m_scale, mat.Height * m_scale));
OpenCvSharp.Mat targetMat = PaintDotNet.Camera.Tools.ToMat(this.m_mergeBitMap);
OpenCvSharp.Cv2.Resize(targetMat, targetMat, new OpenCvSharp.Size(targetMat.Width / 2, targetMat.Height / 2));
m_mergeBitMap = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(targetMat);
}
Bitmap merge = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat);
bitmap = new Bitmap(width, height);
Graphics g = Graphics.FromImage(bitmap);
g.DrawImage(merge, (float)Math.Abs((currentPointF.X - point.X) * m_scale), (float)Math.Abs((currentPointF.Y - point.Y) * m_scale), merge.Width, merge.Height);
g.DrawImage(m_mergeBitMap, (float)Math.Abs((m_pointFStart.X - point.X) * m_scale), (float)Math.Abs((m_pointFStart.Y - point.Y) * m_scale), m_mergeBitMap.Width, m_mergeBitMap.Height);
merge.Dispose();
g.Dispose();
m_pointFStart = point;
}
return bitmap;
}
}
}