MultiDimensionaDialog.cs 110 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428
  1. using OpenCvSharp;
  2. using PaintDotNet.Adjust;
  3. using PaintDotNet.Adjust.BaseImage;
  4. using PaintDotNet.Annotation;
  5. using PaintDotNet.Annotation.Enum;
  6. using PaintDotNet.Annotation.ImageCollect;
  7. using PaintDotNet.Base.CommTool;
  8. using PaintDotNet.Base.SettingModel;
  9. using PaintDotNet.CustomControl;
  10. using PaintDotNet.ImageCollect;
  11. using PaintDotNet.ImageCollect.CameraEDOF;
  12. using PaintDotNet.ImageCollect.ImageStitching;
  13. using PaintDotNet.ImageCollect.MultiDimensiona;
  14. using PaintDotNet.Setting;
  15. using StageController;
  16. using System;
  17. using System.Collections.Generic;
  18. using System.ComponentModel;
  19. using System.Data;
  20. using System.Drawing;
  21. using System.Drawing.Drawing2D;
  22. using System.IO;
  23. using System.Linq;
  24. using System.Management;
  25. using System.Runtime.InteropServices;
  26. using System.Text;
  27. using System.Threading;
  28. using System.Threading.Tasks;
  29. using System.Windows.Forms;
  30. using System.Windows.Interop;
  31. using TUCAMAPI;
  32. using TUCamera;
  33. using PaintDotNet.Hardware;
  34. using OpenCvSharp.Extensions;
  35. namespace PaintDotNet.ImageCollect
  36. {
  37. internal class MultiDimensionaDialog : HardwareBaseDialog
  38. {
  39. #region
  40. private System.ComponentModel.IContainer components = null;
  41. protected override void Dispose(bool disposing)
  42. {
  43. if (disposing && (components != null))
  44. {
  45. components.Dispose();
  46. }
  47. base.Dispose(disposing);
  48. }
  49. #endregion
  50. #region Windows Form Designer generated code
  51. private new void InitializeLanguageText()
  52. {
  53. this.groupBox13.Text = PdnResources.GetString("Menu.Puzzleeffect.text");
  54. this.groupBox7.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.SplicingSettings.text");
  55. this.ckSeamless.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.Seamlesspattern.text");
  56. this.ckTile.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.tilemode.text");
  57. this.label13.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.Stitchingway.text") + ":";
  58. this.groupBox5.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.Listofpuzzleareas.text");
  59. this.ckSize.Text = PdnResources.GetString("Menu.size.text");
  60. this.ckLockNull.Text = PdnResources.GetString("Menu.nothing.Text");
  61. this.ckArea.Text = PdnResources.GetString("Menu.area.text");
  62. this.label12.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.Lockingmethod.text") + ":";
  63. this.btnDel.Text = PdnResources.GetString("Menu.Edit.Delete.Text");
  64. this.btnDetailed.Text = PdnResources.GetString("Menu.detailed.text");
  65. this.groupBox4.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.Puzzleway.text");
  66. this.ckOther.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.user-defined.text");
  67. this.btnEstablish.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.Createpuzzlearea.text");
  68. this.ckPolygon.Text = PdnResources.GetString("Menu.LabelAction.DrawPolygon.Text");
  69. this.ckRectangle.Text = PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text");
  70. this.ckCircular.Text = PdnResources.GetString("Menu.circular.Text");
  71. this.groupBox2.Text = PdnResources.GetString("Menu.ImageCollection.CameraSetting.Text");
  72. this.btnWhiteBalance.Text = PdnResources.GetString("Menu.auto.text") + PdnResources.GetString("Menu.Image.WhiteBalance.Text");
  73. this.chkAutoExposure.Text = PdnResources.GetString("Menu.auto-exposure.text");
  74. this.btnOther.Text = PdnResources.GetString("Menu.othersettings.text");
  75. this.label6.Text = PdnResources.GetString("Menu.Exposurepercentage.text") + ":";
  76. this.label5.Text = PdnResources.GetString("Menu.timeofexposure.text") + ":";
  77. this.groupBox6.Text = PdnResources.GetString("Menu.HardwareControl.Text");
  78. this.btnDsRocker.Text = PdnResources.GetString("Menu.Disabletherocker.text");
  79. this.label4.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.speed.text") + ":";
  80. this.groupBox12.Text = PdnResources.GetString("Menu.Fixedlength.text");
  81. this.groupBox11.Text = PdnResources.GetString("Menu.continuous.text");
  82. this.groupBox10.Text = PdnResources.GetString("Menu.viewmode.text");
  83. this.btnInloadstage.Text = PdnResources.GetString("Menu.enterfilm.text");
  84. this.groupBox9.Text = PdnResources.GetString("Menu.movementmode.text");
  85. this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
  86. this.btnStop.Text = PdnResources.GetString("Menu.stop.text");
  87. this.btnCreatImgFile.Text = PdnResources.GetString("Menu.Createpicture.text");
  88. this.btnWorking.Text = PdnResources.GetString("Menu.Started.text");
  89. this.groupBox3.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.Listofpuzzleareas.text");
  90. this.Text = PdnResources.GetString("Menu.ImageCollection.MultiDimensional.Text");
  91. base.InitializeLanguageText();
  92. }
  93. private void InitializeComponent()
  94. {
  95. this.panelall = new System.Windows.Forms.Panel();
  96. this.groupBox13 = new System.Windows.Forms.GroupBox();
  97. this.cmbStitchList = new System.Windows.Forms.ComboBox();
  98. this.pictureBox1 = new System.Windows.Forms.PictureBox();
  99. this.picEffect = new System.Windows.Forms.PictureBox();
  100. this.groupBox7 = new System.Windows.Forms.GroupBox();
  101. this.ckSeamless = new System.Windows.Forms.RadioButton();
  102. this.ckTile = new System.Windows.Forms.RadioButton();
  103. this.label13 = new System.Windows.Forms.Label();
  104. this.groupBox5 = new System.Windows.Forms.GroupBox();
  105. this.ckSize = new System.Windows.Forms.RadioButton();
  106. this.ckLockNull = new System.Windows.Forms.RadioButton();
  107. this.ckArea = new System.Windows.Forms.RadioButton();
  108. this.label12 = new System.Windows.Forms.Label();
  109. this.dgvRegionTeb = new System.Windows.Forms.DataGridView();
  110. this.regionId = new System.Windows.Forms.DataGridViewTextBoxColumn();
  111. this.regionName = new System.Windows.Forms.DataGridViewTextBoxColumn();
  112. this.regionTiles = new System.Windows.Forms.DataGridViewTextBoxColumn();
  113. this.regionZ = new System.Windows.Forms.DataGridViewTextBoxColumn();
  114. this.regionArea = new System.Windows.Forms.DataGridViewTextBoxColumn();
  115. this.btnDel = new System.Windows.Forms.Button();
  116. this.btnDetailed = new System.Windows.Forms.Button();
  117. this.groupBox4 = new System.Windows.Forms.GroupBox();
  118. this.numOverlapRate = new System.Windows.Forms.NumericUpDown();
  119. this.label19 = new System.Windows.Forms.Label();
  120. this.ckOther = new System.Windows.Forms.RadioButton();
  121. this.btnEstablish = new System.Windows.Forms.Button();
  122. this.label11 = new System.Windows.Forms.Label();
  123. this.label10 = new System.Windows.Forms.Label();
  124. this.label9 = new System.Windows.Forms.Label();
  125. this.txtAreaY = new System.Windows.Forms.TextBox();
  126. this.txtSizeY = new System.Windows.Forms.TextBox();
  127. this.txtTilesY = new System.Windows.Forms.TextBox();
  128. this.txtAreaX = new System.Windows.Forms.TextBox();
  129. this.txtSizeX = new System.Windows.Forms.TextBox();
  130. this.txtTilesX = new System.Windows.Forms.TextBox();
  131. this.label8 = new System.Windows.Forms.Label();
  132. this.label7 = new System.Windows.Forms.Label();
  133. this.ckPolygon = new System.Windows.Forms.RadioButton();
  134. this.ckRectangle = new System.Windows.Forms.RadioButton();
  135. this.ckCircular = new System.Windows.Forms.RadioButton();
  136. this.groupBox2 = new System.Windows.Forms.GroupBox();
  137. this.btnWhiteBalance = new System.Windows.Forms.Button();
  138. this.label16 = new System.Windows.Forms.Label();
  139. this.lblUnit = new System.Windows.Forms.Label();
  140. this.chkAutoExposure = new System.Windows.Forms.CheckBox();
  141. this.txtPercentage = new System.Windows.Forms.TextBox();
  142. this.txtTime = new System.Windows.Forms.TextBox();
  143. this.trackPercentage = new System.Windows.Forms.TrackBar();
  144. this.trackTime = new System.Windows.Forms.TrackBar();
  145. this.btnOther = new System.Windows.Forms.Button();
  146. this.label6 = new System.Windows.Forms.Label();
  147. this.label5 = new System.Windows.Forms.Label();
  148. this.groupBox6 = new System.Windows.Forms.GroupBox();
  149. this.label18 = new System.Windows.Forms.Label();
  150. this.label17 = new System.Windows.Forms.Label();
  151. this.label15 = new System.Windows.Forms.Label();
  152. this.pnlSpeed = new System.Windows.Forms.Panel();
  153. this.label4 = new System.Windows.Forms.Label();
  154. this.cmbStepUnit = new System.Windows.Forms.ComboBox();
  155. this.label3 = new System.Windows.Forms.Label();
  156. this.label2 = new System.Windows.Forms.Label();
  157. this.label1 = new System.Windows.Forms.Label();
  158. this.groupBox12 = new System.Windows.Forms.GroupBox();
  159. this.groupBox11 = new System.Windows.Forms.GroupBox();
  160. this.groupBox10 = new System.Windows.Forms.GroupBox();
  161. this.panelVision = new System.Windows.Forms.Panel();
  162. this.groupBox9 = new System.Windows.Forms.GroupBox();
  163. this.panelMotion = new System.Windows.Forms.Panel();
  164. this.panelControl = new System.Windows.Forms.Panel();
  165. this.groupBox1 = new System.Windows.Forms.GroupBox();
  166. this.btnStop = new System.Windows.Forms.Button();
  167. this.btnCreatImgFile = new System.Windows.Forms.Button();
  168. this.btnWorking = new System.Windows.Forms.Button();
  169. this.groupBox3 = new System.Windows.Forms.GroupBox();
  170. this.panelall.SuspendLayout();
  171. this.groupBox13.SuspendLayout();
  172. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
  173. ((System.ComponentModel.ISupportInitialize)(this.picEffect)).BeginInit();
  174. this.groupBox7.SuspendLayout();
  175. this.groupBox5.SuspendLayout();
  176. ((System.ComponentModel.ISupportInitialize)(this.dgvRegionTeb)).BeginInit();
  177. this.groupBox4.SuspendLayout();
  178. ((System.ComponentModel.ISupportInitialize)(this.numOverlapRate)).BeginInit();
  179. this.groupBox2.SuspendLayout();
  180. ((System.ComponentModel.ISupportInitialize)(this.trackPercentage)).BeginInit();
  181. ((System.ComponentModel.ISupportInitialize)(this.trackTime)).BeginInit();
  182. this.groupBox6.SuspendLayout();
  183. this.groupBox12.SuspendLayout();
  184. this.groupBox11.SuspendLayout();
  185. this.groupBox10.SuspendLayout();
  186. this.groupBox9.SuspendLayout();
  187. this.groupBox1.SuspendLayout();
  188. this.SuspendLayout();
  189. //
  190. // lblXPosition
  191. //
  192. this.lblXPosition.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  193. this.lblXPosition.AutoSize = true;
  194. this.lblXPosition.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  195. this.lblXPosition.Location = new System.Drawing.Point(426, 642);
  196. this.lblXPosition.Size = new System.Drawing.Size(28, 14);
  197. this.lblXPosition.TabIndex = 42;
  198. this.lblXPosition.Text = "X:0";
  199. //
  200. // lblYPosition
  201. //
  202. this.lblYPosition.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  203. this.lblYPosition.AutoSize = true;
  204. this.lblYPosition.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  205. this.lblYPosition.Location = new System.Drawing.Point(426, 668);
  206. this.lblYPosition.Size = new System.Drawing.Size(28, 14);
  207. this.lblYPosition.TabIndex = 43;
  208. this.lblYPosition.Text = "Y:0";
  209. //
  210. // lblZPosition
  211. //
  212. this.lblZPosition.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  213. this.lblZPosition.AutoSize = true;
  214. this.lblZPosition.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  215. this.lblZPosition.Location = new System.Drawing.Point(426, 693);
  216. this.lblZPosition.Size = new System.Drawing.Size(28, 14);
  217. this.lblZPosition.TabIndex = 44;
  218. this.lblZPosition.Text = "Z:0";
  219. //
  220. // btnFreeloadstage
  221. //
  222. this.btnFreeloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  223. this.btnFreeloadstage.Location = new System.Drawing.Point(72, 684);
  224. this.btnFreeloadstage.Size = new System.Drawing.Size(59, 31);
  225. this.btnFreeloadstage.TabIndex = 31;
  226. this.btnFreeloadstage.Text = "锁定";
  227. this.btnFreeloadstage.UseVisualStyleBackColor = true;
  228. //
  229. // btnStoploadstage
  230. //
  231. this.btnStoploadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  232. this.btnStoploadstage.Location = new System.Drawing.Point(72, 639);
  233. this.btnStoploadstage.Size = new System.Drawing.Size(59, 33);
  234. this.btnStoploadstage.TabIndex = 30;
  235. this.btnStoploadstage.Text = "停止";
  236. this.btnStoploadstage.UseVisualStyleBackColor = true;
  237. //
  238. // btnResetloadstage
  239. //
  240. this.btnResetloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  241. this.btnResetloadstage.Location = new System.Drawing.Point(7, 639);
  242. this.btnResetloadstage.Size = new System.Drawing.Size(60, 33);
  243. this.btnResetloadstage.TabIndex = 29;
  244. this.btnResetloadstage.Text = "复位";
  245. this.btnResetloadstage.UseVisualStyleBackColor = true;
  246. //
  247. // btnCenterloadstage
  248. //
  249. this.btnCenterloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  250. this.btnCenterloadstage.Location = new System.Drawing.Point(7, 684);
  251. this.btnCenterloadstage.Size = new System.Drawing.Size(60, 31);
  252. this.btnCenterloadstage.TabIndex = 28;
  253. this.btnCenterloadstage.Text = "中心";
  254. this.btnCenterloadstage.UseVisualStyleBackColor = true;
  255. //
  256. // btnInloadstage
  257. //
  258. this.btnInloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  259. this.btnInloadstage.Location = new System.Drawing.Point(72, 592);
  260. this.btnInloadstage.Size = new System.Drawing.Size(61, 33);
  261. this.btnInloadstage.TabIndex = 27;
  262. this.btnInloadstage.Text = "进片";
  263. this.btnInloadstage.UseVisualStyleBackColor = true;
  264. //
  265. // btnOutloadstage
  266. //
  267. this.btnOutloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  268. this.btnOutloadstage.Location = new System.Drawing.Point(7, 592);
  269. this.btnOutloadstage.Size = new System.Drawing.Size(60, 33);
  270. this.btnOutloadstage.TabIndex = 26;
  271. this.btnOutloadstage.Text = "出片";
  272. this.btnOutloadstage.UseVisualStyleBackColor = true;
  273. //
  274. // btnZStop
  275. //
  276. this.btnZStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  277. this.btnZStop.Location = new System.Drawing.Point(346, 682);
  278. this.btnZStop.Size = new System.Drawing.Size(59, 33);
  279. this.btnZStop.TabIndex = 41;
  280. this.btnZStop.Text = "停止";
  281. this.btnZStop.UseVisualStyleBackColor = true;
  282. //
  283. // btnZFree
  284. //
  285. this.btnZFree.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  286. this.btnZFree.Location = new System.Drawing.Point(346, 641);
  287. this.btnZFree.Size = new System.Drawing.Size(59, 31);
  288. this.btnZFree.TabIndex = 40;
  289. this.btnZFree.Text = "锁定";
  290. this.btnZFree.UseVisualStyleBackColor = true;
  291. //
  292. // txtXStep
  293. //
  294. this.txtXStep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  295. this.txtXStep.Location = new System.Drawing.Point(160, 592);
  296. this.txtXStep.Size = new System.Drawing.Size(68, 21);
  297. this.txtXStep.TabIndex = 35;
  298. this.txtXStep.Text = "1000";
  299. //
  300. // txtYStep
  301. //
  302. this.txtYStep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  303. this.txtYStep.Location = new System.Drawing.Point(256, 592);
  304. this.txtYStep.Size = new System.Drawing.Size(68, 21);
  305. this.txtYStep.TabIndex = 36;
  306. this.txtYStep.Text = "1000";
  307. //
  308. // txtZStep
  309. //
  310. this.txtZStep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  311. this.txtZStep.Location = new System.Drawing.Point(353, 592);
  312. this.txtZStep.Size = new System.Drawing.Size(68, 21);
  313. this.txtZStep.TabIndex = 37;
  314. this.txtZStep.Text = "200";
  315. //
  316. // btnContinuityLower
  317. //
  318. this.btnContinuityLower.Location = new System.Drawing.Point(5, 89);
  319. this.btnContinuityLower.Size = new System.Drawing.Size(46, 59);
  320. this.btnContinuityLower.TabIndex = 1;
  321. this.btnContinuityLower.UseVisualStyleBackColor = true;
  322. //
  323. // btnContinuityUp
  324. //
  325. this.btnContinuityUp.Location = new System.Drawing.Point(5, 24);
  326. this.btnContinuityUp.Size = new System.Drawing.Size(46, 59);
  327. this.btnContinuityUp.TabIndex = 1;
  328. this.btnContinuityUp.UseVisualStyleBackColor = true;
  329. //
  330. // btnFixedLower
  331. //
  332. this.btnFixedLower.Location = new System.Drawing.Point(5, 89);
  333. this.btnFixedLower.Size = new System.Drawing.Size(46, 59);
  334. this.btnFixedLower.TabIndex = 2;
  335. this.btnFixedLower.UseVisualStyleBackColor = true;
  336. //
  337. // btnFixedUp
  338. //
  339. this.btnFixedUp.Location = new System.Drawing.Point(5, 24);
  340. this.btnFixedUp.Size = new System.Drawing.Size(46, 59);
  341. this.btnFixedUp.TabIndex = 3;
  342. this.btnFixedUp.UseVisualStyleBackColor = true;
  343. //
  344. // btnCenterDisplay
  345. //
  346. this.btnCenterDisplay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  347. this.btnCenterDisplay.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  348. this.btnCenterDisplay.Location = new System.Drawing.Point(427, 522);
  349. this.btnCenterDisplay.Size = new System.Drawing.Size(85, 33);
  350. this.btnCenterDisplay.TabIndex = 49;
  351. this.btnCenterDisplay.Text = "中心显示";
  352. this.btnCenterDisplay.UseVisualStyleBackColor = true;
  353. //
  354. // btnStopall
  355. //
  356. this.btnStopall.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  357. this.btnStopall.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  358. this.btnStopall.Location = new System.Drawing.Point(427, 483);
  359. this.btnStopall.Size = new System.Drawing.Size(85, 33);
  360. this.btnStopall.TabIndex = 48;
  361. this.btnStopall.Text = "全部停止";
  362. this.btnStopall.UseVisualStyleBackColor = true;
  363. //
  364. // btnDsRocker
  365. //
  366. this.btnDsRocker.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  367. this.btnDsRocker.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  368. this.btnDsRocker.Location = new System.Drawing.Point(427, 444);
  369. this.btnDsRocker.Size = new System.Drawing.Size(85, 33);
  370. this.btnDsRocker.TabIndex = 47;
  371. this.btnDsRocker.Text = "禁用摇杆";
  372. this.btnDsRocker.UseVisualStyleBackColor = true;
  373. //
  374. // panelall
  375. //
  376. this.panelall.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  377. | System.Windows.Forms.AnchorStyles.Left)
  378. | System.Windows.Forms.AnchorStyles.Right)));
  379. this.panelall.Controls.Add(this.groupBox13);
  380. this.panelall.Controls.Add(this.groupBox7);
  381. this.panelall.Controls.Add(this.groupBox5);
  382. this.panelall.Controls.Add(this.groupBox4);
  383. this.panelall.Controls.Add(this.groupBox2);
  384. this.panelall.Controls.Add(this.groupBox6);
  385. this.panelall.Controls.Add(this.groupBox1);
  386. this.panelall.Location = new System.Drawing.Point(2, 2);
  387. this.panelall.Name = "panelall";
  388. this.panelall.Size = new System.Drawing.Size(1247, 790);
  389. this.panelall.TabIndex = 2;
  390. //
  391. // groupBox13
  392. //
  393. this.groupBox13.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  394. | System.Windows.Forms.AnchorStyles.Right)));
  395. this.groupBox13.Controls.Add(this.cmbStitchList);
  396. this.groupBox13.Controls.Add(this.pictureBox1);
  397. this.groupBox13.Controls.Add(this.picEffect);
  398. this.groupBox13.Location = new System.Drawing.Point(807, 56);
  399. this.groupBox13.Name = "groupBox13";
  400. this.groupBox13.Size = new System.Drawing.Size(438, 731);
  401. this.groupBox13.TabIndex = 22;
  402. this.groupBox13.TabStop = false;
  403. this.groupBox13.Text = "拼图效果";
  404. //
  405. // cmbStitchList
  406. //
  407. this.cmbStitchList.FormattingEnabled = true;
  408. this.cmbStitchList.Location = new System.Drawing.Point(315, 39);
  409. this.cmbStitchList.Name = "cmbStitchList";
  410. this.cmbStitchList.Size = new System.Drawing.Size(102, 20);
  411. this.cmbStitchList.TabIndex = 3;
  412. this.cmbStitchList.Visible = false;
  413. //
  414. // pictureBox1
  415. //
  416. this.pictureBox1.Location = new System.Drawing.Point(6, 164);
  417. this.pictureBox1.Name = "pictureBox1";
  418. this.pictureBox1.Size = new System.Drawing.Size(424, 349);
  419. this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
  420. this.pictureBox1.TabIndex = 1;
  421. this.pictureBox1.TabStop = false;
  422. //
  423. // picEffect
  424. //
  425. this.picEffect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  426. | System.Windows.Forms.AnchorStyles.Right)));
  427. this.picEffect.Location = new System.Drawing.Point(6, 17);
  428. this.picEffect.Name = "picEffect";
  429. this.picEffect.Size = new System.Drawing.Size(426, 708);
  430. this.picEffect.TabIndex = 0;
  431. this.picEffect.TabStop = false;
  432. //
  433. // groupBox7
  434. //
  435. this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  436. this.groupBox7.Controls.Add(this.ckSeamless);
  437. this.groupBox7.Controls.Add(this.ckTile);
  438. this.groupBox7.Controls.Add(this.label13);
  439. this.groupBox7.Location = new System.Drawing.Point(2, 726);
  440. this.groupBox7.Name = "groupBox7";
  441. this.groupBox7.Size = new System.Drawing.Size(280, 60);
  442. this.groupBox7.TabIndex = 20;
  443. this.groupBox7.TabStop = false;
  444. this.groupBox7.Text = "拼接设置";
  445. //
  446. // ckSeamless
  447. //
  448. this.ckSeamless.AutoSize = true;
  449. this.ckSeamless.Location = new System.Drawing.Point(185, 30);
  450. this.ckSeamless.Name = "ckSeamless";
  451. this.ckSeamless.Size = new System.Drawing.Size(71, 16);
  452. this.ckSeamless.TabIndex = 55;
  453. this.ckSeamless.Text = "无缝模式";
  454. this.ckSeamless.UseVisualStyleBackColor = true;
  455. //
  456. // ckTile
  457. //
  458. this.ckTile.AutoSize = true;
  459. this.ckTile.Checked = true;
  460. this.ckTile.Location = new System.Drawing.Point(91, 30);
  461. this.ckTile.Name = "ckTile";
  462. this.ckTile.Size = new System.Drawing.Size(71, 16);
  463. this.ckTile.TabIndex = 54;
  464. this.ckTile.TabStop = true;
  465. this.ckTile.Text = "平铺模式";
  466. this.ckTile.UseVisualStyleBackColor = true;
  467. //
  468. // label13
  469. //
  470. this.label13.AutoSize = true;
  471. this.label13.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  472. this.label13.Location = new System.Drawing.Point(6, 32);
  473. this.label13.Name = "label13";
  474. this.label13.Size = new System.Drawing.Size(65, 12);
  475. this.label13.TabIndex = 52;
  476. this.label13.Text = "拼接方式:";
  477. //
  478. // groupBox5
  479. //
  480. this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  481. | System.Windows.Forms.AnchorStyles.Left)));
  482. this.groupBox5.Controls.Add(this.ckSize);
  483. this.groupBox5.Controls.Add(this.ckLockNull);
  484. this.groupBox5.Controls.Add(this.ckArea);
  485. this.groupBox5.Controls.Add(this.label12);
  486. this.groupBox5.Controls.Add(this.dgvRegionTeb);
  487. this.groupBox5.Controls.Add(this.btnDel);
  488. this.groupBox5.Controls.Add(this.btnDetailed);
  489. this.groupBox5.Location = new System.Drawing.Point(3, 374);
  490. this.groupBox5.Name = "groupBox5";
  491. this.groupBox5.Size = new System.Drawing.Size(280, 346);
  492. this.groupBox5.TabIndex = 19;
  493. this.groupBox5.TabStop = false;
  494. this.groupBox5.Text = "拼图区域列表";
  495. //
  496. // ckSize
  497. //
  498. this.ckSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  499. this.ckSize.AutoSize = true;
  500. this.ckSize.Location = new System.Drawing.Point(218, 321);
  501. this.ckSize.Name = "ckSize";
  502. this.ckSize.Size = new System.Drawing.Size(47, 16);
  503. this.ckSize.TabIndex = 51;
  504. this.ckSize.Text = "大小";
  505. this.ckSize.UseVisualStyleBackColor = true;
  506. this.ckSize.CheckedChanged += new System.EventHandler(this.ckSize_CheckedChanged);
  507. //
  508. // ckLockNull
  509. //
  510. this.ckLockNull.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  511. this.ckLockNull.AutoSize = true;
  512. this.ckLockNull.Checked = true;
  513. this.ckLockNull.Location = new System.Drawing.Point(101, 321);
  514. this.ckLockNull.Name = "ckLockNull";
  515. this.ckLockNull.Size = new System.Drawing.Size(35, 16);
  516. this.ckLockNull.TabIndex = 50;
  517. this.ckLockNull.TabStop = true;
  518. this.ckLockNull.Text = "无";
  519. this.ckLockNull.UseVisualStyleBackColor = true;
  520. this.ckLockNull.CheckedChanged += new System.EventHandler(this.ckLockNull_CheckedChanged);
  521. //
  522. // ckArea
  523. //
  524. this.ckArea.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  525. this.ckArea.AutoSize = true;
  526. this.ckArea.Location = new System.Drawing.Point(156, 321);
  527. this.ckArea.Name = "ckArea";
  528. this.ckArea.Size = new System.Drawing.Size(47, 16);
  529. this.ckArea.TabIndex = 49;
  530. this.ckArea.Text = "面积";
  531. this.ckArea.UseVisualStyleBackColor = true;
  532. this.ckArea.CheckedChanged += new System.EventHandler(this.ckArea_CheckedChanged);
  533. //
  534. // label12
  535. //
  536. this.label12.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  537. this.label12.AutoSize = true;
  538. this.label12.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  539. this.label12.Location = new System.Drawing.Point(6, 319);
  540. this.label12.Name = "label12";
  541. this.label12.Size = new System.Drawing.Size(65, 12);
  542. this.label12.TabIndex = 48;
  543. this.label12.Text = "锁定方式:";
  544. //
  545. // dgvRegionTeb
  546. //
  547. this.dgvRegionTeb.AllowUserToAddRows = false;
  548. this.dgvRegionTeb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  549. | System.Windows.Forms.AnchorStyles.Left)));
  550. this.dgvRegionTeb.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
  551. this.dgvRegionTeb.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
  552. this.dgvRegionTeb.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
  553. this.regionId,
  554. this.regionName,
  555. this.regionTiles,
  556. this.regionZ,
  557. this.regionArea});
  558. this.dgvRegionTeb.Location = new System.Drawing.Point(2, 36);
  559. this.dgvRegionTeb.Name = "dgvRegionTeb";
  560. this.dgvRegionTeb.ReadOnly = true;
  561. this.dgvRegionTeb.RowHeadersVisible = false;
  562. this.dgvRegionTeb.RowHeadersWidth = 51;
  563. this.dgvRegionTeb.RowTemplate.Height = 23;
  564. this.dgvRegionTeb.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
  565. this.dgvRegionTeb.Size = new System.Drawing.Size(274, 274);
  566. this.dgvRegionTeb.TabIndex = 0;
  567. this.dgvRegionTeb.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvRegionTeb_CellContentClick);
  568. this.dgvRegionTeb.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvRegionTeb_CellMouseClick);
  569. this.dgvRegionTeb.SelectionChanged += new System.EventHandler(this.dgvRegionTeb_SelectionChanged);
  570. //
  571. // regionId
  572. //
  573. this.regionId.FillWeight = 24F;
  574. this.regionId.HeaderText = "ID";
  575. this.regionId.MinimumWidth = 6;
  576. this.regionId.Name = "regionId";
  577. this.regionId.ReadOnly = true;
  578. this.regionId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
  579. //
  580. // regionName
  581. //
  582. this.regionName.FillWeight = 60F;
  583. this.regionName.HeaderText = "Name";
  584. this.regionName.MinimumWidth = 6;
  585. this.regionName.Name = "regionName";
  586. this.regionName.ReadOnly = true;
  587. this.regionName.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
  588. //
  589. // regionTiles
  590. //
  591. this.regionTiles.FillWeight = 60F;
  592. this.regionTiles.HeaderText = "Tiles";
  593. this.regionTiles.MinimumWidth = 6;
  594. this.regionTiles.Name = "regionTiles";
  595. this.regionTiles.ReadOnly = true;
  596. this.regionTiles.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
  597. //
  598. // regionZ
  599. //
  600. this.regionZ.FillWeight = 60F;
  601. this.regionZ.HeaderText = "Z(μm)";
  602. this.regionZ.MinimumWidth = 6;
  603. this.regionZ.Name = "regionZ";
  604. this.regionZ.ReadOnly = true;
  605. this.regionZ.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
  606. //
  607. // regionArea
  608. //
  609. this.regionArea.FillWeight = 60F;
  610. this.regionArea.HeaderText = "Area(mm²)";
  611. this.regionArea.MinimumWidth = 6;
  612. this.regionArea.Name = "regionArea";
  613. this.regionArea.ReadOnly = true;
  614. this.regionArea.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
  615. //
  616. // btnDel
  617. //
  618. this.btnDel.Location = new System.Drawing.Point(206, 11);
  619. this.btnDel.Name = "btnDel";
  620. this.btnDel.Size = new System.Drawing.Size(65, 23);
  621. this.btnDel.TabIndex = 47;
  622. this.btnDel.Text = "删除";
  623. this.btnDel.UseVisualStyleBackColor = true;
  624. this.btnDel.Click += new System.EventHandler(this.btnDel_Click);
  625. //
  626. // btnDetailed
  627. //
  628. this.btnDetailed.Location = new System.Drawing.Point(137, 11);
  629. this.btnDetailed.Name = "btnDetailed";
  630. this.btnDetailed.Size = new System.Drawing.Size(68, 23);
  631. this.btnDetailed.TabIndex = 46;
  632. this.btnDetailed.Text = "详细";
  633. this.btnDetailed.UseVisualStyleBackColor = true;
  634. this.btnDetailed.Click += new System.EventHandler(this.btnDetailed_Click);
  635. //
  636. // groupBox4
  637. //
  638. this.groupBox4.Controls.Add(this.numOverlapRate);
  639. this.groupBox4.Controls.Add(this.label19);
  640. this.groupBox4.Controls.Add(this.ckOther);
  641. this.groupBox4.Controls.Add(this.btnEstablish);
  642. this.groupBox4.Controls.Add(this.label11);
  643. this.groupBox4.Controls.Add(this.label10);
  644. this.groupBox4.Controls.Add(this.label9);
  645. this.groupBox4.Controls.Add(this.txtAreaY);
  646. this.groupBox4.Controls.Add(this.txtSizeY);
  647. this.groupBox4.Controls.Add(this.txtTilesY);
  648. this.groupBox4.Controls.Add(this.txtAreaX);
  649. this.groupBox4.Controls.Add(this.txtSizeX);
  650. this.groupBox4.Controls.Add(this.txtTilesX);
  651. this.groupBox4.Controls.Add(this.label8);
  652. this.groupBox4.Controls.Add(this.label7);
  653. this.groupBox4.Controls.Add(this.ckPolygon);
  654. this.groupBox4.Controls.Add(this.ckRectangle);
  655. this.groupBox4.Controls.Add(this.ckCircular);
  656. this.groupBox4.Location = new System.Drawing.Point(3, 176);
  657. this.groupBox4.Name = "groupBox4";
  658. this.groupBox4.Size = new System.Drawing.Size(280, 192);
  659. this.groupBox4.TabIndex = 18;
  660. this.groupBox4.TabStop = false;
  661. this.groupBox4.Text = "拼图方式";
  662. //
  663. // numOverlapRate
  664. //
  665. this.numOverlapRate.DecimalPlaces = 2;
  666. this.numOverlapRate.Increment = new decimal(new int[] {
  667. 5,
  668. 0,
  669. 0,
  670. 131072});
  671. this.numOverlapRate.Location = new System.Drawing.Point(116, 119);
  672. this.numOverlapRate.Maximum = new decimal(new int[] {
  673. 1,
  674. 0,
  675. 0,
  676. 0});
  677. this.numOverlapRate.Minimum = new decimal(new int[] {
  678. 5,
  679. 0,
  680. 0,
  681. 131072});
  682. this.numOverlapRate.Name = "numOverlapRate";
  683. this.numOverlapRate.Size = new System.Drawing.Size(70, 21);
  684. this.numOverlapRate.TabIndex = 50;
  685. this.numOverlapRate.Value = new decimal(new int[] {
  686. 10,
  687. 0,
  688. 0,
  689. 131072});
  690. //
  691. // label19
  692. //
  693. this.label19.AutoSize = true;
  694. this.label19.Location = new System.Drawing.Point(22, 121);
  695. this.label19.Name = "label19";
  696. this.label19.Size = new System.Drawing.Size(77, 12);
  697. this.label19.TabIndex = 49;
  698. this.label19.Text = "Overlap Rate";
  699. //
  700. // ckOther
  701. //
  702. this.ckOther.AutoSize = true;
  703. this.ckOther.Checked = true;
  704. this.ckOther.Location = new System.Drawing.Point(206, 20);
  705. this.ckOther.Name = "ckOther";
  706. this.ckOther.Size = new System.Drawing.Size(59, 16);
  707. this.ckOther.TabIndex = 46;
  708. this.ckOther.TabStop = true;
  709. this.ckOther.Text = "自定义";
  710. this.ckOther.UseVisualStyleBackColor = true;
  711. this.ckOther.CheckedChanged += new System.EventHandler(this.ckOther_CheckedChanged);
  712. //
  713. // btnEstablish
  714. //
  715. this.btnEstablish.Location = new System.Drawing.Point(73, 153);
  716. this.btnEstablish.Name = "btnEstablish";
  717. this.btnEstablish.Size = new System.Drawing.Size(137, 23);
  718. this.btnEstablish.TabIndex = 45;
  719. this.btnEstablish.Text = "创建拼图区域";
  720. this.btnEstablish.UseVisualStyleBackColor = true;
  721. this.btnEstablish.Click += new System.EventHandler(this.btnEstablish_Click);
  722. //
  723. // label11
  724. //
  725. this.label11.AutoSize = true;
  726. this.label11.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  727. this.label11.Location = new System.Drawing.Point(202, 44);
  728. this.label11.Name = "label11";
  729. this.label11.Size = new System.Drawing.Size(35, 14);
  730. this.label11.TabIndex = 44;
  731. this.label11.Text = "Area";
  732. //
  733. // label10
  734. //
  735. this.label10.AutoSize = true;
  736. this.label10.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  737. this.label10.Location = new System.Drawing.Point(133, 44);
  738. this.label10.Name = "label10";
  739. this.label10.Size = new System.Drawing.Size(35, 14);
  740. this.label10.TabIndex = 43;
  741. this.label10.Text = "Size";
  742. //
  743. // label9
  744. //
  745. this.label9.AutoSize = true;
  746. this.label9.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  747. this.label9.Location = new System.Drawing.Point(61, 44);
  748. this.label9.Name = "label9";
  749. this.label9.Size = new System.Drawing.Size(42, 14);
  750. this.label9.TabIndex = 42;
  751. this.label9.Text = "Tiles";
  752. //
  753. // txtAreaY
  754. //
  755. this.txtAreaY.Enabled = false;
  756. this.txtAreaY.Location = new System.Drawing.Point(186, 83);
  757. this.txtAreaY.Name = "txtAreaY";
  758. this.txtAreaY.ReadOnly = true;
  759. this.txtAreaY.Size = new System.Drawing.Size(70, 21);
  760. this.txtAreaY.TabIndex = 41;
  761. //
  762. // txtSizeY
  763. //
  764. this.txtSizeY.Location = new System.Drawing.Point(116, 83);
  765. this.txtSizeY.Name = "txtSizeY";
  766. this.txtSizeY.Size = new System.Drawing.Size(70, 21);
  767. this.txtSizeY.TabIndex = 40;
  768. //
  769. // txtTilesY
  770. //
  771. this.txtTilesY.Location = new System.Drawing.Point(46, 83);
  772. this.txtTilesY.Name = "txtTilesY";
  773. this.txtTilesY.Size = new System.Drawing.Size(70, 21);
  774. this.txtTilesY.TabIndex = 39;
  775. //
  776. // txtAreaX
  777. //
  778. this.txtAreaX.Location = new System.Drawing.Point(186, 61);
  779. this.txtAreaX.Name = "txtAreaX";
  780. this.txtAreaX.Size = new System.Drawing.Size(70, 21);
  781. this.txtAreaX.TabIndex = 38;
  782. //
  783. // txtSizeX
  784. //
  785. this.txtSizeX.Location = new System.Drawing.Point(116, 61);
  786. this.txtSizeX.Name = "txtSizeX";
  787. this.txtSizeX.Size = new System.Drawing.Size(70, 21);
  788. this.txtSizeX.TabIndex = 37;
  789. //
  790. // txtTilesX
  791. //
  792. this.txtTilesX.Location = new System.Drawing.Point(46, 61);
  793. this.txtTilesX.Name = "txtTilesX";
  794. this.txtTilesX.Size = new System.Drawing.Size(70, 21);
  795. this.txtTilesX.TabIndex = 36;
  796. //
  797. // label8
  798. //
  799. this.label8.AutoSize = true;
  800. this.label8.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  801. this.label8.Location = new System.Drawing.Point(21, 86);
  802. this.label8.Name = "label8";
  803. this.label8.Size = new System.Drawing.Size(21, 14);
  804. this.label8.TabIndex = 34;
  805. this.label8.Text = "Y:";
  806. //
  807. // label7
  808. //
  809. this.label7.AutoSize = true;
  810. this.label7.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  811. this.label7.Location = new System.Drawing.Point(21, 64);
  812. this.label7.Name = "label7";
  813. this.label7.Size = new System.Drawing.Size(21, 14);
  814. this.label7.TabIndex = 33;
  815. this.label7.Text = "X:";
  816. //
  817. // ckPolygon
  818. //
  819. this.ckPolygon.AutoSize = true;
  820. this.ckPolygon.Location = new System.Drawing.Point(132, 20);
  821. this.ckPolygon.Name = "ckPolygon";
  822. this.ckPolygon.Size = new System.Drawing.Size(59, 16);
  823. this.ckPolygon.TabIndex = 3;
  824. this.ckPolygon.Text = "多边形";
  825. this.ckPolygon.UseVisualStyleBackColor = true;
  826. this.ckPolygon.CheckedChanged += new System.EventHandler(this.ckPolygon_CheckedChanged);
  827. //
  828. // ckRectangle
  829. //
  830. this.ckRectangle.AutoSize = true;
  831. this.ckRectangle.Location = new System.Drawing.Point(9, 20);
  832. this.ckRectangle.Name = "ckRectangle";
  833. this.ckRectangle.Size = new System.Drawing.Size(47, 16);
  834. this.ckRectangle.TabIndex = 2;
  835. this.ckRectangle.Text = "矩形";
  836. this.ckRectangle.UseVisualStyleBackColor = true;
  837. this.ckRectangle.CheckedChanged += new System.EventHandler(this.ckRectangle_CheckedChanged);
  838. //
  839. // ckCircular
  840. //
  841. this.ckCircular.AutoSize = true;
  842. this.ckCircular.Location = new System.Drawing.Point(73, 20);
  843. this.ckCircular.Name = "ckCircular";
  844. this.ckCircular.Size = new System.Drawing.Size(47, 16);
  845. this.ckCircular.TabIndex = 1;
  846. this.ckCircular.Text = "圆形";
  847. this.ckCircular.UseVisualStyleBackColor = true;
  848. this.ckCircular.CheckedChanged += new System.EventHandler(this.ckCircular_CheckedChanged);
  849. //
  850. // groupBox2
  851. //
  852. this.groupBox2.Controls.Add(this.btnWhiteBalance);
  853. this.groupBox2.Controls.Add(this.label16);
  854. this.groupBox2.Controls.Add(this.lblUnit);
  855. this.groupBox2.Controls.Add(this.chkAutoExposure);
  856. this.groupBox2.Controls.Add(this.txtPercentage);
  857. this.groupBox2.Controls.Add(this.txtTime);
  858. this.groupBox2.Controls.Add(this.trackPercentage);
  859. this.groupBox2.Controls.Add(this.trackTime);
  860. this.groupBox2.Controls.Add(this.btnOther);
  861. this.groupBox2.Controls.Add(this.label6);
  862. this.groupBox2.Controls.Add(this.label5);
  863. this.groupBox2.Location = new System.Drawing.Point(3, 56);
  864. this.groupBox2.Name = "groupBox2";
  865. this.groupBox2.Size = new System.Drawing.Size(280, 114);
  866. this.groupBox2.TabIndex = 17;
  867. this.groupBox2.TabStop = false;
  868. this.groupBox2.Text = "相机设置";
  869. //
  870. // btnWhiteBalance
  871. //
  872. this.btnWhiteBalance.Location = new System.Drawing.Point(96, 85);
  873. this.btnWhiteBalance.Name = "btnWhiteBalance";
  874. this.btnWhiteBalance.Size = new System.Drawing.Size(96, 23);
  875. this.btnWhiteBalance.TabIndex = 40;
  876. this.btnWhiteBalance.Text = "自动白平衡";
  877. this.btnWhiteBalance.UseVisualStyleBackColor = true;
  878. this.btnWhiteBalance.Click += new System.EventHandler(this.btnWhiteBalance_Click);
  879. //
  880. // label16
  881. //
  882. this.label16.AutoSize = true;
  883. this.label16.Location = new System.Drawing.Point(257, 47);
  884. this.label16.Name = "label16";
  885. this.label16.Size = new System.Drawing.Size(11, 12);
  886. this.label16.TabIndex = 39;
  887. this.label16.Text = "%";
  888. //
  889. // lblUnit
  890. //
  891. this.lblUnit.AutoSize = true;
  892. this.lblUnit.Location = new System.Drawing.Point(257, 19);
  893. this.lblUnit.Name = "lblUnit";
  894. this.lblUnit.Size = new System.Drawing.Size(17, 12);
  895. this.lblUnit.TabIndex = 0;
  896. this.lblUnit.Text = "ms";
  897. //
  898. // chkAutoExposure
  899. //
  900. this.chkAutoExposure.AutoSize = true;
  901. this.chkAutoExposure.Location = new System.Drawing.Point(10, 88);
  902. this.chkAutoExposure.Name = "chkAutoExposure";
  903. this.chkAutoExposure.Size = new System.Drawing.Size(72, 16);
  904. this.chkAutoExposure.TabIndex = 0;
  905. this.chkAutoExposure.Text = "自动曝光";
  906. this.chkAutoExposure.UseVisualStyleBackColor = true;
  907. this.chkAutoExposure.Click += new System.EventHandler(this.chkAutoExposure_Click);
  908. //
  909. // txtPercentage
  910. //
  911. this.txtPercentage.Location = new System.Drawing.Point(214, 44);
  912. this.txtPercentage.Name = "txtPercentage";
  913. this.txtPercentage.Size = new System.Drawing.Size(42, 21);
  914. this.txtPercentage.TabIndex = 37;
  915. this.txtPercentage.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtPercentage_KeyPress);
  916. //
  917. // txtTime
  918. //
  919. this.txtTime.Location = new System.Drawing.Point(214, 17);
  920. this.txtTime.Name = "txtTime";
  921. this.txtTime.Size = new System.Drawing.Size(42, 21);
  922. this.txtTime.TabIndex = 36;
  923. this.txtTime.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtTime_KeyPress);
  924. //
  925. // trackPercentage
  926. //
  927. this.trackPercentage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  928. | System.Windows.Forms.AnchorStyles.Right)));
  929. this.trackPercentage.AutoSize = false;
  930. this.trackPercentage.Location = new System.Drawing.Point(78, 45);
  931. this.trackPercentage.Maximum = 200;
  932. this.trackPercentage.Minimum = 5;
  933. this.trackPercentage.Name = "trackPercentage";
  934. this.trackPercentage.Size = new System.Drawing.Size(141, 25);
  935. this.trackPercentage.TabIndex = 5;
  936. this.trackPercentage.TickStyle = System.Windows.Forms.TickStyle.None;
  937. this.trackPercentage.Value = 5;
  938. this.trackPercentage.ValueChanged += new System.EventHandler(this.trackPercentage_ValueChanged);
  939. //
  940. // trackTime
  941. //
  942. this.trackTime.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  943. | System.Windows.Forms.AnchorStyles.Right)));
  944. this.trackTime.AutoSize = false;
  945. this.trackTime.Location = new System.Drawing.Point(78, 19);
  946. this.trackTime.Maximum = 1000000;
  947. this.trackTime.Name = "trackTime";
  948. this.trackTime.Size = new System.Drawing.Size(141, 25);
  949. this.trackTime.TabIndex = 4;
  950. this.trackTime.TickStyle = System.Windows.Forms.TickStyle.None;
  951. this.trackTime.ValueChanged += new System.EventHandler(this.trackTime_ValueChanged);
  952. //
  953. // btnOther
  954. //
  955. this.btnOther.Location = new System.Drawing.Point(202, 85);
  956. this.btnOther.Name = "btnOther";
  957. this.btnOther.Size = new System.Drawing.Size(75, 23);
  958. this.btnOther.TabIndex = 3;
  959. this.btnOther.Text = "曝光设置";
  960. this.btnOther.UseVisualStyleBackColor = true;
  961. this.btnOther.Click += new System.EventHandler(this.btnCameraSetting_Click);
  962. //
  963. // label6
  964. //
  965. this.label6.AutoSize = true;
  966. this.label6.Location = new System.Drawing.Point(7, 47);
  967. this.label6.Name = "label6";
  968. this.label6.Size = new System.Drawing.Size(77, 12);
  969. this.label6.TabIndex = 1;
  970. this.label6.Text = "曝光百分比:";
  971. //
  972. // label5
  973. //
  974. this.label5.AutoSize = true;
  975. this.label5.Location = new System.Drawing.Point(7, 20);
  976. this.label5.Name = "label5";
  977. this.label5.Size = new System.Drawing.Size(65, 12);
  978. this.label5.TabIndex = 0;
  979. this.label5.Text = "曝光时间:";
  980. //
  981. // groupBox6
  982. //
  983. this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  984. | System.Windows.Forms.AnchorStyles.Left)
  985. | System.Windows.Forms.AnchorStyles.Right)));
  986. this.groupBox6.Controls.Add(this.label18);
  987. this.groupBox6.Controls.Add(this.label17);
  988. this.groupBox6.Controls.Add(this.label15);
  989. this.groupBox6.Controls.Add(this.pnlSpeed);
  990. this.groupBox6.Controls.Add(this.btnCenterDisplay);
  991. this.groupBox6.Controls.Add(this.btnStopall);
  992. this.groupBox6.Controls.Add(this.btnDsRocker);
  993. this.groupBox6.Controls.Add(this.lblZPosition);
  994. this.groupBox6.Controls.Add(this.lblYPosition);
  995. this.groupBox6.Controls.Add(this.lblXPosition);
  996. this.groupBox6.Controls.Add(this.btnZStop);
  997. this.groupBox6.Controls.Add(this.btnZFree);
  998. this.groupBox6.Controls.Add(this.label4);
  999. this.groupBox6.Controls.Add(this.cmbStepUnit);
  1000. this.groupBox6.Controls.Add(this.txtZStep);
  1001. this.groupBox6.Controls.Add(this.txtYStep);
  1002. this.groupBox6.Controls.Add(this.txtXStep);
  1003. this.groupBox6.Controls.Add(this.label3);
  1004. this.groupBox6.Controls.Add(this.label2);
  1005. this.groupBox6.Controls.Add(this.label1);
  1006. this.groupBox6.Controls.Add(this.btnOutloadstage);
  1007. this.groupBox6.Controls.Add(this.groupBox12);
  1008. this.groupBox6.Controls.Add(this.btnFreeloadstage);
  1009. this.groupBox6.Controls.Add(this.groupBox11);
  1010. this.groupBox6.Controls.Add(this.groupBox10);
  1011. this.groupBox6.Controls.Add(this.btnInloadstage);
  1012. this.groupBox6.Controls.Add(this.groupBox9);
  1013. this.groupBox6.Controls.Add(this.btnStoploadstage);
  1014. this.groupBox6.Controls.Add(this.panelControl);
  1015. this.groupBox6.Controls.Add(this.btnResetloadstage);
  1016. this.groupBox6.Controls.Add(this.btnCenterloadstage);
  1017. this.groupBox6.Location = new System.Drawing.Point(289, 56);
  1018. this.groupBox6.Name = "groupBox6";
  1019. this.groupBox6.Size = new System.Drawing.Size(512, 731);
  1020. this.groupBox6.TabIndex = 16;
  1021. this.groupBox6.TabStop = false;
  1022. this.groupBox6.Text = "硬件控制";
  1023. this.groupBox6.Controls.SetChildIndex(this.btnCenterloadstage, 0);
  1024. this.groupBox6.Controls.SetChildIndex(this.btnResetloadstage, 0);
  1025. this.groupBox6.Controls.SetChildIndex(this.panelControl, 0);
  1026. this.groupBox6.Controls.SetChildIndex(this.btnStoploadstage, 0);
  1027. this.groupBox6.Controls.SetChildIndex(this.groupBox9, 0);
  1028. this.groupBox6.Controls.SetChildIndex(this.btnInloadstage, 0);
  1029. this.groupBox6.Controls.SetChildIndex(this.groupBox10, 0);
  1030. this.groupBox6.Controls.SetChildIndex(this.groupBox11, 0);
  1031. this.groupBox6.Controls.SetChildIndex(this.btnFreeloadstage, 0);
  1032. this.groupBox6.Controls.SetChildIndex(this.groupBox12, 0);
  1033. this.groupBox6.Controls.SetChildIndex(this.btnOutloadstage, 0);
  1034. this.groupBox6.Controls.SetChildIndex(this.label1, 0);
  1035. this.groupBox6.Controls.SetChildIndex(this.label2, 0);
  1036. this.groupBox6.Controls.SetChildIndex(this.label3, 0);
  1037. this.groupBox6.Controls.SetChildIndex(this.txtXStep, 0);
  1038. this.groupBox6.Controls.SetChildIndex(this.txtYStep, 0);
  1039. this.groupBox6.Controls.SetChildIndex(this.txtZStep, 0);
  1040. this.groupBox6.Controls.SetChildIndex(this.cmbStepUnit, 0);
  1041. this.groupBox6.Controls.SetChildIndex(this.label4, 0);
  1042. this.groupBox6.Controls.SetChildIndex(this.btnZFree, 0);
  1043. this.groupBox6.Controls.SetChildIndex(this.btnZStop, 0);
  1044. this.groupBox6.Controls.SetChildIndex(this.lblXPosition, 0);
  1045. this.groupBox6.Controls.SetChildIndex(this.lblYPosition, 0);
  1046. this.groupBox6.Controls.SetChildIndex(this.lblZPosition, 0);
  1047. this.groupBox6.Controls.SetChildIndex(this.btnDsRocker, 0);
  1048. this.groupBox6.Controls.SetChildIndex(this.btnStopall, 0);
  1049. this.groupBox6.Controls.SetChildIndex(this.btnCenterDisplay, 0);
  1050. this.groupBox6.Controls.SetChildIndex(this.pnlSpeed, 0);
  1051. this.groupBox6.Controls.SetChildIndex(this.label15, 0);
  1052. this.groupBox6.Controls.SetChildIndex(this.label17, 0);
  1053. this.groupBox6.Controls.SetChildIndex(this.label18, 0);
  1054. //
  1055. // label18
  1056. //
  1057. this.label18.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1058. this.label18.AutoSize = true;
  1059. this.label18.Font = new System.Drawing.Font("宋体", 10.5F);
  1060. this.label18.Location = new System.Drawing.Point(408, 693);
  1061. this.label18.Name = "label18";
  1062. this.label18.Size = new System.Drawing.Size(21, 14);
  1063. this.label18.TabIndex = 53;
  1064. this.label18.Text = "Z:";
  1065. //
  1066. // label17
  1067. //
  1068. this.label17.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1069. this.label17.AutoSize = true;
  1070. this.label17.Font = new System.Drawing.Font("宋体", 10.5F);
  1071. this.label17.Location = new System.Drawing.Point(408, 668);
  1072. this.label17.Name = "label17";
  1073. this.label17.Size = new System.Drawing.Size(21, 14);
  1074. this.label17.TabIndex = 54;
  1075. this.label17.Text = "Y:";
  1076. //
  1077. // label15
  1078. //
  1079. this.label15.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1080. this.label15.AutoSize = true;
  1081. this.label15.Font = new System.Drawing.Font("宋体", 10.5F);
  1082. this.label15.Location = new System.Drawing.Point(408, 642);
  1083. this.label15.Name = "label15";
  1084. this.label15.Size = new System.Drawing.Size(21, 14);
  1085. this.label15.TabIndex = 55;
  1086. this.label15.Text = "X:";
  1087. //
  1088. // pnlSpeed
  1089. //
  1090. this.pnlSpeed.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1091. this.pnlSpeed.Location = new System.Drawing.Point(185, 623);
  1092. this.pnlSpeed.Name = "pnlSpeed";
  1093. this.pnlSpeed.Size = new System.Drawing.Size(146, 102);
  1094. this.pnlSpeed.TabIndex = 50;
  1095. //
  1096. // label4
  1097. //
  1098. this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1099. this.label4.AutoSize = true;
  1100. this.label4.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  1101. this.label4.Location = new System.Drawing.Point(138, 642);
  1102. this.label4.Name = "label4";
  1103. this.label4.Size = new System.Drawing.Size(0, 14);
  1104. this.label4.TabIndex = 39;
  1105. //
  1106. // cmbStepUnit
  1107. //
  1108. this.cmbStepUnit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1109. this.cmbStepUnit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  1110. this.cmbStepUnit.FormattingEnabled = true;
  1111. this.cmbStepUnit.Items.AddRange(new object[] {
  1112. "μm",
  1113. "mm",
  1114. "cm"});
  1115. this.cmbStepUnit.Location = new System.Drawing.Point(427, 594);
  1116. this.cmbStepUnit.Name = "cmbStepUnit";
  1117. this.cmbStepUnit.Size = new System.Drawing.Size(69, 20);
  1118. this.cmbStepUnit.TabIndex = 38;
  1119. //
  1120. // label3
  1121. //
  1122. this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1123. this.label3.AutoSize = true;
  1124. this.label3.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  1125. this.label3.Location = new System.Drawing.Point(328, 595);
  1126. this.label3.Name = "label3";
  1127. this.label3.Size = new System.Drawing.Size(21, 14);
  1128. this.label3.TabIndex = 34;
  1129. this.label3.Text = "Z:";
  1130. //
  1131. // label2
  1132. //
  1133. this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1134. this.label2.AutoSize = true;
  1135. this.label2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  1136. this.label2.Location = new System.Drawing.Point(231, 595);
  1137. this.label2.Name = "label2";
  1138. this.label2.Size = new System.Drawing.Size(21, 14);
  1139. this.label2.TabIndex = 33;
  1140. this.label2.Text = "Y:";
  1141. //
  1142. // label1
  1143. //
  1144. this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1145. this.label1.AutoSize = true;
  1146. this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  1147. this.label1.Location = new System.Drawing.Point(138, 595);
  1148. this.label1.Name = "label1";
  1149. this.label1.Size = new System.Drawing.Size(21, 14);
  1150. this.label1.TabIndex = 32;
  1151. this.label1.Text = "X:";
  1152. //
  1153. // groupBox12
  1154. //
  1155. this.groupBox12.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1156. this.groupBox12.Controls.Add(this.btnFixedLower);
  1157. this.groupBox12.Controls.Add(this.btnFixedUp);
  1158. this.groupBox12.Location = new System.Drawing.Point(370, 420);
  1159. this.groupBox12.Name = "groupBox12";
  1160. this.groupBox12.Size = new System.Drawing.Size(56, 162);
  1161. this.groupBox12.TabIndex = 25;
  1162. this.groupBox12.TabStop = false;
  1163. this.groupBox12.Text = "定长";
  1164. //
  1165. // groupBox11
  1166. //
  1167. this.groupBox11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1168. this.groupBox11.Controls.Add(this.btnContinuityLower);
  1169. this.groupBox11.Controls.Add(this.btnContinuityUp);
  1170. this.groupBox11.Location = new System.Drawing.Point(312, 420);
  1171. this.groupBox11.Name = "groupBox11";
  1172. this.groupBox11.Size = new System.Drawing.Size(56, 162);
  1173. this.groupBox11.TabIndex = 24;
  1174. this.groupBox11.TabStop = false;
  1175. this.groupBox11.Text = "连续";
  1176. //
  1177. // groupBox10
  1178. //
  1179. this.groupBox10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1180. this.groupBox10.Controls.Add(this.panelVision);
  1181. this.groupBox10.Location = new System.Drawing.Point(160, 420);
  1182. this.groupBox10.Name = "groupBox10";
  1183. this.groupBox10.Size = new System.Drawing.Size(150, 162);
  1184. this.groupBox10.TabIndex = 23;
  1185. this.groupBox10.TabStop = false;
  1186. this.groupBox10.Text = "视场模式";
  1187. //
  1188. // panelVision
  1189. //
  1190. this.panelVision.Location = new System.Drawing.Point(2, 14);
  1191. this.panelVision.Name = "panelVision";
  1192. this.panelVision.Size = new System.Drawing.Size(144, 144);
  1193. this.panelVision.TabIndex = 2;
  1194. //
  1195. // groupBox9
  1196. //
  1197. this.groupBox9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1198. this.groupBox9.Controls.Add(this.panelMotion);
  1199. this.groupBox9.Location = new System.Drawing.Point(6, 420);
  1200. this.groupBox9.Name = "groupBox9";
  1201. this.groupBox9.Size = new System.Drawing.Size(150, 162);
  1202. this.groupBox9.TabIndex = 22;
  1203. this.groupBox9.TabStop = false;
  1204. this.groupBox9.Text = "运动模式";
  1205. //
  1206. // panelMotion
  1207. //
  1208. this.panelMotion.Location = new System.Drawing.Point(2, 14);
  1209. this.panelMotion.Name = "panelMotion";
  1210. this.panelMotion.Size = new System.Drawing.Size(144, 144);
  1211. this.panelMotion.TabIndex = 1;
  1212. //
  1213. // panelControl
  1214. //
  1215. this.panelControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  1216. | System.Windows.Forms.AnchorStyles.Left)
  1217. | System.Windows.Forms.AnchorStyles.Right)));
  1218. this.panelControl.AutoScroll = true;
  1219. this.panelControl.BackColor = System.Drawing.SystemColors.Control;
  1220. this.panelControl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  1221. this.panelControl.Location = new System.Drawing.Point(6, 17);
  1222. this.panelControl.Name = "panelControl";
  1223. this.panelControl.Size = new System.Drawing.Size(500, 394);
  1224. this.panelControl.TabIndex = 14;
  1225. //
  1226. // groupBox1
  1227. //
  1228. this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  1229. | System.Windows.Forms.AnchorStyles.Right)));
  1230. this.groupBox1.Controls.Add(this.btnStop);
  1231. this.groupBox1.Controls.Add(this.btnCreatImgFile);
  1232. this.groupBox1.Controls.Add(this.btnWorking);
  1233. this.groupBox1.Location = new System.Drawing.Point(3, 3);
  1234. this.groupBox1.Name = "groupBox1";
  1235. this.groupBox1.Size = new System.Drawing.Size(1241, 47);
  1236. this.groupBox1.TabIndex = 2;
  1237. this.groupBox1.TabStop = false;
  1238. this.groupBox1.Text = "操作";
  1239. //
  1240. // btnStop
  1241. //
  1242. this.btnStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1243. this.btnStop.Location = new System.Drawing.Point(1019, 11);
  1244. this.btnStop.Name = "btnStop";
  1245. this.btnStop.Size = new System.Drawing.Size(89, 34);
  1246. this.btnStop.TabIndex = 2;
  1247. this.btnStop.Text = "停止";
  1248. this.btnStop.UseVisualStyleBackColor = true;
  1249. this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
  1250. //
  1251. // btnCreatImgFile
  1252. //
  1253. this.btnCreatImgFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1254. this.btnCreatImgFile.Location = new System.Drawing.Point(1129, 11);
  1255. this.btnCreatImgFile.Name = "btnCreatImgFile";
  1256. this.btnCreatImgFile.Size = new System.Drawing.Size(92, 34);
  1257. this.btnCreatImgFile.TabIndex = 1;
  1258. this.btnCreatImgFile.Text = "创建图片";
  1259. this.btnCreatImgFile.UseVisualStyleBackColor = true;
  1260. this.btnCreatImgFile.Click += new System.EventHandler(this.btnCreatImgFile_Click);
  1261. //
  1262. // btnWorking
  1263. //
  1264. this.btnWorking.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1265. this.btnWorking.Location = new System.Drawing.Point(909, 11);
  1266. this.btnWorking.Name = "btnWorking";
  1267. this.btnWorking.Size = new System.Drawing.Size(89, 34);
  1268. this.btnWorking.TabIndex = 0;
  1269. this.btnWorking.Text = "开始";
  1270. this.btnWorking.UseVisualStyleBackColor = true;
  1271. this.btnWorking.Click += new System.EventHandler(this.btnWorking_Click);
  1272. //
  1273. // groupBox3
  1274. //
  1275. this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  1276. | System.Windows.Forms.AnchorStyles.Left)));
  1277. this.groupBox3.Location = new System.Drawing.Point(2, 498);
  1278. this.groupBox3.Name = "groupBox3";
  1279. this.groupBox3.Size = new System.Drawing.Size(254, 84);
  1280. this.groupBox3.TabIndex = 13;
  1281. this.groupBox3.TabStop = false;
  1282. //
  1283. // MultiDimensionaDialog
  1284. //
  1285. this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
  1286. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  1287. this.ClientSize = new System.Drawing.Size(1251, 796);
  1288. this.Controls.Add(this.panelall);
  1289. this.Controls.Add(this.groupBox3);
  1290. this.MinimumSize = new System.Drawing.Size(1257, 750);
  1291. this.Name = "MultiDimensionaDialog";
  1292. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
  1293. this.Text = "多维图像合成";
  1294. this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MultiDimensionaDialog_FormClosing);
  1295. this.Controls.SetChildIndex(this.groupBox3, 0);
  1296. this.Controls.SetChildIndex(this.panelall, 0);
  1297. this.panelall.ResumeLayout(false);
  1298. this.groupBox13.ResumeLayout(false);
  1299. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
  1300. ((System.ComponentModel.ISupportInitialize)(this.picEffect)).EndInit();
  1301. this.groupBox7.ResumeLayout(false);
  1302. this.groupBox7.PerformLayout();
  1303. this.groupBox5.ResumeLayout(false);
  1304. this.groupBox5.PerformLayout();
  1305. ((System.ComponentModel.ISupportInitialize)(this.dgvRegionTeb)).EndInit();
  1306. this.groupBox4.ResumeLayout(false);
  1307. this.groupBox4.PerformLayout();
  1308. ((System.ComponentModel.ISupportInitialize)(this.numOverlapRate)).EndInit();
  1309. this.groupBox2.ResumeLayout(false);
  1310. this.groupBox2.PerformLayout();
  1311. ((System.ComponentModel.ISupportInitialize)(this.trackPercentage)).EndInit();
  1312. ((System.ComponentModel.ISupportInitialize)(this.trackTime)).EndInit();
  1313. this.groupBox6.ResumeLayout(false);
  1314. this.groupBox6.PerformLayout();
  1315. this.groupBox12.ResumeLayout(false);
  1316. this.groupBox11.ResumeLayout(false);
  1317. this.groupBox10.ResumeLayout(false);
  1318. this.groupBox9.ResumeLayout(false);
  1319. this.groupBox1.ResumeLayout(false);
  1320. this.ResumeLayout(false);
  1321. }
  1322. #endregion
  1323. #region 控件
  1324. private System.Windows.Forms.Panel panelall;
  1325. private System.Windows.Forms.GroupBox groupBox1;
  1326. private System.Windows.Forms.Button btnCreatImgFile;
  1327. private System.Windows.Forms.Button btnWorking;
  1328. private System.Windows.Forms.Button btnStop;
  1329. private System.Windows.Forms.GroupBox groupBox6;
  1330. private System.Windows.Forms.GroupBox groupBox3;
  1331. private System.Windows.Forms.Panel panelControl;
  1332. private System.Windows.Forms.GroupBox groupBox7;
  1333. private System.Windows.Forms.GroupBox groupBox5;
  1334. private System.Windows.Forms.GroupBox groupBox4;
  1335. private System.Windows.Forms.GroupBox groupBox2;
  1336. private System.Windows.Forms.GroupBox groupBox12;
  1337. private System.Windows.Forms.GroupBox groupBox11;
  1338. private System.Windows.Forms.GroupBox groupBox10;
  1339. private System.Windows.Forms.GroupBox groupBox9;
  1340. private System.Windows.Forms.ComboBox cmbStepUnit;
  1341. private System.Windows.Forms.Label label3;
  1342. private System.Windows.Forms.Label label2;
  1343. private System.Windows.Forms.Label label1;
  1344. private System.Windows.Forms.Label label4;
  1345. private System.Windows.Forms.GroupBox groupBox13;
  1346. private System.Windows.Forms.Button btnOther;
  1347. private System.Windows.Forms.Label label6;
  1348. private System.Windows.Forms.Label label5;
  1349. private System.Windows.Forms.TextBox txtPercentage;
  1350. private System.Windows.Forms.TextBox txtTime;
  1351. private System.Windows.Forms.TrackBar trackPercentage;
  1352. private System.Windows.Forms.TrackBar trackTime;
  1353. private System.Windows.Forms.RadioButton ckPolygon;
  1354. private System.Windows.Forms.RadioButton ckRectangle;
  1355. private System.Windows.Forms.RadioButton ckCircular;
  1356. private System.Windows.Forms.TextBox txtSizeX;
  1357. private System.Windows.Forms.TextBox txtTilesX;
  1358. private System.Windows.Forms.Label label8;
  1359. private System.Windows.Forms.Label label7;
  1360. private System.Windows.Forms.DataGridView dgvRegionTeb;
  1361. private System.Windows.Forms.Button btnDel;
  1362. private System.Windows.Forms.Button btnDetailed;
  1363. private System.Windows.Forms.Button btnEstablish;
  1364. private System.Windows.Forms.Label label11;
  1365. private System.Windows.Forms.Label label10;
  1366. private System.Windows.Forms.Label label9;
  1367. private System.Windows.Forms.TextBox txtAreaY;
  1368. private System.Windows.Forms.TextBox txtSizeY;
  1369. private System.Windows.Forms.TextBox txtTilesY;
  1370. private System.Windows.Forms.TextBox txtAreaX;
  1371. private System.Windows.Forms.RadioButton ckSeamless;
  1372. private System.Windows.Forms.RadioButton ckTile;
  1373. private System.Windows.Forms.Label label13;
  1374. private System.Windows.Forms.RadioButton ckSize;
  1375. private System.Windows.Forms.RadioButton ckLockNull;
  1376. private System.Windows.Forms.RadioButton ckArea;
  1377. private System.Windows.Forms.Label label12;
  1378. private System.Windows.Forms.Panel panelVision;
  1379. private System.Windows.Forms.Panel panelMotion;
  1380. private System.Windows.Forms.PictureBox picEffect;
  1381. private System.Windows.Forms.RadioButton ckOther;
  1382. private System.Windows.Forms.CheckBox chkAutoExposure;
  1383. private System.Windows.Forms.Label label16;
  1384. private System.Windows.Forms.Label lblUnit;
  1385. private System.Windows.Forms.Button btnWhiteBalance;
  1386. private System.Windows.Forms.DataGridViewTextBoxColumn regionId;
  1387. private System.Windows.Forms.DataGridViewTextBoxColumn regionName;
  1388. private System.Windows.Forms.DataGridViewTextBoxColumn regionTiles;
  1389. private System.Windows.Forms.DataGridViewTextBoxColumn regionZ;
  1390. private System.Windows.Forms.DataGridViewTextBoxColumn regionArea;
  1391. private System.Windows.Forms.Panel pnlSpeed;
  1392. private System.Windows.Forms.PictureBox pictureBox1;
  1393. private Label label18;
  1394. private Label label17;
  1395. private Label label15;
  1396. private CircleControl circleControl;
  1397. private CircleControl circleSportControl;
  1398. #endregion
  1399. private float m_overlapRate => (float)numOverlapRate.Value; // 拼接率
  1400. private System.Timers.Timer m_aeTimer;
  1401. private Thread m_stitchingThread;
  1402. private double m_scale = 1;
  1403. private bool _isDoing;
  1404. private bool IsDoing
  1405. {
  1406. get => _isDoing;
  1407. set
  1408. {
  1409. _isDoing = value;
  1410. if (value)
  1411. {
  1412. this.Invoke(new Action(() =>
  1413. {
  1414. btnWorking.Enabled = false;
  1415. btnStop.Enabled = true;
  1416. }));
  1417. }
  1418. else
  1419. {
  1420. this.Invoke(new Action(() =>
  1421. {
  1422. btnWorking.Enabled = true;
  1423. btnStop.Enabled = false;
  1424. }));
  1425. }
  1426. }
  1427. }
  1428. private int m_origZStep;
  1429. private NumericUpDown numOverlapRate;
  1430. private Label label19;
  1431. private ComboBox cmbStitchList;
  1432. private Mat[] Coll_Ori = new Mat[2];
  1433. public MultiDimensionaDialog() : base()
  1434. {
  1435. InitializeComponent();
  1436. }
  1437. public MultiDimensionaDialog(AppWorkspace appWorkspace) : base(appWorkspace)
  1438. {
  1439. InitializeComponent();
  1440. InitializeLanguageText();
  1441. m_aeTimer = new System.Timers.Timer(1000);
  1442. m_aeTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimerAutoExposure);
  1443. m_aeTimer.AutoReset = true;
  1444. m_aeTimer.SynchronizingObject = this;
  1445. this.panelControl.Controls.Add(m_documentWorkspace);
  1446. this.m_documentWorkspace.GraphicsList.SelectChanged += GraphicsList_SelectChanged;
  1447. circleControl = initViewCircal(71);
  1448. circleSportControl = initSportCircal(71);
  1449. this.panelVision.Controls.Add(this.circleControl);
  1450. this.panelMotion.Controls.Add(this.circleSportControl);
  1451. // 初始化步长单位
  1452. this.cmbStepUnit.Items.Clear();
  1453. this.cmbStepUnit.Items.AddRange(m_unit);
  1454. this.cmbStepUnit.SelectedIndex = 1;
  1455. this.btnStop.Enabled = false;
  1456. }
  1457. protected override void initCameraSetting()
  1458. {
  1459. int exposureVal = (int)(m_cameraParamModel.parame.LNExposure);
  1460. if (exposureVal >= trackTime.Minimum && exposureVal <= trackTime.Maximum)
  1461. {
  1462. trackTime.Value = exposureVal;
  1463. }
  1464. // 曝光百分比
  1465. int preExposure = m_cameraParamModel.parame.PreExposure;
  1466. if (preExposure < 5)
  1467. {
  1468. trackPercentage.Value = 5;
  1469. }
  1470. else if (preExposure > 200)
  1471. {
  1472. trackPercentage.Value = 200;
  1473. }
  1474. else
  1475. {
  1476. trackPercentage.Value = m_cameraParamModel.parame.PreExposure;
  1477. }
  1478. this.txtPercentage.Text = this.trackPercentage.Value.ToString();
  1479. UpdateExposureUI(m_cameraParamModel.parame.ATExposure);
  1480. }
  1481. private void MultiDimensionaDialog_FormClosing(object sender, FormClosingEventArgs e)
  1482. {
  1483. if (_stchCtlrList == null) return;
  1484. foreach (var item in _stchCtlrList)
  1485. {
  1486. item.Dispose();
  1487. }
  1488. _stchCtlrList.Clear();
  1489. GC.Collect();
  1490. }
  1491. #region Step Length
  1492. /// <summary>
  1493. /// Y轴單次进长度
  1494. /// </summary>
  1495. protected override double StepLenthX
  1496. {
  1497. get
  1498. {
  1499. string text = txtXStep.Text.Trim();
  1500. if (string.IsNullOrEmpty(text))
  1501. {
  1502. throw new Exception("Y" + PdnResources.GetString("Menu.TheXaxismovestepannotbeempty0.Text"));
  1503. }
  1504. var value = double.Parse(text);
  1505. if (cmbStepUnit.SelectedItem.ToString().Equals("mm"))
  1506. {
  1507. value *= 1000;
  1508. }
  1509. return value;
  1510. }
  1511. }
  1512. /// <summary>
  1513. /// Y轴單次进长度
  1514. /// </summary>
  1515. protected override double StepLenthY
  1516. {
  1517. get
  1518. {
  1519. string text = txtYStep.Text.Trim();
  1520. if (string.IsNullOrEmpty(text))
  1521. {
  1522. throw new Exception("Y" + PdnResources.GetString("Menu.TheXaxismovestepannotbeempty0.Text"));
  1523. }
  1524. var value = double.Parse(text);
  1525. if (cmbStepUnit.SelectedItem.ToString().Equals("mm"))
  1526. {
  1527. value *= 1000;
  1528. }
  1529. return value;
  1530. }
  1531. }
  1532. /// <summary>
  1533. /// Z轴步进长度
  1534. /// </summary>
  1535. protected override double StepLenthZ
  1536. {
  1537. get
  1538. {
  1539. string text = txtZStep.Text.Trim();
  1540. if (string.IsNullOrEmpty(text))
  1541. {
  1542. throw new Exception("Z" + PdnResources.GetString("Menu.TheXaxismovestepannotbeempty0.Text"));
  1543. }
  1544. var value = double.Parse(text);
  1545. if (cmbStepUnit.SelectedItem.ToString().Equals("mm"))
  1546. {
  1547. value *= 1000;
  1548. }
  1549. return value;
  1550. }
  1551. }
  1552. #endregion
  1553. #region Speed
  1554. protected override void ReinitSpeedUI()
  1555. {
  1556. InitGroupSpeed(pnlSpeed, SpeedChanged);
  1557. (pnlSpeed.Controls[1] as RadioButton).Checked = true;
  1558. }
  1559. protected void SpeedChanged(object sender, EventArgs e)
  1560. {
  1561. RadioButton radio = (RadioButton)sender;
  1562. if (radio.Checked)
  1563. {
  1564. int index = (int)radio.Tag;
  1565. m_Stage.SetSpeedXY(m_speedLists[index].LSpeed);
  1566. m_Stage.SetSpeedZ(m_speedLists[index].ZSpeed);
  1567. }
  1568. }
  1569. #endregion
  1570. #region 拼图方式
  1571. /// <summary>
  1572. /// 矩形
  1573. /// </summary>
  1574. /// <param name="sender"></param>
  1575. /// <param name="e"></param>
  1576. private void ckRectangle_CheckedChanged(object sender, EventArgs e)
  1577. {
  1578. if (ckRectangle.Checked)
  1579. {
  1580. DrawStitchingRectangle.ViewWidth = m_viewWidth;
  1581. DrawStitchingRectangle.ViewHeight = m_viewHeight;
  1582. DrawStitchingRectangle.Interval = m_overlapRate;
  1583. if (ckArea.Checked)
  1584. {
  1585. DrawStitchingRectangle.lockType = LockType.AREA;
  1586. }
  1587. else if (ckSize.Checked)
  1588. {
  1589. DrawStitchingRectangle.lockType = LockType.SIZE;
  1590. }
  1591. m_documentWorkspace.ActiveTool = DrawToolType.DrawStitchingRectangle;
  1592. btnEstablish.Enabled = false;
  1593. }
  1594. }
  1595. /// <summary>
  1596. /// 圆
  1597. /// </summary>
  1598. /// <param name="sender"></param>
  1599. /// <param name="e"></param>
  1600. private void ckCircular_CheckedChanged(object sender, EventArgs e)
  1601. {
  1602. if (ckCircular.Checked)
  1603. {
  1604. DrawStitchingCircle.ViewWidth = m_viewWidth;
  1605. DrawStitchingCircle.ViewHeight = m_viewHeight;
  1606. DrawStitchingRectangle.Interval = m_overlapRate;
  1607. if (ckArea.Checked)
  1608. {
  1609. DrawStitchingCircle.lockType = LockType.AREA;
  1610. }
  1611. else if (ckSize.Checked)
  1612. {
  1613. DrawStitchingCircle.lockType = LockType.SIZE;
  1614. }
  1615. m_documentWorkspace.ActiveTool = DrawToolType.DrawStitchingCircle;
  1616. btnEstablish.Enabled = false;
  1617. }
  1618. }
  1619. /// <summary>
  1620. /// 多边形
  1621. /// </summary>
  1622. /// <param name="sender"></param>
  1623. /// <param name="e"></param>
  1624. private void ckPolygon_CheckedChanged(object sender, EventArgs e)
  1625. {
  1626. if (ckPolygon.Checked)
  1627. {
  1628. DrawStitchingPolygon.ViewWidth = m_viewWidth;
  1629. DrawStitchingPolygon.ViewHeight = m_viewHeight;
  1630. DrawStitchingRectangle.Interval = m_overlapRate;
  1631. if (ckArea.Checked)
  1632. {
  1633. DrawStitchingPolygon.lockType = LockType.AREA;
  1634. }
  1635. else if (ckSize.Checked)
  1636. {
  1637. DrawStitchingPolygon.lockType = LockType.SIZE;
  1638. }
  1639. m_documentWorkspace.ActiveTool = DrawToolType.DrawStitchingPolygon;
  1640. btnEstablish.Enabled = false;
  1641. }
  1642. }
  1643. /// <summary>
  1644. /// 自定义
  1645. /// </summary>
  1646. /// <param name="sender"></param>
  1647. /// <param name="e"></param>
  1648. private void ckOther_CheckedChanged(object sender, EventArgs e)
  1649. {
  1650. btnEstablish.Enabled = true;
  1651. }
  1652. /// <summary>
  1653. /// 创建自定义矩形
  1654. /// </summary>
  1655. /// <param name="sender"></param>
  1656. /// <param name="e"></param>
  1657. private void btnEstablish_Click(object sender, EventArgs e)
  1658. {
  1659. DrawStitchingRectangle.ViewWidth = m_viewWidth;
  1660. DrawStitchingRectangle.ViewHeight = m_viewHeight;
  1661. DrawStitchingRectangle.Interval = m_overlapRate;
  1662. if (ckArea.Checked)
  1663. {
  1664. DrawStitchingRectangle.lockType = LockType.AREA;
  1665. }
  1666. else if (ckSize.Checked)
  1667. {
  1668. DrawStitchingRectangle.lockType = LockType.SIZE;
  1669. }
  1670. string tilesX = txtTilesX.Text.Trim();
  1671. string tilesY = txtTilesY.Text.Trim();
  1672. string sizeX = txtSizeX.Text.Trim();
  1673. string sizeY = txtSizeY.Text.Trim();
  1674. string areaX = txtAreaX.Text.Trim();
  1675. if (!string.IsNullOrEmpty(tilesX) && !string.IsNullOrEmpty(tilesY))
  1676. {
  1677. int x = Int32.Parse(tilesX);
  1678. int y = Int32.Parse(tilesY);
  1679. if (x <= 0 || y <= 0)
  1680. {
  1681. MessageBox.Show(PdnResources.GetString("Menu.Tilesmusthavavalue.Text"));
  1682. return;
  1683. }
  1684. m_documentWorkspace.ActiveTool = DrawToolType.DrawStitchingRectangle;
  1685. int width = (int)Math.Floor(Convert.ToDouble(((x - (x + 1) * m_overlapRate) * m_viewWidth))) - 1;
  1686. int height = (int)Math.Floor(Convert.ToDouble(((y - (y + 1) * m_overlapRate) * m_viewHeight))) - 1;
  1687. Console.WriteLine(width + " " + height + " " + m_viewHeight);
  1688. m_documentWorkspace.CreateStitchingRectangle(width, height);
  1689. UpdateActiveTool(this.m_documentWorkspace.ActiveTool);
  1690. }
  1691. if (!string.IsNullOrEmpty(sizeX) && !string.IsNullOrEmpty(sizeY))
  1692. {
  1693. float w = float.Parse(sizeX);
  1694. float h = float.Parse(sizeY);
  1695. if (w <= 0 || h <= 0)
  1696. {
  1697. MessageBox.Show(PdnResources.GetString("Menu.Sizevaluemustbegreaterthan0.Text"));
  1698. return;
  1699. }
  1700. m_documentWorkspace.ActiveTool = DrawToolType.DrawStitchingRectangle;
  1701. m_documentWorkspace.CreateStitchingRectangle((int)(w * 1000 / m_PxLength), (int)(h * 1000 / m_PxLength));
  1702. UpdateActiveTool(this.m_documentWorkspace.ActiveTool);
  1703. }
  1704. if (!string.IsNullOrEmpty(areaX))
  1705. {
  1706. double area = double.Parse(areaX);
  1707. if (area <= 0)
  1708. {
  1709. MessageBox.Show(PdnResources.GetString("Menu.TheAreavaluemustbegreaterthan0.Text"));
  1710. return;
  1711. }
  1712. double side = Math.Round(Math.Sqrt(area), 2);
  1713. m_documentWorkspace.ActiveTool = DrawToolType.DrawStitchingRectangle;
  1714. m_documentWorkspace.CreateStitchingRectangle((int)(side * 1000 / m_PxLength), (int)(side * 1000 / m_PxLength));
  1715. UpdateActiveTool(this.m_documentWorkspace.ActiveTool);
  1716. }
  1717. }
  1718. #endregion
  1719. #region 拼图区域列表
  1720. private void GraphicsList_SelectChanged(object sender, EventArgs e)
  1721. {
  1722. UpdateActiveTool(this.m_documentWorkspace.ActiveTool);
  1723. dgvRegionTeb.Rows.Clear();
  1724. List<DrawObject> graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
  1725. int count = graphicsList.Count;
  1726. for (int i = 0; i < count; i++)
  1727. {
  1728. int[] tiles = ((DrawStithchingBase)graphicsList[i]).GetTiles();
  1729. double area = ((DrawStithchingBase)graphicsList[i]).GetArea();
  1730. graphicsList[i].PropertyChanged += CameraImageStitching_PropertyChanged;
  1731. string name = "";
  1732. if (graphicsList[i] is DrawStitchingRectangle)
  1733. {
  1734. name = PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text");
  1735. }
  1736. else if (graphicsList[i] is DrawStitchingPolygon)
  1737. {
  1738. name = PdnResources.GetString("Menu.LabelAction.DrawPolygon.Text");
  1739. }
  1740. else
  1741. {
  1742. name = PdnResources.GetString("Menu.LabelAction.DrawCircle.Text");
  1743. }
  1744. dgvRegionTeb.Rows.Add(i, name, tiles[0] + "," + tiles[1], m_origZStep, area);
  1745. if (graphicsList[i].Selected)
  1746. {
  1747. dgvRegionTeb.Rows[i].Selected = true;
  1748. dgvRegionTeb.CurrentCell = dgvRegionTeb.Rows[i].Cells[0];
  1749. }
  1750. }
  1751. }
  1752. private void CameraImageStitching_PropertyChanged(object sender, EventArgs e)
  1753. {
  1754. UpdateActiveTool(this.m_documentWorkspace.ActiveTool);
  1755. this.DgvRegionTebRefresh();
  1756. }
  1757. private void DgvRegionTebRefresh()
  1758. {
  1759. dgvRegionTeb.Rows.Clear();
  1760. List<DrawObject> graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
  1761. int count = graphicsList.Count;
  1762. for (int i = 0; i < count; i++)
  1763. {
  1764. int[] tiles = ((DrawStithchingBase)graphicsList[i]).GetTiles();
  1765. double area = ((DrawStithchingBase)graphicsList[i]).GetArea();
  1766. string name;
  1767. if (graphicsList[i] is DrawStitchingRectangle)
  1768. {
  1769. name = PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text");
  1770. }
  1771. else if (graphicsList[i] is DrawStitchingPolygon)
  1772. {
  1773. name = PdnResources.GetString("Menu.LabelAction.DrawPolygon.Text");
  1774. }
  1775. else
  1776. {
  1777. name = PdnResources.GetString("Menu.LabelAction.DrawCircle.Text");
  1778. }
  1779. dgvRegionTeb.Rows.Add(i, name, tiles[0] + "," + tiles[1], m_origZStep, area);
  1780. }
  1781. }
  1782. private void UpdateActiveTool(DrawToolType activeTool)
  1783. {
  1784. switch (activeTool)
  1785. {
  1786. case DrawToolType.DrawStitchingRectangle:
  1787. this.ckRectangle.Checked = true;
  1788. break;
  1789. case DrawToolType.DrawStitchingCircle:
  1790. this.ckCircular.Checked = true;
  1791. break;
  1792. case DrawToolType.DrawStitchingPolygon:
  1793. this.ckPolygon.Checked = true;
  1794. break;
  1795. case DrawToolType.Pointer:
  1796. this.ckOther.Checked = true;
  1797. break;
  1798. }
  1799. }
  1800. /// <summary>
  1801. /// 无锁定
  1802. /// </summary>
  1803. /// <param name="sender"></param>
  1804. /// <param name="e"></param>
  1805. private void ckLockNull_CheckedChanged(object sender, EventArgs e)
  1806. {
  1807. int count = this.m_documentWorkspace.GraphicsList.Count;
  1808. for (int i = 0; i < count; i++)
  1809. {
  1810. ((DrawStithchingBase)this.m_documentWorkspace.GraphicsList[i]).Lock(LockType.NULL);
  1811. }
  1812. this.m_documentWorkspace.Refresh();
  1813. }
  1814. /// <summary>
  1815. /// 面积锁定
  1816. /// </summary>
  1817. /// <param name="sender"></param>
  1818. /// <param name="e"></param>
  1819. private void ckArea_CheckedChanged(object sender, EventArgs e)
  1820. {
  1821. int count = this.m_documentWorkspace.GraphicsList.Count;
  1822. for (int i = 0; i < count; i++)
  1823. {
  1824. ((DrawStithchingBase)this.m_documentWorkspace.GraphicsList[i]).Lock(LockType.AREA);
  1825. }
  1826. this.m_documentWorkspace.Refresh();
  1827. }
  1828. /// <summary>
  1829. /// 大小锁定
  1830. /// </summary>
  1831. /// <param name="sender"></param>
  1832. /// <param name="e"></param>
  1833. private void ckSize_CheckedChanged(object sender, EventArgs e)
  1834. {
  1835. int count = this.m_documentWorkspace.GraphicsList.Count;
  1836. for (int i = 0; i < count; i++)
  1837. {
  1838. ((DrawStithchingBase)this.m_documentWorkspace.GraphicsList[i]).Lock(LockType.SIZE);
  1839. }
  1840. this.m_documentWorkspace.Refresh();
  1841. }
  1842. private void btnDel_Click(object sender, EventArgs e)
  1843. {
  1844. if (dgvRegionTeb.SelectedRows.Count <= 0)
  1845. {
  1846. MessageBox.Show(PdnResources.GetString("Menu.Selectthedatatoelete0.Text"));
  1847. return;
  1848. }
  1849. DialogResult result = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretodelete.Text") + "?", PdnResources.GetString("Menu.Tips.text"), MessageBoxButtons.OKCancel);
  1850. if (result == DialogResult.OK)
  1851. {
  1852. //执行删除
  1853. foreach (DataGridViewRow r in dgvRegionTeb.SelectedRows)
  1854. {
  1855. if (!r.IsNewRow)
  1856. {
  1857. this.m_documentWorkspace.GraphicsList.RemoveAt(r.Index);
  1858. }
  1859. }
  1860. this.DgvRegionTebRefresh();
  1861. foreach (DataGridViewRow r in dgvRegionTeb.SelectedRows)
  1862. {
  1863. if (!r.IsNewRow)
  1864. {
  1865. this.m_documentWorkspace.GraphicsList[r.Index].Selected = true;
  1866. }
  1867. }
  1868. this.m_documentWorkspace.Refresh();
  1869. }
  1870. }
  1871. private void dgvRegionTeb_SelectionChanged(object sender, EventArgs e)
  1872. {
  1873. }
  1874. private void dgvRegionTeb_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
  1875. {
  1876. this.m_documentWorkspace.GraphicsList.UnselectAll();
  1877. for (int i = 0; i < dgvRegionTeb.Rows.Count; i++)
  1878. {
  1879. if (dgvRegionTeb.Rows[i].Selected)
  1880. {
  1881. this.m_documentWorkspace.GraphicsList[i].Selected = true;
  1882. }
  1883. else
  1884. {
  1885. this.m_documentWorkspace.GraphicsList[i].Selected = false;
  1886. }
  1887. }
  1888. this.m_documentWorkspace.Refresh();
  1889. }
  1890. private void dgvRegionTeb_CellContentClick(object sender, DataGridViewCellEventArgs e)
  1891. {
  1892. }
  1893. /// <summary>
  1894. /// 详细
  1895. /// </summary>
  1896. /// <param name="sender"></param>
  1897. /// <param name="e"></param>
  1898. private void btnDetailed_Click(object sender, EventArgs e)
  1899. {
  1900. if (dgvRegionTeb.SelectedRows.Count > 1 || dgvRegionTeb.SelectedRows.Count <= 0)
  1901. {
  1902. MessageBox.Show(PdnResources.GetString("Menu.Pleasselectandselecnlyoneuzzlearea0.Text"));
  1903. return;
  1904. }
  1905. foreach (DataGridViewRow r in dgvRegionTeb.SelectedRows)
  1906. {
  1907. if (!r.IsNewRow)
  1908. {
  1909. MultiDimensionaDetailDialog detailDialog = new MultiDimensionaDetailDialog(this.m_documentWorkspace, r.Index);
  1910. detailDialog.ShowDialog();
  1911. }
  1912. }
  1913. }
  1914. /// <summary>
  1915. /// 删除拼图区域
  1916. /// </summary>
  1917. /// <param name="vIndex"></param>
  1918. /// <param name="pIndex"></param>
  1919. private void DetailDialog_Deleted(int vIndex, int pIndex)
  1920. {
  1921. ((DrawStithchingBase)this.m_documentWorkspace.GraphicsList[vIndex]).DeletePoint(pIndex);
  1922. this.m_documentWorkspace.Refresh();
  1923. }
  1924. #endregion
  1925. #region 相机设置
  1926. /// <summary>
  1927. /// 其它设置
  1928. /// </summary>
  1929. private void btnCameraSetting_Click(object sender, EventArgs e)
  1930. {
  1931. using (CameraSettingDialog af = new CameraSettingDialog())
  1932. {
  1933. af.ShowDialog();
  1934. }
  1935. }
  1936. /// <summary>
  1937. /// 自动曝光
  1938. /// </summary>
  1939. private void chkAutoExposure_Click(object sender, EventArgs e)
  1940. {
  1941. int autoExposure = chkAutoExposure.Checked ? 1 : 0;
  1942. m_cameraParamModel.parame.ATExposure = autoExposure;
  1943. if (autoExposure == 0)
  1944. {
  1945. trackPercentage.Value = 100;
  1946. }
  1947. UpdateExposureUI(autoExposure);
  1948. }
  1949. private void UpdateExposureUI(int autoExposure)
  1950. {
  1951. if (autoExposure == 1)
  1952. {
  1953. // 自动曝光
  1954. trackTime.Enabled = false;
  1955. txtTime.Enabled = false;
  1956. trackPercentage.Enabled = false;
  1957. txtPercentage.Enabled = false;
  1958. chkAutoExposure.Checked = true;
  1959. trackPercentage.Value = 100;
  1960. m_aeTimer.Start();
  1961. }
  1962. else
  1963. {
  1964. trackTime.Enabled = true;
  1965. txtTime.Enabled = true;
  1966. trackPercentage.Enabled = true;
  1967. txtPercentage.Enabled = true;
  1968. chkAutoExposure.Checked = false;
  1969. m_aeTimer.Stop();
  1970. }
  1971. }
  1972. public void OnTimerAutoExposure(object source, System.Timers.ElapsedEventArgs e)
  1973. {
  1974. double paramValue = m_camera.GetExposureTime();
  1975. int expValue = (int)(paramValue * 1000);
  1976. if (expValue < 137)
  1977. {
  1978. expValue = 130;
  1979. }
  1980. if (expValue > 15000000)
  1981. {
  1982. expValue = 15000000;
  1983. }
  1984. trackTime.Value = expValue;
  1985. decimal txtVale = 0;
  1986. int sec = 0;
  1987. int msec = 0;
  1988. int usec = 0;
  1989. m_camera.UpdateExposureTime(ref sec, ref msec, ref usec, (UInt64)(paramValue * 1000));
  1990. if (sec > 0)
  1991. {
  1992. this.lblUnit.Text = "s";
  1993. txtVale += sec;
  1994. }
  1995. if (msec > 0)
  1996. {
  1997. if (txtVale > 0)
  1998. {
  1999. txtVale += ((decimal)msec / 1000);
  2000. this.lblUnit.Text = "s";
  2001. usec = 0; // 微秒舍掉不显示了
  2002. }
  2003. else
  2004. {
  2005. this.lblUnit.Text = "ms";
  2006. txtVale += msec;
  2007. }
  2008. }
  2009. if (usec > 0)
  2010. {
  2011. if (txtVale > 0)
  2012. {
  2013. txtVale += ((decimal)usec / 1000);
  2014. }
  2015. else
  2016. {
  2017. this.lblUnit.Text = "μs";
  2018. txtVale = usec;
  2019. }
  2020. }
  2021. this.txtTime.Text = txtVale.ToString();
  2022. }
  2023. private void trackTime_ValueChanged(object sender, EventArgs e)
  2024. {
  2025. //规划为微秒值存储到model
  2026. double atExpValue = (double)(this.trackTime.Value);
  2027. int exposureTimeUSec = (int)atExpValue;
  2028. this.m_cameraParamModel.parame.LNExposure = exposureTimeUSec;
  2029. // 设置到相机
  2030. m_camera.SetExposureTime((ulong)(exposureTimeUSec * (trackPercentage.Value / 100))); //usec
  2031. decimal txtVale = 0;
  2032. int sec = 0;
  2033. int msec = 0;
  2034. int usec = 0;
  2035. m_camera.UpdateExposureTime(ref sec, ref msec, ref usec, (UInt64)exposureTimeUSec);
  2036. if (sec > 0)
  2037. {
  2038. this.lblUnit.Text = "s";
  2039. txtVale += sec;
  2040. }
  2041. if (msec > 0)
  2042. {
  2043. if (txtVale > 0)
  2044. {
  2045. txtVale += ((decimal)msec / 1000);
  2046. this.lblUnit.Text = "s";
  2047. usec = 0; // 微秒舍掉不显示了
  2048. }
  2049. else
  2050. {
  2051. this.lblUnit.Text = "ms";
  2052. txtVale += msec;
  2053. }
  2054. }
  2055. if (usec > 0)
  2056. {
  2057. if (txtVale > 0)
  2058. {
  2059. txtVale += ((decimal)usec / 1000);
  2060. }
  2061. else
  2062. {
  2063. this.lblUnit.Text = "μs";
  2064. txtVale = usec;
  2065. }
  2066. }
  2067. this.txtTime.Text = txtVale.ToString();
  2068. }
  2069. private void txtTime_KeyPress(object sender, KeyPressEventArgs e)
  2070. {
  2071. if (!char.IsDigit(e.KeyChar) && (e.KeyChar != (char)Keys.Enter)) // 非数字键, 放弃该输入
  2072. {
  2073. e.Handled = true;
  2074. return;
  2075. }
  2076. if (e.KeyChar == (char)Keys.Enter)
  2077. {
  2078. try
  2079. {
  2080. int baoGuangTBarVal = Convert.ToInt32(txtTime.Text);
  2081. switch (lblUnit.Text)
  2082. {
  2083. case "s":
  2084. baoGuangTBarVal = baoGuangTBarVal * 1000 * 1000;
  2085. break;
  2086. case "ms":
  2087. baoGuangTBarVal = baoGuangTBarVal * 1000;
  2088. break;
  2089. }
  2090. if (baoGuangTBarVal > trackTime.Maximum)
  2091. {
  2092. baoGuangTBarVal = trackTime.Maximum;
  2093. }
  2094. if (baoGuangTBarVal < trackTime.Minimum)
  2095. {
  2096. baoGuangTBarVal = trackTime.Minimum;
  2097. }
  2098. trackTime.Value = baoGuangTBarVal;
  2099. }
  2100. catch (Exception ex)
  2101. {
  2102. MessageBox.Show(ex.Message);
  2103. }
  2104. }
  2105. }
  2106. private void trackPercentage_ValueChanged(object sender, EventArgs e)
  2107. {
  2108. double atExpValue = (double)(this.trackTime.Value) * (double)this.trackPercentage.Value / 100.0;
  2109. this.txtPercentage.Text = this.trackPercentage.Value + "";
  2110. m_cameraParamModel.parame.PreExposure = this.trackPercentage.Value;
  2111. if (m_cameraParamModel.parame.ATExposure == 0)
  2112. {
  2113. // 设置到相机
  2114. m_camera.SetExposureTime((ulong)atExpValue); //usec
  2115. }
  2116. }
  2117. private void txtPercentage_KeyPress(object sender, KeyPressEventArgs e)
  2118. {
  2119. if (!char.IsDigit(e.KeyChar) && (e.KeyChar != (char)Keys.Enter)) // 非数字键, 放弃该输入
  2120. {
  2121. e.Handled = true;
  2122. return;
  2123. }
  2124. if (e.KeyChar == (char)Keys.Enter)
  2125. {
  2126. try
  2127. {
  2128. int baoGuangPerTBarVal = Convert.ToInt32(txtPercentage.Text);
  2129. if (baoGuangPerTBarVal < 5)
  2130. {
  2131. baoGuangPerTBarVal = 5;
  2132. }
  2133. if (baoGuangPerTBarVal > 200)
  2134. {
  2135. baoGuangPerTBarVal = 200;
  2136. }
  2137. trackPercentage.Value = baoGuangPerTBarVal;
  2138. }
  2139. catch (Exception ex)
  2140. {
  2141. MessageBox.Show(ex.Message);
  2142. }
  2143. }
  2144. }
  2145. /// <summary>
  2146. /// 白平衡
  2147. /// </summary>
  2148. /// <param name="sender"></param>
  2149. /// <param name="e"></param>
  2150. private void btnWhiteBalance_Click(object sender, EventArgs e)
  2151. {
  2152. m_cameraParamModel.parame.WhiteBalance = 1;
  2153. // 自动白平衡
  2154. m_camera.SetWhiteBalanceMode(WhiteBalanceMode.AUTO);
  2155. }
  2156. #endregion
  2157. #region 拼图
  2158. private StitchingController _stitching;
  2159. private List<StitchingController> _stchCtlrList;
  2160. private void btnStop_Click(object sender, EventArgs e)
  2161. {
  2162. IsDoing = false;
  2163. m_Stage.LockStage();
  2164. m_Stage.LockZ();
  2165. }
  2166. /// <summary>
  2167. /// 拼图开始
  2168. /// </summary>
  2169. private void btnWorking_Click(object sender, EventArgs e)
  2170. {
  2171. if (!m_camera.IsOpen())
  2172. {
  2173. MessageBox.Show(PdnResources.GetString("Menu.Pleaseconfirmwhetherthecameraisconnected.Text"));
  2174. return;
  2175. }
  2176. if (!m_isReset)
  2177. {
  2178. MessageBox.Show(PdnResources.GetString("Menu.Pleaseresetfirst.Text"));
  2179. return;
  2180. }
  2181. if (this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch).Count <= 0)
  2182. {
  2183. MessageBox.Show(PdnResources.GetString("Menu.Pleasereatethepuzzleareafirst.Text"));
  2184. return;
  2185. }
  2186. _stchCtlrList = new List<StitchingController>();
  2187. IsDoing = true;
  2188. m_stitchingThread = new Thread(new ThreadStart(StitchingMoveThreadEntry));
  2189. m_stitchingThread.Start();
  2190. ///展示拼图成果
  2191. new Task(() =>
  2192. {
  2193. do
  2194. {
  2195. if (_stitching != null)
  2196. {
  2197. if (_stitching.Result != null)
  2198. this.Invoke(new Action(() =>
  2199. {
  2200. pictureBox1.Image = _stitching.Result;
  2201. pictureBox1.Invalidate();
  2202. }));
  2203. }
  2204. else Thread.Sleep(300);
  2205. } while ((IsDoing || (_stitching != null && !_stitching.IsDone)));
  2206. }).Start();
  2207. }
  2208. /// <summary>
  2209. /// 景深融合
  2210. /// </summary>
  2211. protected override void DepthMerge()
  2212. {
  2213. m_Stage.WaitMoveDone();
  2214. if (m_zMat == null)
  2215. {
  2216. m_zMat = BitmapConverter.ToMat(m_BitmapCurrent);
  2217. }
  2218. else
  2219. {
  2220. //原始图
  2221. Coll_Ori[1] = BitmapConverter.ToMat(m_BitmapCurrent);
  2222. Coll_Ori[0] = m_zMat;
  2223. m_zMat = Merge.GetMergeMatForCamera(Coll_Ori);
  2224. GC.Collect();
  2225. }
  2226. }
  2227. private Mat m_zMat;
  2228. private void StitchingMoveThreadEntry()
  2229. {
  2230. List<DrawObject> graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
  2231. for (int i = 0; i < graphicsList.Count; i++)
  2232. {
  2233. var draw = (DrawStithchingBase)graphicsList[i];
  2234. List<Dictionary<int, object>> list = draw.GetViewPoints();
  2235. PointF currentPointF = (PointF)list[0][0];
  2236. this.Invoke(new Action(() =>
  2237. {
  2238. if (i == 0)
  2239. cmbStitchList.Items.Clear();
  2240. cmbStitchList.Items.Add(i);
  2241. cmbStitchList.Visible = i > 0;
  2242. }));
  2243. //_stitching?.Wait();
  2244. _stitching = new StitchingController(draw.ColumnNum, draw.RowNum, m_overlapRate);
  2245. _stchCtlrList.Add(_stitching);
  2246. _stitching.Start();
  2247. for (int j = 0; j < list.Count; j++)
  2248. {
  2249. if (!IsDoing) return;//结束
  2250. Dictionary<int, object> point = list[j];
  2251. //if (point[1].ToString().Equals("0"))
  2252. {
  2253. PointF nextP = (PointF)point[0];
  2254. var x = ConvertPXToUm((int)(nextP.X));
  2255. var y = ConvertPXToUm((int)(nextP.Y));
  2256. base.m_Stage.To(x, y);
  2257. m_Stage.WaitMoveDone();
  2258. //景深融合
  2259. Bitmap img0;
  2260. ZScanParameter scan = ((DrawStithchingBase)graphicsList[i]).GetZAxisScan(j);
  2261. if (scan.Track > 0)
  2262. {
  2263. m_zMat = null;
  2264. var _isDepthMerging = true;
  2265. m_Stage.ZScan(scan.Start, scan.Track, scan.Times, DepthMerge, null, () => _isDepthMerging = false);
  2266. while (_isDepthMerging)
  2267. {
  2268. if (!IsDoing) return;
  2269. Thread.Sleep(50);
  2270. }
  2271. img0 = BitmapConverter.ToBitmap(m_zMat);
  2272. }
  2273. else
  2274. {
  2275. base.m_Stage.UpTo(m_origZStep);
  2276. m_Stage.WaitMoveDone();
  2277. img0 = m_BitmapCurrent;
  2278. }
  2279. _stitching.Add(img0);
  2280. }
  2281. }
  2282. }
  2283. _stitching?.Wait();
  2284. //拼图结束
  2285. IsDoing = false;
  2286. this.Invoke(new Action(() =>
  2287. {
  2288. cmbStitchList.SelectedIndex = cmbStitchList.Items.Count - 1;
  2289. }));
  2290. }
  2291. private void btnCreatImgFile_Click(object sender, EventArgs e)
  2292. {
  2293. if (_stitching == null)
  2294. {
  2295. MessageBox.Show(PdnResources.GetString("Menu.NoMosaicimagefound.Text"));
  2296. return;
  2297. }
  2298. //获取命名
  2299. string photoName;
  2300. if (Startup.instance.ruleDB == null)
  2301. {
  2302. photoName = NamingRuleHelper.GetNameFromXml(Startup.instance.configModel, "默认标尺", "0");
  2303. }
  2304. else
  2305. {
  2306. photoName = NamingRuleHelper.GetNameFromXml(Startup.instance.configModel, Startup.instance.ruleDB.ruler_name, Startup.instance.ruleDB.gain_multiple.ToString());
  2307. }
  2308. DocumentWorkspace dw = m_appWorkspace.AddNewDocumentWorkspace();
  2309. Document document = Document.FromImage(_stitching.Result);
  2310. document.Dirty = true;
  2311. dw.Document = document;
  2312. dw.fileText = photoName;
  2313. dw.xmlSaveModel = Startup.instance.ruleDB;
  2314. dw.InitRulerInfo();
  2315. //激活
  2316. m_appWorkspace.ActiveDocumentWorkspace = dw;
  2317. //锁定扩缩
  2318. if (m_appWorkspace.isLockZoom && m_appWorkspace.lockScaleRatio > 0)
  2319. {
  2320. m_appWorkspace.ActiveDocumentWorkspace.ZoomBasis = ZoomBasis.ScaleFactor;
  2321. m_appWorkspace.ActiveDocumentWorkspace.ScaleFactor = ScaleFactor.FromDouble(m_appWorkspace.lockScaleRatio);
  2322. m_appWorkspace.SetZoonTrackValue(m_appWorkspace.ActiveDocumentWorkspace.ScaleFactor);
  2323. }
  2324. else
  2325. {
  2326. m_appWorkspace.ActiveDocumentWorkspace.ZoomBasis = ZoomBasis.FitToWindow;
  2327. }
  2328. m_appWorkspace.Refresh();
  2329. }
  2330. #endregion
  2331. }
  2332. }