1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424 |
- 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 OpenCvSharp.Mat imageMat;
- 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, OpenCvSharp.Mat imageMat, double physical_Micron = 1.0)
- {
- this.picture = picture;
- this.xmlModelName = xmlModelName;
- this.typeListNames = typeListNames;
- this.imageMat = imageMat/*.Clone()*/;
- this.bitmap = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(this.imageMat);
- //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 = imageMat.Width / (double)this.panel1.Width;
- double scaleHeight = imageMat.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 - imageMat.Height / scaleWidth) / 2.0);
- drawHeight = (int)(imageMat.Height / scaleWidth);
- }
- else
- {
- scaleSize = scaleHeight;
- originY = 0;
- drawHeight = panel1.Height;
- originX = (int)((panel1.Width - imageMat.Width / scaleHeight) / 2.0);
- drawWidth = (int)(imageMat.Width / scaleHeight);
- }
- g.DrawImage(this.bitmap, originX, originY, drawWidth, drawHeight);//绘制的方法需要测试
- double maxSize = Math.Min(imageMat.Width, imageMat.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 = imageMat.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 = imageMat.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(imageMat.Width, imageMat.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 = imageMat.Width / (double)this.panel1.Width;
- double scaleHeight = imageMat.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 - imageMat.Height / scaleWidth) / 2.0);
- drawHeight = (int)(imageMat.Height / scaleWidth);
- }
- else
- {
- scaleSize = scaleHeight;
- originY = 0;
- drawHeight = panel1.Height;
- originX = (int)((panel1.Width - imageMat.Width / scaleHeight) / 2.0);
- drawWidth = (int)(imageMat.Width / scaleHeight);
- }
- g.DrawImage(this.bitmap, originX, originY, drawWidth, drawHeight);
- double maxSize = Math.Min(imageMat.Width, imageMat.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 > imageMat.Width || bitmapvalue2 > imageMat.Height)
- {
- double scalevalue1 = bitmapvalue1 / (double)imageMat.Width;
- double scalevalue2 = bitmapvalue2 / (double)imageMat.Height;
- if (scalevalue2 > scalevalue1)
- {
- bitmapvalue1 = (int)(bitmapvalue1 / scalevalue2);
- bitmapvalue2 = imageMat.Height;
- }
- else if (scalevalue1 > scalevalue2)
- {
- bitmapvalue2 = (int)(bitmapvalue2 / scalevalue1);
- bitmapvalue1 = imageMat.Width;
- }
- if (operation > 0)
- {
- if (bitmapvalue1 == imageMat.Width)
- {
- this.numericUpDown16.ValueChanged -= new System.EventHandler(this.numericUpDown16_ValueChanged);
- setNumericUpDownValue(this.numericUpDown16, (int)(imageMat.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 == imageMat.Height)
- {
- this.numericUpDown15.ValueChanged -= new System.EventHandler(this.numericUpDown15_ValueChanged);
- setNumericUpDownValue(this.numericUpDown15, (int)(imageMat.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
- }
- }
|