GrainGuideStyleSettingsDialog.cs 180 KB

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