1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760 |
- using OpenCvSharp;
- using OpenCvSharp.Extensions;
- using PaintDotNet.Base;
- using PaintDotNet.Base.Enum;
- using PaintDotNet.Base.Functionodel;
- using PaintDotNet.CustomControl;
- using PaintDotNet.Data.Param;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.IO;
- using System.Windows.Forms;
- using PaintDotNet.DbOpreate.DbBll;
- using PaintDotNet.DbOpreate.DbModel;
- using PaintDotNet.Base.CommTool;
- using System.Linq;
- using PaintDotNet.Instrument;
- using Metis.ParameterSet;
- using static Metis.ParameterSet.GeneralAnalysisModel;
- using static Metis.ParameterSet.GeneralAnalysisModel.PolyphaseMutiAreaContentModel;
- namespace PaintDotNet.GeneralAnalysis
- {
- /// <summary>
- /// 多相含量
- /// </summary>
- internal class PolyphaseMutiAreaContent : PdnBaseForm
- {
- #region 控件
- private System.Windows.Forms.GroupBox groupBox4;
- private System.Windows.Forms.ListView listView1;
- private System.Windows.Forms.GroupBox groupBox1;
- private System.Windows.Forms.Button button2;
- private System.Windows.Forms.CheckBox checkBox1;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.GroupBox groupBox_review;
- private System.Windows.Forms.GroupBox groupBox5;
- private System.Windows.Forms.GroupBox groupBox6;
- private System.Windows.Forms.GroupBox groupBox7;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Button button4;
- private System.Windows.Forms.Button button3;
- private System.Windows.Forms.ImageList imageList1;
- private DataGridView dataGridView_results;
- private Button button_remove;
- private Button button_all;
- private IContainer components;
- private List<CounterResult> finalResults = new List<CounterResult>();
- private List<CounterResult> counterResults = new List<CounterResult>();
- private Button btn_close;
- private GroupBox groupBox2;
- private CheckBox cb8;
- private CheckBox cb6;
- private CheckBox cb4;
- private CheckBox cb7;
- private CheckBox cb5;
- private CheckBox cb3;
- private CheckBox cb2;
- private CheckBox cb1;
- private Label label7;
- private Label label6;
- private Label label5;
- private TextBox txt_phaseName;
- private Label label4;
- private ComboBox cb_SelectPhase;
- private Label label3;
- private RadioButton rb8;
- private RadioButton rb7;
- private RadioButton rb6;
- private RadioButton rb5;
- private RadioButton rb4;
- private RadioButton rb3;
- private RadioButton rb2;
- private RadioButton rb1;
- private Label label2;
- private Panel panel1;
- private GroupBox groupBox3;
- private CheckBox checkBox11;
- private CheckBox checkBox10;
- private Button But_DeleteSX;
- private Button But_DeleteKD;
- private Panel panel2;
- private NumericUpDown numericUpDown_RangeEnd;
- private NumericUpDown numericUpDown_RangeStart;
- private NumericUpDown numericUpDown_SXEnd;
- private NumericUpDown numericUpDown_SXStart;
- private NumericUpDown numericUpDown_KDEnd;
- private NumericUpDown numericUpDown_KDStart;
- private ColorRangeControl cRControl;
- private NumericUpDown numericUpDown1;
- private Button button6;
- private Button button5;
- #endregion
- private GeneralAnalysisCommonControlButtons commonControlButtons;
- /// <summary>
- /// 主空间
- /// </summary>
- private AppWorkspace appWorkspace;
- /// <summary>
- /// 图像面板
- /// </summary>
- private DocumentWorkspaceWindow documentWorkspace;
- /// <summary>
- /// 选中图片的mat
- /// </summary>
- private Mat imageMat;
- /// <summary>
- /// 默认八个颜色的值
- /// </summary>
- private Color[] DefaultColor = new Color[] { Color.Red, Color.Blue, Color.Yellow, Color.Green, Color.Gray, Color.Black, Color.Gold, Color.DeepSkyBlue };
- /// <summary>
- /// 原相
- /// </summary>
- private List<PhaseModel> phaseModels = new List<PhaseModel>();
- /// <summary>
- /// 加工后的相
- /// </summary>
- private List<PhaseModel> viewModels = new List<PhaseModel>();
- private List<MutiPolyphaseModel> mPhaseModels = new List<MutiPolyphaseModel>();
- private List<PhaseModel> orginPhaseModels = new List<PhaseModel>();
- private List<RangeColor> rangeColors = new List<RangeColor>();
- private ColorsForm colorsFormGrid;
- private int imgIndex = -1;
- /// <summary>
- /// 处理程序
- /// </summary>
- private ParamObject action = new Data.Action.Action1010();
- private ParamObject action914 = new Data.Action.Action914();
- private ParamObject action911 = new Data.Action.Action911();
- private List<PolyphaseAnalysisResult> mainPolyphaseAnalysisResults = new List<PolyphaseAnalysisResult>();
- private List<PolyphaseAnalysisResult> viewPolyphaseAnalysisResults = new List<PolyphaseAnalysisResult>();
- private int decnum = 2;
- private int is_all = 0;
- private int xiang_num = 0;
- private GeneralAnalysisModel generalAnalysisModel = new GeneralAnalysisModel();
- private bool userAll = false;
- private string selectedImg = string.Empty;
- private bool isExportResults = false;
- private bool isExportReports = false;
- private bool isExportProjects = false;
- private int menuId;
- private string menuName;
- /// <summary>
- /// 是否脚本运行
- /// </summary>
- private Boolean initScriptValues = false;
- /// <summary>
- /// 初始系统参数配置值
- /// </summary>
- private int selectIndex;
- private List<Bitmap> bitList = new List<Bitmap>();
- private Button button9;
- private CheckedListBox listBox_analysisResult;
- private DataGridViewTextBoxColumn Column5;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
- private Dictionary<string, List<Bitmap>> bitDic = new Dictionary<string, List<Bitmap>>();
- private Dictionary<string, PolyphaseMutiAreaContentModel> everyImgData = new Dictionary<string, PolyphaseMutiAreaContentModel>();
- public PolyphaseMutiAreaContent(AppWorkspace appWorkspace,PdnMenuItem menuItem)
- {
- InitializeComponent();
- InitializeLanguageText();
- this.appWorkspace = appWorkspace;
- this.colorsFormGrid = new ColorsForm();
- this.colorsFormGrid.StartPosition = FormStartPosition.CenterScreen;
- this.documentWorkspace = new DocumentWorkspaceWindow(appWorkspace);
- this.documentWorkspace.Dock = DockStyle.Fill;
- this.documentWorkspace.HookMouseEvents();
- this.documentWorkspace.AuxiliaryLineEnabled = false;
- this.documentWorkspace.Visible = false;
- this.groupBox_review.Controls.Add(documentWorkspace);
- this.commonControlButtons = new GeneralAnalysisCommonControlButtons();
- this.commonControlButtons.Dock = DockStyle.Top;
- this.commonControlButtons.Height = 30;
- this.commonControlButtons.WithTrackBar();
- this.commonControlButtons.trackBar.Minimum = 0;
- this.commonControlButtons.trackBar.Maximum = 255;
- this.commonControlButtons.trackBar.Value = 255;
- this.commonControlButtons.trackLabel.Text = PdnResources.GetString("Menu.transparency.text")+":";
- this.groupBox_review.Controls.Add(commonControlButtons);
- cRControl = new ColorRangeControl();
- cRControl.Height = this.panel1.Height;
- this.panel1.Controls.Add(cRControl);
- cRControl.Click += CRControl_Click;
- cRControl.ColorRangeChangeEvent += new EventHandler(this.ColorRangeChangeEvent);
- this.groupBox2.Enabled = false;
- this.menuId = menuItem.MenuId;
- this.menuName = menuItem.Text;
- Init_CheckBoxes();
- InitPicList();
- SetAnalyzeModelFromXml("Template.Manager.item2.PolyphaseMutiAreaContent");
- SetStyle(ControlStyles.UserPaint, true);
- SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
- SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲
- InitCommonButtonEvent();
- this.Shown += showImg;
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.saveLastData);
- }
- /// <summary>
- /// 获取上次操作参数
- /// </summary>
- private void getLastData() {
- string filePath = Application.StartupPath + "\\Config\\Default\\ParameterSaving\\ParameterGeneralAnalysis.xml";
- if (!System.IO.File.Exists(filePath))
- {
- generalAnalysisModel = new GeneralAnalysisModel();
- generalAnalysisModel.PolyphaseMutiAreaContentModels = new PolyphaseMutiAreaContentModel();
- generalAnalysisModel.PolyphaseCounterAnalysisModels = new PolyphaseCounterAnalysisModel();
- generalAnalysisModel.TwoPhaseScaleModels = new TwoPhaseScaleModel();
- generalAnalysisModel.PolyphaseContentModels = new PolyphaseContentModel();
- generalAnalysisModel.PolyphaseDistanceModels = new PolyphaseDistanceModel();
- generalAnalysisModel.DebrisSelectionModels = new GeneralAnalysisModel.DebrisSelectionModel();
- generalAnalysisModel.CountNumberAnalysisModels = new CountNumberAnalysisModel();
- generalAnalysisModel.PolyphaseMutiAreaContentModels.hasUsed = false;
- generalAnalysisModel.PolyphaseCounterAnalysisModels.hasUsed = false;
- generalAnalysisModel.TwoPhaseScaleModels.hasUsed = false;
- generalAnalysisModel.PolyphaseContentModels.hasUsed = false;
- generalAnalysisModel.PolyphaseDistanceModels.hasUsed = false;
- generalAnalysisModel.DebrisSelectionModels.hasUsed = false;
- generalAnalysisModel.CountNumberAnalysisModels.hasUsed = false;
- string porosityInfoXml = XmlSerializeHelper.XmlSerialize<GeneralAnalysisModel>(generalAnalysisModel);
- Directory.CreateDirectory(Application.StartupPath + "\\Config\\Default\\ParameterSaving\\");
- FileOperationHelper.WriteStringToFile(porosityInfoXml, filePath, FileMode.CreateNew);
- }
- else
- {
- generalAnalysisModel = XmlSerializeHelper.DESerializer<GeneralAnalysisModel>(FileOperationHelper.ReadStringFromFile(filePath, FileMode.Open));
- if (generalAnalysisModel.PolyphaseMutiAreaContentModels == null) {
- generalAnalysisModel.PolyphaseMutiAreaContentModels = new PolyphaseMutiAreaContentModel();
- }
- if (generalAnalysisModel.PolyphaseMutiAreaContentModels.hasUsed) {
- #region [多相数量]
- switch (generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter1)
- {
- case 0:
- rb1.Checked = true;
- break;
- case 1:
- rb1.Checked = true;
- break;
- case 2:
- rb1.Checked = true;
- rb2.Checked = true;
- break;
- case 3:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- break;
- case 4:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- break;
- case 5:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- rb5.Checked = true;
- break;
- case 6:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- rb5.Checked = true;
- rb6.Checked = true;
- break;
- case 7:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- rb5.Checked = true;
- rb6.Checked = true;
- rb7.Checked = true;
- break;
- case 8:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- rb5.Checked = true;
- rb6.Checked = true;
- rb7.Checked = true;
- rb8.Checked = true;
- break;
- }
- #endregion
- #region [显示物相]
- string[] allNum = generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter4.Split(',');
- if (allNum.Contains("1"))
- {
- cb1.Checked = true;
- }
- else
- {
- cb1.Checked = false;
- }
- if (allNum.Contains("2"))
- {
- cb2.Checked = true;
- }
- else
- {
- cb2.Checked = false;
- }
- if (allNum.Contains("3"))
- {
- cb3.Checked = true;
- }
- else
- {
- cb3.Checked = false;
- }
- if (allNum.Contains("4"))
- {
- cb4.Checked = true;
- }
- else
- {
- cb4.Checked = false;
- }
- if (allNum.Contains("5"))
- {
- cb5.Checked = true;
- }
- else
- {
- cb5.Checked = false;
- }
- if (allNum.Contains("6"))
- {
- cb6.Checked = true;
- }
- else
- {
- cb6.Checked = false;
- }
- if (allNum.Contains("7"))
- {
- cb7.Checked = true;
- }
- else
- {
- cb7.Checked = false;
- }
- if (allNum.Contains("8"))
- {
- cb8.Checked = true;
- }
- else
- {
- cb8.Checked = false;
- }
- #endregion
- #region [相信息]
- for (int i = 0; i < generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter3.Count; i++)
- {
- PolyphaseData data = generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter3[i];
- viewModels[i].color = data.color;
- mPhaseModels[i].Model.color = data.color;
- mPhaseModels[i].ColorStart = data.downNum;
- mPhaseModels[i].ColorEnd = data.upNum;
- cRControl.SetColor(i, Color.FromArgb(data.color));
- PhaseModel model = this.applyButtonImpl(Color.FromArgb(data.color), data.downNum, data.upNum);
- this.documentWorkspace.phaseModels[i] = model;
- this.phaseModels[i] = model;
- }
- this.documentWorkspace.Refresh();
- #endregion
- checkBox1.Checked = generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter12;
- cb_SelectPhase.SelectedItem = generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter2;
- if (cb_SelectPhase.SelectedIndex == -1) {
- numericUpDown_RangeStart.Value = mPhaseModels[0].ColorStart;
- numericUpDown_RangeEnd.Value = mPhaseModels[0].ColorEnd;
- }
- else
- {
- numericUpDown_RangeStart.Value = mPhaseModels[cb_SelectPhase.SelectedIndex].ColorStart;
- numericUpDown_RangeEnd.Value = mPhaseModels[cb_SelectPhase.SelectedIndex].ColorEnd;
- }
- commonControlButtons.trackBar.Value = generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter13;
- if (generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter5) {
- checkBox10.Checked = true;
- numericUpDown_KDStart.Value = generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter7;
- numericUpDown_KDEnd.Value = generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter8;
- }
- if (generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter6)
- {
- checkBox11.Checked = true;
- numericUpDown_SXStart.Value = generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter9;
- numericUpDown_SXEnd.Value = generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter10;
- }
- numericUpDown1.Value = generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter11;
- for (int i = 0; i < listView1.Items.Count; i++) {
- if (everyImgData.ContainsKey(listView1.Items[i].Name))
- {
- everyImgData[listView1.Items[i].Name] = generalAnalysisModel.PolyphaseMutiAreaContentModels;
- }
- else {
- everyImgData.Add(listView1.Items[i].Name, generalAnalysisModel.PolyphaseMutiAreaContentModels);
- }
- }
- }
- }
- }
- /// <summary>
- /// 保存上次操作参数
- /// </summary>
- private void saveLastData(object sender, EventArgs e)
- {
- #region [开启脚本录制]
- if (appWorkspace.startScriptRecording)
- {
- getScriptRecording();
- }
- #endregion
- if (generalAnalysisModel.PolyphaseMutiAreaContentModels == null)
- {
- generalAnalysisModel.PolyphaseMutiAreaContentModels = new PolyphaseMutiAreaContentModel();
- }
- generalAnalysisModel.PolyphaseMutiAreaContentModels.hasUsed = true;
- generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter1 = xiang_num;
- generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter12 = checkBox1.Checked;
- generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter13 = commonControlButtons.trackBar.Value;
- generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter2 = cb_SelectPhase.SelectedItem == null ? "" : cb_SelectPhase.SelectedItem.ToString();
- if (generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter3 == null)
- {
- generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter3 = new List<PolyphaseData>();
- }
- var list = new List<PolyphaseData>();
- foreach (var s in mPhaseModels)
- {
- PolyphaseData data = new PolyphaseData();
- data.color = s.Model.color;
- data.downNum = s.ColorStart;
- data.upNum = s.ColorEnd;
- list.Add(data);
- }
- generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter3 = list;
- #region [保存物相选择]
- string all = String.Empty;
- if (cb1.Checked)
- {
- all += "1,";
- }
- if (cb2.Checked)
- {
- all += "2,";
- }
- if (cb3.Checked)
- {
- all += "3,";
- }
- if (cb4.Checked)
- {
- all += "4,";
- }
- if (cb5.Checked)
- {
- all += "5,";
- }
- if (cb6.Checked)
- {
- all += "6,";
- }
- if (cb7.Checked)
- {
- all += "7,";
- }
- if (cb8.Checked)
- {
- all += "8,";
- }
- generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter4 = all;
- #endregion
- generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter5 = checkBox10.Checked;
- generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter6 = checkBox11.Checked;
- generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter7 = (int)numericUpDown_KDStart.Value;
- generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter8 = (int)numericUpDown_KDEnd.Value;
- generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter9 = (int)numericUpDown_SXStart.Value;
- generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter10 = (int)numericUpDown_SXEnd.Value;
- generalAnalysisModel.PolyphaseMutiAreaContentModels.parameter11 = (int)numericUpDown1.Value;
- string filePath = Application.StartupPath + "\\Config\\Default\\ParameterSaving\\ParameterGeneralAnalysis.xml";
- string porosityInfoXml = XmlSerializeHelper.XmlSerialize<GeneralAnalysisModel>(generalAnalysisModel);
- FileOperationHelper.WriteStringToFile(porosityInfoXml, filePath, FileMode.Create);
- }
- private void showImg(object sender, EventArgs e)
- {
- listView1.Focus();
- if (this.imgIndex != -1)
- {
- //滚动到指定的行位置
- this.listView1.EnsureVisible(this.imgIndex);
- this.listView1.Items[imgIndex].Focused = true;
- this.listView1.Items[imgIndex].Selected = true;
- //如果是脚本执行,将参数带入
- if (appWorkspace.ScriptRunning && appWorkspace.ScriptCurrentParam != null)
- {
- this.initScriptValues = true;//ScriptAutomatic
- //Boolean initScriptValues = true;
- ////在这里反射出对应功能的参数类
- string className = InvariantData.path_Action + ".Action" + menuId;
- ParamObject param = (ParamObject)System.Reflection.Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
- foreach (Args arg in param.Lists)
- {
- Args param1 = appWorkspace.ScriptCurrentParam.Lists.Find(m => m.Key.Equals(arg.Key));
- if (param1.value != null)
- arg.Value = param1.value;
- getValue(arg.key, arg.Value);
- }
- appWorkspace.ScriptCurrentParam = null;//阻止第二次进入仍然被赋值参数
- }
- else
- {//读取上次关闭窗口时保存的参数
- getLastData();
- }
- }
- if (this.initScriptValues && this.appWorkspace.ScriptAutomatic)
- this.startScriptAutomaticAction();
- }
- /// <summary>
- /// 执行脚本自动化的步骤
- /// </summary>
- private void startScriptAutomaticAction()
- {
- //this.button8.PerformClick();
- //this.button7.PerformClick();
- button8_Click();
- button7_Click();
- if (isExportResults)//导出结果
- this.button4.PerformClick();
- if (isExportReports)//生成报告
- this.button3.PerformClick();
- if (isExportProjects)//导出项目
- this.button9.PerformClick();
- this.appWorkspace.ScriptAutomatic = false;
- this.Close();
- }
- private void ColorRangeChangeEvent(object sender, EventArgs e)
- {
- this.numericUpDown_RangeStart.ValueChanged -= this.numericUpDown_RangeStart_ValueChanged;
- this.numericUpDown_RangeEnd.ValueChanged -= this.numericUpDown_RangeEnd_ValueChanged;
- //this.selectIndex = cRControl.SelectIndex;
- this.numericUpDown_RangeStart.Value = rangeColors[selectIndex].Start;
- this.numericUpDown_RangeEnd.Value = rangeColors[selectIndex].End;
- mPhaseModels[cRControl.SelectIndex].ColorStart = rangeColors[selectIndex].Start;
- mPhaseModels[cRControl.SelectIndex].ColorEnd = rangeColors[selectIndex].End;
- this.cb_SelectPhase.SelectedIndex = cRControl.SelectIndex;
- try
- {
- mPhaseModels[cRControl.SelectIndex + 1].ColorStart = rangeColors[selectIndex + 1].Start;
- }
- catch (Exception)
- {
- }
- for (int i = 0; i < this.documentWorkspace.phaseModels.Count; i++)
- {
- this.documentWorkspace.phaseModels[i] = applyButtonImpl(rangeColors[i].Color, rangeColors[i].Start, rangeColors[i].End);
- Bitmap bmp = MakeTransparent(this.documentWorkspace.phaseModels[i].mat.ToBitmap(), this.commonControlButtons.trackBar.Value);
- this.documentWorkspace.phaseModels[i].mat = bmp.ToMat();
- }
- this.documentWorkspace.Refresh();
- this.numericUpDown_RangeStart.ValueChanged += this.numericUpDown_RangeStart_ValueChanged;
- this.numericUpDown_RangeEnd.ValueChanged += this.numericUpDown_RangeEnd_ValueChanged;
- }
- private void InitCommonButtonEvent()
- {
- this.commonControlButtons.zoomInButton.Click += new EventHandler(zoomInButton_Click);
- this.commonControlButtons.zoomOutButton.Click += new EventHandler(zoomOutButton_Click);
- this.commonControlButtons.zoomToWindowButton.Click += new EventHandler(zoomToWindowButton_Click);
- this.commonControlButtons.actualSizeButton.Click += new EventHandler(actualSizeButton_Click);
- this.commonControlButtons.pointerButton.Click += new EventHandler(pointerButton_Click);
- this.commonControlButtons.mobileModeButton.Click += new EventHandler(mobileModeButton_Click);
- this.commonControlButtons.trackBar.ValueChanged += new EventHandler(TrackBar_ValueChanged);
- }
- public Bitmap MakeTransparent(Bitmap src, int num)
- {
- try
- {
- int w = src.Width;
- int h = src.Height;
- Bitmap dstBitmap = new Bitmap(src.Width, src.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
- System.Drawing.Imaging.BitmapData srcData = src.LockBits(new Rectangle(0, 0, w, h), System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
- System.Drawing.Imaging.BitmapData dstData = dstBitmap.LockBits(new Rectangle(0, 0, w, h), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
- unsafe
- {
- byte* pIn = (byte*)srcData.Scan0.ToPointer();
- byte* pOut = (byte*)dstData.Scan0.ToPointer();
- byte* p;
- int stride = srcData.Stride;
- int r, g, b, a;
- for (int y = 0; y < h; y++)
- {
- for (int x = 0; x < w; x++)
- {
- p = pIn;
- b = pIn[0];
- g = pIn[1];
- r = pIn[2];
- a = pIn[3];
- pOut[0] = (byte)b;
- pOut[1] = (byte)g;
- pOut[2] = (byte)r;
- if (a != 0)
- {
- pOut[3] = (byte)num;
- }else
- {
- pOut[3] = (byte)a;
- }
-
- pIn += 4;
- pOut += 4;
- }
- pIn += srcData.Stride - w * 4;
- pOut += srcData.Stride - w * 4;
- }
- src.UnlockBits(srcData);
- dstBitmap.UnlockBits(dstData);
- return dstBitmap;
- }
- }
- catch (Exception)
- {
- return null;
- }
- }
- private void TrackBar_ValueChanged(object sender, EventArgs e)
- {
- List<int> allCheck = new List<int>();
- if (cb1.Checked)
- {
- allCheck.Add(0);
- }
- if (cb2.Checked)
- {
- allCheck.Add(1);
- }
- if (cb3.Checked)
- {
- allCheck.Add(2);
- }
- if (cb4.Checked)
- {
- allCheck.Add(3);
- }
- if (cb5.Checked)
- {
- allCheck.Add(4);
- }
- if (cb6.Checked)
- {
- allCheck.Add(5);
- }
- if (cb7.Checked)
- {
- allCheck.Add(6);
- }
- if (cb8.Checked)
- {
- allCheck.Add(7);
- }
- for (int i = 0; i < this.documentWorkspace.phaseModels.Count; i++)
- {
- if (!allCheck.Contains(i))
- {
- continue;
- }
- this.documentWorkspace.phaseModels[i] = applyButtonImpl(rangeColors[i].Color, rangeColors[i].Start, rangeColors[i].End);
- Bitmap bmp = MakeTransparent(this.documentWorkspace.phaseModels[i].mat.ToBitmap(),this.commonControlButtons.trackBar.Value);
- this.documentWorkspace.phaseModels[i].mat = bmp.ToMat();
- }
- this.documentWorkspace.Refresh();
- }
- private void zoomInButton_Click(object sender, EventArgs e)
- {
- if (this.imageMat!= null)
- this.documentWorkspace.ZoomIn();
- }
- private void zoomOutButton_Click(object sender, EventArgs e)
- {
- if (this.imageMat != null)
- this.documentWorkspace.ZoomOut();
- }
- private void zoomToWindowButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomBasis = ZoomBasis.FitToWindow;
- }
- private void actualSizeButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomBasis = ZoomBasis.ScaleFactor;
- this.documentWorkspace.ScaleFactor = ScaleFactor.OneToOne;
- }
- private void pointerButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.Pointer;
- }
- private void mobileModeButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.MoveMode;
- }
- private void CRControl_Click(object sender, EventArgs e)
- {
- showParams(mPhaseModels[cRControl.SelectIndex]);
- }
- public void InitPicList()
- {
- //初始化图片列表
- for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
- {
- this.imageList1.Images.Add("img" + i, this.appWorkspace.DocumentWorkspaces[i].BinarizationThumbnail);
- this.listView1.Items.Add("", i);
- this.listView1.Items[i].ImageIndex = i;
- String imageName = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
- if (listView1.Items.Find(imageName, false).Count() > 0)
- {
- if (imageName.Split('.').Count() > 1)
- {
- imageName = imageName.Split('.')[0] + "(" + listView1.Items.Find(imageName, false).Count() + ")." + imageName.Split('.')[1];
- }
- }
- this.listView1.Items[i].Text = imageName;
- this.listView1.Items[i].Name = imageName;
- if (this.appWorkspace.DocumentWorkspaces[i].Equals(this.appWorkspace.ActiveDocumentWorkspace))
- {
- this.imgIndex = i;
- }
- }
- }
- #region init
- private void InitializeLanguageText()
- {
- this.But_DeleteKD.Text = PdnResources.GetString("Menu.application.text");
- this.checkBox11.Text = PdnResources.GetString("Menu.Clasticdelete.text") + "(μm²)";
- this.checkBox10.Text = PdnResources.GetString("Menu.BinaryAction.HoleRemoval.Text") + "(μm²)";
- this.Text = PdnResources.GetString("Menu.GeneralAnalysis.MultiphaseContent.Text");
- this.label6.Text = PdnResources.GetString("Menu.Generalanalysis.Multiphasecontent.Phaseinterval.text");
- this.label5.Text = PdnResources.GetString("Menu.Generalanalysis.Multiphasecontent.Phasecolor.text");
- this.label4.Text = PdnResources.GetString("Menu.Generalanalysis.Multiphasecontent.Phasename.text");
- this.label3.Text = PdnResources.GetString("Menu.Generalanalysis.Multiphasecontent.Phaseselection.text");
- this.label2.Text = PdnResources.GetString("Menu.Numberofmultiphase.Text");
- this.groupBox3.Text = PdnResources.GetString("Menu.BinaryAction.Text");
- this.But_DeleteSX.Text = PdnResources.GetString("Menu.application.text");
- this.button5.Text = PdnResources.GetString("Menu.LabelAction.SelectAllLabel.Text");
- this.cb8.Text = PdnResources.GetString("Menu.phase.text") + "8";
- this.cb6.Text = PdnResources.GetString("Menu.phase.text") + "6";
- this.cb4.Text = PdnResources.GetString("Menu.phase.text") + "4";
- this.cb7.Text = PdnResources.GetString("Menu.phase.text") + "7";
- this.cb5.Text = PdnResources.GetString("Menu.phase.text") + "5";
- this.cb3.Text = PdnResources.GetString("Menu.phase.text") + "3";
- this.cb2.Text = PdnResources.GetString("Menu.phase.text") + "2";
- this.cb1.Text = PdnResources.GetString("Menu.phase.text") + "1";
- this.label7.Text = PdnResources.GetString("Menu.Generalanalysis.Multiphasecontent.displayphase.text");
- this.dataGridViewTextBoxColumn3.HeaderText = PdnResources.GetString("Menu.proportion.text");
- this.dataGridViewTextBoxColumn4.HeaderText = PdnResources.GetString("Menu.Phasecontent.text");
- this.button9.Text = PdnResources.GetString("Menu.Tools.OpenProject.Text");
- this.label1.Text = PdnResources.GetString("Menu.Decimal.text");
- this.button4.Text = PdnResources.GetString("Menu.Exportresults.text");
- this.button3.Text = PdnResources.GetString("Menu.Tools.CreateReport.Text");
- this.groupBox2.Text = PdnResources.GetString("Menu.Generalanalysis.Multiphasecontent.Phasesetting.text");
- this.button6.Text = PdnResources.GetString("Menu.Theoriginalcolor.text");
- this.groupBox4.Text = PdnResources.GetString("Menu.Tools.ImageIndex.Text");
- this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
- this.btn_close.Text = PdnResources.GetString("Menu.File.Close.Text");
- this.button2.Text = PdnResources.GetString("Menu.Saveresult.text");
- this.checkBox1.Text = PdnResources.GetString("Menu.Opensettingsatingreport.text");
- this.button1.Text = PdnResources.GetString("Menu.Setting.Text");
- this.groupBox_review.Text = PdnResources.GetString("Menu.Preview.text");
- this.groupBox5.Text = PdnResources.GetString("Menu.Analysisresult.text");
- this.button_remove.Text = PdnResources.GetString("Menu.Edit.Delete.Text");
- this.button_all.Text = PdnResources.GetString("Menu.Showall.text");
- this.Column5.HeaderText = PdnResources.GetString("Menu.picture.Text");
- this.dataGridViewTextBoxColumn1.HeaderText = PdnResources.GetString("Menu.Phasename.text");
- this.dataGridViewTextBoxColumn2.HeaderText = PdnResources.GetString("Menu.Phasearea.text");
- }
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.listView1 = new System.Windows.Forms.ListView();
- this.imageList1 = new System.Windows.Forms.ImageList(this.components);
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.btn_close = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.checkBox1 = new System.Windows.Forms.CheckBox();
- this.button1 = new System.Windows.Forms.Button();
- this.groupBox_review = new System.Windows.Forms.GroupBox();
- this.groupBox5 = new System.Windows.Forms.GroupBox();
- this.listBox_analysisResult = new System.Windows.Forms.CheckedListBox();
- this.button_remove = new System.Windows.Forms.Button();
- this.button_all = new System.Windows.Forms.Button();
- this.groupBox6 = new System.Windows.Forms.GroupBox();
- this.dataGridView_results = new System.Windows.Forms.DataGridView();
- this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.groupBox7 = new System.Windows.Forms.GroupBox();
- this.button9 = new System.Windows.Forms.Button();
- this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
- this.label1 = new System.Windows.Forms.Label();
- this.button4 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.button6 = new System.Windows.Forms.Button();
- this.button5 = new System.Windows.Forms.Button();
- this.numericUpDown_RangeEnd = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown_RangeStart = new System.Windows.Forms.NumericUpDown();
- this.panel2 = new System.Windows.Forms.Panel();
- this.cb8 = new System.Windows.Forms.CheckBox();
- this.cb6 = new System.Windows.Forms.CheckBox();
- this.cb4 = new System.Windows.Forms.CheckBox();
- this.cb7 = new System.Windows.Forms.CheckBox();
- this.cb5 = new System.Windows.Forms.CheckBox();
- this.cb3 = new System.Windows.Forms.CheckBox();
- this.cb2 = new System.Windows.Forms.CheckBox();
- this.cb1 = new System.Windows.Forms.CheckBox();
- this.label7 = new System.Windows.Forms.Label();
- this.label6 = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
- this.txt_phaseName = new System.Windows.Forms.TextBox();
- this.label4 = new System.Windows.Forms.Label();
- this.cb_SelectPhase = new System.Windows.Forms.ComboBox();
- this.label3 = new System.Windows.Forms.Label();
- this.rb8 = new System.Windows.Forms.RadioButton();
- this.rb7 = new System.Windows.Forms.RadioButton();
- this.rb6 = new System.Windows.Forms.RadioButton();
- this.rb5 = new System.Windows.Forms.RadioButton();
- this.rb4 = new System.Windows.Forms.RadioButton();
- this.rb3 = new System.Windows.Forms.RadioButton();
- this.rb2 = new System.Windows.Forms.RadioButton();
- this.rb1 = new System.Windows.Forms.RadioButton();
- this.label2 = new System.Windows.Forms.Label();
- this.panel1 = new System.Windows.Forms.Panel();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.numericUpDown_SXEnd = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown_SXStart = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown_KDEnd = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown_KDStart = new System.Windows.Forms.NumericUpDown();
- this.But_DeleteSX = new System.Windows.Forms.Button();
- this.But_DeleteKD = new System.Windows.Forms.Button();
- this.checkBox11 = new System.Windows.Forms.CheckBox();
- this.checkBox10 = new System.Windows.Forms.CheckBox();
- this.groupBox4.SuspendLayout();
- this.groupBox1.SuspendLayout();
- this.groupBox5.SuspendLayout();
- this.groupBox6.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView_results)).BeginInit();
- this.groupBox7.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
- this.groupBox2.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_RangeEnd)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_RangeStart)).BeginInit();
- this.groupBox3.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_SXEnd)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_SXStart)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_KDEnd)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_KDStart)).BeginInit();
- this.SuspendLayout();
- //
- // groupBox4
- //
- this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox4.Controls.Add(this.listView1);
- this.groupBox4.Location = new System.Drawing.Point(13, 72);
- this.groupBox4.Margin = new System.Windows.Forms.Padding(4);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Padding = new System.Windows.Forms.Padding(4);
- this.groupBox4.Size = new System.Drawing.Size(158, 483);
- this.groupBox4.TabIndex = 9;
- this.groupBox4.TabStop = false;
- this.groupBox4.Text = "图像索引";
- //
- // listView1
- //
- this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.listView1.HideSelection = false;
- this.listView1.LargeImageList = this.imageList1;
- this.listView1.Location = new System.Drawing.Point(8, 26);
- this.listView1.Margin = new System.Windows.Forms.Padding(4);
- this.listView1.MultiSelect = false;
- this.listView1.Name = "listView1";
- this.listView1.Size = new System.Drawing.Size(140, 449);
- this.listView1.TabIndex = 0;
- this.listView1.UseCompatibleStateImageBehavior = false;
- this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
- //
- // imageList1
- //
- this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
- this.imageList1.ImageSize = new System.Drawing.Size(64, 64);
- this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
- //
- // groupBox1
- //
- this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox1.Controls.Add(this.btn_close);
- this.groupBox1.Controls.Add(this.button2);
- this.groupBox1.Controls.Add(this.checkBox1);
- this.groupBox1.Controls.Add(this.button1);
- this.groupBox1.Location = new System.Drawing.Point(20, 12);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(1145, 53);
- this.groupBox1.TabIndex = 10;
- this.groupBox1.TabStop = false;
- this.groupBox1.Text = "操作";
- //
- // btn_close
- //
- this.btn_close.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btn_close.Location = new System.Drawing.Point(972, 21);
- this.btn_close.Name = "btn_close";
- this.btn_close.Size = new System.Drawing.Size(75, 23);
- this.btn_close.TabIndex = 3;
- this.btn_close.Text = "关闭";
- this.btn_close.UseVisualStyleBackColor = true;
- this.btn_close.Click += new System.EventHandler(this.btn_close_Click);
- //
- // button2
- //
- this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button2.Location = new System.Drawing.Point(1053, 21);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(75, 23);
- this.button2.TabIndex = 2;
- this.button2.Text = "保存结果";
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // checkBox1
- //
- this.checkBox1.AutoSize = true;
- this.checkBox1.Location = new System.Drawing.Point(98, 24);
- this.checkBox1.Name = "checkBox1";
- this.checkBox1.Size = new System.Drawing.Size(132, 16);
- this.checkBox1.TabIndex = 1;
- this.checkBox1.Text = "生成报告时打开设置";
- this.checkBox1.UseVisualStyleBackColor = true;
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(6, 24);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(75, 23);
- this.button1.TabIndex = 0;
- this.button1.Text = "设置";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // groupBox_review
- //
- this.groupBox_review.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox_review.Location = new System.Drawing.Point(590, 72);
- this.groupBox_review.Name = "groupBox_review";
- this.groupBox_review.Size = new System.Drawing.Size(575, 483);
- this.groupBox_review.TabIndex = 12;
- this.groupBox_review.TabStop = false;
- this.groupBox_review.Text = "预览";
- //
- // groupBox5
- //
- this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox5.Controls.Add(this.listBox_analysisResult);
- this.groupBox5.Controls.Add(this.button_remove);
- this.groupBox5.Controls.Add(this.button_all);
- this.groupBox5.Location = new System.Drawing.Point(12, 562);
- this.groupBox5.Name = "groupBox5";
- this.groupBox5.Size = new System.Drawing.Size(224, 165);
- this.groupBox5.TabIndex = 13;
- this.groupBox5.TabStop = false;
- this.groupBox5.Text = "分析结果";
- //
- // listBox_analysisResult
- //
- this.listBox_analysisResult.CheckOnClick = true;
- this.listBox_analysisResult.FormattingEnabled = true;
- this.listBox_analysisResult.HorizontalScrollbar = true;
- this.listBox_analysisResult.Location = new System.Drawing.Point(11, 59);
- this.listBox_analysisResult.Name = "listBox_analysisResult";
- this.listBox_analysisResult.Size = new System.Drawing.Size(202, 100);
- this.listBox_analysisResult.TabIndex = 11;
- this.listBox_analysisResult.SelectedIndexChanged += new System.EventHandler(this.listBox_analysisResult_SelectedIndexChanged);
- //
- // button_remove
- //
- this.button_remove.Location = new System.Drawing.Point(130, 24);
- this.button_remove.Name = "button_remove";
- this.button_remove.Size = new System.Drawing.Size(75, 23);
- this.button_remove.TabIndex = 8;
- this.button_remove.Text = "删除";
- this.button_remove.UseVisualStyleBackColor = true;
- this.button_remove.Click += new System.EventHandler(this.button_remove_Click);
- //
- // button_all
- //
- this.button_all.Location = new System.Drawing.Point(14, 24);
- this.button_all.Name = "button_all";
- this.button_all.Size = new System.Drawing.Size(75, 23);
- this.button_all.TabIndex = 1;
- this.button_all.Text = "全部显示";
- this.button_all.UseVisualStyleBackColor = true;
- this.button_all.Click += new System.EventHandler(this.button_all_Click);
- //
- // groupBox6
- //
- this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox6.Controls.Add(this.dataGridView_results);
- this.groupBox6.Location = new System.Drawing.Point(249, 562);
- this.groupBox6.Name = "groupBox6";
- this.groupBox6.Size = new System.Drawing.Size(769, 165);
- this.groupBox6.TabIndex = 14;
- this.groupBox6.TabStop = false;
- //
- // dataGridView_results
- //
- this.dataGridView_results.AllowUserToAddRows = false;
- this.dataGridView_results.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.dataGridView_results.BorderStyle = System.Windows.Forms.BorderStyle.None;
- this.dataGridView_results.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView_results.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.Column5,
- this.dataGridViewTextBoxColumn1,
- this.dataGridViewTextBoxColumn2,
- this.dataGridViewTextBoxColumn3,
- this.dataGridViewTextBoxColumn4});
- this.dataGridView_results.Location = new System.Drawing.Point(16, 20);
- this.dataGridView_results.Name = "dataGridView_results";
- this.dataGridView_results.RowHeadersVisible = false;
- this.dataGridView_results.RowHeadersWidth = 51;
- this.dataGridView_results.RowTemplate.Height = 27;
- this.dataGridView_results.Size = new System.Drawing.Size(733, 139);
- this.dataGridView_results.TabIndex = 1;
- //
- // Column5
- //
- this.Column5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
- this.Column5.HeaderText = "Column5";
- this.Column5.MinimumWidth = 6;
- this.Column5.Name = "Column5";
- //
- // dataGridViewTextBoxColumn1
- //
- this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
- this.dataGridViewTextBoxColumn1.HeaderText = "dataGridViewTextBoxColumn1";
- this.dataGridViewTextBoxColumn1.MinimumWidth = 6;
- this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
- //
- // dataGridViewTextBoxColumn2
- //
- this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
- this.dataGridViewTextBoxColumn2.HeaderText = "dataGridViewTextBoxColumn2";
- this.dataGridViewTextBoxColumn2.MinimumWidth = 6;
- this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
- //
- // dataGridViewTextBoxColumn3
- //
- this.dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
- this.dataGridViewTextBoxColumn3.HeaderText = "dataGridViewTextBoxColumn3";
- this.dataGridViewTextBoxColumn3.MinimumWidth = 6;
- this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
- //
- // dataGridViewTextBoxColumn4
- //
- this.dataGridViewTextBoxColumn4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
- this.dataGridViewTextBoxColumn4.HeaderText = "dataGridViewTextBoxColumn4";
- this.dataGridViewTextBoxColumn4.MinimumWidth = 6;
- this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
- //
- // groupBox7
- //
- this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox7.Controls.Add(this.button9);
- this.groupBox7.Controls.Add(this.numericUpDown1);
- this.groupBox7.Controls.Add(this.label1);
- this.groupBox7.Controls.Add(this.button4);
- this.groupBox7.Controls.Add(this.button3);
- this.groupBox7.Location = new System.Drawing.Point(1031, 562);
- this.groupBox7.Name = "groupBox7";
- this.groupBox7.Size = new System.Drawing.Size(133, 165);
- this.groupBox7.TabIndex = 15;
- this.groupBox7.TabStop = false;
- //
- // button9
- //
- this.button9.Location = new System.Drawing.Point(29, 89);
- this.button9.Name = "button9";
- this.button9.Size = new System.Drawing.Size(75, 23);
- this.button9.TabIndex = 7;
- this.button9.Text = "项目工程";
- this.button9.UseVisualStyleBackColor = true;
- this.button9.Click += new System.EventHandler(this.button9_Click);
- //
- // numericUpDown1
- //
- this.numericUpDown1.Location = new System.Drawing.Point(62, 127);
- this.numericUpDown1.Maximum = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.numericUpDown1.Name = "numericUpDown1";
- this.numericUpDown1.Size = new System.Drawing.Size(42, 21);
- this.numericUpDown1.TabIndex = 4;
- this.numericUpDown1.Value = new decimal(new int[] {
- 2,
- 0,
- 0,
- 0});
- this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(27, 129);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(41, 12);
- this.label1.TabIndex = 3;
- this.label1.Text = "小数:";
- //
- // button4
- //
- this.button4.Location = new System.Drawing.Point(29, 53);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(75, 23);
- this.button4.TabIndex = 1;
- this.button4.Text = "导出结果";
- this.button4.UseVisualStyleBackColor = true;
- this.button4.Click += new System.EventHandler(this.button4_Click);
- //
- // button3
- //
- this.button3.Location = new System.Drawing.Point(29, 18);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(75, 23);
- this.button3.TabIndex = 0;
- this.button3.Text = "生成报告";
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += new System.EventHandler(this.button3_Click);
- //
- // groupBox2
- //
- this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox2.Controls.Add(this.button6);
- this.groupBox2.Controls.Add(this.button5);
- this.groupBox2.Controls.Add(this.numericUpDown_RangeEnd);
- this.groupBox2.Controls.Add(this.numericUpDown_RangeStart);
- this.groupBox2.Controls.Add(this.panel2);
- this.groupBox2.Controls.Add(this.cb8);
- this.groupBox2.Controls.Add(this.cb6);
- this.groupBox2.Controls.Add(this.cb4);
- this.groupBox2.Controls.Add(this.cb7);
- this.groupBox2.Controls.Add(this.cb5);
- this.groupBox2.Controls.Add(this.cb3);
- this.groupBox2.Controls.Add(this.cb2);
- this.groupBox2.Controls.Add(this.cb1);
- this.groupBox2.Controls.Add(this.label7);
- this.groupBox2.Controls.Add(this.label6);
- this.groupBox2.Controls.Add(this.label5);
- this.groupBox2.Controls.Add(this.txt_phaseName);
- this.groupBox2.Controls.Add(this.label4);
- this.groupBox2.Controls.Add(this.cb_SelectPhase);
- this.groupBox2.Controls.Add(this.label3);
- this.groupBox2.Controls.Add(this.rb8);
- this.groupBox2.Controls.Add(this.rb7);
- this.groupBox2.Controls.Add(this.rb6);
- this.groupBox2.Controls.Add(this.rb5);
- this.groupBox2.Controls.Add(this.rb4);
- this.groupBox2.Controls.Add(this.rb3);
- this.groupBox2.Controls.Add(this.rb2);
- this.groupBox2.Controls.Add(this.rb1);
- this.groupBox2.Controls.Add(this.label2);
- this.groupBox2.Controls.Add(this.panel1);
- this.groupBox2.Location = new System.Drawing.Point(178, 72);
- this.groupBox2.Margin = new System.Windows.Forms.Padding(3, 3, 3, 112);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(406, 366);
- this.groupBox2.TabIndex = 18;
- this.groupBox2.TabStop = false;
- this.groupBox2.Text = "相设置";
- //
- // button6
- //
- this.button6.Location = new System.Drawing.Point(279, 311);
- this.button6.Name = "button6";
- this.button6.Size = new System.Drawing.Size(75, 23);
- this.button6.TabIndex = 32;
- this.button6.Text = "原图";
- this.button6.UseVisualStyleBackColor = true;
- this.button6.Click += new System.EventHandler(this.button6_Click);
- //
- // button5
- //
- this.button5.Location = new System.Drawing.Point(188, 311);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(75, 23);
- this.button5.TabIndex = 31;
- this.button5.Text = "全选";
- this.button5.UseVisualStyleBackColor = true;
- this.button5.Click += new System.EventHandler(this.button5_Click);
- //
- // numericUpDown_RangeEnd
- //
- this.numericUpDown_RangeEnd.Location = new System.Drawing.Point(270, 187);
- this.numericUpDown_RangeEnd.Maximum = new decimal(new int[] {
- 256,
- 0,
- 0,
- 0});
- this.numericUpDown_RangeEnd.Name = "numericUpDown_RangeEnd";
- this.numericUpDown_RangeEnd.Size = new System.Drawing.Size(52, 21);
- this.numericUpDown_RangeEnd.TabIndex = 30;
- this.numericUpDown_RangeEnd.ValueChanged += new System.EventHandler(this.numericUpDown_RangeEnd_ValueChanged);
- this.numericUpDown_RangeEnd.KeyUp += new System.Windows.Forms.KeyEventHandler(this.numericUpDown_RangeEnd_KeyUp);
- //
- // numericUpDown_RangeStart
- //
- this.numericUpDown_RangeStart.Location = new System.Drawing.Point(187, 187);
- this.numericUpDown_RangeStart.Maximum = new decimal(new int[] {
- 256,
- 0,
- 0,
- 0});
- this.numericUpDown_RangeStart.Name = "numericUpDown_RangeStart";
- this.numericUpDown_RangeStart.Size = new System.Drawing.Size(51, 21);
- this.numericUpDown_RangeStart.TabIndex = 29;
- this.numericUpDown_RangeStart.ValueChanged += new System.EventHandler(this.numericUpDown_RangeStart_ValueChanged);
- this.numericUpDown_RangeStart.KeyUp += new System.Windows.Forms.KeyEventHandler(this.numericUpDown_RangeStart_KeyUp);
- //
- // panel2
- //
- this.panel2.BackColor = System.Drawing.Color.White;
- this.panel2.Location = new System.Drawing.Point(187, 150);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(135, 22);
- this.panel2.TabIndex = 28;
- this.panel2.Click += new System.EventHandler(this.panel2_Click);
- //
- // cb8
- //
- this.cb8.AutoSize = true;
- this.cb8.Location = new System.Drawing.Point(247, 288);
- this.cb8.Name = "cb8";
- this.cb8.Size = new System.Drawing.Size(42, 16);
- this.cb8.TabIndex = 27;
- this.cb8.Text = "相8";
- this.cb8.UseVisualStyleBackColor = true;
- this.cb8.CheckedChanged += new System.EventHandler(this.cb8_CheckedChanged);
- //
- // cb6
- //
- this.cb6.AutoSize = true;
- this.cb6.Location = new System.Drawing.Point(247, 266);
- this.cb6.Name = "cb6";
- this.cb6.Size = new System.Drawing.Size(42, 16);
- this.cb6.TabIndex = 26;
- this.cb6.Text = "相6";
- this.cb6.UseVisualStyleBackColor = true;
- this.cb6.CheckedChanged += new System.EventHandler(this.cb6_CheckedChanged);
- //
- // cb4
- //
- this.cb4.AutoSize = true;
- this.cb4.Location = new System.Drawing.Point(247, 244);
- this.cb4.Name = "cb4";
- this.cb4.Size = new System.Drawing.Size(42, 16);
- this.cb4.TabIndex = 25;
- this.cb4.Text = "相4";
- this.cb4.UseVisualStyleBackColor = true;
- this.cb4.CheckedChanged += new System.EventHandler(this.cb4_CheckedChanged);
- //
- // cb7
- //
- this.cb7.AutoSize = true;
- this.cb7.Location = new System.Drawing.Point(188, 288);
- this.cb7.Name = "cb7";
- this.cb7.Size = new System.Drawing.Size(42, 16);
- this.cb7.TabIndex = 24;
- this.cb7.Text = "相7";
- this.cb7.UseVisualStyleBackColor = true;
- this.cb7.CheckedChanged += new System.EventHandler(this.cb7_CheckedChanged);
- //
- // cb5
- //
- this.cb5.AutoSize = true;
- this.cb5.Location = new System.Drawing.Point(188, 266);
- this.cb5.Name = "cb5";
- this.cb5.Size = new System.Drawing.Size(42, 16);
- this.cb5.TabIndex = 23;
- this.cb5.Text = "相5";
- this.cb5.UseVisualStyleBackColor = true;
- this.cb5.CheckedChanged += new System.EventHandler(this.cb5_CheckedChanged);
- //
- // cb3
- //
- this.cb3.AutoSize = true;
- this.cb3.Location = new System.Drawing.Point(188, 244);
- this.cb3.Name = "cb3";
- this.cb3.Size = new System.Drawing.Size(42, 16);
- this.cb3.TabIndex = 22;
- this.cb3.Text = "相3";
- this.cb3.UseVisualStyleBackColor = true;
- this.cb3.CheckedChanged += new System.EventHandler(this.cb3_CheckedChanged);
- //
- // cb2
- //
- this.cb2.AutoSize = true;
- this.cb2.Location = new System.Drawing.Point(247, 222);
- this.cb2.Name = "cb2";
- this.cb2.Size = new System.Drawing.Size(42, 16);
- this.cb2.TabIndex = 21;
- this.cb2.Text = "相2";
- this.cb2.UseVisualStyleBackColor = true;
- this.cb2.CheckedChanged += new System.EventHandler(this.cb2_CheckedChanged);
- //
- // cb1
- //
- this.cb1.AutoSize = true;
- this.cb1.Location = new System.Drawing.Point(188, 222);
- this.cb1.Name = "cb1";
- this.cb1.Size = new System.Drawing.Size(42, 16);
- this.cb1.TabIndex = 20;
- this.cb1.Text = "相1";
- this.cb1.UseVisualStyleBackColor = true;
- this.cb1.CheckedChanged += new System.EventHandler(this.cb1_CheckedChanged);
- //
- // label7
- //
- this.label7.AutoSize = true;
- this.label7.Location = new System.Drawing.Point(105, 223);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(53, 12);
- this.label7.TabIndex = 19;
- this.label7.Text = "显示物相";
- //
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(105, 189);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(53, 12);
- this.label6.TabIndex = 16;
- this.label6.Text = "物相区间";
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(105, 150);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(53, 12);
- this.label5.TabIndex = 14;
- this.label5.Text = "物相颜色";
- //
- // txt_phaseName
- //
- this.txt_phaseName.Location = new System.Drawing.Point(188, 117);
- this.txt_phaseName.Name = "txt_phaseName";
- this.txt_phaseName.ReadOnly = true;
- this.txt_phaseName.Size = new System.Drawing.Size(134, 21);
- this.txt_phaseName.TabIndex = 13;
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(105, 117);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(53, 12);
- this.label4.TabIndex = 12;
- this.label4.Text = "物相名称";
- //
- // cb_SelectPhase
- //
- this.cb_SelectPhase.FormattingEnabled = true;
- this.cb_SelectPhase.Location = new System.Drawing.Point(188, 85);
- this.cb_SelectPhase.Name = "cb_SelectPhase";
- this.cb_SelectPhase.Size = new System.Drawing.Size(134, 20);
- this.cb_SelectPhase.TabIndex = 11;
- this.cb_SelectPhase.SelectedIndexChanged += new System.EventHandler(this.cb_SelectPhase_SelectedIndexChanged);
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(105, 88);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(53, 12);
- this.label3.TabIndex = 10;
- this.label3.Text = "物相选择";
- //
- // rb8
- //
- this.rb8.AutoSize = true;
- this.rb8.Location = new System.Drawing.Point(293, 57);
- this.rb8.Name = "rb8";
- this.rb8.Size = new System.Drawing.Size(29, 16);
- this.rb8.TabIndex = 9;
- this.rb8.TabStop = true;
- this.rb8.Text = "8";
- this.rb8.UseVisualStyleBackColor = true;
- this.rb8.CheckedChanged += new System.EventHandler(this.rb8_CheckedChanged);
- //
- // rb7
- //
- this.rb7.AutoSize = true;
- this.rb7.Location = new System.Drawing.Point(258, 57);
- this.rb7.Name = "rb7";
- this.rb7.Size = new System.Drawing.Size(29, 16);
- this.rb7.TabIndex = 8;
- this.rb7.TabStop = true;
- this.rb7.Text = "7";
- this.rb7.UseVisualStyleBackColor = true;
- this.rb7.CheckedChanged += new System.EventHandler(this.rb7_CheckedChanged);
- //
- // rb6
- //
- this.rb6.AutoSize = true;
- this.rb6.Location = new System.Drawing.Point(223, 57);
- this.rb6.Name = "rb6";
- this.rb6.Size = new System.Drawing.Size(29, 16);
- this.rb6.TabIndex = 7;
- this.rb6.TabStop = true;
- this.rb6.Text = "6";
- this.rb6.UseVisualStyleBackColor = true;
- this.rb6.CheckedChanged += new System.EventHandler(this.rb6_CheckedChanged);
- //
- // rb5
- //
- this.rb5.AutoSize = true;
- this.rb5.Location = new System.Drawing.Point(188, 57);
- this.rb5.Name = "rb5";
- this.rb5.Size = new System.Drawing.Size(29, 16);
- this.rb5.TabIndex = 6;
- this.rb5.TabStop = true;
- this.rb5.Text = "5";
- this.rb5.UseVisualStyleBackColor = true;
- this.rb5.CheckedChanged += new System.EventHandler(this.rb5_CheckedChanged);
- //
- // rb4
- //
- this.rb4.AutoSize = true;
- this.rb4.Location = new System.Drawing.Point(293, 26);
- this.rb4.Name = "rb4";
- this.rb4.Size = new System.Drawing.Size(29, 16);
- this.rb4.TabIndex = 5;
- this.rb4.TabStop = true;
- this.rb4.Text = "4";
- this.rb4.UseVisualStyleBackColor = true;
- this.rb4.CheckedChanged += new System.EventHandler(this.rb4_CheckedChanged);
- //
- // rb3
- //
- this.rb3.AutoSize = true;
- this.rb3.Location = new System.Drawing.Point(258, 26);
- this.rb3.Name = "rb3";
- this.rb3.Size = new System.Drawing.Size(29, 16);
- this.rb3.TabIndex = 4;
- this.rb3.TabStop = true;
- this.rb3.Text = "3";
- this.rb3.UseVisualStyleBackColor = true;
- this.rb3.CheckedChanged += new System.EventHandler(this.rb3_CheckedChanged);
- //
- // rb2
- //
- this.rb2.AutoSize = true;
- this.rb2.Location = new System.Drawing.Point(223, 26);
- this.rb2.Name = "rb2";
- this.rb2.Size = new System.Drawing.Size(29, 16);
- this.rb2.TabIndex = 3;
- this.rb2.TabStop = true;
- this.rb2.Text = "2";
- this.rb2.UseVisualStyleBackColor = true;
- this.rb2.CheckedChanged += new System.EventHandler(this.rb2_CheckedChanged);
- //
- // rb1
- //
- this.rb1.AutoSize = true;
- this.rb1.Location = new System.Drawing.Point(188, 26);
- this.rb1.Name = "rb1";
- this.rb1.Size = new System.Drawing.Size(29, 16);
- this.rb1.TabIndex = 2;
- this.rb1.TabStop = true;
- this.rb1.Text = "1";
- this.rb1.UseVisualStyleBackColor = true;
- this.rb1.CheckedChanged += new System.EventHandler(this.rb1_CheckedChanged);
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(107, 26);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(53, 12);
- this.label2.TabIndex = 1;
- this.label2.Text = "多相数量";
- //
- // panel1
- //
- this.panel1.Location = new System.Drawing.Point(6, 26);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(93, 256);
- this.panel1.TabIndex = 0;
- //
- // groupBox3
- //
- this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox3.Controls.Add(this.numericUpDown_SXEnd);
- this.groupBox3.Controls.Add(this.numericUpDown_SXStart);
- this.groupBox3.Controls.Add(this.numericUpDown_KDEnd);
- this.groupBox3.Controls.Add(this.numericUpDown_KDStart);
- this.groupBox3.Controls.Add(this.But_DeleteSX);
- this.groupBox3.Controls.Add(this.But_DeleteKD);
- this.groupBox3.Controls.Add(this.checkBox11);
- this.groupBox3.Controls.Add(this.checkBox10);
- this.groupBox3.Location = new System.Drawing.Point(178, 444);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(406, 112);
- this.groupBox3.TabIndex = 17;
- this.groupBox3.TabStop = false;
- this.groupBox3.Text = "二值操作";
- //
- // numericUpDown_SXEnd
- //
- this.numericUpDown_SXEnd.Location = new System.Drawing.Point(206, 64);
- this.numericUpDown_SXEnd.Maximum = new decimal(new int[] {
- 100000000,
- 0,
- 0,
- 0});
- this.numericUpDown_SXEnd.Name = "numericUpDown_SXEnd";
- this.numericUpDown_SXEnd.Size = new System.Drawing.Size(51, 21);
- this.numericUpDown_SXEnd.TabIndex = 33;
- //
- // numericUpDown_SXStart
- //
- this.numericUpDown_SXStart.Location = new System.Drawing.Point(135, 64);
- this.numericUpDown_SXStart.Maximum = new decimal(new int[] {
- 10000,
- 0,
- 0,
- 0});
- this.numericUpDown_SXStart.Name = "numericUpDown_SXStart";
- this.numericUpDown_SXStart.Size = new System.Drawing.Size(51, 21);
- this.numericUpDown_SXStart.TabIndex = 32;
- //
- // numericUpDown_KDEnd
- //
- this.numericUpDown_KDEnd.Location = new System.Drawing.Point(206, 31);
- this.numericUpDown_KDEnd.Maximum = new decimal(new int[] {
- 100000000,
- 0,
- 0,
- 0});
- this.numericUpDown_KDEnd.Name = "numericUpDown_KDEnd";
- this.numericUpDown_KDEnd.Size = new System.Drawing.Size(51, 21);
- this.numericUpDown_KDEnd.TabIndex = 31;
- //
- // numericUpDown_KDStart
- //
- this.numericUpDown_KDStart.Location = new System.Drawing.Point(135, 33);
- this.numericUpDown_KDStart.Maximum = new decimal(new int[] {
- 10000,
- 0,
- 0,
- 0});
- this.numericUpDown_KDStart.Name = "numericUpDown_KDStart";
- this.numericUpDown_KDStart.Size = new System.Drawing.Size(51, 21);
- this.numericUpDown_KDStart.TabIndex = 30;
- //
- // But_DeleteSX
- //
- this.But_DeleteSX.Location = new System.Drawing.Point(273, 65);
- this.But_DeleteSX.Name = "But_DeleteSX";
- this.But_DeleteSX.Size = new System.Drawing.Size(75, 23);
- this.But_DeleteSX.TabIndex = 7;
- this.But_DeleteSX.Text = "应用";
- this.But_DeleteSX.UseVisualStyleBackColor = true;
- this.But_DeleteSX.Click += new System.EventHandler(this.But_DeleteSX_Click);
- //
- // But_DeleteKD
- //
- this.But_DeleteKD.Location = new System.Drawing.Point(273, 31);
- this.But_DeleteKD.Name = "But_DeleteKD";
- this.But_DeleteKD.Size = new System.Drawing.Size(75, 23);
- this.But_DeleteKD.TabIndex = 6;
- this.But_DeleteKD.Text = "应用";
- this.But_DeleteKD.UseVisualStyleBackColor = true;
- this.But_DeleteKD.Click += new System.EventHandler(this.But_DeleteKD_Click);
- //
- // checkBox11
- //
- this.checkBox11.AutoSize = true;
- this.checkBox11.Location = new System.Drawing.Point(21, 69);
- this.checkBox11.Name = "checkBox11";
- this.checkBox11.Size = new System.Drawing.Size(108, 16);
- this.checkBox11.TabIndex = 1;
- this.checkBox11.Text = "碎屑删除(μm²)";
- this.checkBox11.UseVisualStyleBackColor = true;
- this.checkBox11.CheckedChanged += new System.EventHandler(this.checkBox11_CheckedChanged);
- //
- // checkBox10
- //
- this.checkBox10.AutoSize = true;
- this.checkBox10.Location = new System.Drawing.Point(21, 36);
- this.checkBox10.Name = "checkBox10";
- this.checkBox10.Size = new System.Drawing.Size(108, 16);
- this.checkBox10.TabIndex = 0;
- this.checkBox10.Text = "孔洞删除(μm²)";
- this.checkBox10.UseVisualStyleBackColor = true;
- this.checkBox10.CheckedChanged += new System.EventHandler(this.checkBox10_CheckedChanged);
- //
- // PolyphaseMutiAreaContent
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(1177, 744);
- this.Controls.Add(this.groupBox3);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox7);
- this.Controls.Add(this.groupBox6);
- this.Controls.Add(this.groupBox5);
- this.Controls.Add(this.groupBox_review);
- this.Controls.Add(this.groupBox1);
- this.Controls.Add(this.groupBox4);
- this.Name = "PolyphaseMutiAreaContent";
- this.Text = "多相含量";
- this.Controls.SetChildIndex(this.groupBox4, 0);
- this.Controls.SetChildIndex(this.groupBox1, 0);
- this.Controls.SetChildIndex(this.groupBox_review, 0);
- this.Controls.SetChildIndex(this.groupBox5, 0);
- this.Controls.SetChildIndex(this.groupBox6, 0);
- this.Controls.SetChildIndex(this.groupBox7, 0);
- this.Controls.SetChildIndex(this.groupBox2, 0);
- this.Controls.SetChildIndex(this.groupBox3, 0);
- this.groupBox4.ResumeLayout(false);
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.groupBox5.ResumeLayout(false);
- this.groupBox6.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView_results)).EndInit();
- this.groupBox7.ResumeLayout(false);
- this.groupBox7.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
- this.groupBox2.ResumeLayout(false);
- this.groupBox2.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_RangeEnd)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_RangeStart)).EndInit();
- this.groupBox3.ResumeLayout(false);
- this.groupBox3.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_SXEnd)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_SXStart)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_KDEnd)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_KDStart)).EndInit();
- this.ResumeLayout(false);
- }
- #endregion
- private void Init_CheckBoxes()
- {
- foreach (Control ctrl in this.groupBox2.Controls) //遍历窗体中的所有控件,Control是所有控件的基类
- {
- if (ctrl.GetType().Name == "CheckBox") //判断是否为CheckBox
- {
- if (ctrl.Name.IndexOf("cb")>=0)
- {
- CheckBox cBox = (CheckBox)ctrl; //创建CheckBox对象
- cBox.Checked = false;
- cBox.Enabled = false;
- }
- }
- }
- }
- private void ChangeNumber(int num)
- {
- this.documentWorkspace.phaseModels.Clear();
- this.cb_SelectPhase.Items.Clear();
- this.phaseModels.Clear();
- this.mPhaseModels.Clear();
- this.viewModels.Clear();
- this.rangeColors.Clear();
- cb_SelectPhase.Text = "";
- selectIndex = 0;
- this.xiang_num = num;
- Init_CheckBoxes();
- int step = 255 / num;
- for (int i = 0; i < num; i++)
- {
- PhaseModel model = this.applyButtonImpl(DefaultColor[i], i * step, (i + 1) * step);
- model.name = "相" + (i + 1);
- PhaseModel viewModel = new PhaseModel();
- viewModel.choise = model.choise;
- viewModel.color = model.color;
- viewModel.name = model.name;
- viewModel.position = model.position;
- viewModel.mat = new OpenCvSharp.Mat();
- model.mat.CopyTo(viewModel.mat);
- MutiPolyphaseModel mPModel = new MutiPolyphaseModel();
- mPModel.Model = viewModel;
- int start = i * step;
- if (i != 0)
- {
- start += 1;
- }
- mPModel.ColorStart = start;
- mPModel.ColorEnd = (i + 1) * step;
- if (i == num - 1)
- {
- mPModel.ColorEnd = 255;
- }
- mPhaseModels.Add(mPModel);
- viewModels.Add(viewModel);
- phaseModels.Add(model);
- rangeColors.Add(new RangeColor(mPModel.ColorStart, mPModel.ColorEnd, DefaultColor[i]));
- cb_SelectPhase.Items.Add(mPModel.Model.name);
- foreach (Control ctrl in this.groupBox2.Controls) //遍历窗体中的所有控件,Control是所有控件的基类
- {
- if (ctrl.GetType().Name == "CheckBox") //判断是否为CheckBox
- {
-
- if (ctrl.Name.Equals("cb"+(i+1)))
- {
- CheckBox cBox = (CheckBox)ctrl; //创建CheckBox对象
- cBox.Checked = true;
- cBox.Enabled = true;
- }
- }
- }
- }
- this.cRControl.RangeColors = rangeColors;
- this.cRControl.Refresh();
- this.documentWorkspace.phaseModels = viewModels;
- this.documentWorkspace.Refresh();
- ShowthisParams(mPhaseModels[0]);
- }
- private void ShowthisParams(MutiPolyphaseModel pModel)
- {
- cb_SelectPhase.SelectedText = pModel.Model.name;
- cb_SelectPhase.SelectedIndex = 0;
- selectIndex = cb_SelectPhase.SelectedIndex;
- this.cRControl.SelectIndex = cb_SelectPhase.SelectedIndex;
- txt_phaseName.Text = pModel.Model.name;
- panel2.BackColor = Color.FromArgb(pModel.Model.color);
- numericUpDown_RangeStart.Value = pModel.ColorStart;
- numericUpDown_RangeEnd.Value = pModel.ColorEnd;
- }
- /// <summary>
- /// 参数改变时,重新处理图像
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private PhaseModel applyButtonImpl(Color pColor,int start,int end)
- {
- PhaseModel model = new PhaseModel();
- if (this.listView1.FocusedItem != null)
- {
- //判断是否存在视场,如果存在视场,则把视场提取出来,进行处理
- foreach (Args args in action.Lists)
- {
- if (args.Key == "phaseColor")
- {
- args.Value = pColor.ToArgb();
- break;
- }
- if (args.Key == "scope1")
- {
- List<double> twoL = new List<double>();
- twoL.Add(start);
- twoL.Add(end);
- args.Value = twoL;
- }
- }
- if (this.documentWorkspace.GraphicsList.IsExsitView())
- {
- model.mat = action.PerformProcess(
- PaintDotNet.Camera.Tools.ToMat(this.documentWorkspace.GetFullSizeWithRegion()),
- this.imageMat.Clone());
- model.color = pColor.ToArgb();
- model.choise = true;
- }
- else
- {
- model.mat = action.PerformProcess(this.imageMat.Clone());
- model.color = pColor.ToArgb();
- model.choise = true;
- }
- }
- return model;
- }
- #region select phase Numer
- private void rb1_CheckedChanged(object sender, EventArgs e)
- {
- if (rb1.Checked)
- {
- ChangeNumber(1);
- }
-
- }
- private void rb2_CheckedChanged(object sender, EventArgs e)
- {
- if (rb2.Checked)
- {
- ChangeNumber(2);
- }
- }
- private void rb3_CheckedChanged(object sender, EventArgs e)
- {
- if (rb3.Checked)
- {
- ChangeNumber(3);
- }
- }
- private void rb4_CheckedChanged(object sender, EventArgs e)
- {
- if (rb4.Checked)
- {
- ChangeNumber(4);
- }
- }
- private void rb5_CheckedChanged(object sender, EventArgs e)
- {
- if (rb5.Checked)
- {
- ChangeNumber(5);
- }
- }
- private void rb6_CheckedChanged(object sender, EventArgs e)
- {
- if (rb6.Checked)
- {
- ChangeNumber(6);
- }
- }
- private void rb7_CheckedChanged(object sender, EventArgs e)
- {
- if (rb7.Checked)
- {
- ChangeNumber(7);
- }
- }
- private void rb8_CheckedChanged(object sender, EventArgs e)
- {
- if (rb8.Checked)
- {
- ChangeNumber(8);
- }
- }
- #endregion
- private void listView1_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (this.listView1.FocusedItem != null && this.listView1.FocusedItem.Selected)
- {
- if (!string.IsNullOrEmpty(this.selectedImg))
- {
- #region [保存图片参数]
- PolyphaseMutiAreaContentModel model = new PolyphaseMutiAreaContentModel();
- model.hasUsed = true;
- model.parameter1 = xiang_num;
- model.parameter12 = checkBox1.Checked;
- model.parameter13 = commonControlButtons.trackBar.Value;
- model.parameter2 = cb_SelectPhase.SelectedItem == null ? "" : cb_SelectPhase.SelectedItem.ToString();
- if (model.parameter3 == null)
- {
- model.parameter3 = new List<PolyphaseData>();
- }
- var list = new List<PolyphaseData>();
- foreach (var s in mPhaseModels)
- {
- PolyphaseData data = new PolyphaseData();
- data.color = s.Model.color;
- data.downNum = s.ColorStart;
- data.upNum = s.ColorEnd;
- list.Add(data);
- }
- model.parameter3 = list;
- #region [保存物相选择]
- string all = String.Empty;
- if (cb1.Checked)
- {
- all += "1,";
- }
- if (cb2.Checked)
- {
- all += "2,";
- }
- if (cb3.Checked)
- {
- all += "3,";
- }
- if (cb4.Checked)
- {
- all += "4,";
- }
- if (cb5.Checked)
- {
- all += "5,";
- }
- if (cb6.Checked)
- {
- all += "6,";
- }
- if (cb7.Checked)
- {
- all += "7,";
- }
- if (cb8.Checked)
- {
- all += "8,";
- }
- model.parameter4 = all;
- #endregion
- model.parameter5 = checkBox10.Checked;
- model.parameter6 = checkBox11.Checked;
- model.parameter7 = (int)numericUpDown_KDStart.Value;
- model.parameter8 = (int)numericUpDown_KDEnd.Value;
- model.parameter9 = (int)numericUpDown_SXStart.Value;
- model.parameter10 = (int)numericUpDown_SXEnd.Value;
- model.parameter11 = (int)numericUpDown1.Value;
- if (everyImgData.ContainsKey(this.selectedImg))
- {
- everyImgData[this.selectedImg] = model;
- }
- else
- {
- everyImgData.Add(this.selectedImg, model);
- }
- #endregion
- }
- this.imageMat = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreatedAliasedMat();
- Document document = Document.FromImageMat(imageMat.Clone());
- this.documentWorkspace.Document = document;
- this.documentWorkspace.Visible = true;
- this.documentWorkspace.GraphicsList = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GraphicsList;
- #region [设置参数]
- this.selectedImg = this.listView1.FocusedItem.Name;
- if (everyImgData.ContainsKey(this.selectedImg)) {
- var imgData = everyImgData[this.selectedImg];
- #region [多相数量]
- switch (imgData.parameter1)
- {
- case 0:
- rb1.Checked = true;
- break;
- case 1:
- rb1.Checked = true;
- break;
- case 2:
- rb1.Checked = true;
- rb2.Checked = true;
- break;
- case 3:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- break;
- case 4:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- break;
- case 5:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- rb5.Checked = true;
- break;
- case 6:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- rb5.Checked = true;
- rb6.Checked = true;
- break;
- case 7:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- rb5.Checked = true;
- rb6.Checked = true;
- rb7.Checked = true;
- break;
- case 8:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- rb5.Checked = true;
- rb6.Checked = true;
- rb7.Checked = true;
- rb8.Checked = true;
- break;
- }
- #endregion
- #region [相信息]
- for (int i = 0; i < imgData.parameter3.Count; i++)
- {
- PolyphaseData data = imgData.parameter3[i];
- viewModels[i].color = data.color;
- mPhaseModels[i].Model.color = data.color;
- mPhaseModels[i].ColorStart = data.downNum;
- mPhaseModels[i].ColorEnd = data.upNum;
- cRControl.SetColor(i, Color.FromArgb(data.color));
- PhaseModel thisModel = this.applyButtonImpl(Color.FromArgb(data.color), data.downNum, data.upNum);
- this.documentWorkspace.phaseModels[i] = thisModel;
- this.phaseModels[i] = thisModel;
- }
- this.documentWorkspace.Refresh();
- #endregion
- checkBox1.Checked = imgData.parameter12;
- cb_SelectPhase.SelectedItem = imgData.parameter2;
- if (cb_SelectPhase.SelectedItem != null) {
- txt_phaseName.Text = cb_SelectPhase.SelectedItem.ToString();
- }
- commonControlButtons.trackBar.Value = imgData.parameter13;
- #region [显示物相]
- string[] allNum = imgData.parameter4.Split(',');
- if (allNum.Contains("1"))
- {
- cb1.Checked = true;
- }
- else
- {
- cb1.Checked = false;
- }
- if (allNum.Contains("2"))
- {
- cb2.Checked = true;
- }
- else
- {
- cb2.Checked = false;
- }
- if (allNum.Contains("3"))
- {
- cb3.Checked = true;
- }
- else
- {
- cb3.Checked = false;
- }
- if (allNum.Contains("4"))
- {
- cb4.Checked = true;
- }
- else
- {
- cb4.Checked = false;
- }
- if (allNum.Contains("5"))
- {
- cb5.Checked = true;
- }
- else
- {
- cb5.Checked = false;
- }
- if (allNum.Contains("6"))
- {
- cb6.Checked = true;
- }
- else
- {
- cb6.Checked = false;
- }
- if (allNum.Contains("7"))
- {
- cb7.Checked = true;
- }
- else
- {
- cb7.Checked = false;
- }
- if (allNum.Contains("8"))
- {
- cb8.Checked = true;
- }
- else
- {
- cb8.Checked = false;
- }
- #endregion
- if (imgData.parameter5)
- {
- checkBox10.Checked = true;
- numericUpDown_KDStart.Value = imgData.parameter7;
- numericUpDown_KDEnd.Value = imgData.parameter8;
- }
- else {
- checkBox10.Checked = false;
- numericUpDown_KDStart.Value = 0;
- numericUpDown_KDEnd.Value = 0;
- }
- if (imgData.parameter6)
- {
- checkBox11.Checked = true;
- numericUpDown_SXStart.Value = imgData.parameter9;
- numericUpDown_SXEnd.Value = imgData.parameter10;
- }
- else
- {
- checkBox11.Checked = false;
- numericUpDown_SXStart.Value = 0;
- numericUpDown_SXEnd.Value = 0;
- }
- numericUpDown1.Value = imgData.parameter11;
- if (cb_SelectPhase.SelectedIndex == -1)
- {
- showParams(mPhaseModels[0]);
- }
- else
- {
- showParams(mPhaseModels[cb_SelectPhase.SelectedIndex]);
- }
- }
- #endregion
- this.orginPhaseModels.Clear();
- groupBox2.Enabled = true;
- }
- }
- private void panel2_Click(object sender, EventArgs e)
- {
- this.colorsFormGrid.UserPrimaryColor = ColorBgra.FromColor(this.panel2.BackColor);
- this.colorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.gridColorChanged));
- this.colorsFormGrid.ShowDialog();
- }
- /// <summary>
- /// Panel2的调色板颜色改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void gridColorChanged(object sender, EventArgs e)
- {
- Color color = this.colorsFormGrid.UserPrimaryColor.ToColor();
- //先修改参数
- foreach (Args args in action.Lists)
- {
- if (args.Key == "phaseColor")
- {
- args.Value = color.ToArgb();
- break;
- }
- }
- //更改背景色,触发事件
- this.panel2.BackColor = color;
- //改变配置文件里面的相颜色
- //this.binaryExtractionModel.PhaseColor = color.ToArgb();
- //关闭色板
- RangeColor active = rangeColors[selectIndex];
- active.Color = color;
- rangeColors[selectIndex] = active;
- this.cRControl.RangeColors = rangeColors;
- this.cRControl.Refresh();
- PhaseModel model = this.applyButtonImpl(Color.FromArgb(color.ToArgb()), (int)numericUpDown_RangeStart.Value, (int)numericUpDown_RangeEnd.Value);
- model.name = this.cb_SelectPhase.Items[selectIndex].ToString();
- this.documentWorkspace.phaseModels[selectIndex] = model;
- mPhaseModels[selectIndex].Model = model;
- mPhaseModels[selectIndex].Model.color = color.ToArgb();
- this.phaseModels[selectIndex] = model;
- this.documentWorkspace.Refresh();
- this.colorsFormGrid.Close();
- }
- private void ChangePhaseVisable(int num)
- {
- foreach (Control ctrl in this.groupBox2.Controls) //遍历窗体中的所有控件,Control是所有控件的基类
- {
- if (ctrl.GetType().Name == "CheckBox") //判断是否为CheckBox
- {
- if (ctrl.Name.Equals("cb" + num))
- {
- CheckBox cBox = (CheckBox)ctrl; //创建CheckBox对象
- if (viewModels.Count >= num)
- {
- if (cBox.Checked)
- {
- viewModels[num-1].choise = true;
- phaseModels[num - 1].choise = true;
- }
- else
- {
- viewModels[num-1].choise = false;
- phaseModels[num - 1].choise = false;
- }
- }
- }
- }
- }
- this.documentWorkspace.phaseModels = viewModels;
- this.documentWorkspace.Refresh();
- }
- private void cb1_CheckedChanged(object sender, EventArgs e)
- {
- ChangePhaseVisable(1);
- }
- private void cb2_CheckedChanged(object sender, EventArgs e)
- {
- ChangePhaseVisable(2);
- }
- private void cb3_CheckedChanged(object sender, EventArgs e)
- {
- ChangePhaseVisable(3);
- }
- private void cb4_CheckedChanged(object sender, EventArgs e)
- {
- ChangePhaseVisable(4);
- }
- private void cb5_CheckedChanged(object sender, EventArgs e)
- {
- ChangePhaseVisable(5);
- }
- private void cb6_CheckedChanged(object sender, EventArgs e)
- {
- ChangePhaseVisable(6);
- }
- private void cb7_CheckedChanged(object sender, EventArgs e)
- {
- ChangePhaseVisable(7);
- }
- private void cb8_CheckedChanged(object sender, EventArgs e)
- {
-
- ChangePhaseVisable(8);
- }
- private void cb_SelectPhase_SelectedIndexChanged(object sender, EventArgs e)
- {
- selectIndex = cb_SelectPhase.SelectedIndex;
- this.cRControl.SelectIndex = cb_SelectPhase.SelectedIndex;
- if (selectIndex != -1)
- {
- txt_phaseName.Text = mPhaseModels[selectIndex].Model.name;
- numericUpDown_RangeStart.Value = mPhaseModels[selectIndex].ColorStart;
- numericUpDown_RangeEnd.Value = mPhaseModels[selectIndex].ColorEnd;
- panel2.BackColor = Color.FromArgb(mPhaseModels[selectIndex].Model.color);
- }
- }
- private void showParams(MutiPolyphaseModel model)
- {
- if (cb_SelectPhase.SelectedIndex == -1) {
- txt_phaseName.Text = model.Model.name;
- }
- numericUpDown_RangeStart.Value = model.ColorStart;
- numericUpDown_RangeEnd.Value = model.ColorEnd;
- panel2.BackColor = Color.FromArgb(model.Model.color);
- }
- private void button2_Click(object sender, EventArgs e)
- {
- if (listView1.SelectedItems.Count==0)
- {
- MessageBox.Show(PdnResources.GetString("Menu.seselecttheimagethatyouwanttoan.Text")+"!");
- return;
- }
- double pxPerUnit = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRuler(MeasurementUnit.Micron);
- String tag = listView1.FocusedItem.Text;
- List<Bitmap> tempBit = new List<Bitmap>();
- if (listView1.FocusedItem != null)
- {
- if (mainPolyphaseAnalysisResults.FindAll(item => item.GraphName.Equals(listView1.FocusedItem.Text)).Count == 0)
- {
- listBox_analysisResult.Items.Add(this.listView1.FocusedItem.Text);
- listBox_analysisResult.SetItemChecked(listBox_analysisResult.Items.Count - 1, true);
- }
- else
- {
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Theresuethertoreplace.text")+"?", PdnResources.GetString("Form.OkButton.Text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
- if (dr != DialogResult.OK)
- {
- return;
- }
- mainPolyphaseAnalysisResults.RemoveAll(item => item.GraphName.Equals(listView1.FocusedItem.Text));
- viewPolyphaseAnalysisResults.RemoveAll(item => item.GraphName.Equals(listView1.FocusedItem.Text));
- List<string> list = new List<string>();
- foreach (var s in this.listBox_analysisResult.Items)
- {
- list.Add(s.ToString());
- }
- this.listBox_analysisResult.Items.Clear();
- foreach (var s in list)
- {
- this.listBox_analysisResult.Items.Add(s);
- }
- var thisindex = this.listBox_analysisResult.Items.IndexOf(listView1.FocusedItem.Text);
- this.listBox_analysisResult.SetItemChecked(thisindex, false);
- this.listBox_analysisResult_SelectedIndexChanged(sender, e);
- listBox_analysisResult.SetItemChecked(thisindex, true);
- }
- }else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
- return;
- }
- if (this.documentWorkspace.GraphicsList.IsExsitView())
- {
- for (int i = 0; i < this.documentWorkspace.phaseModels.Count; i++)
- {
- PhaseModel pModel = this.documentWorkspace.phaseModels[i];
- //if (pModel.choise)
- //{
- Color pColor = new Color();
- pColor = Color.FromArgb(pModel.color);
- Mat front = pModel.mat;
- int phaseAmount = AnalysisTools.GetPointsFromMat(front);
- Bitmap frontTarget = this.documentWorkspace.GetFullSizeWithRegion(front.ToBitmap());
- //获取相的点合计
- int frontAmount = AnalysisTools.GetPointsFromMat(PaintDotNet.Camera.Tools.ToMat(frontTarget));
- Mat background = this.imageMat.Clone();
- Mat roi = new Mat(background, new Rect(0, 0, background.Width, background.Height));
- Mat mask = Mat.FromImageData(front.ToBytes(), ImreadModes.Grayscale);
- front.CopyTo(roi, mask);
- Bitmap target = this.documentWorkspace.GetFullSizeWithRegion(background.ToBitmap());
- Mat targetMat = PaintDotNet.Camera.Tools.ToMat(target);
- //获取合并后视场内的点合计
- int allAmount = AnalysisTools.GetPointsFromMat(targetMat);
- int picAmount = AnalysisTools.GetPointsFromMat(background);
- double cRate = 0f;
- //计算比例
- //视场内部存在相
- if (frontAmount > 0)
- {
- cRate = (double)frontAmount / allAmount;
- }
- else
- {
- //视场内部不存在相
- cRate = (double)phaseAmount / allAmount;
- }
- //计算面积
- double cArea = phaseAmount;
- //计算相含量
- double fRate = (double)phaseAmount / picAmount;
- PolyphaseAnalysisResult pResult = new PolyphaseAnalysisResult();
- pResult.GraphName = this.listView1.FocusedItem.Text;
- pResult.PolyphaseName = mPhaseModels[i].Model.name;
- pResult.PolyphaseArea = cArea * pxPerUnit * pxPerUnit;
- pResult.PolyphaseRate = cRate * 100;
- pResult.PolyphaseAllRate = fRate * 100;
- mainPolyphaseAnalysisResults.Add(pResult);
- viewPolyphaseAnalysisResults.Add(pResult);
-
- }
- }
- else
- {
- for (int i = 0; i < this.documentWorkspace.phaseModels.Count; i++)
- {
- PhaseModel pModel = this.documentWorkspace.phaseModels[i];
- Color pColor = new Color();
- pColor = Color.FromArgb(pModel.color);
- int phaseArea = AnalysisTools.GetPointsFromMat(pModel.mat);
- Mat sourceMat = this.imageMat.Clone();
- int picAmount = AnalysisTools.GetPointsFromMat(sourceMat);
- //计算面积
- double cRate = (double)phaseArea / picAmount;
- PolyphaseAnalysisResult pResult = new PolyphaseAnalysisResult();
- pResult.GraphName = this.listView1.FocusedItem.Text;
- pResult.PolyphaseName = mPhaseModels[i].Model.name;
- pResult.PolyphaseArea = phaseArea * pxPerUnit * pxPerUnit;
- pResult.PolyphaseRate = cRate * 100;
- pResult.PolyphaseAllRate = cRate * 100;
- mainPolyphaseAnalysisResults.Add(pResult);
- viewPolyphaseAnalysisResults.Add(pResult);
- }
- }
- List<PolyphaseAnalysisResult> selectItems = mainPolyphaseAnalysisResults.FindAll(u => u.GraphName == listView1.FocusedItem.Text);
- for (int i = 0; i < selectItems.Count; i++)
- {
- PolyphaseAnalysisResult pResult = selectItems[i];
- dataGridView_results.Rows.Add(pResult.GraphName, pResult.PolyphaseName, AnalysisTools.GetDecNum(pResult.PolyphaseArea, decnum), AnalysisTools.GetDecNum(pResult.PolyphaseRate, decnum), AnalysisTools.GetDecNum(pResult.PolyphaseAllRate, decnum));
- }
- for (int i = 0; i < this.documentWorkspace.phaseModels.Count; i++) {
- double pantographRatio = (double)this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRulerMultiple(MeasurementUnit.Micron);//标尺*放大倍数
- Bitmap originalBit = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreateAliasedBitmap();
- originalBit.Tag = pantographRatio;
- if (i == 0) {
- tempBit.Add(originalBit);
- }
- Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- Graphics graphics = Graphics.FromImage(newBit);
- Bitmap processedBit = BitmapConverter.ToBitmap(this.documentWorkspace.phaseModels[i].mat);
- graphics.DrawImage(processedBit, new PointF(0, 0));
- newBit.Tag = pantographRatio;
- tempBit.Add(newBit);
- }
- if (bitDic.ContainsKey(tag))
- {
- bitDic[tag].Clear();
- bitDic[tag] = tempBit;
- }
- else
- {
- bitDic.Add(tag, tempBit);
- }
- }
- private void But_DeleteKD_Click(object sender, EventArgs e)
- {
- if (checkBox10.Checked)
- {
- KDDelete(Color.White);
- }
- }
- private void But_DeleteSX_Click(object sender, EventArgs e)
- {
- if (checkBox11.Checked)
- {
- SXDelete();
- }
- }
- private void numericUpDown_RangeStart_ValueChanged(object sender, EventArgs e)
- {
- this.selectIndex = this.cRControl.SelectIndex;
- if (selectIndex == -1) {
- return;
- }
- if (selectIndex != 0) {
- this.rangeColors[selectIndex - 1].End = (int)numericUpDown_RangeStart.Value - 1;
- this.mPhaseModels[selectIndex - 1].ColorEnd = (int)numericUpDown_RangeStart.Value - 1;
- }
- this.rangeColors[selectIndex].Start = (int)numericUpDown_RangeStart.Value;
- this.mPhaseModels[selectIndex].ColorStart = (int)numericUpDown_RangeStart.Value;
- this.cRControl.RangeColors = this.rangeColors;
- this.cRControl.Refresh();
- PhaseModel model = this.applyButtonImpl(Color.FromArgb(mPhaseModels[selectIndex].Model.color), (int)numericUpDown_RangeStart.Value, (int)numericUpDown_RangeEnd.Value);
- this.documentWorkspace.phaseModels[selectIndex] = model;
- this.documentWorkspace.Refresh();
- }
- private void numericUpDown_RangeEnd_ValueChanged(object sender, EventArgs e)
- {
- this.selectIndex = this.cRControl.SelectIndex;
- if (selectIndex == -1)
- {
- return;
- }
- PhaseModel model = this.applyButtonImpl(Color.FromArgb(mPhaseModels[selectIndex].Model.color), (int)numericUpDown_RangeStart.Value, (int)numericUpDown_RangeEnd.Value);
- if ((selectIndex-1)>=0)
- {
- this.rangeColors[selectIndex - 1].End = (int)this.rangeColors[selectIndex].Start - 1;
- this.mPhaseModels[selectIndex-1].ColorEnd = (int)this.rangeColors[selectIndex].Start - 1;
- }
- this.rangeColors[selectIndex].Start = (int)numericUpDown_RangeStart.Value;
- this.rangeColors[selectIndex].End = (int)numericUpDown_RangeEnd.Value;
- this.mPhaseModels[selectIndex].ColorStart = (int)numericUpDown_RangeStart.Value;
- this.mPhaseModels[selectIndex].ColorEnd = (int)numericUpDown_RangeEnd.Value;
- if (this.rangeColors.Count > (selectIndex + 1))
- {
- this.rangeColors[selectIndex + 1].Start = (int)this.rangeColors[selectIndex].End + 1;
- this.mPhaseModels[selectIndex + 1].ColorStart = (int)this.rangeColors[selectIndex].End + 1;
- }
- this.cRControl.RangeColors = this.rangeColors;
- this.cRControl.Refresh();
- this.documentWorkspace.phaseModels[selectIndex] = model;
- this.documentWorkspace.Refresh();
- }
- private void button_all_Click(object sender, EventArgs e)
- {
- dataGridView_results.Rows.Clear();
- if (this.is_all % 2 == 0)
- {
- for (int i = 0; i < listBox_analysisResult.Items.Count; i++)
- {
- listBox_analysisResult.SetItemChecked(i, false);
- }
- }
- else
- {
- for (int i = 0; i < listBox_analysisResult.Items.Count; i++)
- {
- listBox_analysisResult.SetItemChecked(i, true);
- }
- viewPolyphaseAnalysisResults.Clear();
- viewPolyphaseAnalysisResults.AddRange(mainPolyphaseAnalysisResults);
- for (int i = 0; i < viewPolyphaseAnalysisResults.Count; i++)
- {
- PolyphaseAnalysisResult pResult = viewPolyphaseAnalysisResults[i];
- dataGridView_results.Rows.Add(pResult.GraphName, pResult.PolyphaseName, AnalysisTools.GetDecNum(pResult.PolyphaseArea, decnum), AnalysisTools.GetDecNum(pResult.PolyphaseRate, decnum), AnalysisTools.GetDecNum(pResult.PolyphaseAllRate, decnum));
- }
- }
- this.is_all += 1;
- }
- private void button_remove_Click(object sender, EventArgs e)
- {
- var removeList = new List<string>();
- if (listBox_analysisResult.CheckedItems != null && listBox_analysisResult.CheckedItems.Count > 0)
- {
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.ertodeletetheselectedanalysisres.Text")+"?", PdnResources.GetString("Menu.Edit.Delete.Text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
- if (dr == DialogResult.OK)
- {
- dataGridView_results.Rows.Clear();
- foreach (var s in listBox_analysisResult.CheckedItems)
- {
- mainPolyphaseAnalysisResults.RemoveAll(u => u.GraphName == s.ToString());
- viewPolyphaseAnalysisResults.RemoveAll(u => u.GraphName == s.ToString());
- removeList.Add(s.ToString());
- }
- for (int i = 0; i < viewPolyphaseAnalysisResults.Count; i++)
- {
- PolyphaseAnalysisResult pResult = viewPolyphaseAnalysisResults[i];
- dataGridView_results.Rows.Add(pResult.GraphName, pResult.PolyphaseName, AnalysisTools.GetDecNum(pResult.PolyphaseArea, decnum), AnalysisTools.GetDecNum(pResult.PolyphaseRate, decnum), AnalysisTools.GetDecNum(pResult.PolyphaseAllRate, decnum));
- }
- foreach (var m in removeList)
- {
- listBox_analysisResult.Items.Remove(m);
- }
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttheimagetodelete.Text")+"!");
- }
- }
- private void numericUpDown1_ValueChanged(object sender, EventArgs e)
- {
- decnum = (int)numericUpDown1.Value;
- dataGridView_results.Rows.Clear();
- for (int i = 0; i < viewPolyphaseAnalysisResults.Count; i++)
- {
- PolyphaseAnalysisResult pResult = viewPolyphaseAnalysisResults[i];
- dataGridView_results.Rows.Add(pResult.GraphName, pResult.PolyphaseName, AnalysisTools.GetDecNum(pResult.PolyphaseArea,decnum), AnalysisTools.GetDecNum(pResult.PolyphaseRate, decnum), AnalysisTools.GetDecNum(pResult.PolyphaseAllRate, decnum));
- }
- }
- private void KDDelete(Color color)
- {
- //double pxPerUnit = Startup.instance.rules[MeasurementUnit.Micron];
- if (this.listView1.FocusedItem == null) {
- return;
- }
- double pxPerUnit = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRuler(MeasurementUnit.Micron);
- List<PhaseModel> phases = this.phaseModels.FindAll(a => a.choise == true);
- foreach (Args args in action914.Lists)
- {
- if (args.Key == "Scope")
- {
- ((List<double>)args.Value)[0] = (double)numericUpDown_KDStart.Value;
- ((List<double>)args.Value)[1] = (double)numericUpDown_KDEnd.Value;
- }
- if (args.Key == "HoleColor")
- {
- args.Value = color.ToArgb();
- }
- }
- List<PhaseModel> phasesCopy = this.viewModels.FindAll(a => a.choise == true);
- for (int i = 0; i < phases.Count; i++)
- {
- PhaseModel model = new PhaseModel();
- model.choise = phases[i].choise;
- model.color = phases[i].color;
- model.name = phases[i].name;
- model.position = phases[i].position;
- model.mat = new OpenCvSharp.Mat();
- phases[i].mat.CopyTo(model.mat);
- phasesCopy[i].mat = action914.PerformProcess(model, pxPerUnit);
- }
- this.documentWorkspace.Refresh();
- }
- private void SXDelete()
- {
- //double pxPerUnit = Startup.instance.rules[MeasurementUnit.Micron];
- if (this.listView1.FocusedItem == null)
- {
- return;
- }
- double pxPerUnit = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRuler(MeasurementUnit.Micron);
- foreach (Args args in action911.Lists)
- {
- if (args.Key == "FilterParameters")
- {
- args.Value = FilterParameters.Area;
- }
- if (args.Key == "Scope")
- {
- ((List<double>)args.Value)[0] = (double)numericUpDown_SXStart.Value;
- ((List<double>)args.Value)[1] = (double)numericUpDown_SXEnd.Value;
- }
- if (args.Key == "UnitParameters")
- {
- args.Value = MeasurementUnit.Micron;
- }
- if (args.Key == "BoundaryPreservation")
- {
- args.Value = true;
- }
- }
- //this.orginPhaseModels.Clear();
- if (orginPhaseModels.Count == 0)
- {
- foreach (var s in mPhaseModels)
- {
- var phaseCopy = new PhaseModel();
- phaseCopy.mat = s.Model.mat.Clone();
- phaseCopy.color = s.Model.color;
- phaseCopy.choise = s.Model.choise;
- phaseCopy.name = s.Model.name;
- orginPhaseModels.Add(phaseCopy);
- }
- }
- else {
- if (orginPhaseModels.Count < mPhaseModels.Count)
- {
- for (int i = 0; i < mPhaseModels.Count; i++) {
- if (i >= orginPhaseModels.Count)
- {
- var phaseCopy = new PhaseModel();
- phaseCopy.mat = mPhaseModels[i].Model.mat.Clone();
- phaseCopy.color = mPhaseModels[i].Model.color;
- phaseCopy.choise = mPhaseModels[i].Model.choise;
- phaseCopy.name = mPhaseModels[i].Model.name;
- orginPhaseModels.Add(phaseCopy);
- }
- else {
- PhaseModel model = this.applyButtonImpl(Color.FromArgb(mPhaseModels[i].Model.color), mPhaseModels[i].ColorStart, mPhaseModels[i].ColorEnd);
- orginPhaseModels[i].mat = model.mat;
- orginPhaseModels[i].color = mPhaseModels[i].Model.color;
- }
- }
- }
- else if (orginPhaseModels.Count == mPhaseModels.Count)
- {
- for (int i = 0; i < mPhaseModels.Count; i++)
- {
- PhaseModel model = this.applyButtonImpl(Color.FromArgb(mPhaseModels[i].Model.color), mPhaseModels[i].ColorStart, mPhaseModels[i].ColorEnd);
-
- orginPhaseModels[i].mat = model.mat;
- orginPhaseModels[i].color = mPhaseModels[i].Model.color;
- }
- }
- else {
- for (int i = 0; i < mPhaseModels.Count; i++)
- {
- PhaseModel model = this.applyButtonImpl(Color.FromArgb(mPhaseModels[i].Model.color), mPhaseModels[i].ColorStart, mPhaseModels[i].ColorEnd);
- orginPhaseModels[i].mat = model.mat;
- orginPhaseModels[i].color = mPhaseModels[i].Model.color;
- }
- }
- }
- //foreach (var s in mPhaseModels)
- //{
- // var phaseCopy = new PhaseModel();
- // phaseCopy.mat = s.Model.mat.Clone();
- // phaseCopy.color = s.Model.color;
- // phaseCopy.choise = s.Model.choise;
- // phaseCopy.name = s.Model.name;
- // orginPhaseModels.Add(phaseCopy);
- //}
- for (int i = 0; i < documentWorkspace.phaseModels.Count; i++)
- {
- this.documentWorkspace.phaseModels[i].mat = action911.PerformProcess(orginPhaseModels[i], pxPerUnit);
- };
- this.documentWorkspace.Refresh();
- }
- private void listBox_analysisResult_SelectedIndexChanged(object sender, EventArgs e)
- {
- dataGridView_results.Rows.Clear();
- if (listBox_analysisResult.CheckedItems != null && listBox_analysisResult.CheckedItems.Count > 0)
- {
- foreach (var s in listBox_analysisResult.CheckedItems)
- {
- List<PolyphaseAnalysisResult> selectItems = mainPolyphaseAnalysisResults.FindAll(u => u.GraphName == s.ToString());
- viewPolyphaseAnalysisResults.Clear();
- viewPolyphaseAnalysisResults.AddRange(selectItems);
- for (int i = 0; i < viewPolyphaseAnalysisResults.Count; i++)
- {
- PolyphaseAnalysisResult pResult = viewPolyphaseAnalysisResults[i];
- dataGridView_results.Rows.Add(pResult.GraphName, pResult.PolyphaseName, AnalysisTools.GetDecNum(pResult.PolyphaseArea, decnum), AnalysisTools.GetDecNum(pResult.PolyphaseRate, decnum), AnalysisTools.GetDecNum(pResult.PolyphaseAllRate, decnum));
- }
- }
- }
- }
- private void btn_close_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void button4_Click(object sender, EventArgs e)
- {
- if (this.dataGridView_results.Rows.Count > 0)
- {
- SaveFileDialog exe = new SaveFileDialog();
- exe.Filter = "Execl files (*.xlsx)|*.xlsx";
- exe.FilterIndex = 0;
- exe.RestoreDirectory = true;
- exe.Title = "Export Excel File";
- exe.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
- exe.FileName = PdnResources.GetString("Menu.GeneralAnalysis.MultiphaseContent.Text")+ PdnResources.GetString("Menu.Analysisresult.text") + DateTime.Now.ToString("yyyyMMddhhmmss");
- DialogResult dr = exe.ShowDialog();
- if (dr == DialogResult.OK)
- {
- DataTable dtb = new DataTable();
- foreach (DataGridViewColumn c in this.dataGridView_results.Columns)
- {
- dtb.Columns.Add(c.HeaderText);
- }
- for (int r = 0; r < this.dataGridView_results.Rows.Count; r++)
- {
- DataRow dataRow = dtb.NewRow();
- for (int c = 0; c < this.dataGridView_results.Rows[r].Cells.Count; c++)
- {
- dataRow[this.dataGridView_results.Columns[c].HeaderText] = this.dataGridView_results.Rows[r].Cells[c].Value;
- }
- dtb.Rows.Add(dataRow);
- }
- List<DataTable> list = new List<DataTable>();
- list.Add(dtb);
- this.appWorkspace.ExportDataToExcelWithProgress(list, exe.FileName, true, false, true);
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Noanalysisresults.text")+"!");
- }
- }
- private void button5_Click(object sender, EventArgs e)
- {
- foreach (Control ctrl in this.groupBox2.Controls) //遍历窗体中的所有控件,Control是所有控件的基类
- {
- if (ctrl.GetType().Name == "CheckBox") //判断是否为CheckBox
- {
- if (ctrl.Name.Contains("cb"))
- {
- CheckBox cBox = (CheckBox)ctrl; //创建CheckBox对象
- cBox.Checked = true;
- }
- }
- }
- foreach (PhaseModel ph in this.documentWorkspace.phaseModels)
- {
- ph.choise = true;
- }
- this.documentWorkspace.phaseModels = phaseModels;
- this.documentWorkspace.Refresh();
- }
- private void button6_Click(object sender, EventArgs e)
- {
- foreach (Control ctrl in this.groupBox2.Controls) //遍历窗体中的所有控件,Control是所有控件的基类
- {
- if (ctrl.GetType().Name == "CheckBox") //判断是否为CheckBox
- {
- if (ctrl.Name.Contains("cb"))
- {
- CheckBox cBox = (CheckBox)ctrl; //创建CheckBox对象
- cBox.Checked = false;
- }
- }
- }
- foreach (PhaseModel ph in this.documentWorkspace.phaseModels)
- {
- ph.choise = false;
- }
- this.documentWorkspace.phaseModels = phaseModels;
- this.documentWorkspace.Refresh();
- }
- private void checkBox11_CheckedChanged(object sender, EventArgs e)
- {
- if (checkBox11.Checked)
- {
- //SXDelete();
- }else
- {
- numericUpDown_SXStart.Value = 0;
- numericUpDown_SXEnd.Value = 0;
- List<PhaseModel> phases = this.phaseModels.FindAll(a => a.choise == true);
- List<PhaseModel> phasesCopy = this.viewModels.FindAll(a => a.choise == true);
- for (int i = 0; i < phases.Count; i++)
- {
- PhaseModel model = new PhaseModel();
- model.choise = phases[i].choise;
- model.color = phases[i].color;
- model.name = phases[i].name;
- model.position = phases[i].position;
- model.mat = new OpenCvSharp.Mat();
- phases[i].mat.CopyTo(model.mat);
- phasesCopy[i].mat = model.mat;
- }
- this.documentWorkspace.phaseModels = this.viewModels;
- TrackBar_ValueChanged(null, null);
- this.documentWorkspace.Refresh();
- }
- }
- private void checkBox10_CheckedChanged(object sender, EventArgs e)
- {
- if (checkBox10.Checked)
- {
- KDDelete(Color.White);
- }
- else
- {
- numericUpDown_KDStart.Value = 0;
- numericUpDown_KDEnd.Value = 0;
- List<PhaseModel> phases = this.phaseModels.FindAll(a => a.choise == true);
- List<PhaseModel> phasesCopy = this.viewModels.FindAll(a => a.choise == true);
- for (int i = 0; i < phases.Count; i++)
- {
- PhaseModel model = new PhaseModel();
- model.choise = phases[i].choise;
- model.color = phases[i].color;
- model.name = phases[i].name;
- model.position = phases[i].position;
- model.mat = new OpenCvSharp.Mat();
- phases[i].mat.CopyTo(model.mat);
- phasesCopy[i].mat = model.mat;
- }
- this.documentWorkspace.phaseModels = this.viewModels;
- TrackBar_ValueChanged(null, null);
- this.documentWorkspace.Refresh();
- }
- }
- private void Draw(Graphics graphics)
- {
- if (this.documentWorkspace.phaseModels.Count > 0)
- {
- foreach (PhaseModel model in phaseModels)
- {
- if (model.choise && model.mat != null)
- {
- Bitmap map = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(model.mat);
- graphics.DrawImage(map, 0, 0, map.Width, map.Height);
- }
- }
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- AnalyzeSettingDialog recombinationRateSetDialog = new AnalyzeSettingDialog(this, "Template.Manager.item2.PolyphaseMutiAreaContent");
- if (recombinationRateSetDialog.hasModule)
- {
- recombinationRateSetDialog.StartPosition = FormStartPosition.CenterScreen;
- recombinationRateSetDialog.ShowDialog();
- }
- else
- {
- recombinationRateSetDialog = null;
- }
- }
- private void button3_Click(object sender, EventArgs e)
- {
- bitList.Clear();
- if (checkBox1.Checked)
- {
- AnalyzeSettingDialog recombinationRateSetDialog = new AnalyzeSettingDialog(this, "Template.Manager.item2.PolyphaseMutiAreaContent");
- if (recombinationRateSetDialog.hasModule)
- {
- recombinationRateSetDialog.StartPosition = FormStartPosition.CenterScreen;
- recombinationRateSetDialog.ShowDialog();
- }
- else
- {
- recombinationRateSetDialog = null;
- }
- }
- if (this.analyzeSettingModel != null && !string.IsNullOrEmpty(this.analyzeSettingModel.analyzeClassify))
- {
- //获取word书签与excel单元格的关系,以字典方式存储
- List<mic_module_infos> mic_module_infos = mic_module_infos_BLL.FindAll().FindAll(a => a.analyze_classify == this.analyzeSettingModel.analyzeClassify);
- Dictionary<string, string> tagInfos = new Dictionary<string, string>();
- if (mic_module_infos != null && mic_module_infos.Count > 0)
- {
- foreach (mic_module_infos info in mic_module_infos)
- {
- tagInfos.Add(info.tag_name, info.cell_position);
- }
- }
- List<List<string>> analysisContent = new List<List<string>>();
- List<string> nameList = new List<string>();
- for (int i = 0; i < this.dataGridView_results.Rows.Count; i++)
- {
- List<string> content1 = new List<string>();
- if (i == 0)
- {
- content1.Add(this.dataGridView_results.Columns[0].HeaderText);
- content1.Add(this.dataGridView_results.Columns[1].HeaderText);
- content1.Add(this.dataGridView_results.Columns[2].HeaderText);
- content1.Add(this.dataGridView_results.Columns[3].HeaderText);
- content1.Add(this.dataGridView_results.Columns[4].HeaderText);
- analysisContent.Add(content1);
- }
- content1 = new List<string>();
- content1.Add(this.dataGridView_results.Rows[i].Cells[0].Value.ToString());
- content1.Add(this.dataGridView_results.Rows[i].Cells[1].Value.ToString());
- content1.Add(this.dataGridView_results.Rows[i].Cells[2].Value.ToString());
- content1.Add(this.dataGridView_results.Rows[i].Cells[3].Value.ToString());
- content1.Add(this.dataGridView_results.Rows[i].Cells[4].Value.ToString());
- analysisContent.Add(content1);
- string tag = this.dataGridView_results.Rows[i].Cells[0].Value.ToString();
- if (nameList.IndexOf(tag) == -1)
- {
- nameList.Add(tag);
- }
- }
- foreach (var s in nameList)
- {
- if (bitDic.ContainsKey(s))
- {
- foreach (var m in bitDic[s])
- {
- bitList.Add(bitDic[s][bitDic[s].IndexOf(m)]);
- }
- }
- }
- this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, analysisContent, bitList, tagInfos);
- }
- else
- MessageBox.Show(PdnResources.GetString("Menu.Pleasesettheanalysisreportfirst.text")+"!");
- }
- private void numericUpDown_RangeStart_KeyUp(object sender, KeyEventArgs e)
- {
- numericUpDown_RangeStart.Value = numericUpDown_RangeStart.Value;
- }
- private void numericUpDown_RangeEnd_KeyUp(object sender, KeyEventArgs e)
- {
- numericUpDown_RangeEnd.Value = numericUpDown_RangeEnd.Value;
- }
- private void button9_Click(object sender, EventArgs e)
- {
- if (this.dataGridView_results.Rows.Count == 0)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Noresults.text"));
- return;
- }
- if (this.analyzeSettingModel == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleasesetiirst.Text"));
- return;
- }
- //获取项目工程内的文件夹路径
- ProjectEngineering.NodeItem item = this.appWorkspace.GetInsertProjectPath(2, "Menu.GeneralAnalysis.MultiphaseContent.Text", this.analyzeSettingModel.savePath);
- if (item != null)
- {
- //向文件夹内保存图片和报告
- if (!string.IsNullOrEmpty(this.analyzeSettingModel.analyzeClassify))
- {
- //获取word书签与excel单元格的关系,以字典方式存储
- List<mic_module_infos> mic_module_infos = mic_module_infos_BLL.FindAll().FindAll(a => a.analyze_classify == this.analyzeSettingModel.analyzeClassify);
- Dictionary<string, string> tagInfos = new Dictionary<string, string>();
- if (mic_module_infos != null && mic_module_infos.Count > 0)
- {
- foreach (mic_module_infos info in mic_module_infos)
- {
- tagInfos.Add(info.tag_name, info.cell_position);
- }
- }
- List<List<string>> analysisContent = new List<List<string>>();
- List<List<string>> inclusionList = new List<List<string>>();
- List<ExportProjectModel> exportModel = new List<ExportProjectModel>();
- List<Bitmap> bitImgList = new List<Bitmap>();
- List<string> titleContent = new List<string>();
- List<string> nameList = new List<string>();
- for (int i = 0; i < this.dataGridView_results.Rows.Count; i++)
- {
- List<string> content1 = new List<string>();
- if (i == 0)
- {
- content1.Add(this.dataGridView_results.Columns[0].HeaderText);
- content1.Add(this.dataGridView_results.Columns[1].HeaderText);
- content1.Add(this.dataGridView_results.Columns[2].HeaderText);
- content1.Add(this.dataGridView_results.Columns[3].HeaderText);
- analysisContent.Add(content1);
- titleContent.AddRange(content1);
- }
- content1 = new List<string>();
- content1.Add(this.dataGridView_results.Rows[i].Cells[0].Value.ToString());
- content1.Add(this.dataGridView_results.Rows[i].Cells[1].Value.ToString());
- content1.Add(this.dataGridView_results.Rows[i].Cells[2].Value.ToString());
- content1.Add(this.dataGridView_results.Rows[i].Cells[3].Value.ToString());
- analysisContent.Add(content1);
- string tag = this.dataGridView_results.Rows[i].Cells[0].Value.ToString();
- if (nameList.IndexOf(tag) == -1)
- {
- nameList.Add(tag);
- }
- var export = exportModel.Where(m => m.picName == tag).FirstOrDefault();
- if (export == null) {
- ExportProjectModel exportProjectModel = new ExportProjectModel();
- exportProjectModel.dataList = new List<List<string>>();
- exportProjectModel.dataList.Add(titleContent);
- exportProjectModel.dataList.Add(content1);
- exportProjectModel.picName = tag;
- exportProjectModel.tagName = PdnResources.GetString("Menu.GeneralAnalysis.MultiphaseContent.Text");
- exportModel.Add(exportProjectModel);
- }
- else {
- exportModel[exportModel.IndexOf(export)].dataList.Add(content1);
- }
- }
- foreach (var s in nameList) {
- if (bitDic.ContainsKey(s))
- {
- foreach (var m in bitDic[s])
- {
- bitImgList.Add(bitDic[s][bitDic[s].IndexOf(m)]);
- }
- }
- }
- try
- {
- this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, analysisContent, exportModel, bitImgList, tagInfos, item.path, item.code);
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleasesettheanalysisreportfirst.text")+"!");
- return;
- }
- //保存项目信息到数据库
- this.appWorkspace.InsertIntoDB(this.analyzeSettingModel, item);
- }
- }
- /// <summary>
- /// 应用全部
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button8_Click()
- {
- if (this.listView1.FocusedItem == null)
- {
- return;
- }
- #region [设置参数]
- PolyphaseMutiAreaContentModel model = new PolyphaseMutiAreaContentModel();
- model.hasUsed = true;
- model.parameter1 = xiang_num;
- model.parameter12 = checkBox1.Checked;
- model.parameter13 = commonControlButtons.trackBar.Value;
- model.parameter2 = cb_SelectPhase.SelectedItem == null ? "" : cb_SelectPhase.SelectedItem.ToString();
- if (model.parameter3 == null)
- {
- model.parameter3 = new List<PolyphaseData>();
- }
- var list = new List<PolyphaseData>();
- foreach (var s in mPhaseModels)
- {
- PolyphaseData data = new PolyphaseData();
- data.color = s.Model.color;
- data.downNum = s.ColorStart;
- data.upNum = s.ColorEnd;
- list.Add(data);
- }
- model.parameter3 = list;
- #region [保存物相选择]
- string all = String.Empty;
- if (cb1.Checked)
- {
- all += "1,";
- }
- if (cb2.Checked)
- {
- all += "2,";
- }
- if (cb3.Checked)
- {
- all += "3,";
- }
- if (cb4.Checked)
- {
- all += "4,";
- }
- if (cb5.Checked)
- {
- all += "5,";
- }
- if (cb6.Checked)
- {
- all += "6,";
- }
- if (cb7.Checked)
- {
- all += "7,";
- }
- if (cb8.Checked)
- {
- all += "8,";
- }
- model.parameter4 = all;
- #endregion
- model.parameter5 = checkBox10.Checked;
- model.parameter6 = checkBox11.Checked;
- model.parameter7 = (int)numericUpDown_KDStart.Value;
- model.parameter8 = (int)numericUpDown_KDEnd.Value;
- model.parameter9 = (int)numericUpDown_SXStart.Value;
- model.parameter10 = (int)numericUpDown_SXEnd.Value;
- model.parameter11 = (int)numericUpDown1.Value;
- for (int i = 0; i < listView1.Items.Count; i++)
- {
- if (everyImgData.ContainsKey(listView1.Items[i].Name))
- {
- everyImgData[listView1.Items[i].Name] = model;
- }
- else
- {
- everyImgData.Add(listView1.Items[i].Name, model);
- }
- }
- #endregion
- this.listView1.EnsureVisible(listView1.Items.Count - 1);
- this.listView1.Items[listView1.Items.Count - 1].Focused = true;
- this.listView1.Items[listView1.Items.Count - 1].Selected = true;
- this.userAll = true;
- }
- /// <summary>
- /// 保存到全部
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button7_Click()
- {
- if (!this.userAll) {
- MessageBox.Show("请先点击应用全部!");
- return;
- }
- for (int i = 0; i < listView1.Items.Count; i++)
- {
- this.listView1.EnsureVisible(i);
- this.listView1.Items[i].Focused = true;
- this.listView1.Items[i].Selected = true;
- this.But_DeleteKD.PerformClick();
- this.But_DeleteSX.PerformClick();
- button2_Click(null, null);
- }
- }
- private void getValue(string key, Object value)
- {
- switch (key)
- {
- case "parameter1":
- switch (Convert.ToInt32(value) + 1)
- {
- case 0:
- rb1.Checked = true;
- break;
- case 1:
- rb1.Checked = true;
- break;
- case 2:
- rb1.Checked = true;
- rb2.Checked = true;
- break;
- case 3:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- break;
- case 4:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- break;
- case 5:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- rb5.Checked = true;
- break;
- case 6:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- rb5.Checked = true;
- rb6.Checked = true;
- break;
- case 7:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- rb5.Checked = true;
- rb6.Checked = true;
- rb7.Checked = true;
- break;
- case 8:
- rb1.Checked = true;
- rb2.Checked = true;
- rb3.Checked = true;
- rb4.Checked = true;
- rb5.Checked = true;
- rb6.Checked = true;
- rb7.Checked = true;
- rb8.Checked = true;
- break;
- }
- break;
- case "parameter2":
- checkBox10.Checked = Convert.ToBoolean(value);
- break;
- case "parameter3":
- numericUpDown_KDStart.Value = Convert.ToDecimal(value);
- break;
- case "parameter4":
- numericUpDown_KDEnd.Value = Convert.ToDecimal(value);
- break;
- case "parameter5":
- checkBox11.Checked = Convert.ToBoolean(value);
- break;
- case "parameter6":
- numericUpDown_SXStart.Value = Convert.ToDecimal(value);
- break;
- case "parameter7":
- numericUpDown_SXEnd.Value = Convert.ToDecimal(value);
- break;
- case "OpenWhileExportReport":
- checkBox1.Checked = Convert.ToBoolean(value);
- break;
- case "CalculatorDecimalDigits":
- numericUpDown1.Value = Convert.ToDecimal(value);
- break;
- case "ExportResults":
- isExportResults = Convert.ToBoolean(value);
- break;
- case "ExportReports":
- isExportReports = Convert.ToBoolean(value);
- break;
- case "ExportProjects":
- isExportProjects = Convert.ToBoolean(value);
- break;
- }
- }
- #region [脚本录制]
- private void getScriptRecording()
- {
- string className = InvariantData.path_Action + ".Action" + menuId;
- ParamObject param = (ParamObject)System.Reflection.Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
- List<Args> args = param.Lists;
- foreach (var item in args)
- {
- item.value = setScriptRecording(item.key);
- }
- appWorkspace.SetScriptStartRecording(this.menuId, menuName, args);
- }
- private object setScriptRecording(string key)
- {
- object value = null;
- switch (key)
- {
- case "parameter1":
- if (rb1.Checked) {
- value = 0;
- }
- if (rb2.Checked)
- {
- value = 1;
- }
- if (rb3.Checked)
- {
- value = 2;
- }
- if (rb4.Checked)
- {
- value = 3;
- }
- if (rb5.Checked)
- {
- value = 4;
- }
- if (rb6.Checked)
- {
- value = 5;
- }
- if (rb7.Checked)
- {
- value = 6;
- }
- if (rb8.Checked)
- {
- value = 7;
- }
- break;
- case "parameter2":
- value = checkBox10.Checked;
- break;
- case "parameter3":
- value = numericUpDown_KDStart.Value;
- break;
- case "parameter4":
- value = numericUpDown_KDEnd.Value;
- break;
- case "parameter5":
- value = checkBox11.Checked;
- break;
- case "parameter6":
- value = numericUpDown_SXStart.Value;
- break;
- case "parameter7":
- value = numericUpDown_SXEnd.Value;
- break;
- case "OpenWhileExportReport":
- value = checkBox1.Checked;
- break;
- case "CalculatorDecimalDigits":
- value = numericUpDown1.Value;
- break;
- case "ExportResults":
- value = isExportResults;
- break;
- case "ExportReports":
- value = isExportReports;
- break;
- case "ExportProjects":
- value = isExportProjects;
- break;
- }
- return value;
- }
- #endregion
- }
- }
|