12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422 |
- using PaintDotNet.Base.SettingModel;
- using PaintDotNet.Base.CommTool;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.IO;
- using System.Windows.Forms;
- using PaintDotNet.DedicatedAnalysis.GrainSizeStandard;
- namespace PaintDotNet.DedicatedAnalysis
- {
- /// <summary>
- /// 晶粒度辅助线设置
- /// </summary>
- public partial class GrainGuideSettingsDialog : Form
- {
- #region 控件
- private GroupBox groupBox2;
- private GroupBox groupBox3;
- private Button button1;
- private Button button2;
- private Label label3;
- private Label label2;
- private Label label1;
- private Panel panel1;
- private Panel panel2;
- private GroupBox groupBox1;
- /// <summary>
- /// 线宽
- /// </summary>
- private NumericUpDown numericUpDown2;
- private GroupBox groupBox4;
- private Button button5;
- private Button button4;
- private Button button3;
- private Label label7;
- private TextBox textBox1;
- private ComboBox comboBox1;
- /// <summary>
- /// 截点法-垂直辅助线-辅助线长度
- /// </summary>
- private NumericUpDown numericUpDown1;
- private Panel panel3;
- private Panel panel4;
- /// <summary>
- /// 截点法-水平辅助线-辅助线长度
- /// </summary>
- private NumericUpDown numericUpDown3;
- private Label label4;
- private Panel panel5;
- private NumericUpDown numericUpDown4;
- private Label label5;
- private Panel panel6;
- private NumericUpDown numericUpDown6;
- private Label label8;
- private NumericUpDown numericUpDown5;
- private Label label6;
- private Panel panel7;
- /// <summary>
- /// 水平线长度
- /// </summary>
- private NumericUpDown numericUpDown7;
- private Label label9;
- /// <summary>
- /// 垂线长度
- /// </summary>
- private NumericUpDown numericUpDown8;
- private Label label10;
- /// <summary>
- /// 边距
- /// </summary>
- private NumericUpDown numericUpDown10;
- private Label label12;
- /// <summary>
- /// 直径
- /// </summary>
- private NumericUpDown numericUpDown9;
- private Label label11;
- /// <summary>
- /// 左下到右上斜线长度
- /// </summary>
- private NumericUpDown numericUpDown11;
- private Label label13;
- /// <summary>
- /// 左上到右下斜线长度
- /// </summary>
- private NumericUpDown numericUpDown12;
- private Label label14;
- private DataGridView dataGridView1;
- private DataGridViewTextBoxColumn GuideName;
- private DataGridViewTextBoxColumn Column1;
- private DataGridViewTextBoxColumn GrainType;
- private Label label16;
- private Label label15;
- /// <summary>
- /// 水平线到圆距离
- /// </summary>
- private NumericUpDown numericUpDown14;
- /// <summary>
- /// 垂线到圆距离
- /// </summary>
- private NumericUpDown numericUpDown13;
- private Panel panel8;
- /// <summary>
- /// 面积法-矩形-高
- /// </summary>
- private NumericUpDown numericUpDown15;
- private Label label17;
- /// <summary>
- /// 面积法-矩形-宽
- /// </summary>
- private NumericUpDown numericUpDown16;
- private Label label18;
- private Panel panel9;
- /// <summary>
- /// 面积法-圆形-直径
- /// </summary>
- private NumericUpDown numericUpDown18;
- private Label label20;
- /// <summary>
- /// 面积法-辅助线类型
- /// </summary>
- private ComboBox comboBox2;
- /// <summary>
- /// 截点法-水平辅助线-辅助线数量
- /// </summary>
- private NumericUpDown numericUpDown19;
- private Label label21;
- /// <summary>
- /// 截点法-水平辅助线-辅助线间距
- /// </summary>
- private NumericUpDown numericUpDown17;
- private Label label19;
- /// <summary>
- /// 截点法-垂直辅助线-辅助线数量
- /// </summary>
- private NumericUpDown numericUpDown20;
- private Label label22;
- /// <summary>
- /// 截点法-垂直辅助线-辅助线间距
- /// </summary>
- private NumericUpDown numericUpDown21;
- private Label label23;
- private CheckBox checkBox1;
- #endregion
- /// <summary>
- /// 调色板
- /// </summary>
- PaintDotNet.ColorsForm colorsForm;
- /// <summary>
- /// 操作区分(0 :添加 1 :编辑)
- /// </summary>
- private int operation = -1;
- /// <summary>
- /// 临时数据
- /// </summary>
- private List<ArrayList> arrayLists = new List<ArrayList>();
- /// <summary>
- /// 跳转画面 0:截点法 1:面积法
- /// </summary>
- private int picture;
- /// <summary>
- /// 配置文件名称
- /// </summary>
- private string xmlModelName;
- //##考虑放在父类中声明属性,这样就不用创建这个dialog了
- private string[] typeListNames = new string[] { "", "" };
- //{
- // return new string[] {
- // PdnResources.GetString("Menu.Verticalauxiliaryline.text"),
- // PdnResources.GetString("Menu.Horizontalauxiliaryline.text")};
- //}
- /// <summary>
- /// 直径
- /// </summary>
- public int diameter;
- /// <summary>
- /// 边距
- /// </summary>
- public int margin;
- /// <summary>
- /// 长度(垂线)
- /// </summary>
- public int vLineLength;
- /// <summary>
- /// 长度(水平线)
- /// </summary>
- public int hLineLength;
- /// <summary>
- /// 左上到右下斜线长度
- /// </summary>
- public int TopleftLineLength;
- /// <summary>
- /// 左下到右上斜线长度
- /// </summary>
- public int ToprightLineLength;
- /// <summary>
- /// 垂线到圆距离
- /// </summary>
- public int VLineToCDistance;
- /// <summary>
- /// 水平线到圆距离
- /// </summary>
- public int HLineToCDistance;
- /// <summary>
- /// 线宽
- /// </summary>
- public int lineWidth;
- /// %
- /// </summary>
- public decimal percentage;
- private Label label24;
- private ToolTip toolTip1;
- private IContainer components;
- /// <summary>
- /// 选择的图片
- /// </summary>
- private Bitmap bitmap;
- /// <summary>
- /// 选择标尺的物理长度(1倍下的 微米/像素)
- /// </summary>
- double physical_length = 1;
- /// <summary>
- /// 选择标尺的物理长度(1倍下的 微米/像素)
- /// </summary>
- double physical_area_length_Micron = 1;
- /// <summary>
- /// 排列顺序
- /// </summary>
- private int index = 0;
- public GrainGuideSettingsDialog(int picture, string xmlModelName, string[] typeListNames, Bitmap bitmap, double physical_Micron = 1.0)
- {
- this.picture = picture;
- this.xmlModelName = xmlModelName;
- this.typeListNames = typeListNames;
- this.bitmap = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(OpenCvSharp.Extensions.BitmapConverter.ToMat(bitmap));
- //Dictionary<MeasurementUnit, double> measurementUnitDictionary = Startup.instance.rules;
- physical_length = physical_Micron;//;this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].GetRuler(MeasurementUnit.Micron)// measurementUnitDictionary[MeasurementUnit.Micron];
- physical_area_length_Micron = physical_Micron;//;this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].GetRuler(MeasurementUnit.Micron) measurementUnitDictionary[MeasurementUnit.Micron];
- //physical_area_length_Millimeter = measurementUnitDictionary[MeasurementUnit.Millimeter];
- //double physical_area_length_Micron = getCurrentWorkspace().GetRuler(MeasurementUnit.Micron);
- InitializeComponent();
- InitializeLanguageText();
- InitializeButtonBackgroudImage();
- InitializeToolTip();
- InitializeData();
- //调色板
- this.colorsForm = new ColorsForm();
- this.colorsForm.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- }
- #region 初始化
- private void InitializeLanguageText()
- {
- this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
- this.button2.Text = PdnResources.GetString("CommonAction.Save");
- this.button1.Text = PdnResources.GetString("Menu.File.Close.Text");
- this.groupBox2.Text = PdnResources.GetString("Menu.Tools.AuxiliaryLine.Text");
- this.label21.Text = PdnResources.GetString("Menu.Numberoflines.text") + ":";
- this.label19.Text = PdnResources.GetString("Menu.spacing.text") + ":";
- this.label4.Text = PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text") + ":";
- this.label20.Text = PdnResources.GetString("Menu.diameter.text") + ":";
- this.label5.Text = PdnResources.GetString("Menu.diameter.text") + ":";
- this.label8.Text = PdnResources.GetString("Menu.margin.Text") + ":";
- this.label6.Text = PdnResources.GetString("Menu.Innercirclediameter.Text") + ":";
- this.label17.Text = PdnResources.GetString("Menu.Rectheight.text") + ":";
- this.label18.Text = PdnResources.GetString("Menu.Rectwidth.text") + ":";
- this.label22.Text = PdnResources.GetString("Menu.Numberoflines.text") + ":";
- this.label23.Text = PdnResources.GetString("Menu.spacing.text") + ":";
- this.label1.Text = PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text") + ":";
- this.label3.Text = PdnResources.GetString("Menu.Linewidth.text") + ":";
- this.checkBox1.Text = PdnResources.GetString("Menu.Geometricscaling.Text");
- this.label16.Text = PdnResources.GetString("Menu.Thedistancefromthehorizontothecircle.Text");
- this.label15.Text = PdnResources.GetString("Menu.theperpendiculartothecircl.Text") + ":";
- this.label13.Text = PdnResources.GetString("Menu.gonallinefrombottomlefttotopright.Text") + ":";
- this.label14.Text = PdnResources.GetString("Menu.nalfromtoplefttob.Text") + ":";
- this.label12.Text = PdnResources.GetString("Menu.margin.Text") + ":";
- this.label11.Text = PdnResources.GetString("Menu.Innercirclediameter.Text") + ":";
- this.label9.Text = PdnResources.GetString("Menu.Horizontallength.Text") + ":";
- this.label10.Text = PdnResources.GetString("Menu.Set.Rulersettings.lengthofperpendicular.text") + ":";
- this.label7.Text = PdnResources.GetString("Menu.name.text") + ":";
- this.label2.Text = PdnResources.GetString("Menu.color.text") + ":";
- this.label24.Text = PdnResources.GetString("Menu.Type.text") + ":";
- this.groupBox3.Text = PdnResources.GetString("Menu.Preview.text");
- this.groupBox4.Text = PdnResources.GetString("Menu.Preview.text");
- this.Text = PdnResources.GetString("Menu.Auxiliarylinestylesettings.text");
- }
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.button2 = new System.Windows.Forms.Button();
- this.button1 = new System.Windows.Forms.Button();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.panel4 = new System.Windows.Forms.Panel();
- this.numericUpDown19 = new System.Windows.Forms.NumericUpDown();
- this.label21 = new System.Windows.Forms.Label();
- this.numericUpDown17 = new System.Windows.Forms.NumericUpDown();
- this.label19 = new System.Windows.Forms.Label();
- this.numericUpDown3 = new System.Windows.Forms.NumericUpDown();
- this.label4 = new System.Windows.Forms.Label();
- this.panel9 = new System.Windows.Forms.Panel();
- this.numericUpDown18 = new System.Windows.Forms.NumericUpDown();
- this.label20 = new System.Windows.Forms.Label();
- this.panel5 = new System.Windows.Forms.Panel();
- this.numericUpDown4 = new System.Windows.Forms.NumericUpDown();
- this.label5 = new System.Windows.Forms.Label();
- this.comboBox2 = new System.Windows.Forms.ComboBox();
- this.panel6 = new System.Windows.Forms.Panel();
- this.numericUpDown6 = new System.Windows.Forms.NumericUpDown();
- this.label8 = new System.Windows.Forms.Label();
- this.numericUpDown5 = new System.Windows.Forms.NumericUpDown();
- this.label6 = new System.Windows.Forms.Label();
- this.panel8 = new System.Windows.Forms.Panel();
- this.numericUpDown15 = new System.Windows.Forms.NumericUpDown();
- this.label17 = new System.Windows.Forms.Label();
- this.numericUpDown16 = new System.Windows.Forms.NumericUpDown();
- this.label18 = new System.Windows.Forms.Label();
- this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
- this.panel3 = new System.Windows.Forms.Panel();
- this.numericUpDown20 = new System.Windows.Forms.NumericUpDown();
- this.label22 = new System.Windows.Forms.Label();
- this.numericUpDown21 = new System.Windows.Forms.NumericUpDown();
- this.label23 = new System.Windows.Forms.Label();
- this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
- this.label1 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.comboBox1 = new System.Windows.Forms.ComboBox();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.panel2 = new System.Windows.Forms.Panel();
- this.panel7 = new System.Windows.Forms.Panel();
- this.checkBox1 = new System.Windows.Forms.CheckBox();
- this.numericUpDown14 = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown13 = new System.Windows.Forms.NumericUpDown();
- this.label16 = new System.Windows.Forms.Label();
- this.label15 = new System.Windows.Forms.Label();
- this.numericUpDown11 = new System.Windows.Forms.NumericUpDown();
- this.label13 = new System.Windows.Forms.Label();
- this.numericUpDown12 = new System.Windows.Forms.NumericUpDown();
- this.label14 = new System.Windows.Forms.Label();
- this.numericUpDown10 = new System.Windows.Forms.NumericUpDown();
- this.label12 = new System.Windows.Forms.Label();
- this.numericUpDown9 = new System.Windows.Forms.NumericUpDown();
- this.label11 = new System.Windows.Forms.Label();
- this.numericUpDown7 = new System.Windows.Forms.NumericUpDown();
- this.label9 = new System.Windows.Forms.Label();
- this.numericUpDown8 = new System.Windows.Forms.NumericUpDown();
- this.label10 = new System.Windows.Forms.Label();
- this.label7 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.label24 = new System.Windows.Forms.Label();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.panel1 = new System.Windows.Forms.Panel();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.dataGridView1 = new System.Windows.Forms.DataGridView();
- this.GuideName = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.GrainType = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.button5 = new System.Windows.Forms.Button();
- this.button4 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.panel4.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown19)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown17)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit();
- this.panel9.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown18)).BeginInit();
- this.panel5.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit();
- this.panel6.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).BeginInit();
- this.panel8.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown15)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown16)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
- this.panel3.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown20)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown21)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
- this.panel7.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown14)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown13)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown11)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown12)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown10)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown9)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown7)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown8)).BeginInit();
- this.groupBox3.SuspendLayout();
- this.groupBox4.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
- this.SuspendLayout();
- //
- // groupBox1
- //
- this.groupBox1.Controls.Add(this.button2);
- this.groupBox1.Controls.Add(this.button1);
- this.groupBox1.Location = new System.Drawing.Point(12, 12);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(500, 54);
- this.groupBox1.TabIndex = 0;
- this.groupBox1.TabStop = false;
- //
- // button2
- //
- this.button2.Location = new System.Drawing.Point(414, 16);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(70, 28);
- this.button2.TabIndex = 1;
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(325, 16);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(70, 28);
- this.button1.TabIndex = 0;
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // groupBox2
- //
- this.groupBox2.Controls.Add(this.panel4);
- this.groupBox2.Controls.Add(this.panel9);
- this.groupBox2.Controls.Add(this.panel5);
- this.groupBox2.Controls.Add(this.comboBox2);
- this.groupBox2.Controls.Add(this.panel6);
- this.groupBox2.Controls.Add(this.panel8);
- this.groupBox2.Controls.Add(this.numericUpDown2);
- this.groupBox2.Controls.Add(this.panel3);
- this.groupBox2.Controls.Add(this.label3);
- this.groupBox2.Controls.Add(this.comboBox1);
- this.groupBox2.Controls.Add(this.textBox1);
- this.groupBox2.Controls.Add(this.panel2);
- this.groupBox2.Controls.Add(this.panel7);
- this.groupBox2.Controls.Add(this.label7);
- this.groupBox2.Controls.Add(this.label2);
- this.groupBox2.Controls.Add(this.label24);
- this.groupBox2.Location = new System.Drawing.Point(193, 72);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(319, 260);
- this.groupBox2.TabIndex = 1;
- this.groupBox2.TabStop = false;
- //
- // panel4
- //
- this.panel4.Controls.Add(this.numericUpDown19);
- this.panel4.Controls.Add(this.label21);
- this.panel4.Controls.Add(this.numericUpDown17);
- this.panel4.Controls.Add(this.label19);
- this.panel4.Controls.Add(this.numericUpDown3);
- this.panel4.Controls.Add(this.label4);
- this.panel4.Location = new System.Drawing.Point(21, 75);
- this.panel4.Name = "panel4";
- this.panel4.Size = new System.Drawing.Size(272, 107);
- this.panel4.TabIndex = 23;
- //
- // numericUpDown19
- //
- this.numericUpDown19.Location = new System.Drawing.Point(56, 42);
- this.numericUpDown19.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown19.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown19.Name = "numericUpDown19";
- this.numericUpDown19.Size = new System.Drawing.Size(82, 21);
- this.numericUpDown19.TabIndex = 25;
- this.numericUpDown19.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown19.ValueChanged += new System.EventHandler(this.numericUpDown19_ValueChanged);
- //
- // label21
- //
- this.label21.AutoSize = true;
- this.label21.Location = new System.Drawing.Point(6, 47);
- this.label21.Name = "label21";
- this.label21.Size = new System.Drawing.Size(53, 12);
- this.label21.TabIndex = 24;
- //
- // numericUpDown17
- //
- this.numericUpDown17.Location = new System.Drawing.Point(179, 15);
- this.numericUpDown17.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown17.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown17.Name = "numericUpDown17";
- this.numericUpDown17.Size = new System.Drawing.Size(82, 21);
- this.numericUpDown17.TabIndex = 23;
- this.numericUpDown17.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown17.ValueChanged += new System.EventHandler(this.numericUpDown17_ValueChanged);
- //
- // label19
- //
- this.label19.AutoSize = true;
- this.label19.Location = new System.Drawing.Point(136, 18);
- this.label19.Name = "label19";
- this.label19.Size = new System.Drawing.Size(41, 12);
- this.label19.TabIndex = 22;
- //
- // numericUpDown3
- //
- this.numericUpDown3.Location = new System.Drawing.Point(48, 15);
- this.numericUpDown3.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown3.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown3.Name = "numericUpDown3";
- this.numericUpDown3.Size = new System.Drawing.Size(82, 21);
- this.numericUpDown3.TabIndex = 21;
- this.numericUpDown3.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown3.ValueChanged += new System.EventHandler(this.numericUpDown3_ValueChanged);
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(6, 18);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(41, 12);
- this.label4.TabIndex = 0;
- //
- // panel9
- //
- this.panel9.Controls.Add(this.numericUpDown18);
- this.panel9.Controls.Add(this.label20);
- this.panel9.Location = new System.Drawing.Point(21, 75);
- this.panel9.Name = "panel9";
- this.panel9.Size = new System.Drawing.Size(272, 107);
- this.panel9.TabIndex = 28;
- //
- // numericUpDown18
- //
- this.numericUpDown18.Location = new System.Drawing.Point(52, 13);
- this.numericUpDown18.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown18.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown18.Name = "numericUpDown18";
- this.numericUpDown18.Size = new System.Drawing.Size(82, 21);
- this.numericUpDown18.TabIndex = 21;
- this.numericUpDown18.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown18.ValueChanged += new System.EventHandler(this.numericUpDown18_ValueChanged);
- //
- // label20
- //
- this.label20.AutoSize = true;
- this.label20.Location = new System.Drawing.Point(6, 18);
- this.label20.Name = "label20";
- this.label20.Size = new System.Drawing.Size(41, 12);
- this.label20.TabIndex = 0;
- //
- // panel5
- //
- this.panel5.Controls.Add(this.numericUpDown4);
- this.panel5.Controls.Add(this.label5);
- this.panel5.Location = new System.Drawing.Point(21, 75);
- this.panel5.Name = "panel5";
- this.panel5.Size = new System.Drawing.Size(272, 107);
- this.panel5.TabIndex = 24;
- //
- // numericUpDown4
- //
- this.numericUpDown4.Location = new System.Drawing.Point(52, 13);
- this.numericUpDown4.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown4.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown4.Name = "numericUpDown4";
- this.numericUpDown4.Size = new System.Drawing.Size(82, 21);
- this.numericUpDown4.TabIndex = 21;
- this.numericUpDown4.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown4.ValueChanged += new System.EventHandler(this.numericUpDown4_ValueChanged);
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(6, 18);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(41, 12);
- this.label5.TabIndex = 0;
- //
- // comboBox2
- //
- this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox2.FormattingEnabled = true;
- this.comboBox2.Items.AddRange(new object[] {
- "",
- ""});
- this.comboBox2.Location = new System.Drawing.Point(55, 49);
- this.comboBox2.Name = "comboBox2";
- this.comboBox2.Size = new System.Drawing.Size(241, 20);
- this.comboBox2.TabIndex = 26;
- this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged);
- //
- // panel6
- //
- this.panel6.Controls.Add(this.numericUpDown6);
- this.panel6.Controls.Add(this.label8);
- this.panel6.Controls.Add(this.numericUpDown5);
- this.panel6.Controls.Add(this.label6);
- this.panel6.Location = new System.Drawing.Point(21, 75);
- this.panel6.Name = "panel6";
- this.panel6.Size = new System.Drawing.Size(272, 107);
- this.panel6.TabIndex = 25;
- //
- // numericUpDown6
- //
- this.numericUpDown6.Location = new System.Drawing.Point(172, 13);
- this.numericUpDown6.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown6.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown6.Name = "numericUpDown6";
- this.numericUpDown6.Size = new System.Drawing.Size(75, 21);
- this.numericUpDown6.TabIndex = 23;
- this.numericUpDown6.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown6.ValueChanged += new System.EventHandler(this.numericUpDown6_ValueChanged);
- //
- // label8
- //
- this.label8.AutoSize = true;
- this.label8.Location = new System.Drawing.Point(135, 18);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(41, 12);
- this.label8.TabIndex = 22;
- //
- // numericUpDown5
- //
- this.numericUpDown5.Location = new System.Drawing.Point(65, 13);
- this.numericUpDown5.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown5.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown5.Name = "numericUpDown5";
- this.numericUpDown5.Size = new System.Drawing.Size(69, 21);
- this.numericUpDown5.TabIndex = 21;
- this.numericUpDown5.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown5.ValueChanged += new System.EventHandler(this.numericUpDown5_ValueChanged);
- //
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(6, 18);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(65, 12);
- this.label6.TabIndex = 0;
- //
- // panel8
- //
- this.panel8.Controls.Add(this.numericUpDown15);
- this.panel8.Controls.Add(this.label17);
- this.panel8.Controls.Add(this.numericUpDown16);
- this.panel8.Controls.Add(this.label18);
- this.panel8.Location = new System.Drawing.Point(21, 75);
- this.panel8.Name = "panel8";
- this.panel8.Size = new System.Drawing.Size(272, 107);
- this.panel8.TabIndex = 27;
- //
- // numericUpDown15
- //
- this.numericUpDown15.Location = new System.Drawing.Point(181, 13);
- this.numericUpDown15.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown15.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown15.Name = "numericUpDown15";
- this.numericUpDown15.Size = new System.Drawing.Size(82, 21);
- this.numericUpDown15.TabIndex = 23;
- this.numericUpDown15.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown15.ValueChanged += new System.EventHandler(this.numericUpDown15_ValueChanged);
- //
- // label17
- //
- this.label17.AutoSize = true;
- this.label17.Location = new System.Drawing.Point(135, 18);
- this.label17.Name = "label17";
- this.label17.Size = new System.Drawing.Size(53, 12);
- this.label17.TabIndex = 22;
- //
- // numericUpDown16
- //
- this.numericUpDown16.Location = new System.Drawing.Point(52, 13);
- this.numericUpDown16.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown16.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown16.Name = "numericUpDown16";
- this.numericUpDown16.Size = new System.Drawing.Size(82, 21);
- this.numericUpDown16.TabIndex = 21;
- this.numericUpDown16.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown16.ValueChanged += new System.EventHandler(this.numericUpDown16_ValueChanged);
- //
- // label18
- //
- this.label18.AutoSize = true;
- this.label18.Location = new System.Drawing.Point(6, 18);
- this.label18.Name = "label18";
- this.label18.Size = new System.Drawing.Size(53, 12);
- this.label18.TabIndex = 0;
- //
- // numericUpDown2
- //
- this.numericUpDown2.Location = new System.Drawing.Point(197, 235);
- this.numericUpDown2.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown2.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown2.Name = "numericUpDown2";
- this.numericUpDown2.Size = new System.Drawing.Size(82, 21);
- this.numericUpDown2.TabIndex = 14;
- this.numericUpDown2.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown2.ValueChanged += new System.EventHandler(this.numericUpDown2_ValueChanged);
- //
- // panel3
- //
- this.panel3.Controls.Add(this.numericUpDown20);
- this.panel3.Controls.Add(this.label22);
- this.panel3.Controls.Add(this.numericUpDown21);
- this.panel3.Controls.Add(this.label23);
- this.panel3.Controls.Add(this.numericUpDown1);
- this.panel3.Controls.Add(this.label1);
- this.panel3.Location = new System.Drawing.Point(21, 75);
- this.panel3.Name = "panel3";
- this.panel3.Size = new System.Drawing.Size(272, 107);
- this.panel3.TabIndex = 22;
- //
- // numericUpDown20
- //
- this.numericUpDown20.Location = new System.Drawing.Point(58, 42);
- this.numericUpDown20.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown20.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown20.Name = "numericUpDown20";
- this.numericUpDown20.Size = new System.Drawing.Size(82, 21);
- this.numericUpDown20.TabIndex = 29;
- this.numericUpDown20.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown20.ValueChanged += new System.EventHandler(this.numericUpDown20_ValueChanged);
- //
- // label22
- //
- this.label22.AutoSize = true;
- this.label22.Location = new System.Drawing.Point(7, 47);
- this.label22.Name = "label22";
- this.label22.Size = new System.Drawing.Size(53, 12);
- this.label22.TabIndex = 28;
- //
- // numericUpDown21
- //
- this.numericUpDown21.Location = new System.Drawing.Point(183, 14);
- this.numericUpDown21.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown21.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown21.Name = "numericUpDown21";
- this.numericUpDown21.Size = new System.Drawing.Size(82, 21);
- this.numericUpDown21.TabIndex = 27;
- this.numericUpDown21.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown21.ValueChanged += new System.EventHandler(this.numericUpDown21_ValueChanged);
- //
- // label23
- //
- this.label23.AutoSize = true;
- this.label23.Location = new System.Drawing.Point(140, 18);
- this.label23.Name = "label23";
- this.label23.Size = new System.Drawing.Size(41, 12);
- this.label23.TabIndex = 26;
- //
- // numericUpDown1
- //
- this.numericUpDown1.Location = new System.Drawing.Point(50, 14);
- this.numericUpDown1.Maximum = new decimal(new int[] {
- 9999999,
- 0,
- 0,
- 0});
- this.numericUpDown1.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown1.Name = "numericUpDown1";
- this.numericUpDown1.Size = new System.Drawing.Size(82, 21);
- this.numericUpDown1.TabIndex = 21;
- this.numericUpDown1.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(6, 18);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(41, 12);
- this.label1.TabIndex = 0;
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(154, 240);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(41, 12);
- this.label3.TabIndex = 2;
- //
- // comboBox1
- //
- this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox1.FormattingEnabled = true;
- this.comboBox1.Location = new System.Drawing.Point(55, 49);
- this.comboBox1.Name = "comboBox1";
- this.comboBox1.Size = new System.Drawing.Size(241, 20);
- this.comboBox1.TabIndex = 20;
- this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged_1);
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(55, 17);
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(241, 21);
- this.textBox1.TabIndex = 19;
- //
- // panel2
- //
- this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panel2.Location = new System.Drawing.Point(63, 235);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(81, 21);
- this.panel2.TabIndex = 12;
- this.panel2.BackColorChanged += new System.EventHandler(this.panel2_BackColorChanged);
- this.panel2.Click += new System.EventHandler(this.panel2_Click);
- //
- // panel7
- //
- this.panel7.Controls.Add(this.checkBox1);
- this.panel7.Controls.Add(this.numericUpDown14);
- this.panel7.Controls.Add(this.numericUpDown13);
- this.panel7.Controls.Add(this.label16);
- this.panel7.Controls.Add(this.label15);
- this.panel7.Controls.Add(this.numericUpDown11);
- this.panel7.Controls.Add(this.label13);
- this.panel7.Controls.Add(this.numericUpDown12);
- this.panel7.Controls.Add(this.label14);
- this.panel7.Controls.Add(this.numericUpDown10);
- this.panel7.Controls.Add(this.label12);
- this.panel7.Controls.Add(this.numericUpDown9);
- this.panel7.Controls.Add(this.label11);
- this.panel7.Controls.Add(this.numericUpDown7);
- this.panel7.Controls.Add(this.label9);
- this.panel7.Controls.Add(this.numericUpDown8);
- this.panel7.Controls.Add(this.label10);
- this.panel7.Location = new System.Drawing.Point(21, 75);
- this.panel7.Name = "panel7";
- this.panel7.Size = new System.Drawing.Size(272, 154);
- this.panel7.TabIndex = 26;
- //
- // checkBox1
- //
- this.checkBox1.AutoSize = true;
- this.checkBox1.Location = new System.Drawing.Point(191, 132);
- this.checkBox1.Name = "checkBox1";
- this.checkBox1.Size = new System.Drawing.Size(72, 16);
- this.checkBox1.TabIndex = 36;
- this.checkBox1.UseVisualStyleBackColor = true;
- //
- // numericUpDown14
- //
- this.numericUpDown14.Location = new System.Drawing.Point(101, 130);
- this.numericUpDown14.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown14.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown14.Name = "numericUpDown14";
- this.numericUpDown14.Size = new System.Drawing.Size(64, 21);
- this.numericUpDown14.TabIndex = 35;
- this.numericUpDown14.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
- //
- // numericUpDown13
- //
- this.numericUpDown13.Location = new System.Drawing.Point(91, 107);
- this.numericUpDown13.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown13.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown13.Name = "numericUpDown13";
- this.numericUpDown13.Size = new System.Drawing.Size(63, 21);
- this.numericUpDown13.TabIndex = 34;
- this.numericUpDown13.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
- //
- // label16
- //
- this.label16.AutoSize = true;
- this.label16.Location = new System.Drawing.Point(6, 133);
- this.label16.Name = "label16";
- this.label16.Size = new System.Drawing.Size(101, 12);
- this.label16.TabIndex = 33;
- //
- // label15
- //
- this.label15.AutoSize = true;
- this.label15.Location = new System.Drawing.Point(6, 109);
- this.label15.Name = "label15";
- this.label15.Size = new System.Drawing.Size(89, 12);
- this.label15.TabIndex = 32;
- //
- // numericUpDown11
- //
- this.numericUpDown11.Location = new System.Drawing.Point(129, 83);
- this.numericUpDown11.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown11.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown11.Name = "numericUpDown11";
- this.numericUpDown11.Size = new System.Drawing.Size(63, 21);
- this.numericUpDown11.TabIndex = 31;
- this.numericUpDown11.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
- //
- // label13
- //
- this.label13.AutoSize = true;
- this.label13.Location = new System.Drawing.Point(6, 86);
- this.label13.Name = "label13";
- this.label13.Size = new System.Drawing.Size(125, 12);
- this.label13.TabIndex = 30;
- //
- // numericUpDown12
- //
- this.numericUpDown12.Location = new System.Drawing.Point(129, 57);
- this.numericUpDown12.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown12.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown12.Name = "numericUpDown12";
- this.numericUpDown12.Size = new System.Drawing.Size(63, 21);
- this.numericUpDown12.TabIndex = 29;
- this.numericUpDown12.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
- //
- // label14
- //
- this.label14.AutoSize = true;
- this.label14.Location = new System.Drawing.Point(6, 61);
- this.label14.Name = "label14";
- this.label14.Size = new System.Drawing.Size(125, 12);
- this.label14.TabIndex = 28;
- //
- // numericUpDown10
- //
- this.numericUpDown10.Location = new System.Drawing.Point(200, 32);
- this.numericUpDown10.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown10.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown10.Name = "numericUpDown10";
- this.numericUpDown10.Size = new System.Drawing.Size(63, 21);
- this.numericUpDown10.TabIndex = 27;
- this.numericUpDown10.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
- //
- // label12
- //
- this.label12.AutoSize = true;
- this.label12.Location = new System.Drawing.Point(167, 36);
- this.label12.Name = "label12";
- this.label12.Size = new System.Drawing.Size(41, 12);
- this.label12.TabIndex = 26;
- //
- // numericUpDown9
- //
- this.numericUpDown9.Location = new System.Drawing.Point(66, 32);
- this.numericUpDown9.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown9.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown9.Name = "numericUpDown9";
- this.numericUpDown9.Size = new System.Drawing.Size(65, 21);
- this.numericUpDown9.TabIndex = 25;
- this.numericUpDown9.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
- //
- // label11
- //
- this.label11.AutoSize = true;
- this.label11.Location = new System.Drawing.Point(6, 36);
- this.label11.Name = "label11";
- this.label11.Size = new System.Drawing.Size(65, 12);
- this.label11.TabIndex = 24;
- //
- // numericUpDown7
- //
- this.numericUpDown7.Location = new System.Drawing.Point(200, 6);
- this.numericUpDown7.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown7.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown7.Name = "numericUpDown7";
- this.numericUpDown7.Size = new System.Drawing.Size(63, 21);
- this.numericUpDown7.TabIndex = 23;
- this.numericUpDown7.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
- //
- // label9
- //
- this.label9.AutoSize = true;
- this.label9.Location = new System.Drawing.Point(131, 11);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(77, 12);
- this.label9.TabIndex = 22;
- //
- // numericUpDown8
- //
- this.numericUpDown8.Location = new System.Drawing.Point(66, 6);
- this.numericUpDown8.Maximum = new decimal(new int[] {
- 99999999,
- 0,
- 0,
- 0});
- this.numericUpDown8.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown8.Name = "numericUpDown8";
- this.numericUpDown8.Size = new System.Drawing.Size(63, 21);
- this.numericUpDown8.TabIndex = 21;
- this.numericUpDown8.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
- //
- // label10
- //
- this.label10.AutoSize = true;
- this.label10.Location = new System.Drawing.Point(6, 11);
- this.label10.Name = "label10";
- this.label10.Size = new System.Drawing.Size(65, 12);
- this.label10.TabIndex = 0;
- //
- // label7
- //
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(19, 23);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(41, 12);
- this.label7.TabIndex = 18;
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(19, 240);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(41, 12);
- this.label2.TabIndex = 1;
- //
- // label24
- //
- this.label24.AutoSize = true;
- this.label24.Location = new System.Drawing.Point(19, 52);
- this.label24.Name = "label24";
- this.label24.Size = new System.Drawing.Size(41, 12);
- this.label24.TabIndex = 29;
- //
- // groupBox3
- //
- this.groupBox3.Controls.Add(this.panel1);
- this.groupBox3.Location = new System.Drawing.Point(193, 338);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(319, 213);
- this.groupBox3.TabIndex = 1;
- this.groupBox3.TabStop = false;
- //
- // panel1
- //
- this.panel1.Location = new System.Drawing.Point(6, 17);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(307, 190);
- this.panel1.TabIndex = 0;
- this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
- //
- // groupBox4
- //
- this.groupBox4.Controls.Add(this.dataGridView1);
- this.groupBox4.Controls.Add(this.button5);
- this.groupBox4.Controls.Add(this.button4);
- this.groupBox4.Controls.Add(this.button3);
- this.groupBox4.Location = new System.Drawing.Point(12, 72);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Size = new System.Drawing.Size(175, 473);
- this.groupBox4.TabIndex = 2;
- this.groupBox4.TabStop = false;
- //
- // dataGridView1
- //
- this.dataGridView1.AllowUserToAddRows = false;
- this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
- this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control;
- this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView1.ColumnHeadersVisible = false;
- this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.GuideName,
- this.Column1,
- this.GrainType});
- this.dataGridView1.Location = new System.Drawing.Point(6, 53);
- this.dataGridView1.MultiSelect = false;
- this.dataGridView1.Name = "dataGridView1";
- this.dataGridView1.RowHeadersVisible = false;
- this.dataGridView1.RowTemplate.Height = 23;
- this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
- this.dataGridView1.Size = new System.Drawing.Size(162, 414);
- this.dataGridView1.TabIndex = 4;
- this.dataGridView1.SelectionChanged += new System.EventHandler(this.dataGridView1_SelectionChanged);
- //
- // GuideName
- //
- this.GuideName.HeaderText = "";
- this.GuideName.Name = "GuideName";
- //
- // Column1
- //
- this.Column1.HeaderText = "Column1";
- this.Column1.Name = "Column1";
- this.Column1.Visible = false;
- //
- // GrainType
- //
- this.GrainType.HeaderText = "Column1";
- this.GrainType.Name = "GrainType";
- this.GrainType.Visible = false;
- //
- // button5
- //
- this.button5.Location = new System.Drawing.Point(138, 18);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(30, 25);
- this.button5.TabIndex = 3;
- this.button5.UseVisualStyleBackColor = true;
- this.button5.Click += new System.EventHandler(this.button5_Click);
- //
- // button4
- //
- this.button4.Location = new System.Drawing.Point(104, 18);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(30, 25);
- this.button4.TabIndex = 2;
- this.button4.UseVisualStyleBackColor = true;
- this.button4.Click += new System.EventHandler(this.button4_Click);
- //
- // button3
- //
- this.button3.Location = new System.Drawing.Point(70, 18);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(30, 25);
- this.button3.TabIndex = 1;
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += new System.EventHandler(this.button3_Click);
- //
- // GrainGuideSettingsDialog
- //
- this.ClientSize = new System.Drawing.Size(521, 553);
- this.Controls.Add(this.groupBox4);
- this.Controls.Add(this.groupBox3);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox1);
- this.MaximizeBox = false;
- this.MaximumSize = new System.Drawing.Size(537, 592);
- this.MinimizeBox = false;
- this.MinimumSize = new System.Drawing.Size(537, 592);
- this.Name = "GrainGuideSettingsDialog";
- this.ShowInTaskbar = false;
- this.Load += new System.EventHandler(this.GrainGuideSettingsDialog_Load);
- this.groupBox1.ResumeLayout(false);
- this.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- this.panel4.ResumeLayout(false);
- this.panel4.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown19)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown17)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
- this.panel9.ResumeLayout(false);
- this.panel9.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown18)).EndInit();
- this.panel5.ResumeLayout(false);
- this.panel5.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();
- this.panel6.ResumeLayout(false);
- this.panel6.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).EndInit();
- this.panel8.ResumeLayout(false);
- this.panel8.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown15)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown16)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
- this.panel3.ResumeLayout(false);
- this.panel3.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown20)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown21)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
- this.panel7.ResumeLayout(false);
- this.panel7.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown14)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown13)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown11)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown12)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown10)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown9)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown7)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown8)).EndInit();
- this.groupBox3.ResumeLayout(false);
- this.groupBox4.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
- this.ResumeLayout(false);
- }
- #endregion
- private void InitializeToolTip()
- {
- this.toolTip1 = new ToolTip();
- this.toolTip1.SetToolTip(this.button3, PdnResources.GetString("Menu.Addto.text"));
- this.toolTip1.SetToolTip(this.button4, PdnResources.GetString("Menu.Edit.Text"));
- this.toolTip1.SetToolTip(this.button5, PdnResources.GetString("Menu.Edit.Delete.Text"));
- this.toolTip1.ShowAlways = true;
- }
- private void InitializeButtonBackgroudImage()
- {
- this.button3.FlatStyle = FlatStyle.Flat;
- this.button3.FlatAppearance.BorderSize = 0;
- this.button3.BackgroundImageLayout = ImageLayout.Center;
- this.button3.BackgroundImage = PdnResources.GetImageResource("Icons.MenuRulesListAddIcon.png").Reference;
- this.button4.FlatStyle = FlatStyle.Flat;
- this.button4.FlatAppearance.BorderSize = 0;
- this.button4.BackgroundImageLayout = ImageLayout.Center;
- this.button4.BackgroundImage = PdnResources.GetImageResource("Icons.MenuRulesListEditIcon.png").Reference;
- this.button5.FlatStyle = FlatStyle.Flat;
- this.button5.FlatAppearance.BorderSize = 0;
- this.button5.BackgroundImageLayout = ImageLayout.Center;
- this.button5.BackgroundImage = PdnResources.GetImageResource("Icons.MenuRulesListDeleteIcon.png").Reference;
- }
- /// <summary>
- /// 初始化数据
- /// </summary>
- private void InitializeData()
- {
- if (this.comboBox1.Items.Count > 0)
- this.comboBox1.SelectedIndex = 0;
- this.comboBox2.SelectedIndex = 0;
- if(this.picture == 0)
- {
- this.comboBox1.Visible = true;
- this.comboBox2.Visible = false;
- }
- else if (this.picture == 1)
- {
- this.comboBox1.Visible = false;
- this.comboBox2.Visible = true;
- }
- this.groupBox2.Enabled = false;
- this.dataGridView1.ReadOnly = true;
- this.numericUpDown15.Maximum = 999999;
- this.numericUpDown15.Minimum = 1;
- this.numericUpDown16.Maximum = 999999;
- this.numericUpDown16.Minimum = 1;
- if (this.picture == 0)
- {
- GrainSizeGuideStyleModel grainSizeGuideStyleModel = XmlSerializeHelper.DESerializer<GrainSizeGuideStyleModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\" + this.xmlModelName, FileMode.Open));
- // 垂直辅助线
- if (grainSizeGuideStyleModel.vGuideStyles != null)//###
- {
- foreach (var vGuideStyle in grainSizeGuideStyleModel.vGuideStyles)
- {
- index++;
- DataGridViewRow row = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView1.Columns)
- {
- row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- row.Cells[0].Value = vGuideStyle.tag;
- row.Cells[1].Value = PdnResources.GetString("Menu.Verticalauxiliaryline.text");
- row.Cells[2].Value = vGuideStyle.index;
- this.dataGridView1.Rows.Add(row);
- ArrayList arrayList = new ArrayList();
- arrayList.Add(vGuideStyle.tag);
- arrayList.Add(PdnResources.GetString("Menu.Verticalauxiliaryline.text"));
- arrayList.Add(vGuideStyle.lineLength);
- arrayList.Add(vGuideStyle.lineSpacing);
- arrayList.Add(vGuideStyle.lineDec);
- arrayList.Add(vGuideStyle.lineColor);
- arrayList.Add(vGuideStyle.lineWidth);
- arrayList.Add(vGuideStyle.index);
- this.arrayLists.Add(arrayList);
- }
- }
- // 水平辅助线
- if (grainSizeGuideStyleModel.hGuideStyles != null)
- {
- foreach (var hGuideStyle in grainSizeGuideStyleModel.hGuideStyles)
- {
- index++;
- DataGridViewRow row = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView1.Columns)
- {
- row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- row.Cells[0].Value = hGuideStyle.tag;
- row.Cells[1].Value = PdnResources.GetString("Menu.Horizontalauxiliaryline.text");
- row.Cells[2].Value = hGuideStyle.index;
- this.dataGridView1.Rows.Add(row);
- ArrayList arrayList = new ArrayList();
- arrayList.Add(hGuideStyle.tag);
- arrayList.Add(PdnResources.GetString("Menu.Horizontalauxiliaryline.text"));
- arrayList.Add(hGuideStyle.lineLength);
- arrayList.Add(hGuideStyle.lineSpacing);
- arrayList.Add(hGuideStyle.lineDec);
- arrayList.Add(hGuideStyle.lineColor);
- arrayList.Add(hGuideStyle.lineWidth);
- arrayList.Add(hGuideStyle.index);
- this.arrayLists.Add(arrayList);
- }
- }
- // 单圆辅助线
- if (grainSizeGuideStyleModel.cGuideStyles != null/* && this.gbtType != 1*/)//###
- {
- foreach (var cGuideStyle in grainSizeGuideStyleModel.cGuideStyles)
- {
- index++;
- DataGridViewRow row = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView1.Columns)
- {
- row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- row.Cells[0].Value = cGuideStyle.tag;
- row.Cells[1].Value = PdnResources.GetString("Menu.Singlecircleauxiliaryline.text");
- row.Cells[2].Value = cGuideStyle.index;
- this.dataGridView1.Rows.Add(row);
- ArrayList arrayList = new ArrayList();
- arrayList.Add(cGuideStyle.tag);
- arrayList.Add(PdnResources.GetString("Menu.Singlecircleauxiliaryline.text"));
- arrayList.Add(cGuideStyle.diameter);
- arrayList.Add(cGuideStyle.lineColor);
- arrayList.Add(cGuideStyle.lineWidth);
- arrayList.Add(cGuideStyle.index);
- this.arrayLists.Add(arrayList);
- }
- }
- // 三圆辅助线
- if (grainSizeGuideStyleModel.tCGuideStyles != null)
- {
- foreach (var tCGuideStyle in grainSizeGuideStyleModel.tCGuideStyles)
- {
- index++;
- DataGridViewRow row = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView1.Columns)
- {
- row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- row.Cells[0].Value = tCGuideStyle.tag;
- row.Cells[1].Value = PdnResources.GetString("Menu.Three-circleauxiliaryline.text");
- row.Cells[2].Value = tCGuideStyle.index;
- this.dataGridView1.Rows.Add(row);
- ArrayList arrayList = new ArrayList();
- arrayList.Add(tCGuideStyle.tag);
- arrayList.Add(PdnResources.GetString("Menu.Three-circleauxiliaryline.text"));
- arrayList.Add(tCGuideStyle.diameter);
- arrayList.Add(tCGuideStyle.margin);
- arrayList.Add(tCGuideStyle.lineColor);
- arrayList.Add(tCGuideStyle.lineWidth);
- arrayList.Add(tCGuideStyle.index);
- this.arrayLists.Add(arrayList);
- }
- }
- // 复合辅助线
- if (grainSizeGuideStyleModel.rGuideStyles != null/* && this.gbtType != 1 && this.gbtType != 13*/)//###
- {
- foreach (var rGuideStyle in grainSizeGuideStyleModel.rGuideStyles)
- {
- index++;
- DataGridViewRow row = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView1.Columns)
- {
- row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- row.Cells[0].Value = rGuideStyle.tag;
- row.Cells[1].Value = PdnResources.GetString("Menu.Compositeauxiliaryline.text");
- row.Cells[2].Value = rGuideStyle.index;
- this.dataGridView1.Rows.Add(row);
- ArrayList arrayList = new ArrayList();
- arrayList.Add(rGuideStyle.tag);
- arrayList.Add(PdnResources.GetString("Menu.Compositeauxiliaryline.text"));
- arrayList.Add(rGuideStyle.vLineLength);
- arrayList.Add(rGuideStyle.hLineLength);
- arrayList.Add(rGuideStyle.diameter);
- arrayList.Add(rGuideStyle.margin);
- arrayList.Add(rGuideStyle.TopleftLineLength);
- arrayList.Add(rGuideStyle.ToprightLineLength);
- arrayList.Add(rGuideStyle.VLineToCDistance);
- arrayList.Add(rGuideStyle.HLineToCDistance);
- arrayList.Add(rGuideStyle.lineColor);
- arrayList.Add(rGuideStyle.lineWidth);
- arrayList.Add(rGuideStyle.index);
- this.arrayLists.Add(arrayList);
- }
- }
- }
- else if(this.picture == 1)
- {
- GrainSizeGuideAreaMethodModel grainSizeGuideAreaMethodModel = XmlSerializeHelper.DESerializer<GrainSizeGuideAreaMethodModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\" + this.xmlModelName, FileMode.Open));
- // 圆形
- if (grainSizeGuideAreaMethodModel.circularGuideStyles != null)
- {
- foreach (var circularGuideStyle in grainSizeGuideAreaMethodModel.circularGuideStyles)
- {
- index++;
- DataGridViewRow row = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView1.Columns)
- {
- row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- row.Cells[0].Value = circularGuideStyle.tag;
- row.Cells[1].Value = PdnResources.GetString("Menu.circular.Text");
- row.Cells[2].Value = circularGuideStyle.index;
- this.dataGridView1.Rows.Add(row);
- ArrayList arrayList = new ArrayList();
- arrayList.Add(circularGuideStyle.tag);
- arrayList.Add(PdnResources.GetString("Menu.circular.Text"));
- arrayList.Add(circularGuideStyle.lineDiameter);
- arrayList.Add(circularGuideStyle.lineColor);
- arrayList.Add(circularGuideStyle.lineWidth);
- arrayList.Add(circularGuideStyle.index);
- this.arrayLists.Add(arrayList);
- }
- }
- // 矩形
- if (grainSizeGuideAreaMethodModel.rectangleGuideStyles != null)//###
- {
- foreach (var rectangleGuideStyle in grainSizeGuideAreaMethodModel.rectangleGuideStyles)
- {
- index++;
- DataGridViewRow row = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView1.Columns)
- {
- row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- row.Cells[0].Value = rectangleGuideStyle.tag;
- row.Cells[1].Value = PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text");
- row.Cells[2].Value = rectangleGuideStyle.index;
- this.dataGridView1.Rows.Add(row);
- ArrayList arrayList = new ArrayList();
- arrayList.Add(rectangleGuideStyle.tag);
- arrayList.Add(PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text"));
- arrayList.Add(rectangleGuideStyle.lineRectangleWidth);
- arrayList.Add(rectangleGuideStyle.lineRectangleHeight);
- arrayList.Add(rectangleGuideStyle.lineColor);
- arrayList.Add(rectangleGuideStyle.lineWidth);
- arrayList.Add(rectangleGuideStyle.index);
- this.arrayLists.Add(arrayList);
- }
- }
- }
- dataGridView1.Sort(dataGridView1.Columns[2], ListSortDirection.Ascending);
- }
- /// <summary>
- /// 保存到配置文件
- /// </summary>
- private void SaveXmlFile()
- {
- if (this.picture == 0)
- {
- GrainSizeGuideStyleModel grainSizeGuideStyleModel = new GrainSizeGuideStyleModel();
- grainSizeGuideStyleModel.vGuideStyles = new List<GrainSizeGuideStyleModel.VGuideStyle>();
- grainSizeGuideStyleModel.hGuideStyles = new List<GrainSizeGuideStyleModel.HGuideStyle>();
- grainSizeGuideStyleModel.cGuideStyles = new List<GrainSizeGuideStyleModel.CGuideStyle>();
- grainSizeGuideStyleModel.tCGuideStyles = new List<GrainSizeGuideStyleModel.TCGuideStyle>();
- grainSizeGuideStyleModel.rGuideStyles = new List<GrainSizeGuideStyleModel.RGuideStyle>();
- foreach (ArrayList arrayList1 in this.arrayLists)
- {
- if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(arrayList1[1]))
- {
- GrainSizeGuideStyleModel.VGuideStyle vGuideStyle = new GrainSizeGuideStyleModel.VGuideStyle();
- vGuideStyle.tag = arrayList1[0].ToString();
- vGuideStyle.lineLength = Convert.ToInt32(arrayList1[2]);
- vGuideStyle.lineSpacing = Convert.ToInt32(arrayList1[3]);
- vGuideStyle.lineDec = Convert.ToInt32(arrayList1[4]);
- vGuideStyle.lineColor = Convert.ToInt32(arrayList1[5]);
- vGuideStyle.lineWidth = Convert.ToInt32(arrayList1[6]);
- vGuideStyle.index = Convert.ToInt32(arrayList1[7]);
- grainSizeGuideStyleModel.vGuideStyles.Add(vGuideStyle);
- }
- else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(arrayList1[1]))
- {
- GrainSizeGuideStyleModel.HGuideStyle hGuideStyle = new GrainSizeGuideStyleModel.HGuideStyle();
- hGuideStyle.tag = arrayList1[0].ToString();
- hGuideStyle.lineLength = Convert.ToInt32(arrayList1[2]);
- hGuideStyle.lineSpacing = Convert.ToInt32(arrayList1[3]);
- hGuideStyle.lineDec = Convert.ToInt32(arrayList1[4]);
- hGuideStyle.lineColor = Convert.ToInt32(arrayList1[5]);
- hGuideStyle.lineWidth = Convert.ToInt32(arrayList1[6]);
- hGuideStyle.index = Convert.ToInt32(arrayList1[7]);
- grainSizeGuideStyleModel.hGuideStyles.Add(hGuideStyle);
- }
- else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(arrayList1[1]))
- {
- GrainSizeGuideStyleModel.CGuideStyle cGuideStyle = new GrainSizeGuideStyleModel.CGuideStyle();
- cGuideStyle.tag = arrayList1[0].ToString();
- cGuideStyle.diameter = Convert.ToInt32(arrayList1[2]);
- cGuideStyle.lineColor = Convert.ToInt32(arrayList1[3]);
- cGuideStyle.lineWidth = Convert.ToInt32(arrayList1[4]);
- cGuideStyle.index = Convert.ToInt32(arrayList1[5]);
- grainSizeGuideStyleModel.cGuideStyles.Add(cGuideStyle);
- }
- else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(arrayList1[1]))
- {
- GrainSizeGuideStyleModel.TCGuideStyle tCGuideStyle = new GrainSizeGuideStyleModel.TCGuideStyle();
- tCGuideStyle.tag = arrayList1[0].ToString();
- tCGuideStyle.diameter = Convert.ToInt32(arrayList1[2]);
- tCGuideStyle.margin = Convert.ToInt32(arrayList1[3]);
- tCGuideStyle.lineColor = Convert.ToInt32(arrayList1[4]);
- tCGuideStyle.lineWidth = Convert.ToInt32(arrayList1[5]);
- tCGuideStyle.index = Convert.ToInt32(arrayList1[6]);
- grainSizeGuideStyleModel.tCGuideStyles.Add(tCGuideStyle);
- }
- else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(arrayList1[1]))
- {
- GrainSizeGuideStyleModel.RGuideStyle rGuideStyle = new GrainSizeGuideStyleModel.RGuideStyle();
- rGuideStyle.tag = arrayList1[0].ToString();
- rGuideStyle.vLineLength = Convert.ToInt32(arrayList1[2]);
- rGuideStyle.hLineLength = Convert.ToInt32(arrayList1[3]);
- rGuideStyle.diameter = Convert.ToInt32(arrayList1[4]);
- rGuideStyle.margin = Convert.ToInt32(arrayList1[5]);
- rGuideStyle.TopleftLineLength = Convert.ToInt32(arrayList1[6]);
- rGuideStyle.ToprightLineLength = Convert.ToInt32(arrayList1[7]);
- rGuideStyle.VLineToCDistance = Convert.ToInt32(arrayList1[8]);
- rGuideStyle.HLineToCDistance = Convert.ToInt32(arrayList1[9]);
- rGuideStyle.lineColor = Convert.ToInt32(arrayList1[10]);
- rGuideStyle.lineWidth = Convert.ToInt32(arrayList1[11]);
- rGuideStyle.index = Convert.ToInt32(arrayList1[12]);
- grainSizeGuideStyleModel.rGuideStyles.Add(rGuideStyle);
- }
- }
- //以下保存xml文件信息
- string stageModelXml = XmlSerializeHelper.XmlSerialize<GrainSizeGuideStyleModel>(grainSizeGuideStyleModel);
- string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\" + this.xmlModelName;
- FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create);
- }
- else if (this.picture == 1)
- {
- GrainSizeGuideAreaMethodModel grainSizeGuideAreaMethodModel = new GrainSizeGuideAreaMethodModel();
- grainSizeGuideAreaMethodModel.circularGuideStyles = new List<GrainSizeGuideAreaMethodModel.circular>();
- grainSizeGuideAreaMethodModel.rectangleGuideStyles = new List<GrainSizeGuideAreaMethodModel.rectangle>();
- foreach (ArrayList arrayList1 in this.arrayLists)
- {
- if (PdnResources.GetString("Menu.circular.Text").Equals(arrayList1[1]))
- {
- GrainSizeGuideAreaMethodModel.circular circular = new GrainSizeGuideAreaMethodModel.circular();
- circular.tag = arrayList1[0].ToString();
- circular.lineDiameter = Convert.ToInt32(arrayList1[2]);
- circular.lineColor = Convert.ToInt32(arrayList1[3]);
- circular.lineWidth = Convert.ToInt32(arrayList1[4]);
- circular.index = Convert.ToInt32(arrayList1[5]);
- grainSizeGuideAreaMethodModel.circularGuideStyles.Add(circular);
- }
- else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(arrayList1[1]))
- {
- GrainSizeGuideAreaMethodModel.rectangle rectangle = new GrainSizeGuideAreaMethodModel.rectangle();
- rectangle.tag = arrayList1[0].ToString();
- rectangle.lineRectangleWidth = Convert.ToInt32(arrayList1[2]);
- rectangle.lineRectangleHeight = Convert.ToInt32(arrayList1[3]);
- rectangle.lineColor = Convert.ToInt32(arrayList1[4]);
- rectangle.lineWidth = Convert.ToInt32(arrayList1[5]);
- rectangle.index = Convert.ToInt32(arrayList1[6]);
- grainSizeGuideAreaMethodModel.rectangleGuideStyles.Add(rectangle);
- }
- }
- //以下保存xml文件信息
- string stageModelXml = XmlSerializeHelper.XmlSerialize<GrainSizeGuideAreaMethodModel>(grainSizeGuideAreaMethodModel);
- string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\" + this.xmlModelName;
- FileOperationHelper.WriteStringToFile(stageModelXml, filePath, FileMode.Create);
- }
- }
- /// <summary>
- /// 页面关闭
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button1_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
- {
- }
- private void panel2_Click(object sender, EventArgs e)
- {
- this.colorsForm.UserPrimaryColor = ColorBgra.FromColor(this.panel2.BackColor);
- this.colorsForm.setSaveBtn_Click(new System.EventHandler(this.panel2Changed));
- this.colorsForm.ShowDialog();
- }
- private void panel2Changed(object sender, EventArgs e)
- {
- this.panel2.BackColor = this.colorsForm.UserPrimaryColor.ToColor();
- this.colorsForm.Close();
- }
- private void InitGroupbox2()
- {
- this.textBox1.Clear();
- if (this.comboBox1.Items.Count > 0)
- this.comboBox1.SelectedIndex = 0;
- this.comboBox2.SelectedIndex = 0;
- this.numericUpDown1.Value = 1;
- this.numericUpDown2.Value = 1;
- this.numericUpDown3.Value = 1;
- this.numericUpDown4.Value = 1;
- this.numericUpDown5.Value = 1;
- this.numericUpDown6.Value = 1;
- this.numericUpDown7.Value = 1;
- this.numericUpDown8.Value = 1;
- this.numericUpDown9.Value = 1;
- this.numericUpDown10.Value = 1;
- this.numericUpDown11.Value = 1;
- this.numericUpDown12.Value = 1;
- this.numericUpDown13.Value = 1;
- this.numericUpDown14.Value = 1;
- this.numericUpDown15.Value = 1;
- this.numericUpDown16.Value = 1;
- this.numericUpDown18.Value = 1;
- this.numericUpDown17.Value = 1;
- this.numericUpDown19.Value = 1;
- this.numericUpDown20.Value = 1;
- this.numericUpDown21.Value = 1;
- }
- /// <summary>
- /// 返回维护的辅助线
- /// </summary>
- /// <param name="currentOperation">操作区分(0 :添加 1 :编辑 2 :删除)</param>
- private void ReturnGrainSize(int currentOperation = -1)
- {
- ArrayList arrayList = new ArrayList();
- for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
- {
- arrayList.Add(this.dataGridView1.Rows[i].Cells[0].Value);
- }
- if (this.Owner is GrainSizeStandardDialog)
- {
- GrainSizeStandardDialog grainSizeMethodDialog = (GrainSizeStandardDialog)this.Owner;
- if (currentOperation == 0)//#21794
- grainSizeMethodDialog.AddComboboxValue(arrayList);
- else
- {
- grainSizeMethodDialog.comboboxChange = false;
- grainSizeMethodDialog.InitComboboxValue(arrayList);
- }
- }
- //if (this.picture == 0)//###
- //{
- // ArrayList arrayList = new ArrayList();
- // for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
- // {
- // arrayList.Add(this.dataGridView1.Rows[i].Cells[0].Value);
- // }
- // GrainSizeStandardDialog grainSizeMethodDialog = (GrainSizeStandardDialog)this.Owner;
- // grainSizeMethodDialog.comboboxChange = false;
- // grainSizeMethodDialog.InitComboboxValue(arrayList);
- //}
- //else if(this.picture == 1)
- //{
- // ArrayList arrayList = new ArrayList();
- // for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
- // {
- // arrayList.Add(this.dataGridView1.Rows[i].Cells[0].Value);
- // }
- // GrainSizeStandardDialog grainSizeMethodDialog = (GrainSizeStandardDialog)this.Owner;
- // grainSizeMethodDialog.comboboxChange = false;
- // grainSizeMethodDialog.InitComboboxValue(arrayList);
- //}
-
- }
- /// <summary>
- /// 保存按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button2_Click(object sender, EventArgs e)
- {
- int currentOperation = this.operation;
- if (this.picture == 0)
- {
- // 添加
- if (this.operation == 0)
- {
- if (string.IsNullOrEmpty(this.textBox1.Text))
- {
- MessageBox.Show(PdnResources.GetString("Menu.namecannotbeEmpty.text")+"!");
- }
- else
- {
- bool next = true;
- for (int r = 0; r < this.dataGridView1.Rows.Count; r++)
- {
- if (this.dataGridView1.Rows[r].Cells[0].Value.Equals(this.textBox1.Text))
- {
- MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
- next = false;
- break;
- }
- }
- if (next)
- {
- index++;
- ArrayList arrayList = new ArrayList();
- if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- arrayList.Add(this.textBox1.Text);
- arrayList.Add(this.comboBox1.SelectedItem);
- arrayList.Add(Convert.ToInt32(this.numericUpDown1.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown21.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown20.Value));
- arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
- arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
- arrayList.Add(index);
- }
- else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- arrayList.Add(this.textBox1.Text);
- arrayList.Add(this.comboBox1.SelectedItem);
- arrayList.Add(Convert.ToInt32(this.numericUpDown3.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown17.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown19.Value));
- arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
- arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
- arrayList.Add(index);
- }
- else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- arrayList.Add(this.textBox1.Text);
- arrayList.Add(this.comboBox1.SelectedItem);
- arrayList.Add(Convert.ToInt32(this.numericUpDown4.Value));
- arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
- arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
- arrayList.Add(index);
- }
- else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- arrayList.Add(this.textBox1.Text);
- arrayList.Add(this.comboBox1.SelectedItem);
- arrayList.Add(Convert.ToInt32(this.numericUpDown5.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown6.Value));
- arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
- arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
- arrayList.Add(index);
- }
- else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- arrayList.Add(this.textBox1.Text);
- arrayList.Add(this.comboBox1.SelectedItem);
- arrayList.Add(Convert.ToInt32(this.numericUpDown8.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown7.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown9.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown10.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown12.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown11.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown13.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown14.Value));
- arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
- arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
- arrayList.Add(index);
- }
- this.arrayLists.Add(arrayList);
- DataGridViewRow row = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView1.Columns)
- {
- row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- row.Cells[0].Value = this.textBox1.Text;
- row.Cells[1].Value = this.comboBox1.SelectedItem;
- this.dataGridView1.Rows.Add(row);
- SaveXmlFile();
- //MessageBox.Show(PdnResources.GetString("Menu.Addsuccessfully.text")+"!");//###20506
- operation = -1;
- this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Selected = true;
- }
- }
- }
- // 编辑
- else if (this.operation == 1)
- {
- if (string.IsNullOrEmpty(this.textBox1.Text))
- {
- MessageBox.Show(PdnResources.GetString("Menu.namecannotbeEmpty.text")+"!");
- }
- else
- {
- bool next = true;
- for (int r = 0; r < this.dataGridView1.Rows.Count; r++)
- {
- if (this.dataGridView1.Rows[r].Cells[0].Value.Equals(this.textBox1.Text) && this.dataGridView1.SelectedRows[0].Index != r)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
- next = false;
- break;
- }
- }
- if (next)
- {
- int updIndex = 0;
- foreach (var arrayList1 in this.arrayLists)
- {
- if (arrayList1[0].ToString().Equals(this.dataGridView1.SelectedRows[0].Cells[0].Value))
- {
- updIndex = Convert.ToInt32(arrayList1[arrayList1.Count - 1]);
- this.arrayLists.Remove(arrayList1);
- break;
- }
- }
- ArrayList arrayList = new ArrayList();
- if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- arrayList.Add(this.textBox1.Text);
- arrayList.Add(this.comboBox1.SelectedItem);
- arrayList.Add(Convert.ToInt32(this.numericUpDown1.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown21.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown20.Value));
- arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
- arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
- arrayList.Add(updIndex);
- }
- else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- arrayList.Add(this.textBox1.Text);
- arrayList.Add(this.comboBox1.SelectedItem);
- arrayList.Add(Convert.ToInt32(this.numericUpDown3.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown17.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown19.Value));
- arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
- arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
- arrayList.Add(updIndex);
- }
- else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- arrayList.Add(this.textBox1.Text);
- arrayList.Add(this.comboBox1.SelectedItem);
- arrayList.Add(Convert.ToInt32(this.numericUpDown4.Value));
- arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
- arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
- arrayList.Add(updIndex);
- }
- else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- arrayList.Add(this.textBox1.Text);
- arrayList.Add(this.comboBox1.SelectedItem);
- arrayList.Add(Convert.ToInt32(this.numericUpDown5.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown6.Value));
- arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
- arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
- arrayList.Add(updIndex);
- }
- else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- arrayList.Add(this.textBox1.Text);
- arrayList.Add(this.comboBox1.SelectedItem);
- arrayList.Add(Convert.ToInt32(this.numericUpDown8.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown7.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown9.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown10.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown12.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown11.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown13.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown14.Value));
- arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
- arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
- arrayList.Add(updIndex);
- }
- this.arrayLists.Add(arrayList);
- this.dataGridView1.SelectedRows[0].Cells[0].Value = this.textBox1.Text;
- this.dataGridView1.SelectedRows[0].Cells[1].Value = this.comboBox1.SelectedItem;
- SaveXmlFile();
- //MessageBox.Show(PdnResources.GetString("Menu.Editsuccessfully.text")+"!");//###20506
- operation = -1;
- this.groupBox2.Enabled = false;
- }
- }
- }
- }
- else if(this.picture == 1)
- {
- // 添加
- if (this.operation == 0)
- {
- if (string.IsNullOrEmpty(this.textBox1.Text))
- {
- MessageBox.Show(PdnResources.GetString("Menu.namecannotbeEmpty.text")+"!");
- }
- else
- {
- bool next = true;
- for (int r = 0; r < this.dataGridView1.Rows.Count; r++)
- {
- if (this.dataGridView1.Rows[r].Cells[0].Value.Equals(this.textBox1.Text))
- {
- MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
- next = false;
- break;
- }
- }
- if (next)
- {
- index++;
- ArrayList arrayList = new ArrayList();
- if (PdnResources.GetString("Menu.circular.Text").Equals(this.comboBox2.SelectedItem))
- {
- arrayList.Add(this.textBox1.Text);
- arrayList.Add(this.comboBox2.SelectedItem);
- arrayList.Add(Convert.ToInt32(this.numericUpDown18.Value));
- arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
- arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
- arrayList.Add(index);
- }
- else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.comboBox2.SelectedItem))
- {
- arrayList.Add(this.textBox1.Text);
- arrayList.Add(this.comboBox2.SelectedItem);
- arrayList.Add(Convert.ToInt32(this.numericUpDown16.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown15.Value));
- arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
- arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
- arrayList.Add(index);
- }
- this.arrayLists.Add(arrayList);
- DataGridViewRow row = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView1.Columns)
- {
- row.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- row.Cells[0].Value = this.textBox1.Text;
- row.Cells[1].Value = this.comboBox2.SelectedItem;
- this.dataGridView1.Rows.Add(row);
- SaveXmlFile();
- //MessageBox.Show(PdnResources.GetString("Menu.Addsuccessfully.text")+"!");//###20506
- operation = -1;
- this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Selected = true;
- }
- }
- }
- // 编辑
- else if (this.operation == 1)
- {
- if (string.IsNullOrEmpty(this.textBox1.Text))
- {
- MessageBox.Show(PdnResources.GetString("Menu.namecannotbeEmpty.text")+"!");
- }
- else
- {
- bool next = true;
- for (int r = 0; r < this.dataGridView1.Rows.Count; r++)
- {
- if (this.dataGridView1.Rows[r].Cells[0].Value.Equals(this.textBox1.Text) && this.dataGridView1.SelectedRows[0].Index != r)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
- next = false;
- break;
- }
- }
- if (next)
- {
- int updIndex = 0;
- foreach (var arrayList1 in this.arrayLists)
- {
- if (arrayList1[0].ToString().Equals(this.dataGridView1.SelectedRows[0].Cells[0].Value))
- {
- updIndex = Convert.ToInt32(arrayList1[arrayList1.Count - 1]);
- this.arrayLists.Remove(arrayList1);
- break;
- }
- }
- ArrayList arrayList = new ArrayList();
- if (PdnResources.GetString("Menu.circular.Text").Equals(this.comboBox2.SelectedItem))
- {
- arrayList.Add(this.textBox1.Text);
- arrayList.Add(this.comboBox2.SelectedItem);
- arrayList.Add(Convert.ToInt32(this.numericUpDown18.Value));
- arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
- arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
- arrayList.Add(index);
- }
- else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.comboBox2.SelectedItem))
- {
- arrayList.Add(this.textBox1.Text);
- arrayList.Add(this.comboBox2.SelectedItem);
- arrayList.Add(Convert.ToInt32(this.numericUpDown16.Value));
- arrayList.Add(Convert.ToInt32(this.numericUpDown15.Value));
- arrayList.Add(Convert.ToInt32(this.panel2.BackColor.ToArgb()));
- arrayList.Add(Convert.ToInt32(numericUpDown2.Value));
- arrayList.Add(index);
- }
- this.arrayLists.Add(arrayList);
- this.dataGridView1.SelectedRows[0].Cells[0].Value = this.textBox1.Text;
- this.dataGridView1.SelectedRows[0].Cells[1].Value = this.comboBox2.SelectedItem;
- SaveXmlFile();
- //MessageBox.Show(PdnResources.GetString("Menu.Editsuccessfully.text")+"!");//###20506
- operation = -1;
- this.groupBox2.Enabled = false;
- }
- }
- }
- }
-
- ReturnGrainSize(currentOperation);//优化方向:如果选择的不是当前辅助线,不调用更新界面方法
- }
- /// <summary>
- /// 辅助线样式预览
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void panel1_Paint(object sender, PaintEventArgs e)
- {
- if (this.picture == 0)
- {
- GuideStylePreviewCapOffPoint(e.Graphics);
- }
- else if(this.picture == 1)
- {
- GuideStylePreviewArea(e.Graphics);
- }
- }
- private void setNumericUpDownValue(NumericUpDown numericUp, int value)//###
- {
- if (value > numericUp.Maximum)
- numericUp.Value = numericUp.Maximum;
- else if (value < numericUp.Minimum)
- numericUp.Value = numericUp.Minimum;
- else
- numericUp.Value = value;
- }
- /// <summary>
- /// 辅助线样式预览是(截点法)
- /// </summary>
- private void GuideStylePreviewCapOffPoint(Graphics g)
- {
- this.panel1.BackColor = Color.Black;
- double scaleWidth = bitmap.Width / (double)this.panel1.Width;
- double scaleHeight = bitmap.Height / (double)this.panel1.Height;
- double scaleSize;
- int originX;
- int originY;
- int drawWidth;
- int drawHeight;
- if (scaleWidth > scaleHeight)
- {
- scaleSize = scaleWidth;
- originX = 0;
- drawWidth = panel1.Width;
- originY = (int)((panel1.Height - bitmap.Height / scaleWidth) / 2.0);
- drawHeight = (int)(bitmap.Height / scaleWidth);
- }
- else
- {
- scaleSize = scaleHeight;
- originY = 0;
- drawHeight = panel1.Height;
- originX = (int)((panel1.Width - bitmap.Width / scaleHeight) / 2.0);
- drawWidth = (int)(bitmap.Width / scaleHeight);
- }
- g.DrawImage(this.bitmap, originX, originY, drawWidth, drawHeight);
- double maxSize = Math.Min(bitmap.Width, bitmap.Height);
- Pen linePen = new Pen(this.panel2.BackColor, Math.Max(1, (int)(Convert.ToInt32(numericUpDown2.Value) / scaleSize)));
- Font textfont = new Font(this.comboBox1.Text, Convert.ToInt32(numericUpDown3.Value));
- SizeF size = g.MeasureString("abc", textfont);
- if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- bool autosized = false;
- double maxSizeCurrent = bitmap.Height;
- double multiple = this.physicalGainMultiple(Convert.ToInt32(this.numericUpDown1.Value) / this.physical_length, maxSizeCurrent);
- if (multiple < 1)
- autosized = true;
- int mat_lineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown1.Value) / this.physical_length);
- int mat_lineSpacing = (int)(multiple * Convert.ToInt32(this.numericUpDown21.Value) / this.physical_length);
- int lineDec = Convert.ToInt32(this.numericUpDown20.Value);
- if (autosized && operation > 0)
- {
- this.numericUpDown1.ValueChanged -= new System.EventHandler(this.numericUpDown1_ValueChanged);
- setNumericUpDownValue(this.numericUpDown1, (int)(multiple * Convert.ToInt32(this.numericUpDown1.Value)));
- this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
- this.numericUpDown21.ValueChanged -= new System.EventHandler(this.numericUpDown21_ValueChanged);
- setNumericUpDownValue(this.numericUpDown21, (int)(multiple * Convert.ToInt32(this.numericUpDown21.Value)));
- this.numericUpDown21.ValueChanged += new System.EventHandler(this.numericUpDown21_ValueChanged);
- }
- mat_lineLength = (int)(mat_lineLength / scaleSize);
- mat_lineSpacing = (int)(mat_lineSpacing / scaleSize);
- float originLineTop = (float)((this.panel1.Height - mat_lineLength) / 2.0);
- float originLineBottom = (float)(mat_lineLength + (this.panel1.Height - mat_lineLength) / 2.0);
- if (Convert.ToInt32(this.numericUpDown20.Value) % 2 == 0)
- {
- float Spacing = (float)(mat_lineSpacing / 2.0);
- for (int i = 0; i < (float)this.numericUpDown20.Value / 2; i++)
- {
- g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2 - Spacing, originLineTop)
- , new PointF((float)this.panel1.Width / 2 - Spacing, originLineBottom));
- g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2 + Spacing, originLineTop)
- , new PointF((float)this.panel1.Width / 2 + Spacing, originLineBottom));
- Spacing += mat_lineSpacing;
- }
- }
- else
- {
- if (Convert.ToInt32(this.numericUpDown20.Value) == 1)
- g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2, originLineTop)
- , new PointF((float)this.panel1.Width / 2, originLineBottom));
- else
- {
- float Spacing = (float)(mat_lineSpacing);
- for (int i = 0; i < (this.numericUpDown20.Value - 1) / 2; i++)
- {
- if (i == 0)
- g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2, originLineTop)
- , new PointF((float)this.panel1.Width / 2, originLineBottom));
- g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2 + Spacing, originLineTop)
- , new PointF((float)this.panel1.Width / 2 + Spacing, originLineBottom));
- g.DrawLine(linePen, new PointF((float)this.panel1.Width / 2 - Spacing, originLineTop)
- , new PointF((float)this.panel1.Width / 2 - Spacing, originLineBottom));
- Spacing += mat_lineSpacing;
- }
- }
- }
- }
- else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- bool autosized = false;
- double maxSizeCurrent = bitmap.Width;
- double multiple = this.physicalGainMultiple(Convert.ToInt32(this.numericUpDown3.Value) / this.physical_length, maxSizeCurrent);
- if (multiple < 1)
- autosized = true;
- int mat_lineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown3.Value) / this.physical_length);
- int mat_lineSpacing = (int)(multiple * Convert.ToInt32(this.numericUpDown17.Value) / this.physical_length);
- int lineDec = Convert.ToInt32(this.numericUpDown19.Value);
- if (autosized && operation > 0)
- {
- this.numericUpDown3.ValueChanged -= new System.EventHandler(this.numericUpDown3_ValueChanged);
- setNumericUpDownValue(this.numericUpDown3, (int)(multiple * Convert.ToInt32(this.numericUpDown3.Value)));
- this.numericUpDown3.ValueChanged += new System.EventHandler(this.numericUpDown3_ValueChanged);
- this.numericUpDown17.ValueChanged -= new System.EventHandler(this.numericUpDown17_ValueChanged);
- setNumericUpDownValue(this.numericUpDown17, (int)(multiple * Convert.ToInt32(this.numericUpDown17.Value)));
- this.numericUpDown17.ValueChanged += new System.EventHandler(this.numericUpDown17_ValueChanged);
- }
- mat_lineLength = (int)(mat_lineLength / scaleSize);
- mat_lineSpacing = (int)(mat_lineSpacing / scaleSize);
- float originLineLeft = (float)((this.panel1.Width - mat_lineLength) / 2.0);
- float originLineRight = (float)(mat_lineLength + (this.panel1.Width - mat_lineLength) / 2.0);
- if (Convert.ToInt32(this.numericUpDown19.Value) % 2 == 0)
- {
- float Spacing = (float)(mat_lineSpacing / 2.0);
- for (int i = 0; i < (float)this.numericUpDown19.Value / 2; i++)
- {
- g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2 - Spacing)
- , new PointF(originLineRight, (float)this.panel1.Height / 2 - Spacing));
- g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2 + Spacing)
- , new PointF(originLineRight, (float)this.panel1.Height / 2 + Spacing));
- Spacing += mat_lineSpacing;
- }
- }
- else
- {
- if (Convert.ToInt32(this.numericUpDown19.Value) == 1)
- g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2)
- , new PointF(originLineRight, (float)this.panel1.Height / 2));
- else
- {
- float Spacing = (float)(mat_lineSpacing);
- for (int i = 0; i < (Convert.ToInt32(this.numericUpDown19.Value) - 1) / 2; i++)
- {
- if (i == 0)
- g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2)
- , new PointF(originLineRight, (float)this.panel1.Height / 2));
- g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2 - Spacing)
- , new PointF(originLineRight, (float)this.panel1.Height / 2 - Spacing));
- g.DrawLine(linePen, new PointF(originLineLeft, (float)this.panel1.Height / 2 + Spacing)
- , new PointF(originLineRight, (float)this.panel1.Height / 2 + Spacing));
- Spacing += mat_lineSpacing;
- }
- }
- }
- }
- else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- bool autosized = false;
- double multiple = this.physicalGainMultiple(Convert.ToInt32(this.numericUpDown4.Value) / this.physical_length, maxSize);
- if (multiple < 1)
- autosized = true;
- int mat_diameter = (int)(multiple * Convert.ToInt32(this.numericUpDown4.Value) / this.physical_length);
- if (autosized && operation > 0)
- {
- this.numericUpDown4.ValueChanged -= new System.EventHandler(this.numericUpDown4_ValueChanged);
- setNumericUpDownValue(this.numericUpDown4, (int)(multiple * Convert.ToInt32(this.numericUpDown4.Value)));
- this.numericUpDown4.ValueChanged += new System.EventHandler(this.numericUpDown4_ValueChanged);
- }
- mat_diameter = (int)(mat_diameter / scaleSize);
- g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0), (float)((this.panel1.Height - mat_diameter) / 2.0), mat_diameter, mat_diameter);
- }
- else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- bool autosized = false;
- int diameter11 = Convert.ToInt32(this.numericUpDown5.Value);
- int margin11 = Convert.ToInt32(this.numericUpDown6.Value);
- double multiple = this.physicalGainMultiple((diameter11 + margin11 * 4) / this.physical_length, maxSize);
- if (multiple < 1)
- autosized = true;
- int mat_diameter = (int)(multiple * diameter11 / this.physical_length);
- int mat_margin = (int)(multiple * margin11 / this.physical_length);
- if (autosized && operation > 0)
- {
- this.numericUpDown5.ValueChanged -= new System.EventHandler(this.numericUpDown5_ValueChanged);
- setNumericUpDownValue(this.numericUpDown5, (int)(multiple * Convert.ToInt32(this.numericUpDown5.Value)));
- this.numericUpDown5.ValueChanged += new System.EventHandler(this.numericUpDown5_ValueChanged);
- this.numericUpDown6.ValueChanged -= new System.EventHandler(this.numericUpDown6_ValueChanged);
- setNumericUpDownValue(this.numericUpDown6, (int)(multiple * Convert.ToInt32(this.numericUpDown6.Value)));
- this.numericUpDown6.ValueChanged += new System.EventHandler(this.numericUpDown6_ValueChanged);
- }
- mat_diameter = (int)(mat_diameter / scaleSize);
- mat_margin = (int)(mat_margin / scaleSize);
- g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0), (float)((this.panel1.Height - mat_diameter) / 2.0), mat_diameter, mat_diameter);
- 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);
- 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);
- }
- else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- bool autosized = false;
- double maxSizeCurrent = 0;//Math.Min(bitmap.Width, bitmap.Height);
- int num_vLineLength = Convert.ToInt32(this.numericUpDown8.Value);//垂线长度
- int num_hLineLength = Convert.ToInt32(this.numericUpDown7.Value);//水平线长度
- int num_diameter = Convert.ToInt32(this.numericUpDown9.Value);//直径
- int num_margin = Convert.ToInt32(this.numericUpDown10.Value);//边距
- int num_TopleftLineLength = Convert.ToInt32(this.numericUpDown12.Value);//左上到右下斜线长度
- int num_ToprightLineLength = Convert.ToInt32(this.numericUpDown11.Value);//左下到右上斜线长度
- int num_VLineToCDistance = Convert.ToInt32(this.numericUpDown13.Value);//垂线到圆距离
- int num_HLineToCDistance = Convert.ToInt32(this.numericUpDown14.Value);//水平线到圆距离
- if (num_vLineLength / this.physical_length > maxSizeCurrent)
- {
- maxSizeCurrent = num_vLineLength / this.physical_length;
- }
- if (num_hLineLength / this.physical_length > maxSizeCurrent)
- {
- maxSizeCurrent = num_hLineLength / this.physical_length;
- }
- if ((num_diameter + num_margin * 4 + num_VLineToCDistance) / this.physical_length > maxSizeCurrent)
- {
- maxSizeCurrent = (num_diameter + num_margin * 4 + num_VLineToCDistance) / this.physical_length;
- }
- if ((num_diameter + num_margin * 4 + num_HLineToCDistance) / this.physical_length > maxSizeCurrent)
- {
- maxSizeCurrent = (num_diameter + num_margin * 4 + num_HLineToCDistance) / this.physical_length;
- }
- if ((num_TopleftLineLength / Math.Sqrt(2.0)) / this.physical_length > maxSizeCurrent)
- {
- maxSizeCurrent = (num_TopleftLineLength / Math.Sqrt(2.0)) / this.physical_length;
- }
- if ((num_ToprightLineLength / Math.Sqrt(2.0)) / this.physical_length > maxSizeCurrent)
- {
- maxSizeCurrent = (num_ToprightLineLength / Math.Sqrt(2.0)) / this.physical_length;
- }
- double multiple = this.physicalGainMultiple(maxSizeCurrent, maxSize);
- if (multiple < 1)
- autosized = true;
- int mat_vLineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown8.Value) / this.physical_length);//垂线长度
- int mat_hLineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown7.Value) / this.physical_length);//水平线长度
- int mat_diameter = (int)(multiple * Convert.ToInt32(this.numericUpDown9.Value) / this.physical_length);//直径
- int mat_margin = (int)(multiple * Convert.ToInt32(this.numericUpDown10.Value) / this.physical_length);//边距
- int mat_TopleftLineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown12.Value) / this.physical_length);//左上到右下斜线长度
- int mat_ToprightLineLength = (int)(multiple * Convert.ToInt32(this.numericUpDown11.Value) / this.physical_length);//左下到右上斜线长度
- int mat_VLineToCDistance = (int)(multiple * Convert.ToInt32(this.numericUpDown13.Value) / this.physical_length);//垂线到圆距离
- int mat_HLineToCDistance = (int)(multiple * Convert.ToInt32(this.numericUpDown14.Value) / this.physical_length);//水平线到圆距离
- if (autosized && operation > 0)
- {
- this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
- setNumericUpDownValue(this.numericUpDown8, (int)(multiple * Convert.ToInt32(this.numericUpDown8.Value)));
- this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
- setNumericUpDownValue(this.numericUpDown7, (int)(multiple * Convert.ToInt32(this.numericUpDown7.Value)));
- this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
- setNumericUpDownValue(this.numericUpDown9, (int)(multiple * Convert.ToInt32(this.numericUpDown9.Value)));
- this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
- setNumericUpDownValue(this.numericUpDown10, (int)(multiple * Convert.ToInt32(this.numericUpDown10.Value)));
- this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
- setNumericUpDownValue(this.numericUpDown11, (int)(multiple * Convert.ToInt32(this.numericUpDown11.Value)));
- this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
- setNumericUpDownValue(this.numericUpDown12, (int)(multiple * Convert.ToInt32(this.numericUpDown12.Value)));
- this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
- setNumericUpDownValue(this.numericUpDown13, (int)(multiple * Convert.ToInt32(this.numericUpDown13.Value)));
- this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
- this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
- setNumericUpDownValue(this.numericUpDown14, (int)(multiple * Convert.ToInt32(this.numericUpDown14.Value)));
- this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
- }
- mat_vLineLength = (int)(mat_vLineLength / scaleSize);
- mat_hLineLength = (int)(mat_hLineLength / scaleSize);
- mat_diameter = (int)(mat_diameter / scaleSize);
- mat_margin = (int)(mat_margin / scaleSize);
- mat_TopleftLineLength = (int)(mat_TopleftLineLength / scaleSize);
- mat_ToprightLineLength = (int)(mat_ToprightLineLength / scaleSize);
- mat_VLineToCDistance = (int)(mat_VLineToCDistance / scaleSize);
- mat_HLineToCDistance = (int)(mat_HLineToCDistance / scaleSize);
- g.DrawEllipse(linePen, (float)((this.panel1.Width - mat_diameter) / 2.0), (float)((this.panel1.Height - mat_diameter) / 2.0), mat_diameter, mat_diameter);
- 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);
- 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);
- //g.DrawEllipse(linePen, (float)(this.panel1.Width / 2 - 60), (float)(this.panel1.Height / 2 - 60), 120, 120);
- //左下到右上斜线
- 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))));
- //左上到右下斜线
- 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))));
- //水平线
- 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));
- //垂线
- 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)));
- }
- }
- /// <summary>
- /// 获取辅助线缩放比例
- /// </summary>
- /// <param name="gridSize"> 设置的数值 </param>
- /// <param name="maxSize"> 限制最大值 </param>
- /// <returns></returns>
- private double physicalGainMultiple(double gridSize, double maxSize)
- {
- double multiple = 1.0;
- if (gridSize > maxSize)
- {
- multiple = maxSize / gridSize;
- }
- return multiple;
- }
- /// <summary>
- /// 辅助线样式预览是(面积法)
- /// </summary>
- private void GuideStylePreviewArea(Graphics g)
- {
- this.panel1.BackColor = Color.Black;
- double scaleWidth = bitmap.Width / (double)this.panel1.Width;
- double scaleHeight = bitmap.Height / (double)this.panel1.Height;
- double scaleSize;
- int originX;
- int originY;
- int drawWidth;
- int drawHeight;
- if (scaleWidth > scaleHeight)
- {
- scaleSize = scaleWidth;
- originX = 0;
- drawWidth = panel1.Width;
- originY = (int)((panel1.Height - bitmap.Height / scaleWidth) / 2.0);
- drawHeight = (int)(bitmap.Height / scaleWidth);
- }
- else
- {
- scaleSize = scaleHeight;
- originY = 0;
- drawHeight = panel1.Height;
- originX = (int)((panel1.Width - bitmap.Width / scaleHeight) / 2.0);
- drawWidth = (int)(bitmap.Width / scaleHeight);
- }
- g.DrawImage(this.bitmap, originX, originY, drawWidth, drawHeight);
- double maxSize = Math.Min(bitmap.Width, bitmap.Height);
- Pen linePen = new Pen(this.panel2.BackColor, Math.Max(1, (int)(Convert.ToInt32(numericUpDown2.Value) / scaleSize)));
- if (PdnResources.GetString("Menu.circular.Text").Equals(this.comboBox2.SelectedItem))
- {
- if (Convert.ToInt32(numericUpDown18.Value) / this.physical_area_length_Micron > maxSize)
- {
- if (operation > 0)
- {
- this.numericUpDown18.ValueChanged -= new System.EventHandler(this.numericUpDown18_ValueChanged);
- setNumericUpDownValue(this.numericUpDown18, (int)(maxSize * this.physical_area_length_Micron));
- this.numericUpDown18.ValueChanged += new System.EventHandler(this.numericUpDown18_ValueChanged);
- }
- int drawvalue1 = (int)(maxSize / scaleSize);
- g.DrawEllipse(linePen, (int)(this.panel1.Width - maxSize / scaleSize) / 2, (int)(this.panel1.Height - maxSize / scaleSize) / 2, drawvalue1, drawvalue1);
- }
- else
- {
- int bitmapvalue1 = (int)(Convert.ToInt32(numericUpDown18.Value) / this.physical_area_length_Micron);
- int drawvalue1 = (int)(bitmapvalue1 / scaleSize);
- g.DrawEllipse(linePen, (int)(this.panel1.Width - bitmapvalue1 / scaleSize) / 2, (int)(this.panel1.Height - bitmapvalue1 / scaleSize) / 2, drawvalue1, drawvalue1);
- }
- }
- else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.comboBox2.SelectedItem))
- {
- int bitmapvalue1 = (int)(Convert.ToInt32(numericUpDown16.Value) / this.physical_area_length_Micron);
- int bitmapvalue2 = (int)(Convert.ToInt32(numericUpDown15.Value) / this.physical_area_length_Micron);
- if (bitmapvalue1 > bitmap.Width || bitmapvalue2 > bitmap.Height)
- {
- double scalevalue1 = bitmapvalue1 / (double)bitmap.Width;
- double scalevalue2 = bitmapvalue2 / (double)bitmap.Height;
- if (scalevalue2 > scalevalue1)
- {
- bitmapvalue1 = (int)(bitmapvalue1 / scalevalue2);
- bitmapvalue2 = bitmap.Height;
- }
- else if (scalevalue1 > scalevalue2)
- {
- bitmapvalue2 = (int)(bitmapvalue2 / scalevalue1);
- bitmapvalue1 = bitmap.Width;
- }
- if (operation > 0)
- {
- if (bitmapvalue1 == bitmap.Width)
- {
- this.numericUpDown16.ValueChanged -= new System.EventHandler(this.numericUpDown16_ValueChanged);
- setNumericUpDownValue(this.numericUpDown16, (int)(bitmap.Width * this.physical_area_length_Micron));
- this.numericUpDown16.ValueChanged += new System.EventHandler(this.numericUpDown16_ValueChanged);
- this.numericUpDown15.ValueChanged -= new System.EventHandler(this.numericUpDown15_ValueChanged);
- setNumericUpDownValue(this.numericUpDown15, (int)(bitmapvalue2 * this.physical_area_length_Micron));
- this.numericUpDown15.ValueChanged += new System.EventHandler(this.numericUpDown15_ValueChanged);
- }
- if (bitmapvalue2 == bitmap.Height)
- {
- this.numericUpDown15.ValueChanged -= new System.EventHandler(this.numericUpDown15_ValueChanged);
- setNumericUpDownValue(this.numericUpDown15, (int)(bitmap.Height * this.physical_area_length_Micron));
- this.numericUpDown15.ValueChanged += new System.EventHandler(this.numericUpDown15_ValueChanged);
- this.numericUpDown16.ValueChanged -= new System.EventHandler(this.numericUpDown16_ValueChanged);
- setNumericUpDownValue(this.numericUpDown16, (int)(bitmapvalue1 * this.physical_area_length_Micron));
- this.numericUpDown16.ValueChanged += new System.EventHandler(this.numericUpDown16_ValueChanged);
- }
- }
- }
- int drawvalue1 = (int)(bitmapvalue1 / scaleSize);
- int drawvalue2 = (int)(bitmapvalue2 / scaleSize);
- g.DrawRectangle(linePen, (int)(this.panel1.Width - bitmapvalue1 / scaleSize) / 2, (int)(this.panel1.Height - bitmapvalue2 / scaleSize) / 2, drawvalue1, drawvalue2);
- //g.DrawRectangle(linePen, this.panel1.Width / 2 - 80, this.panel1.Height / 2 - 50, 160, 100);
- }
- }
- /// <summary>
- /// 线颜色改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void panel2_BackColorChanged(object sender, EventArgs e)
- {
- this.panel1.Refresh();
- }
- /// <summary>
- /// 切换辅助线类型
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void comboBox1_SelectedIndexChanged_1(object sender, EventArgs e)
- {
- if(this.picture == 0)
- {
- if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- this.panel3.Visible = true;
- this.panel4.Visible = false;
- this.panel5.Visible = false;
- this.panel6.Visible = false;
- this.panel7.Visible = false;
- this.panel8.Visible = false;
- this.panel9.Visible = false;
- }
- else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- this.panel3.Visible = false;
- this.panel4.Visible = true;
- this.panel5.Visible = false;
- this.panel6.Visible = false;
- this.panel7.Visible = false;
- this.panel8.Visible = false;
- this.panel9.Visible = false;
- }
- else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- this.panel3.Visible = false;
- this.panel4.Visible = false;
- this.panel5.Visible = true;
- this.panel6.Visible = false;
- this.panel7.Visible = false;
- this.panel8.Visible = false;
- this.panel9.Visible = false;
- }
- else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- this.panel3.Visible = false;
- this.panel4.Visible = false;
- this.panel5.Visible = false;
- this.panel6.Visible = true;
- this.panel7.Visible = false;
- this.panel8.Visible = false;
- this.panel9.Visible = false;
- }
- else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.comboBox1.SelectedItem))
- {
- this.panel3.Visible = false;
- this.panel4.Visible = false;
- this.panel5.Visible = false;
- this.panel6.Visible = false;
- this.panel7.Visible = true;
- this.panel8.Visible = false;
- this.panel9.Visible = false;
- }
- this.panel1.Refresh();
- }
- }
- /// <summary>
- /// 切换辅助图形
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
- {
- if(this.picture == 1)
- {
- if (PdnResources.GetString("Menu.circular.Text").Equals(this.comboBox2.SelectedItem))
- {
- this.panel3.Visible = false;
- this.panel4.Visible = false;
- this.panel5.Visible = false;
- this.panel6.Visible = false;
- this.panel7.Visible = false;
- this.panel8.Visible = false;
- this.panel9.Visible = true;
- }
- else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.comboBox2.SelectedItem))
- {
- this.panel3.Visible = false;
- this.panel4.Visible = false;
- this.panel5.Visible = false;
- this.panel6.Visible = false;
- this.panel7.Visible = false;
- this.panel8.Visible = true;
- this.panel9.Visible = false;
- }
- this.panel1.Refresh();
- }
- }
- /// <summary>
- /// 添加辅助线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button3_Click(object sender, EventArgs e)
- {
- // 添加
- this.textBox1.Focus();
- this.dataGridView1.ClearSelection();
- operation = 0;
- this.groupBox2.Enabled = true;
- InitGroupbox2();
- }
- /// <summary>
- /// 编辑辅助线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button4_Click(object sender, EventArgs e)
- {
- if(this.dataGridView1.Rows.Count > 0)
- {
- if(this.dataGridView1.SelectedRows.Count > 0)
- {
- // 编辑
- operation = 1;
- this.groupBox2.Enabled = true;
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttheauxiliarylinetoedit.text")+"!");
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseaddauxiliarylines.text")+"!");
- }
- }
- /// <summary>
- /// 切换辅助线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void dataGridView1_SelectionChanged(object sender, EventArgs e)
- {
- this.groupBox2.Enabled = false;
- operation = -1;
- if (this.dataGridView1.SelectedRows.Count > 0)
- {
- if (this.picture == 0)
- {
- ArrayList arrayList1 = new ArrayList();
- foreach (var arrayList in this.arrayLists)
- {
- if (this.dataGridView1.SelectedRows[0].Cells[0].Value.Equals(arrayList[0]))
- arrayList1 = arrayList;
- }
- if (PdnResources.GetString("Menu.Verticalauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
- {
- this.textBox1.Text = arrayList1[0].ToString();
- this.comboBox1.SelectedItem = arrayList1[1];
- this.numericUpDown1.Value = Convert.ToInt32(arrayList1[2]);
- this.numericUpDown21.Value = Convert.ToInt32(arrayList1[3]);
- this.numericUpDown20.Value = Convert.ToInt32(arrayList1[4]);
- this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[5]));
- this.numericUpDown2.Value = Convert.ToInt32(arrayList1[6]);
- }
- else if (PdnResources.GetString("Menu.Horizontalauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
- {
- this.textBox1.Text = arrayList1[0].ToString();
- this.comboBox1.SelectedItem = arrayList1[1];
- this.numericUpDown3.Value = Convert.ToInt32(arrayList1[2]);
- this.numericUpDown17.Value = Convert.ToInt32(arrayList1[3]);
- this.numericUpDown19.Value = Convert.ToInt32(arrayList1[4]);
- this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[5]));
- this.numericUpDown2.Value = Convert.ToInt32(arrayList1[6]);
- }
- else if (PdnResources.GetString("Menu.Singlecircleauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
- {
- this.textBox1.Text = arrayList1[0].ToString();
- this.comboBox1.SelectedItem = arrayList1[1];
- this.numericUpDown4.Value = Convert.ToInt32(arrayList1[2]);
- this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[3]));
- this.numericUpDown2.Value = Convert.ToInt32(arrayList1[4]);
- }
- else if (PdnResources.GetString("Menu.Three-circleauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
- {
- this.textBox1.Text = arrayList1[0].ToString();
- this.comboBox1.SelectedItem = arrayList1[1];
- this.numericUpDown5.Value = Convert.ToInt32(arrayList1[2]);
- this.numericUpDown6.Value = Convert.ToInt32(arrayList1[3]);
- this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[4]));
- this.numericUpDown2.Value = Convert.ToInt32(arrayList1[5]);
- }
- else if (PdnResources.GetString("Menu.Compositeauxiliaryline.text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
- {
- this.textBox1.Text = arrayList1[0].ToString();
- this.comboBox1.SelectedItem = arrayList1[1];
- this.numericUpDown8.Value = Convert.ToInt32(arrayList1[2]);
- this.numericUpDown7.Value = Convert.ToInt32(arrayList1[3]);
- this.numericUpDown9.Value = Convert.ToInt32(arrayList1[4]);
- this.numericUpDown10.Value = Convert.ToInt32(arrayList1[5]);
- this.numericUpDown12.Value = Convert.ToInt32(arrayList1[6]);
- this.numericUpDown11.Value = Convert.ToInt32(arrayList1[7]);
- this.numericUpDown13.Value = Convert.ToInt32(arrayList1[8]);
- this.numericUpDown14.Value = Convert.ToInt32(arrayList1[9]);
- this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[10]));
- this.numericUpDown2.Value = Convert.ToInt32(arrayList1[11]);
- this.vLineLength = Convert.ToInt32(arrayList1[2]);
- this.hLineLength = Convert.ToInt32(arrayList1[3]);
- this.diameter = Convert.ToInt32(arrayList1[4]);
- this.margin = Convert.ToInt32(arrayList1[5]);
- this.TopleftLineLength = Convert.ToInt32(arrayList1[6]);
- this.ToprightLineLength = Convert.ToInt32(arrayList1[7]);
- this.VLineToCDistance = Convert.ToInt32(arrayList1[8]);
- this.HLineToCDistance = Convert.ToInt32(arrayList1[9]);
- this.lineWidth = Convert.ToInt32(arrayList1[11]);
- }
- }
- else if(this.picture == 1)
- {
- ArrayList arrayList1 = new ArrayList();
- foreach (var arrayList in this.arrayLists)
- {
- if (this.dataGridView1.SelectedRows[0].Cells[0].Value.Equals(arrayList[0]))
- arrayList1 = arrayList;
- }
- if (PdnResources.GetString("Menu.circular.Text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
- {
- this.textBox1.Text = arrayList1[0].ToString();
- this.comboBox2.SelectedItem = arrayList1[1];
- this.numericUpDown18.Value = Convert.ToInt32(arrayList1[2]);
- this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[3]));
- this.numericUpDown2.Value = Convert.ToInt32(arrayList1[4]);
- }
- else if (PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text").Equals(this.dataGridView1.SelectedRows[0].Cells[1].Value))
- {
- this.textBox1.Text = arrayList1[0].ToString();
- this.comboBox2.SelectedItem = arrayList1[1];
- this.numericUpDown16.Value = Convert.ToInt32(arrayList1[2]);
- this.numericUpDown15.Value = Convert.ToInt32(arrayList1[3]);
- this.panel2.BackColor = Color.FromArgb(Convert.ToInt32(arrayList1[4]));
- this.numericUpDown2.Value = Convert.ToInt32(arrayList1[5]);
- }
- }
- this.panel1.Refresh();
- }
- }
- /// <summary>
- /// 删除辅助线
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button5_Click(object sender, EventArgs e)
- {
- if(this.dataGridView1.SelectedRows.Count > 0)
- {
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretodeletetheauxiliaryline?.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
- if (dr == DialogResult.OK)
- {
- foreach (var arrayList in this.arrayLists)
- {
- if (this.dataGridView1.SelectedRows[0].Cells[0].Value.Equals(arrayList[0]))
- {
- this.arrayLists.Remove(arrayList);
- break;
- }
- }
- SaveXmlFile();
- this.dataGridView1.Rows.Remove(this.dataGridView1.SelectedRows[0]);
- if (this.dataGridView1.Rows.Count == 0)
- InitGroupbox2();
- ReturnGrainSize(2);
- }
- this.panel1.Refresh();
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttheauxiliarylinetodelete.text")+"!");
- }
- }
- /// <summary>
- /// 截点法-垂直辅助线-辅助线长度
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown1_ValueChanged(object sender, EventArgs e)
- {
- this.panel1.Refresh();
- }
- /// <summary>
- /// 截点法-水平辅助线-辅助线长度
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown3_ValueChanged(object sender, EventArgs e)
- {
- this.panel1.Refresh();
- }
- /// <summary>
- /// 截点法-圆辅助线-直径
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown4_ValueChanged(object sender, EventArgs e)
- {
- this.panel1.Refresh();
- }
- /// <summary>
- /// 截点法-三圆辅助线-直径
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown5_ValueChanged(object sender, EventArgs e)
- {
- this.panel1.Refresh();
- }
- /// <summary>
- /// 截点法-三圆辅助线-边距
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown6_ValueChanged(object sender, EventArgs e)
- {
- this.panel1.Refresh();
- }
- /// <summary>
- /// 间距
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown21_ValueChanged(object sender, EventArgs e)
- {
- this.panel1.Refresh();
- }
- /// <summary>
- /// 线条数
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown20_ValueChanged(object sender, EventArgs e)
- {
- this.panel1.Refresh();
- }
- /// <summary>
- /// 面积法-矩形-宽
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown15_ValueChanged(object sender, EventArgs e)
- {
- this.panel1.Refresh();
- }
- /// <summary>
- /// 面积法-矩形-高
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown16_ValueChanged(object sender, EventArgs e)
- {
- this.panel1.Refresh();
- }
- /// <summary>
- /// 间距
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown17_ValueChanged(object sender, EventArgs e)
- {
- this.panel1.Refresh();
- }
- /// <summary>
- /// 面积法-圆-直径
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown18_ValueChanged(object sender, EventArgs e)
- {
- this.panel1.Refresh();
- }
- /// <summary>
- /// 线条数
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown19_ValueChanged(object sender, EventArgs e)
- {
- this.panel1.Refresh();
- }
- /// <summary>
- /// 线宽改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown2_ValueChanged(object sender, EventArgs e)
- {
- this.panel1.Refresh();
- }
- /// <summary>
- /// 垂线长度改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown8_ValueChanged(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked && this.groupBox2.Enabled)
- {
- this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
- this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
- this.percentage = this.numericUpDown8.Value / this.vLineLength;
- this.vLineLength = Convert.ToInt32(this.numericUpDown8.Value);
- setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
- setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
- setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
- setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
- setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
- setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
- setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
- this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
- this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
- }
- this.panel1.Refresh();
- }
- /// <summary>
- /// 水平线长度改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown7_ValueChanged(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked && this.groupBox2.Enabled)
- {
- this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
- this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
- this.percentage = this.numericUpDown7.Value / this.hLineLength;
- this.hLineLength = Convert.ToInt32(this.numericUpDown7.Value);
- setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
- setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
- setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
- setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
- setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
- setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
- setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
- this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
- this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
- }
- this.panel1.Refresh();
- }
- /// <summary>
- /// 内圆直径改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown9_ValueChanged(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked && this.groupBox2.Enabled)
- {
- this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
- this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
- this.percentage = this.numericUpDown9.Value / this.diameter;
- this.diameter = Convert.ToInt32(this.numericUpDown9.Value);
- setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
- setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
- setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
- setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
- setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
- setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
- setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
- this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
- this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
- }
- this.panel1.Refresh();
- }
- /// <summary>
- /// 边距改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown10_ValueChanged(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked && this.groupBox2.Enabled)
- {
- this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
- this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
- this.percentage = this.numericUpDown10.Value / this.margin;
- this.margin = Convert.ToInt32(this.numericUpDown10.Value);
- //##19847
- setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
- setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
- setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
- setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
- setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
- setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
- setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
- this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
- this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
- }
- this.panel1.Refresh();
- }
- /// <summary>
- /// 左上到右下斜线长度改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown12_ValueChanged(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked && this.groupBox2.Enabled)
- {
- this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
- this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
- this.percentage = this.numericUpDown12.Value / this.TopleftLineLength;
- this.TopleftLineLength = Convert.ToInt32(this.numericUpDown12.Value);
- setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
- setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
- setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
- setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
- setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
- setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
- setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
- this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
- this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
- }
- this.panel1.Refresh();
- }
- /// <summary>
- /// 左下到右上斜线长度改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown11_ValueChanged(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked && this.groupBox2.Enabled)
- {
- this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
- this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
- this.percentage = this.numericUpDown11.Value / this.ToprightLineLength;
- this.ToprightLineLength = Convert.ToInt32(this.numericUpDown11.Value);
- setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
- setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
- setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
- setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
- setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
- setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
- setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
- this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
- this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
- }
- this.panel1.Refresh();
- }
- /// <summary>
- /// 垂线到圆距离改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown13_ValueChanged(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked && this.groupBox2.Enabled)
- {
- this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown14.ValueChanged -= new System.EventHandler(this.numericUpDown14_ValueChanged);
- this.percentage = this.numericUpDown13.Value / this.VLineToCDistance;
- this.VLineToCDistance = Convert.ToInt32(this.numericUpDown13.Value);
- setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
- setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
- setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
- setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
- setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
- setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
- setNumericUpDownValue(numericUpDown14, (int)(this.numericUpDown14.Value * this.percentage < 1 ? 1 : this.numericUpDown14.Value * this.percentage));
- this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown14.ValueChanged += new System.EventHandler(this.numericUpDown14_ValueChanged);
- }
- this.panel1.Refresh();
- }
- /// <summary>
- /// 水平线到圆距离改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown14_ValueChanged(object sender, EventArgs e)
- {
- if (this.checkBox1.Checked && this.groupBox2.Enabled)
- {
- this.numericUpDown8.ValueChanged -= new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown7.ValueChanged -= new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown9.ValueChanged -= new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown10.ValueChanged -= new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown12.ValueChanged -= new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown11.ValueChanged -= new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown13.ValueChanged -= new System.EventHandler(this.numericUpDown13_ValueChanged);
- this.percentage = this.numericUpDown14.Value / this.HLineToCDistance;
- this.HLineToCDistance = Convert.ToInt32(this.numericUpDown14.Value);
- setNumericUpDownValue(numericUpDown8, (int)(this.numericUpDown8.Value * this.percentage < 1 ? 1 : this.numericUpDown8.Value * this.percentage));
- setNumericUpDownValue(numericUpDown7, (int)(this.numericUpDown7.Value * this.percentage < 1 ? 1 : this.numericUpDown7.Value * this.percentage));
- setNumericUpDownValue(numericUpDown9, (int)(this.numericUpDown9.Value * this.percentage < 1 ? 1 : this.numericUpDown9.Value * this.percentage));
- setNumericUpDownValue(numericUpDown10, (int)(this.numericUpDown10.Value * this.percentage < 1 ? 1 : this.numericUpDown10.Value * this.percentage));
- setNumericUpDownValue(numericUpDown12, (int)(this.numericUpDown12.Value * this.percentage < 1 ? 1 : this.numericUpDown12.Value * this.percentage));
- setNumericUpDownValue(numericUpDown11, (int)(this.numericUpDown11.Value * this.percentage < 1 ? 1 : this.numericUpDown11.Value * this.percentage));
- setNumericUpDownValue(numericUpDown13, (int)(this.numericUpDown13.Value * this.percentage < 1 ? 1 : this.numericUpDown13.Value * this.percentage));
- this.numericUpDown8.ValueChanged += new System.EventHandler(this.numericUpDown8_ValueChanged);
- this.numericUpDown7.ValueChanged += new System.EventHandler(this.numericUpDown7_ValueChanged);
- this.numericUpDown9.ValueChanged += new System.EventHandler(this.numericUpDown9_ValueChanged);
- this.numericUpDown10.ValueChanged += new System.EventHandler(this.numericUpDown10_ValueChanged);
- this.numericUpDown12.ValueChanged += new System.EventHandler(this.numericUpDown12_ValueChanged);
- this.numericUpDown11.ValueChanged += new System.EventHandler(this.numericUpDown11_ValueChanged);
- this.numericUpDown13.ValueChanged += new System.EventHandler(this.numericUpDown13_ValueChanged);
- }
- this.panel1.Refresh();
- }
- private void GrainGuideSettingsDialog_Load(object sender, EventArgs e)
- {
- if (this.picture == 0)
- {
- this.comboBox1.Items.Clear();
- this.comboBox1.Items.AddRange(getTypeNames());
- if (this.comboBox1.Items.Count > 0)
- this.comboBox1.SelectedIndex = 0;
- }
- else if (this.picture == 1)
- {
- this.comboBox2.Items.Clear();
- this.comboBox2.Items.AddRange(getTypeNames());
- if (this.comboBox2.Items.Count > 0)
- this.comboBox2.SelectedIndex = 0;
- dataGridView1_SelectionChanged(sender, e);
- }
- }
- #region 需继承方法
- protected virtual string[] getTypeNames()
- {
- return this.typeListNames;
- }
- #endregion
- }
- }
|