ListOfLocationsDialog.cs 97 KB

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