GrainGuideSettingsDialog.cs 180 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424
  1. using PaintDotNet.Base.SettingModel;
  2. using PaintDotNet.Base.CommTool;
  3. using System;
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.Drawing;
  8. using System.IO;
  9. using System.Windows.Forms;
  10. using PaintDotNet.DedicatedAnalysis.GrainSizeStandard;
  11. namespace PaintDotNet.DedicatedAnalysis
  12. {
  13. /// <summary>
  14. /// 晶粒度辅助线设置
  15. /// </summary>
  16. public partial class GrainGuideSettingsDialog : Form
  17. {
  18. #region 控件
  19. private GroupBox groupBox2;
  20. private GroupBox groupBox3;
  21. private Button button1;
  22. private Button button2;
  23. private Label label3;
  24. private Label label2;
  25. private Label label1;
  26. private Panel panel1;
  27. private Panel panel2;
  28. private GroupBox groupBox1;
  29. /// <summary>
  30. /// 线宽
  31. /// </summary>
  32. private NumericUpDown numericUpDown2;
  33. private GroupBox groupBox4;
  34. private Button button5;
  35. private Button button4;
  36. private Button button3;
  37. private Label label7;
  38. private TextBox textBox1;
  39. private ComboBox comboBox1;
  40. /// <summary>
  41. /// 截点法-垂直辅助线-辅助线长度
  42. /// </summary>
  43. private NumericUpDown numericUpDown1;
  44. private Panel panel3;
  45. private Panel panel4;
  46. /// <summary>
  47. /// 截点法-水平辅助线-辅助线长度
  48. /// </summary>
  49. private NumericUpDown numericUpDown3;
  50. private Label label4;
  51. private Panel panel5;
  52. private NumericUpDown numericUpDown4;
  53. private Label label5;
  54. private Panel panel6;
  55. private NumericUpDown numericUpDown6;
  56. private Label label8;
  57. private NumericUpDown numericUpDown5;
  58. private Label label6;
  59. private Panel panel7;
  60. /// <summary>
  61. /// 水平线长度
  62. /// </summary>
  63. private NumericUpDown numericUpDown7;
  64. private Label label9;
  65. /// <summary>
  66. /// 垂线长度
  67. /// </summary>
  68. private NumericUpDown numericUpDown8;
  69. private Label label10;
  70. /// <summary>
  71. /// 边距
  72. /// </summary>
  73. private NumericUpDown numericUpDown10;
  74. private Label label12;
  75. /// <summary>
  76. /// 直径
  77. /// </summary>
  78. private NumericUpDown numericUpDown9;
  79. private Label label11;
  80. /// <summary>
  81. /// 左下到右上斜线长度
  82. /// </summary>
  83. private NumericUpDown numericUpDown11;
  84. private Label label13;
  85. /// <summary>
  86. /// 左上到右下斜线长度
  87. /// </summary>
  88. private NumericUpDown numericUpDown12;
  89. private Label label14;
  90. private DataGridView dataGridView1;
  91. private DataGridViewTextBoxColumn GuideName;
  92. private DataGridViewTextBoxColumn Column1;
  93. private DataGridViewTextBoxColumn GrainType;
  94. private Label label16;
  95. private Label label15;
  96. /// <summary>
  97. /// 水平线到圆距离
  98. /// </summary>
  99. private NumericUpDown numericUpDown14;
  100. /// <summary>
  101. /// 垂线到圆距离
  102. /// </summary>
  103. private NumericUpDown numericUpDown13;
  104. private Panel panel8;
  105. /// <summary>
  106. /// 面积法-矩形-高
  107. /// </summary>
  108. private NumericUpDown numericUpDown15;
  109. private Label label17;
  110. /// <summary>
  111. /// 面积法-矩形-宽
  112. /// </summary>
  113. private NumericUpDown numericUpDown16;
  114. private Label label18;
  115. private Panel panel9;
  116. /// <summary>
  117. /// 面积法-圆形-直径
  118. /// </summary>
  119. private NumericUpDown numericUpDown18;
  120. private Label label20;
  121. /// <summary>
  122. /// 面积法-辅助线类型
  123. /// </summary>
  124. private ComboBox comboBox2;
  125. /// <summary>
  126. /// 截点法-水平辅助线-辅助线数量
  127. /// </summary>
  128. private NumericUpDown numericUpDown19;
  129. private Label label21;
  130. /// <summary>
  131. /// 截点法-水平辅助线-辅助线间距
  132. /// </summary>
  133. private NumericUpDown numericUpDown17;
  134. private Label label19;
  135. /// <summary>
  136. /// 截点法-垂直辅助线-辅助线数量
  137. /// </summary>
  138. private NumericUpDown numericUpDown20;
  139. private Label label22;
  140. /// <summary>
  141. /// 截点法-垂直辅助线-辅助线间距
  142. /// </summary>
  143. private NumericUpDown numericUpDown21;
  144. private Label label23;
  145. private CheckBox checkBox1;
  146. #endregion
  147. /// <summary>
  148. /// 调色板
  149. /// </summary>
  150. PaintDotNet.ColorsForm colorsForm;
  151. /// <summary>
  152. /// 操作区分(0 :添加 1 :编辑)
  153. /// </summary>
  154. private int operation = -1;
  155. /// <summary>
  156. /// 临时数据
  157. /// </summary>
  158. private List<ArrayList> arrayLists = new List<ArrayList>();
  159. /// <summary>
  160. /// 跳转画面 0:截点法 1:面积法
  161. /// </summary>
  162. private int picture;
  163. /// <summary>
  164. /// 配置文件名称
  165. /// </summary>
  166. private string xmlModelName;
  167. //##考虑放在父类中声明属性,这样就不用创建这个dialog了
  168. private string[] typeListNames = new string[] { "", "" };
  169. //{
  170. // return new string[] {
  171. // PdnResources.GetString("Menu.Verticalauxiliaryline.text"),
  172. // PdnResources.GetString("Menu.Horizontalauxiliaryline.text")};
  173. //}
  174. /// <summary>
  175. /// 直径
  176. /// </summary>
  177. public int diameter;
  178. /// <summary>
  179. /// 边距
  180. /// </summary>
  181. public int margin;
  182. /// <summary>
  183. /// 长度(垂线)
  184. /// </summary>
  185. public int vLineLength;
  186. /// <summary>
  187. /// 长度(水平线)
  188. /// </summary>
  189. public int hLineLength;
  190. /// <summary>
  191. /// 左上到右下斜线长度
  192. /// </summary>
  193. public int TopleftLineLength;
  194. /// <summary>
  195. /// 左下到右上斜线长度
  196. /// </summary>
  197. public int ToprightLineLength;
  198. /// <summary>
  199. /// 垂线到圆距离
  200. /// </summary>
  201. public int VLineToCDistance;
  202. /// <summary>
  203. /// 水平线到圆距离
  204. /// </summary>
  205. public int HLineToCDistance;
  206. /// <summary>
  207. /// 线宽
  208. /// </summary>
  209. public int lineWidth;
  210. /// %
  211. /// </summary>
  212. public decimal percentage;
  213. private Label label24;
  214. private ToolTip toolTip1;
  215. private IContainer components;
  216. /// <summary>
  217. /// 选择的图片
  218. /// </summary>
  219. private OpenCvSharp.Mat imageMat;
  220. private Bitmap bitmap;
  221. /// <summary>
  222. /// 选择标尺的物理长度(1倍下的 微米/像素)
  223. /// </summary>
  224. double physical_length = 1;
  225. /// <summary>
  226. /// 选择标尺的物理长度(1倍下的 微米/像素)
  227. /// </summary>
  228. double physical_area_length_Micron = 1;
  229. /// <summary>
  230. /// 排列顺序
  231. /// </summary>
  232. private int index = 0;
  233. public GrainGuideSettingsDialog(int picture, string xmlModelName, string[] typeListNames, OpenCvSharp.Mat imageMat, double physical_Micron = 1.0)
  234. {
  235. this.picture = picture;
  236. this.xmlModelName = xmlModelName;
  237. this.typeListNames = typeListNames;
  238. this.imageMat = imageMat/*.Clone()*/;
  239. this.bitmap = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(this.imageMat);
  240. //Dictionary<MeasurementUnit, double> measurementUnitDictionary = Startup.instance.rules;
  241. physical_length = physical_Micron;//;this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].GetRuler(MeasurementUnit.Micron)// measurementUnitDictionary[MeasurementUnit.Micron];
  242. physical_area_length_Micron = physical_Micron;//;this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].GetRuler(MeasurementUnit.Micron) measurementUnitDictionary[MeasurementUnit.Micron];
  243. //physical_area_length_Millimeter = measurementUnitDictionary[MeasurementUnit.Millimeter];
  244. //double physical_area_length_Micron = getCurrentWorkspace().GetRuler(MeasurementUnit.Micron);
  245. InitializeComponent();
  246. InitializeLanguageText();
  247. InitializeButtonBackgroudImage();
  248. InitializeToolTip();
  249. InitializeData();
  250. //调色板
  251. this.colorsForm = new ColorsForm();
  252. this.colorsForm.StartPosition = FormStartPosition.CenterScreen;
  253. this.colorsForm.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  254. }
  255. #region 初始化
  256. private void InitializeLanguageText()
  257. {
  258. this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
  259. this.button2.Text = PdnResources.GetString("CommonAction.Save");
  260. this.button1.Text = PdnResources.GetString("Menu.File.Close.Text");
  261. this.groupBox2.Text = PdnResources.GetString("Menu.Tools.AuxiliaryLine.Text");
  262. this.label21.Text = PdnResources.GetString("Menu.Numberoflines.text") + ":";
  263. this.label19.Text = PdnResources.GetString("Menu.spacing.text") + ":";
  264. this.label4.Text = PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text") + ":";
  265. this.label20.Text = PdnResources.GetString("Menu.diameter.text") + ":";
  266. this.label5.Text = PdnResources.GetString("Menu.diameter.text") + ":";
  267. this.label8.Text = PdnResources.GetString("Menu.margin.Text") + ":";
  268. this.label6.Text = PdnResources.GetString("Menu.Innercirclediameter.Text") + ":";
  269. this.label17.Text = PdnResources.GetString("Menu.Rectheight.text") + ":";
  270. this.label18.Text = PdnResources.GetString("Menu.Rectwidth.text") + ":";
  271. this.label22.Text = PdnResources.GetString("Menu.Numberoflines.text") + ":";
  272. this.label23.Text = PdnResources.GetString("Menu.spacing.text") + ":";
  273. this.label1.Text = PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text") + ":";
  274. this.label3.Text = PdnResources.GetString("Menu.Linewidth.text") + ":";
  275. this.checkBox1.Text = PdnResources.GetString("Menu.Geometricscaling.Text");
  276. this.label16.Text = PdnResources.GetString("Menu.Thedistancefromthehorizontothecircle.Text");
  277. this.label15.Text = PdnResources.GetString("Menu.theperpendiculartothecircl.Text") + ":";
  278. this.label13.Text = PdnResources.GetString("Menu.gonallinefrombottomlefttotopright.Text") + ":";
  279. this.label14.Text = PdnResources.GetString("Menu.nalfromtoplefttob.Text") + ":";
  280. this.label12.Text = PdnResources.GetString("Menu.margin.Text") + ":";
  281. this.label11.Text = PdnResources.GetString("Menu.Innercirclediameter.Text") + ":";
  282. this.label9.Text = PdnResources.GetString("Menu.Horizontallength.Text") + ":";
  283. this.label10.Text = PdnResources.GetString("Menu.Set.Rulersettings.lengthofperpendicular.text") + ":";
  284. this.label7.Text = PdnResources.GetString("Menu.name.text") + ":";
  285. this.label2.Text = PdnResources.GetString("Menu.color.text") + ":";
  286. this.label24.Text = PdnResources.GetString("Menu.Type.text") + ":";
  287. this.groupBox3.Text = PdnResources.GetString("Menu.Preview.text");
  288. this.groupBox4.Text = PdnResources.GetString("Menu.Preview.text");
  289. this.Text = PdnResources.GetString("Menu.Auxiliarylinestylesettings.text");
  290. }
  291. private void InitializeComponent()
  292. {
  293. this.components = new System.ComponentModel.Container();
  294. this.groupBox1 = new System.Windows.Forms.GroupBox();
  295. this.button2 = new System.Windows.Forms.Button();
  296. this.button1 = new System.Windows.Forms.Button();
  297. this.groupBox2 = new System.Windows.Forms.GroupBox();
  298. this.panel4 = new System.Windows.Forms.Panel();
  299. this.numericUpDown19 = new System.Windows.Forms.NumericUpDown();
  300. this.label21 = new System.Windows.Forms.Label();
  301. this.numericUpDown17 = new System.Windows.Forms.NumericUpDown();
  302. this.label19 = new System.Windows.Forms.Label();
  303. this.numericUpDown3 = new System.Windows.Forms.NumericUpDown();
  304. this.label4 = new System.Windows.Forms.Label();
  305. this.panel9 = new System.Windows.Forms.Panel();
  306. this.numericUpDown18 = new System.Windows.Forms.NumericUpDown();
  307. this.label20 = new System.Windows.Forms.Label();
  308. this.panel5 = new System.Windows.Forms.Panel();
  309. this.numericUpDown4 = new System.Windows.Forms.NumericUpDown();
  310. this.label5 = new System.Windows.Forms.Label();
  311. this.comboBox2 = new System.Windows.Forms.ComboBox();
  312. this.panel6 = new System.Windows.Forms.Panel();
  313. this.numericUpDown6 = new System.Windows.Forms.NumericUpDown();
  314. this.label8 = new System.Windows.Forms.Label();
  315. this.numericUpDown5 = new System.Windows.Forms.NumericUpDown();
  316. this.label6 = new System.Windows.Forms.Label();
  317. this.panel8 = new System.Windows.Forms.Panel();
  318. this.numericUpDown15 = new System.Windows.Forms.NumericUpDown();
  319. this.label17 = new System.Windows.Forms.Label();
  320. this.numericUpDown16 = new System.Windows.Forms.NumericUpDown();
  321. this.label18 = new System.Windows.Forms.Label();
  322. this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
  323. this.panel3 = new System.Windows.Forms.Panel();
  324. this.numericUpDown20 = new System.Windows.Forms.NumericUpDown();
  325. this.label22 = new System.Windows.Forms.Label();
  326. this.numericUpDown21 = new System.Windows.Forms.NumericUpDown();
  327. this.label23 = new System.Windows.Forms.Label();
  328. this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
  329. this.label1 = new System.Windows.Forms.Label();
  330. this.label3 = new System.Windows.Forms.Label();
  331. this.comboBox1 = new System.Windows.Forms.ComboBox();
  332. this.textBox1 = new System.Windows.Forms.TextBox();
  333. this.panel2 = new System.Windows.Forms.Panel();
  334. this.panel7 = new System.Windows.Forms.Panel();
  335. this.checkBox1 = new System.Windows.Forms.CheckBox();
  336. this.numericUpDown14 = new System.Windows.Forms.NumericUpDown();
  337. this.numericUpDown13 = new System.Windows.Forms.NumericUpDown();
  338. this.label16 = new System.Windows.Forms.Label();
  339. this.label15 = new System.Windows.Forms.Label();
  340. this.numericUpDown11 = new System.Windows.Forms.NumericUpDown();
  341. this.label13 = new System.Windows.Forms.Label();
  342. this.numericUpDown12 = new System.Windows.Forms.NumericUpDown();
  343. this.label14 = new System.Windows.Forms.Label();
  344. this.numericUpDown10 = new System.Windows.Forms.NumericUpDown();
  345. this.label12 = new System.Windows.Forms.Label();
  346. this.numericUpDown9 = new System.Windows.Forms.NumericUpDown();
  347. this.label11 = new System.Windows.Forms.Label();
  348. this.numericUpDown7 = new System.Windows.Forms.NumericUpDown();
  349. this.label9 = new System.Windows.Forms.Label();
  350. this.numericUpDown8 = new System.Windows.Forms.NumericUpDown();
  351. this.label10 = new System.Windows.Forms.Label();
  352. this.label7 = new System.Windows.Forms.Label();
  353. this.label2 = new System.Windows.Forms.Label();
  354. this.label24 = new System.Windows.Forms.Label();
  355. this.groupBox3 = new System.Windows.Forms.GroupBox();
  356. this.panel1 = new System.Windows.Forms.Panel();
  357. this.groupBox4 = new System.Windows.Forms.GroupBox();
  358. this.dataGridView1 = new System.Windows.Forms.DataGridView();
  359. this.GuideName = new System.Windows.Forms.DataGridViewTextBoxColumn();
  360. this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  361. this.GrainType = new System.Windows.Forms.DataGridViewTextBoxColumn();
  362. this.button5 = new System.Windows.Forms.Button();
  363. this.button4 = new System.Windows.Forms.Button();
  364. this.button3 = new System.Windows.Forms.Button();
  365. this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
  366. this.groupBox1.SuspendLayout();
  367. this.groupBox2.SuspendLayout();
  368. this.panel4.SuspendLayout();
  369. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown19)).BeginInit();
  370. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown17)).BeginInit();
  371. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit();
  372. this.panel9.SuspendLayout();
  373. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown18)).BeginInit();
  374. this.panel5.SuspendLayout();
  375. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit();
  376. this.panel6.SuspendLayout();
  377. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).BeginInit();
  378. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).BeginInit();
  379. this.panel8.SuspendLayout();
  380. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown15)).BeginInit();
  381. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown16)).BeginInit();
  382. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
  383. this.panel3.SuspendLayout();
  384. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown20)).BeginInit();
  385. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown21)).BeginInit();
  386. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
  387. this.panel7.SuspendLayout();
  388. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown14)).BeginInit();
  389. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown13)).BeginInit();
  390. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown11)).BeginInit();
  391. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown12)).BeginInit();
  392. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown10)).BeginInit();
  393. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown9)).BeginInit();
  394. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown7)).BeginInit();
  395. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown8)).BeginInit();
  396. this.groupBox3.SuspendLayout();
  397. this.groupBox4.SuspendLayout();
  398. ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
  399. this.SuspendLayout();
  400. //
  401. // groupBox1
  402. //
  403. this.groupBox1.Controls.Add(this.button2);
  404. this.groupBox1.Controls.Add(this.button1);
  405. this.groupBox1.Location = new System.Drawing.Point(12, 12);
  406. this.groupBox1.Name = "groupBox1";
  407. this.groupBox1.Size = new System.Drawing.Size(500, 54);
  408. this.groupBox1.TabIndex = 0;
  409. this.groupBox1.TabStop = false;
  410. //
  411. // button2
  412. //
  413. this.button2.Location = new System.Drawing.Point(414, 16);
  414. this.button2.Name = "button2";
  415. this.button2.Size = new System.Drawing.Size(70, 28);
  416. this.button2.TabIndex = 1;
  417. this.button2.UseVisualStyleBackColor = true;
  418. this.button2.Click += new System.EventHandler(this.button2_Click);
  419. //
  420. // button1
  421. //
  422. this.button1.Location = new System.Drawing.Point(325, 16);
  423. this.button1.Name = "button1";
  424. this.button1.Size = new System.Drawing.Size(70, 28);
  425. this.button1.TabIndex = 0;
  426. this.button1.UseVisualStyleBackColor = true;
  427. this.button1.Click += new System.EventHandler(this.button1_Click);
  428. //
  429. // groupBox2
  430. //
  431. this.groupBox2.Controls.Add(this.panel4);
  432. this.groupBox2.Controls.Add(this.panel9);
  433. this.groupBox2.Controls.Add(this.panel5);
  434. this.groupBox2.Controls.Add(this.comboBox2);
  435. this.groupBox2.Controls.Add(this.panel6);
  436. this.groupBox2.Controls.Add(this.panel8);
  437. this.groupBox2.Controls.Add(this.numericUpDown2);
  438. this.groupBox2.Controls.Add(this.panel3);
  439. this.groupBox2.Controls.Add(this.label3);
  440. this.groupBox2.Controls.Add(this.comboBox1);
  441. this.groupBox2.Controls.Add(this.textBox1);
  442. this.groupBox2.Controls.Add(this.panel2);
  443. this.groupBox2.Controls.Add(this.panel7);
  444. this.groupBox2.Controls.Add(this.label7);
  445. this.groupBox2.Controls.Add(this.label2);
  446. this.groupBox2.Controls.Add(this.label24);
  447. this.groupBox2.Location = new System.Drawing.Point(193, 72);
  448. this.groupBox2.Name = "groupBox2";
  449. this.groupBox2.Size = new System.Drawing.Size(319, 260);
  450. this.groupBox2.TabIndex = 1;
  451. this.groupBox2.TabStop = false;
  452. //
  453. // panel4
  454. //
  455. this.panel4.Controls.Add(this.numericUpDown19);
  456. this.panel4.Controls.Add(this.label21);
  457. this.panel4.Controls.Add(this.numericUpDown17);
  458. this.panel4.Controls.Add(this.label19);
  459. this.panel4.Controls.Add(this.numericUpDown3);
  460. this.panel4.Controls.Add(this.label4);
  461. this.panel4.Location = new System.Drawing.Point(21, 75);
  462. this.panel4.Name = "panel4";
  463. this.panel4.Size = new System.Drawing.Size(272, 107);
  464. this.panel4.TabIndex = 23;
  465. //
  466. // numericUpDown19
  467. //
  468. this.numericUpDown19.Location = new System.Drawing.Point(56, 42);
  469. this.numericUpDown19.Maximum = new decimal(new int[] {
  470. 99999999,
  471. 0,
  472. 0,
  473. 0});
  474. this.numericUpDown19.Minimum = new decimal(new int[] {
  475. 1,
  476. 0,
  477. 0,
  478. 0});
  479. this.numericUpDown19.Name = "numericUpDown19";
  480. this.numericUpDown19.Size = new System.Drawing.Size(82, 21);
  481. this.numericUpDown19.TabIndex = 25;
  482. this.numericUpDown19.Value = new decimal(new int[] {
  483. 1,
  484. 0,
  485. 0,
  486. 0});
  487. this.numericUpDown19.ValueChanged += new System.EventHandler(this.numericUpDown19_ValueChanged);
  488. //
  489. // label21
  490. //
  491. this.label21.AutoSize = true;
  492. this.label21.Location = new System.Drawing.Point(6, 47);
  493. this.label21.Name = "label21";
  494. this.label21.Size = new System.Drawing.Size(53, 12);
  495. this.label21.TabIndex = 24;
  496. //
  497. // numericUpDown17
  498. //
  499. this.numericUpDown17.Location = new System.Drawing.Point(179, 15);
  500. this.numericUpDown17.Maximum = new decimal(new int[] {
  501. 99999999,
  502. 0,
  503. 0,
  504. 0});
  505. this.numericUpDown17.Minimum = new decimal(new int[] {
  506. 1,
  507. 0,
  508. 0,
  509. 0});
  510. this.numericUpDown17.Name = "numericUpDown17";
  511. this.numericUpDown17.Size = new System.Drawing.Size(82, 21);
  512. this.numericUpDown17.TabIndex = 23;
  513. this.numericUpDown17.Value = new decimal(new int[] {
  514. 1,
  515. 0,
  516. 0,
  517. 0});
  518. this.numericUpDown17.ValueChanged += new System.EventHandler(this.numericUpDown17_ValueChanged);
  519. //
  520. // label19
  521. //
  522. this.label19.AutoSize = true;
  523. this.label19.Location = new System.Drawing.Point(136, 18);
  524. this.label19.Name = "label19";
  525. this.label19.Size = new System.Drawing.Size(41, 12);
  526. this.label19.TabIndex = 22;
  527. //
  528. // numericUpDown3
  529. //
  530. this.numericUpDown3.Location = new System.Drawing.Point(48, 15);
  531. this.numericUpDown3.Maximum = new decimal(new int[] {
  532. 99999999,
  533. 0,
  534. 0,
  535. 0});
  536. this.numericUpDown3.Minimum = new decimal(new int[] {
  537. 1,
  538. 0,
  539. 0,
  540. 0});
  541. this.numericUpDown3.Name = "numericUpDown3";
  542. this.numericUpDown3.Size = new System.Drawing.Size(82, 21);
  543. this.numericUpDown3.TabIndex = 21;
  544. this.numericUpDown3.Value = new decimal(new int[] {
  545. 1,
  546. 0,
  547. 0,
  548. 0});
  549. this.numericUpDown3.ValueChanged += new System.EventHandler(this.numericUpDown3_ValueChanged);
  550. //
  551. // label4
  552. //
  553. this.label4.AutoSize = true;
  554. this.label4.Location = new System.Drawing.Point(6, 18);
  555. this.label4.Name = "label4";
  556. this.label4.Size = new System.Drawing.Size(41, 12);
  557. this.label4.TabIndex = 0;
  558. //
  559. // panel9
  560. //
  561. this.panel9.Controls.Add(this.numericUpDown18);
  562. this.panel9.Controls.Add(this.label20);
  563. this.panel9.Location = new System.Drawing.Point(21, 75);
  564. this.panel9.Name = "panel9";
  565. this.panel9.Size = new System.Drawing.Size(272, 107);
  566. this.panel9.TabIndex = 28;
  567. //
  568. // numericUpDown18
  569. //
  570. this.numericUpDown18.Location = new System.Drawing.Point(52, 13);
  571. this.numericUpDown18.Maximum = new decimal(new int[] {
  572. 99999999,
  573. 0,
  574. 0,
  575. 0});
  576. this.numericUpDown18.Minimum = new decimal(new int[] {
  577. 1,
  578. 0,
  579. 0,
  580. 0});
  581. this.numericUpDown18.Name = "numericUpDown18";
  582. this.numericUpDown18.Size = new System.Drawing.Size(82, 21);
  583. this.numericUpDown18.TabIndex = 21;
  584. this.numericUpDown18.Value = new decimal(new int[] {
  585. 1,
  586. 0,
  587. 0,
  588. 0});
  589. this.numericUpDown18.ValueChanged += new System.EventHandler(this.numericUpDown18_ValueChanged);
  590. //
  591. // label20
  592. //
  593. this.label20.AutoSize = true;
  594. this.label20.Location = new System.Drawing.Point(6, 18);
  595. this.label20.Name = "label20";
  596. this.label20.Size = new System.Drawing.Size(41, 12);
  597. this.label20.TabIndex = 0;
  598. //
  599. // panel5
  600. //
  601. this.panel5.Controls.Add(this.numericUpDown4);
  602. this.panel5.Controls.Add(this.label5);
  603. this.panel5.Location = new System.Drawing.Point(21, 75);
  604. this.panel5.Name = "panel5";
  605. this.panel5.Size = new System.Drawing.Size(272, 107);
  606. this.panel5.TabIndex = 24;
  607. //
  608. // numericUpDown4
  609. //
  610. this.numericUpDown4.Location = new System.Drawing.Point(52, 13);
  611. this.numericUpDown4.Maximum = new decimal(new int[] {
  612. 99999999,
  613. 0,
  614. 0,
  615. 0});
  616. this.numericUpDown4.Minimum = new decimal(new int[] {
  617. 1,
  618. 0,
  619. 0,
  620. 0});
  621. this.numericUpDown4.Name = "numericUpDown4";
  622. this.numericUpDown4.Size = new System.Drawing.Size(82, 21);
  623. this.numericUpDown4.TabIndex = 21;
  624. this.numericUpDown4.Value = new decimal(new int[] {
  625. 1,
  626. 0,
  627. 0,
  628. 0});
  629. this.numericUpDown4.ValueChanged += new System.EventHandler(this.numericUpDown4_ValueChanged);
  630. //
  631. // label5
  632. //
  633. this.label5.AutoSize = true;
  634. this.label5.Location = new System.Drawing.Point(6, 18);
  635. this.label5.Name = "label5";
  636. this.label5.Size = new System.Drawing.Size(41, 12);
  637. this.label5.TabIndex = 0;
  638. //
  639. // comboBox2
  640. //
  641. this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  642. this.comboBox2.FormattingEnabled = true;
  643. this.comboBox2.Items.AddRange(new object[] {
  644. "",
  645. ""});
  646. this.comboBox2.Location = new System.Drawing.Point(55, 49);
  647. this.comboBox2.Name = "comboBox2";
  648. this.comboBox2.Size = new System.Drawing.Size(241, 20);
  649. this.comboBox2.TabIndex = 26;
  650. this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged);
  651. //
  652. // panel6
  653. //
  654. this.panel6.Controls.Add(this.numericUpDown6);
  655. this.panel6.Controls.Add(this.label8);
  656. this.panel6.Controls.Add(this.numericUpDown5);
  657. this.panel6.Controls.Add(this.label6);
  658. this.panel6.Location = new System.Drawing.Point(21, 75);
  659. this.panel6.Name = "panel6";
  660. this.panel6.Size = new System.Drawing.Size(272, 107);
  661. this.panel6.TabIndex = 25;
  662. //
  663. // numericUpDown6
  664. //
  665. this.numericUpDown6.Location = new System.Drawing.Point(172, 13);
  666. this.numericUpDown6.Maximum = new decimal(new int[] {
  667. 99999999,
  668. 0,
  669. 0,
  670. 0});
  671. this.numericUpDown6.Minimum = new decimal(new int[] {
  672. 1,
  673. 0,
  674. 0,
  675. 0});
  676. this.numericUpDown6.Name = "numericUpDown6";
  677. this.numericUpDown6.Size = new System.Drawing.Size(75, 21);
  678. this.numericUpDown6.TabIndex = 23;
  679. this.numericUpDown6.Value = new decimal(new int[] {
  680. 1,
  681. 0,
  682. 0,
  683. 0});
  684. this.numericUpDown6.ValueChanged += new System.EventHandler(this.numericUpDown6_ValueChanged);
  685. //
  686. // label8
  687. //
  688. this.label8.AutoSize = true;
  689. this.label8.Location = new System.Drawing.Point(135, 18);
  690. this.label8.Name = "label8";
  691. this.label8.Size = new System.Drawing.Size(41, 12);
  692. this.label8.TabIndex = 22;
  693. //
  694. // numericUpDown5
  695. //
  696. this.numericUpDown5.Location = new System.Drawing.Point(65, 13);
  697. this.numericUpDown5.Maximum = new decimal(new int[] {
  698. 99999999,
  699. 0,
  700. 0,
  701. 0});
  702. this.numericUpDown5.Minimum = new decimal(new int[] {
  703. 1,
  704. 0,
  705. 0,
  706. 0});
  707. this.numericUpDown5.Name = "numericUpDown5";
  708. this.numericUpDown5.Size = new System.Drawing.Size(69, 21);
  709. this.numericUpDown5.TabIndex = 21;
  710. this.numericUpDown5.Value = new decimal(new int[] {
  711. 1,
  712. 0,
  713. 0,
  714. 0});
  715. this.numericUpDown5.ValueChanged += new System.EventHandler(this.numericUpDown5_ValueChanged);
  716. //
  717. // label6
  718. //
  719. this.label6.AutoSize = true;
  720. this.label6.Location = new System.Drawing.Point(6, 18);
  721. this.label6.Name = "label6";
  722. this.label6.Size = new System.Drawing.Size(65, 12);
  723. this.label6.TabIndex = 0;
  724. //
  725. // panel8
  726. //
  727. this.panel8.Controls.Add(this.numericUpDown15);
  728. this.panel8.Controls.Add(this.label17);
  729. this.panel8.Controls.Add(this.numericUpDown16);
  730. this.panel8.Controls.Add(this.label18);
  731. this.panel8.Location = new System.Drawing.Point(21, 75);
  732. this.panel8.Name = "panel8";
  733. this.panel8.Size = new System.Drawing.Size(272, 107);
  734. this.panel8.TabIndex = 27;
  735. //
  736. // numericUpDown15
  737. //
  738. this.numericUpDown15.Location = new System.Drawing.Point(181, 13);
  739. this.numericUpDown15.Maximum = new decimal(new int[] {
  740. 99999999,
  741. 0,
  742. 0,
  743. 0});
  744. this.numericUpDown15.Minimum = new decimal(new int[] {
  745. 1,
  746. 0,
  747. 0,
  748. 0});
  749. this.numericUpDown15.Name = "numericUpDown15";
  750. this.numericUpDown15.Size = new System.Drawing.Size(82, 21);
  751. this.numericUpDown15.TabIndex = 23;
  752. this.numericUpDown15.Value = new decimal(new int[] {
  753. 1,
  754. 0,
  755. 0,
  756. 0});
  757. this.numericUpDown15.ValueChanged += new System.EventHandler(this.numericUpDown15_ValueChanged);
  758. //
  759. // label17
  760. //
  761. this.label17.AutoSize = true;
  762. this.label17.Location = new System.Drawing.Point(135, 18);
  763. this.label17.Name = "label17";
  764. this.label17.Size = new System.Drawing.Size(53, 12);
  765. this.label17.TabIndex = 22;
  766. //
  767. // numericUpDown16
  768. //
  769. this.numericUpDown16.Location = new System.Drawing.Point(52, 13);
  770. this.numericUpDown16.Maximum = new decimal(new int[] {
  771. 99999999,
  772. 0,
  773. 0,
  774. 0});
  775. this.numericUpDown16.Minimum = new decimal(new int[] {
  776. 1,
  777. 0,
  778. 0,
  779. 0});
  780. this.numericUpDown16.Name = "numericUpDown16";
  781. this.numericUpDown16.Size = new System.Drawing.Size(82, 21);
  782. this.numericUpDown16.TabIndex = 21;
  783. this.numericUpDown16.Value = new decimal(new int[] {
  784. 1,
  785. 0,
  786. 0,
  787. 0});
  788. this.numericUpDown16.ValueChanged += new System.EventHandler(this.numericUpDown16_ValueChanged);
  789. //
  790. // label18
  791. //
  792. this.label18.AutoSize = true;
  793. this.label18.Location = new System.Drawing.Point(6, 18);
  794. this.label18.Name = "label18";
  795. this.label18.Size = new System.Drawing.Size(53, 12);
  796. this.label18.TabIndex = 0;
  797. //
  798. // numericUpDown2
  799. //
  800. this.numericUpDown2.Location = new System.Drawing.Point(197, 235);
  801. this.numericUpDown2.Maximum = new decimal(new int[] {
  802. 99999999,
  803. 0,
  804. 0,
  805. 0});
  806. this.numericUpDown2.Minimum = new decimal(new int[] {
  807. 1,
  808. 0,
  809. 0,
  810. 0});
  811. this.numericUpDown2.Name = "numericUpDown2";
  812. this.numericUpDown2.Size = new System.Drawing.Size(82, 21);
  813. this.numericUpDown2.TabIndex = 14;
  814. this.numericUpDown2.Value = new decimal(new int[] {
  815. 1,
  816. 0,
  817. 0,
  818. 0});
  819. this.numericUpDown2.ValueChanged += new System.EventHandler(this.numericUpDown2_ValueChanged);
  820. //
  821. // panel3
  822. //
  823. this.panel3.Controls.Add(this.numericUpDown20);
  824. this.panel3.Controls.Add(this.label22);
  825. this.panel3.Controls.Add(this.numericUpDown21);
  826. this.panel3.Controls.Add(this.label23);
  827. this.panel3.Controls.Add(this.numericUpDown1);
  828. this.panel3.Controls.Add(this.label1);
  829. this.panel3.Location = new System.Drawing.Point(21, 75);
  830. this.panel3.Name = "panel3";
  831. this.panel3.Size = new System.Drawing.Size(272, 107);
  832. this.panel3.TabIndex = 22;
  833. //
  834. // numericUpDown20
  835. //
  836. this.numericUpDown20.Location = new System.Drawing.Point(58, 42);
  837. this.numericUpDown20.Maximum = new decimal(new int[] {
  838. 99999999,
  839. 0,
  840. 0,
  841. 0});
  842. this.numericUpDown20.Minimum = new decimal(new int[] {
  843. 1,
  844. 0,
  845. 0,
  846. 0});
  847. this.numericUpDown20.Name = "numericUpDown20";
  848. this.numericUpDown20.Size = new System.Drawing.Size(82, 21);
  849. this.numericUpDown20.TabIndex = 29;
  850. this.numericUpDown20.Value = new decimal(new int[] {
  851. 1,
  852. 0,
  853. 0,
  854. 0});
  855. this.numericUpDown20.ValueChanged += new System.EventHandler(this.numericUpDown20_ValueChanged);
  856. //
  857. // label22
  858. //
  859. this.label22.AutoSize = true;
  860. this.label22.Location = new System.Drawing.Point(7, 47);
  861. this.label22.Name = "label22";
  862. this.label22.Size = new System.Drawing.Size(53, 12);
  863. this.label22.TabIndex = 28;
  864. //
  865. // numericUpDown21
  866. //
  867. this.numericUpDown21.Location = new System.Drawing.Point(183, 14);
  868. this.numericUpDown21.Maximum = new decimal(new int[] {
  869. 99999999,
  870. 0,
  871. 0,
  872. 0});
  873. this.numericUpDown21.Minimum = new decimal(new int[] {
  874. 1,
  875. 0,
  876. 0,
  877. 0});
  878. this.numericUpDown21.Name = "numericUpDown21";
  879. this.numericUpDown21.Size = new System.Drawing.Size(82, 21);
  880. this.numericUpDown21.TabIndex = 27;
  881. this.numericUpDown21.Value = new decimal(new int[] {
  882. 1,
  883. 0,
  884. 0,
  885. 0});
  886. this.numericUpDown21.ValueChanged += new System.EventHandler(this.numericUpDown21_ValueChanged);
  887. //
  888. // label23
  889. //
  890. this.label23.AutoSize = true;
  891. this.label23.Location = new System.Drawing.Point(140, 18);
  892. this.label23.Name = "label23";
  893. this.label23.Size = new System.Drawing.Size(41, 12);
  894. this.label23.TabIndex = 26;
  895. //
  896. // numericUpDown1
  897. //
  898. this.numericUpDown1.Location = new System.Drawing.Point(50, 14);
  899. this.numericUpDown1.Maximum = new decimal(new int[] {
  900. 9999999,
  901. 0,
  902. 0,
  903. 0});
  904. this.numericUpDown1.Minimum = new decimal(new int[] {
  905. 1,
  906. 0,
  907. 0,
  908. 0});
  909. this.numericUpDown1.Name = "numericUpDown1";
  910. this.numericUpDown1.Size = new System.Drawing.Size(82, 21);
  911. this.numericUpDown1.TabIndex = 21;
  912. this.numericUpDown1.Value = new decimal(new int[] {
  913. 1,
  914. 0,
  915. 0,
  916. 0});
  917. this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
  918. //
  919. // label1
  920. //
  921. this.label1.AutoSize = true;
  922. this.label1.Location = new System.Drawing.Point(6, 18);
  923. this.label1.Name = "label1";
  924. this.label1.Size = new System.Drawing.Size(41, 12);
  925. this.label1.TabIndex = 0;
  926. //
  927. // label3
  928. //
  929. this.label3.AutoSize = true;
  930. this.label3.Location = new System.Drawing.Point(154, 240);
  931. this.label3.Name = "label3";
  932. this.label3.Size = new System.Drawing.Size(41, 12);
  933. this.label3.TabIndex = 2;
  934. //
  935. // comboBox1
  936. //
  937. this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  938. this.comboBox1.FormattingEnabled = true;
  939. this.comboBox1.Location = new System.Drawing.Point(55, 49);
  940. this.comboBox1.Name = "comboBox1";
  941. this.comboBox1.Size = new System.Drawing.Size(241, 20);
  942. this.comboBox1.TabIndex = 20;
  943. this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged_1);
  944. //
  945. // textBox1
  946. //
  947. this.textBox1.Location = new System.Drawing.Point(55, 17);
  948. this.textBox1.Name = "textBox1";
  949. this.textBox1.Size = new System.Drawing.Size(241, 21);
  950. this.textBox1.TabIndex = 19;
  951. //
  952. // panel2
  953. //
  954. this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  955. this.panel2.Location = new System.Drawing.Point(63, 235);
  956. this.panel2.Name = "panel2";
  957. this.panel2.Size = new System.Drawing.Size(81, 21);
  958. this.panel2.TabIndex = 12;
  959. this.panel2.BackColorChanged += new System.EventHandler(this.panel2_BackColorChanged);
  960. this.panel2.Click += new System.EventHandler(this.panel2_Click);
  961. //
  962. // panel7
  963. //
  964. this.panel7.Controls.Add(this.checkBox1);
  965. this.panel7.Controls.Add(this.numericUpDown14);
  966. this.panel7.Controls.Add(this.numericUpDown13);
  967. this.panel7.Controls.Add(this.label16);
  968. this.panel7.Controls.Add(this.label15);
  969. this.panel7.Controls.Add(this.numericUpDown11);
  970. this.panel7.Controls.Add(this.label13);
  971. this.panel7.Controls.Add(this.numericUpDown12);
  972. this.panel7.Controls.Add(this.label14);
  973. this.panel7.Controls.Add(this.numericUpDown10);
  974. this.panel7.Controls.Add(this.label12);
  975. this.panel7.Controls.Add(this.numericUpDown9);
  976. this.panel7.Controls.Add(this.label11);
  977. this.panel7.Controls.Add(this.numericUpDown7);
  978. this.panel7.Controls.Add(this.label9);
  979. this.panel7.Controls.Add(this.numericUpDown8);
  980. this.panel7.Controls.Add(this.label10);
  981. this.panel7.Location = new System.Drawing.Point(21, 75);
  982. this.panel7.Name = "panel7";
  983. this.panel7.Size = new System.Drawing.Size(272, 154);
  984. this.panel7.TabIndex = 26;
  985. //
  986. // checkBox1
  987. //
  988. this.checkBox1.AutoSize = true;
  989. this.checkBox1.Location = new System.Drawing.Point(191, 132);
  990. this.checkBox1.Name = "checkBox1";
  991. this.checkBox1.Size = new System.Drawing.Size(72, 16);
  992. this.checkBox1.TabIndex = 36;
  993. this.checkBox1.UseVisualStyleBackColor = true;
  994. //
  995. // numericUpDown14
  996. //
  997. this.numericUpDown14.Location = new System.Drawing.Point(101, 130);
  998. this.numericUpDown14.Maximum = new decimal(new int[] {
  999. 99999999,
  1000. 0,
  1001. 0,
  1002. 0});
  1003. this.numericUpDown14.Minimum = new decimal(new int[] {
  1004. 1,
  1005. 0,
  1006. 0,
  1007. 0});
  1008. this.numericUpDown14.Name = "numericUpDown14";
  1009. this.numericUpDown14.Size = new System.Drawing.Size(64, 21);
  1010. this.numericUpDown14.TabIndex = 35;
  1011. this.numericUpDown14.Value = new decimal(new int[] {
  1012. 1,
  1013. 0,
  1014. 0,
  1015. 0});
  1016. this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
  1017. //
  1018. // numericUpDown13
  1019. //
  1020. this.numericUpDown13.Location = new System.Drawing.Point(91, 107);
  1021. this.numericUpDown13.Maximum = new decimal(new int[] {
  1022. 99999999,
  1023. 0,
  1024. 0,
  1025. 0});
  1026. this.numericUpDown13.Minimum = new decimal(new int[] {
  1027. 1,
  1028. 0,
  1029. 0,
  1030. 0});
  1031. this.numericUpDown13.Name = "numericUpDown13";
  1032. this.numericUpDown13.Size = new System.Drawing.Size(63, 21);
  1033. this.numericUpDown13.TabIndex = 34;
  1034. this.numericUpDown13.Value = new decimal(new int[] {
  1035. 1,
  1036. 0,
  1037. 0,
  1038. 0});
  1039. this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
  1040. //
  1041. // label16
  1042. //
  1043. this.label16.AutoSize = true;
  1044. this.label16.Location = new System.Drawing.Point(6, 133);
  1045. this.label16.Name = "label16";
  1046. this.label16.Size = new System.Drawing.Size(101, 12);
  1047. this.label16.TabIndex = 33;
  1048. //
  1049. // label15
  1050. //
  1051. this.label15.AutoSize = true;
  1052. this.label15.Location = new System.Drawing.Point(6, 109);
  1053. this.label15.Name = "label15";
  1054. this.label15.Size = new System.Drawing.Size(89, 12);
  1055. this.label15.TabIndex = 32;
  1056. //
  1057. // numericUpDown11
  1058. //
  1059. this.numericUpDown11.Location = new System.Drawing.Point(129, 83);
  1060. this.numericUpDown11.Maximum = new decimal(new int[] {
  1061. 99999999,
  1062. 0,
  1063. 0,
  1064. 0});
  1065. this.numericUpDown11.Minimum = new decimal(new int[] {
  1066. 1,
  1067. 0,
  1068. 0,
  1069. 0});
  1070. this.numericUpDown11.Name = "numericUpDown11";
  1071. this.numericUpDown11.Size = new System.Drawing.Size(63, 21);
  1072. this.numericUpDown11.TabIndex = 31;
  1073. this.numericUpDown11.Value = new decimal(new int[] {
  1074. 1,
  1075. 0,
  1076. 0,
  1077. 0});
  1078. this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
  1079. //
  1080. // label13
  1081. //
  1082. this.label13.AutoSize = true;
  1083. this.label13.Location = new System.Drawing.Point(6, 86);
  1084. this.label13.Name = "label13";
  1085. this.label13.Size = new System.Drawing.Size(125, 12);
  1086. this.label13.TabIndex = 30;
  1087. //
  1088. // numericUpDown12
  1089. //
  1090. this.numericUpDown12.Location = new System.Drawing.Point(129, 57);
  1091. this.numericUpDown12.Maximum = new decimal(new int[] {
  1092. 99999999,
  1093. 0,
  1094. 0,
  1095. 0});
  1096. this.numericUpDown12.Minimum = new decimal(new int[] {
  1097. 1,
  1098. 0,
  1099. 0,
  1100. 0});
  1101. this.numericUpDown12.Name = "numericUpDown12";
  1102. this.numericUpDown12.Size = new System.Drawing.Size(63, 21);
  1103. this.numericUpDown12.TabIndex = 29;
  1104. this.numericUpDown12.Value = new decimal(new int[] {
  1105. 1,
  1106. 0,
  1107. 0,
  1108. 0});
  1109. this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
  1110. //
  1111. // label14
  1112. //
  1113. this.label14.AutoSize = true;
  1114. this.label14.Location = new System.Drawing.Point(6, 61);
  1115. this.label14.Name = "label14";
  1116. this.label14.Size = new System.Drawing.Size(125, 12);
  1117. this.label14.TabIndex = 28;
  1118. //
  1119. // numericUpDown10
  1120. //
  1121. this.numericUpDown10.Location = new System.Drawing.Point(200, 32);
  1122. this.numericUpDown10.Maximum = new decimal(new int[] {
  1123. 99999999,
  1124. 0,
  1125. 0,
  1126. 0});
  1127. this.numericUpDown10.Minimum = new decimal(new int[] {
  1128. 1,
  1129. 0,
  1130. 0,
  1131. 0});
  1132. this.numericUpDown10.Name = "numericUpDown10";
  1133. this.numericUpDown10.Size = new System.Drawing.Size(63, 21);
  1134. this.numericUpDown10.TabIndex = 27;
  1135. this.numericUpDown10.Value = new decimal(new int[] {
  1136. 1,
  1137. 0,
  1138. 0,
  1139. 0});
  1140. this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
  1141. //
  1142. // label12
  1143. //
  1144. this.label12.AutoSize = true;
  1145. this.label12.Location = new System.Drawing.Point(167, 36);
  1146. this.label12.Name = "label12";
  1147. this.label12.Size = new System.Drawing.Size(41, 12);
  1148. this.label12.TabIndex = 26;
  1149. //
  1150. // numericUpDown9
  1151. //
  1152. this.numericUpDown9.Location = new System.Drawing.Point(66, 32);
  1153. this.numericUpDown9.Maximum = new decimal(new int[] {
  1154. 99999999,
  1155. 0,
  1156. 0,
  1157. 0});
  1158. this.numericUpDown9.Minimum = new decimal(new int[] {
  1159. 1,
  1160. 0,
  1161. 0,
  1162. 0});
  1163. this.numericUpDown9.Name = "numericUpDown9";
  1164. this.numericUpDown9.Size = new System.Drawing.Size(65, 21);
  1165. this.numericUpDown9.TabIndex = 25;
  1166. this.numericUpDown9.Value = new decimal(new int[] {
  1167. 1,
  1168. 0,
  1169. 0,
  1170. 0});
  1171. this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
  1172. //
  1173. // label11
  1174. //
  1175. this.label11.AutoSize = true;
  1176. this.label11.Location = new System.Drawing.Point(6, 36);
  1177. this.label11.Name = "label11";
  1178. this.label11.Size = new System.Drawing.Size(65, 12);
  1179. this.label11.TabIndex = 24;
  1180. //
  1181. // numericUpDown7
  1182. //
  1183. this.numericUpDown7.Location = new System.Drawing.Point(200, 6);
  1184. this.numericUpDown7.Maximum = new decimal(new int[] {
  1185. 99999999,
  1186. 0,
  1187. 0,
  1188. 0});
  1189. this.numericUpDown7.Minimum = new decimal(new int[] {
  1190. 1,
  1191. 0,
  1192. 0,
  1193. 0});
  1194. this.numericUpDown7.Name = "numericUpDown7";
  1195. this.numericUpDown7.Size = new System.Drawing.Size(63, 21);
  1196. this.numericUpDown7.TabIndex = 23;
  1197. this.numericUpDown7.Value = new decimal(new int[] {
  1198. 1,
  1199. 0,
  1200. 0,
  1201. 0});
  1202. this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
  1203. //
  1204. // label9
  1205. //
  1206. this.label9.AutoSize = true;
  1207. this.label9.Location = new System.Drawing.Point(131, 11);
  1208. this.label9.Name = "label9";
  1209. this.label9.Size = new System.Drawing.Size(77, 12);
  1210. this.label9.TabIndex = 22;
  1211. //
  1212. // numericUpDown8
  1213. //
  1214. this.numericUpDown8.Location = new System.Drawing.Point(66, 6);
  1215. this.numericUpDown8.Maximum = new decimal(new int[] {
  1216. 99999999,
  1217. 0,
  1218. 0,
  1219. 0});
  1220. this.numericUpDown8.Minimum = new decimal(new int[] {
  1221. 1,
  1222. 0,
  1223. 0,
  1224. 0});
  1225. this.numericUpDown8.Name = "numericUpDown8";
  1226. this.numericUpDown8.Size = new System.Drawing.Size(63, 21);
  1227. this.numericUpDown8.TabIndex = 21;
  1228. this.numericUpDown8.Value = new decimal(new int[] {
  1229. 1,
  1230. 0,
  1231. 0,
  1232. 0});
  1233. this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
  1234. //
  1235. // label10
  1236. //
  1237. this.label10.AutoSize = true;
  1238. this.label10.Location = new System.Drawing.Point(6, 11);
  1239. this.label10.Name = "label10";
  1240. this.label10.Size = new System.Drawing.Size(65, 12);
  1241. this.label10.TabIndex = 0;
  1242. //
  1243. // label7
  1244. //
  1245. this.label7.AutoSize = true;
  1246. this.label7.Location = new System.Drawing.Point(19, 23);
  1247. this.label7.Name = "label7";
  1248. this.label7.Size = new System.Drawing.Size(41, 12);
  1249. this.label7.TabIndex = 18;
  1250. //
  1251. // label2
  1252. //
  1253. this.label2.AutoSize = true;
  1254. this.label2.Location = new System.Drawing.Point(19, 240);
  1255. this.label2.Name = "label2";
  1256. this.label2.Size = new System.Drawing.Size(41, 12);
  1257. this.label2.TabIndex = 1;
  1258. //
  1259. // label24
  1260. //
  1261. this.label24.AutoSize = true;
  1262. this.label24.Location = new System.Drawing.Point(19, 52);
  1263. this.label24.Name = "label24";
  1264. this.label24.Size = new System.Drawing.Size(41, 12);
  1265. this.label24.TabIndex = 29;
  1266. //
  1267. // groupBox3
  1268. //
  1269. this.groupBox3.Controls.Add(this.panel1);
  1270. this.groupBox3.Location = new System.Drawing.Point(193, 338);
  1271. this.groupBox3.Name = "groupBox3";
  1272. this.groupBox3.Size = new System.Drawing.Size(319, 213);
  1273. this.groupBox3.TabIndex = 1;
  1274. this.groupBox3.TabStop = false;
  1275. //
  1276. // panel1
  1277. //
  1278. this.panel1.Location = new System.Drawing.Point(6, 17);
  1279. this.panel1.Name = "panel1";
  1280. this.panel1.Size = new System.Drawing.Size(307, 190);
  1281. this.panel1.TabIndex = 0;
  1282. this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
  1283. //
  1284. // groupBox4
  1285. //
  1286. this.groupBox4.Controls.Add(this.dataGridView1);
  1287. this.groupBox4.Controls.Add(this.button5);
  1288. this.groupBox4.Controls.Add(this.button4);
  1289. this.groupBox4.Controls.Add(this.button3);
  1290. this.groupBox4.Location = new System.Drawing.Point(12, 72);
  1291. this.groupBox4.Name = "groupBox4";
  1292. this.groupBox4.Size = new System.Drawing.Size(175, 473);
  1293. this.groupBox4.TabIndex = 2;
  1294. this.groupBox4.TabStop = false;
  1295. //
  1296. // dataGridView1
  1297. //
  1298. this.dataGridView1.AllowUserToAddRows = false;
  1299. this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
  1300. this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control;
  1301. this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
  1302. this.dataGridView1.ColumnHeadersVisible = false;
  1303. this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
  1304. this.GuideName,
  1305. this.Column1,
  1306. this.GrainType});
  1307. this.dataGridView1.Location = new System.Drawing.Point(6, 53);
  1308. this.dataGridView1.MultiSelect = false;
  1309. this.dataGridView1.Name = "dataGridView1";
  1310. this.dataGridView1.RowHeadersVisible = false;
  1311. this.dataGridView1.RowTemplate.Height = 23;
  1312. this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
  1313. this.dataGridView1.Size = new System.Drawing.Size(162, 414);
  1314. this.dataGridView1.TabIndex = 4;
  1315. this.dataGridView1.SelectionChanged += new System.EventHandler(this.dataGridView1_SelectionChanged);
  1316. //
  1317. // GuideName
  1318. //
  1319. this.GuideName.HeaderText = "";
  1320. this.GuideName.Name = "GuideName";
  1321. //
  1322. // Column1
  1323. //
  1324. this.Column1.HeaderText = "Column1";
  1325. this.Column1.Name = "Column1";
  1326. this.Column1.Visible = false;
  1327. //
  1328. // GrainType
  1329. //
  1330. this.GrainType.HeaderText = "Column1";
  1331. this.GrainType.Name = "GrainType";
  1332. this.GrainType.Visible = false;
  1333. //
  1334. // button5
  1335. //
  1336. this.button5.Location = new System.Drawing.Point(138, 18);
  1337. this.button5.Name = "button5";
  1338. this.button5.Size = new System.Drawing.Size(30, 25);
  1339. this.button5.TabIndex = 3;
  1340. this.button5.UseVisualStyleBackColor = true;
  1341. this.button5.Click += new System.EventHandler(this.button5_Click);
  1342. //
  1343. // button4
  1344. //
  1345. this.button4.Location = new System.Drawing.Point(104, 18);
  1346. this.button4.Name = "button4";
  1347. this.button4.Size = new System.Drawing.Size(30, 25);
  1348. this.button4.TabIndex = 2;
  1349. this.button4.UseVisualStyleBackColor = true;
  1350. this.button4.Click += new System.EventHandler(this.button4_Click);
  1351. //
  1352. // button3
  1353. //
  1354. this.button3.Location = new System.Drawing.Point(70, 18);
  1355. this.button3.Name = "button3";
  1356. this.button3.Size = new System.Drawing.Size(30, 25);
  1357. this.button3.TabIndex = 1;
  1358. this.button3.UseVisualStyleBackColor = true;
  1359. this.button3.Click += new System.EventHandler(this.button3_Click);
  1360. //
  1361. // GrainGuideSettingsDialog
  1362. //
  1363. this.ClientSize = new System.Drawing.Size(521, 553);
  1364. this.Controls.Add(this.groupBox4);
  1365. this.Controls.Add(this.groupBox3);
  1366. this.Controls.Add(this.groupBox2);
  1367. this.Controls.Add(this.groupBox1);
  1368. this.MaximizeBox = false;
  1369. this.MaximumSize = new System.Drawing.Size(537, 592);
  1370. this.MinimizeBox = false;
  1371. this.MinimumSize = new System.Drawing.Size(537, 592);
  1372. this.Name = "GrainGuideSettingsDialog";
  1373. this.ShowInTaskbar = false;
  1374. this.Load += new System.EventHandler(this.GrainGuideSettingsDialog_Load);
  1375. this.groupBox1.ResumeLayout(false);
  1376. this.groupBox2.ResumeLayout(false);
  1377. this.groupBox2.PerformLayout();
  1378. this.panel4.ResumeLayout(false);
  1379. this.panel4.PerformLayout();
  1380. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown19)).EndInit();
  1381. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown17)).EndInit();
  1382. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
  1383. this.panel9.ResumeLayout(false);
  1384. this.panel9.PerformLayout();
  1385. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown18)).EndInit();
  1386. this.panel5.ResumeLayout(false);
  1387. this.panel5.PerformLayout();
  1388. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();
  1389. this.panel6.ResumeLayout(false);
  1390. this.panel6.PerformLayout();
  1391. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).EndInit();
  1392. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).EndInit();
  1393. this.panel8.ResumeLayout(false);
  1394. this.panel8.PerformLayout();
  1395. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown15)).EndInit();
  1396. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown16)).EndInit();
  1397. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
  1398. this.panel3.ResumeLayout(false);
  1399. this.panel3.PerformLayout();
  1400. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown20)).EndInit();
  1401. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown21)).EndInit();
  1402. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
  1403. this.panel7.ResumeLayout(false);
  1404. this.panel7.PerformLayout();
  1405. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown14)).EndInit();
  1406. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown13)).EndInit();
  1407. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown11)).EndInit();
  1408. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown12)).EndInit();
  1409. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown10)).EndInit();
  1410. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown9)).EndInit();
  1411. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown7)).EndInit();
  1412. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown8)).EndInit();
  1413. this.groupBox3.ResumeLayout(false);
  1414. this.groupBox4.ResumeLayout(false);
  1415. ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
  1416. this.ResumeLayout(false);
  1417. }
  1418. #endregion
  1419. private void InitializeToolTip()
  1420. {
  1421. this.toolTip1 = new ToolTip();
  1422. this.toolTip1.SetToolTip(this.button3, PdnResources.GetString("Menu.Addto.text"));
  1423. this.toolTip1.SetToolTip(this.button4, PdnResources.GetString("Menu.Edit.Text"));
  1424. this.toolTip1.SetToolTip(this.button5, PdnResources.GetString("Menu.Edit.Delete.Text"));
  1425. this.toolTip1.ShowAlways = true;
  1426. }
  1427. private void InitializeButtonBackgroudImage()
  1428. {
  1429. this.button3.FlatStyle = FlatStyle.Flat;
  1430. this.button3.FlatAppearance.BorderSize = 0;
  1431. this.button3.BackgroundImageLayout = ImageLayout.Center;
  1432. this.button3.BackgroundImage = PdnResources.GetImageResource("Icons.MenuRulesListAddIcon.png").Reference;
  1433. this.button4.FlatStyle = FlatStyle.Flat;
  1434. this.button4.FlatAppearance.BorderSize = 0;
  1435. this.button4.BackgroundImageLayout = ImageLayout.Center;
  1436. this.button4.BackgroundImage = PdnResources.GetImageResource("Icons.MenuRulesListEditIcon.png").Reference;
  1437. this.button5.FlatStyle = FlatStyle.Flat;
  1438. this.button5.FlatAppearance.BorderSize = 0;
  1439. this.button5.BackgroundImageLayout = ImageLayout.Center;
  1440. this.button5.BackgroundImage = PdnResources.GetImageResource("Icons.MenuRulesListDeleteIcon.png").Reference;
  1441. }
  1442. /// <summary>
  1443. /// 初始化数据
  1444. /// </summary>
  1445. private void InitializeData()
  1446. {
  1447. if (this.comboBox1.Items.Count > 0)
  1448. this.comboBox1.SelectedIndex = 0;
  1449. this.comboBox2.SelectedIndex = 0;
  1450. if(this.picture == 0)
  1451. {
  1452. this.comboBox1.Visible = true;
  1453. this.comboBox2.Visible = false;
  1454. }
  1455. else if (this.picture == 1)
  1456. {
  1457. this.comboBox1.Visible = false;
  1458. this.comboBox2.Visible = true;
  1459. }
  1460. this.groupBox2.Enabled = false;
  1461. this.dataGridView1.ReadOnly = true;
  1462. this.numericUpDown15.Maximum = 999999;
  1463. this.numericUpDown15.Minimum = 1;
  1464. this.numericUpDown16.Maximum = 999999;
  1465. this.numericUpDown16.Minimum = 1;
  1466. if (this.picture == 0)
  1467. {
  1468. GrainSizeGuideStyleModel grainSizeGuideStyleModel = XmlSerializeHelper.DESerializer<GrainSizeGuideStyleModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\" + this.xmlModelName, FileMode.Open));
  1469. // 垂直辅助线
  1470. if (grainSizeGuideStyleModel.vGuideStyles != null)//###
  1471. {
  1472. foreach (var vGuideStyle in grainSizeGuideStyleModel.vGuideStyles)
  1473. {
  1474. index++;
  1475. DataGridViewRow row = new DataGridViewRow();
  1476. foreach (DataGridViewColumn c in this.dataGridView1.Columns)
  1477. {
  1478. row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  1479. }
  1480. row.Cells[0].Value = vGuideStyle.tag;
  1481. row.Cells[1].Value = PdnResources.GetString("Menu.Verticalauxiliaryline.text");
  1482. row.Cells[2].Value = vGuideStyle.index;
  1483. this.dataGridView1.Rows.Add(row);
  1484. ArrayList arrayList = new ArrayList();
  1485. arrayList.Add(vGuideStyle.tag);
  1486. arrayList.Add(PdnResources.GetString("Menu.Verticalauxiliaryline.text"));
  1487. arrayList.Add(vGuideStyle.lineLength);
  1488. arrayList.Add(vGuideStyle.lineSpacing);
  1489. arrayList.Add(vGuideStyle.lineDec);
  1490. arrayList.Add(vGuideStyle.lineColor);
  1491. arrayList.Add(vGuideStyle.lineWidth);
  1492. arrayList.Add(vGuideStyle.index);
  1493. this.arrayLists.Add(arrayList);
  1494. }
  1495. }
  1496. // 水平辅助线
  1497. if (grainSizeGuideStyleModel.hGuideStyles != null)
  1498. {
  1499. foreach (var hGuideStyle in grainSizeGuideStyleModel.hGuideStyles)
  1500. {
  1501. index++;
  1502. DataGridViewRow row = new DataGridViewRow();
  1503. foreach (DataGridViewColumn c in this.dataGridView1.Columns)
  1504. {
  1505. row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  1506. }
  1507. row.Cells[0].Value = hGuideStyle.tag;
  1508. row.Cells[1].Value = PdnResources.GetString("Menu.Horizontalauxiliaryline.text");
  1509. row.Cells[2].Value = hGuideStyle.index;
  1510. this.dataGridView1.Rows.Add(row);
  1511. ArrayList arrayList = new ArrayList();
  1512. arrayList.Add(hGuideStyle.tag);
  1513. arrayList.Add(PdnResources.GetString("Menu.Horizontalauxiliaryline.text"));
  1514. arrayList.Add(hGuideStyle.lineLength);
  1515. arrayList.Add(hGuideStyle.lineSpacing);
  1516. arrayList.Add(hGuideStyle.lineDec);
  1517. arrayList.Add(hGuideStyle.lineColor);
  1518. arrayList.Add(hGuideStyle.lineWidth);
  1519. arrayList.Add(hGuideStyle.index);
  1520. this.arrayLists.Add(arrayList);
  1521. }
  1522. }
  1523. // 单圆辅助线
  1524. if (grainSizeGuideStyleModel.cGuideStyles != null/* && this.gbtType != 1*/)//###
  1525. {
  1526. foreach (var cGuideStyle in grainSizeGuideStyleModel.cGuideStyles)
  1527. {
  1528. index++;
  1529. DataGridViewRow row = new DataGridViewRow();
  1530. foreach (DataGridViewColumn c in this.dataGridView1.Columns)
  1531. {
  1532. row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  1533. }
  1534. row.Cells[0].Value = cGuideStyle.tag;
  1535. row.Cells[1].Value = PdnResources.GetString("Menu.Singlecircleauxiliaryline.text");
  1536. row.Cells[2].Value = cGuideStyle.index;
  1537. this.dataGridView1.Rows.Add(row);
  1538. ArrayList arrayList = new ArrayList();
  1539. arrayList.Add(cGuideStyle.tag);
  1540. arrayList.Add(PdnResources.GetString("Menu.Singlecircleauxiliaryline.text"));
  1541. arrayList.Add(cGuideStyle.diameter);
  1542. arrayList.Add(cGuideStyle.lineColor);
  1543. arrayList.Add(cGuideStyle.lineWidth);
  1544. arrayList.Add(cGuideStyle.index);
  1545. this.arrayLists.Add(arrayList);
  1546. }
  1547. }
  1548. // 三圆辅助线
  1549. if (grainSizeGuideStyleModel.tCGuideStyles != null)
  1550. {
  1551. foreach (var tCGuideStyle in grainSizeGuideStyleModel.tCGuideStyles)
  1552. {
  1553. index++;
  1554. DataGridViewRow row = new DataGridViewRow();
  1555. foreach (DataGridViewColumn c in this.dataGridView1.Columns)
  1556. {
  1557. row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  1558. }
  1559. row.Cells[0].Value = tCGuideStyle.tag;
  1560. row.Cells[1].Value = PdnResources.GetString("Menu.Three-circleauxiliaryline.text");
  1561. row.Cells[2].Value = tCGuideStyle.index;
  1562. this.dataGridView1.Rows.Add(row);
  1563. ArrayList arrayList = new ArrayList();
  1564. arrayList.Add(tCGuideStyle.tag);
  1565. arrayList.Add(PdnResources.GetString("Menu.Three-circleauxiliaryline.text"));
  1566. arrayList.Add(tCGuideStyle.diameter);
  1567. arrayList.Add(tCGuideStyle.margin);
  1568. arrayList.Add(tCGuideStyle.lineColor);
  1569. arrayList.Add(tCGuideStyle.lineWidth);
  1570. arrayList.Add(tCGuideStyle.index);
  1571. this.arrayLists.Add(arrayList);
  1572. }
  1573. }
  1574. // 复合辅助线
  1575. if (grainSizeGuideStyleModel.rGuideStyles != null/* && this.gbtType != 1 && this.gbtType != 13*/)//###
  1576. {
  1577. foreach (var rGuideStyle in grainSizeGuideStyleModel.rGuideStyles)
  1578. {
  1579. index++;
  1580. DataGridViewRow row = new DataGridViewRow();
  1581. foreach (DataGridViewColumn c in this.dataGridView1.Columns)
  1582. {
  1583. row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  1584. }
  1585. row.Cells[0].Value = rGuideStyle.tag;
  1586. row.Cells[1].Value = PdnResources.GetString("Menu.Compositeauxiliaryline.text");
  1587. row.Cells[2].Value = rGuideStyle.index;
  1588. this.dataGridView1.Rows.Add(row);
  1589. ArrayList arrayList = new ArrayList();
  1590. arrayList.Add(rGuideStyle.tag);
  1591. arrayList.Add(PdnResources.GetString("Menu.Compositeauxiliaryline.text"));
  1592. arrayList.Add(rGuideStyle.vLineLength);
  1593. arrayList.Add(rGuideStyle.hLineLength);
  1594. arrayList.Add(rGuideStyle.diameter);
  1595. arrayList.Add(rGuideStyle.margin);
  1596. arrayList.Add(rGuideStyle.TopleftLineLength);
  1597. arrayList.Add(rGuideStyle.ToprightLineLength);
  1598. arrayList.Add(rGuideStyle.VLineToCDistance);
  1599. arrayList.Add(rGuideStyle.HLineToCDistance);
  1600. arrayList.Add(rGuideStyle.lineColor);
  1601. arrayList.Add(rGuideStyle.lineWidth);
  1602. arrayList.Add(rGuideStyle.index);
  1603. this.arrayLists.Add(arrayList);
  1604. }
  1605. }
  1606. }
  1607. else if(this.picture == 1)
  1608. {
  1609. GrainSizeGuideAreaMethodModel grainSizeGuideAreaMethodModel = XmlSerializeHelper.DESerializer<GrainSizeGuideAreaMethodModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\" + this.xmlModelName, FileMode.Open));
  1610. // 圆形
  1611. if (grainSizeGuideAreaMethodModel.circularGuideStyles != null)
  1612. {
  1613. foreach (var circularGuideStyle in grainSizeGuideAreaMethodModel.circularGuideStyles)
  1614. {
  1615. index++;
  1616. DataGridViewRow row = new DataGridViewRow();
  1617. foreach (DataGridViewColumn c in this.dataGridView1.Columns)
  1618. {
  1619. row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  1620. }
  1621. row.Cells[0].Value = circularGuideStyle.tag;
  1622. row.Cells[1].Value = PdnResources.GetString("Menu.circular.Text");
  1623. row.Cells[2].Value = circularGuideStyle.index;
  1624. this.dataGridView1.Rows.Add(row);
  1625. ArrayList arrayList = new ArrayList();
  1626. arrayList.Add(circularGuideStyle.tag);
  1627. arrayList.Add(PdnResources.GetString("Menu.circular.Text"));
  1628. arrayList.Add(circularGuideStyle.lineDiameter);
  1629. arrayList.Add(circularGuideStyle.lineColor);
  1630. arrayList.Add(circularGuideStyle.lineWidth);
  1631. arrayList.Add(circularGuideStyle.index);
  1632. this.arrayLists.Add(arrayList);
  1633. }
  1634. }
  1635. // 矩形
  1636. if (grainSizeGuideAreaMethodModel.rectangleGuideStyles != null)//###
  1637. {
  1638. foreach (var rectangleGuideStyle in grainSizeGuideAreaMethodModel.rectangleGuideStyles)
  1639. {
  1640. index++;
  1641. DataGridViewRow row = new DataGridViewRow();
  1642. foreach (DataGridViewColumn c in this.dataGridView1.Columns)
  1643. {
  1644. row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  1645. }
  1646. row.Cells[0].Value = rectangleGuideStyle.tag;
  1647. row.Cells[1].Value = PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text");
  1648. row.Cells[2].Value = rectangleGuideStyle.index;
  1649. this.dataGridView1.Rows.Add(row);
  1650. ArrayList arrayList = new ArrayList();
  1651. arrayList.Add(rectangleGuideStyle.tag);
  1652. arrayList.Add(PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text"));
  1653. arrayList.Add(rectangleGuideStyle.lineRectangleWidth);
  1654. arrayList.Add(rectangleGuideStyle.lineRectangleHeight);
  1655. arrayList.Add(rectangleGuideStyle.lineColor);
  1656. arrayList.Add(rectangleGuideStyle.lineWidth);
  1657. arrayList.Add(rectangleGuideStyle.index);
  1658. this.arrayLists.Add(arrayList);
  1659. }
  1660. }
  1661. }
  1662. dataGridView1.Sort(dataGridView1.Columns[2], ListSortDirection.Ascending);
  1663. }
  1664. /// <summary>
  1665. /// 保存到配置文件
  1666. /// </summary>
  1667. private void SaveXmlFile()
  1668. {
  1669. if (this.picture == 0)
  1670. {
  1671. GrainSizeGuideStyleModel grainSizeGuideStyleModel = new GrainSizeGuideStyleModel();
  1672. grainSizeGuideStyleModel.vGuideStyles = new List<GrainSizeGuideStyleModel.VGuideStyle>();
  1673. grainSizeGuideStyleModel.hGuideStyles = new List<GrainSizeGuideStyleModel.HGuideStyle>();
  1674. grainSizeGuideStyleModel.cGuideStyles = new List<GrainSizeGuideStyleModel.CGuideStyle>();
  1675. grainSizeGuideStyleModel.tCGuideStyles = new List<GrainSizeGuideStyleModel.TCGuideStyle>();
  1676. grainSizeGuideStyleModel.rGuideStyles = new List<GrainSizeGuideStyleModel.RGuideStyle>();
  1677. foreach (ArrayList arrayList1 in this.arrayLists)
  1678. {
  1679. if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(arrayList1[1]))
  1680. {
  1681. GrainSizeGuideStyleModel.VGuideStyle vGuideStyle = new GrainSizeGuideStyleModel.VGuideStyle();
  1682. vGuideStyle.tag = arrayList1[0].ToString();
  1683. vGuideStyle.lineLength = Convert.ToInt32(arrayList1[2]);
  1684. vGuideStyle.lineSpacing = Convert.ToInt32(arrayList1[3]);
  1685. vGuideStyle.lineDec = Convert.ToInt32(arrayList1[4]);
  1686. vGuideStyle.lineColor = Convert.ToInt32(arrayList1[5]);
  1687. vGuideStyle.lineWidth = Convert.ToInt32(arrayList1[6]);
  1688. vGuideStyle.index = Convert.ToInt32(arrayList1[7]);
  1689. grainSizeGuideStyleModel.vGuideStyles.Add(vGuideStyle);
  1690. }
  1691. else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(arrayList1[1]))
  1692. {
  1693. GrainSizeGuideStyleModel.HGuideStyle hGuideStyle = new GrainSizeGuideStyleModel.HGuideStyle();
  1694. hGuideStyle.tag = arrayList1[0].ToString();
  1695. hGuideStyle.lineLength = Convert.ToInt32(arrayList1[2]);
  1696. hGuideStyle.lineSpacing = Convert.ToInt32(arrayList1[3]);
  1697. hGuideStyle.lineDec = Convert.ToInt32(arrayList1[4]);
  1698. hGuideStyle.lineColor = Convert.ToInt32(arrayList1[5]);
  1699. hGuideStyle.lineWidth = Convert.ToInt32(arrayList1[6]);
  1700. hGuideStyle.index = Convert.ToInt32(arrayList1[7]);
  1701. grainSizeGuideStyleModel.hGuideStyles.Add(hGuideStyle);
  1702. }
  1703. else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(arrayList1[1]))
  1704. {
  1705. GrainSizeGuideStyleModel.CGuideStyle cGuideStyle = new GrainSizeGuideStyleModel.CGuideStyle();
  1706. cGuideStyle.tag = arrayList1[0].ToString();
  1707. cGuideStyle.diameter = Convert.ToInt32(arrayList1[2]);
  1708. cGuideStyle.lineColor = Convert.ToInt32(arrayList1[3]);
  1709. cGuideStyle.lineWidth = Convert.ToInt32(arrayList1[4]);
  1710. cGuideStyle.index = Convert.ToInt32(arrayList1[5]);
  1711. grainSizeGuideStyleModel.cGuideStyles.Add(cGuideStyle);
  1712. }
  1713. else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(arrayList1[1]))
  1714. {
  1715. GrainSizeGuideStyleModel.TCGuideStyle tCGuideStyle = new GrainSizeGuideStyleModel.TCGuideStyle();
  1716. tCGuideStyle.tag = arrayList1[0].ToString();
  1717. tCGuideStyle.diameter = Convert.ToInt32(arrayList1[2]);
  1718. tCGuideStyle.margin = Convert.ToInt32(arrayList1[3]);
  1719. tCGuideStyle.lineColor = Convert.ToInt32(arrayList1[4]);
  1720. tCGuideStyle.lineWidth = Convert.ToInt32(arrayList1[5]);
  1721. tCGuideStyle.index = Convert.ToInt32(arrayList1[6]);
  1722. grainSizeGuideStyleModel.tCGuideStyles.Add(tCGuideStyle);
  1723. }
  1724. else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(arrayList1[1]))
  1725. {
  1726. GrainSizeGuideStyleModel.RGuideStyle rGuideStyle = new GrainSizeGuideStyleModel.RGuideStyle();
  1727. rGuideStyle.tag = arrayList1[0].ToString();
  1728. rGuideStyle.vLineLength = Convert.ToInt32(arrayList1[2]);
  1729. rGuideStyle.hLineLength = Convert.ToInt32(arrayList1[3]);
  1730. rGuideStyle.diameter = Convert.ToInt32(arrayList1[4]);
  1731. rGuideStyle.margin = Convert.ToInt32(arrayList1[5]);
  1732. rGuideStyle.TopleftLineLength = Convert.ToInt32(arrayList1[6]);
  1733. rGuideStyle.ToprightLineLength = Convert.ToInt32(arrayList1[7]);
  1734. rGuideStyle.VLineToCDistance = Convert.ToInt32(arrayList1[8]);
  1735. rGuideStyle.HLineToCDistance = Convert.ToInt32(arrayList1[9]);
  1736. rGuideStyle.lineColor = Convert.ToInt32(arrayList1[10]);
  1737. rGuideStyle.lineWidth = Convert.ToInt32(arrayList1[11]);
  1738. rGuideStyle.index = Convert.ToInt32(arrayList1[12]);
  1739. grainSizeGuideStyleModel.rGuideStyles.Add(rGuideStyle);
  1740. }
  1741. }
  1742. //以下保存xml文件信息
  1743. string stageModelXml = XmlSerializeHelper.XmlSerialize<GrainSizeGuideStyleModel>(grainSizeGuideStyleModel);
  1744. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\" + this.xmlModelName;
  1745. FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create);
  1746. }
  1747. else if (this.picture == 1)
  1748. {
  1749. GrainSizeGuideAreaMethodModel grainSizeGuideAreaMethodModel = new GrainSizeGuideAreaMethodModel();
  1750. grainSizeGuideAreaMethodModel.circularGuideStyles = new List<GrainSizeGuideAreaMethodModel.circular>();
  1751. grainSizeGuideAreaMethodModel.rectangleGuideStyles = new List<GrainSizeGuideAreaMethodModel.rectangle>();
  1752. foreach (ArrayList arrayList1 in this.arrayLists)
  1753. {
  1754. if (PdnResources.GetString("Menu.circular.Text").Equals(arrayList1[1]))
  1755. {
  1756. GrainSizeGuideAreaMethodModel.circular circular = new GrainSizeGuideAreaMethodModel.circular();
  1757. circular.tag = arrayList1[0].ToString();
  1758. circular.lineDiameter = Convert.ToInt32(arrayList1[2]);
  1759. circular.lineColor = Convert.ToInt32(arrayList1[3]);
  1760. circular.lineWidth = Convert.ToInt32(arrayList1[4]);
  1761. circular.index = Convert.ToInt32(arrayList1[5]);
  1762. grainSizeGuideAreaMethodModel.circularGuideStyles.Add(circular);
  1763. }
  1764. else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(arrayList1[1]))
  1765. {
  1766. GrainSizeGuideAreaMethodModel.rectangle rectangle = new GrainSizeGuideAreaMethodModel.rectangle();
  1767. rectangle.tag = arrayList1[0].ToString();
  1768. rectangle.lineRectangleWidth = Convert.ToInt32(arrayList1[2]);
  1769. rectangle.lineRectangleHeight = Convert.ToInt32(arrayList1[3]);
  1770. rectangle.lineColor = Convert.ToInt32(arrayList1[4]);
  1771. rectangle.lineWidth = Convert.ToInt32(arrayList1[5]);
  1772. rectangle.index = Convert.ToInt32(arrayList1[6]);
  1773. grainSizeGuideAreaMethodModel.rectangleGuideStyles.Add(rectangle);
  1774. }
  1775. }
  1776. //以下保存xml文件信息
  1777. string stageModelXml = XmlSerializeHelper.XmlSerialize<GrainSizeGuideAreaMethodModel>(grainSizeGuideAreaMethodModel);
  1778. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\" + this.xmlModelName;
  1779. FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create);
  1780. }
  1781. }
  1782. /// <summary>
  1783. /// 页面关闭
  1784. /// </summary>
  1785. /// <param name="sender"></param>
  1786. /// <param name="e"></param>
  1787. private void button1_Click(object sender, EventArgs e)
  1788. {
  1789. this.Close();
  1790. }
  1791. private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
  1792. {
  1793. }
  1794. private void panel2_Click(object sender, EventArgs e)
  1795. {
  1796. this.colorsForm.UserPrimaryColor = ColorBgra.FromColor(this.panel2.BackColor);
  1797. this.colorsForm.setSaveBtn_Click(new System.EventHandler(this.panel2Changed));
  1798. this.colorsForm.ShowDialog();
  1799. }
  1800. private void panel2Changed(object sender, EventArgs e)
  1801. {
  1802. this.panel2.BackColor = this.colorsForm.UserPrimaryColor.ToColor();
  1803. this.colorsForm.Close();
  1804. }
  1805. private void InitGroupbox2()
  1806. {
  1807. this.textBox1.Clear();
  1808. if (this.comboBox1.Items.Count > 0)
  1809. this.comboBox1.SelectedIndex = 0;
  1810. this.comboBox2.SelectedIndex = 0;
  1811. this.numericUpDown1.Value = 1;
  1812. this.numericUpDown2.Value = 1;
  1813. this.numericUpDown3.Value = 1;
  1814. this.numericUpDown4.Value = 1;
  1815. this.numericUpDown5.Value = 1;
  1816. this.numericUpDown6.Value = 1;
  1817. this.numericUpDown7.Value = 1;
  1818. this.numericUpDown8.Value = 1;
  1819. this.numericUpDown9.Value = 1;
  1820. this.numericUpDown10.Value = 1;
  1821. this.numericUpDown11.Value = 1;
  1822. this.numericUpDown12.Value = 1;
  1823. this.numericUpDown13.Value = 1;
  1824. this.numericUpDown14.Value = 1;
  1825. this.numericUpDown15.Value = 1;
  1826. this.numericUpDown16.Value = 1;
  1827. this.numericUpDown18.Value = 1;
  1828. this.numericUpDown17.Value = 1;
  1829. this.numericUpDown19.Value = 1;
  1830. this.numericUpDown20.Value = 1;
  1831. this.numericUpDown21.Value = 1;
  1832. }
  1833. /// <summary>
  1834. /// 返回维护的辅助线
  1835. /// </summary>
  1836. /// <param name="currentOperation">操作区分(0 :添加 1 :编辑 2 :删除)</param>
  1837. private void ReturnGrainSize(int currentOperation = -1)
  1838. {
  1839. ArrayList arrayList = new ArrayList();
  1840. for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
  1841. {
  1842. arrayList.Add(this.dataGridView1.Rows[i].Cells[0].Value);
  1843. }
  1844. if (this.Owner is GrainSizeStandardDialog)
  1845. {
  1846. GrainSizeStandardDialog grainSizeMethodDialog = (GrainSizeStandardDialog)this.Owner;
  1847. if (currentOperation == 0)//#21794
  1848. grainSizeMethodDialog.AddComboboxValue(arrayList);
  1849. else
  1850. {
  1851. grainSizeMethodDialog.comboboxChange = false;
  1852. grainSizeMethodDialog.InitComboboxValue(arrayList);
  1853. }
  1854. }
  1855. //if (this.picture == 0)//###
  1856. //{
  1857. // ArrayList arrayList = new ArrayList();
  1858. // for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
  1859. // {
  1860. // arrayList.Add(this.dataGridView1.Rows[i].Cells[0].Value);
  1861. // }
  1862. // GrainSizeStandardDialog grainSizeMethodDialog = (GrainSizeStandardDialog)this.Owner;
  1863. // grainSizeMethodDialog.comboboxChange = false;
  1864. // grainSizeMethodDialog.InitComboboxValue(arrayList);
  1865. //}
  1866. //else if(this.picture == 1)
  1867. //{
  1868. // ArrayList arrayList = new ArrayList();
  1869. // for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
  1870. // {
  1871. // arrayList.Add(this.dataGridView1.Rows[i].Cells[0].Value);
  1872. // }
  1873. // GrainSizeStandardDialog grainSizeMethodDialog = (GrainSizeStandardDialog)this.Owner;
  1874. // grainSizeMethodDialog.comboboxChange = false;
  1875. // grainSizeMethodDialog.InitComboboxValue(arrayList);
  1876. //}
  1877. }
  1878. /// <summary>
  1879. /// 保存按钮
  1880. /// </summary>
  1881. /// <param name="sender"></param>
  1882. /// <param name="e"></param>
  1883. private void button2_Click(object sender, EventArgs e)
  1884. {
  1885. int currentOperation = this.operation;
  1886. if (this.picture == 0)
  1887. {
  1888. // 添加
  1889. if (this.operation == 0)
  1890. {
  1891. if (string.IsNullOrEmpty(this.textBox1.Text))
  1892. {
  1893. MessageBox.Show(PdnResources.GetString("Menu.namecannotbeEmpty.text")+"!");
  1894. }
  1895. else
  1896. {
  1897. bool next = true;
  1898. for (int r = 0; r < this.dataGridView1.Rows.Count; r++)
  1899. {
  1900. if (this.dataGridView1.Rows[r].Cells[0].Value.Equals(this.textBox1.Text))
  1901. {
  1902. MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
  1903. next = false;
  1904. break;
  1905. }
  1906. }
  1907. if (next)
  1908. {
  1909. index++;
  1910. ArrayList arrayList = new ArrayList();
  1911. if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  1912. {
  1913. arrayList.Add(this.textBox1.Text);
  1914. arrayList.Add(this.comboBox1.SelectedItem);
  1915. arrayList.Add(Convert.ToInt32(this.numericUpDown1.Value));
  1916. arrayList.Add(Convert.ToInt32(this.numericUpDown21.Value));
  1917. arrayList.Add(Convert.ToInt32(this.numericUpDown20.Value));
  1918. arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
  1919. arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
  1920. arrayList.Add(index);
  1921. }
  1922. else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  1923. {
  1924. arrayList.Add(this.textBox1.Text);
  1925. arrayList.Add(this.comboBox1.SelectedItem);
  1926. arrayList.Add(Convert.ToInt32(this.numericUpDown3.Value));
  1927. arrayList.Add(Convert.ToInt32(this.numericUpDown17.Value));
  1928. arrayList.Add(Convert.ToInt32(this.numericUpDown19.Value));
  1929. arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
  1930. arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
  1931. arrayList.Add(index);
  1932. }
  1933. else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  1934. {
  1935. arrayList.Add(this.textBox1.Text);
  1936. arrayList.Add(this.comboBox1.SelectedItem);
  1937. arrayList.Add(Convert.ToInt32(this.numericUpDown4.Value));
  1938. arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
  1939. arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
  1940. arrayList.Add(index);
  1941. }
  1942. else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  1943. {
  1944. arrayList.Add(this.textBox1.Text);
  1945. arrayList.Add(this.comboBox1.SelectedItem);
  1946. arrayList.Add(Convert.ToInt32(this.numericUpDown5.Value));
  1947. arrayList.Add(Convert.ToInt32(this.numericUpDown6.Value));
  1948. arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
  1949. arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
  1950. arrayList.Add(index);
  1951. }
  1952. else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  1953. {
  1954. arrayList.Add(this.textBox1.Text);
  1955. arrayList.Add(this.comboBox1.SelectedItem);
  1956. arrayList.Add(Convert.ToInt32(this.numericUpDown8.Value));
  1957. arrayList.Add(Convert.ToInt32(this.numericUpDown7.Value));
  1958. arrayList.Add(Convert.ToInt32(this.numericUpDown9.Value));
  1959. arrayList.Add(Convert.ToInt32(this.numericUpDown10.Value));
  1960. arrayList.Add(Convert.ToInt32(this.numericUpDown12.Value));
  1961. arrayList.Add(Convert.ToInt32(this.numericUpDown11.Value));
  1962. arrayList.Add(Convert.ToInt32(this.numericUpDown13.Value));
  1963. arrayList.Add(Convert.ToInt32(this.numericUpDown14.Value));
  1964. arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
  1965. arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
  1966. arrayList.Add(index);
  1967. }
  1968. this.arrayLists.Add(arrayList);
  1969. DataGridViewRow row = new DataGridViewRow();
  1970. foreach (DataGridViewColumn c in this.dataGridView1.Columns)
  1971. {
  1972. row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  1973. }
  1974. row.Cells[0].Value = this.textBox1.Text;
  1975. row.Cells[1].Value = this.comboBox1.SelectedItem;
  1976. this.dataGridView1.Rows.Add(row);
  1977. SaveXmlFile();
  1978. //MessageBox.Show(PdnResources.GetString("Menu.Addsuccessfully.text")+"!");//###20506
  1979. operation = -1;
  1980. this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Selected = true;
  1981. }
  1982. }
  1983. }
  1984. // 编辑
  1985. else if (this.operation == 1)
  1986. {
  1987. if (string.IsNullOrEmpty(this.textBox1.Text))
  1988. {
  1989. MessageBox.Show(PdnResources.GetString("Menu.namecannotbeEmpty.text")+"!");
  1990. }
  1991. else
  1992. {
  1993. bool next = true;
  1994. for (int r = 0; r < this.dataGridView1.Rows.Count; r++)
  1995. {
  1996. if (this.dataGridView1.Rows[r].Cells[0].Value.Equals(this.textBox1.Text) && this.dataGridView1.SelectedRows[0].Index != r)
  1997. {
  1998. MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
  1999. next = false;
  2000. break;
  2001. }
  2002. }
  2003. if (next)
  2004. {
  2005. int updIndex = 0;
  2006. foreach (var arrayList1 in this.arrayLists)
  2007. {
  2008. if (arrayList1[0].ToString().Equals(this.dataGridView1.SelectedRows[0].Cells[0].Value))
  2009. {
  2010. updIndex = Convert.ToInt32(arrayList1[arrayList1.Count - 1]);
  2011. this.arrayLists.Remove(arrayList1);
  2012. break;
  2013. }
  2014. }
  2015. ArrayList arrayList = new ArrayList();
  2016. if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2017. {
  2018. arrayList.Add(this.textBox1.Text);
  2019. arrayList.Add(this.comboBox1.SelectedItem);
  2020. arrayList.Add(Convert.ToInt32(this.numericUpDown1.Value));
  2021. arrayList.Add(Convert.ToInt32(this.numericUpDown21.Value));
  2022. arrayList.Add(Convert.ToInt32(this.numericUpDown20.Value));
  2023. arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
  2024. arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
  2025. arrayList.Add(updIndex);
  2026. }
  2027. else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2028. {
  2029. arrayList.Add(this.textBox1.Text);
  2030. arrayList.Add(this.comboBox1.SelectedItem);
  2031. arrayList.Add(Convert.ToInt32(this.numericUpDown3.Value));
  2032. arrayList.Add(Convert.ToInt32(this.numericUpDown17.Value));
  2033. arrayList.Add(Convert.ToInt32(this.numericUpDown19.Value));
  2034. arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
  2035. arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
  2036. arrayList.Add(updIndex);
  2037. }
  2038. else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2039. {
  2040. arrayList.Add(this.textBox1.Text);
  2041. arrayList.Add(this.comboBox1.SelectedItem);
  2042. arrayList.Add(Convert.ToInt32(this.numericUpDown4.Value));
  2043. arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
  2044. arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
  2045. arrayList.Add(updIndex);
  2046. }
  2047. else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2048. {
  2049. arrayList.Add(this.textBox1.Text);
  2050. arrayList.Add(this.comboBox1.SelectedItem);
  2051. arrayList.Add(Convert.ToInt32(this.numericUpDown5.Value));
  2052. arrayList.Add(Convert.ToInt32(this.numericUpDown6.Value));
  2053. arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
  2054. arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
  2055. arrayList.Add(updIndex);
  2056. }
  2057. else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2058. {
  2059. arrayList.Add(this.textBox1.Text);
  2060. arrayList.Add(this.comboBox1.SelectedItem);
  2061. arrayList.Add(Convert.ToInt32(this.numericUpDown8.Value));
  2062. arrayList.Add(Convert.ToInt32(this.numericUpDown7.Value));
  2063. arrayList.Add(Convert.ToInt32(this.numericUpDown9.Value));
  2064. arrayList.Add(Convert.ToInt32(this.numericUpDown10.Value));
  2065. arrayList.Add(Convert.ToInt32(this.numericUpDown12.Value));
  2066. arrayList.Add(Convert.ToInt32(this.numericUpDown11.Value));
  2067. arrayList.Add(Convert.ToInt32(this.numericUpDown13.Value));
  2068. arrayList.Add(Convert.ToInt32(this.numericUpDown14.Value));
  2069. arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
  2070. arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
  2071. arrayList.Add(updIndex);
  2072. }
  2073. this.arrayLists.Add(arrayList);
  2074. this.dataGridView1.SelectedRows[0].Cells[0].Value = this.textBox1.Text;
  2075. this.dataGridView1.SelectedRows[0].Cells[1].Value = this.comboBox1.SelectedItem;
  2076. SaveXmlFile();
  2077. //MessageBox.Show(PdnResources.GetString("Menu.Editsuccessfully.text")+"!");//###20506
  2078. operation = -1;
  2079. this.groupBox2.Enabled = false;
  2080. }
  2081. }
  2082. }
  2083. }
  2084. else if(this.picture == 1)
  2085. {
  2086. // 添加
  2087. if (this.operation == 0)
  2088. {
  2089. if (string.IsNullOrEmpty(this.textBox1.Text))
  2090. {
  2091. MessageBox.Show(PdnResources.GetString("Menu.namecannotbeEmpty.text")+"!");
  2092. }
  2093. else
  2094. {
  2095. bool next = true;
  2096. for (int r = 0; r < this.dataGridView1.Rows.Count; r++)
  2097. {
  2098. if (this.dataGridView1.Rows[r].Cells[0].Value.Equals(this.textBox1.Text))
  2099. {
  2100. MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
  2101. next = false;
  2102. break;
  2103. }
  2104. }
  2105. if (next)
  2106. {
  2107. index++;
  2108. ArrayList arrayList = new ArrayList();
  2109. if (PdnResources.GetString("Menu.circular.Text").Equals(this.comboBox2.SelectedItem))
  2110. {
  2111. arrayList.Add(this.textBox1.Text);
  2112. arrayList.Add(this.comboBox2.SelectedItem);
  2113. arrayList.Add(Convert.ToInt32(this.numericUpDown18.Value));
  2114. arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
  2115. arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
  2116. arrayList.Add(index);
  2117. }
  2118. else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.comboBox2.SelectedItem))
  2119. {
  2120. arrayList.Add(this.textBox1.Text);
  2121. arrayList.Add(this.comboBox2.SelectedItem);
  2122. arrayList.Add(Convert.ToInt32(this.numericUpDown16.Value));
  2123. arrayList.Add(Convert.ToInt32(this.numericUpDown15.Value));
  2124. arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
  2125. arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
  2126. arrayList.Add(index);
  2127. }
  2128. this.arrayLists.Add(arrayList);
  2129. DataGridViewRow row = new DataGridViewRow();
  2130. foreach (DataGridViewColumn c in this.dataGridView1.Columns)
  2131. {
  2132. row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  2133. }
  2134. row.Cells[0].Value = this.textBox1.Text;
  2135. row.Cells[1].Value = this.comboBox2.SelectedItem;
  2136. this.dataGridView1.Rows.Add(row);
  2137. SaveXmlFile();
  2138. //MessageBox.Show(PdnResources.GetString("Menu.Addsuccessfully.text")+"!");//###20506
  2139. operation = -1;
  2140. this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Selected = true;
  2141. }
  2142. }
  2143. }
  2144. // 编辑
  2145. else if (this.operation == 1)
  2146. {
  2147. if (string.IsNullOrEmpty(this.textBox1.Text))
  2148. {
  2149. MessageBox.Show(PdnResources.GetString("Menu.namecannotbeEmpty.text")+"!");
  2150. }
  2151. else
  2152. {
  2153. bool next = true;
  2154. for (int r = 0; r < this.dataGridView1.Rows.Count; r++)
  2155. {
  2156. if (this.dataGridView1.Rows[r].Cells[0].Value.Equals(this.textBox1.Text) && this.dataGridView1.SelectedRows[0].Index != r)
  2157. {
  2158. MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
  2159. next = false;
  2160. break;
  2161. }
  2162. }
  2163. if (next)
  2164. {
  2165. int updIndex = 0;
  2166. foreach (var arrayList1 in this.arrayLists)
  2167. {
  2168. if (arrayList1[0].ToString().Equals(this.dataGridView1.SelectedRows[0].Cells[0].Value))
  2169. {
  2170. updIndex = Convert.ToInt32(arrayList1[arrayList1.Count - 1]);
  2171. this.arrayLists.Remove(arrayList1);
  2172. break;
  2173. }
  2174. }
  2175. ArrayList arrayList = new ArrayList();
  2176. if (PdnResources.GetString("Menu.circular.Text").Equals(this.comboBox2.SelectedItem))
  2177. {
  2178. arrayList.Add(this.textBox1.Text);
  2179. arrayList.Add(this.comboBox2.SelectedItem);
  2180. arrayList.Add(Convert.ToInt32(this.numericUpDown18.Value));
  2181. arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
  2182. arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
  2183. arrayList.Add(index);
  2184. }
  2185. else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.comboBox2.SelectedItem))
  2186. {
  2187. arrayList.Add(this.textBox1.Text);
  2188. arrayList.Add(this.comboBox2.SelectedItem);
  2189. arrayList.Add(Convert.ToInt32(this.numericUpDown16.Value));
  2190. arrayList.Add(Convert.ToInt32(this.numericUpDown15.Value));
  2191. arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
  2192. arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
  2193. arrayList.Add(index);
  2194. }
  2195. this.arrayLists.Add(arrayList);
  2196. this.dataGridView1.SelectedRows[0].Cells[0].Value = this.textBox1.Text;
  2197. this.dataGridView1.SelectedRows[0].Cells[1].Value = this.comboBox2.SelectedItem;
  2198. SaveXmlFile();
  2199. //MessageBox.Show(PdnResources.GetString("Menu.Editsuccessfully.text")+"!");//###20506
  2200. operation = -1;
  2201. this.groupBox2.Enabled = false;
  2202. }
  2203. }
  2204. }
  2205. }
  2206. ReturnGrainSize(currentOperation);//优化方向:如果选择的不是当前辅助线,不调用更新界面方法
  2207. }
  2208. /// <summary>
  2209. /// 辅助线样式预览
  2210. /// </summary>
  2211. /// <param name="sender"></param>
  2212. /// <param name="e"></param>
  2213. private void panel1_Paint(object sender, PaintEventArgs e)
  2214. {
  2215. if (this.picture == 0)
  2216. {
  2217. GuideStylePreviewCapOffPoint(e.Graphics);
  2218. }
  2219. else if(this.picture == 1)
  2220. {
  2221. GuideStylePreviewArea(e.Graphics);
  2222. }
  2223. }
  2224. private void setNumericUpDownValue(NumericUpDown numericUp, int value)//###
  2225. {
  2226. if (value > numericUp.Maximum)
  2227. numericUp.Value = numericUp.Maximum;
  2228. else if (value < numericUp.Minimum)
  2229. numericUp.Value = numericUp.Minimum;
  2230. else
  2231. numericUp.Value = value;
  2232. }
  2233. /// <summary>
  2234. /// 辅助线样式预览是(截点法)
  2235. /// </summary>
  2236. private void GuideStylePreviewCapOffPoint(Graphics g)
  2237. {
  2238. this.panel1.BackColor = Color.Black;
  2239. double scaleWidth = imageMat.Width / (double)this.panel1.Width;
  2240. double scaleHeight = imageMat.Height / (double)this.panel1.Height;
  2241. double scaleSize;
  2242. int originX;
  2243. int originY;
  2244. int drawWidth;
  2245. int drawHeight;
  2246. if (scaleWidth > scaleHeight)
  2247. {
  2248. scaleSize = scaleWidth;
  2249. originX = 0;
  2250. drawWidth = panel1.Width;
  2251. originY = (int)((panel1.Height - imageMat.Height / scaleWidth) / 2.0);
  2252. drawHeight = (int)(imageMat.Height / scaleWidth);
  2253. }
  2254. else
  2255. {
  2256. scaleSize = scaleHeight;
  2257. originY = 0;
  2258. drawHeight = panel1.Height;
  2259. originX = (int)((panel1.Width - imageMat.Width / scaleHeight) / 2.0);
  2260. drawWidth = (int)(imageMat.Width / scaleHeight);
  2261. }
  2262. g.DrawImage(this.bitmap, originX, originY, drawWidth, drawHeight);//绘制的方法需要测试
  2263. double maxSize = Math.Min(imageMat.Width, imageMat.Height);
  2264. Pen linePen = new Pen(this.panel2.BackColor, Math.Max(1, (int)(Convert.ToInt32(numericUpDown2.Value) / scaleSize)));
  2265. Font textfont = new Font(this.comboBox1.Text, Convert.ToInt32(numericUpDown3.Value));
  2266. SizeF size = g.MeasureString("abc", textfont);
  2267. if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2268. {
  2269. bool autosized = false;
  2270. double maxSizeCurrent = imageMat.Height;
  2271. double multiple = this.physicalGainMultiple(Convert.ToInt32(this.numericUpDown1.Value) / this.physical_length, maxSizeCurrent);
  2272. if (multiple < 1)
  2273. autosized = true;
  2274. int mat_lineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown1.Value) / this.physical_length);
  2275. int mat_lineSpacing = (int)(multiple * Convert.ToInt32(this.numericUpDown21.Value) / this.physical_length);
  2276. int lineDec = Convert.ToInt32(this.numericUpDown20.Value);
  2277. if (autosized && operation > 0)
  2278. {
  2279. this.numericUpDown1.ValueChanged -= new System.EventHandler(this.numericUpDown1_ValueChanged);
  2280. setNumericUpDownValue(this.numericUpDown1, (int)(multiple * Convert.ToInt32(this.numericUpDown1.Value)));
  2281. this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
  2282. this.numericUpDown21.ValueChanged -= new System.EventHandler(this.numericUpDown21_ValueChanged);
  2283. setNumericUpDownValue(this.numericUpDown21, (int)(multiple * Convert.ToInt32(this.numericUpDown21.Value)));
  2284. this.numericUpDown21.ValueChanged += new System.EventHandler(this.numericUpDown21_ValueChanged);
  2285. }
  2286. mat_lineLength = (int)(mat_lineLength / scaleSize);
  2287. mat_lineSpacing = (int)(mat_lineSpacing / scaleSize);
  2288. float originLineTop = (float)((this.panel1.Height - mat_lineLength) / 2.0);
  2289. float originLineBottom = (float)(mat_lineLength + (this.panel1.Height - mat_lineLength) / 2.0);
  2290. if (Convert.ToInt32(this.numericUpDown20.Value) % 2 == 0)
  2291. {
  2292. float Spacing = (float)(mat_lineSpacing / 2.0);
  2293. for (int i = 0; i < (float)this.numericUpDown20.Value / 2; i++)
  2294. {
  2295. g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2 - Spacing, originLineTop)
  2296. , new PointF((float)this.panel1.Width / 2 - Spacing, originLineBottom));
  2297. g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2 + Spacing, originLineTop)
  2298. , new PointF((float)this.panel1.Width / 2 + Spacing, originLineBottom));
  2299. Spacing += mat_lineSpacing;
  2300. }
  2301. }
  2302. else
  2303. {
  2304. if (Convert.ToInt32(this.numericUpDown20.Value) == 1)
  2305. g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2, originLineTop)
  2306. , new PointF((float)this.panel1.Width / 2, originLineBottom));
  2307. else
  2308. {
  2309. float Spacing = (float)(mat_lineSpacing);
  2310. for (int i = 0; i < (this.numericUpDown20.Value - 1) / 2; i++)
  2311. {
  2312. if (i == 0)
  2313. g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2, originLineTop)
  2314. , new PointF((float)this.panel1.Width / 2, originLineBottom));
  2315. g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2 + Spacing, originLineTop)
  2316. , new PointF((float)this.panel1.Width / 2 + Spacing, originLineBottom));
  2317. g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2 - Spacing, originLineTop)
  2318. , new PointF((float)this.panel1.Width / 2 - Spacing, originLineBottom));
  2319. Spacing += mat_lineSpacing;
  2320. }
  2321. }
  2322. }
  2323. }
  2324. else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2325. {
  2326. bool autosized = false;
  2327. double maxSizeCurrent = imageMat.Width;
  2328. double multiple = this.physicalGainMultiple(Convert.ToInt32(this.numericUpDown3.Value) / this.physical_length, maxSizeCurrent);
  2329. if (multiple < 1)
  2330. autosized = true;
  2331. int mat_lineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown3.Value) / this.physical_length);
  2332. int mat_lineSpacing = (int)(multiple * Convert.ToInt32(this.numericUpDown17.Value) / this.physical_length);
  2333. int lineDec = Convert.ToInt32(this.numericUpDown19.Value);
  2334. if (autosized && operation > 0)
  2335. {
  2336. this.numericUpDown3.ValueChanged -= new System.EventHandler(this.numericUpDown3_ValueChanged);
  2337. setNumericUpDownValue(this.numericUpDown3, (int)(multiple * Convert.ToInt32(this.numericUpDown3.Value)));
  2338. this.numericUpDown3.ValueChanged += new System.EventHandler(this.numericUpDown3_ValueChanged);
  2339. this.numericUpDown17.ValueChanged -= new System.EventHandler(this.numericUpDown17_ValueChanged);
  2340. setNumericUpDownValue(this.numericUpDown17, (int)(multiple * Convert.ToInt32(this.numericUpDown17.Value)));
  2341. this.numericUpDown17.ValueChanged += new System.EventHandler(this.numericUpDown17_ValueChanged);
  2342. }
  2343. mat_lineLength = (int)(mat_lineLength / scaleSize);
  2344. mat_lineSpacing = (int)(mat_lineSpacing / scaleSize);
  2345. float originLineLeft = (float)((this.panel1.Width - mat_lineLength) / 2.0);
  2346. float originLineRight = (float)(mat_lineLength + (this.panel1.Width - mat_lineLength) / 2.0);
  2347. if (Convert.ToInt32(this.numericUpDown19.Value) % 2 == 0)
  2348. {
  2349. float Spacing = (float)(mat_lineSpacing / 2.0);
  2350. for (int i = 0; i < (float)this.numericUpDown19.Value / 2; i++)
  2351. {
  2352. g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2 - Spacing)
  2353. , new PointF(originLineRight, (float)this.panel1.Height / 2 - Spacing));
  2354. g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2 + Spacing)
  2355. , new PointF(originLineRight, (float)this.panel1.Height / 2 + Spacing));
  2356. Spacing += mat_lineSpacing;
  2357. }
  2358. }
  2359. else
  2360. {
  2361. if (Convert.ToInt32(this.numericUpDown19.Value) == 1)
  2362. g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2)
  2363. , new PointF(originLineRight, (float)this.panel1.Height / 2));
  2364. else
  2365. {
  2366. float Spacing = (float)(mat_lineSpacing);
  2367. for (int i = 0; i < (Convert.ToInt32(this.numericUpDown19.Value) - 1) / 2; i++)
  2368. {
  2369. if (i == 0)
  2370. g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2)
  2371. , new PointF(originLineRight, (float)this.panel1.Height / 2));
  2372. g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2 - Spacing)
  2373. , new PointF(originLineRight, (float)this.panel1.Height / 2 - Spacing));
  2374. g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2 + Spacing)
  2375. , new PointF(originLineRight, (float)this.panel1.Height / 2 + Spacing));
  2376. Spacing += mat_lineSpacing;
  2377. }
  2378. }
  2379. }
  2380. }
  2381. else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2382. {
  2383. bool autosized = false;
  2384. double multiple = this.physicalGainMultiple(Convert.ToInt32(this.numericUpDown4.Value) / this.physical_length, maxSize);
  2385. if (multiple < 1)
  2386. autosized = true;
  2387. int mat_diameter = (int)(multiple * Convert.ToInt32(this.numericUpDown4.Value) / this.physical_length);
  2388. if (autosized && operation > 0)
  2389. {
  2390. this.numericUpDown4.ValueChanged -= new System.EventHandler(this.numericUpDown4_ValueChanged);
  2391. setNumericUpDownValue(this.numericUpDown4, (int)(multiple * Convert.ToInt32(this.numericUpDown4.Value)));
  2392. this.numericUpDown4.ValueChanged += new System.EventHandler(this.numericUpDown4_ValueChanged);
  2393. }
  2394. mat_diameter = (int)(mat_diameter / scaleSize);
  2395. g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0), (float)((this.panel1.Height - mat_diameter) / 2.0), mat_diameter, mat_diameter);
  2396. }
  2397. else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2398. {
  2399. bool autosized = false;
  2400. int diameter11 = Convert.ToInt32(this.numericUpDown5.Value);
  2401. int margin11 = Convert.ToInt32(this.numericUpDown6.Value);
  2402. double multiple = this.physicalGainMultiple((diameter11 + margin11 * 4) / this.physical_length, maxSize);
  2403. if (multiple < 1)
  2404. autosized = true;
  2405. int mat_diameter = (int)(multiple * diameter11 / this.physical_length);
  2406. int mat_margin = (int)(multiple * margin11 / this.physical_length);
  2407. if (autosized && operation > 0)
  2408. {
  2409. this.numericUpDown5.ValueChanged -= new System.EventHandler(this.numericUpDown5_ValueChanged);
  2410. setNumericUpDownValue(this.numericUpDown5, (int)(multiple * Convert.ToInt32(this.numericUpDown5.Value)));
  2411. this.numericUpDown5.ValueChanged += new System.EventHandler(this.numericUpDown5_ValueChanged);
  2412. this.numericUpDown6.ValueChanged -= new System.EventHandler(this.numericUpDown6_ValueChanged);
  2413. setNumericUpDownValue(this.numericUpDown6, (int)(multiple * Convert.ToInt32(this.numericUpDown6.Value)));
  2414. this.numericUpDown6.ValueChanged += new System.EventHandler(this.numericUpDown6_ValueChanged);
  2415. }
  2416. mat_diameter = (int)(mat_diameter / scaleSize);
  2417. mat_margin = (int)(mat_margin / scaleSize);
  2418. g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0), (float)((this.panel1.Height - mat_diameter) / 2.0), mat_diameter, mat_diameter);
  2419. g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0 - mat_margin), (float)((this.panel1.Height - mat_diameter) / 2.0 - mat_margin), mat_diameter + mat_margin * 2, mat_diameter + mat_margin * 2);
  2420. g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0 - mat_margin * 2), (float)((this.panel1.Height - mat_diameter) / 2.0 - mat_margin * 2), mat_diameter + mat_margin * 4, mat_diameter + mat_margin * 4);
  2421. }
  2422. else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2423. {
  2424. bool autosized = false;
  2425. double maxSizeCurrent = 0;//Math.Min(imageMat.Width, imageMat.Height);
  2426. int num_vLineLength = Convert.ToInt32(this.numericUpDown8.Value);//垂线长度
  2427. int num_hLineLength = Convert.ToInt32(this.numericUpDown7.Value);//水平线长度
  2428. int num_diameter = Convert.ToInt32(this.numericUpDown9.Value);//直径
  2429. int num_margin = Convert.ToInt32(this.numericUpDown10.Value);//边距
  2430. int num_TopleftLineLength = Convert.ToInt32(this.numericUpDown12.Value);//左上到右下斜线长度
  2431. int num_ToprightLineLength = Convert.ToInt32(this.numericUpDown11.Value);//左下到右上斜线长度
  2432. int num_VLineToCDistance = Convert.ToInt32(this.numericUpDown13.Value);//垂线到圆距离
  2433. int num_HLineToCDistance = Convert.ToInt32(this.numericUpDown14.Value);//水平线到圆距离
  2434. if (num_vLineLength / this.physical_length > maxSizeCurrent)
  2435. {
  2436. maxSizeCurrent = num_vLineLength / this.physical_length;
  2437. }
  2438. if (num_hLineLength / this.physical_length > maxSizeCurrent)
  2439. {
  2440. maxSizeCurrent = num_hLineLength / this.physical_length;
  2441. }
  2442. if ((num_diameter + num_margin * 4 + num_VLineToCDistance) / this.physical_length > maxSizeCurrent)
  2443. {
  2444. maxSizeCurrent = (num_diameter + num_margin * 4 + num_VLineToCDistance) / this.physical_length;
  2445. }
  2446. if ((num_diameter + num_margin * 4 + num_HLineToCDistance) / this.physical_length > maxSizeCurrent)
  2447. {
  2448. maxSizeCurrent = (num_diameter + num_margin * 4 + num_HLineToCDistance) / this.physical_length;
  2449. }
  2450. if ((num_TopleftLineLength / Math.Sqrt(2.0)) / this.physical_length > maxSizeCurrent)
  2451. {
  2452. maxSizeCurrent = (num_TopleftLineLength / Math.Sqrt(2.0)) / this.physical_length;
  2453. }
  2454. if ((num_ToprightLineLength / Math.Sqrt(2.0)) / this.physical_length > maxSizeCurrent)
  2455. {
  2456. maxSizeCurrent = (num_ToprightLineLength / Math.Sqrt(2.0)) / this.physical_length;
  2457. }
  2458. double multiple = this.physicalGainMultiple(maxSizeCurrent, maxSize);
  2459. if (multiple < 1)
  2460. autosized = true;
  2461. int mat_vLineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown8.Value) / this.physical_length);//垂线长度
  2462. int mat_hLineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown7.Value) / this.physical_length);//水平线长度
  2463. int mat_diameter = (int)(multiple * Convert.ToInt32(this.numericUpDown9.Value) / this.physical_length);//直径
  2464. int mat_margin = (int)(multiple * Convert.ToInt32(this.numericUpDown10.Value) / this.physical_length);//边距
  2465. int mat_TopleftLineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown12.Value) / this.physical_length);//左上到右下斜线长度
  2466. int mat_ToprightLineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown11.Value) / this.physical_length);//左下到右上斜线长度
  2467. int mat_VLineToCDistance = (int)(multiple * Convert.ToInt32(this.numericUpDown13.Value) / this.physical_length);//垂线到圆距离
  2468. int mat_HLineToCDistance = (int)(multiple * Convert.ToInt32(this.numericUpDown14.Value) / this.physical_length);//水平线到圆距离
  2469. if (autosized && operation > 0)
  2470. {
  2471. this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
  2472. setNumericUpDownValue(this.numericUpDown8, (int)(multiple * Convert.ToInt32(this.numericUpDown8.Value)));
  2473. this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
  2474. this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
  2475. setNumericUpDownValue(this.numericUpDown7, (int)(multiple * Convert.ToInt32(this.numericUpDown7.Value)));
  2476. this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
  2477. this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
  2478. setNumericUpDownValue(this.numericUpDown9, (int)(multiple * Convert.ToInt32(this.numericUpDown9.Value)));
  2479. this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
  2480. this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
  2481. setNumericUpDownValue(this.numericUpDown10, (int)(multiple * Convert.ToInt32(this.numericUpDown10.Value)));
  2482. this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
  2483. this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
  2484. setNumericUpDownValue(this.numericUpDown11, (int)(multiple * Convert.ToInt32(this.numericUpDown11.Value)));
  2485. this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
  2486. this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
  2487. setNumericUpDownValue(this.numericUpDown12, (int)(multiple * Convert.ToInt32(this.numericUpDown12.Value)));
  2488. this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
  2489. this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
  2490. setNumericUpDownValue(this.numericUpDown13, (int)(multiple * Convert.ToInt32(this.numericUpDown13.Value)));
  2491. this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
  2492. this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
  2493. setNumericUpDownValue(this.numericUpDown14, (int)(multiple * Convert.ToInt32(this.numericUpDown14.Value)));
  2494. this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
  2495. }
  2496. mat_vLineLength = (int)(mat_vLineLength / scaleSize);
  2497. mat_hLineLength = (int)(mat_hLineLength / scaleSize);
  2498. mat_diameter = (int)(mat_diameter / scaleSize);
  2499. mat_margin = (int)(mat_margin / scaleSize);
  2500. mat_TopleftLineLength = (int)(mat_TopleftLineLength / scaleSize);
  2501. mat_ToprightLineLength = (int)(mat_ToprightLineLength / scaleSize);
  2502. mat_VLineToCDistance = (int)(mat_VLineToCDistance / scaleSize);
  2503. mat_HLineToCDistance = (int)(mat_HLineToCDistance / scaleSize);
  2504. g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0), (float)((this.panel1.Height - mat_diameter) / 2.0), mat_diameter, mat_diameter);
  2505. g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0 - mat_margin), (float)((this.panel1.Height - mat_diameter) / 2.0 - mat_margin), mat_diameter + mat_margin * 2, mat_diameter + mat_margin * 2);
  2506. g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0 - mat_margin * 2), (float)((this.panel1.Height - mat_diameter) / 2.0 - mat_margin * 2), mat_diameter + mat_margin * 4, mat_diameter + mat_margin * 4);
  2507. //g.DrawEllipse(linePen, (float)(this.panel1.Width / 2 - 60), (float)(this.panel1.Height / 2 - 60), 120, 120);
  2508. //左下到右上斜线
  2509. g.DrawLine(linePen, new PointF(this.panel1.Width / 2 - (float)(mat_ToprightLineLength / Math.Sqrt(8.0)), this.panel1.Height / 2 + (float)(mat_ToprightLineLength / Math.Sqrt(8.0))), new PointF(this.panel1.Width / 2 + (float)(mat_ToprightLineLength / Math.Sqrt(8.0)), this.panel1.Height / 2 - (float)(mat_ToprightLineLength / Math.Sqrt(8.0))));
  2510. //左上到右下斜线
  2511. g.DrawLine(linePen, new PointF(this.panel1.Width / 2 - (float)(mat_TopleftLineLength / Math.Sqrt(8.0)), this.panel1.Height / 2 - (float)(mat_TopleftLineLength / Math.Sqrt(8.0))), new PointF(this.panel1.Width / 2 + (float)(mat_TopleftLineLength / Math.Sqrt(8.0)), this.panel1.Height / 2 + (float)(mat_TopleftLineLength / Math.Sqrt(8.0))));
  2512. //水平线
  2513. g.DrawLine(linePen, new PointF(this.panel1.Width / 2 - (float)(mat_hLineLength / 2.0), (float)((this.panel1.Height + mat_diameter) / 2.0 + mat_margin * 2) + mat_HLineToCDistance), new PointF(this.panel1.Width / 2 + (float)(mat_hLineLength / 2.0), (float)((this.panel1.Height + mat_diameter) / 2.0 + mat_margin * 2) + mat_HLineToCDistance));
  2514. //垂线
  2515. g.DrawLine(linePen, new PointF((float)((this.panel1.Width - mat_diameter) / 2.0 - mat_margin * 2) - mat_VLineToCDistance, this.panel1.Height / 2 + (float)(mat_vLineLength / 2.0)), new PointF((float)((this.panel1.Width - mat_diameter) / 2.0 - mat_margin * 2) - mat_VLineToCDistance, this.panel1.Height / 2 - (float)(mat_vLineLength / 2.0)));
  2516. }
  2517. }
  2518. /// <summary>
  2519. /// 获取辅助线缩放比例
  2520. /// </summary>
  2521. /// <param name="gridSize"> 设置的数值 </param>
  2522. /// <param name="maxSize"> 限制最大值 </param>
  2523. /// <returns></returns>
  2524. private double physicalGainMultiple(double gridSize, double maxSize)
  2525. {
  2526. double multiple = 1.0;
  2527. if (gridSize > maxSize)
  2528. {
  2529. multiple = maxSize / gridSize;
  2530. }
  2531. return multiple;
  2532. }
  2533. /// <summary>
  2534. /// 辅助线样式预览是(面积法)
  2535. /// </summary>
  2536. private void GuideStylePreviewArea(Graphics g)
  2537. {
  2538. this.panel1.BackColor = Color.Black;
  2539. double scaleWidth = imageMat.Width / (double)this.panel1.Width;
  2540. double scaleHeight = imageMat.Height / (double)this.panel1.Height;
  2541. double scaleSize;
  2542. int originX;
  2543. int originY;
  2544. int drawWidth;
  2545. int drawHeight;
  2546. if (scaleWidth > scaleHeight)
  2547. {
  2548. scaleSize = scaleWidth;
  2549. originX = 0;
  2550. drawWidth = panel1.Width;
  2551. originY = (int)((panel1.Height - imageMat.Height / scaleWidth) / 2.0);
  2552. drawHeight = (int)(imageMat.Height / scaleWidth);
  2553. }
  2554. else
  2555. {
  2556. scaleSize = scaleHeight;
  2557. originY = 0;
  2558. drawHeight = panel1.Height;
  2559. originX = (int)((panel1.Width - imageMat.Width / scaleHeight) / 2.0);
  2560. drawWidth = (int)(imageMat.Width / scaleHeight);
  2561. }
  2562. g.DrawImage(this.bitmap, originX, originY, drawWidth, drawHeight);
  2563. double maxSize = Math.Min(imageMat.Width, imageMat.Height);
  2564. Pen linePen = new Pen(this.panel2.BackColor, Math.Max(1, (int)(Convert.ToInt32(numericUpDown2.Value) / scaleSize)));
  2565. if (PdnResources.GetString("Menu.circular.Text").Equals(this.comboBox2.SelectedItem))
  2566. {
  2567. if (Convert.ToInt32(numericUpDown18.Value) / this.physical_area_length_Micron > maxSize)
  2568. {
  2569. if (operation > 0)
  2570. {
  2571. this.numericUpDown18.ValueChanged -= new System.EventHandler(this.numericUpDown18_ValueChanged);
  2572. setNumericUpDownValue(this.numericUpDown18, (int)(maxSize * this.physical_area_length_Micron));
  2573. this.numericUpDown18.ValueChanged += new System.EventHandler(this.numericUpDown18_ValueChanged);
  2574. }
  2575. int drawvalue1 = (int)(maxSize / scaleSize);
  2576. g.DrawEllipse(linePen, (int)(this.panel1.Width - maxSize / scaleSize) / 2, (int)(this.panel1.Height - maxSize / scaleSize) / 2, drawvalue1, drawvalue1);
  2577. }
  2578. else
  2579. {
  2580. int bitmapvalue1 = (int)(Convert.ToInt32(numericUpDown18.Value) / this.physical_area_length_Micron);
  2581. int drawvalue1 = (int)(bitmapvalue1 / scaleSize);
  2582. g.DrawEllipse(linePen, (int)(this.panel1.Width - bitmapvalue1 / scaleSize) / 2, (int)(this.panel1.Height - bitmapvalue1 / scaleSize) / 2, drawvalue1, drawvalue1);
  2583. }
  2584. }
  2585. else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.comboBox2.SelectedItem))
  2586. {
  2587. int bitmapvalue1 = (int)(Convert.ToInt32(numericUpDown16.Value) / this.physical_area_length_Micron);
  2588. int bitmapvalue2 = (int)(Convert.ToInt32(numericUpDown15.Value) / this.physical_area_length_Micron);
  2589. if (bitmapvalue1 > imageMat.Width || bitmapvalue2 > imageMat.Height)
  2590. {
  2591. double scalevalue1 = bitmapvalue1 / (double)imageMat.Width;
  2592. double scalevalue2 = bitmapvalue2 / (double)imageMat.Height;
  2593. if (scalevalue2 > scalevalue1)
  2594. {
  2595. bitmapvalue1 = (int)(bitmapvalue1 / scalevalue2);
  2596. bitmapvalue2 = imageMat.Height;
  2597. }
  2598. else if (scalevalue1 > scalevalue2)
  2599. {
  2600. bitmapvalue2 = (int)(bitmapvalue2 / scalevalue1);
  2601. bitmapvalue1 = imageMat.Width;
  2602. }
  2603. if (operation > 0)
  2604. {
  2605. if (bitmapvalue1 == imageMat.Width)
  2606. {
  2607. this.numericUpDown16.ValueChanged -= new System.EventHandler(this.numericUpDown16_ValueChanged);
  2608. setNumericUpDownValue(this.numericUpDown16, (int)(imageMat.Width * this.physical_area_length_Micron));
  2609. this.numericUpDown16.ValueChanged += new System.EventHandler(this.numericUpDown16_ValueChanged);
  2610. this.numericUpDown15.ValueChanged -= new System.EventHandler(this.numericUpDown15_ValueChanged);
  2611. setNumericUpDownValue(this.numericUpDown15, (int)(bitmapvalue2 * this.physical_area_length_Micron));
  2612. this.numericUpDown15.ValueChanged += new System.EventHandler(this.numericUpDown15_ValueChanged);
  2613. }
  2614. if (bitmapvalue2 == imageMat.Height)
  2615. {
  2616. this.numericUpDown15.ValueChanged -= new System.EventHandler(this.numericUpDown15_ValueChanged);
  2617. setNumericUpDownValue(this.numericUpDown15, (int)(imageMat.Height * this.physical_area_length_Micron));
  2618. this.numericUpDown15.ValueChanged += new System.EventHandler(this.numericUpDown15_ValueChanged);
  2619. this.numericUpDown16.ValueChanged -= new System.EventHandler(this.numericUpDown16_ValueChanged);
  2620. setNumericUpDownValue(this.numericUpDown16, (int)(bitmapvalue1 * this.physical_area_length_Micron));
  2621. this.numericUpDown16.ValueChanged += new System.EventHandler(this.numericUpDown16_ValueChanged);
  2622. }
  2623. }
  2624. }
  2625. int drawvalue1 = (int)(bitmapvalue1 / scaleSize);
  2626. int drawvalue2 = (int)(bitmapvalue2 / scaleSize);
  2627. g.DrawRectangle(linePen, (int)(this.panel1.Width - bitmapvalue1 / scaleSize) / 2, (int)(this.panel1.Height - bitmapvalue2 / scaleSize) / 2, drawvalue1, drawvalue2);
  2628. //g.DrawRectangle(linePen, this.panel1.Width / 2 - 80, this.panel1.Height / 2 - 50, 160, 100);
  2629. }
  2630. }
  2631. /// <summary>
  2632. /// 线颜色改变
  2633. /// </summary>
  2634. /// <param name="sender"></param>
  2635. /// <param name="e"></param>
  2636. private void panel2_BackColorChanged(object sender, EventArgs e)
  2637. {
  2638. this.panel1.Refresh();
  2639. }
  2640. /// <summary>
  2641. /// 切换辅助线类型
  2642. /// </summary>
  2643. /// <param name="sender"></param>
  2644. /// <param name="e"></param>
  2645. private void comboBox1_SelectedIndexChanged_1(object sender, EventArgs e)
  2646. {
  2647. if(this.picture == 0)
  2648. {
  2649. if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2650. {
  2651. this.panel3.Visible = true;
  2652. this.panel4.Visible = false;
  2653. this.panel5.Visible = false;
  2654. this.panel6.Visible = false;
  2655. this.panel7.Visible = false;
  2656. this.panel8.Visible = false;
  2657. this.panel9.Visible = false;
  2658. }
  2659. else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2660. {
  2661. this.panel3.Visible = false;
  2662. this.panel4.Visible = true;
  2663. this.panel5.Visible = false;
  2664. this.panel6.Visible = false;
  2665. this.panel7.Visible = false;
  2666. this.panel8.Visible = false;
  2667. this.panel9.Visible = false;
  2668. }
  2669. else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2670. {
  2671. this.panel3.Visible = false;
  2672. this.panel4.Visible = false;
  2673. this.panel5.Visible = true;
  2674. this.panel6.Visible = false;
  2675. this.panel7.Visible = false;
  2676. this.panel8.Visible = false;
  2677. this.panel9.Visible = false;
  2678. }
  2679. else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2680. {
  2681. this.panel3.Visible = false;
  2682. this.panel4.Visible = false;
  2683. this.panel5.Visible = false;
  2684. this.panel6.Visible = true;
  2685. this.panel7.Visible = false;
  2686. this.panel8.Visible = false;
  2687. this.panel9.Visible = false;
  2688. }
  2689. else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
  2690. {
  2691. this.panel3.Visible = false;
  2692. this.panel4.Visible = false;
  2693. this.panel5.Visible = false;
  2694. this.panel6.Visible = false;
  2695. this.panel7.Visible = true;
  2696. this.panel8.Visible = false;
  2697. this.panel9.Visible = false;
  2698. }
  2699. this.panel1.Refresh();
  2700. }
  2701. }
  2702. /// <summary>
  2703. /// 切换辅助图形
  2704. /// </summary>
  2705. /// <param name="sender"></param>
  2706. /// <param name="e"></param>
  2707. private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
  2708. {
  2709. if(this.picture == 1)
  2710. {
  2711. if (PdnResources.GetString("Menu.circular.Text").Equals(this.comboBox2.SelectedItem))
  2712. {
  2713. this.panel3.Visible = false;
  2714. this.panel4.Visible = false;
  2715. this.panel5.Visible = false;
  2716. this.panel6.Visible = false;
  2717. this.panel7.Visible = false;
  2718. this.panel8.Visible = false;
  2719. this.panel9.Visible = true;
  2720. }
  2721. else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.comboBox2.SelectedItem))
  2722. {
  2723. this.panel3.Visible = false;
  2724. this.panel4.Visible = false;
  2725. this.panel5.Visible = false;
  2726. this.panel6.Visible = false;
  2727. this.panel7.Visible = false;
  2728. this.panel8.Visible = true;
  2729. this.panel9.Visible = false;
  2730. }
  2731. this.panel1.Refresh();
  2732. }
  2733. }
  2734. /// <summary>
  2735. /// 添加辅助线
  2736. /// </summary>
  2737. /// <param name="sender"></param>
  2738. /// <param name="e"></param>
  2739. private void button3_Click(object sender, EventArgs e)
  2740. {
  2741. // 添加
  2742. this.textBox1.Focus();
  2743. this.dataGridView1.ClearSelection();
  2744. operation = 0;
  2745. this.groupBox2.Enabled = true;
  2746. InitGroupbox2();
  2747. }
  2748. /// <summary>
  2749. /// 编辑辅助线
  2750. /// </summary>
  2751. /// <param name="sender"></param>
  2752. /// <param name="e"></param>
  2753. private void button4_Click(object sender, EventArgs e)
  2754. {
  2755. if(this.dataGridView1.Rows.Count > 0)
  2756. {
  2757. if(this.dataGridView1.SelectedRows.Count > 0)
  2758. {
  2759. // 编辑
  2760. operation = 1;
  2761. this.groupBox2.Enabled = true;
  2762. }
  2763. else
  2764. {
  2765. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttheauxiliarylinetoedit.text")+"!");
  2766. }
  2767. }
  2768. else
  2769. {
  2770. MessageBox.Show(PdnResources.GetString("Menu.Pleaseaddauxiliarylines.text")+"!");
  2771. }
  2772. }
  2773. /// <summary>
  2774. /// 切换辅助线
  2775. /// </summary>
  2776. /// <param name="sender"></param>
  2777. /// <param name="e"></param>
  2778. private void dataGridView1_SelectionChanged(object sender, EventArgs e)
  2779. {
  2780. this.groupBox2.Enabled = false;
  2781. operation = -1;
  2782. if (this.dataGridView1.SelectedRows.Count > 0)
  2783. {
  2784. if (this.picture == 0)
  2785. {
  2786. ArrayList arrayList1 = new ArrayList();
  2787. foreach (var arrayList in this.arrayLists)
  2788. {
  2789. if (this.dataGridView1.SelectedRows[0].Cells[0].Value.Equals(arrayList[0]))
  2790. arrayList1 = arrayList;
  2791. }
  2792. if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
  2793. {
  2794. this.textBox1.Text = arrayList1[0].ToString();
  2795. this.comboBox1.SelectedItem = arrayList1[1];
  2796. this.numericUpDown1.Value = Convert.ToInt32(arrayList1[2]);
  2797. this.numericUpDown21.Value = Convert.ToInt32(arrayList1[3]);
  2798. this.numericUpDown20.Value = Convert.ToInt32(arrayList1[4]);
  2799. this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[5]));
  2800. this.numericUpDown2.Value = Convert.ToInt32(arrayList1[6]);
  2801. }
  2802. else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
  2803. {
  2804. this.textBox1.Text = arrayList1[0].ToString();
  2805. this.comboBox1.SelectedItem = arrayList1[1];
  2806. this.numericUpDown3.Value = Convert.ToInt32(arrayList1[2]);
  2807. this.numericUpDown17.Value = Convert.ToInt32(arrayList1[3]);
  2808. this.numericUpDown19.Value = Convert.ToInt32(arrayList1[4]);
  2809. this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[5]));
  2810. this.numericUpDown2.Value = Convert.ToInt32(arrayList1[6]);
  2811. }
  2812. else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
  2813. {
  2814. this.textBox1.Text = arrayList1[0].ToString();
  2815. this.comboBox1.SelectedItem = arrayList1[1];
  2816. this.numericUpDown4.Value = Convert.ToInt32(arrayList1[2]);
  2817. this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[3]));
  2818. this.numericUpDown2.Value = Convert.ToInt32(arrayList1[4]);
  2819. }
  2820. else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
  2821. {
  2822. this.textBox1.Text = arrayList1[0].ToString();
  2823. this.comboBox1.SelectedItem = arrayList1[1];
  2824. this.numericUpDown5.Value = Convert.ToInt32(arrayList1[2]);
  2825. this.numericUpDown6.Value = Convert.ToInt32(arrayList1[3]);
  2826. this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[4]));
  2827. this.numericUpDown2.Value = Convert.ToInt32(arrayList1[5]);
  2828. }
  2829. else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
  2830. {
  2831. this.textBox1.Text = arrayList1[0].ToString();
  2832. this.comboBox1.SelectedItem = arrayList1[1];
  2833. this.numericUpDown8.Value = Convert.ToInt32(arrayList1[2]);
  2834. this.numericUpDown7.Value = Convert.ToInt32(arrayList1[3]);
  2835. this.numericUpDown9.Value = Convert.ToInt32(arrayList1[4]);
  2836. this.numericUpDown10.Value = Convert.ToInt32(arrayList1[5]);
  2837. this.numericUpDown12.Value = Convert.ToInt32(arrayList1[6]);
  2838. this.numericUpDown11.Value = Convert.ToInt32(arrayList1[7]);
  2839. this.numericUpDown13.Value = Convert.ToInt32(arrayList1[8]);
  2840. this.numericUpDown14.Value = Convert.ToInt32(arrayList1[9]);
  2841. this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[10]));
  2842. this.numericUpDown2.Value = Convert.ToInt32(arrayList1[11]);
  2843. this.vLineLength = Convert.ToInt32(arrayList1[2]);
  2844. this.hLineLength = Convert.ToInt32(arrayList1[3]);
  2845. this.diameter = Convert.ToInt32(arrayList1[4]);
  2846. this.margin = Convert.ToInt32(arrayList1[5]);
  2847. this.TopleftLineLength = Convert.ToInt32(arrayList1[6]);
  2848. this.ToprightLineLength = Convert.ToInt32(arrayList1[7]);
  2849. this.VLineToCDistance = Convert.ToInt32(arrayList1[8]);
  2850. this.HLineToCDistance = Convert.ToInt32(arrayList1[9]);
  2851. this.lineWidth = Convert.ToInt32(arrayList1[11]);
  2852. }
  2853. }
  2854. else if(this.picture == 1)
  2855. {
  2856. ArrayList arrayList1 = new ArrayList();
  2857. foreach (var arrayList in this.arrayLists)
  2858. {
  2859. if (this.dataGridView1.SelectedRows[0].Cells[0].Value.Equals(arrayList[0]))
  2860. arrayList1 = arrayList;
  2861. }
  2862. if (PdnResources.GetString("Menu.circular.Text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
  2863. {
  2864. this.textBox1.Text = arrayList1[0].ToString();
  2865. this.comboBox2.SelectedItem = arrayList1[1];
  2866. this.numericUpDown18.Value = Convert.ToInt32(arrayList1[2]);
  2867. this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[3]));
  2868. this.numericUpDown2.Value = Convert.ToInt32(arrayList1[4]);
  2869. }
  2870. else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
  2871. {
  2872. this.textBox1.Text = arrayList1[0].ToString();
  2873. this.comboBox2.SelectedItem = arrayList1[1];
  2874. this.numericUpDown16.Value = Convert.ToInt32(arrayList1[2]);
  2875. this.numericUpDown15.Value = Convert.ToInt32(arrayList1[3]);
  2876. this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[4]));
  2877. this.numericUpDown2.Value = Convert.ToInt32(arrayList1[5]);
  2878. }
  2879. }
  2880. this.panel1.Refresh();
  2881. }
  2882. }
  2883. /// <summary>
  2884. /// 删除辅助线
  2885. /// </summary>
  2886. /// <param name="sender"></param>
  2887. /// <param name="e"></param>
  2888. private void button5_Click(object sender, EventArgs e)
  2889. {
  2890. if(this.dataGridView1.SelectedRows.Count > 0)
  2891. {
  2892. DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretodeletetheauxiliaryline?.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
  2893. if (dr == DialogResult.OK)
  2894. {
  2895. foreach (var arrayList in this.arrayLists)
  2896. {
  2897. if (this.dataGridView1.SelectedRows[0].Cells[0].Value.Equals(arrayList[0]))
  2898. {
  2899. this.arrayLists.Remove(arrayList);
  2900. break;
  2901. }
  2902. }
  2903. SaveXmlFile();
  2904. this.dataGridView1.Rows.Remove(this.dataGridView1.SelectedRows[0]);
  2905. if (this.dataGridView1.Rows.Count == 0)
  2906. InitGroupbox2();
  2907. ReturnGrainSize(2);
  2908. }
  2909. this.panel1.Refresh();
  2910. }
  2911. else
  2912. {
  2913. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttheauxiliarylinetodelete.text")+"!");
  2914. }
  2915. }
  2916. /// <summary>
  2917. /// 截点法-垂直辅助线-辅助线长度
  2918. /// </summary>
  2919. /// <param name="sender"></param>
  2920. /// <param name="e"></param>
  2921. private void numericUpDown1_ValueChanged(object sender, EventArgs e)
  2922. {
  2923. this.panel1.Refresh();
  2924. }
  2925. /// <summary>
  2926. /// 截点法-水平辅助线-辅助线长度
  2927. /// </summary>
  2928. /// <param name="sender"></param>
  2929. /// <param name="e"></param>
  2930. private void numericUpDown3_ValueChanged(object sender, EventArgs e)
  2931. {
  2932. this.panel1.Refresh();
  2933. }
  2934. /// <summary>
  2935. /// 截点法-圆辅助线-直径
  2936. /// </summary>
  2937. /// <param name="sender"></param>
  2938. /// <param name="e"></param>
  2939. private void numericUpDown4_ValueChanged(object sender, EventArgs e)
  2940. {
  2941. this.panel1.Refresh();
  2942. }
  2943. /// <summary>
  2944. /// 截点法-三圆辅助线-直径
  2945. /// </summary>
  2946. /// <param name="sender"></param>
  2947. /// <param name="e"></param>
  2948. private void numericUpDown5_ValueChanged(object sender, EventArgs e)
  2949. {
  2950. this.panel1.Refresh();
  2951. }
  2952. /// <summary>
  2953. /// 截点法-三圆辅助线-边距
  2954. /// </summary>
  2955. /// <param name="sender"></param>
  2956. /// <param name="e"></param>
  2957. private void numericUpDown6_ValueChanged(object sender, EventArgs e)
  2958. {
  2959. this.panel1.Refresh();
  2960. }
  2961. /// <summary>
  2962. /// 间距
  2963. /// </summary>
  2964. /// <param name="sender"></param>
  2965. /// <param name="e"></param>
  2966. private void numericUpDown21_ValueChanged(object sender, EventArgs e)
  2967. {
  2968. this.panel1.Refresh();
  2969. }
  2970. /// <summary>
  2971. /// 线条数
  2972. /// </summary>
  2973. /// <param name="sender"></param>
  2974. /// <param name="e"></param>
  2975. private void numericUpDown20_ValueChanged(object sender, EventArgs e)
  2976. {
  2977. this.panel1.Refresh();
  2978. }
  2979. /// <summary>
  2980. /// 面积法-矩形-宽
  2981. /// </summary>
  2982. /// <param name="sender"></param>
  2983. /// <param name="e"></param>
  2984. private void numericUpDown15_ValueChanged(object sender, EventArgs e)
  2985. {
  2986. this.panel1.Refresh();
  2987. }
  2988. /// <summary>
  2989. /// 面积法-矩形-高
  2990. /// </summary>
  2991. /// <param name="sender"></param>
  2992. /// <param name="e"></param>
  2993. private void numericUpDown16_ValueChanged(object sender, EventArgs e)
  2994. {
  2995. this.panel1.Refresh();
  2996. }
  2997. /// <summary>
  2998. /// 间距
  2999. /// </summary>
  3000. /// <param name="sender"></param>
  3001. /// <param name="e"></param>
  3002. private void numericUpDown17_ValueChanged(object sender, EventArgs e)
  3003. {
  3004. this.panel1.Refresh();
  3005. }
  3006. /// <summary>
  3007. /// 面积法-圆-直径
  3008. /// </summary>
  3009. /// <param name="sender"></param>
  3010. /// <param name="e"></param>
  3011. private void numericUpDown18_ValueChanged(object sender, EventArgs e)
  3012. {
  3013. this.panel1.Refresh();
  3014. }
  3015. /// <summary>
  3016. /// 线条数
  3017. /// </summary>
  3018. /// <param name="sender"></param>
  3019. /// <param name="e"></param>
  3020. private void numericUpDown19_ValueChanged(object sender, EventArgs e)
  3021. {
  3022. this.panel1.Refresh();
  3023. }
  3024. /// <summary>
  3025. /// 线宽改变
  3026. /// </summary>
  3027. /// <param name="sender"></param>
  3028. /// <param name="e"></param>
  3029. private void numericUpDown2_ValueChanged(object sender, EventArgs e)
  3030. {
  3031. this.panel1.Refresh();
  3032. }
  3033. /// <summary>
  3034. /// 垂线长度改变
  3035. /// </summary>
  3036. /// <param name="sender"></param>
  3037. /// <param name="e"></param>
  3038. private void numericUpDown8_ValueChanged(object sender, EventArgs e)
  3039. {
  3040. if (this.checkBox1.Checked && this.groupBox2.Enabled)
  3041. {
  3042. this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
  3043. this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
  3044. this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
  3045. this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
  3046. this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
  3047. this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
  3048. this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
  3049. this.percentage = this.numericUpDown8.Value / this.vLineLength;
  3050. this.vLineLength = Convert.ToInt32(this.numericUpDown8.Value);
  3051. setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
  3052. setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
  3053. setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
  3054. setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
  3055. setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
  3056. setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
  3057. setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
  3058. this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
  3059. this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
  3060. this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
  3061. this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
  3062. this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
  3063. this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
  3064. this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
  3065. }
  3066. this.panel1.Refresh();
  3067. }
  3068. /// <summary>
  3069. /// 水平线长度改变
  3070. /// </summary>
  3071. /// <param name="sender"></param>
  3072. /// <param name="e"></param>
  3073. private void numericUpDown7_ValueChanged(object sender, EventArgs e)
  3074. {
  3075. if (this.checkBox1.Checked && this.groupBox2.Enabled)
  3076. {
  3077. this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
  3078. this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
  3079. this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
  3080. this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
  3081. this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
  3082. this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
  3083. this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
  3084. this.percentage = this.numericUpDown7.Value / this.hLineLength;
  3085. this.hLineLength = Convert.ToInt32(this.numericUpDown7.Value);
  3086. setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
  3087. setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
  3088. setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
  3089. setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
  3090. setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
  3091. setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
  3092. setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
  3093. this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
  3094. this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
  3095. this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
  3096. this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
  3097. this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
  3098. this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
  3099. this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
  3100. }
  3101. this.panel1.Refresh();
  3102. }
  3103. /// <summary>
  3104. /// 内圆直径改变
  3105. /// </summary>
  3106. /// <param name="sender"></param>
  3107. /// <param name="e"></param>
  3108. private void numericUpDown9_ValueChanged(object sender, EventArgs e)
  3109. {
  3110. if (this.checkBox1.Checked && this.groupBox2.Enabled)
  3111. {
  3112. this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
  3113. this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
  3114. this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
  3115. this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
  3116. this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
  3117. this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
  3118. this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
  3119. this.percentage = this.numericUpDown9.Value / this.diameter;
  3120. this.diameter = Convert.ToInt32(this.numericUpDown9.Value);
  3121. setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
  3122. setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
  3123. setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
  3124. setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
  3125. setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
  3126. setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
  3127. setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
  3128. this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
  3129. this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
  3130. this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
  3131. this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
  3132. this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
  3133. this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
  3134. this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
  3135. }
  3136. this.panel1.Refresh();
  3137. }
  3138. /// <summary>
  3139. /// 边距改变
  3140. /// </summary>
  3141. /// <param name="sender"></param>
  3142. /// <param name="e"></param>
  3143. private void numericUpDown10_ValueChanged(object sender, EventArgs e)
  3144. {
  3145. if (this.checkBox1.Checked && this.groupBox2.Enabled)
  3146. {
  3147. this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
  3148. this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
  3149. this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
  3150. this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
  3151. this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
  3152. this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
  3153. this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
  3154. this.percentage = this.numericUpDown10.Value / this.margin;
  3155. this.margin = Convert.ToInt32(this.numericUpDown10.Value);
  3156. //##19847
  3157. setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
  3158. setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
  3159. setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
  3160. setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
  3161. setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
  3162. setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
  3163. setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
  3164. this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
  3165. this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
  3166. this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
  3167. this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
  3168. this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
  3169. this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
  3170. this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
  3171. }
  3172. this.panel1.Refresh();
  3173. }
  3174. /// <summary>
  3175. /// 左上到右下斜线长度改变
  3176. /// </summary>
  3177. /// <param name="sender"></param>
  3178. /// <param name="e"></param>
  3179. private void numericUpDown12_ValueChanged(object sender, EventArgs e)
  3180. {
  3181. if (this.checkBox1.Checked && this.groupBox2.Enabled)
  3182. {
  3183. this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
  3184. this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
  3185. this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
  3186. this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
  3187. this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
  3188. this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
  3189. this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
  3190. this.percentage = this.numericUpDown12.Value / this.TopleftLineLength;
  3191. this.TopleftLineLength = Convert.ToInt32(this.numericUpDown12.Value);
  3192. setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
  3193. setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
  3194. setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
  3195. setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
  3196. setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
  3197. setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
  3198. setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
  3199. this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
  3200. this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
  3201. this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
  3202. this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
  3203. this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
  3204. this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
  3205. this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
  3206. }
  3207. this.panel1.Refresh();
  3208. }
  3209. /// <summary>
  3210. /// 左下到右上斜线长度改变
  3211. /// </summary>
  3212. /// <param name="sender"></param>
  3213. /// <param name="e"></param>
  3214. private void numericUpDown11_ValueChanged(object sender, EventArgs e)
  3215. {
  3216. if (this.checkBox1.Checked && this.groupBox2.Enabled)
  3217. {
  3218. this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
  3219. this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
  3220. this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
  3221. this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
  3222. this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
  3223. this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
  3224. this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
  3225. this.percentage = this.numericUpDown11.Value / this.ToprightLineLength;
  3226. this.ToprightLineLength = Convert.ToInt32(this.numericUpDown11.Value);
  3227. setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
  3228. setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
  3229. setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
  3230. setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
  3231. setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
  3232. setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
  3233. setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
  3234. this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
  3235. this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
  3236. this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
  3237. this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
  3238. this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
  3239. this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
  3240. this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
  3241. }
  3242. this.panel1.Refresh();
  3243. }
  3244. /// <summary>
  3245. /// 垂线到圆距离改变
  3246. /// </summary>
  3247. /// <param name="sender"></param>
  3248. /// <param name="e"></param>
  3249. private void numericUpDown13_ValueChanged(object sender, EventArgs e)
  3250. {
  3251. if (this.checkBox1.Checked && this.groupBox2.Enabled)
  3252. {
  3253. this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
  3254. this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
  3255. this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
  3256. this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
  3257. this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
  3258. this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
  3259. this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
  3260. this.percentage = this.numericUpDown13.Value / this.VLineToCDistance;
  3261. this.VLineToCDistance = Convert.ToInt32(this.numericUpDown13.Value);
  3262. setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
  3263. setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
  3264. setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
  3265. setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
  3266. setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
  3267. setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
  3268. setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
  3269. this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
  3270. this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
  3271. this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
  3272. this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
  3273. this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
  3274. this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
  3275. this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
  3276. }
  3277. this.panel1.Refresh();
  3278. }
  3279. /// <summary>
  3280. /// 水平线到圆距离改变
  3281. /// </summary>
  3282. /// <param name="sender"></param>
  3283. /// <param name="e"></param>
  3284. private void numericUpDown14_ValueChanged(object sender, EventArgs e)
  3285. {
  3286. if (this.checkBox1.Checked && this.groupBox2.Enabled)
  3287. {
  3288. this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
  3289. this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
  3290. this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
  3291. this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
  3292. this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
  3293. this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
  3294. this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
  3295. this.percentage = this.numericUpDown14.Value / this.HLineToCDistance;
  3296. this.HLineToCDistance = Convert.ToInt32(this.numericUpDown14.Value);
  3297. setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
  3298. setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
  3299. setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
  3300. setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
  3301. setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
  3302. setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
  3303. setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
  3304. this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
  3305. this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
  3306. this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
  3307. this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
  3308. this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
  3309. this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
  3310. this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
  3311. }
  3312. this.panel1.Refresh();
  3313. }
  3314. private void GrainGuideSettingsDialog_Load(object sender, EventArgs e)
  3315. {
  3316. if (this.picture == 0)
  3317. {
  3318. this.comboBox1.Items.Clear();
  3319. this.comboBox1.Items.AddRange(getTypeNames());
  3320. if (this.comboBox1.Items.Count > 0)
  3321. this.comboBox1.SelectedIndex = 0;
  3322. }
  3323. else if (this.picture == 1)
  3324. {
  3325. this.comboBox2.Items.Clear();
  3326. this.comboBox2.Items.AddRange(getTypeNames());
  3327. if (this.comboBox2.Items.Count > 0)
  3328. this.comboBox2.SelectedIndex = 0;
  3329. dataGridView1_SelectionChanged(sender, e);
  3330. }
  3331. }
  3332. #region 需继承方法
  3333. protected virtual string[] getTypeNames()
  3334. {
  3335. return this.typeListNames;
  3336. }
  3337. #endregion
  3338. }
  3339. }