MultiDimensionaDialog.cs 106 KB

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