GrainGuideSettingsDialog.cs 180 KB

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