ListOfLocationsDialog.cs 90 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009
  1. using OpenCvSharp;
  2. using PaintDotNet.Adjust.BaseImage;
  3. using PaintDotNet.Annotation;
  4. using PaintDotNet.Annotation.Enum;
  5. using PaintDotNet.Annotation.ImageCollect;
  6. using PaintDotNet.Base.CommTool;
  7. using PaintDotNet.Base.SettingModel;
  8. using PaintDotNet.CustomControl;
  9. using PaintDotNet.Setting;
  10. using System;
  11. using System.Collections.Generic;
  12. using System.ComponentModel;
  13. using System.Data;
  14. using System.Drawing;
  15. using System.Drawing.Drawing2D;
  16. using System.IO;
  17. using System.Linq;
  18. using System.Management;
  19. using System.Runtime.InteropServices;
  20. using System.Text;
  21. using System.Threading;
  22. using System.Windows.Forms;
  23. using System.Windows.Interop;
  24. using PaintDotNet.Hardware;
  25. using PaintDotNet.ImageCollect.ListOfLocation;
  26. using OpenCvSharp.Extensions;
  27. namespace PaintDotNet.ImageCollect
  28. {
  29. internal class ListOfLocationsDialog : HardwareBaseDialog
  30. {
  31. private System.ComponentModel.IContainer components = null;
  32. protected override void Dispose(bool disposing)
  33. {
  34. if (disposing && (components != null))
  35. {
  36. components.Dispose();
  37. }
  38. base.Dispose(disposing);
  39. }
  40. #region Windows Form Designer generated code
  41. private new void InitializeLanguageText()
  42. {
  43. this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
  44. this.btnDelete.Text = PdnResources.GetString("Menu.Edit.Delete.Text");
  45. this.btnSave.Text = PdnResources.GetString("Menu.File.Save.Text");
  46. this.btnSaveAs.Text = PdnResources.GetString("Menu.File.SaveAs.Text");
  47. this.btnStop.Text = PdnResources.GetString("Menu.stop.text");
  48. this.btnCreatImgFile.Text = PdnResources.GetString("Menu.Createpicture.text");
  49. this.btnWorking.Text = PdnResources.GetString("Menu.Started.text");
  50. this.groupBox2.Text = PdnResources.GetString("Menu.ImageCollection.CameraSetting.Text");
  51. this.btnWhiteBalance.Text = PdnResources.GetString("Menu.auto.text") + PdnResources.GetString("Menu.Image.WhiteBalance.Text");
  52. this.chkAutoExposure.Text = PdnResources.GetString("Menu.auto-exposure.text");
  53. this.btnOther.Text = PdnResources.GetString("Menu.othersettings.text");
  54. this.label6.Text = PdnResources.GetString("Menu.Exposurepercentage.text") + ":";
  55. this.label5.Text = PdnResources.GetString("Menu.timeofexposure.text") + ":";
  56. this.groupBox6.Text = PdnResources.GetString("Menu.HardwareControl.Text");
  57. this.label4.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.speed.text") + ":";
  58. this.groupBox12.Text = PdnResources.GetString("Menu.Fixedlength.text");
  59. this.groupBox11.Text = PdnResources.GetString("Menu.continuous.text");
  60. this.groupBox10.Text = PdnResources.GetString("Menu.viewmode.text");
  61. this.groupBox9.Text = PdnResources.GetString("Menu.movementmode.text");
  62. this.groupBox13.Text = PdnResources.GetString("Menu.Puzzleeffect.text");
  63. this.groupBox3.Text = PdnResources.GetString("Menu.Addtheposition.Text");
  64. this.btnAddCross.Text = PdnResources.GetString("Menu.Addalist.Text");
  65. this.rdoCenter.Text = PdnResources.GetString("Menu.center.text");
  66. this.rdoLeftTop.Text = PdnResources.GetString("Menu.Upperleft.text");
  67. this.groupBox4.Text = PdnResources.GetString("Menu.ImageCollection.ListOfLocations.Text");
  68. this.btnModify.Text = PdnResources.GetString("Menu.change.Text");
  69. this.btnDel.Text = PdnResources.GetString("Menu.delete.Text");
  70. this.id.HeaderText = PdnResources.GetString("Menu.Dedicatedanalysis.Non-ferrousmetals.serialnumber.text");
  71. this.Text = PdnResources.GetString("Menu.ImageCollection.ListOfLocations.Text");
  72. base.InitializeLanguageText();
  73. }
  74. private void InitializeComponent()
  75. {
  76. this.groupBox1 = new System.Windows.Forms.GroupBox();
  77. this.btnDelete = new System.Windows.Forms.Button();
  78. this.btnSave = new System.Windows.Forms.Button();
  79. this.btnSaveAs = new System.Windows.Forms.Button();
  80. this.cmbFile = new System.Windows.Forms.ComboBox();
  81. this.btnStop = new System.Windows.Forms.Button();
  82. this.btnCreatImgFile = new System.Windows.Forms.Button();
  83. this.btnWorking = new System.Windows.Forms.Button();
  84. this.groupBox2 = new System.Windows.Forms.GroupBox();
  85. this.btnWhiteBalance = new System.Windows.Forms.Button();
  86. this.label16 = new System.Windows.Forms.Label();
  87. this.lblUnit = new System.Windows.Forms.Label();
  88. this.chkAutoExposure = new System.Windows.Forms.CheckBox();
  89. this.txtPercentage = new System.Windows.Forms.TextBox();
  90. this.txtTime = new System.Windows.Forms.TextBox();
  91. this.trackPercentage = new System.Windows.Forms.TrackBar();
  92. this.trackTime = new System.Windows.Forms.TrackBar();
  93. this.btnOther = new System.Windows.Forms.Button();
  94. this.label6 = new System.Windows.Forms.Label();
  95. this.label5 = new System.Windows.Forms.Label();
  96. this.groupBox6 = new System.Windows.Forms.GroupBox();
  97. this.label18 = new System.Windows.Forms.Label();
  98. this.label17 = new System.Windows.Forms.Label();
  99. this.label15 = new System.Windows.Forms.Label();
  100. this.pnlSpeed = new System.Windows.Forms.Panel();
  101. this.label4 = new System.Windows.Forms.Label();
  102. this.cmbStepUnit = new System.Windows.Forms.ComboBox();
  103. this.label3 = new System.Windows.Forms.Label();
  104. this.label2 = new System.Windows.Forms.Label();
  105. this.label1 = new System.Windows.Forms.Label();
  106. this.groupBox12 = new System.Windows.Forms.GroupBox();
  107. this.groupBox11 = new System.Windows.Forms.GroupBox();
  108. this.groupBox10 = new System.Windows.Forms.GroupBox();
  109. this.panelVision = new System.Windows.Forms.Panel();
  110. this.groupBox9 = new System.Windows.Forms.GroupBox();
  111. this.panelMotion = new System.Windows.Forms.Panel();
  112. this.panelControl = new System.Windows.Forms.Panel();
  113. this.groupBox13 = new System.Windows.Forms.GroupBox();
  114. this.pictureBox1 = new System.Windows.Forms.PictureBox();
  115. this.picEffect = new System.Windows.Forms.PictureBox();
  116. this.groupBox3 = new System.Windows.Forms.GroupBox();
  117. this.btnAddCross = new System.Windows.Forms.Button();
  118. this.label10 = new System.Windows.Forms.Label();
  119. this.txtLY = new System.Windows.Forms.TextBox();
  120. this.label11 = new System.Windows.Forms.Label();
  121. this.txtNY = new System.Windows.Forms.TextBox();
  122. this.label12 = new System.Windows.Forms.Label();
  123. this.label9 = new System.Windows.Forms.Label();
  124. this.txtLX = new System.Windows.Forms.TextBox();
  125. this.label8 = new System.Windows.Forms.Label();
  126. this.txtNX = new System.Windows.Forms.TextBox();
  127. this.label7 = new System.Windows.Forms.Label();
  128. this.rdoCenter = new System.Windows.Forms.RadioButton();
  129. this.rdoLeftTop = new System.Windows.Forms.RadioButton();
  130. this.groupBox4 = new System.Windows.Forms.GroupBox();
  131. this.btnModify = new System.Windows.Forms.Button();
  132. this.btnDel = new System.Windows.Forms.Button();
  133. this.dgvRegionTeb = new System.Windows.Forms.DataGridView();
  134. this.id = new System.Windows.Forms.DataGridViewTextBoxColumn();
  135. this.x = new System.Windows.Forms.DataGridViewTextBoxColumn();
  136. this.y = new System.Windows.Forms.DataGridViewTextBoxColumn();
  137. this.z = new System.Windows.Forms.DataGridViewTextBoxColumn();
  138. this.groupBox1.SuspendLayout();
  139. this.groupBox2.SuspendLayout();
  140. ((System.ComponentModel.ISupportInitialize)(this.trackPercentage)).BeginInit();
  141. ((System.ComponentModel.ISupportInitialize)(this.trackTime)).BeginInit();
  142. this.groupBox6.SuspendLayout();
  143. this.groupBox12.SuspendLayout();
  144. this.groupBox11.SuspendLayout();
  145. this.groupBox10.SuspendLayout();
  146. this.groupBox9.SuspendLayout();
  147. this.groupBox13.SuspendLayout();
  148. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
  149. ((System.ComponentModel.ISupportInitialize)(this.picEffect)).BeginInit();
  150. this.groupBox3.SuspendLayout();
  151. this.groupBox4.SuspendLayout();
  152. ((System.ComponentModel.ISupportInitialize)(this.dgvRegionTeb)).BeginInit();
  153. this.SuspendLayout();
  154. //
  155. // lblXPosition
  156. //
  157. this.lblXPosition.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  158. this.lblXPosition.AutoSize = true;
  159. this.lblXPosition.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  160. this.lblXPosition.Location = new System.Drawing.Point(429, 642);
  161. this.lblXPosition.Size = new System.Drawing.Size(28, 14);
  162. this.lblXPosition.TabIndex = 42;
  163. this.lblXPosition.Text = "X:0";
  164. //
  165. // lblYPosition
  166. //
  167. this.lblYPosition.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  168. this.lblYPosition.AutoSize = true;
  169. this.lblYPosition.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  170. this.lblYPosition.Location = new System.Drawing.Point(429, 668);
  171. this.lblYPosition.Size = new System.Drawing.Size(28, 14);
  172. this.lblYPosition.TabIndex = 43;
  173. this.lblYPosition.Text = "Y:0";
  174. //
  175. // lblZPosition
  176. //
  177. this.lblZPosition.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  178. this.lblZPosition.AutoSize = true;
  179. this.lblZPosition.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  180. this.lblZPosition.Location = new System.Drawing.Point(429, 693);
  181. this.lblZPosition.Size = new System.Drawing.Size(28, 14);
  182. this.lblZPosition.TabIndex = 44;
  183. this.lblZPosition.Text = "Z:0";
  184. //
  185. // btnLockloadstage
  186. //
  187. this.btnFreeloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  188. this.btnFreeloadstage.Location = new System.Drawing.Point(72, 684);
  189. this.btnFreeloadstage.Size = new System.Drawing.Size(59, 31);
  190. this.btnFreeloadstage.TabIndex = 31;
  191. this.btnFreeloadstage.Text = "锁定";
  192. this.btnFreeloadstage.UseVisualStyleBackColor = true;
  193. //
  194. // btnStoploadstage
  195. //
  196. this.btnStoploadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  197. this.btnStoploadstage.Location = new System.Drawing.Point(72, 639);
  198. this.btnStoploadstage.Size = new System.Drawing.Size(59, 33);
  199. this.btnStoploadstage.TabIndex = 30;
  200. this.btnStoploadstage.Text = "停止";
  201. this.btnStoploadstage.UseVisualStyleBackColor = true;
  202. //
  203. // btnResetloadstage
  204. //
  205. this.btnResetloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  206. this.btnResetloadstage.Location = new System.Drawing.Point(7, 639);
  207. this.btnResetloadstage.Size = new System.Drawing.Size(60, 33);
  208. this.btnResetloadstage.TabIndex = 29;
  209. this.btnResetloadstage.Text = "复位";
  210. this.btnResetloadstage.UseVisualStyleBackColor = true;
  211. //
  212. // btnCenterloadstage
  213. //
  214. this.btnCenterloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  215. this.btnCenterloadstage.Location = new System.Drawing.Point(7, 684);
  216. this.btnCenterloadstage.Size = new System.Drawing.Size(60, 31);
  217. this.btnCenterloadstage.TabIndex = 28;
  218. this.btnCenterloadstage.Text = "中心";
  219. this.btnCenterloadstage.UseVisualStyleBackColor = true;
  220. //
  221. // btnInloadstage
  222. //
  223. this.btnInloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  224. this.btnInloadstage.Location = new System.Drawing.Point(72, 592);
  225. this.btnInloadstage.Size = new System.Drawing.Size(61, 33);
  226. this.btnInloadstage.TabIndex = 27;
  227. this.btnInloadstage.Text = "进片";
  228. this.btnInloadstage.UseVisualStyleBackColor = true;
  229. //
  230. // btnOutloadstage
  231. //
  232. this.btnOutloadstage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  233. this.btnOutloadstage.Location = new System.Drawing.Point(7, 592);
  234. this.btnOutloadstage.Size = new System.Drawing.Size(60, 33);
  235. this.btnOutloadstage.TabIndex = 26;
  236. this.btnOutloadstage.Text = "出片";
  237. this.btnOutloadstage.UseVisualStyleBackColor = true;
  238. //
  239. // btnZStop
  240. //
  241. this.btnZStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  242. this.btnZStop.Location = new System.Drawing.Point(346, 682);
  243. this.btnZStop.Size = new System.Drawing.Size(59, 33);
  244. this.btnZStop.TabIndex = 41;
  245. this.btnZStop.Text = "停止";
  246. this.btnZStop.UseVisualStyleBackColor = true;
  247. //
  248. // btnZLock
  249. //
  250. this.btnZFree.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  251. this.btnZFree.Location = new System.Drawing.Point(346, 641);
  252. this.btnZFree.Size = new System.Drawing.Size(59, 31);
  253. this.btnZFree.TabIndex = 40;
  254. this.btnZFree.Text = "锁定";
  255. this.btnZFree.UseVisualStyleBackColor = true;
  256. //
  257. // txtXStep
  258. //
  259. this.txtXStep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  260. this.txtXStep.Location = new System.Drawing.Point(160, 592);
  261. this.txtXStep.Size = new System.Drawing.Size(68, 21);
  262. this.txtXStep.TabIndex = 35;
  263. this.txtXStep.Text = "1000";
  264. //
  265. // txtYStep
  266. //
  267. this.txtYStep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  268. this.txtYStep.Location = new System.Drawing.Point(256, 592);
  269. this.txtYStep.Size = new System.Drawing.Size(68, 21);
  270. this.txtYStep.TabIndex = 36;
  271. this.txtYStep.Text = "1000";
  272. //
  273. // txtZStep
  274. //
  275. this.txtZStep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  276. this.txtZStep.Location = new System.Drawing.Point(353, 592);
  277. this.txtZStep.Size = new System.Drawing.Size(68, 21);
  278. this.txtZStep.TabIndex = 37;
  279. this.txtZStep.Text = "200";
  280. //
  281. // btnContinuityLower
  282. //
  283. this.btnContinuityLower.Location = new System.Drawing.Point(5, 89);
  284. this.btnContinuityLower.Size = new System.Drawing.Size(46, 59);
  285. this.btnContinuityLower.TabIndex = 1;
  286. this.btnContinuityLower.UseVisualStyleBackColor = true;
  287. //
  288. // btnContinuityUp
  289. //
  290. this.btnContinuityUp.Location = new System.Drawing.Point(5, 24);
  291. this.btnContinuityUp.Size = new System.Drawing.Size(46, 59);
  292. this.btnContinuityUp.TabIndex = 1;
  293. this.btnContinuityUp.UseVisualStyleBackColor = true;
  294. //
  295. // btnFixedLower
  296. //
  297. this.btnFixedLower.Location = new System.Drawing.Point(5, 89);
  298. this.btnFixedLower.Size = new System.Drawing.Size(46, 59);
  299. this.btnFixedLower.TabIndex = 2;
  300. this.btnFixedLower.UseVisualStyleBackColor = true;
  301. //
  302. // btnFixedUp
  303. //
  304. this.btnFixedUp.Location = new System.Drawing.Point(5, 24);
  305. this.btnFixedUp.Size = new System.Drawing.Size(46, 59);
  306. this.btnFixedUp.TabIndex = 3;
  307. this.btnFixedUp.UseVisualStyleBackColor = true;
  308. //
  309. // btnCenterDisplay
  310. //
  311. this.btnCenterDisplay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  312. this.btnCenterDisplay.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  313. this.btnCenterDisplay.Location = new System.Drawing.Point(427, 522);
  314. this.btnCenterDisplay.Size = new System.Drawing.Size(74, 33);
  315. this.btnCenterDisplay.TabIndex = 49;
  316. this.btnCenterDisplay.Text = "中心显示";
  317. this.btnCenterDisplay.UseVisualStyleBackColor = true;
  318. //
  319. // btnStopall
  320. //
  321. this.btnStopall.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  322. this.btnStopall.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  323. this.btnStopall.Location = new System.Drawing.Point(427, 483);
  324. this.btnStopall.Size = new System.Drawing.Size(74, 33);
  325. this.btnStopall.TabIndex = 48;
  326. this.btnStopall.Text = "全部停止";
  327. this.btnStopall.UseVisualStyleBackColor = true;
  328. //
  329. // btnDsRocker
  330. //
  331. this.btnDsRocker.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  332. this.btnDsRocker.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  333. this.btnDsRocker.Location = new System.Drawing.Point(427, 444);
  334. this.btnDsRocker.Size = new System.Drawing.Size(74, 33);
  335. this.btnDsRocker.TabIndex = 47;
  336. this.btnDsRocker.Text = "禁用摇杆";
  337. this.btnDsRocker.UseVisualStyleBackColor = true;
  338. //
  339. // btnSetting
  340. //
  341. this.btnSetting.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  342. this.btnSetting.Location = new System.Drawing.Point(796, 11);
  343. this.btnSetting.Size = new System.Drawing.Size(92, 30);
  344. this.btnSetting.TabIndex = 3;
  345. this.btnSetting.Text = "串口设置";
  346. this.btnSetting.UseVisualStyleBackColor = true;
  347. //
  348. // groupBox1
  349. //
  350. this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  351. | System.Windows.Forms.AnchorStyles.Right)));
  352. this.groupBox1.Controls.Add(this.btnDelete);
  353. this.groupBox1.Controls.Add(this.btnSave);
  354. this.groupBox1.Controls.Add(this.btnSaveAs);
  355. this.groupBox1.Controls.Add(this.cmbFile);
  356. this.groupBox1.Controls.Add(this.btnSetting);
  357. this.groupBox1.Controls.Add(this.btnStop);
  358. this.groupBox1.Controls.Add(this.btnCreatImgFile);
  359. this.groupBox1.Controls.Add(this.btnWorking);
  360. this.groupBox1.Location = new System.Drawing.Point(12, 12);
  361. this.groupBox1.Name = "groupBox1";
  362. this.groupBox1.Size = new System.Drawing.Size(1235, 47);
  363. this.groupBox1.TabIndex = 3;
  364. this.groupBox1.TabStop = false;
  365. this.groupBox1.Text = "操作";
  366. this.groupBox1.Controls.SetChildIndex(this.btnWorking, 0);
  367. this.groupBox1.Controls.SetChildIndex(this.btnCreatImgFile, 0);
  368. this.groupBox1.Controls.SetChildIndex(this.btnStop, 0);
  369. this.groupBox1.Controls.SetChildIndex(this.btnSetting, 0);
  370. this.groupBox1.Controls.SetChildIndex(this.cmbFile, 0);
  371. this.groupBox1.Controls.SetChildIndex(this.btnSaveAs, 0);
  372. this.groupBox1.Controls.SetChildIndex(this.btnSave, 0);
  373. this.groupBox1.Controls.SetChildIndex(this.btnDelete, 0);
  374. //
  375. // btnDelete
  376. //
  377. this.btnDelete.Location = new System.Drawing.Point(482, 11);
  378. this.btnDelete.Name = "btnDelete";
  379. this.btnDelete.Size = new System.Drawing.Size(92, 30);
  380. this.btnDelete.TabIndex = 7;
  381. this.btnDelete.Text = "删除";
  382. this.btnDelete.UseVisualStyleBackColor = true;
  383. this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
  384. //
  385. // btnSave
  386. //
  387. this.btnSave.Location = new System.Drawing.Point(384, 11);
  388. this.btnSave.Name = "btnSave";
  389. this.btnSave.Size = new System.Drawing.Size(92, 30);
  390. this.btnSave.TabIndex = 6;
  391. this.btnSave.Text = "保存";
  392. this.btnSave.UseVisualStyleBackColor = true;
  393. this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
  394. //
  395. // btnSaveAs
  396. //
  397. this.btnSaveAs.Location = new System.Drawing.Point(286, 11);
  398. this.btnSaveAs.Name = "btnSaveAs";
  399. this.btnSaveAs.Size = new System.Drawing.Size(92, 30);
  400. this.btnSaveAs.TabIndex = 5;
  401. this.btnSaveAs.Text = "另存为";
  402. this.btnSaveAs.UseVisualStyleBackColor = true;
  403. this.btnSaveAs.Click += new System.EventHandler(this.btnSaveAs_Click);
  404. //
  405. // cmbFile
  406. //
  407. this.cmbFile.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  408. this.cmbFile.FormattingEnabled = true;
  409. this.cmbFile.Location = new System.Drawing.Point(17, 18);
  410. this.cmbFile.Name = "cmbFile";
  411. this.cmbFile.Size = new System.Drawing.Size(255, 20);
  412. this.cmbFile.TabIndex = 4;
  413. this.cmbFile.SelectedIndexChanged += new System.EventHandler(this.cmbFile_SelectedIndexChanged);
  414. //
  415. // btnStop
  416. //
  417. this.btnStop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  418. this.btnStop.Location = new System.Drawing.Point(1015, 11);
  419. this.btnStop.Name = "btnStop";
  420. this.btnStop.Size = new System.Drawing.Size(89, 30);
  421. this.btnStop.TabIndex = 2;
  422. this.btnStop.Text = "停止";
  423. this.btnStop.UseVisualStyleBackColor = true;
  424. this.btnStop.Click += new System.EventHandler(this.btnStop_Click);
  425. //
  426. // btnCreatImgFile
  427. //
  428. this.btnCreatImgFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  429. this.btnCreatImgFile.Location = new System.Drawing.Point(1123, 11);
  430. this.btnCreatImgFile.Name = "btnCreatImgFile";
  431. this.btnCreatImgFile.Size = new System.Drawing.Size(92, 30);
  432. this.btnCreatImgFile.TabIndex = 1;
  433. this.btnCreatImgFile.Text = "创建图片";
  434. this.btnCreatImgFile.UseVisualStyleBackColor = true;
  435. this.btnCreatImgFile.Click += new System.EventHandler(this.btnCreatImgFile_Click);
  436. //
  437. // btnWorking
  438. //
  439. this.btnWorking.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  440. this.btnWorking.Location = new System.Drawing.Point(907, 11);
  441. this.btnWorking.Name = "btnWorking";
  442. this.btnWorking.Size = new System.Drawing.Size(89, 30);
  443. this.btnWorking.TabIndex = 0;
  444. this.btnWorking.Text = "开始";
  445. this.btnWorking.UseVisualStyleBackColor = true;
  446. this.btnWorking.Click += new System.EventHandler(this.btnWorking_Click);
  447. //
  448. // groupBox2
  449. //
  450. this.groupBox2.Controls.Add(this.btnWhiteBalance);
  451. this.groupBox2.Controls.Add(this.label16);
  452. this.groupBox2.Controls.Add(this.lblUnit);
  453. this.groupBox2.Controls.Add(this.chkAutoExposure);
  454. this.groupBox2.Controls.Add(this.txtPercentage);
  455. this.groupBox2.Controls.Add(this.txtTime);
  456. this.groupBox2.Controls.Add(this.trackPercentage);
  457. this.groupBox2.Controls.Add(this.trackTime);
  458. this.groupBox2.Controls.Add(this.btnOther);
  459. this.groupBox2.Controls.Add(this.label6);
  460. this.groupBox2.Controls.Add(this.label5);
  461. this.groupBox2.Location = new System.Drawing.Point(12, 65);
  462. this.groupBox2.Name = "groupBox2";
  463. this.groupBox2.Size = new System.Drawing.Size(280, 114);
  464. this.groupBox2.TabIndex = 18;
  465. this.groupBox2.TabStop = false;
  466. this.groupBox2.Text = "相机设置";
  467. //
  468. // btnWhiteBalance
  469. //
  470. this.btnWhiteBalance.Location = new System.Drawing.Point(96, 85);
  471. this.btnWhiteBalance.Name = "btnWhiteBalance";
  472. this.btnWhiteBalance.Size = new System.Drawing.Size(96, 23);
  473. this.btnWhiteBalance.TabIndex = 40;
  474. this.btnWhiteBalance.Text = "自动白平衡";
  475. this.btnWhiteBalance.UseVisualStyleBackColor = true;
  476. //
  477. // label16
  478. //
  479. this.label16.AutoSize = true;
  480. this.label16.Location = new System.Drawing.Point(257, 47);
  481. this.label16.Name = "label16";
  482. this.label16.Size = new System.Drawing.Size(11, 12);
  483. this.label16.TabIndex = 39;
  484. this.label16.Text = "%";
  485. //
  486. // lblUnit
  487. //
  488. this.lblUnit.AutoSize = true;
  489. this.lblUnit.Location = new System.Drawing.Point(257, 19);
  490. this.lblUnit.Name = "lblUnit";
  491. this.lblUnit.Size = new System.Drawing.Size(17, 12);
  492. this.lblUnit.TabIndex = 0;
  493. this.lblUnit.Text = "ms";
  494. //
  495. // chkAutoExposure
  496. //
  497. this.chkAutoExposure.AutoSize = true;
  498. this.chkAutoExposure.Location = new System.Drawing.Point(10, 88);
  499. this.chkAutoExposure.Name = "chkAutoExposure";
  500. this.chkAutoExposure.Size = new System.Drawing.Size(72, 16);
  501. this.chkAutoExposure.TabIndex = 0;
  502. this.chkAutoExposure.Text = "自动曝光";
  503. this.chkAutoExposure.UseVisualStyleBackColor = true;
  504. this.chkAutoExposure.Click += new System.EventHandler(this.chkAutoExposure_Click);
  505. //
  506. // txtPercentage
  507. //
  508. this.txtPercentage.Location = new System.Drawing.Point(214, 44);
  509. this.txtPercentage.Name = "txtPercentage";
  510. this.txtPercentage.Size = new System.Drawing.Size(42, 21);
  511. this.txtPercentage.TabIndex = 37;
  512. //
  513. // txtTime
  514. //
  515. this.txtTime.Location = new System.Drawing.Point(214, 17);
  516. this.txtTime.Name = "txtTime";
  517. this.txtTime.Size = new System.Drawing.Size(42, 21);
  518. this.txtTime.TabIndex = 36;
  519. //
  520. // trackPercentage
  521. //
  522. this.trackPercentage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  523. | System.Windows.Forms.AnchorStyles.Right)));
  524. this.trackPercentage.AutoSize = false;
  525. this.trackPercentage.Location = new System.Drawing.Point(78, 45);
  526. this.trackPercentage.Maximum = 200;
  527. this.trackPercentage.Minimum = 5;
  528. this.trackPercentage.Name = "trackPercentage";
  529. this.trackPercentage.Size = new System.Drawing.Size(141, 25);
  530. this.trackPercentage.TabIndex = 5;
  531. this.trackPercentage.TickStyle = System.Windows.Forms.TickStyle.None;
  532. this.trackPercentage.Value = 5;
  533. //
  534. // trackTime
  535. //
  536. this.trackTime.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  537. | System.Windows.Forms.AnchorStyles.Right)));
  538. this.trackTime.AutoSize = false;
  539. this.trackTime.Location = new System.Drawing.Point(78, 19);
  540. this.trackTime.Maximum = 1000000;
  541. this.trackTime.Name = "trackTime";
  542. this.trackTime.Size = new System.Drawing.Size(141, 25);
  543. this.trackTime.TabIndex = 4;
  544. this.trackTime.TickStyle = System.Windows.Forms.TickStyle.None;
  545. //
  546. // btnOther
  547. //
  548. this.btnOther.Location = new System.Drawing.Point(202, 85);
  549. this.btnOther.Name = "btnOther";
  550. this.btnOther.Size = new System.Drawing.Size(75, 23);
  551. this.btnOther.TabIndex = 3;
  552. this.btnOther.Text = "其他设置";
  553. this.btnOther.UseVisualStyleBackColor = true;
  554. //
  555. // label6
  556. //
  557. this.label6.AutoSize = true;
  558. this.label6.Location = new System.Drawing.Point(7, 47);
  559. this.label6.Name = "label6";
  560. this.label6.Size = new System.Drawing.Size(77, 12);
  561. this.label6.TabIndex = 1;
  562. this.label6.Text = "曝光百分比:";
  563. //
  564. // label5
  565. //
  566. this.label5.AutoSize = true;
  567. this.label5.Location = new System.Drawing.Point(7, 20);
  568. this.label5.Name = "label5";
  569. this.label5.Size = new System.Drawing.Size(65, 12);
  570. this.label5.TabIndex = 0;
  571. this.label5.Text = "曝光时间:";
  572. //
  573. // groupBox6
  574. //
  575. this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  576. | System.Windows.Forms.AnchorStyles.Left)
  577. | System.Windows.Forms.AnchorStyles.Right)));
  578. this.groupBox6.Controls.Add(this.label18);
  579. this.groupBox6.Controls.Add(this.label17);
  580. this.groupBox6.Controls.Add(this.label15);
  581. this.groupBox6.Controls.Add(this.pnlSpeed);
  582. this.groupBox6.Controls.Add(this.btnCenterDisplay);
  583. this.groupBox6.Controls.Add(this.btnStopall);
  584. this.groupBox6.Controls.Add(this.btnDsRocker);
  585. this.groupBox6.Controls.Add(this.lblZPosition);
  586. this.groupBox6.Controls.Add(this.lblYPosition);
  587. this.groupBox6.Controls.Add(this.lblXPosition);
  588. this.groupBox6.Controls.Add(this.btnZStop);
  589. this.groupBox6.Controls.Add(this.btnZFree);
  590. this.groupBox6.Controls.Add(this.label4);
  591. this.groupBox6.Controls.Add(this.cmbStepUnit);
  592. this.groupBox6.Controls.Add(this.txtZStep);
  593. this.groupBox6.Controls.Add(this.txtYStep);
  594. this.groupBox6.Controls.Add(this.txtXStep);
  595. this.groupBox6.Controls.Add(this.label3);
  596. this.groupBox6.Controls.Add(this.label2);
  597. this.groupBox6.Controls.Add(this.label1);
  598. this.groupBox6.Controls.Add(this.btnOutloadstage);
  599. this.groupBox6.Controls.Add(this.groupBox12);
  600. this.groupBox6.Controls.Add(this.btnFreeloadstage);
  601. this.groupBox6.Controls.Add(this.groupBox11);
  602. this.groupBox6.Controls.Add(this.groupBox10);
  603. this.groupBox6.Controls.Add(this.btnInloadstage);
  604. this.groupBox6.Controls.Add(this.groupBox9);
  605. this.groupBox6.Controls.Add(this.btnStoploadstage);
  606. this.groupBox6.Controls.Add(this.panelControl);
  607. this.groupBox6.Controls.Add(this.btnResetloadstage);
  608. this.groupBox6.Controls.Add(this.btnCenterloadstage);
  609. this.groupBox6.Location = new System.Drawing.Point(298, 65);
  610. this.groupBox6.Name = "groupBox6";
  611. this.groupBox6.Size = new System.Drawing.Size(512, 731);
  612. this.groupBox6.TabIndex = 19;
  613. this.groupBox6.TabStop = false;
  614. this.groupBox6.Text = "硬件控制";
  615. this.groupBox6.Controls.SetChildIndex(this.btnCenterloadstage, 0);
  616. this.groupBox6.Controls.SetChildIndex(this.btnResetloadstage, 0);
  617. this.groupBox6.Controls.SetChildIndex(this.panelControl, 0);
  618. this.groupBox6.Controls.SetChildIndex(this.btnStoploadstage, 0);
  619. this.groupBox6.Controls.SetChildIndex(this.groupBox9, 0);
  620. this.groupBox6.Controls.SetChildIndex(this.btnInloadstage, 0);
  621. this.groupBox6.Controls.SetChildIndex(this.groupBox10, 0);
  622. this.groupBox6.Controls.SetChildIndex(this.groupBox11, 0);
  623. this.groupBox6.Controls.SetChildIndex(this.btnFreeloadstage, 0);
  624. this.groupBox6.Controls.SetChildIndex(this.groupBox12, 0);
  625. this.groupBox6.Controls.SetChildIndex(this.btnOutloadstage, 0);
  626. this.groupBox6.Controls.SetChildIndex(this.label1, 0);
  627. this.groupBox6.Controls.SetChildIndex(this.label2, 0);
  628. this.groupBox6.Controls.SetChildIndex(this.label3, 0);
  629. this.groupBox6.Controls.SetChildIndex(this.txtXStep, 0);
  630. this.groupBox6.Controls.SetChildIndex(this.txtYStep, 0);
  631. this.groupBox6.Controls.SetChildIndex(this.txtZStep, 0);
  632. this.groupBox6.Controls.SetChildIndex(this.cmbStepUnit, 0);
  633. this.groupBox6.Controls.SetChildIndex(this.label4, 0);
  634. this.groupBox6.Controls.SetChildIndex(this.btnZFree, 0);
  635. this.groupBox6.Controls.SetChildIndex(this.btnZStop, 0);
  636. this.groupBox6.Controls.SetChildIndex(this.lblXPosition, 0);
  637. this.groupBox6.Controls.SetChildIndex(this.lblYPosition, 0);
  638. this.groupBox6.Controls.SetChildIndex(this.lblZPosition, 0);
  639. this.groupBox6.Controls.SetChildIndex(this.btnDsRocker, 0);
  640. this.groupBox6.Controls.SetChildIndex(this.btnStopall, 0);
  641. this.groupBox6.Controls.SetChildIndex(this.btnCenterDisplay, 0);
  642. this.groupBox6.Controls.SetChildIndex(this.pnlSpeed, 0);
  643. this.groupBox6.Controls.SetChildIndex(this.label15, 0);
  644. this.groupBox6.Controls.SetChildIndex(this.label17, 0);
  645. this.groupBox6.Controls.SetChildIndex(this.label18, 0);
  646. //
  647. // label18
  648. //
  649. this.label18.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  650. this.label18.AutoSize = true;
  651. this.label18.Font = new System.Drawing.Font("宋体", 10.5F);
  652. this.label18.Location = new System.Drawing.Point(411, 693);
  653. this.label18.Name = "label18";
  654. this.label18.Size = new System.Drawing.Size(21, 14);
  655. this.label18.TabIndex = 53;
  656. this.label18.Text = "Z:";
  657. //
  658. // label17
  659. //
  660. this.label17.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  661. this.label17.AutoSize = true;
  662. this.label17.Font = new System.Drawing.Font("宋体", 10.5F);
  663. this.label17.Location = new System.Drawing.Point(411, 668);
  664. this.label17.Name = "label17";
  665. this.label17.Size = new System.Drawing.Size(21, 14);
  666. this.label17.TabIndex = 54;
  667. this.label17.Text = "Y:";
  668. //
  669. // label15
  670. //
  671. this.label15.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  672. this.label15.AutoSize = true;
  673. this.label15.Font = new System.Drawing.Font("宋体", 10.5F);
  674. this.label15.Location = new System.Drawing.Point(411, 642);
  675. this.label15.Name = "label15";
  676. this.label15.Size = new System.Drawing.Size(21, 14);
  677. this.label15.TabIndex = 55;
  678. this.label15.Text = "X:";
  679. //
  680. // pnlSpeed
  681. //
  682. this.pnlSpeed.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  683. this.pnlSpeed.Location = new System.Drawing.Point(185, 623);
  684. this.pnlSpeed.Name = "pnlSpeed";
  685. this.pnlSpeed.Size = new System.Drawing.Size(146, 102);
  686. this.pnlSpeed.TabIndex = 50;
  687. //
  688. // label4
  689. //
  690. this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  691. this.label4.AutoSize = true;
  692. this.label4.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  693. this.label4.Location = new System.Drawing.Point(138, 642);
  694. this.label4.Name = "label4";
  695. this.label4.Size = new System.Drawing.Size(49, 14);
  696. this.label4.TabIndex = 39;
  697. this.label4.Text = "速度:";
  698. //
  699. // cmbStepUnit
  700. //
  701. this.cmbStepUnit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  702. this.cmbStepUnit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  703. this.cmbStepUnit.FormattingEnabled = true;
  704. this.cmbStepUnit.Items.AddRange(new object[] {
  705. "μm",
  706. "mm",
  707. "cm"});
  708. this.cmbStepUnit.Location = new System.Drawing.Point(427, 594);
  709. this.cmbStepUnit.Name = "cmbStepUnit";
  710. this.cmbStepUnit.Size = new System.Drawing.Size(69, 20);
  711. this.cmbStepUnit.TabIndex = 38;
  712. //
  713. // label3
  714. //
  715. this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  716. this.label3.AutoSize = true;
  717. this.label3.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  718. this.label3.Location = new System.Drawing.Point(328, 595);
  719. this.label3.Name = "label3";
  720. this.label3.Size = new System.Drawing.Size(21, 14);
  721. this.label3.TabIndex = 34;
  722. this.label3.Text = "Z:";
  723. //
  724. // label2
  725. //
  726. this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  727. this.label2.AutoSize = true;
  728. this.label2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  729. this.label2.Location = new System.Drawing.Point(231, 595);
  730. this.label2.Name = "label2";
  731. this.label2.Size = new System.Drawing.Size(21, 14);
  732. this.label2.TabIndex = 33;
  733. this.label2.Text = "Y:";
  734. //
  735. // label1
  736. //
  737. this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  738. this.label1.AutoSize = true;
  739. this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  740. this.label1.Location = new System.Drawing.Point(138, 595);
  741. this.label1.Name = "label1";
  742. this.label1.Size = new System.Drawing.Size(21, 14);
  743. this.label1.TabIndex = 32;
  744. this.label1.Text = "X:";
  745. //
  746. // groupBox12
  747. //
  748. this.groupBox12.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  749. this.groupBox12.Controls.Add(this.btnFixedLower);
  750. this.groupBox12.Controls.Add(this.btnFixedUp);
  751. this.groupBox12.Location = new System.Drawing.Point(370, 420);
  752. this.groupBox12.Name = "groupBox12";
  753. this.groupBox12.Size = new System.Drawing.Size(56, 162);
  754. this.groupBox12.TabIndex = 25;
  755. this.groupBox12.TabStop = false;
  756. //
  757. // groupBox11
  758. //
  759. this.groupBox11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  760. this.groupBox11.Controls.Add(this.btnContinuityLower);
  761. this.groupBox11.Controls.Add(this.btnContinuityUp);
  762. this.groupBox11.Location = new System.Drawing.Point(312, 420);
  763. this.groupBox11.Name = "groupBox11";
  764. this.groupBox11.Size = new System.Drawing.Size(56, 162);
  765. this.groupBox11.TabIndex = 24;
  766. this.groupBox11.TabStop = false;
  767. //
  768. // groupBox10
  769. //
  770. this.groupBox10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  771. this.groupBox10.Controls.Add(this.panelVision);
  772. this.groupBox10.Location = new System.Drawing.Point(160, 420);
  773. this.groupBox10.Name = "groupBox10";
  774. this.groupBox10.Size = new System.Drawing.Size(150, 162);
  775. this.groupBox10.TabIndex = 23;
  776. this.groupBox10.TabStop = false;
  777. this.groupBox10.Text = "视场模式";
  778. //
  779. // panelVision
  780. //
  781. this.panelVision.Location = new System.Drawing.Point(2, 14);
  782. this.panelVision.Name = "panelVision";
  783. this.panelVision.Size = new System.Drawing.Size(144, 144);
  784. this.panelVision.TabIndex = 2;
  785. //
  786. // groupBox9
  787. //
  788. this.groupBox9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  789. this.groupBox9.Controls.Add(this.panelMotion);
  790. this.groupBox9.Location = new System.Drawing.Point(6, 420);
  791. this.groupBox9.Name = "groupBox9";
  792. this.groupBox9.Size = new System.Drawing.Size(150, 162);
  793. this.groupBox9.TabIndex = 22;
  794. this.groupBox9.TabStop = false;
  795. this.groupBox9.Text = "运动模式";
  796. //
  797. // panelMotion
  798. //
  799. this.panelMotion.Location = new System.Drawing.Point(2, 14);
  800. this.panelMotion.Name = "panelMotion";
  801. this.panelMotion.Size = new System.Drawing.Size(144, 144);
  802. this.panelMotion.TabIndex = 1;
  803. //
  804. // panelControl
  805. //
  806. this.panelControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  807. | System.Windows.Forms.AnchorStyles.Left)
  808. | System.Windows.Forms.AnchorStyles.Right)));
  809. this.panelControl.AutoScroll = true;
  810. this.panelControl.BackColor = System.Drawing.SystemColors.Control;
  811. this.panelControl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  812. this.panelControl.Location = new System.Drawing.Point(6, 17);
  813. this.panelControl.Name = "panelControl";
  814. this.panelControl.Size = new System.Drawing.Size(500, 394);
  815. this.panelControl.TabIndex = 14;
  816. //
  817. // groupBox13
  818. //
  819. this.groupBox13.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  820. | System.Windows.Forms.AnchorStyles.Right)));
  821. this.groupBox13.Controls.Add(this.pictureBox1);
  822. this.groupBox13.Controls.Add(this.picEffect);
  823. this.groupBox13.Location = new System.Drawing.Point(816, 65);
  824. this.groupBox13.Name = "groupBox13";
  825. this.groupBox13.Size = new System.Drawing.Size(431, 731);
  826. this.groupBox13.TabIndex = 23;
  827. this.groupBox13.TabStop = false;
  828. this.groupBox13.Text = "拼图效果";
  829. //
  830. // pictureBox1
  831. //
  832. this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  833. | System.Windows.Forms.AnchorStyles.Right)));
  834. this.pictureBox1.Location = new System.Drawing.Point(14, 164);
  835. this.pictureBox1.Name = "pictureBox1";
  836. this.pictureBox1.Size = new System.Drawing.Size(404, 349);
  837. this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
  838. this.pictureBox1.TabIndex = 1;
  839. this.pictureBox1.TabStop = false;
  840. //
  841. // picEffect
  842. //
  843. this.picEffect.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  844. | System.Windows.Forms.AnchorStyles.Right)));
  845. this.picEffect.Location = new System.Drawing.Point(14, 17);
  846. this.picEffect.Name = "picEffect";
  847. this.picEffect.Size = new System.Drawing.Size(404, 708);
  848. this.picEffect.TabIndex = 0;
  849. this.picEffect.TabStop = false;
  850. //
  851. // groupBox3
  852. //
  853. this.groupBox3.Controls.Add(this.btnAddCross);
  854. this.groupBox3.Controls.Add(this.label10);
  855. this.groupBox3.Controls.Add(this.txtLY);
  856. this.groupBox3.Controls.Add(this.label11);
  857. this.groupBox3.Controls.Add(this.txtNY);
  858. this.groupBox3.Controls.Add(this.label12);
  859. this.groupBox3.Controls.Add(this.label9);
  860. this.groupBox3.Controls.Add(this.txtLX);
  861. this.groupBox3.Controls.Add(this.label8);
  862. this.groupBox3.Controls.Add(this.txtNX);
  863. this.groupBox3.Controls.Add(this.label7);
  864. this.groupBox3.Controls.Add(this.rdoCenter);
  865. this.groupBox3.Controls.Add(this.rdoLeftTop);
  866. this.groupBox3.ImeMode = System.Windows.Forms.ImeMode.NoControl;
  867. this.groupBox3.Location = new System.Drawing.Point(12, 185);
  868. this.groupBox3.Name = "groupBox3";
  869. this.groupBox3.Size = new System.Drawing.Size(280, 160);
  870. this.groupBox3.TabIndex = 2;
  871. this.groupBox3.TabStop = false;
  872. this.groupBox3.Text = "添加位置";
  873. //
  874. // btnAddCross
  875. //
  876. this.btnAddCross.Location = new System.Drawing.Point(197, 113);
  877. this.btnAddCross.Name = "btnAddCross";
  878. this.btnAddCross.Size = new System.Drawing.Size(73, 23);
  879. this.btnAddCross.TabIndex = 0;
  880. this.btnAddCross.Text = "添加列表";
  881. this.btnAddCross.UseVisualStyleBackColor = true;
  882. this.btnAddCross.Click += new System.EventHandler(this.btnAddCross_Click);
  883. //
  884. // label10
  885. //
  886. this.label10.AutoSize = true;
  887. this.label10.Location = new System.Drawing.Point(168, 120);
  888. this.label10.Name = "label10";
  889. this.label10.Size = new System.Drawing.Size(17, 12);
  890. this.label10.TabIndex = 4;
  891. this.label10.Text = "px";
  892. //
  893. // txtLY
  894. //
  895. this.txtLY.Location = new System.Drawing.Point(124, 110);
  896. this.txtLY.Name = "txtLY";
  897. this.txtLY.Size = new System.Drawing.Size(43, 21);
  898. this.txtLY.TabIndex = 7;
  899. //
  900. // label11
  901. //
  902. this.label11.AutoSize = true;
  903. this.label11.Location = new System.Drawing.Point(97, 113);
  904. this.label11.Name = "label11";
  905. this.label11.Size = new System.Drawing.Size(29, 12);
  906. this.label11.TabIndex = 8;
  907. this.label11.Text = "间距";
  908. //
  909. // txtNY
  910. //
  911. this.txtNY.Location = new System.Drawing.Point(43, 110);
  912. this.txtNY.Name = "txtNY";
  913. this.txtNY.Size = new System.Drawing.Size(43, 21);
  914. this.txtNY.TabIndex = 5;
  915. //
  916. // label12
  917. //
  918. this.label12.AutoSize = true;
  919. this.label12.Location = new System.Drawing.Point(16, 113);
  920. this.label12.Name = "label12";
  921. this.label12.Size = new System.Drawing.Size(29, 12);
  922. this.label12.TabIndex = 6;
  923. this.label12.Text = "行数";
  924. //
  925. // label9
  926. //
  927. this.label9.AutoSize = true;
  928. this.label9.Location = new System.Drawing.Point(168, 78);
  929. this.label9.Name = "label9";
  930. this.label9.Size = new System.Drawing.Size(17, 12);
  931. this.label9.TabIndex = 0;
  932. this.label9.Text = "px";
  933. //
  934. // txtLX
  935. //
  936. this.txtLX.Location = new System.Drawing.Point(124, 68);
  937. this.txtLX.Name = "txtLX";
  938. this.txtLX.Size = new System.Drawing.Size(41, 21);
  939. this.txtLX.TabIndex = 2;
  940. //
  941. // label8
  942. //
  943. this.label8.AutoSize = true;
  944. this.label8.Location = new System.Drawing.Point(97, 71);
  945. this.label8.Name = "label8";
  946. this.label8.Size = new System.Drawing.Size(29, 12);
  947. this.label8.TabIndex = 3;
  948. this.label8.Text = "间距";
  949. //
  950. // txtNX
  951. //
  952. this.txtNX.Location = new System.Drawing.Point(43, 68);
  953. this.txtNX.Name = "txtNX";
  954. this.txtNX.Size = new System.Drawing.Size(41, 21);
  955. this.txtNX.TabIndex = 0;
  956. //
  957. // label7
  958. //
  959. this.label7.AutoSize = true;
  960. this.label7.Location = new System.Drawing.Point(16, 71);
  961. this.label7.Name = "label7";
  962. this.label7.Size = new System.Drawing.Size(29, 12);
  963. this.label7.TabIndex = 0;
  964. this.label7.Text = "列数";
  965. //
  966. // rdoCenter
  967. //
  968. this.rdoCenter.AutoSize = true;
  969. this.rdoCenter.Location = new System.Drawing.Point(108, 35);
  970. this.rdoCenter.Name = "rdoCenter";
  971. this.rdoCenter.Size = new System.Drawing.Size(47, 16);
  972. this.rdoCenter.TabIndex = 1;
  973. this.rdoCenter.Text = "中心";
  974. this.rdoCenter.UseVisualStyleBackColor = true;
  975. //
  976. // rdoLeftTop
  977. //
  978. this.rdoLeftTop.AutoSize = true;
  979. this.rdoLeftTop.Checked = true;
  980. this.rdoLeftTop.Location = new System.Drawing.Point(17, 35);
  981. this.rdoLeftTop.Name = "rdoLeftTop";
  982. this.rdoLeftTop.Size = new System.Drawing.Size(47, 16);
  983. this.rdoLeftTop.TabIndex = 0;
  984. this.rdoLeftTop.TabStop = true;
  985. this.rdoLeftTop.Text = "左上";
  986. this.rdoLeftTop.UseVisualStyleBackColor = true;
  987. //
  988. // groupBox4
  989. //
  990. this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  991. | System.Windows.Forms.AnchorStyles.Left)));
  992. this.groupBox4.Controls.Add(this.btnModify);
  993. this.groupBox4.Controls.Add(this.btnDel);
  994. this.groupBox4.Controls.Add(this.dgvRegionTeb);
  995. this.groupBox4.Location = new System.Drawing.Point(12, 351);
  996. this.groupBox4.Name = "groupBox4";
  997. this.groupBox4.Size = new System.Drawing.Size(280, 445);
  998. this.groupBox4.TabIndex = 0;
  999. this.groupBox4.TabStop = false;
  1000. this.groupBox4.Text = "位置列表";
  1001. //
  1002. // btnModify
  1003. //
  1004. this.btnModify.Location = new System.Drawing.Point(233, 24);
  1005. this.btnModify.Name = "btnModify";
  1006. this.btnModify.Size = new System.Drawing.Size(37, 23);
  1007. this.btnModify.TabIndex = 2;
  1008. this.btnModify.Text = "改";
  1009. this.btnModify.UseVisualStyleBackColor = true;
  1010. this.btnModify.Click += new System.EventHandler(this.btnModify_Click);
  1011. //
  1012. // btnDel
  1013. //
  1014. this.btnDel.Location = new System.Drawing.Point(182, 24);
  1015. this.btnDel.Name = "btnDel";
  1016. this.btnDel.Size = new System.Drawing.Size(37, 23);
  1017. this.btnDel.TabIndex = 0;
  1018. this.btnDel.Text = "删";
  1019. this.btnDel.UseVisualStyleBackColor = true;
  1020. this.btnDel.Click += new System.EventHandler(this.btnDel_Click);
  1021. //
  1022. // dgvRegionTeb
  1023. //
  1024. this.dgvRegionTeb.AllowUserToAddRows = false;
  1025. this.dgvRegionTeb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  1026. | System.Windows.Forms.AnchorStyles.Left)));
  1027. this.dgvRegionTeb.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
  1028. this.dgvRegionTeb.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
  1029. this.dgvRegionTeb.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
  1030. this.id,
  1031. this.x,
  1032. this.y,
  1033. this.z});
  1034. this.dgvRegionTeb.Location = new System.Drawing.Point(3, 53);
  1035. this.dgvRegionTeb.Name = "dgvRegionTeb";
  1036. this.dgvRegionTeb.RowHeadersVisible = false;
  1037. this.dgvRegionTeb.RowHeadersWidth = 51;
  1038. this.dgvRegionTeb.RowTemplate.Height = 23;
  1039. this.dgvRegionTeb.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
  1040. this.dgvRegionTeb.Size = new System.Drawing.Size(274, 380);
  1041. this.dgvRegionTeb.TabIndex = 1;
  1042. this.dgvRegionTeb.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvRegionTeb_CellMouseClick);
  1043. this.dgvRegionTeb.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvRegionTeb_CellMouseDoubleClick);
  1044. //
  1045. // id
  1046. //
  1047. this.id.FillWeight = 50F;
  1048. this.id.MinimumWidth = 6;
  1049. this.id.Name = "id";
  1050. this.id.ReadOnly = true;
  1051. this.id.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
  1052. //
  1053. // x
  1054. //
  1055. this.x.FillWeight = 60F;
  1056. this.x.HeaderText = "X";
  1057. this.x.MinimumWidth = 6;
  1058. this.x.Name = "x";
  1059. this.x.ReadOnly = true;
  1060. this.x.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
  1061. //
  1062. // y
  1063. //
  1064. this.y.FillWeight = 60F;
  1065. this.y.HeaderText = "Y";
  1066. this.y.MinimumWidth = 6;
  1067. this.y.Name = "y";
  1068. this.y.ReadOnly = true;
  1069. this.y.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
  1070. //
  1071. // z
  1072. //
  1073. this.z.FillWeight = 60F;
  1074. this.z.HeaderText = "Z";
  1075. this.z.MinimumWidth = 6;
  1076. this.z.Name = "z";
  1077. this.z.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
  1078. //
  1079. // ListOfLocationsDialog
  1080. //
  1081. this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
  1082. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  1083. this.ClientSize = new System.Drawing.Size(1253, 804);
  1084. this.Controls.Add(this.groupBox4);
  1085. this.Controls.Add(this.groupBox3);
  1086. this.Controls.Add(this.groupBox13);
  1087. this.Controls.Add(this.groupBox6);
  1088. this.Controls.Add(this.groupBox2);
  1089. this.Controls.Add(this.groupBox1);
  1090. this.MinimumSize = new System.Drawing.Size(1269, 843);
  1091. this.Name = "ListOfLocationsDialog";
  1092. this.Text = "位置列表";
  1093. this.Load += new System.EventHandler(this.ListOfLocationsDialog_Load);
  1094. this.Controls.SetChildIndex(this.groupBox1, 0);
  1095. this.Controls.SetChildIndex(this.groupBox2, 0);
  1096. this.Controls.SetChildIndex(this.groupBox6, 0);
  1097. this.Controls.SetChildIndex(this.groupBox13, 0);
  1098. this.Controls.SetChildIndex(this.groupBox3, 0);
  1099. this.Controls.SetChildIndex(this.groupBox4, 0);
  1100. this.groupBox1.ResumeLayout(false);
  1101. this.groupBox2.ResumeLayout(false);
  1102. this.groupBox2.PerformLayout();
  1103. ((System.ComponentModel.ISupportInitialize)(this.trackPercentage)).EndInit();
  1104. ((System.ComponentModel.ISupportInitialize)(this.trackTime)).EndInit();
  1105. this.groupBox6.ResumeLayout(false);
  1106. this.groupBox6.PerformLayout();
  1107. this.groupBox12.ResumeLayout(false);
  1108. this.groupBox11.ResumeLayout(false);
  1109. this.groupBox10.ResumeLayout(false);
  1110. this.groupBox9.ResumeLayout(false);
  1111. this.groupBox13.ResumeLayout(false);
  1112. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
  1113. ((System.ComponentModel.ISupportInitialize)(this.picEffect)).EndInit();
  1114. this.groupBox3.ResumeLayout(false);
  1115. this.groupBox3.PerformLayout();
  1116. this.groupBox4.ResumeLayout(false);
  1117. ((System.ComponentModel.ISupportInitialize)(this.dgvRegionTeb)).EndInit();
  1118. this.ResumeLayout(false);
  1119. }
  1120. #endregion
  1121. #region 控件
  1122. private GroupBox groupBox1;
  1123. private GroupBox groupBox2;
  1124. private GroupBox groupBox6;
  1125. private GroupBox groupBox12;
  1126. private GroupBox groupBox11;
  1127. private GroupBox groupBox10;
  1128. private GroupBox groupBox9;
  1129. private GroupBox groupBox4;
  1130. private GroupBox groupBox3;
  1131. private GroupBox groupBox13;
  1132. private Label label6;
  1133. private Label label5;
  1134. private Label label3;
  1135. private Label label2;
  1136. private Label label1;
  1137. private Label lblUnit;
  1138. private Button btnStop;
  1139. private Button btnCreatImgFile;
  1140. private Button btnWorking;
  1141. private Button btnWhiteBalance;
  1142. private CheckBox chkAutoExposure;
  1143. private TextBox txtPercentage;
  1144. private TextBox txtTime;
  1145. private TrackBar trackPercentage;
  1146. private TrackBar trackTime;
  1147. private Button btnOther;
  1148. private Label label16;
  1149. private Panel pnlSpeed;
  1150. private Label label4;
  1151. private ComboBox cmbStepUnit;
  1152. private Panel panelVision;
  1153. private Panel panelMotion;
  1154. private Panel panelControl;
  1155. private PictureBox pictureBox1;
  1156. private PictureBox picEffect;
  1157. private RadioButton rdoCenter;
  1158. private RadioButton rdoLeftTop;
  1159. private TextBox txtLX;
  1160. private Label label8;
  1161. private TextBox txtNX;
  1162. private Label label7;
  1163. private Button btnAddCross;
  1164. private Label label10;
  1165. private TextBox txtLY;
  1166. private Label label11;
  1167. private TextBox txtNY;
  1168. private Label label12;
  1169. private Label label9;
  1170. private Label label18;
  1171. private Label label17;
  1172. private Label label15;
  1173. private DataGridView dgvRegionTeb;
  1174. private Button btnDelete;
  1175. private Button btnSave;
  1176. private Button btnSaveAs;
  1177. private ComboBox cmbFile;
  1178. private Button btnDel;
  1179. private Button btnModify;
  1180. private DataGridViewTextBoxColumn id;
  1181. private DataGridViewTextBoxColumn x;
  1182. private DataGridViewTextBoxColumn y;
  1183. private DataGridViewTextBoxColumn z;
  1184. private CircleControl circleControl;
  1185. private CircleControl circleSportControl;
  1186. #endregion
  1187. private System.Timers.Timer m_aeTimer;
  1188. private Mat m_merge;
  1189. private Thread m_stitchingThread;
  1190. private double m_scale = 1;
  1191. private bool m_isDoing;
  1192. /// <summary>
  1193. /// Y轴單次进长度
  1194. /// </summary>
  1195. protected override double StepLenthX
  1196. {
  1197. get
  1198. {
  1199. string text = txtXStep.Text.Trim();
  1200. if (string.IsNullOrEmpty(text))
  1201. {
  1202. throw new Exception("Y" + PdnResources.GetString("Menu.TheXaxismovestepannotbeempty0.Text"));
  1203. }
  1204. var value = double.Parse(text);
  1205. if (cmbStepUnit.SelectedItem.ToString().Equals("mm"))
  1206. {
  1207. value *= 1000;
  1208. }
  1209. return value;
  1210. }
  1211. }
  1212. /// <summary>
  1213. /// Y轴單次进长度
  1214. /// </summary>
  1215. protected override double StepLenthY
  1216. {
  1217. get
  1218. {
  1219. string text = txtYStep.Text.Trim();
  1220. if (string.IsNullOrEmpty(text))
  1221. {
  1222. throw new Exception("Y" + PdnResources.GetString("Menu.TheXaxismovestepannotbeempty0.Text"));
  1223. }
  1224. var value = double.Parse(text);
  1225. if (cmbStepUnit.SelectedItem.ToString().Equals("mm"))
  1226. {
  1227. value *= 1000;
  1228. }
  1229. return value;
  1230. }
  1231. }
  1232. /// <summary>
  1233. /// Z轴步进长度
  1234. /// </summary>
  1235. protected override double StepLenthZ
  1236. {
  1237. get
  1238. {
  1239. string text = txtZStep.Text.Trim();
  1240. if (string.IsNullOrEmpty(text))
  1241. {
  1242. throw new Exception("Z" + PdnResources.GetString("Menu.TheXaxismovestepannotbeempty0.Text"));
  1243. }
  1244. var value = double.Parse(text);
  1245. if (cmbStepUnit.SelectedItem.ToString().Equals("mm"))
  1246. {
  1247. value *= 1000;
  1248. }
  1249. return value;
  1250. }
  1251. }
  1252. public ListOfLocationsDialog() : base()
  1253. {
  1254. InitializeComponent();
  1255. }
  1256. public ListOfLocationsDialog(AppWorkspace appWorkspace) : base(appWorkspace)
  1257. {
  1258. InitializeComponent();
  1259. InitializeLanguageText();
  1260. m_aeTimer = new System.Timers.Timer(1000);
  1261. m_aeTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnTimerAutoExposure);
  1262. m_aeTimer.AutoReset = true;
  1263. m_aeTimer.SynchronizingObject = this;
  1264. this.panelControl.Controls.Add(m_documentWorkspace);
  1265. this.m_documentWorkspace.GraphicsList.SelectChanged += GraphicsList_SelectChanged;
  1266. circleControl = initViewCircal(71);
  1267. circleSportControl = initSportCircal(71);
  1268. this.panelVision.Controls.Add(this.circleControl);
  1269. this.panelMotion.Controls.Add(this.circleSportControl);
  1270. this.InitComFile(null);
  1271. // 初始化步长单位
  1272. this.cmbStepUnit.Items.Clear();
  1273. this.cmbStepUnit.Items.AddRange(m_unit);
  1274. this.cmbStepUnit.SelectedIndex = 1;
  1275. //this.UpdateBtnState();
  1276. this.btnStop.Enabled = false;
  1277. }
  1278. #region 相机设置
  1279. /// <summary>
  1280. /// 初始化相机设置相关控件
  1281. /// </summary>
  1282. protected override void initCameraSetting()
  1283. {
  1284. int exposureVal = (int)(m_cameraParamModel.parame.LNExposure);
  1285. if (exposureVal >= trackTime.Minimum && exposureVal <= trackTime.Maximum)
  1286. {
  1287. trackTime.Value = exposureVal;
  1288. }
  1289. UpdateExposureUI(m_cameraParamModel.parame.ATExposure);
  1290. }
  1291. protected override void GetMouseLeftClickPoint(object sender, EventArgs e)
  1292. {
  1293. if (!this.m_isReset)
  1294. {
  1295. MessageBox.Show(PdnResources.GetString("Menu.Pleaseresetfirst.Text"));
  1296. return;
  1297. }
  1298. PointF pointF = (PointF)sender;
  1299. List<DrawObject> graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
  1300. int count = graphicsList.Count;
  1301. for (int i = 0; i < count; i++)
  1302. {
  1303. List<PointF> points = ((DrawLocationCross)graphicsList[i]).GetRulerPoints();
  1304. RectangleF rectangleF = new RectangleF(points[0], new SizeF(points[1].X - points[0].X, points[1].Y - points[0].Y));
  1305. if (rectangleF.Contains(pointF))
  1306. {
  1307. pointF = (PointF)points[0];
  1308. }
  1309. }
  1310. // 移动操作台和视图
  1311. // 移动X轴
  1312. var x = ConvertPXToUm((int)(pointF.X));
  1313. var y = ConvertPXToUm((int)(pointF.Y));
  1314. m_Stage.To(x, y);
  1315. }
  1316. /// <summary>
  1317. /// 自动曝光
  1318. /// </summary>
  1319. /// <param name="sender"></param>
  1320. /// <param name="e"></param>
  1321. private void chkAutoExposure_Click(object sender, EventArgs e)
  1322. {
  1323. int autoExposure = chkAutoExposure.Checked ? 1 : 0;
  1324. m_cameraParamModel.parame.ATExposure = autoExposure;
  1325. if (autoExposure == 0)
  1326. {
  1327. trackPercentage.Value = 100;
  1328. }
  1329. UpdateExposureUI(autoExposure);
  1330. }
  1331. private void UpdateExposureUI(int autoExposure)
  1332. {
  1333. if (autoExposure == 1)
  1334. {
  1335. // 自动曝光
  1336. trackTime.Enabled = false;
  1337. txtTime.Enabled = false;
  1338. trackPercentage.Enabled = false;
  1339. txtPercentage.Enabled = false;
  1340. chkAutoExposure.Checked = true;
  1341. trackPercentage.Value = 100;
  1342. m_aeTimer.Start();
  1343. }
  1344. else
  1345. {
  1346. trackTime.Enabled = true;
  1347. txtTime.Enabled = true;
  1348. trackPercentage.Enabled = true;
  1349. txtPercentage.Enabled = true;
  1350. chkAutoExposure.Checked = false;
  1351. m_aeTimer.Stop();
  1352. }
  1353. }
  1354. public void OnTimerAutoExposure(object source, System.Timers.ElapsedEventArgs e)
  1355. {
  1356. double paramValue = m_camera.ExposureTime;
  1357. int expValue = (int)(paramValue * 1000);
  1358. if (expValue < 137)
  1359. {
  1360. expValue = 130;
  1361. }
  1362. if (expValue > 15000000)
  1363. {
  1364. expValue = 15000000;
  1365. }
  1366. trackTime.Value = expValue;
  1367. this.txtTime.Text = paramValue.ToString();
  1368. }
  1369. #endregion
  1370. protected override void ReinitSpeedUI()
  1371. {
  1372. InitGroupSpeed(pnlSpeed, SpeedChanged);
  1373. }
  1374. protected void SpeedChanged(object sender, EventArgs e)
  1375. {
  1376. RadioButton radio = (RadioButton)sender;
  1377. if (radio.Checked)
  1378. {
  1379. int index = (int)radio.Tag;
  1380. m_Stage.SetSpeedXY(m_speedLists[index].LSpeed);
  1381. m_Stage.SetSpeedZ(m_speedLists[index].ZSpeed);
  1382. }
  1383. }
  1384. private void UpdateBtnState()
  1385. {
  1386. if (m_isDoing)
  1387. {
  1388. this.Invoke(new Action(() =>
  1389. {
  1390. btnWorking.Enabled = false;
  1391. btnStop.Enabled = true;
  1392. }));
  1393. }
  1394. else
  1395. {
  1396. this.Invoke(new Action(() =>
  1397. {
  1398. btnWorking.Enabled = true;
  1399. btnStop.Enabled = false;
  1400. }));
  1401. }
  1402. }
  1403. private void btnStop_Click(object sender, EventArgs e)
  1404. {
  1405. m_isDoing = false;
  1406. this.UpdateBtnState();
  1407. }
  1408. private void btnCreatImgFile_Click(object sender, EventArgs e)
  1409. {
  1410. if (m_mergeBitMap == null)
  1411. {
  1412. MessageBox.Show(PdnResources.GetString("Menu.NoMosaicimagefound.Text"));
  1413. return;
  1414. }
  1415. //获取命名
  1416. string photoName;
  1417. if (Startup.instance.ruleDB == null)
  1418. {
  1419. photoName = NamingRuleHelper.GetNameFromXml(Startup.instance.configModel, "默认标尺", "0");
  1420. }
  1421. else
  1422. {
  1423. photoName = NamingRuleHelper.GetNameFromXml(Startup.instance.configModel, Startup.instance.ruleDB.ruler_name, Startup.instance.ruleDB.gain_multiple.ToString());
  1424. }
  1425. DocumentWorkspace dw = m_appWorkspace.AddNewDocumentWorkspace();
  1426. Document document = Document.FromImageMat(Camera.Tools.ToMat(m_mergeBitMap));
  1427. document.Dirty = true;
  1428. dw.Document = document;
  1429. dw.fileText = photoName;
  1430. //dw.rules = new Dictionary<MeasurementUnit, double>(Startup.instance.rules);
  1431. dw.xmlSaveModel = Startup.instance.ruleDB;
  1432. dw.InitRulerInfo();
  1433. //激活
  1434. m_appWorkspace.ActiveDocumentWorkspace = dw;
  1435. //锁定扩缩
  1436. if (m_appWorkspace.isLockZoom && m_appWorkspace.lockScaleRatio > 0)
  1437. {
  1438. m_appWorkspace.ActiveDocumentWorkspace.ZoomBasis = ZoomBasis.ScaleFactor;
  1439. m_appWorkspace.ActiveDocumentWorkspace.ScaleFactor = ScaleFactor.FromDouble(m_appWorkspace.lockScaleRatio);
  1440. m_appWorkspace.SetZoonTrackValue(m_appWorkspace.ActiveDocumentWorkspace.ScaleFactor);
  1441. }
  1442. else
  1443. {
  1444. m_appWorkspace.ActiveDocumentWorkspace.ZoomBasis = ZoomBasis.FitToWindow;
  1445. }
  1446. m_appWorkspace.Refresh();
  1447. }
  1448. private void ListOfLocationsDialog_Load(object sender, EventArgs e)
  1449. {
  1450. this.panelControl.AutoScrollPosition = new System.Drawing.Point(0, 0);
  1451. }
  1452. /// <summary>
  1453. /// 添加列表(创建十字线)
  1454. /// </summary>
  1455. /// <param name="sender"></param>
  1456. /// <param name="e"></param>
  1457. private void btnAddCross_Click(object sender, EventArgs e)
  1458. {
  1459. //m_documentWorkspace.GraphicsList.Clear();
  1460. if (txtNX.Text.Trim().Length == 0)
  1461. {
  1462. MessageBox.Show("NX" + PdnResources.GetString("Menu.Cantbeempty.Text"));
  1463. return;
  1464. }
  1465. if (txtLX.Text.Trim().Length == 0)
  1466. {
  1467. MessageBox.Show("LX" + PdnResources.GetString("Menu.Cantbeempty.Text"));
  1468. return;
  1469. }
  1470. if (txtNY.Text.Trim().Length == 0)
  1471. {
  1472. MessageBox.Show("NY" + PdnResources.GetString("Menu.Cantbeempty.Text"));
  1473. return;
  1474. }
  1475. if (txtLY.Text.Trim().Length == 0)
  1476. {
  1477. MessageBox.Show("LY" + PdnResources.GetString("Menu.Cantbeempty.Text"));
  1478. return;
  1479. }
  1480. int nx = int.Parse(txtNX.Text);
  1481. int ny = int.Parse(txtNY.Text);
  1482. int lx = int.Parse(txtLX.Text);
  1483. int ly = int.Parse(txtLY.Text);
  1484. System.Drawing.Point start = new System.Drawing.Point();
  1485. if (rdoLeftTop.Checked)
  1486. {
  1487. start.X = m_viewWidth / 2;
  1488. start.Y = m_viewHeight / 2;
  1489. }
  1490. else
  1491. {
  1492. start.X = 0;
  1493. start.Y = 0;
  1494. }
  1495. for (int i = 0; i < ny; i++)
  1496. {
  1497. for (int j = 0; j < nx; j++)
  1498. {
  1499. m_documentWorkspace.ActiveTool = DrawToolType.DrawLocationCross;
  1500. int x = start.X + j * lx;
  1501. int y = start.Y + i * ly;
  1502. m_documentWorkspace.CreateLocationCross(x, y, m_viewWidth, m_viewHeight, 0);
  1503. }
  1504. }
  1505. m_documentWorkspace.Refresh();
  1506. }
  1507. private void dgvRegionTeb_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
  1508. {
  1509. this.m_documentWorkspace.GraphicsList.UnselectAll();
  1510. for (int i = 0; i < dgvRegionTeb.Rows.Count; i++)
  1511. {
  1512. if (dgvRegionTeb.Rows[i].Selected)
  1513. {
  1514. this.m_documentWorkspace.GraphicsList[i].Selected = true;
  1515. }
  1516. else
  1517. {
  1518. this.m_documentWorkspace.GraphicsList[i].Selected = false;
  1519. }
  1520. }
  1521. this.m_documentWorkspace.Refresh();
  1522. }
  1523. private void GraphicsList_SelectChanged(object sender, EventArgs e)
  1524. {
  1525. this.DgvRegionTebRefresh();
  1526. }
  1527. private void DgvRegionTebRefresh()
  1528. {
  1529. dgvRegionTeb.Rows.Clear();
  1530. List<DrawObject> graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
  1531. int count = graphicsList.Count;
  1532. for (int i = 0; i < count; i++)
  1533. {
  1534. Dictionary<int, object> point = ((DrawLocationCross)graphicsList[i]).GetViewPoints();
  1535. if (point.Count > 0)
  1536. {
  1537. PointF pointF = (PointF)point[0];
  1538. string z = m_Stage.Z.ToString("F2");
  1539. if (point.Count == 2)
  1540. {
  1541. z = point[1].ToString();
  1542. }
  1543. else
  1544. {
  1545. point[1] = z;
  1546. }
  1547. dgvRegionTeb.Rows.Add(i, pointF.X, pointF.Y, z);
  1548. if (graphicsList[i].Selected)
  1549. {
  1550. dgvRegionTeb.Rows[i].Selected = true;
  1551. dgvRegionTeb.CurrentCell = dgvRegionTeb.Rows[i].Cells[0];
  1552. }
  1553. }
  1554. }
  1555. }
  1556. private void btnDel_Click(object sender, EventArgs e)
  1557. {
  1558. if (dgvRegionTeb.SelectedRows.Count <= 0)
  1559. {
  1560. MessageBox.Show(PdnResources.GetString("Menu.Selectthedatatoelete0.Text"));
  1561. return;
  1562. }
  1563. DialogResult result = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretodelete.Text") + "?", PdnResources.GetString("Menu.Tips.text"), MessageBoxButtons.OKCancel);
  1564. if (result == DialogResult.OK)
  1565. {
  1566. //执行删除
  1567. foreach (DataGridViewRow r in dgvRegionTeb.SelectedRows)
  1568. {
  1569. if (!r.IsNewRow)
  1570. {
  1571. this.m_documentWorkspace.GraphicsList.RemoveAt(r.Index);
  1572. }
  1573. }
  1574. this.DgvRegionTebRefresh();
  1575. foreach (DataGridViewRow r in dgvRegionTeb.SelectedRows)
  1576. {
  1577. if (!r.IsNewRow)
  1578. {
  1579. this.m_documentWorkspace.GraphicsList[r.Index].Selected = true;
  1580. }
  1581. }
  1582. this.m_documentWorkspace.Refresh();
  1583. }
  1584. }
  1585. private void OpenZModifyDialog(int index, Dictionary<int, object> point)
  1586. {
  1587. ZModifyDialog dg = new ZModifyDialog(index, point);
  1588. dg.Modified += ZModifyDialog_Modified;
  1589. dg.ShowDialog();
  1590. }
  1591. private void ZModifyDialog_Modified(int vIndex, Dictionary<int, object> point)
  1592. {
  1593. List<DrawObject> graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
  1594. int count = graphicsList.Count;
  1595. for (int i = 0; i < count; i++)
  1596. {
  1597. if (i == vIndex)
  1598. {
  1599. ((DrawLocationCross)graphicsList[i]).SetZPostion(point);
  1600. }
  1601. }
  1602. this.DgvRegionTebRefresh();
  1603. }
  1604. private void dgvRegionTeb_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
  1605. {
  1606. List<DrawObject> graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
  1607. int count = graphicsList.Count;
  1608. for (int i = 0; i < count; i++)
  1609. {
  1610. if (i == e.RowIndex)
  1611. {
  1612. this.OpenZModifyDialog(i, ((DrawLocationCross)graphicsList[i]).GetViewPoints());
  1613. }
  1614. }
  1615. }
  1616. private void btnModify_Click(object sender, EventArgs e)
  1617. {
  1618. if (dgvRegionTeb.SelectedRows.Count != 1)
  1619. {
  1620. MessageBox.Show(PdnResources.GetString("Menu.Selectwofdata.text"));
  1621. return;
  1622. }
  1623. foreach (DataGridViewRow r in dgvRegionTeb.SelectedRows)
  1624. {
  1625. if (!r.IsNewRow)
  1626. {
  1627. List<DrawObject> graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
  1628. this.OpenZModifyDialog(r.Index, ((DrawLocationCross)graphicsList[r.Index]).GetViewPoints());
  1629. }
  1630. }
  1631. }
  1632. List<LocationModel.Item> m_items = new List<LocationModel.Item>();
  1633. private void CreatModelList()
  1634. {
  1635. m_items.Clear();
  1636. List<DrawObject> graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
  1637. int count = graphicsList.Count;
  1638. for (int i = 0; i < count; i++)
  1639. {
  1640. List<PointF> pointFs = ((DrawLocationCross)graphicsList[i]).GetRulerPoints();
  1641. Dictionary<int, object> point = ((DrawLocationCross)graphicsList[i]).GetViewPoints();
  1642. if (point.Count > 0)
  1643. {
  1644. PointF pointF = (PointF)pointFs[0];
  1645. string z = m_Stage.Z.ToString("F2");
  1646. if (point.Count == 2)
  1647. {
  1648. z = point[1].ToString();
  1649. }
  1650. LocationModel.Item item = new LocationModel.Item();
  1651. item.x = pointF.X;
  1652. item.y = pointF.Y;
  1653. item.z = long.Parse(z);
  1654. m_items.Add(item);
  1655. }
  1656. }
  1657. }
  1658. private void InitComFile(string name)
  1659. {
  1660. cmbFile.Items.Clear();
  1661. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Location\\";
  1662. if (!Directory.Exists(filePath))
  1663. {
  1664. Directory.CreateDirectory(filePath);
  1665. }
  1666. List<string> files = FileOperationHelper.GetFileList(filePath);
  1667. foreach (string file in files)
  1668. {
  1669. string fileName = file.Replace(".xml", "");
  1670. cmbFile.Items.Add(fileName);
  1671. }
  1672. if (name != null && name.Length > 0)
  1673. {
  1674. cmbFile.Text = name;
  1675. }
  1676. else
  1677. {
  1678. cmbFile.Text = "";
  1679. }
  1680. }
  1681. LocationModel m_locationModel;
  1682. private void cmbFile_SelectedIndexChanged(object sender, EventArgs e)
  1683. {
  1684. string fileName = cmbFile.Text.Trim();
  1685. if (fileName.Length != 0)
  1686. {
  1687. m_locationModel = XmlSerializeHelper.DESerializer<LocationModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Location\\" + fileName + ".xml", FileMode.Open));
  1688. m_documentWorkspace.GraphicsList.Clear();
  1689. for (int i = 0; i < m_locationModel.items.Count; i++)
  1690. {
  1691. m_documentWorkspace.ActiveTool = DrawToolType.DrawLocationCross;
  1692. int x = (int)m_locationModel.items[i].x;
  1693. int y = (int)m_locationModel.items[i].y;
  1694. m_documentWorkspace.CreateLocationCross(x, y, m_viewWidth, m_viewHeight, (int)m_locationModel.items[i].z);
  1695. }
  1696. this.m_documentWorkspace.Refresh();
  1697. this.DgvRegionTebRefresh();
  1698. }
  1699. }
  1700. /// <summary>
  1701. /// 保存
  1702. /// </summary>
  1703. /// <param name="sender"></param>
  1704. /// <param name="e"></param>
  1705. private void btnSave_Click(object sender, EventArgs e)
  1706. {
  1707. CreatModelList();
  1708. if (cmbFile.Text.Trim().Length == 0)
  1709. {
  1710. SaveAsDialog dg = new SaveAsDialog(m_items);
  1711. dg.Saved += InitComFile;
  1712. dg.ShowDialog();
  1713. }
  1714. else
  1715. {
  1716. string name = cmbFile.Text.Trim();
  1717. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Location\\";
  1718. if (!Directory.Exists(filePath))
  1719. {
  1720. Directory.CreateDirectory(filePath);
  1721. }
  1722. m_locationModel = new LocationModel();
  1723. m_locationModel.items = m_items;
  1724. string stageModelXml = XmlSerializeHelper.XmlSerialize<LocationModel>(m_locationModel);
  1725. filePath = filePath + name + ".xml";
  1726. if (!FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create))
  1727. {
  1728. MessageBox.Show(PdnResources.GetString("Menu.Savefailed.text"));
  1729. }
  1730. }
  1731. }
  1732. /// <summary>
  1733. /// 另存为
  1734. /// </summary>
  1735. /// <param name="sender"></param>
  1736. /// <param name="e"></param>
  1737. private void btnSaveAs_Click(object sender, EventArgs e)
  1738. {
  1739. CreatModelList();
  1740. SaveAsDialog dg = new SaveAsDialog(m_items);
  1741. dg.Saved += InitComFile;
  1742. dg.ShowDialog();
  1743. }
  1744. /// <summary>
  1745. /// 删除
  1746. /// </summary>
  1747. /// <param name="sender"></param>
  1748. /// <param name="e"></param>
  1749. private void btnDelete_Click(object sender, EventArgs e)
  1750. {
  1751. if (cmbFile.Text.Trim().Length == 0)
  1752. {
  1753. MessageBox.Show(PdnResources.GetString("Menu.Pleasselectthesavedfilefirst.Text"));
  1754. return;
  1755. }
  1756. DialogResult result = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretodelete.Text") + "?", PdnResources.GetString("Menu.Tips.text"), MessageBoxButtons.OKCancel);
  1757. if (result == DialogResult.OK)
  1758. {
  1759. string name = cmbFile.Text.Trim();
  1760. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Location\\" + name + ".xml";
  1761. if (System.IO.File.Exists(filePath))
  1762. {
  1763. System.IO.File.Delete(filePath);
  1764. InitComFile(null);
  1765. this.m_documentWorkspace.GraphicsList.Clear();
  1766. this.m_documentWorkspace.Refresh();
  1767. this.dgvRegionTeb.Rows.Clear();
  1768. MessageBox.Show(PdnResources.GetString("Menu.successfullydeleted.text"));
  1769. }
  1770. else
  1771. {
  1772. MessageBox.Show(PdnResources.GetString("Menu.Nodeletedfilesfound.Text"));
  1773. }
  1774. }
  1775. }
  1776. private void btnWorking_Click(object sender, EventArgs e)
  1777. {
  1778. if (!m_camera.IsOpen())
  1779. {
  1780. MessageBox.Show(PdnResources.GetString("Menu.Pleaseconfirmwhetherthecameraisconnected.Text"));
  1781. return;
  1782. }
  1783. if (!m_isReset)
  1784. {
  1785. MessageBox.Show(PdnResources.GetString("Menu.Pleaseresetfirst.Text"));
  1786. return;
  1787. }
  1788. if (this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch).Count <= 0)
  1789. {
  1790. MessageBox.Show(PdnResources.GetString("Menu.Pleasereatethepuzzleareafirst.Text"));
  1791. return;
  1792. }
  1793. m_isDoing = true;
  1794. this.UpdateBtnState();
  1795. m_stitchingThread = new Thread(new ThreadStart(WaitForStitchingThreadEntry));
  1796. m_stitchingThread.Start();
  1797. }
  1798. //private string m_filePath = Application.StartupPath + "\\Picture\\";
  1799. private Bitmap m_mergeBitMap;
  1800. private PointF m_pointFStart;
  1801. private void WaitForStitchingThreadEntry()
  1802. {
  1803. List<DrawObject> graphicsList = this.m_documentWorkspace.GraphicsList.GetDrawClassList(DrawClass.Stitch);
  1804. int count = graphicsList.Count;
  1805. for (int i = 0; i < count; i++)
  1806. {
  1807. if (!m_isDoing)
  1808. {
  1809. return;
  1810. }
  1811. List<PointF> points = ((DrawLocationCross)graphicsList[i]).GetRulerPoints();
  1812. PointF nextP = points[0];
  1813. var x = ConvertPXToUm((int)(nextP.X));
  1814. var y = ConvertPXToUm((int)(nextP.Y));
  1815. base.m_Stage.To(x, y);
  1816. do
  1817. {
  1818. Thread.Sleep(250);
  1819. }
  1820. while (m_Stage.StateX > 1 || m_Stage.StateY > 1);
  1821. Thread.Sleep(100);
  1822. //m_camera.m_bufHandler -= CallbackDraw;
  1823. m_merge = PaintDotNet.Camera.Tools.ToMat(m_BitmapCurrent);
  1824. //m_camera.m_bufHandler += CallbackDraw;
  1825. var Image = this.MatchPic(i, m_merge, nextP);
  1826. m_mergeBitMap = (Bitmap)Image.Clone();
  1827. pictureBox1.Image = Image;
  1828. if (m_pointFStart.X > nextP.X)
  1829. {
  1830. m_pointFStart.X = nextP.X;
  1831. }
  1832. if (m_pointFStart.Y > nextP.Y)
  1833. {
  1834. m_pointFStart.Y = nextP.Y;
  1835. }
  1836. }
  1837. m_isDoing = false;
  1838. this.UpdateBtnState();
  1839. }
  1840. private Bitmap MatchPic(int index, Mat mat, PointF currentPointF)
  1841. {
  1842. Bitmap bitmap;
  1843. if (index == 0)
  1844. {
  1845. bitmap = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat);
  1846. m_pointFStart = currentPointF;
  1847. }
  1848. else
  1849. {
  1850. int width;
  1851. int height;
  1852. if (m_pointFStart.X > currentPointF.X)
  1853. {
  1854. width = (int)Math.Ceiling((m_pointFStart.X - currentPointF.X) + m_mergeBitMap.Width);
  1855. width = width > m_mergeBitMap.Width ? width : m_mergeBitMap.Width;
  1856. }
  1857. else
  1858. {
  1859. width = (int)Math.Ceiling((currentPointF.X - m_pointFStart.X) + mat.Width);
  1860. width = width > m_mergeBitMap.Width ? width : m_mergeBitMap.Width;
  1861. }
  1862. if (m_pointFStart.Y > currentPointF.Y)
  1863. {
  1864. height = (int)Math.Ceiling((m_pointFStart.Y - currentPointF.Y) + m_mergeBitMap.Height);
  1865. height = height > m_mergeBitMap.Height ? height : m_mergeBitMap.Height;
  1866. }
  1867. else
  1868. {
  1869. height = (int)Math.Ceiling((currentPointF.Y - m_pointFStart.Y) + mat.Height);
  1870. height = height > m_mergeBitMap.Height ? height : m_mergeBitMap.Height;
  1871. }
  1872. PointF point = new PointF();
  1873. if (m_pointFStart.X > currentPointF.X)
  1874. {
  1875. point.X = currentPointF.X;
  1876. }
  1877. else
  1878. {
  1879. point.X = m_pointFStart.X;
  1880. }
  1881. if (m_pointFStart.Y > currentPointF.Y)
  1882. {
  1883. point.Y = currentPointF.Y;
  1884. }
  1885. else
  1886. {
  1887. point.Y = m_pointFStart.Y;
  1888. }
  1889. if (width > 30000 || height > 30000)
  1890. {
  1891. m_scale = m_scale * 0.5;
  1892. width = width / 2;
  1893. height = height / 2;
  1894. OpenCvSharp.Cv2.Resize(mat, mat, new OpenCvSharp.Size(mat.Width * m_scale, mat.Height * m_scale));
  1895. OpenCvSharp.Mat targetMat = PaintDotNet.Camera.Tools.ToMat(this.m_mergeBitMap);
  1896. OpenCvSharp.Cv2.Resize(targetMat, targetMat, new OpenCvSharp.Size(targetMat.Width / 2, targetMat.Height / 2));
  1897. m_mergeBitMap = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(targetMat);
  1898. }
  1899. Bitmap merge = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat);
  1900. bitmap = new Bitmap(width, height);
  1901. Graphics g = Graphics.FromImage(bitmap);
  1902. g.DrawImage(merge, (float)Math.Abs((currentPointF.X - point.X) * m_scale), (float)Math.Abs((currentPointF.Y - point.Y) * m_scale), merge.Width, merge.Height);
  1903. g.DrawImage(m_mergeBitMap, (float)Math.Abs((m_pointFStart.X - point.X) * m_scale), (float)Math.Abs((m_pointFStart.Y - point.Y) * m_scale), m_mergeBitMap.Width, m_mergeBitMap.Height);
  1904. merge.Dispose();
  1905. g.Dispose();
  1906. m_pointFStart = point;
  1907. }
  1908. return bitmap;
  1909. }
  1910. }
  1911. }