123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242 |
- using Metis.DedicatedAnalysis.Inclusions;
- using Metis.ParameterSet;
- using OpenCvSharp;
- using OpenCvSharp.Extensions;
- using PaintDotNet.Adjust.BaseImage;
- using PaintDotNet.Annotation;
- using PaintDotNet.Annotation.DedicatedAnalysis;
- using PaintDotNet.Annotation.Enum;
- using PaintDotNet.Annotation.FieldView;
- using PaintDotNet.Base;
- using PaintDotNet.Base.CommTool;
- using PaintDotNet.Base.DedicatedAnalysis.Inclusions;
- using PaintDotNet.Base.DedicatedAnalysis.Inclusions.Model;
- using PaintDotNet.Base.Functionodel;
- using PaintDotNet.Base.SettingModel;
- using PaintDotNet.CustomControl;
- using PaintDotNet.Data.Param;
- using PaintDotNet.DbOpreate.DbBll;
- using PaintDotNet.DbOpreate.DbModel;
- using PaintDotNet.Instrument;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.IO;
- using System.Linq;
- using System.Windows.Forms;
- using static PaintDotNet.Base.DedicatedAnalysis.Inclusions.InclusionsGlobalSettings;
- using static PaintDotNet.Base.DedicatedAnalysis.Inclusions.MethodOfAssessment;
- namespace PaintDotNet.DedicatedAnalysis.Inclusions
- {
- internal class InclusionsStandardDialog : PdnBaseForm
- {
- #region 属性
- #region 属性
- /// <summary>
- /// 主控件
- /// </summary>
- private AppWorkspace appWorkspace;
- /// <summary>
- /// 公共按钮
- /// </summary>
- private CommonControlButtons commonControlButtons;
- /// <summary>
- /// 图像面板
- /// </summary>
- private DocumentWorkspaceWindow documentWorkspace;
- private Dictionary<int, DocumentItem> documentItems;
- /// <summary>
- /// 当前选择的图片
- /// </summary>
- private Mat imageMat;
- /// <summary>
- /// 初始系统参数配置值
- /// </summary>
- private BinaryExtractionModel binaryExtractionModel = new BinaryExtractionModel();
- /// <summary>
- /// 选择的评定方法
- /// </summary>
- private MethodOfAssessment methodOfAssessment;
- private AnalysisResult tempAnalysisResult;
- private Dictionary<DocumentWorkspace, AnalysisResult> analysisResults = new Dictionary<DocumentWorkspace, AnalysisResult>();
- protected ColorOfInclusions selectedColorOfInclusions;
- protected ColorOfInclusions oldSelectedColorOfInclusions;
- private int chooseK = 3;
- /// <summary>
- /// RGB/HLS 选中那个按钮,默认1=R/H 2=G/L 2=B/S
- /// </summary>
- private int HistogramRGBSelect = 1;
- private bool pickColorChecked;
- //二值化集成1
- private BinaryClass binaryClass;
- protected int menuId;
- protected string menuName;
- // 选定夹杂物类型
- private bool clearSelect = false;
- private TypesOfInclusions selectedTypesOfInclusions;
- // 选定夹杂物类型 操作 记录点
- private System.Drawing.Point? selectedTypesOfInclusionsPoint = null;
- private System.Drawing.RectangleF? selectedTypesOfInclusionsRectangle = null;
- // 视场边长
- private int viewNum = 710;
- private bool is_showRectangle = false;
- private bool is_showOval = false;
- private int is_full = 1;
- //局部变量
- private bool rbcheck = true;
- protected InclusionsModel inclusionsModel = new InclusionsModel();
- protected InclusionsModel.InclusionParameter thisParameters;
- protected int thisParametersIndex = -1;
- private bool userAll = false;
- private bool firstShow = true;
- protected int whichChecked = 0;
- private int autoJiaoBen = -1;
- #endregion
- #region 组件
- private GroupBox groupBox_operating;
- private Button btn_editInclusions;
- private Button btn_statistics;
- private GroupBox groupBox_img;
- private ListView lstView_img;
- private ImageList imageList_img;
- private IContainer components;
- private GroupBox groupBox_baseSetting;
- private ComboBox comboBox_rollingDirection;
- private Label label_lwRatioLimit;
- private Label label_rollingDirection;
- protected NumericUpDown numericUpDown_lwRatioLimit;
- protected GroupBox groupBox_colorSetting;
- private Panel panel_colorGamut;
- protected GroupBox groupBox_displaySetting;
- private GroupBox groupBox_histogram;
- private CustomControl.HistogramControl histogramControl_colorSetting;
- private GroupBox groupBox_colorAdjustment;
- private Button button_colorAdjustmentBS;
- private Button button_colorAdjustmentGL;
- private Button button_colorAdjustmentRH;
- private NumericUpDown numericUpDown_colorAdjustmentBSD;
- private NumericUpDown numericUpDown_colorAdjustmentBSU;
- private Label label_colorAdjustmentBS;
- private NumericUpDown numericUpDown_colorAdjustmentGLD;
- private NumericUpDown numericUpDown_colorAdjustmentGLU;
- private Label label_colorAdjustmentGL;
- private NumericUpDown numericUpDown_colorAdjustmentRHD;
- private NumericUpDown numericUpDown_colorAdjustmentRHU;
- private Label label_colorAdjustmentRH;
- private RadioButton radioButton_checkedHLS;
- private RadioButton radioButton_checkedRGB;
- private GroupBox groupBox_review;
- private GroupBox groupBox_report;
- private Label label_resultPrecision;
- private DomainUpDown domainUpDown_resultPrecision;
- private Button button_exportResults;
- private Button button_generateReport;
- private GroupBox groupBox6groupBox_analysisResult2;
- private ListView listView_analysisResult;
- private GroupBox groupBox_analysisResult1;
- private Button button_remove;
- private Button button_all;
- private Label label_colorGamut;
- private Button button_pickColor;
- private Panel panel_colorGamutPhase;
- private CheckBox checkBox_showColorGamutPhase;
- private ToolTip toolTip_InclusionsDetails;
- private ListView listView_analysisResult2;
- private Button button_setting;
- private CheckedListBox listBox_analysisResult;
- private Button btn_clean_result;
- private CheckBox checkBox_generateReport_opensetting;
- private Button button1;
- private ComboBox comboBox1;
- private Label label1;
- private BinaryControl bc;
- private Button btn_drawRecognitionArea;
- private Button btn_selectClear;
- private Button btn_saveresult;
- private Button button2;
- private CheckBox checkBox2;
- private CheckBox checkBox1;
- private RadioButton radioButton2;
- private RadioButton radioButton1;
- private int isK = 2;
- private int imgIndex = -1;
- private RectangleF paintRectangle;
- private Dictionary<string, List<PhaseModel>> dict = new Dictionary<string, List<PhaseModel>>();
- protected double imgPxPerUnit;
- protected GroupBox groupBox1;
- private Button button4;
- private Button button3;
- private string dialogText;
- private List<AnalysisResult> resultList = new List<AnalysisResult>();
- private List<int> hasResultIndexList = new List<int>();
- private Dictionary<int, CurrentPageData> everyImgData = new Dictionary<int, CurrentPageData>();
- protected string colorName;
- private Dictionary<string, List<double>> rgbDict = new Dictionary<string, List<double>>();
- private bool isExportResults = false;
- private bool isExportReports = false;
- private bool isExportProjects = false;
- private RadioButton radioButton3;
- private RadioButton radioButton4;
- private RadioButton radioButton5;
- /// <summary>
- /// 是否脚本运行
- /// </summary>
- private Boolean initScriptValues = false;
- #endregion
- #endregion
- #region 构造函数
- public InclusionsStandardDialog(AppWorkspace appWorkspace, string dialogText, PdnMenuItem menuitem)
- {
- this.appWorkspace = appWorkspace;
- this.Shown += showImg;
- this.Text = dialogText;
- this.dialogText = dialogText;
- this.Icon = PdnInfo.AppIcon;
- InitializeComponent();
- this.menuId = menuitem.MenuId;
- this.menuName = menuitem.Text;
- this.binaryClass = new BinaryClass(menuId);
- InitializeComponent2();
- Initialize();
- //二值化集成2
- bc.OriginCheckedChangedAction += new EventHandler(this.bcOriginCheckedChanged);//初始化原图勾选改变事件
- binaryClass.createDocumentItems(new string[] { PdnResources.GetString("Menu.binary.Text"), PdnResources.GetString("Menu.Theinclusioncolomatches.Text") }
- , this.bc, this.appWorkspace, this.documentWorkspace, this.lstView_img);//初始化相的工作结构
- binaryClass.BinaryImplFinishAction += new EventHandler(this.bClassBinaryImplFinishAction);//二值化后续处理事件
- this.documentWorkspace.panel.Paint += Panel_Paint;
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.saveLastData);
- }
- private void showImg(object sender, EventArgs e)
- {
- lstView_img.Focus();
- if (this.imgIndex != -1)
- {
- //滚动到指定的行位置
- this.lstView_img.EnsureVisible(this.imgIndex);
- this.lstView_img.Items[imgIndex].Focused = true;
- this.lstView_img.Items[imgIndex].Selected = true;
- }
- this.methodOfAssessment = getMethodOfAssessment();
- MethodOfAssessment.activeMethod = this.methodOfAssessment;
- SetAnalyzeModelFromXml(this.methodOfAssessment.resourcesName);
- SubclassInitialize();
- initColorSetting();
- initDisplaySetting();
- //如果是脚本执行,将参数带入
- 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();
- }
- this.firstShow = false;
- binaryClass.RefreshHistogramControl1Values();
- // 初始化显示设置区域
- foreach (var item in this.groupBox_displaySetting.Controls)
- {
- if (item is Button)
- {
- ((Button)item).Click += this.label_displaySetting;
- }
- }
- if (this.initScriptValues && this.appWorkspace.ScriptAutomatic)
- this.startScriptAutomaticAction();
- }
- /// <summary>
- /// 执行脚本自动化的步骤
- /// </summary>
- private void startScriptAutomaticAction()
- {
- this.button4.PerformClick();
- this.button3.PerformClick();
- this.allCheck();
- if (isExportResults)//导出结果
- this.button_exportResults.PerformClick();
- if (isExportReports)//生成报告
- this.button_generateReport.PerformClick();
- if (isExportProjects)//导出项目
- this.button1.PerformClick();
- this.appWorkspace.ScriptAutomatic = false;
- this.Close();
- }
- public InclusionsStandardDialog()
- {
- InitializeComponent();
- }
- #endregion
- #region 初始化组件
- private void InitializeComponent2()
- {
- this.bc = new PaintDotNet.CustomControl.BinaryControl();
- //
- // bc
- //
- this.bc.BinaryBackColor = System.Drawing.Color.Red;
- this.bc.BinaryChecked = false;
- this.bc.BinaryStyle = 1;
- this.bc.Location = new System.Drawing.Point(178, 72);
- this.bc.Name = "bc";
- this.bc.OriginChecked = false;
- this.bc.scope1End = 0D;
- this.bc.scope1Start = 0D;
- this.bc.scope2End = 0D;
- this.bc.scope2Start = 0D;
- this.bc.scope3End = 0D;
- this.bc.scope3Start = 0D;
- this.bc.Size = new System.Drawing.Size(360, 292);
- this.bc.TabIndex = 35;
- this.Controls.Add(this.bc);
- this.Controls.SetChildIndex(this.bc, 0);
- //
- // histogramControl_colorSetting
- //
- this.histogramControl_colorSetting = new PaintDotNet.CustomControl.HistogramControl();
- this.histogramControl_colorSetting.Flag = 1;
- this.histogramControl_colorSetting.Location = new System.Drawing.Point(7, 15);
- this.histogramControl_colorSetting.Name = "histogramControl_colorSetting";
- this.histogramControl_colorSetting.Size = new System.Drawing.Size(167, 114);
- this.histogramControl_colorSetting.TabIndex = 0;
- this.groupBox_histogram.Controls.Add(this.histogramControl_colorSetting);
- this.comboBox_rollingDirection.Items.AddRange(new object[] {
- PdnResources.GetString("Menu.vertical.text"),
- PdnResources.GetString("Menu.Level.text")});
- this.groupBox_operating.Text = PdnResources.GetString("Menu.operation.text");
- this.btn_drawRecognitionArea.Text = PdnResources.GetString("Menu.dentificationarea.Text");
- this.checkBox_generateReport_opensetting.Text = PdnResources.GetString("Menu.Opensettingsatingreport.text");
- this.btn_clean_result.Text = PdnResources.GetString("Menu.Clearstatistics.text");
- this.button_setting.Text = PdnResources.GetString("Menu.Setting.Text");
- this.btn_editInclusions.Text = PdnResources.GetString("Menu.Editinclusions.text");
- this.btn_statistics.Text = PdnResources.GetString("Menu.Startstatistics.text");
- this.btn_saveresult.Text = PdnResources.GetString("Menu.Saveresult.text");
- this.groupBox_img.Text = PdnResources.GetString("Menu.Tools.ImageIndex.Text");
- this.groupBox_baseSetting.Text = PdnResources.GetString("Menu.BasicSettings.text");
- this.label1.Text = "K" + PdnResources.GetString("Menu.Imagement.Measurementlist.value.text");
- this.label_lwRatioLimit.Text = PdnResources.GetString("Menu.lengthwidthratio.Text");
- this.label_rollingDirection.Text = PdnResources.GetString("Menu.Rollingdirection.text");
- this.groupBox_colorSetting.Text = PdnResources.GetString("Menu.Inclusioncolorsetting.text");
- this.checkBox_showColorGamutPhase.Text = PdnResources.GetString("Menu.Matchthecoloreffect.text");
- this.button_pickColor.Text = PdnResources.GetString("Menu.Pickcolor.text");
- this.label_colorGamut.Text = PdnResources.GetString("Menu.Colorinterval.text");
- this.groupBox_displaySetting.Text = PdnResources.GetString("Menu.displaysetting.text");
- this.btn_selectClear.Text = PdnResources.GetString("Menu.Removalofinclusion.Text");
- this.groupBox_histogram.Text = PdnResources.GetString("Menu.Tools.Histogram.Text");
- this.groupBox_colorAdjustment.Text = PdnResources.GetString("Menu.Coloradjustment.text");
- this.groupBox_review.Text = PdnResources.GetString("Menu.Preview.text");
- this.button1.Text = PdnResources.GetString("Menu.Tools.OpenProject.Text");
- this.label_resultPrecision.Text = PdnResources.GetString("Menu.Decimal.text") + ":";
- this.button_exportResults.Text = PdnResources.GetString("Menu.Exportresults.text");
- this.button_generateReport.Text = PdnResources.GetString("Menu.Tools.CreateReport.Text");
- this.groupBox_analysisResult1.Text = PdnResources.GetString("Menu.Analysisresult.text");
- this.button_remove.Text = PdnResources.GetString("Menu.Edit.Delete.Text");
- this.button2.Text = PdnResources.GetString("Menu.ViewSetting.Text");
- this.button_all.Text = PdnResources.GetString("Menu.Showall.text");
- this.checkBox1.Text = PdnResources.GetString("Menu.Ellipsebox.text");
- this.checkBox2.Text = PdnResources.GetString("Menu.Rectangularbox.text");
- this.radioButton1.Text = PdnResources.GetString("Menu.ImageCollection.CameraFrame.Text");
- this.radioButton2.Text = PdnResources.GetString("Menu.solid.text");
- this.button4.Text = PdnResources.GetString("Menu.Applyall.text");
- this.button3.Text = PdnResources.GetString("Menu.File.SaveAll.Text");
- }
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.groupBox_operating = new System.Windows.Forms.GroupBox();
- this.radioButton2 = new System.Windows.Forms.RadioButton();
- this.radioButton1 = new System.Windows.Forms.RadioButton();
- this.checkBox2 = new System.Windows.Forms.CheckBox();
- this.checkBox1 = new System.Windows.Forms.CheckBox();
- this.btn_selectClear = new System.Windows.Forms.Button();
- this.btn_drawRecognitionArea = new System.Windows.Forms.Button();
- this.checkBox_generateReport_opensetting = new System.Windows.Forms.CheckBox();
- this.btn_clean_result = new System.Windows.Forms.Button();
- this.button_setting = new System.Windows.Forms.Button();
- this.btn_editInclusions = new System.Windows.Forms.Button();
- this.btn_statistics = new System.Windows.Forms.Button();
- this.btn_saveresult = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.groupBox_img = new System.Windows.Forms.GroupBox();
- this.lstView_img = new System.Windows.Forms.ListView();
- this.imageList_img = new System.Windows.Forms.ImageList(this.components);
- this.groupBox_baseSetting = new System.Windows.Forms.GroupBox();
- this.comboBox1 = new System.Windows.Forms.ComboBox();
- this.label1 = new System.Windows.Forms.Label();
- this.comboBox_rollingDirection = new System.Windows.Forms.ComboBox();
- this.label_lwRatioLimit = new System.Windows.Forms.Label();
- this.label_rollingDirection = new System.Windows.Forms.Label();
- this.numericUpDown_lwRatioLimit = new System.Windows.Forms.NumericUpDown();
- this.groupBox_colorSetting = new System.Windows.Forms.GroupBox();
- this.checkBox_showColorGamutPhase = new System.Windows.Forms.CheckBox();
- this.panel_colorGamutPhase = new System.Windows.Forms.Panel();
- this.button_pickColor = new System.Windows.Forms.Button();
- this.label_colorGamut = new System.Windows.Forms.Label();
- this.panel_colorGamut = new System.Windows.Forms.Panel();
- this.groupBox_displaySetting = new System.Windows.Forms.GroupBox();
- this.groupBox_histogram = new System.Windows.Forms.GroupBox();
- this.groupBox_colorAdjustment = new System.Windows.Forms.GroupBox();
- this.button_colorAdjustmentBS = new System.Windows.Forms.Button();
- this.button_colorAdjustmentGL = new System.Windows.Forms.Button();
- this.button_colorAdjustmentRH = new System.Windows.Forms.Button();
- this.numericUpDown_colorAdjustmentBSD = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown_colorAdjustmentBSU = new System.Windows.Forms.NumericUpDown();
- this.label_colorAdjustmentBS = new System.Windows.Forms.Label();
- this.numericUpDown_colorAdjustmentGLD = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown_colorAdjustmentGLU = new System.Windows.Forms.NumericUpDown();
- this.label_colorAdjustmentGL = new System.Windows.Forms.Label();
- this.numericUpDown_colorAdjustmentRHD = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown_colorAdjustmentRHU = new System.Windows.Forms.NumericUpDown();
- this.label_colorAdjustmentRH = new System.Windows.Forms.Label();
- this.radioButton_checkedHLS = new System.Windows.Forms.RadioButton();
- this.radioButton_checkedRGB = new System.Windows.Forms.RadioButton();
- this.groupBox_review = new System.Windows.Forms.GroupBox();
- this.groupBox_report = new System.Windows.Forms.GroupBox();
- this.button1 = new System.Windows.Forms.Button();
- this.label_resultPrecision = new System.Windows.Forms.Label();
- this.domainUpDown_resultPrecision = new System.Windows.Forms.DomainUpDown();
- this.button_exportResults = new System.Windows.Forms.Button();
- this.button_generateReport = new System.Windows.Forms.Button();
- this.groupBox6groupBox_analysisResult2 = new System.Windows.Forms.GroupBox();
- this.listView_analysisResult2 = new System.Windows.Forms.ListView();
- this.listView_analysisResult = new System.Windows.Forms.ListView();
- this.groupBox_analysisResult1 = 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.toolTip_InclusionsDetails = new System.Windows.Forms.ToolTip(this.components);
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.radioButton3 = new System.Windows.Forms.RadioButton();
- this.radioButton4 = new System.Windows.Forms.RadioButton();
- this.button4 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.radioButton5 = new System.Windows.Forms.RadioButton();
- this.groupBox_operating.SuspendLayout();
- this.groupBox_img.SuspendLayout();
- this.groupBox_baseSetting.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).BeginInit();
- this.groupBox_colorSetting.SuspendLayout();
- this.groupBox_colorAdjustment.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentBSD)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentBSU)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentGLD)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentGLU)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentRHD)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentRHU)).BeginInit();
- this.groupBox_report.SuspendLayout();
- this.groupBox6groupBox_analysisResult2.SuspendLayout();
- this.groupBox_analysisResult1.SuspendLayout();
- this.groupBox1.SuspendLayout();
- this.SuspendLayout();
- //
- // groupBox_operating
- //
- this.groupBox_operating.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox_operating.Controls.Add(this.radioButton2);
- this.groupBox_operating.Controls.Add(this.radioButton1);
- this.groupBox_operating.Controls.Add(this.checkBox2);
- this.groupBox_operating.Controls.Add(this.checkBox1);
- this.groupBox_operating.Controls.Add(this.btn_selectClear);
- this.groupBox_operating.Controls.Add(this.btn_drawRecognitionArea);
- this.groupBox_operating.Controls.Add(this.checkBox_generateReport_opensetting);
- this.groupBox_operating.Controls.Add(this.btn_clean_result);
- this.groupBox_operating.Controls.Add(this.button_setting);
- this.groupBox_operating.Controls.Add(this.btn_editInclusions);
- this.groupBox_operating.Controls.Add(this.btn_statistics);
- this.groupBox_operating.Controls.Add(this.btn_saveresult);
- this.groupBox_operating.Controls.Add(this.button2);
- this.groupBox_operating.Location = new System.Drawing.Point(13, 12);
- this.groupBox_operating.Name = "groupBox_operating";
- this.groupBox_operating.Size = new System.Drawing.Size(1152, 53);
- this.groupBox_operating.TabIndex = 12;
- this.groupBox_operating.TabStop = false;
- //
- // radioButton2
- //
- this.radioButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.radioButton2.AutoSize = true;
- this.radioButton2.Checked = true;
- this.radioButton2.Location = new System.Drawing.Point(405, 23);
- this.radioButton2.Name = "radioButton2";
- this.radioButton2.Size = new System.Drawing.Size(14, 13);
- this.radioButton2.TabIndex = 12;
- this.radioButton2.TabStop = true;
- this.radioButton2.UseVisualStyleBackColor = true;
- this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
- //
- // radioButton1
- //
- this.radioButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.radioButton1.AutoSize = true;
- this.radioButton1.Location = new System.Drawing.Point(348, 22);
- this.radioButton1.Name = "radioButton1";
- this.radioButton1.Size = new System.Drawing.Size(14, 13);
- this.radioButton1.TabIndex = 11;
- this.radioButton1.UseVisualStyleBackColor = true;
- this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
- //
- // checkBox2
- //
- this.checkBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.checkBox2.AutoSize = true;
- this.checkBox2.Location = new System.Drawing.Point(504, 24);
- this.checkBox2.Name = "checkBox2";
- this.checkBox2.Size = new System.Drawing.Size(15, 14);
- this.checkBox2.TabIndex = 10;
- this.checkBox2.UseVisualStyleBackColor = true;
- this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
- //
- // checkBox1
- //
- this.checkBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.checkBox1.AutoSize = true;
- this.checkBox1.Location = new System.Drawing.Point(591, 23);
- this.checkBox1.Name = "checkBox1";
- this.checkBox1.Size = new System.Drawing.Size(15, 14);
- this.checkBox1.TabIndex = 9;
- this.checkBox1.UseVisualStyleBackColor = true;
- this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
- //
- // btn_selectClear
- //
- this.btn_selectClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btn_selectClear.Location = new System.Drawing.Point(829, 20);
- this.btn_selectClear.Name = "btn_selectClear";
- this.btn_selectClear.Size = new System.Drawing.Size(75, 23);
- this.btn_selectClear.TabIndex = 0;
- this.btn_selectClear.UseVisualStyleBackColor = true;
- this.btn_selectClear.Click += new System.EventHandler(this.btn_selectClear_Click);
- //
- // btn_drawRecognitionArea
- //
- this.btn_drawRecognitionArea.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btn_drawRecognitionArea.Location = new System.Drawing.Point(667, 20);
- this.btn_drawRecognitionArea.Name = "btn_drawRecognitionArea";
- this.btn_drawRecognitionArea.Size = new System.Drawing.Size(75, 23);
- this.btn_drawRecognitionArea.TabIndex = 7;
- this.btn_drawRecognitionArea.UseVisualStyleBackColor = true;
- this.btn_drawRecognitionArea.Click += new System.EventHandler(this.btn_drawRecognitionArea_Click);
- //
- // checkBox_generateReport_opensetting
- //
- this.checkBox_generateReport_opensetting.AutoSize = true;
- this.checkBox_generateReport_opensetting.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
- this.checkBox_generateReport_opensetting.Location = new System.Drawing.Point(91, 24);
- this.checkBox_generateReport_opensetting.Name = "checkBox_generateReport_opensetting";
- this.checkBox_generateReport_opensetting.Size = new System.Drawing.Size(15, 14);
- this.checkBox_generateReport_opensetting.TabIndex = 6;
- this.checkBox_generateReport_opensetting.UseVisualStyleBackColor = true;
- //
- // btn_clean_result
- //
- this.btn_clean_result.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btn_clean_result.Location = new System.Drawing.Point(991, 20);
- this.btn_clean_result.Name = "btn_clean_result";
- this.btn_clean_result.Size = new System.Drawing.Size(75, 23);
- this.btn_clean_result.TabIndex = 5;
- this.btn_clean_result.UseVisualStyleBackColor = true;
- this.btn_clean_result.Click += new System.EventHandler(this.btn_clean_result_Click);
- //
- // button_setting
- //
- this.button_setting.Location = new System.Drawing.Point(6, 20);
- this.button_setting.Name = "button_setting";
- this.button_setting.Size = new System.Drawing.Size(75, 23);
- this.button_setting.TabIndex = 4;
- this.button_setting.UseVisualStyleBackColor = true;
- this.button_setting.Click += new System.EventHandler(this.button_setting_Click);
- //
- // btn_editInclusions
- //
- this.btn_editInclusions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btn_editInclusions.Location = new System.Drawing.Point(748, 20);
- this.btn_editInclusions.Name = "btn_editInclusions";
- this.btn_editInclusions.Size = new System.Drawing.Size(75, 23);
- this.btn_editInclusions.TabIndex = 3;
- this.btn_editInclusions.UseVisualStyleBackColor = true;
- this.btn_editInclusions.Click += new System.EventHandler(this.btn_editInclusions_Click);
- //
- // btn_statistics
- //
- this.btn_statistics.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btn_statistics.Location = new System.Drawing.Point(910, 20);
- this.btn_statistics.Name = "btn_statistics";
- this.btn_statistics.Size = new System.Drawing.Size(75, 23);
- this.btn_statistics.TabIndex = 3;
- this.btn_statistics.UseVisualStyleBackColor = true;
- this.btn_statistics.Click += new System.EventHandler(this.btn_statistics_Click);
- //
- // btn_saveresult
- //
- this.btn_saveresult.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btn_saveresult.Location = new System.Drawing.Point(1072, 20);
- this.btn_saveresult.Name = "btn_saveresult";
- this.btn_saveresult.Size = new System.Drawing.Size(75, 23);
- this.btn_saveresult.TabIndex = 2;
- this.btn_saveresult.UseVisualStyleBackColor = true;
- this.btn_saveresult.Click += new System.EventHandler(this.btn_saveresult_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(667, 20);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(75, 23);
- this.button2.TabIndex = 8;
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // groupBox_img
- //
- this.groupBox_img.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox_img.Controls.Add(this.lstView_img);
- this.groupBox_img.Location = new System.Drawing.Point(13, 72);
- this.groupBox_img.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.groupBox_img.Name = "groupBox_img";
- this.groupBox_img.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.groupBox_img.Size = new System.Drawing.Size(158, 630);
- this.groupBox_img.TabIndex = 13;
- this.groupBox_img.TabStop = false;
- //
- // lstView_img
- //
- this.lstView_img.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.lstView_img.HideSelection = false;
- this.lstView_img.LargeImageList = this.imageList_img;
- this.lstView_img.Location = new System.Drawing.Point(8, 26);
- this.lstView_img.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.lstView_img.MultiSelect = false;
- this.lstView_img.Name = "lstView_img";
- this.lstView_img.Size = new System.Drawing.Size(140, 596);
- this.lstView_img.TabIndex = 0;
- this.lstView_img.UseCompatibleStateImageBehavior = false;
- this.lstView_img.SelectedIndexChanged += new System.EventHandler(this.lstView_img_SelectedIndexChanged);
- this.lstView_img.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseUp);
- //
- // imageList_img
- //
- this.imageList_img.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
- this.imageList_img.ImageSize = new System.Drawing.Size(64, 64);
- this.imageList_img.TransparentColor = System.Drawing.Color.Transparent;
- //
- // groupBox_baseSetting
- //
- this.groupBox_baseSetting.Controls.Add(this.comboBox1);
- this.groupBox_baseSetting.Controls.Add(this.label1);
- this.groupBox_baseSetting.Controls.Add(this.comboBox_rollingDirection);
- this.groupBox_baseSetting.Controls.Add(this.label_lwRatioLimit);
- this.groupBox_baseSetting.Controls.Add(this.label_rollingDirection);
- this.groupBox_baseSetting.Controls.Add(this.numericUpDown_lwRatioLimit);
- this.groupBox_baseSetting.Location = new System.Drawing.Point(178, 370);
- this.groupBox_baseSetting.Name = "groupBox_baseSetting";
- this.groupBox_baseSetting.Size = new System.Drawing.Size(360, 51);
- this.groupBox_baseSetting.TabIndex = 18;
- this.groupBox_baseSetting.TabStop = false;
- //
- // comboBox1
- //
- this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox1.FormattingEnabled = true;
- this.comboBox1.Items.AddRange(new object[] {
- "0",
- "1",
- "2",
- "3",
- "4",
- "5",
- "6",
- "7",
- "8"});
- this.comboBox1.Location = new System.Drawing.Point(296, 21);
- this.comboBox1.Name = "comboBox1";
- this.comboBox1.Size = new System.Drawing.Size(56, 20);
- this.comboBox1.TabIndex = 9;
- this.comboBox1.SelectionChangeCommitted += new System.EventHandler(this.abc);
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(268, 25);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(0, 12);
- this.label1.TabIndex = 10;
- //
- // comboBox_rollingDirection
- //
- this.comboBox_rollingDirection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox_rollingDirection.FormattingEnabled = true;
- this.comboBox_rollingDirection.Location = new System.Drawing.Point(68, 23);
- this.comboBox_rollingDirection.Name = "comboBox_rollingDirection";
- this.comboBox_rollingDirection.Size = new System.Drawing.Size(56, 20);
- this.comboBox_rollingDirection.TabIndex = 3;
- //
- // label_lwRatioLimit
- //
- this.label_lwRatioLimit.AutoSize = true;
- this.label_lwRatioLimit.Location = new System.Drawing.Point(130, 26);
- this.label_lwRatioLimit.Name = "label_lwRatioLimit";
- this.label_lwRatioLimit.Size = new System.Drawing.Size(0, 12);
- this.label_lwRatioLimit.TabIndex = 7;
- //
- // label_rollingDirection
- //
- this.label_rollingDirection.AutoSize = true;
- this.label_rollingDirection.Location = new System.Drawing.Point(8, 26);
- this.label_rollingDirection.Name = "label_rollingDirection";
- this.label_rollingDirection.Size = new System.Drawing.Size(0, 12);
- this.label_rollingDirection.TabIndex = 8;
- //
- // numericUpDown_lwRatioLimit
- //
- this.numericUpDown_lwRatioLimit.DecimalPlaces = 2;
- this.numericUpDown_lwRatioLimit.Location = new System.Drawing.Point(201, 20);
- this.numericUpDown_lwRatioLimit.Maximum = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.numericUpDown_lwRatioLimit.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown_lwRatioLimit.Name = "numericUpDown_lwRatioLimit";
- this.numericUpDown_lwRatioLimit.Size = new System.Drawing.Size(56, 21);
- this.numericUpDown_lwRatioLimit.TabIndex = 5;
- this.numericUpDown_lwRatioLimit.Value = new decimal(new int[] {
- 3,
- 0,
- 0,
- 0});
- this.numericUpDown_lwRatioLimit.ValueChanged += new System.EventHandler(this.numericUpDown_lwRatioLimit_ValueChanged);
- //
- // groupBox_colorSetting
- //
- this.groupBox_colorSetting.Controls.Add(this.checkBox_showColorGamutPhase);
- this.groupBox_colorSetting.Controls.Add(this.panel_colorGamutPhase);
- this.groupBox_colorSetting.Controls.Add(this.button_pickColor);
- this.groupBox_colorSetting.Controls.Add(this.label_colorGamut);
- this.groupBox_colorSetting.Controls.Add(this.panel_colorGamut);
- this.groupBox_colorSetting.Location = new System.Drawing.Point(179, 427);
- this.groupBox_colorSetting.Name = "groupBox_colorSetting";
- this.groupBox_colorSetting.Size = new System.Drawing.Size(359, 72);
- this.groupBox_colorSetting.TabIndex = 26;
- this.groupBox_colorSetting.TabStop = false;
- //
- // checkBox_showColorGamutPhase
- //
- this.checkBox_showColorGamutPhase.AutoSize = true;
- this.checkBox_showColorGamutPhase.Location = new System.Drawing.Point(185, 48);
- this.checkBox_showColorGamutPhase.Name = "checkBox_showColorGamutPhase";
- this.checkBox_showColorGamutPhase.Size = new System.Drawing.Size(15, 14);
- this.checkBox_showColorGamutPhase.TabIndex = 41;
- this.checkBox_showColorGamutPhase.UseVisualStyleBackColor = true;
- this.checkBox_showColorGamutPhase.CheckedChanged += new System.EventHandler(this.checkBox_showColorGamutPhase_CheckedChanged);
- //
- // panel_colorGamutPhase
- //
- this.panel_colorGamutPhase.BackColor = System.Drawing.Color.Lime;
- this.panel_colorGamutPhase.Location = new System.Drawing.Point(284, 46);
- this.panel_colorGamutPhase.Name = "panel_colorGamutPhase";
- this.panel_colorGamutPhase.Size = new System.Drawing.Size(69, 17);
- this.panel_colorGamutPhase.TabIndex = 40;
- //
- // button_pickColor
- //
- this.button_pickColor.Location = new System.Drawing.Point(284, 17);
- this.button_pickColor.Name = "button_pickColor";
- this.button_pickColor.Size = new System.Drawing.Size(69, 23);
- this.button_pickColor.TabIndex = 36;
- this.button_pickColor.UseVisualStyleBackColor = true;
- this.button_pickColor.Click += new System.EventHandler(this.button_pickColor_Click);
- //
- // label_colorGamut
- //
- this.label_colorGamut.AutoSize = true;
- this.label_colorGamut.Location = new System.Drawing.Point(5, 51);
- this.label_colorGamut.Name = "label_colorGamut";
- this.label_colorGamut.Size = new System.Drawing.Size(0, 12);
- this.label_colorGamut.TabIndex = 35;
- //
- // panel_colorGamut
- //
- this.panel_colorGamut.Location = new System.Drawing.Point(64, 47);
- this.panel_colorGamut.Name = "panel_colorGamut";
- this.panel_colorGamut.Size = new System.Drawing.Size(110, 17);
- this.panel_colorGamut.TabIndex = 34;
- this.panel_colorGamut.Paint += new System.Windows.Forms.PaintEventHandler(this.panel_colorGamut_Paint);
- //
- // groupBox_displaySetting
- //
- this.groupBox_displaySetting.Location = new System.Drawing.Point(179, 646);
- this.groupBox_displaySetting.Name = "groupBox_displaySetting";
- this.groupBox_displaySetting.Size = new System.Drawing.Size(359, 56);
- this.groupBox_displaySetting.TabIndex = 29;
- this.groupBox_displaySetting.TabStop = false;
- //
- // groupBox_histogram
- //
- this.groupBox_histogram.Location = new System.Drawing.Point(179, 505);
- this.groupBox_histogram.Name = "groupBox_histogram";
- this.groupBox_histogram.Size = new System.Drawing.Size(179, 135);
- this.groupBox_histogram.TabIndex = 28;
- this.groupBox_histogram.TabStop = false;
- //
- // groupBox_colorAdjustment
- //
- this.groupBox_colorAdjustment.Controls.Add(this.button_colorAdjustmentBS);
- this.groupBox_colorAdjustment.Controls.Add(this.button_colorAdjustmentGL);
- this.groupBox_colorAdjustment.Controls.Add(this.button_colorAdjustmentRH);
- this.groupBox_colorAdjustment.Controls.Add(this.numericUpDown_colorAdjustmentBSD);
- this.groupBox_colorAdjustment.Controls.Add(this.numericUpDown_colorAdjustmentBSU);
- this.groupBox_colorAdjustment.Controls.Add(this.label_colorAdjustmentBS);
- this.groupBox_colorAdjustment.Controls.Add(this.numericUpDown_colorAdjustmentGLD);
- this.groupBox_colorAdjustment.Controls.Add(this.numericUpDown_colorAdjustmentGLU);
- this.groupBox_colorAdjustment.Controls.Add(this.label_colorAdjustmentGL);
- this.groupBox_colorAdjustment.Controls.Add(this.numericUpDown_colorAdjustmentRHD);
- this.groupBox_colorAdjustment.Controls.Add(this.numericUpDown_colorAdjustmentRHU);
- this.groupBox_colorAdjustment.Controls.Add(this.label_colorAdjustmentRH);
- this.groupBox_colorAdjustment.Controls.Add(this.radioButton_checkedHLS);
- this.groupBox_colorAdjustment.Controls.Add(this.radioButton_checkedRGB);
- this.groupBox_colorAdjustment.Location = new System.Drawing.Point(364, 505);
- this.groupBox_colorAdjustment.Name = "groupBox_colorAdjustment";
- this.groupBox_colorAdjustment.Size = new System.Drawing.Size(174, 135);
- this.groupBox_colorAdjustment.TabIndex = 27;
- this.groupBox_colorAdjustment.TabStop = false;
- //
- // button_colorAdjustmentBS
- //
- this.button_colorAdjustmentBS.Location = new System.Drawing.Point(134, 99);
- this.button_colorAdjustmentBS.Name = "button_colorAdjustmentBS";
- this.button_colorAdjustmentBS.Size = new System.Drawing.Size(34, 21);
- this.button_colorAdjustmentBS.TabIndex = 34;
- this.button_colorAdjustmentBS.Text = "B";
- this.button_colorAdjustmentBS.UseVisualStyleBackColor = true;
- this.button_colorAdjustmentBS.Click += new System.EventHandler(this.button_colorAdjustmentBS_Click);
- //
- // button_colorAdjustmentGL
- //
- this.button_colorAdjustmentGL.Location = new System.Drawing.Point(134, 72);
- this.button_colorAdjustmentGL.Name = "button_colorAdjustmentGL";
- this.button_colorAdjustmentGL.Size = new System.Drawing.Size(34, 21);
- this.button_colorAdjustmentGL.TabIndex = 33;
- this.button_colorAdjustmentGL.Text = "G";
- this.button_colorAdjustmentGL.UseVisualStyleBackColor = true;
- this.button_colorAdjustmentGL.Click += new System.EventHandler(this.button_colorAdjustmentGL_Click);
- //
- // button_colorAdjustmentRH
- //
- this.button_colorAdjustmentRH.BackColor = System.Drawing.SystemColors.Control;
- this.button_colorAdjustmentRH.Location = new System.Drawing.Point(134, 45);
- this.button_colorAdjustmentRH.Margin = new System.Windows.Forms.Padding(0);
- this.button_colorAdjustmentRH.Name = "button_colorAdjustmentRH";
- this.button_colorAdjustmentRH.Size = new System.Drawing.Size(34, 21);
- this.button_colorAdjustmentRH.TabIndex = 32;
- this.button_colorAdjustmentRH.Text = "R";
- this.button_colorAdjustmentRH.UseVisualStyleBackColor = true;
- this.button_colorAdjustmentRH.Click += new System.EventHandler(this.button_colorAdjustmentRH_Click);
- //
- // numericUpDown_colorAdjustmentBSD
- //
- this.numericUpDown_colorAdjustmentBSD.Location = new System.Drawing.Point(82, 99);
- this.numericUpDown_colorAdjustmentBSD.Maximum = new decimal(new int[] {
- 255,
- 0,
- 0,
- 0});
- this.numericUpDown_colorAdjustmentBSD.Name = "numericUpDown_colorAdjustmentBSD";
- this.numericUpDown_colorAdjustmentBSD.Size = new System.Drawing.Size(40, 21);
- this.numericUpDown_colorAdjustmentBSD.TabIndex = 30;
- this.numericUpDown_colorAdjustmentBSD.Tag = "max";
- this.numericUpDown_colorAdjustmentBSD.Value = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.numericUpDown_colorAdjustmentBSD.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentBSD.KeyUp += new System.Windows.Forms.KeyEventHandler(this.RGBoRHLSValue_Changed);
- //
- // numericUpDown_colorAdjustmentBSU
- //
- this.numericUpDown_colorAdjustmentBSU.Location = new System.Drawing.Point(37, 99);
- this.numericUpDown_colorAdjustmentBSU.Maximum = new decimal(new int[] {
- 255,
- 0,
- 0,
- 0});
- this.numericUpDown_colorAdjustmentBSU.Name = "numericUpDown_colorAdjustmentBSU";
- this.numericUpDown_colorAdjustmentBSU.Size = new System.Drawing.Size(40, 21);
- this.numericUpDown_colorAdjustmentBSU.TabIndex = 29;
- this.numericUpDown_colorAdjustmentBSU.Tag = "min";
- this.numericUpDown_colorAdjustmentBSU.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentBSU.KeyUp += new System.Windows.Forms.KeyEventHandler(this.RGBoRHLSValue_Changed);
- //
- // label_colorAdjustmentBS
- //
- this.label_colorAdjustmentBS.AutoSize = true;
- this.label_colorAdjustmentBS.Location = new System.Drawing.Point(10, 103);
- this.label_colorAdjustmentBS.Name = "label_colorAdjustmentBS";
- this.label_colorAdjustmentBS.Size = new System.Drawing.Size(23, 12);
- this.label_colorAdjustmentBS.TabIndex = 31;
- this.label_colorAdjustmentBS.Text = "B:";
- //
- // numericUpDown_colorAdjustmentGLD
- //
- this.numericUpDown_colorAdjustmentGLD.Location = new System.Drawing.Point(82, 72);
- this.numericUpDown_colorAdjustmentGLD.Maximum = new decimal(new int[] {
- 255,
- 0,
- 0,
- 0});
- this.numericUpDown_colorAdjustmentGLD.Name = "numericUpDown_colorAdjustmentGLD";
- this.numericUpDown_colorAdjustmentGLD.Size = new System.Drawing.Size(40, 21);
- this.numericUpDown_colorAdjustmentGLD.TabIndex = 27;
- this.numericUpDown_colorAdjustmentGLD.Tag = "max";
- this.numericUpDown_colorAdjustmentGLD.Value = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.numericUpDown_colorAdjustmentGLD.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentGLD.KeyUp += new System.Windows.Forms.KeyEventHandler(this.RGBoRHLSValue_Changed);
- //
- // numericUpDown_colorAdjustmentGLU
- //
- this.numericUpDown_colorAdjustmentGLU.Location = new System.Drawing.Point(37, 72);
- this.numericUpDown_colorAdjustmentGLU.Maximum = new decimal(new int[] {
- 255,
- 0,
- 0,
- 0});
- this.numericUpDown_colorAdjustmentGLU.Name = "numericUpDown_colorAdjustmentGLU";
- this.numericUpDown_colorAdjustmentGLU.Size = new System.Drawing.Size(40, 21);
- this.numericUpDown_colorAdjustmentGLU.TabIndex = 26;
- this.numericUpDown_colorAdjustmentGLU.Tag = "min";
- this.numericUpDown_colorAdjustmentGLU.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentGLU.KeyUp += new System.Windows.Forms.KeyEventHandler(this.RGBoRHLSValue_Changed);
- //
- // label_colorAdjustmentGL
- //
- this.label_colorAdjustmentGL.AutoSize = true;
- this.label_colorAdjustmentGL.Location = new System.Drawing.Point(10, 76);
- this.label_colorAdjustmentGL.Name = "label_colorAdjustmentGL";
- this.label_colorAdjustmentGL.Size = new System.Drawing.Size(23, 12);
- this.label_colorAdjustmentGL.TabIndex = 28;
- this.label_colorAdjustmentGL.Text = "G:";
- //
- // numericUpDown_colorAdjustmentRHD
- //
- this.numericUpDown_colorAdjustmentRHD.Location = new System.Drawing.Point(82, 45);
- this.numericUpDown_colorAdjustmentRHD.Maximum = new decimal(new int[] {
- 255,
- 0,
- 0,
- 0});
- this.numericUpDown_colorAdjustmentRHD.Name = "numericUpDown_colorAdjustmentRHD";
- this.numericUpDown_colorAdjustmentRHD.Size = new System.Drawing.Size(40, 21);
- this.numericUpDown_colorAdjustmentRHD.TabIndex = 8;
- this.numericUpDown_colorAdjustmentRHD.Tag = "max";
- this.numericUpDown_colorAdjustmentRHD.Value = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.numericUpDown_colorAdjustmentRHD.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentRHD.KeyUp += new System.Windows.Forms.KeyEventHandler(this.RGBoRHLSValue_Changed);
- //
- // numericUpDown_colorAdjustmentRHU
- //
- this.numericUpDown_colorAdjustmentRHU.Location = new System.Drawing.Point(37, 45);
- this.numericUpDown_colorAdjustmentRHU.Maximum = new decimal(new int[] {
- 255,
- 0,
- 0,
- 0});
- this.numericUpDown_colorAdjustmentRHU.Name = "numericUpDown_colorAdjustmentRHU";
- this.numericUpDown_colorAdjustmentRHU.Size = new System.Drawing.Size(40, 21);
- this.numericUpDown_colorAdjustmentRHU.TabIndex = 7;
- this.numericUpDown_colorAdjustmentRHU.Tag = "min";
- this.numericUpDown_colorAdjustmentRHU.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentRHU.KeyUp += new System.Windows.Forms.KeyEventHandler(this.RGBoRHLSValue_Changed);
- //
- // label_colorAdjustmentRH
- //
- this.label_colorAdjustmentRH.AutoSize = true;
- this.label_colorAdjustmentRH.Location = new System.Drawing.Point(10, 49);
- this.label_colorAdjustmentRH.Name = "label_colorAdjustmentRH";
- this.label_colorAdjustmentRH.Size = new System.Drawing.Size(23, 12);
- this.label_colorAdjustmentRH.TabIndex = 25;
- this.label_colorAdjustmentRH.Text = "R:";
- //
- // radioButton_checkedHLS
- //
- this.radioButton_checkedHLS.AutoSize = true;
- this.radioButton_checkedHLS.Location = new System.Drawing.Point(66, 20);
- this.radioButton_checkedHLS.Name = "radioButton_checkedHLS";
- this.radioButton_checkedHLS.Size = new System.Drawing.Size(41, 16);
- this.radioButton_checkedHLS.TabIndex = 4;
- this.radioButton_checkedHLS.Text = "HLS";
- this.radioButton_checkedHLS.UseVisualStyleBackColor = true;
- this.radioButton_checkedHLS.Visible = false;
- this.radioButton_checkedHLS.CheckedChanged += new System.EventHandler(this.radioButton_checkedHLS_CheckedChanged);
- //
- // radioButton_checkedRGB
- //
- this.radioButton_checkedRGB.AutoSize = true;
- this.radioButton_checkedRGB.Checked = true;
- this.radioButton_checkedRGB.Location = new System.Drawing.Point(7, 20);
- this.radioButton_checkedRGB.Name = "radioButton_checkedRGB";
- this.radioButton_checkedRGB.Size = new System.Drawing.Size(41, 16);
- this.radioButton_checkedRGB.TabIndex = 3;
- this.radioButton_checkedRGB.TabStop = true;
- this.radioButton_checkedRGB.Text = "RGB";
- this.radioButton_checkedRGB.UseVisualStyleBackColor = true;
- this.radioButton_checkedRGB.CheckedChanged += new System.EventHandler(this.radioButton_checkedRGB_CheckedChanged);
- //
- // 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(544, 121);
- this.groupBox_review.Name = "groupBox_review";
- this.groupBox_review.Size = new System.Drawing.Size(622, 581);
- this.groupBox_review.TabIndex = 30;
- this.groupBox_review.TabStop = false;
- //
- // groupBox_report
- //
- this.groupBox_report.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox_report.Controls.Add(this.button1);
- this.groupBox_report.Controls.Add(this.label_resultPrecision);
- this.groupBox_report.Controls.Add(this.domainUpDown_resultPrecision);
- this.groupBox_report.Controls.Add(this.button_exportResults);
- this.groupBox_report.Controls.Add(this.button_generateReport);
- this.groupBox_report.Location = new System.Drawing.Point(1024, 708);
- this.groupBox_report.Name = "groupBox_report";
- this.groupBox_report.Size = new System.Drawing.Size(142, 188);
- this.groupBox_report.TabIndex = 33;
- this.groupBox_report.TabStop = false;
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(28, 104);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(75, 23);
- this.button1.TabIndex = 4;
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // label_resultPrecision
- //
- this.label_resultPrecision.AutoSize = true;
- this.label_resultPrecision.Location = new System.Drawing.Point(21, 148);
- this.label_resultPrecision.Name = "label_resultPrecision";
- this.label_resultPrecision.Size = new System.Drawing.Size(0, 12);
- this.label_resultPrecision.TabIndex = 3;
- //
- // domainUpDown_resultPrecision
- //
- this.domainUpDown_resultPrecision.Location = new System.Drawing.Point(63, 142);
- this.domainUpDown_resultPrecision.Name = "domainUpDown_resultPrecision";
- this.domainUpDown_resultPrecision.ReadOnly = true;
- this.domainUpDown_resultPrecision.Size = new System.Drawing.Size(41, 21);
- this.domainUpDown_resultPrecision.TabIndex = 2;
- this.domainUpDown_resultPrecision.Text = "2";
- this.domainUpDown_resultPrecision.SelectedItemChanged += new System.EventHandler(this.domainUpDown_resultPrecision_SelectedItemChanged);
- //
- // button_exportResults
- //
- this.button_exportResults.Location = new System.Drawing.Point(28, 63);
- this.button_exportResults.Name = "button_exportResults";
- this.button_exportResults.Size = new System.Drawing.Size(75, 24);
- this.button_exportResults.TabIndex = 1;
- this.button_exportResults.UseVisualStyleBackColor = true;
- this.button_exportResults.Click += new System.EventHandler(this.button_exportResults_Click);
- //
- // button_generateReport
- //
- this.button_generateReport.Location = new System.Drawing.Point(29, 24);
- this.button_generateReport.Name = "button_generateReport";
- this.button_generateReport.Size = new System.Drawing.Size(75, 23);
- this.button_generateReport.TabIndex = 0;
- this.button_generateReport.UseVisualStyleBackColor = true;
- this.button_generateReport.Click += new System.EventHandler(this.button_generateReport_Click);
- //
- // groupBox6groupBox_analysisResult2
- //
- this.groupBox6groupBox_analysisResult2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox6groupBox_analysisResult2.Controls.Add(this.listView_analysisResult2);
- this.groupBox6groupBox_analysisResult2.Controls.Add(this.listView_analysisResult);
- this.groupBox6groupBox_analysisResult2.Location = new System.Drawing.Point(242, 708);
- this.groupBox6groupBox_analysisResult2.Name = "groupBox6groupBox_analysisResult2";
- this.groupBox6groupBox_analysisResult2.Size = new System.Drawing.Size(769, 188);
- this.groupBox6groupBox_analysisResult2.TabIndex = 32;
- this.groupBox6groupBox_analysisResult2.TabStop = false;
- //
- // listView_analysisResult2
- //
- this.listView_analysisResult2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.listView_analysisResult2.FullRowSelect = true;
- this.listView_analysisResult2.GridLines = true;
- this.listView_analysisResult2.HideSelection = false;
- this.listView_analysisResult2.Location = new System.Drawing.Point(6, 114);
- this.listView_analysisResult2.MultiSelect = false;
- this.listView_analysisResult2.Name = "listView_analysisResult2";
- this.listView_analysisResult2.Size = new System.Drawing.Size(757, 63);
- this.listView_analysisResult2.TabIndex = 2;
- this.listView_analysisResult2.UseCompatibleStateImageBehavior = false;
- //
- // listView_analysisResult
- //
- this.listView_analysisResult.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.listView_analysisResult.FullRowSelect = true;
- this.listView_analysisResult.GridLines = true;
- this.listView_analysisResult.HideSelection = false;
- this.listView_analysisResult.Location = new System.Drawing.Point(6, 20);
- this.listView_analysisResult.MultiSelect = false;
- this.listView_analysisResult.Name = "listView_analysisResult";
- this.listView_analysisResult.Size = new System.Drawing.Size(757, 88);
- this.listView_analysisResult.TabIndex = 2;
- this.listView_analysisResult.UseCompatibleStateImageBehavior = false;
- //
- // groupBox_analysisResult1
- //
- this.groupBox_analysisResult1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox_analysisResult1.Controls.Add(this.listBox_analysisResult);
- this.groupBox_analysisResult1.Controls.Add(this.button_remove);
- this.groupBox_analysisResult1.Controls.Add(this.button_all);
- this.groupBox_analysisResult1.Location = new System.Drawing.Point(12, 708);
- this.groupBox_analysisResult1.Name = "groupBox_analysisResult1";
- this.groupBox_analysisResult1.Size = new System.Drawing.Size(224, 188);
- this.groupBox_analysisResult1.TabIndex = 31;
- this.groupBox_analysisResult1.TabStop = false;
- //
- // 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(6, 53);
- this.listBox_analysisResult.Name = "listBox_analysisResult";
- this.listBox_analysisResult.Size = new System.Drawing.Size(199, 116);
- this.listBox_analysisResult.TabIndex = 0;
- 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.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.UseVisualStyleBackColor = true;
- this.button_all.Click += new System.EventHandler(this.button_all_Click);
- //
- // 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.radioButton5);
- this.groupBox1.Controls.Add(this.radioButton3);
- this.groupBox1.Controls.Add(this.radioButton4);
- this.groupBox1.Controls.Add(this.button4);
- this.groupBox1.Controls.Add(this.button3);
- this.groupBox1.Location = new System.Drawing.Point(544, 71);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(621, 44);
- this.groupBox1.TabIndex = 34;
- this.groupBox1.TabStop = false;
- //
- // radioButton3
- //
- this.radioButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.radioButton3.AutoSize = true;
- this.radioButton3.Checked = true;
- this.radioButton3.Location = new System.Drawing.Point(377, 19);
- this.radioButton3.Name = "radioButton3";
- this.radioButton3.Size = new System.Drawing.Size(59, 16);
- this.radioButton3.TabIndex = 14;
- this.radioButton3.TabStop = true;
- this.radioButton3.Text = "旧算法";
- this.radioButton3.UseVisualStyleBackColor = true;
- //
- // radioButton4
- //
- this.radioButton4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.radioButton4.AutoSize = true;
- this.radioButton4.Location = new System.Drawing.Point(314, 19);
- this.radioButton4.Name = "radioButton4";
- this.radioButton4.Size = new System.Drawing.Size(59, 16);
- this.radioButton4.TabIndex = 13;
- this.radioButton4.Text = "新算法";
- this.radioButton4.UseVisualStyleBackColor = true;
- //
- // button4
- //
- this.button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button4.Location = new System.Drawing.Point(459, 15);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(75, 23);
- this.button4.TabIndex = 9;
- this.button4.Text = "应用全部";
- this.button4.UseVisualStyleBackColor = true;
- this.button4.Click += new System.EventHandler(this.button4_Click);
- //
- // button3
- //
- this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button3.Location = new System.Drawing.Point(540, 15);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(75, 23);
- this.button3.TabIndex = 8;
- this.button3.Text = "保存全部";
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += new System.EventHandler(this.button3_Click);
- //
- // radioButton5
- //
- this.radioButton5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.radioButton5.AutoSize = true;
- this.radioButton5.Location = new System.Drawing.Point(225, 18);
- this.radioButton5.Name = "radioButton5";
- this.radioButton5.Size = new System.Drawing.Size(83, 16);
- this.radioButton5.TabIndex = 15;
- this.radioButton5.Text = "新算法(二)";
- this.radioButton5.UseVisualStyleBackColor = true;
- //
- // InclusionsStandardDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
- this.ClientSize = new System.Drawing.Size(1177, 908);
- this.Controls.Add(this.groupBox1);
- this.Controls.Add(this.groupBox_baseSetting);
- this.Controls.Add(this.groupBox_report);
- this.Controls.Add(this.groupBox6groupBox_analysisResult2);
- this.Controls.Add(this.groupBox_analysisResult1);
- this.Controls.Add(this.groupBox_review);
- this.Controls.Add(this.groupBox_displaySetting);
- this.Controls.Add(this.groupBox_histogram);
- this.Controls.Add(this.groupBox_colorAdjustment);
- this.Controls.Add(this.groupBox_colorSetting);
- this.Controls.Add(this.groupBox_img);
- this.Controls.Add(this.groupBox_operating);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.Location = new System.Drawing.Point(0, 0);
- this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.Name = "InclusionsStandardDialog";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.InclusionsStandardDialog_FormClosing);
- this.Controls.SetChildIndex(this.groupBox_operating, 0);
- this.Controls.SetChildIndex(this.groupBox_img, 0);
- this.Controls.SetChildIndex(this.groupBox_colorSetting, 0);
- this.Controls.SetChildIndex(this.groupBox_colorAdjustment, 0);
- this.Controls.SetChildIndex(this.groupBox_histogram, 0);
- this.Controls.SetChildIndex(this.groupBox_displaySetting, 0);
- this.Controls.SetChildIndex(this.groupBox_review, 0);
- this.Controls.SetChildIndex(this.groupBox_analysisResult1, 0);
- this.Controls.SetChildIndex(this.groupBox6groupBox_analysisResult2, 0);
- this.Controls.SetChildIndex(this.groupBox_report, 0);
- this.Controls.SetChildIndex(this.groupBox_baseSetting, 0);
- this.Controls.SetChildIndex(this.groupBox1, 0);
- this.groupBox_operating.ResumeLayout(false);
- this.groupBox_operating.PerformLayout();
- this.groupBox_img.ResumeLayout(false);
- this.groupBox_baseSetting.ResumeLayout(false);
- this.groupBox_baseSetting.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).EndInit();
- this.groupBox_colorSetting.ResumeLayout(false);
- this.groupBox_colorSetting.PerformLayout();
- this.groupBox_colorAdjustment.ResumeLayout(false);
- this.groupBox_colorAdjustment.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentBSD)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentBSU)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentGLD)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentGLU)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentRHD)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentRHU)).EndInit();
- this.groupBox_report.ResumeLayout(false);
- this.groupBox_report.PerformLayout();
- this.groupBox6groupBox_analysisResult2.ResumeLayout(false);
- this.groupBox_analysisResult1.ResumeLayout(false);
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.ResumeLayout(false);
- }
- private void abc(object sender, EventArgs e)
- {
- if (this.listBox_analysisResult.Items.Count > 0)
- {
- MessageBox.Show(PdnResources.GetString("Menu.sultsbeforemodifyingtheKvalue.Text"));
- this.comboBox1.SelectedIndex = chooseK;
- return;
- }
- if (this.lstView_img.FocusedItem != null)
- {
- if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
- {
- everyImgData[this.lstView_img.FocusedItem.Index].kNum = Convert.ToInt32(this.comboBox1.SelectedItem);
- }
- else
- {
- CurrentPageData data = new CurrentPageData(this.autoJiaoBen);
- data.directionIndex = comboBox_rollingDirection.SelectedIndex;
- data.ratio = numericUpDown_lwRatioLimit.Value;
- data.colorCheck = this.checkBox_showColorGamutPhase.Checked;
- data.kNum = Convert.ToInt32(this.comboBox1.SelectedItem);
- everyImgData.Add(this.lstView_img.FocusedItem.Index, data);
- }
- }
- this.comboBox1_SelectedIndexChanged(sender, e);
- }
- public void Initialize()
- {
- if (this.Text == "DIN50602_1985_MethodK")
- {
- this.comboBox1.Visible = true;
- this.label1.Visible = true;
- this.button2.Visible = true;
- this.btn_drawRecognitionArea.Visible = false;
- this.isK = 1;
- }
- else
- {
- this.comboBox1.Visible = false;
- this.label1.Visible = false;
- this.button2.Visible = false;
- this.btn_drawRecognitionArea.Visible = true;
- this.isK = 2;
- }
- radioButton1.Enabled = false;
- radioButton2.Enabled = false;
- checkBox1.Enabled = false;
- checkBox2.Enabled = false;
- this.Load += new System.EventHandler(this.GrainSizeDialog_Load);
- this.comboBox_rollingDirection.SelectedIndex = 0;
- this.comboBox_rollingDirection.SelectedIndexChanged += new System.EventHandler(this.comboBox_rollingDirection_SelectedIndexChanged);
- this.comboBox1.SelectedIndex = 3;
- //this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
- for (int i = 10; i >= 1; i--)
- {
- this.domainUpDown_resultPrecision.Items.Add(i.ToString());
- }
- this.domainUpDown_resultPrecision.SelectedIndex = 8;
- this.documentItems = new Dictionary<int, DocumentItem>();
- //初始化图片列表
- for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
- {
- this.imageList_img.Images.Add("img" + i, this.appWorkspace.DocumentWorkspaces[i].BinarizationThumbnail);
- this.lstView_img.Items.Add("", i);
- this.lstView_img.Items[i].ImageIndex = i;
- this.lstView_img.Items[i].Text = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
- this.lstView_img.Items[i].Name = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
- if (this.appWorkspace.DocumentWorkspaces[i].Equals(this.appWorkspace.ActiveDocumentWorkspace))
- {
- this.imgIndex = i;
- }
- }
- //
- //初始化图像控件
- //
- this.documentWorkspace = new DocumentWorkspaceWindow(this.appWorkspace);
- this.documentWorkspace.Cursor = Cursors.Default;
- this.documentWorkspace.Dock = DockStyle.Fill;
- this.documentWorkspace.HookMouseEvents();
- this.documentWorkspace.AuxiliaryLineEnabled = false;
- this.documentWorkspace.Visible = true;
- this.documentWorkspace.panel.Click += new EventHandler(this.documentWorkspace_panel_Click);
- this.documentWorkspace.panel.MouseDown += new MouseEventHandler(this.documentWorkspace_panel_MouseDown);
- this.documentWorkspace.panel.MouseMove += new MouseEventHandler(this.documentWorkspace_panel_MouseMove);
- this.documentWorkspace.panel.MouseUp += new MouseEventHandler(this.documentWorkspace_panel_MouseUp);
- PdnBaseForm.RegisterFormHotKey(Keys.Delete, (key) => { this.documentWorkspace.MouseEvent_Del(null, null); return true; });
- this.groupBox_review.Controls.Add(this.documentWorkspace);
- //
- //初始化操作按钮
- //
- this.commonControlButtons = new CommonControlButtons();
- this.commonControlButtons.Dock = DockStyle.Top;
- this.commonControlButtons.Height = 30;
- this.commonControlButtons.HideZoomToWindowAndActualSize();
- 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);
- groupBox_review.Controls.Add(this.commonControlButtons);
- this.binaryExtractionModel.ColorInterval = 1;
- this.radioButton_checkedRGB.FlatStyle = FlatStyle.Flat;
- this.radioButton_checkedRGB.BackColor = Color.FromArgb(225, 225, 225);
- this.radioButton_checkedRGB.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215);
- this.radioButton_checkedRGB.FlatAppearance.BorderSize = 2;
- // 直方图
- this.histogramControl_colorSetting.DragOneEventActionFinish += new EventHandler<EventArgs<int>>(this.histogramControl_colorSetting_DragOneEvent);
- this.histogramControl_colorSetting.DragTwoEventActionFinish += new EventHandler<EventArgs<int>>(this.histogramControl_colorSetting_DragTwoEvent);
- // 初始化报告列表
- this.listView_analysisResult.View = View.Details;
- this.listView_analysisResult2.View = View.Details;
- this.listBox_analysisResult.DisplayMember = "Display";
- this.listBox_analysisResult.ValueMember = "Value";
- }
- #endregion
- #region 事件
- #region 公共按钮
- private void zoomInButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomIn();
- }
- private void zoomOutButton_Click(object sender, EventArgs e)
- {
- 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.Cursor = Cursors.Default;
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.InclusionSelectRecognitionArea;
- }
- private void mobileModeButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.MoveMode;
- }
- #endregion
- private void btn_selectClear_Click(object sender, EventArgs e)
- {
- this.clearSelect = true;
- }
- private void label_displaySetting(object sender, EventArgs e)
- {
- if (this.lstView_img.FocusedItem == null || !this.lstView_img.FocusedItem.Selected)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text"));
- return;
- }
- if (this.documentWorkspace.phaseModels[0].mat == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseperformabinaryoperationfirst.text"));
- return;
- }
- //按钮选择
- if (this.isK == 1)
- {
- this.documentWorkspace.ActiveTool = DrawToolType.InclusionSelectRecognitionArea;
- }
- if (this.selectedTypesOfInclusions != null)
- {
- if (this.selectedTypesOfInclusions.Equals(this.methodOfAssessment.inclusionsStandard.globalSettings.typeDics[((Button)sender).Text]))
- {
- this.selectedTypesOfInclusions = null;
- this.button1.Focus();
- }
- else
- {
- this.selectedTypesOfInclusions = this.methodOfAssessment.inclusionsStandard.globalSettings.typeDics[((Button)sender).Text];
- }
- }
- else
- {
- this.selectedTypesOfInclusions = this.methodOfAssessment.inclusionsStandard.globalSettings.typeDics[((Button)sender).Text];
- }
- }
- private void button_setting_Click(object sender, EventArgs e)
- {
- AnalyzeSettingDialog recombinationRateSetDialog = new AnalyzeSettingDialog(this, this.methodOfAssessment.resourcesName);
- if (recombinationRateSetDialog.hasModule)
- {
- recombinationRateSetDialog.StartPosition = FormStartPosition.CenterScreen;
- recombinationRateSetDialog.ShowDialog();
- }
- else
- {
- recombinationRateSetDialog = null;
- }
- }
- private void checkBox_showColorGamutPhase_CheckedChanged(object sender, EventArgs e)
- {
- if (this.documentWorkspace.phaseModels.Count == 0)
- {
- return;
- }
- CheckBox checkBox = (CheckBox)sender;
- if (this.lstView_img.FocusedItem != null)
- {
- if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
- {
- everyImgData[this.lstView_img.FocusedItem.Index].colorCheck = this.checkBox_showColorGamutPhase.Checked;
- }
- else
- {
- CurrentPageData data = new CurrentPageData(this.autoJiaoBen);
- data.directionIndex = comboBox_rollingDirection.SelectedIndex;
- data.ratio = numericUpDown_lwRatioLimit.Value;
- data.colorCheck = this.checkBox_showColorGamutPhase.Checked;
- everyImgData.Add(this.lstView_img.FocusedItem.Index, data);
- }
- }
- this.documentWorkspace.phaseModels[this.documentWorkspace.phaseModels.Count - 1].choise = checkBox.Checked;
- this.documentWorkspace.Refresh();
- }
- private void btn_clean_result_Click(object sender, EventArgs e)
- {
- this.tempAnalysisResult = null;
- ToolInclusionSelect.CleanInclusionAll(this.documentWorkspace);
- radioButton1.Enabled = false;
- radioButton2.Enabled = false;
- checkBox1.Enabled = false;
- checkBox2.Enabled = false;
- userAll = false;
- }
- private void btn_statistics_Click(object sender, EventArgs e)
- {
- if (this.isK == 1)
- {
- this.documentWorkspace.ActiveTool = DrawToolType.InclusionSelectRecognitionArea;
- }
- this.startStatistics();
- radioButton1.Enabled = true;
- radioButton2.Enabled = true;
- checkBox1.Enabled = true;
- checkBox2.Enabled = true;
- }
- private void btn_saveresult_Click(object sender, EventArgs e)
- {
- if (this.tempAnalysisResult == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttostartstatistics.text"));
- return;
- }
- if (analysisResults.ContainsKey(this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index]))
- {
- 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;
- }
- analysisResults[this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index]] = this.tempAnalysisResult;
- }
- else
- {
- analysisResults.Add(this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index], this.tempAnalysisResult);
- }
- buildListBox_analysisResult();
- }
- private void lstView_img_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (this.lstView_img.FocusedItem != null && this.lstView_img.FocusedItem.Selected)
- {
- this.imgPxPerUnit = this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].GetRuler(MeasurementUnit.Micron);
- if (this.methodOfAssessment != null)
- {
- this.methodOfAssessment = getMethodOfAssessment();
- MethodOfAssessment.activeMethod = this.methodOfAssessment;
- SetAnalyzeModelFromXml(this.methodOfAssessment.resourcesName);
- }
- this.imageMat = this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].CompositionSurface.CreatedAliasedMat();
- this.tempAnalysisResult = null;
- //二值化
- binaryClass.listView1_SelectedIndexChanged(this.imageMat.Clone(), this.imageList_img.Images.Keys[this.lstView_img.FocusedItem.Index]);
- var gList = new GraphicsList();
- for (int i = 0; i < this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].GraphicsList.Count; i++)
- {
- var obj = this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].GraphicsList[i].Clone();
- gList.Add(obj);
- }
- this.documentWorkspace.GraphicsList = gList;
- this.documentWorkspace.ActiveTool = DrawToolType.InclusionSelectRecognitionArea;
- if (this.isK == 1)
- {
- this.documentWorkspace.GraphicsList.DeleteAllView();
- var line = new ViewRectangle(0, 0, this.imageMat.Width, this.imageMat.Height);
- line.ISurfaceBox = documentWorkspace;
- line.combineMode = (CombineMode)Enum.Parse(typeof(CombineMode), "Union");
- line.Selected = true;
- this.documentWorkspace.AddGraphicsFromForm(line);
- if (!this.bcBinaryChecked())
- {
- this.documentWorkspace.ActiveTool = DrawToolType.Pointer;
- }
- this.documentWorkspace.Refresh();
- }
- this.histogramControl_colorSetting.CreateHistogram(this.imageMat, false, this.histogramControl_colorSetting.Width - 1, this.histogramControl_colorSetting.Height - 5, HistogramRGBSelect);
- if (userAll)
- {
- this.startStatistics();
- }
- if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
- {
- if (everyImgData[this.lstView_img.FocusedItem.Index].thisSelectedColorOfInclusions != null)
- {
- this.colorName = everyImgData[this.lstView_img.FocusedItem.Index].thisSelectedColorOfInclusions.colorName;
- getOldCheck();
- this.selectedColorOfInclusions = everyImgData[this.lstView_img.FocusedItem.Index].thisSelectedColorOfInclusions;
- CalcRGBOrHLSValue();
- UpdateHistogramStartAndEnd();
- }
- else
- {
- if (this.oldSelectedColorOfInclusions != null)
- {
- this.colorName = this.oldSelectedColorOfInclusions.colorName;
- getOldCheck();
- this.selectedColorOfInclusions = new ColorOfInclusions(this.oldSelectedColorOfInclusions.colorName, this.oldSelectedColorOfInclusions.ofTypes, this.oldSelectedColorOfInclusions.ru, this.oldSelectedColorOfInclusions.rd, this.oldSelectedColorOfInclusions.gu, this.oldSelectedColorOfInclusions.gd, this.oldSelectedColorOfInclusions.bu, this.oldSelectedColorOfInclusions.bd);
- everyImgData[this.lstView_img.FocusedItem.Index].thisSelectedColorOfInclusions = this.selectedColorOfInclusions;
- CalcRGBOrHLSValue();
- UpdateHistogramStartAndEnd();
- }
- }
- comboBox1.SelectedIndex = everyImgData[this.lstView_img.FocusedItem.Index].kNum;
- if (everyImgData[this.lstView_img.FocusedItem.Index].directionIndex >= 0)
- {
- comboBox_rollingDirection.SelectedIndex = everyImgData[this.lstView_img.FocusedItem.Index].directionIndex;
- }
- if (everyImgData[this.lstView_img.FocusedItem.Index].ratio >= numericUpDown_lwRatioLimit.Minimum)
- {
- numericUpDown_lwRatioLimit.Value = everyImgData[this.lstView_img.FocusedItem.Index].ratio;
- }
- checkBox_showColorGamutPhase.Checked = everyImgData[this.lstView_img.FocusedItem.Index].colorCheck;
- }
- else
- {
- if (this.oldSelectedColorOfInclusions != null)
- {
- this.colorName = this.oldSelectedColorOfInclusions.colorName;
- getOldCheck();
- this.selectedColorOfInclusions = new ColorOfInclusions(this.oldSelectedColorOfInclusions.colorName, this.oldSelectedColorOfInclusions.ofTypes, this.oldSelectedColorOfInclusions.ru, this.oldSelectedColorOfInclusions.rd, this.oldSelectedColorOfInclusions.gu, this.oldSelectedColorOfInclusions.gd, this.oldSelectedColorOfInclusions.bu, this.oldSelectedColorOfInclusions.bd);
- CalcRGBOrHLSValue();
- UpdateHistogramStartAndEnd();
- }
- comboBox1.SelectedIndex = 5;
- if (thisParameters != null)
- {
- if (thisParameters.parameter1 >= 0)
- {
- comboBox_rollingDirection.SelectedIndex = thisParameters.parameter1;
- }
- if (thisParameters.parameter2 >= numericUpDown_lwRatioLimit.Minimum)
- {
- numericUpDown_lwRatioLimit.Value = thisParameters.parameter2;
- }
- checkBox_showColorGamutPhase.Checked = thisParameters.parameter5;
- }
- }
- }
- else
- {
- this.documentWorkspace.Visible = false;
- }
- }
- private void listBox_analysisResult_SelectedIndexChanged(object sender, EventArgs e)
- {
- buildListView_analysisResult();
- }
- private void button_all_Click(object sender, EventArgs e)
- {
- for (int i = 0; i < this.listBox_analysisResult.Items.Count; i++)
- {
- this.listBox_analysisResult.SetItemChecked(i, true);
- }
- buildListView_analysisResult();
- }
- private void button_remove_Click(object sender, EventArgs e)
- {
- if (this.listBox_analysisResult.Items.Count == 0)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Noresultsatmeasuring.text"));
- return;
- }
- if (MessageBox.Show(PdnResources.GetString("Menu.Areyousuretodeleteth.text") + "?", "", MessageBoxButtons.OKCancel) == DialogResult.OK)
- {
- if (this.listBox_analysisResult.CheckedItems.Count == 0)
- {
- return;
- }
- foreach (var item in this.listBox_analysisResult.CheckedItems)
- {
- this.analysisResults.Remove(((LocalListViewItem)item).Value);
- }
- buildListBox_analysisResult();
- }
- }
- private void btn_editInclusions_Click(object sender, EventArgs e)
- {
- if (this.tempAnalysisResult == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttostartstatistics.text"));
- return;
- }
- DocumentItem item = new DocumentItem(this.imageMat.Clone(), this.documentWorkspace.GraphicsList, this.documentWorkspace.phaseModels);
- new InclusionEditDialog(this.Text, this.appWorkspace, item, this.tempAnalysisResult, this.inclusionEditDialogCloseCallback, this.is_showRectangle, this.is_showOval, this.is_full, this.isK).ShowDialog();
- }
- private void numericUpDown_lwRatioLimit_ValueChanged(object sender, EventArgs e)
- {
- this.methodOfAssessment.inclusionsStandard.globalSettings.lwRatioLimit = Decimal.ToDouble(this.numericUpDown_lwRatioLimit.Value);
- if (this.lstView_img.FocusedItem != null)
- {
- if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
- {
- everyImgData[this.lstView_img.FocusedItem.Index].ratio = this.numericUpDown_lwRatioLimit.Value;
- }
- else
- {
- CurrentPageData data = new CurrentPageData(this.autoJiaoBen);
- data.directionIndex = comboBox_rollingDirection.SelectedIndex;
- data.ratio = numericUpDown_lwRatioLimit.Value;
- everyImgData.Add(this.lstView_img.FocusedItem.Index, data);
- }
- }
- }
- private void numericUpDown_threshold_ValueChanged(object sender, EventArgs e)
- {
- //this.methodOfAssessment.inclusionsStandard.globalSettings.binaryThreshold = Decimal.ToInt32(this.numericUpDown_threshold.Value);
- }
- private void radioButton_colorSelect_CheckedChanged(object sender, EventArgs e)
- {
- RadioButton checkedButton = this.groupBox_colorSetting.Controls.OfType<RadioButton>()
- .FirstOrDefault(r => r.Checked);
- }
- private void radioButton_checkedRGB_CheckedChanged(object sender, EventArgs e)
- {
- if (this.radioButton_checkedRGB.Checked)
- {
- this.label_colorAdjustmentRH.Text = "R";
- this.label_colorAdjustmentGL.Text = "G";
- this.label_colorAdjustmentBS.Text = "B";
- this.button_colorAdjustmentRH.Text = "R";
- this.button_colorAdjustmentGL.Text = "G";
- this.button_colorAdjustmentBS.Text = "B";
- CalcRGBOrHLSValue();
- UpdateHistogramStartAndEnd();
- }
- }
- private void radioButton_checkedHLS_CheckedChanged(object sender, EventArgs e)
- {
- if (this.radioButton_checkedHLS.Checked)
- {
- this.label_colorAdjustmentRH.Text = "H";
- this.label_colorAdjustmentGL.Text = "L";
- this.label_colorAdjustmentBS.Text = "S";
- this.button_colorAdjustmentRH.Text = "H";
- this.button_colorAdjustmentGL.Text = "L";
- this.button_colorAdjustmentBS.Text = "S";
- CalcRGBOrHLSValue();
- UpdateHistogramStartAndEnd();
- }
- }
- private void RGBoRHLSValue_Changed(object sender, EventArgs e)
- {
- UpdateHistogramStartAndEnd();
- SetPhaseModelRGBOrHLS();
- }
- /// <summary>
- /// RGB/HLS的Button的R/H点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button_colorAdjustmentRH_Click(object sender, EventArgs e)
- {
- this.HistogramRGBSelect = 1;
- this.button_colorAdjustmentRH.FlatStyle = FlatStyle.Flat;
- this.button_colorAdjustmentRH.BackColor = Color.FromArgb(225, 225, 225);
- this.button_colorAdjustmentRH.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215);
- this.button_colorAdjustmentRH.FlatAppearance.BorderSize = 1;
- this.button_colorAdjustmentGL.FlatStyle = FlatStyle.Standard;
- this.button_colorAdjustmentGL.BackColor = Control.DefaultBackColor;
- this.button_colorAdjustmentGL.FlatAppearance.BorderColor = Control.DefaultBackColor;
- this.button_colorAdjustmentBS.FlatStyle = FlatStyle.Standard;
- this.button_colorAdjustmentBS.BackColor = Control.DefaultBackColor;
- this.button_colorAdjustmentBS.FlatAppearance.BorderColor = Control.DefaultBackColor;
- //处理直方图
- this.histogramControl_colorSetting.UpdateVerticalBarWithOneScope((int)this.numericUpDown_colorAdjustmentRHU.Value, (int)this.numericUpDown_colorAdjustmentRHD.Value);
- }
- /// <summary>
- /// RGB/HLS的Button的G/L点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button_colorAdjustmentGL_Click(object sender, EventArgs e)
- {
- this.HistogramRGBSelect = 2;
- this.button_colorAdjustmentRH.FlatStyle = FlatStyle.Standard;
- this.button_colorAdjustmentRH.BackColor = Control.DefaultBackColor;
- this.button_colorAdjustmentRH.FlatAppearance.BorderColor = Control.DefaultBackColor;
- this.button_colorAdjustmentGL.FlatStyle = FlatStyle.Flat;
- this.button_colorAdjustmentGL.BackColor = Color.FromArgb(225, 225, 225);
- this.button_colorAdjustmentGL.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215);
- this.button_colorAdjustmentGL.FlatAppearance.BorderSize = 1;
- this.button_colorAdjustmentBS.FlatStyle = FlatStyle.Standard;
- this.button_colorAdjustmentBS.BackColor = Control.DefaultBackColor;
- this.button_colorAdjustmentBS.FlatAppearance.BorderColor = Control.DefaultBackColor;
- //处理直方图
- this.histogramControl_colorSetting.UpdateVerticalBarWithOneScope((int)this.numericUpDown_colorAdjustmentGLU.Value, (int)this.numericUpDown_colorAdjustmentGLD.Value);
- }
- /// <summary>
- /// RGB/HLS的Button的B/S点击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button_colorAdjustmentBS_Click(object sender, EventArgs e)
- {
- this.HistogramRGBSelect = 3;
- this.button_colorAdjustmentRH.FlatStyle = FlatStyle.Standard;
- this.button_colorAdjustmentRH.BackColor = Control.DefaultBackColor;
- this.button_colorAdjustmentRH.FlatAppearance.BorderColor = Control.DefaultBackColor;
- this.button_colorAdjustmentGL.FlatStyle = FlatStyle.Standard;
- this.button_colorAdjustmentGL.BackColor = Control.DefaultBackColor;
- this.button_colorAdjustmentGL.FlatAppearance.BorderColor = Control.DefaultBackColor;
- this.button_colorAdjustmentBS.FlatStyle = FlatStyle.Flat;
- this.button_colorAdjustmentBS.BackColor = Color.FromArgb(225, 225, 225);
- this.button_colorAdjustmentBS.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215);
- this.button_colorAdjustmentBS.FlatAppearance.BorderSize = 1;
- //处理直方图
- this.histogramControl_colorSetting.UpdateVerticalBarWithOneScope((int)this.numericUpDown_colorAdjustmentBSU.Value, (int)this.numericUpDown_colorAdjustmentBSD.Value);
- }
- private void panel_colorGamut_Paint(object sender, PaintEventArgs e)
- {
- Graphics g = e.Graphics;
- Color fColor = Color.FromArgb(Decimal.ToInt32(this.numericUpDown_colorAdjustmentRHU.Value), Decimal.ToInt32(this.numericUpDown_colorAdjustmentGLU.Value), Decimal.ToInt32(this.numericUpDown_colorAdjustmentBSU.Value));
- Color tColor = Color.FromArgb(Decimal.ToInt32(this.numericUpDown_colorAdjustmentRHD.Value), Decimal.ToInt32(this.numericUpDown_colorAdjustmentGLD.Value), Decimal.ToInt32(this.numericUpDown_colorAdjustmentBSD.Value));
- Brush b = new LinearGradientBrush(this.panel_colorGamut.ClientRectangle, fColor, tColor, LinearGradientMode.Horizontal);
- g.FillRectangle(b, this.panel_colorGamut.ClientRectangle);
- if (this.imageMat == null)
- {
- return;
- }
- Mat mat = this.imageMat.Clone();
- Color c = this.panel_colorGamutPhase.BackColor;
- for (int i = 0; i < mat.Height; i++)
- {
- for (int j = 0; j < mat.Width; j++)
- {
- Vec3b vec3b = mat.At<Vec3b>(i, j);
- if (this.numericUpDown_colorAdjustmentRHU.Value <= vec3b.Item2 &&
- this.numericUpDown_colorAdjustmentRHD.Value >= vec3b.Item2 &&
- this.numericUpDown_colorAdjustmentGLU.Value <= vec3b.Item1 &&
- this.numericUpDown_colorAdjustmentGLD.Value >= vec3b.Item1 &&
- this.numericUpDown_colorAdjustmentBSU.Value <= vec3b.Item0 &&
- this.numericUpDown_colorAdjustmentBSD.Value >= vec3b.Item0)
- {
- mat.Set<Vec3b>(i, j, new Vec3b(c.B, c.G, c.R));
- }
- }
- }
- if (this.documentWorkspace.phaseModels.Count > 1 && checkBox_showColorGamutPhase.Checked)
- {
- this.documentWorkspace.phaseModels[this.documentWorkspace.phaseModels.Count - 1].mat = mat;
- }
- this.documentWorkspace.Refresh();
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- chooseK = this.comboBox1.SelectedIndex;
- this.btn_statistics_Click(sender, e);
- }
- private void comboBox_rollingDirection_SelectedIndexChanged(object sender, EventArgs e)
- {
- this.methodOfAssessment.inclusionsStandard.globalSettings.rollingDirection = (InclusionsGlobalSettings.RollingDirection)this.comboBox_rollingDirection.SelectedIndex;
- if (this.lstView_img.FocusedItem != null)
- {
- if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
- {
- everyImgData[this.lstView_img.FocusedItem.Index].directionIndex = this.comboBox_rollingDirection.SelectedIndex;
- }
- else
- {
- CurrentPageData data = new CurrentPageData(this.autoJiaoBen);
- data.directionIndex = comboBox_rollingDirection.SelectedIndex;
- data.ratio = numericUpDown_lwRatioLimit.Value;
- everyImgData.Add(this.lstView_img.FocusedItem.Index, data);
- }
- }
- }
- private void histogramControl_colorSetting_DragOneEvent(object sender, EventArgs<int> e)
- {
- if (this.HistogramRGBSelect == 1)
- {
- this.numericUpDown_colorAdjustmentRHU.Value = e.Data;
- }
- if (this.HistogramRGBSelect == 2)
- {
- this.numericUpDown_colorAdjustmentGLU.Value = e.Data;
- }
- if (this.HistogramRGBSelect == 3)
- {
- this.numericUpDown_colorAdjustmentBSU.Value = e.Data;
- }
- this.panel_colorGamut.Refresh();
- }
- private void histogramControl_colorSetting_DragTwoEvent(object sender, EventArgs<int> e)
- {
- if (!button_colorAdjustmentRH.Focused && !button_colorAdjustmentGL.Focused && !button_colorAdjustmentBS.Focused)
- {
- MessageBox.Show("请选择颜色!");
- return;
- }
- if (this.HistogramRGBSelect == 1)
- {
- this.numericUpDown_colorAdjustmentRHD.Value = e.Data;
- }
- if (this.HistogramRGBSelect == 2)
- {
- this.numericUpDown_colorAdjustmentGLD.Value = e.Data;
- }
- if (this.HistogramRGBSelect == 3)
- {
- this.numericUpDown_colorAdjustmentBSD.Value = e.Data;
- }
- this.panel_colorGamut.Refresh();
- }
- protected void colorSettingRadioButton(object sender, EventArgs e)
- {
- this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions[((RadioButton)sender).Name.Split('_')[1]];
- CalcRGBOrHLSValue();
- UpdateHistogramStartAndEnd();
- if (this.lstView_img.FocusedItem != null)
- {
- if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
- {
- everyImgData[this.lstView_img.FocusedItem.Index].thisSelectedColorOfInclusions = this.selectedColorOfInclusions;
- }
- else
- {
- CurrentPageData data = new CurrentPageData(this.autoJiaoBen);
- data.directionIndex = comboBox_rollingDirection.SelectedIndex;
- data.ratio = numericUpDown_lwRatioLimit.Value;
- data.thisSelectedColorOfInclusions = this.selectedColorOfInclusions;
- everyImgData.Add(this.lstView_img.FocusedItem.Index, data);
- }
- }
- }
- private void btn_drawRecognitionArea_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.InclusionDrawRecognitionArea;
- }
- /// <summary>
- /// 自动阈值
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void checkBox_autoThreshold_CheckedChanged(object sender, EventArgs e)
- {
- bool check = ((CheckBox)sender).Checked;
- this.methodOfAssessment.inclusionsStandard.globalSettings.autoThreshold = check;
- //numericUpDown_threshold.Visible = !check;
- }
- private void documentWorkspace_panel_Click(object sender, EventArgs e)
- {
- System.Windows.Forms.MouseEventArgs me = (System.Windows.Forms.MouseEventArgs)e;
- if (me.Button == MouseButtons.Left)
- {
- if (this.pickColorChecked)
- {
- if (this.imageMat == null)
- {
- return;
- }
- System.Drawing.Point pointscroll = this.documentWorkspace.GetScalePoint(me.Location);
- Mat mat = this.imageMat.Clone();
- Vec3b vec3b = mat.At<Vec3b>(pointscroll.Y, pointscroll.X);
- Color c = Color.FromArgb(vec3b.Item2, vec3b.Item1, vec3b.Item0);
- this.selectedColorOfInclusions.setColor(c);
- CalcRGBOrHLSValue();
- UpdateHistogramStartAndEnd();
- this.pickColorChecked = false;
- this.documentWorkspace.Cursor = Cursors.Default;
- this.button_pickColor.FlatStyle = FlatStyle.Standard;
- this.button_pickColor.BackColor = Control.DefaultBackColor;
- this.button_pickColor.FlatAppearance.BorderColor = Control.DefaultBackColor;
- }
- }
- else
- {
- System.Drawing.Point pointscroll = this.documentWorkspace.GetScalePoint(((System.Windows.Forms.MouseEventArgs)e).Location);
- for (int i = 0; i < this.documentWorkspace.GraphicsList.Count; i++)
- {
- DrawObject drawObject = this.documentWorkspace.GraphicsList[i];
- if (drawObject.drawToolType == DrawToolType.InclusionSelect)
- {
- Inclusion inclusion = ((InclusionDrawObject)drawObject).inclusion;
- if (inclusion.rectProfile.Contains(pointscroll))
- {
- string showText = "";
- if (inclusion.shape == ParticleShape.Globular)
- {
- showText += PdnResources.GetString("Menu.diameter.text") + ":" + inclusion.diameter;
- }
- else
- {
- showText += PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text") + ":" + inclusion.physicalLength;
- showText += "\n宽度:" + inclusion.physicalWidth;
- }
- showText += "\n面积:" + inclusion.area;
- showText += "\n类型:" + inclusion.type.type;
- showText += "\n化学特性:" + inclusion.chemicalCharacteristics;
- this.toolTip_InclusionsDetails.Show(showText, (System.Windows.Forms.Control)sender);
- }
- }
- }
- }
- }
- private void documentWorkspace_panel_MouseDown(object sender, MouseEventArgs e)
- {
- if (this.selectedTypesOfInclusions == null && !this.clearSelect)
- {
- return;
- }
- if (e.Button == MouseButtons.Left)
- {
- this.selectedTypesOfInclusionsPoint = e.Location;
- }
- }
- private void documentWorkspace_panel_MouseMove(object sender, MouseEventArgs e)
- {
- Pen pen = null;
- if (this.selectedTypesOfInclusionsPoint == null)
- {
- return;
- }
- if (this.selectedTypesOfInclusions != null)
- {
- pen = new Pen(Color.FromArgb(this.selectedTypesOfInclusions.showColor), 1);
- }
- else if (this.clearSelect)
- {
- pen = new Pen(Color.Black, 1);
- pen.DashStyle = DashStyle.Dash;
- }
- this.documentWorkspace.Refresh();
- float x = Math.Min(this.selectedTypesOfInclusionsPoint.Value.X, e.Location.X);
- float y = Math.Min(this.selectedTypesOfInclusionsPoint.Value.Y, e.Location.Y);
- float width = Math.Abs(this.selectedTypesOfInclusionsPoint.Value.X - e.Location.X);
- float height = Math.Abs(this.selectedTypesOfInclusionsPoint.Value.Y - e.Location.Y);
- this.documentWorkspace.panel.CreateGraphics().DrawRectangles(pen, new RectangleF[] { new RectangleF(x, y, width, height) });
- }
- private void documentWorkspace_panel_MouseUp(object sender, MouseEventArgs e)
- {
- if (this.selectedTypesOfInclusions == null && !this.clearSelect)
- {
- return;
- }
- if (e.Button == MouseButtons.Left)
- {
- if (this.selectedTypesOfInclusionsPoint == null)
- {
- return;
- }
- var startPoint = this.documentWorkspace.GetScalePoint(this.selectedTypesOfInclusionsPoint.Value);
- var stopPoint = this.documentWorkspace.GetScalePoint(e.Location);
- float x = Math.Min(startPoint.X, stopPoint.X);
- float y = Math.Min(startPoint.Y, stopPoint.Y);
- float width = Math.Abs(startPoint.X - stopPoint.X);
- float height = Math.Abs(startPoint.Y - stopPoint.Y);
- this.selectedTypesOfInclusionsRectangle = new RectangleF(x, y, width, height);
- if (this.selectedTypesOfInclusions != null)
- {
- startStatistics();
- }
- else
- {
- if (this.tempAnalysisResult != null)
- {
- for (int i = this.tempAnalysisResult.inclusions.Count - 1; i >= 0; i--)
- {
- if (this.selectedTypesOfInclusionsRectangle.Value.Contains(this.tempAnalysisResult.inclusions[i].rectProfile)
- || this.selectedTypesOfInclusionsRectangle.Value.IntersectsWith(this.tempAnalysisResult.inclusions[i].rectProfile))
- {
- this.tempAnalysisResult.inclusions.RemoveAt(i);
- }
- }
- ToolInclusionSelect.CleanAndDrawInclusionAll(this.documentWorkspace, this.tempAnalysisResult.inclusions, is_showRectangle, is_showOval, is_full);
- }
- }
- this.clearSelect = false;
- //this.selectedTypesOfInclusions = null;
- this.selectedTypesOfInclusionsPoint = null;
- this.selectedTypesOfInclusionsRectangle = null;
- radioButton1.Enabled = true;
- radioButton2.Enabled = true;
- checkBox1.Enabled = true;
- checkBox2.Enabled = true;
- }
- }
- #endregion
- #region 内部方法
- private void startStatistics()
- {
- if (this.lstView_img.FocusedItem == null || !this.lstView_img.FocusedItem.Selected)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text"));
- return;
- }
- if (this.documentWorkspace.phaseModels[0].mat == null || !this.bcBinaryChecked())
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseperformabinaryoperationfirst.text"));
- return;
- }
- ProgressThreadProcClass procClass = new ProgressThreadProcClass();
- int itemCount = 100;
- ProgressThreadProcClass.IFileTransferProgressEvents progressEvents = new ProgressThreadProcClass.IFileTransferProgressEvents();
- System.Threading.ThreadStart copyThreadProc =
- delegate ()
- {
- try
- {
- if (dict.ContainsKey(this.lstView_img.FocusedItem.Text))
- {
- dict[this.lstView_img.FocusedItem.Text] = this.documentWorkspace.phaseModels;
- }
- else
- {
- dict.Add(this.lstView_img.FocusedItem.Text, this.documentWorkspace.phaseModels);
- }
- Mat mat = this.documentWorkspace.phaseModels[0].mat.Clone();
- List<RectangleF> rectangles = new List<RectangleF>();
- if (this.selectedTypesOfInclusionsRectangle != null)
- {
- // 添加框选范围
- rectangles.Add(this.selectedTypesOfInclusionsRectangle.Value);
- // 删除框选范围内夹杂物
- if (this.tempAnalysisResult != null)
- {
- for (int i = this.tempAnalysisResult.inclusions.Count - 1; i >= 0; i--)
- {
- if (this.selectedTypesOfInclusionsRectangle.Value.Contains(this.tempAnalysisResult.inclusions[i].rectProfile)
- || this.selectedTypesOfInclusionsRectangle.Value.IntersectsWith(this.tempAnalysisResult.inclusions[i].rectProfile))
- {
- this.tempAnalysisResult.inclusions.RemoveAt(i);
- }
- }
- }
- }
- for (int i = 0; i < this.documentWorkspace.GraphicsList.Count; i++)
- {
- if (this.documentWorkspace.GraphicsList[i].drawToolType == DrawToolType.InclusionDrawRecognitionArea)
- {
- DedicatedAnalysisDrawObject drawObject = (DrawRecognitionAreaDrawObject)this.documentWorkspace.GraphicsList[i];
- rectangles.Add(drawObject.Rectangle);
- }
- }
- // 二值图非黑色点涂白
- for (int i = 0; i < mat.Height; i++)
- {
- for (int j = 0; j < mat.Width; j++)
- {
- if (mat.At<int>(i, j) == 0)
- {
- mat.Set<Vec3b>(i, j, new Vec3b(255, 255, 255));
- }
- else
- {
- if (rectangles.Count == 0)
- {
- continue;
- }
- bool contains = false;
- // 二值图过滤未选中区域
- foreach (var item in rectangles)
- {
- if (item.Contains(j, i))
- {
- contains = true;
- }
- }
- if (!contains)
- {
- mat.Set<Vec3b>(i, j, new Vec3b(255, 255, 255));
- }
- }
- }
- }
- // 找出正方形视场
- List<RectangleF> rectangleF = new List<RectangleF>();
- for (int i = 0; i < this.documentWorkspace.GraphicsList.Count; i++)
- {
- if (this.documentWorkspace.GraphicsList[i].drawToolType == DrawToolType.ViewSquare || this.documentWorkspace.GraphicsList[i].drawToolType == DrawToolType.ViewRectangle || this.documentWorkspace.GraphicsList[i].drawToolType == DrawToolType.ViewRectangleEx)
- {
- rectangleF.Add(this.documentWorkspace.GraphicsList[i].Rectangle);
- }
- }
- int k = Convert.ToInt32(this.comboBox1.SelectedItem);
- var rollingDirection = (InclusionsGlobalSettings.RollingDirection)this.comboBox_rollingDirection.SelectedIndex;
- AnalysisResult report;
- if (this.radioButton3.Checked)
- {
- report = this.methodOfAssessment.generateReport(this.imageMat.Clone(), mat, rectangleF, isK, this.viewNum, k, this.is_full, rollingDirection);
- }
- else {
- bool isNew = this.radioButton5.Checked ? true : false;
- report = this.methodOfAssessment.NewGenerateReport(this.imageMat.Clone(), mat, rectangleF, isK, this.viewNum, k, this.is_full, rollingDirection, isNew);
- }
-
- if (this.selectedTypesOfInclusionsRectangle == null)
- {
- this.tempAnalysisResult = report;
- }
- else
- {
- foreach (var item in report.inclusions)
- {
- item.type = this.selectedTypesOfInclusions;
- }
- if (this.tempAnalysisResult == null)
- {
- this.tempAnalysisResult = report;
- }
- else
- {
- this.tempAnalysisResult.inclusions.AddRange(report.inclusions);
- }
- this.tempAnalysisResult.buildResultBody();
- }
- if (userAll)
- {
- if (hasResultIndexList.IndexOf(this.lstView_img.FocusedItem.Index) == -1)
- {
- resultList.Add(this.tempAnalysisResult);
- hasResultIndexList.Add(this.lstView_img.FocusedItem.Index);
- }
- else
- {
- resultList[this.lstView_img.FocusedItem.Index] = this.tempAnalysisResult;
- }
- }
- ToolInclusionSelect.CleanAndDrawInclusionAll(this.documentWorkspace, this.tempAnalysisResult.inclusions, is_showRectangle, is_showOval, is_full);
- }
- catch (Exception ex)
- {
- }
- finally
- {
- progressEvents.EndOperation(OperationResult.Finished);
- }
- };
- procClass.StartProgressAction(this, itemCount, copyThreadProc, progressEvents, null);
- }
- private void Panel_Paint(object sender, PaintEventArgs e)
- {
- if (isK == 2)
- {
- return;
- }
- Rectangle rc = this.documentWorkspace.panel.ClientRectangle;
- int wid = this.documentWorkspace.CompositionSurface == null ? this.documentWorkspace.Width : this.documentWorkspace.CompositionSurface.Width;
- int hei = this.documentWorkspace.CompositionSurface == null ? this.documentWorkspace.Height : this.documentWorkspace.CompositionSurface.Height;
- int width = (int)(wid * this.documentWorkspace.ScaleFactor.Ratio);
- int height = (int)(hei * this.documentWorkspace.ScaleFactor.Ratio);
- int x = (rc.Width < width) ? this.documentWorkspace.panel.AutoScrollPosition.X : (rc.Width - width) / 2;
- int y = (rc.Height < height) ? this.documentWorkspace.panel.AutoScrollPosition.Y : (rc.Height - height) / 2;
- e.Graphics.TranslateTransform(x, y);
- e.Graphics.ScaleTransform((float)this.documentWorkspace.ScaleFactor.Ratio, (float)this.documentWorkspace.ScaleFactor.Ratio);
- if (this.documentWorkspace.GraphicsList.Count > 0)
- {
- Font font = new Font(System.Drawing.SystemFonts.DefaultFont.FontFamily, 40, System.Drawing.SystemFonts.DefaultFont.Style);
- double pxPerUnit = this.imgPxPerUnit;
- int allWidth = (int)(this.imageMat.Width * pxPerUnit);
- int allHeight = (int)(this.imageMat.Height * pxPerUnit);
- if (this.tempAnalysisResult == null)
- {
- this.paintRectangle = this.documentWorkspace.GraphicsList[0].Rectangle;
- }
- int realWidth = (int)(this.paintRectangle.Width * pxPerUnit);
- int realHeight = (int)(this.paintRectangle.Height * pxPerUnit);
- e.Graphics.DrawString($"{realWidth}/{allWidth}", font, new SolidBrush(Color.Blue), this.paintRectangle.Right, this.paintRectangle.Bottom / 2);
- e.Graphics.DrawString($"{realHeight}/{allHeight}", font, new SolidBrush(Color.Blue), this.paintRectangle.Right / 2, this.paintRectangle.Bottom + 10);
- }
- if (this.tempAnalysisResult != null && this.tempAnalysisResult.segmentationView == 2)
- {
- foreach (var s in this.tempAnalysisResult.MedthodKRectangles)
- {
- e.Graphics.DrawRectangle(new Pen(Color.Black, 0.1f), new Rectangle((int)s.X, (int)s.Y, (int)s.Width, (int)s.Height));
- }
- }
- e.Graphics.ScaleTransform(1 / (float)this.documentWorkspace.ScaleFactor.Ratio, 1 / (float)this.documentWorkspace.ScaleFactor.Ratio);
- e.Graphics.TranslateTransform(-x, -y);
- }
- private void buildListBox_analysisResult()
- {
- this.listBox_analysisResult.Items.Clear();
- foreach (var item in analysisResults.Keys)
- {
- this.listBox_analysisResult.Items.Add(new LocalListViewItem(item, item.GetFriendlyName()));
- }
- buildListView_analysisResult();
- }
- private List<ListViewItem> buildAnalysisResults(DocumentWorkspace workspace, AnalysisResult analysisResult)
- {
- List<ListViewItem> listViews = new List<ListViewItem>();
- foreach (var fieldOfView in analysisResult.resultBody.Keys)
- {
- ListViewItem lvi = new ListViewItem();
- lvi.Text = workspace.GetFriendlyName();
- lvi.SubItems.Add(fieldOfView.name);
- foreach (var item in analysisResult.resultBody[fieldOfView])
- {
- try
- {
- int num = 2;
- if (this.domainUpDown_resultPrecision.SelectedIndex != -1)
- {
- num = Convert.ToInt32(this.domainUpDown_resultPrecision.Items[this.domainUpDown_resultPrecision.SelectedIndex]);
- }
- lvi.SubItems.Add(Math.Round(Convert.ToDecimal(item), num).ToString());
- }
- catch (Exception ex)
- {
- lvi.SubItems.Add(item);
- }
- }
- listViews.Add(lvi);
- }
- return listViews;
- }
- #region [二值化相关方法]
- /// <summary>
- /// 添加参数改变的监听
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GrainSizeDialog_Load(object sender, EventArgs e)
- {
- this.binaryClass.loadParams();
- System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
- if (this.initScriptValues && this.appWorkspace.ScriptAutomatic)
- this.startScriptAutomaticAction();
- }
- /// <summary>
- /// 参数改变时,重新处理图像
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bClassBinaryImplFinishAction(object sender, EventArgs e)
- {
- if (!bcOriginChecked())
- {
- if (bcBinaryChecked())
- {
- if (this.isK == 1)
- {
- this.documentWorkspace.ActiveTool = DrawToolType.InclusionSelectRecognitionArea;
- this.documentWorkspace.Cursor = Cursors.Default;
- }
- }
- else
- {
- if (this.isK == 1)
- {
- this.documentWorkspace.ActiveTool = DrawToolType.Pointer;
- }
- }
- }
- else
- {
- if (this.isK == 1)
- {
- this.documentWorkspace.ActiveTool = DrawToolType.Pointer;
- }
- }
- this.documentWorkspace.Refresh();
- }
- private bool bcBinaryChecked()
- {
- return bc != null && bc.BinaryChecked;
- }
- private bool bcOriginChecked()
- {
- return bc != null && bc.OriginChecked;
- }
- /// <summary>
- /// 显示原图/原图+二值图
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bcOriginCheckedChanged(object sender, EventArgs e)
- {
- if (!bcOriginChecked())
- {
- if (bcBinaryChecked())
- {
- this.documentWorkspace.PhaseModels[0].choise = true;
- if (this.isK == 1)
- {
- this.documentWorkspace.ActiveTool = DrawToolType.InclusionSelectRecognitionArea;
- this.documentWorkspace.Cursor = Cursors.Default;
- }
- }
- }
- else
- {
- this.documentWorkspace.PhaseModels[0].choise = false;
- if (this.isK == 1)
- {
- this.documentWorkspace.ActiveTool = DrawToolType.Pointer;
- }
- }
- this.documentWorkspace.Refresh();
- }
- #endregion [二值化相关方法]
- private void buildListView_analysisResult()
- {
- List<AnalysisResult> conclusions = new List<AnalysisResult>();
- this.listView_analysisResult.Columns.Clear();
- this.listView_analysisResult.Items.Clear();
- this.listView_analysisResult2.Columns.Clear();
- this.listView_analysisResult2.Items.Clear();
- if (analysisResults.Count == 0)
- {
- return;
- }
- if (this.listBox_analysisResult.CheckedItems.Count == 0)
- {
- return;
- }
- this.listView_analysisResult.BeginUpdate();
- // 构建头
- foreach (var item in analysisResults.First().Value.getResultHead())
- {
- ColumnHeader header = new ColumnHeader();
- header.Text = item;
- header.Width = 150;
- this.listView_analysisResult.Columns.Add(header);
- }
- foreach (var item in this.listBox_analysisResult.CheckedItems)
- {
- DocumentWorkspace workspace = ((LocalListViewItem)item).Value;
- this.listView_analysisResult.Items.AddRange(buildAnalysisResults(workspace, analysisResults[workspace]).ToArray());
- conclusions.Add(analysisResults[workspace]);
- }
- this.listView_analysisResult.EndUpdate();
- if (this.listView_analysisResult.Items.Count > 0)
- {
- this.listView_analysisResult.Items[0].Selected = true;
- }
- this.listView_analysisResult2.Columns.Clear();
- this.listView_analysisResult2.Items.Clear();
- ListViewItem lvi = new ListViewItem();
- List<string> strings = this.methodOfAssessment.buildResultConclusion(conclusions);
- // 构建头
- foreach (var item in this.methodOfAssessment.getResultConclusionHead())
- {
- ColumnHeader header = new ColumnHeader();
- header.Text = item;
- header.Width = 150;
- this.listView_analysisResult2.Columns.Add(header);
- }
- try
- {
- int num = 2;
- if (this.domainUpDown_resultPrecision.SelectedIndex != -1)
- {
- num = Convert.ToInt32(this.domainUpDown_resultPrecision.Items[this.domainUpDown_resultPrecision.SelectedIndex]);
- }
- lvi.Text = Math.Round(Convert.ToDecimal(strings[0]), num).ToString();
- }
- catch (Exception ex)
- {
- lvi.Text = strings[0];
- }
- for (int i = 1; i < strings.Count; i++)
- {
- try
- {
- int num = 2;
- if (this.domainUpDown_resultPrecision.SelectedIndex != -1)
- {
- num = Convert.ToInt32(this.domainUpDown_resultPrecision.Items[this.domainUpDown_resultPrecision.SelectedIndex]);
- }
- lvi.SubItems.Add(Math.Round(Convert.ToDecimal(strings[i]), num).ToString());
- }
- catch (Exception ex)
- {
- lvi.SubItems.Add(strings[i]);
- }
- }
- this.listView_analysisResult2.Items.Add(lvi);
- this.listView_analysisResult2.EndUpdate();
- }
- private void inclusionEditDialogCloseCallback()
- {
- if (this.tempAnalysisResult.segmentationView != 2)
- {
- ToolInclusionSelect.CleanAndDrawInclusionAll(this.documentWorkspace, this.tempAnalysisResult.inclusions, is_showRectangle, is_showOval, is_full);
- }
- else
- {
- this.documentWorkspace.Refresh();
- }
- }
- private void UpdateHistogramStartAndEnd()
- {
- if (this.HistogramRGBSelect == 1)
- {
- this.histogramControl_colorSetting.UpdateVerticalBarWithOneScope((int)this.numericUpDown_colorAdjustmentRHU.Value, (int)this.numericUpDown_colorAdjustmentRHD.Value);
- }
- if (this.HistogramRGBSelect == 2)
- {
- this.histogramControl_colorSetting.UpdateVerticalBarWithOneScope((int)this.numericUpDown_colorAdjustmentGLU.Value, (int)this.numericUpDown_colorAdjustmentGLD.Value);
- }
- if (this.HistogramRGBSelect == 3)
- {
- this.histogramControl_colorSetting.UpdateVerticalBarWithOneScope((int)this.numericUpDown_colorAdjustmentBSU.Value, (int)this.numericUpDown_colorAdjustmentBSD.Value);
- }
- }
- private void CalcRGBOrHLSValue()
- {
- this.numericUpDown_colorAdjustmentRHU.ValueChanged -= new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentRHD.ValueChanged -= new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentGLU.ValueChanged -= new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentGLD.ValueChanged -= new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentBSU.ValueChanged -= new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentBSD.ValueChanged -= new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentRHU.KeyUp -= new KeyEventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentRHD.KeyUp -= new KeyEventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentGLU.KeyUp -= new KeyEventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentGLD.KeyUp -= new KeyEventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentBSU.KeyUp -= new KeyEventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentBSD.KeyUp -= new KeyEventHandler(this.RGBoRHLSValue_Changed);
- if (this.radioButton_checkedRGB.Checked)
- {
- this.numericUpDown_colorAdjustmentRHU.Value = this.selectedColorOfInclusions.rd;
- this.numericUpDown_colorAdjustmentRHD.Value = this.selectedColorOfInclusions.ru;
- this.numericUpDown_colorAdjustmentGLU.Value = this.selectedColorOfInclusions.gd;
- this.numericUpDown_colorAdjustmentGLD.Value = this.selectedColorOfInclusions.gu;
- this.numericUpDown_colorAdjustmentBSU.Value = this.selectedColorOfInclusions.bd;
- this.numericUpDown_colorAdjustmentBSD.Value = this.selectedColorOfInclusions.bu;
- }
- else
- {
- Vec3b rgbd = new Vec3b();
- Vec3b rgbu = new Vec3b();
- rgbd[2] = Decimal.ToByte(this.numericUpDown_colorAdjustmentRHU.Value);
- rgbu[2] = Decimal.ToByte(this.numericUpDown_colorAdjustmentRHD.Value);
- rgbd[1] = Decimal.ToByte(this.numericUpDown_colorAdjustmentGLU.Value);
- rgbu[1] = Decimal.ToByte(this.numericUpDown_colorAdjustmentGLD.Value);
- rgbd[0] = Decimal.ToByte(this.numericUpDown_colorAdjustmentBSU.Value);
- rgbu[0] = Decimal.ToByte(this.numericUpDown_colorAdjustmentBSD.Value);
- double hd, ld, sd, hu, lu, su;
- BaseTools.RGBtoHLS(rgbd, out hd, out ld, out sd);
- BaseTools.RGBtoHLS(rgbu, out hu, out lu, out su);
- this.numericUpDown_colorAdjustmentRHD.Value = new Decimal(hd);
- this.numericUpDown_colorAdjustmentRHU.Value = new Decimal(hu);
- this.numericUpDown_colorAdjustmentGLD.Value = new Decimal(ld);
- this.numericUpDown_colorAdjustmentGLU.Value = new Decimal(lu);
- this.numericUpDown_colorAdjustmentBSD.Value = new Decimal(sd);
- this.numericUpDown_colorAdjustmentBSU.Value = new Decimal(su);
- }
- this.numericUpDown_colorAdjustmentRHU.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentRHD.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentGLU.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentGLD.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentBSU.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentBSD.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentRHU.KeyUp += new KeyEventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentRHD.KeyUp += new KeyEventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentGLU.KeyUp += new KeyEventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentGLD.KeyUp += new KeyEventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentBSU.KeyUp += new KeyEventHandler(this.RGBoRHLSValue_Changed);
- this.numericUpDown_colorAdjustmentBSD.KeyUp += new KeyEventHandler(this.RGBoRHLSValue_Changed);
- this.panel_colorGamut.Refresh();
- }
- /// <summary>
- /// 修改当前model的rgb或hls
- /// </summary>
- private void SetPhaseModelRGBOrHLS()
- {
- if (this.radioButton_checkedRGB.Checked)
- {
- if (this.selectedColorOfInclusions != null)
- {
- this.selectedColorOfInclusions.rd = Decimal.ToByte(this.numericUpDown_colorAdjustmentRHU.Value);
- this.selectedColorOfInclusions.ru = Decimal.ToByte(this.numericUpDown_colorAdjustmentRHD.Value);
- this.selectedColorOfInclusions.gd = Decimal.ToByte(this.numericUpDown_colorAdjustmentGLU.Value);
- this.selectedColorOfInclusions.gu = Decimal.ToByte(this.numericUpDown_colorAdjustmentGLD.Value);
- this.selectedColorOfInclusions.bd = Decimal.ToByte(this.numericUpDown_colorAdjustmentBSU.Value);
- this.selectedColorOfInclusions.bu = Decimal.ToByte(this.numericUpDown_colorAdjustmentBSD.Value);
- }
- }
- else
- {
- Vec3b rgbd = BaseTools.HLStoRGB(Decimal.ToDouble(this.numericUpDown_colorAdjustmentRHU.Value), Decimal.ToDouble(this.numericUpDown_colorAdjustmentGLU.Value), Decimal.ToDouble(this.numericUpDown_colorAdjustmentBSU.Value));
- Vec3b rgbu = BaseTools.HLStoRGB(Decimal.ToDouble(this.numericUpDown_colorAdjustmentRHD.Value), Decimal.ToDouble(this.numericUpDown_colorAdjustmentGLD.Value), Decimal.ToDouble(this.numericUpDown_colorAdjustmentBSD.Value));
- this.selectedColorOfInclusions.rd = rgbd[2];
- this.selectedColorOfInclusions.ru = rgbu[2];
- this.selectedColorOfInclusions.gd = rgbd[1];
- this.selectedColorOfInclusions.gu = rgbu[1];
- this.selectedColorOfInclusions.bd = rgbd[0];
- this.selectedColorOfInclusions.bu = rgbu[0];
- }
- if (this.lstView_img.FocusedItem != null)
- {
- if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
- {
- everyImgData[this.lstView_img.FocusedItem.Index].thisSelectedColorOfInclusions = this.selectedColorOfInclusions;
- }
- else
- {
- CurrentPageData data = new CurrentPageData(this.autoJiaoBen);
- data.directionIndex = comboBox_rollingDirection.SelectedIndex;
- data.ratio = numericUpDown_lwRatioLimit.Value;
- data.thisSelectedColorOfInclusions = this.selectedColorOfInclusions;
- everyImgData.Add(this.lstView_img.FocusedItem.Index, data);
- }
- }
- }
- private void button_pickColor_Click(object sender, EventArgs e)
- {
- //this.checkBox_showBinary.Checked = false;
- this.documentWorkspace.Cursor = new Cursor(PdnResources.GetResourceStream("Cursors.ColorPickerToolCursor.cur"));
- this.pickColorChecked = true;
- this.button_pickColor.FlatStyle = FlatStyle.Flat;
- this.button_pickColor.BackColor = Color.FromArgb(225, 225, 225);
- this.button_pickColor.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215);
- this.button_pickColor.FlatAppearance.BorderSize = 1;
- }
- private void button_generateReport_Click(object sender, EventArgs e)
- {
- if (this.listView_analysisResult.Items.Count == 0)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Noresults.text"));
- return;
- }
- if (this.checkBox_generateReport_opensetting.Checked)
- {
- AnalyzeSettingDialog recombinationRateSetDialog = new AnalyzeSettingDialog(this, this.methodOfAssessment.resourcesName);
- 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<List<string>>> sheets = new List<List<List<string>>>();
- sheets.Add(new List<List<string>>());
- List<List<string>> contentList = new List<List<string>>();
- List<string> contentHead = new List<string>();
- contentList.Add(contentHead);
- foreach (ColumnHeader c in this.listView_analysisResult2.Columns)
- {
- contentHead.Add(c.Text);
- }
- for (int r = 0; r < this.listView_analysisResult2.Items.Count; r++)
- {
- List<string> contentBody = new List<string>();
- for (int c = 0; c < this.listView_analysisResult2.Items[r].SubItems.Count; c++)
- {
- contentBody.Add(this.listView_analysisResult2.Items[r].SubItems[c].Text);
- }
- contentList.Add(contentBody);
- }
- contentList.Add(new List<string>());
- contentHead = new List<string>();
- contentList.Add(contentHead);
- foreach (ColumnHeader c in this.listView_analysisResult.Columns)
- {
- contentHead.Add(c.Text);
- }
- for (int r = 0; r < this.listView_analysisResult.Items.Count; r++)
- {
- List<string> contentBody = new List<string>();
- for (int c = 0; c < this.listView_analysisResult.Items[r].SubItems.Count; c++)
- {
- contentBody.Add(this.listView_analysisResult.Items[r].SubItems[c].Text);
- }
- contentList.Add(contentBody);
- }
- sheets.Add(contentList);
- List<List<string>> inclusionList = new List<List<string>>();
- List<string> inclusionHead = new List<string>();
- inclusionList.Add(inclusionHead);
- inclusionHead.Add("pixelLength");
- inclusionHead.Add("pixelWidth");
- inclusionHead.Add("physicalLength");
- inclusionHead.Add("physicalWidth");
- inclusionHead.Add("lwRatio");
- inclusionHead.Add("arrangement");
- inclusionHead.Add("shape");
- inclusionHead.Add("shapeFactor");
- inclusionHead.Add("area");
- inclusionHead.Add("diameter");
- inclusionHead.Add("type");
- inclusionHead.Add("color");
- inclusionHead.Add("chemicalCharacteristics");
- inclusionHead.Add("X-Position");
- inclusionHead.Add("Y-Position");
- if (this.isK == 1)
- {
- inclusionHead.Add("fieldNumber");
- inclusionHead.Add("fieldLeftLimit");
- inclusionHead.Add("fieldRightLimit");
- inclusionHead.Add("fieldTopLimit");
- inclusionHead.Add("fieldBottomLimit");
- inclusionHead.Add("rating");
- }
- foreach (var analysisResult in this.analysisResults.Values)
- {
- foreach (var inclusion in analysisResult.inclusions)
- {
- List<string> inclusionBody = new List<string>();
- inclusionList.Add(inclusionBody);
- inclusionBody.Add(inclusion.pixelLength + "");
- inclusionBody.Add(inclusion.pixelWidth + "");
- inclusionBody.Add(inclusion.physicalLength + "");
- inclusionBody.Add(inclusion.physicalWidth + "");
- inclusionBody.Add(inclusion.lwRatio + "");
- inclusionBody.Add(inclusion.arrangement + "");
- inclusionBody.Add(inclusion.shape + "");
- inclusionBody.Add(inclusion.shapeFactor + "");
- inclusionBody.Add(inclusion.area + "");
- inclusionBody.Add(inclusion.diameter + "");
- inclusionBody.Add(inclusion.type.type + "");
- inclusionBody.Add(inclusion.color == null ? "" : inclusion.color.colorName + "");
- inclusionBody.Add(inclusion.chemicalCharacteristics + "");
- inclusionBody.Add(inclusion.rectProfile.X + "");
- inclusionBody.Add(inclusion.rectProfile.Y + "");
- if (this.isK == 1)
- {
- inclusionBody.Add(inclusion.viewNum + "");
- inclusionBody.Add(inclusion.viewLeft + "");
- inclusionBody.Add(inclusion.viewRight + "");
- inclusionBody.Add(inclusion.viewTop + "");
- inclusionBody.Add(inclusion.viewBottom + "");
- inclusionBody.Add(inclusion.rating + "");
- }
- }
- }
- sheets.Add(inclusionList);
- List<Bitmap> bitList = new List<Bitmap>();
- foreach (var item in this.listBox_analysisResult.CheckedItems)
- {
- DocumentWorkspace workspace = ((LocalListViewItem)item).Value;
- double pantographRatio = workspace.GetRulerMultiple(MeasurementUnit.Micron);
- Bitmap originalBit = workspace.CompositionSurface.CreateAliasedBitmap();
- originalBit.Tag = pantographRatio;
- Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- newBit.Tag = pantographRatio;
- Graphics graphics = Graphics.FromImage(newBit);
- foreach (var phase in dict[((LocalListViewItem)item).Display])
- {
- if (phase.mat == null)
- {
- continue;
- }
- Bitmap processedBit = BitmapConverter.ToBitmap(phase.mat);
- graphics.DrawImage(processedBit, new PointF(0, 0));
- }
- foreach (var inclusion in analysisResults[workspace].inclusions)
- {
- new InclusionDrawObject(workspace, inclusion, this.is_full).Draw(graphics);
- }
- bitList.Add(originalBit);
- bitList.Add(newBit);
- }
- try
- {
- //OfficeFileHandleHelper.CreateAnalysisReportInclusion(this.analyzeSettingModel, sheets, bitList, tagInfos);
- this.appWorkspace.CreateAnalysisReportInclusion(this.analyzeSettingModel, sheets, bitList, tagInfos);
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- else
- MessageBox.Show(PdnResources.GetString("Menu.Pleasesettheanalysisreportfirst.text") + "!");
- }
- private void button_exportResults_Click(object sender, EventArgs e)
- {
- if (this.listView_analysisResult.Items.Count == 0)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Noresults.text"));
- return;
- }
- SaveFileDialog exe = new SaveFileDialog();
- exe.Filter = "Execl files (*.xlsx)|*.xlsx";
- exe.FilterIndex = 0;
- exe.RestoreDirectory = true;
- //exe.CreatePrompt = true;
- exe.Title = "Export Excel File";
- exe.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
- exe.FileName = DateTime.Now.ToString("yyyyMMddhhmmss") + this.methodOfAssessment.resourcesName;
- DialogResult dr = exe.ShowDialog();
- if (dr != DialogResult.OK)
- {
- return;
- }
- List<DataTable> list = new List<DataTable>();
- DataTable dtb = new DataTable();
- foreach (ColumnHeader c in this.listView_analysisResult.Columns)
- {
- dtb.Columns.Add(c.Text);
- }
- for (int r = 0; r < this.listView_analysisResult.Items.Count; r++)
- {
- DataRow dataRow = dtb.NewRow();
- for (int c = 0; c < this.listView_analysisResult.Items[r].SubItems.Count; c++)
- {
- dataRow[c] = this.listView_analysisResult.Items[r].SubItems[c].Text;
- }
- dtb.Rows.Add(dataRow);
- }
- DataTable dtb1 = new DataTable();
- foreach (ColumnHeader c in this.listView_analysisResult2.Columns)
- {
- dtb1.Columns.Add(c.Text);
- }
- for (int r = 0; r < this.listView_analysisResult2.Items.Count; r++)
- {
- DataRow dataRow = dtb1.NewRow();
- for (int c = 0; c < this.listView_analysisResult2.Items[r].SubItems.Count; c++)
- {
- dataRow[c] = this.listView_analysisResult2.Items[r].SubItems[c].Text;
- }
- dtb1.Rows.Add(dataRow);
- }
- DataTable dtb2 = new DataTable();
- dtb2.Columns.Add("pixelLength");
- dtb2.Columns.Add("pixelWidth");
- dtb2.Columns.Add("physicalLength");
- dtb2.Columns.Add("physicalWidth");
- dtb2.Columns.Add("lwRatio");
- dtb2.Columns.Add("arrangement");
- dtb2.Columns.Add("shape");
- dtb2.Columns.Add("shapeFactor");
- dtb2.Columns.Add("area");
- dtb2.Columns.Add("diameter");
- dtb2.Columns.Add("type");
- dtb2.Columns.Add("color");
- dtb2.Columns.Add("chemicalCharacteristics");
- dtb2.Columns.Add("X-Position");
- dtb2.Columns.Add("Y-Position");
- if (this.isK == 1)
- {
- dtb2.Columns.Add("rating");
- }
- foreach (var analysisResult in this.analysisResults.Values)
- {
- foreach (var inclusion in analysisResult.inclusions)
- {
- DataRow dataRow = dtb2.NewRow();
- dataRow[0] = (inclusion.pixelLength + "");
- dataRow[1] = (inclusion.pixelWidth + "");
- dataRow[2] = (inclusion.physicalLength + "");
- dataRow[3] = (inclusion.physicalWidth + "");
- dataRow[4] = (inclusion.lwRatio + "");
- dataRow[5] = (inclusion.arrangement + "");
- dataRow[6] = (inclusion.shape + "");
- dataRow[7] = (inclusion.shapeFactor + "");
- dataRow[8] = (inclusion.area + "");
- dataRow[9] = (inclusion.diameter + "");
- dataRow[10] = (inclusion.type.type + "");
- dataRow[11] = (inclusion.color == null ? "" : inclusion.color.colorName + "");
- dataRow[12] = (inclusion.chemicalCharacteristics + "");
- dataRow[13] = (inclusion.rectProfile.X + "");
- dataRow[14] = (inclusion.rectProfile.Y + "");
- if (this.isK == 1)
- {
- dataRow[15] = (inclusion.rating + "");
- dataRow[8] = (inclusion.areaK + "");
- }
- dtb2.Rows.Add(dataRow);
- }
- }
- dtb.TableName = "Sheet1";
- dtb1.TableName = "Sheet2";
- dtb2.TableName = "Sheet3";
- list.Add(dtb);
- list.Add(dtb1);
- list.Add(dtb2);
- try
- {
- this.appWorkspace.ExportDataToExcelWithProgress(list, exe.FileName, true, true, true);
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
- }
- #endregion
- #region 需继承方法
- protected virtual void SubclassInitialize()
- {
- throw new NotImplementedException();
- }
- protected virtual MethodOfAssessment getMethodOfAssessment()
- {
- throw new NotImplementedException();
- }
- protected virtual void initColorSetting()
- {
- throw new NotImplementedException();
- }
- protected virtual void initDisplaySetting()
- {
- throw new NotImplementedException();
- }
- protected virtual void getInclusionParameters()
- {
- }
- protected virtual void saveInclusionParameters()
- {
- }
- protected virtual void getOldCheck()
- {
- }
- #endregion
- #region 内部类
- internal class CurrentPageData
- {
- public CurrentPageData(int isYuanshi)
- {
- if (isYuanshi == -1)
- {
- kNum = 4;
- }
- else
- {
- kNum = isYuanshi;
- }
- }
- public int directionIndex { get; set; }
- public decimal ratio { get; set; }
- public ColorOfInclusions thisSelectedColorOfInclusions { get; set; }
- public bool colorCheck { get; set; }
- public int kNum { get; set; }
- }
- internal class LocalListViewItem
- {
- public DocumentWorkspace Value { get; }
- public string Display { get; }
- public LocalListViewItem(DocumentWorkspace Value, string Display)
- {
- this.Value = Value;
- this.Display = Display;
- }
- }
- internal class DocumentItem
- {
- public Mat imageMat;
- public GraphicsList graphicsList;
- public List<PhaseModel> phaseModels;
- public AnalysisResult analysisResult;
- public DocumentItem(Mat imageMat, GraphicsList graphicsList, List<PhaseModel> phaseModels)
- {
- this.imageMat = imageMat;
- this.graphicsList = graphicsList;
- this.phaseModels = phaseModels;
- }
- }
- #endregion
- private void domainUpDown_resultPrecision_SelectedItemChanged(object sender, EventArgs e)
- {
- buildListView_analysisResult();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (this.listView_analysisResult.Items.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.DedicatedAnalysis.BlackMetal.Inclusion.Text", this.analyzeSettingModel.savePath);
- if (item != 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>> contentList = new List<List<string>>();
- List<string> contentHead = new List<string>();
- contentList.Add(contentHead);
- foreach (ColumnHeader c in this.listView_analysisResult2.Columns)
- {
- contentHead.Add(c.Text);
- }
- for (int r = 0; r < this.listView_analysisResult2.Items.Count; r++)
- {
- List<string> contentBody = new List<string>();
- for (int c = 0; c < this.listView_analysisResult2.Items[r].SubItems.Count; c++)
- {
- contentBody.Add(this.listView_analysisResult2.Items[r].SubItems[c].Text);
- }
- contentList.Add(contentBody);
- }
- contentList.Add(new List<string>());
- contentHead = new List<string>();
- contentList.Add(contentHead);
- foreach (ColumnHeader c in this.listView_analysisResult.Columns)
- {
- contentHead.Add(c.Text);
- }
- for (int r = 0; r < this.listView_analysisResult.Items.Count; r++)
- {
- List<string> contentBody = new List<string>();
- for (int c = 0; c < this.listView_analysisResult.Items[r].SubItems.Count; c++)
- {
- contentBody.Add(this.listView_analysisResult.Items[r].SubItems[c].Text);
- }
- contentList.Add(contentBody);
- }
- List<Bitmap> bitList = new List<Bitmap>();
- List<ExportProjectModel> exportModel = new List<ExportProjectModel>();
- foreach (var itemIt in this.listBox_analysisResult.CheckedItems)
- {
- List<List<string>> inclusionList = new List<List<string>>();
- List<string> inclusionHead = new List<string>();
- inclusionList.Add(inclusionHead);
- inclusionHead.Add("pixelLength");
- inclusionHead.Add("pixelWidth");
- inclusionHead.Add("physicalLength");
- inclusionHead.Add("physicalWidth");
- inclusionHead.Add("lwRatio");
- inclusionHead.Add("arrangement");
- inclusionHead.Add("shape");
- inclusionHead.Add("shapeFactor");
- inclusionHead.Add("area");
- inclusionHead.Add("diameter");
- inclusionHead.Add("type");
- inclusionHead.Add("color");
- inclusionHead.Add("chemicalCharacteristics");
- inclusionHead.Add("X-Position");
- inclusionHead.Add("Y-Position");
- if (this.isK == 1)
- {
- inclusionHead.Add("fieldNumber");
- inclusionHead.Add("fieldLeftLimit");
- inclusionHead.Add("fieldRightLimit");
- inclusionHead.Add("fieldTopLimit");
- inclusionHead.Add("fieldBottomLimit");
- inclusionHead.Add("rating");
- }
- DocumentWorkspace workspace = ((LocalListViewItem)itemIt).Value;
- double pantographRatio = workspace.GetRulerMultiple(MeasurementUnit.Micron);
- Bitmap originalBit = workspace.CompositionSurface.CreateAliasedBitmap();
- originalBit.Tag = pantographRatio;
- Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- newBit.Tag = pantographRatio;
- Graphics graphics = Graphics.FromImage(newBit);
- foreach (var phase in dict[((LocalListViewItem)itemIt).Display])
- {
- if (phase.mat == null)
- {
- continue;
- }
- Bitmap processedBit = BitmapConverter.ToBitmap(phase.mat);
- graphics.DrawImage(processedBit, new PointF(0, 0));
- }
- foreach (var inclusion in analysisResults[workspace].inclusions)
- {
- List<string> inclusionBody = new List<string>();
- inclusionBody.Add(inclusion.pixelLength + "");
- inclusionBody.Add(inclusion.pixelWidth + "");
- inclusionBody.Add(inclusion.physicalLength + "");
- inclusionBody.Add(inclusion.physicalWidth + "");
- inclusionBody.Add(inclusion.lwRatio + "");
- inclusionBody.Add(inclusion.arrangement + "");
- inclusionBody.Add(inclusion.shape + "");
- inclusionBody.Add(inclusion.shapeFactor + "");
- if (this.isK == 1)
- {
- inclusionBody.Add(inclusion.areaK + "");
- }
- else
- {
- inclusionBody.Add(inclusion.area + "");
- }
- inclusionBody.Add(inclusion.diameter + "");
- inclusionBody.Add(inclusion.type.type + "");
- inclusionBody.Add(inclusion.color == null ? "" : inclusion.color.colorName + "");
- inclusionBody.Add(inclusion.chemicalCharacteristics + "");
- inclusionBody.Add(inclusion.rectProfile.X + "");
- inclusionBody.Add(inclusion.rectProfile.Y + "");
- if (this.isK == 1)
- {
- inclusionBody.Add(inclusion.viewNum + "");
- inclusionBody.Add(inclusion.viewLeft + "");
- inclusionBody.Add(inclusion.viewRight + "");
- inclusionBody.Add(inclusion.viewTop + "");
- inclusionBody.Add(inclusion.viewBottom + "");
- inclusionBody.Add(inclusion.rating + "");
- }
- inclusionList.Add(inclusionBody);
- new InclusionDrawObject(workspace, inclusion, this.is_full).Draw(graphics);
- }
- ExportProjectModel exportProjectModel = new ExportProjectModel();
- exportProjectModel.dataList = inclusionList;
- exportProjectModel.picName = ((LocalListViewItem)itemIt).Display;
- exportProjectModel.tagName = PdnResources.GetString("Menu.DedicatedAnalysis.BlackMetal.Inclusion.Text");
- exportModel.Add(exportProjectModel);
- bitList.Add(originalBit);
- bitList.Add(newBit);
- }
- try
- {
- this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, contentList, exportModel, bitList, 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);
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- new InclusionViewSetting(this.viewNum, this.inclusionViewSettingCloseCallback).ShowDialog();
- }
- private void inclusionViewSettingCloseCallback(int num)
- {
- this.viewNum = num;
- }
- private void checkBox2_CheckedChanged(object sender, EventArgs e)
- {
- if (this.firstShow)
- {
- return;
- }
- if (this.tempAnalysisResult == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttostartstatistics.text"));
- return;
- }
- is_showRectangle = !is_showRectangle;
- ToolInclusionSelect.CleanAndDrawInclusionAll(this.documentWorkspace, this.tempAnalysisResult.inclusions, is_showRectangle, is_showOval, is_full);
- this.documentWorkspace.Refresh();
- }
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- if (this.firstShow)
- {
- return;
- }
- if (this.tempAnalysisResult == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttostartstatistics.text"));
- return;
- }
- is_showOval = !is_showOval;
- ToolInclusionSelect.CleanAndDrawInclusionAll(this.documentWorkspace, this.tempAnalysisResult.inclusions, is_showRectangle, is_showOval, is_full);
- }
- private void radioButton1_CheckedChanged(object sender, EventArgs e)
- {
- if (this.firstShow)
- {
- return;
- }
- if (this.tempAnalysisResult == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttostartstatistics.text"));
- return;
- }
- if (radioButton1.Checked)
- {
- this.is_full = 2;
- }
- else
- {
- this.is_full = 1;
- }
- if (this.tempAnalysisResult.segmentationView != 2)
- {
- ToolInclusionSelect.CleanAndDrawInclusionAll(this.documentWorkspace, this.tempAnalysisResult.inclusions, is_showRectangle, is_showOval, is_full);
- }
- else
- {
- this.documentWorkspace.Refresh();
- }
- }
- private void InclusionsStandardDialog_FormClosing(object sender, FormClosingEventArgs e)
- {
- binaryClass.saveParams();
- }
- private void ShownChoiseItemAndInitData(object sender, EventArgs e)
- {
- }
- private void getLastData()
- {
- string filePath = Application.StartupPath + "\\Config\\Default\\ParameterSaving\\ParameterInclusionsModel.xml";
- var text = this.dialogText;
- if (!System.IO.File.Exists(filePath))
- {
- inclusionsModel.InclusionParameters = new List<InclusionsModel.InclusionParameter>();
- string[] textList = new string[] { "GBT10561_MethodA", "GBT10561_MethodB", "EN10247_MethodP", "EN10247_MethodM", "EN10247_MethodK", "ISO4967_MethodA",
- "ISO4967_MethodB","JISG0555_MethodA","JISG0555_MethodB","DIN50602_1985_MethodM","DIN50602_1985_MethodK","ASTME45_MethodA","ASTME45_MethodB",
- "ASTME45_MethodC","ASTME45_MethodD","ASTME45_MethodE"};
- for (int i = 0; i < textList.Count(); i++)
- {
- var inclusionParameters = new InclusionsModel.InclusionParameter();
- inclusionParameters.hasUsed = false;
- inclusionParameters.name = textList[i];
- inclusionsModel.InclusionParameters.Add(inclusionParameters);
- }
- this.thisParametersIndex = textList.ToList().IndexOf(text);
- this.thisParameters = inclusionsModel.InclusionParameters[this.thisParametersIndex];
- string porosityInfoXml = XmlSerializeHelper.XmlSerialize<InclusionsModel>(inclusionsModel);
- Directory.CreateDirectory(Application.StartupPath + "\\Config\\Default\\ParameterSaving\\");
- FileOperationHelper.WriteStringToFile(porosityInfoXml, filePath, FileMode.CreateNew);
- }
- else
- {
- inclusionsModel = XmlSerializeHelper.DESerializer<InclusionsModel>(FileOperationHelper.ReadStringFromFile(filePath, FileMode.Open));
- if (inclusionsModel.InclusionParameters == null)
- {
- inclusionsModel.InclusionParameters = new List<InclusionsModel.InclusionParameter>();
- }
- thisParameters = inclusionsModel.InclusionParameters.Where(m => m.name.Equals(text)).FirstOrDefault();
- if (thisParameters == null)
- {
- thisParameters = new InclusionsModel.InclusionParameter();
- thisParameters.hasUsed = false;
- thisParameters.name = text;
- inclusionsModel.InclusionParameters.Add(thisParameters);
- this.thisParametersIndex = inclusionsModel.InclusionParameters.Count() - 1;
- string porosityInfoXml = XmlSerializeHelper.XmlSerialize<InclusionsModel>(inclusionsModel);
- Directory.CreateDirectory(Application.StartupPath + "\\Config\\Default\\ParameterSaving\\");
- FileOperationHelper.WriteStringToFile(porosityInfoXml, filePath, FileMode.CreateNew);
- }
- else
- {
- this.thisParametersIndex = inclusionsModel.InclusionParameters.IndexOf(thisParameters);
- if (thisParameters.hasUsed)
- {
- if (thisParameters.parameter1 >= 0)
- {
- comboBox_rollingDirection.SelectedIndex = thisParameters.parameter1;
- }
- if (thisParameters.parameter2 >= numericUpDown_lwRatioLimit.Minimum)
- {
- numericUpDown_lwRatioLimit.Value = thisParameters.parameter2;
- }
- if (thisParameters.parameter14 >= 0)
- {
- comboBox1.SelectedIndex = thisParameters.parameter14;
- }
- checkBox_showColorGamutPhase.Checked = thisParameters.parameter5;
- domainUpDown_resultPrecision.SelectedIndex = thisParameters.parameter13;
- this.viewNum = thisParameters.parameter16;
- checkBox_generateReport_opensetting.Checked = thisParameters.parameter17;
- radioButton1.Checked = thisParameters.parameter18 == 0 ? true : false;
- radioButton2.Checked = thisParameters.parameter18 == 0 ? false : true;
- if (radioButton1.Checked)
- {
- this.is_full = 2;
- }
- else
- {
- this.is_full = 1;
- }
- checkBox2.Checked = thisParameters.parameter19;
- is_showRectangle = thisParameters.parameter19;
- checkBox1.Checked = thisParameters.parameter20;
- is_showOval = thisParameters.parameter20;
- if (thisParameters.parameter3 > 0)
- {
- this.whichChecked = thisParameters.parameter3;
- getInclusionParameters();
- switch (thisParameters.parameter3)
- {
- case 1:
- if (thisParameters.parameter15 != null && thisParameters.parameter15.Count > 0)
- {
- this.numericUpDown_colorAdjustmentRHU.Value = thisParameters.parameter15[0].parameter7;
- this.numericUpDown_colorAdjustmentRHD.Value = thisParameters.parameter15[0].parameter8;
- this.numericUpDown_colorAdjustmentGLU.Value = thisParameters.parameter15[0].parameter9;
- this.numericUpDown_colorAdjustmentGLD.Value = thisParameters.parameter15[0].parameter10;
- this.numericUpDown_colorAdjustmentBSU.Value = thisParameters.parameter15[0].parameter11;
- this.numericUpDown_colorAdjustmentBSD.Value = thisParameters.parameter15[0].parameter12;
- }
- break;
- case 2:
- if (thisParameters.parameter15 != null && thisParameters.parameter15.Count > 1)
- {
- this.numericUpDown_colorAdjustmentRHU.Value = thisParameters.parameter15[1].parameter7;
- this.numericUpDown_colorAdjustmentRHD.Value = thisParameters.parameter15[1].parameter8;
- this.numericUpDown_colorAdjustmentGLU.Value = thisParameters.parameter15[1].parameter9;
- this.numericUpDown_colorAdjustmentGLD.Value = thisParameters.parameter15[1].parameter10;
- this.numericUpDown_colorAdjustmentBSU.Value = thisParameters.parameter15[1].parameter11;
- this.numericUpDown_colorAdjustmentBSD.Value = thisParameters.parameter15[1].parameter12;
- }
- break;
- case 3:
- if (thisParameters.parameter15 != null && thisParameters.parameter15.Count > 2)
- {
- this.numericUpDown_colorAdjustmentRHU.Value = thisParameters.parameter15[2].parameter7;
- this.numericUpDown_colorAdjustmentRHD.Value = thisParameters.parameter15[2].parameter8;
- this.numericUpDown_colorAdjustmentGLU.Value = thisParameters.parameter15[2].parameter9;
- this.numericUpDown_colorAdjustmentGLD.Value = thisParameters.parameter15[2].parameter10;
- this.numericUpDown_colorAdjustmentBSU.Value = thisParameters.parameter15[2].parameter11;
- this.numericUpDown_colorAdjustmentBSD.Value = thisParameters.parameter15[2].parameter12;
- }
- break;
- case 4:
- if (thisParameters.parameter15 != null && thisParameters.parameter15.Count > 3)
- {
- this.numericUpDown_colorAdjustmentRHU.Value = thisParameters.parameter15[3].parameter7;
- this.numericUpDown_colorAdjustmentRHD.Value = thisParameters.parameter15[3].parameter8;
- this.numericUpDown_colorAdjustmentGLU.Value = thisParameters.parameter15[3].parameter9;
- this.numericUpDown_colorAdjustmentGLD.Value = thisParameters.parameter15[3].parameter10;
- this.numericUpDown_colorAdjustmentBSU.Value = thisParameters.parameter15[3].parameter11;
- this.numericUpDown_colorAdjustmentBSD.Value = thisParameters.parameter15[3].parameter12;
- }
- break;
- }
- button_colorAdjustmentRH.Focus();
- CalcRGBOrHLSValue();
- UpdateHistogramStartAndEnd();
- }
- }
- }
- }
- if (this.selectedColorOfInclusions != null)
- {
- ColorOfInclusions colorOfInclusions = new ColorOfInclusions(this.selectedColorOfInclusions.colorName, this.selectedColorOfInclusions.ofTypes, this.selectedColorOfInclusions.ru, this.selectedColorOfInclusions.rd, this.selectedColorOfInclusions.gu, this.selectedColorOfInclusions.gd, this.selectedColorOfInclusions.bu, this.selectedColorOfInclusions.bd);
- this.oldSelectedColorOfInclusions = colorOfInclusions;
- }
- }
- private void saveLastData(object sender, EventArgs e)
- {
- if (this.thisParametersIndex == -1)
- {
- return;
- }
- binaryClass.saveParams();
- this.thisParameters.hasUsed = true;
- if (comboBox_rollingDirection.SelectedIndex >= 0)
- {
- thisParameters.parameter1 = comboBox_rollingDirection.SelectedIndex;
- }
- comboBox_rollingDirection.SelectedIndex = thisParameters.parameter1;
- thisParameters.parameter2 = numericUpDown_lwRatioLimit.Value;
- if (comboBox1.SelectedIndex >= 0)
- {
- thisParameters.parameter14 = comboBox1.SelectedIndex;
- }
- thisParameters.parameter5 = checkBox_showColorGamutPhase.Checked;
- this.thisParameters.parameter13 = domainUpDown_resultPrecision.SelectedIndex;
- this.thisParameters.parameter16 = this.viewNum;
- thisParameters.parameter17 = checkBox_generateReport_opensetting.Checked;
- if (radioButton1.Checked)
- {
- thisParameters.parameter18 = 0;
- }
- else if (radioButton2.Checked)
- {
- thisParameters.parameter18 = 1;
- }
- thisParameters.parameter19 = checkBox2.Checked;
- thisParameters.parameter20 = checkBox1.Checked;
- saveInclusionParameters();
- this.thisParameters.parameter15 = new List<InclusionsModel.InclusionParameter.rgbNum>();
- for (int i = 0; i <= 3; i++)
- {
- var num = new InclusionsModel.InclusionParameter.rgbNum();
- num.parameter7 = 0;
- num.parameter8 = 0;
- num.parameter9 = 0;
- num.parameter10 = 0;
- num.parameter11 = 0;
- num.parameter12 = 0;
- this.thisParameters.parameter15.Add(num);
- }
- foreach (var item in MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions)
- {
- switch (item.Key)
- {
- case "Black":
- this.thisParameters.parameter15[0].parameter7 = item.Value.rd;
- this.thisParameters.parameter15[0].parameter8 = item.Value.ru;
- this.thisParameters.parameter15[0].parameter9 = item.Value.gd;
- this.thisParameters.parameter15[0].parameter10 = item.Value.gu;
- this.thisParameters.parameter15[0].parameter11 = item.Value.bd;
- this.thisParameters.parameter15[0].parameter12 = item.Value.bu;
- break;
- case "LightBlue":
- this.thisParameters.parameter15[1].parameter7 = item.Value.rd;
- this.thisParameters.parameter15[1].parameter8 = item.Value.ru;
- this.thisParameters.parameter15[1].parameter9 = item.Value.gd;
- this.thisParameters.parameter15[1].parameter10 = item.Value.gu;
- this.thisParameters.parameter15[1].parameter11 = item.Value.bd;
- this.thisParameters.parameter15[1].parameter12 = item.Value.bu;
- break;
- case "Colored":
- this.thisParameters.parameter15[1].parameter7 = item.Value.rd;
- this.thisParameters.parameter15[1].parameter8 = item.Value.ru;
- this.thisParameters.parameter15[1].parameter9 = item.Value.gd;
- this.thisParameters.parameter15[1].parameter10 = item.Value.gu;
- this.thisParameters.parameter15[1].parameter11 = item.Value.bd;
- this.thisParameters.parameter15[1].parameter12 = item.Value.bu;
- break;
- case "Gray":
- this.thisParameters.parameter15[2].parameter7 = item.Value.rd;
- this.thisParameters.parameter15[2].parameter8 = item.Value.ru;
- this.thisParameters.parameter15[2].parameter9 = item.Value.gd;
- this.thisParameters.parameter15[2].parameter10 = item.Value.gu;
- this.thisParameters.parameter15[2].parameter11 = item.Value.bd;
- this.thisParameters.parameter15[2].parameter12 = item.Value.bu;
- break;
- case "DarkGray":
- this.thisParameters.parameter15[3].parameter7 = item.Value.rd;
- this.thisParameters.parameter15[3].parameter8 = item.Value.ru;
- this.thisParameters.parameter15[3].parameter9 = item.Value.gd;
- this.thisParameters.parameter15[3].parameter10 = item.Value.gu;
- this.thisParameters.parameter15[3].parameter11 = item.Value.bd;
- this.thisParameters.parameter15[3].parameter12 = item.Value.bu;
- break;
- }
- }
- this.inclusionsModel.InclusionParameters[this.thisParametersIndex] = this.thisParameters;
- string filePath = Application.StartupPath + "\\Config\\Default\\ParameterSaving\\ParameterInclusionsModel.xml";
- string porosityInfoXml = XmlSerializeHelper.XmlSerialize<InclusionsModel>(inclusionsModel);
- Directory.CreateDirectory(Application.StartupPath + "\\Config\\Default\\ParameterSaving\\");
- FileOperationHelper.WriteStringToFile(porosityInfoXml, filePath, FileMode.CreateNew);
- #region [开启脚本录制]
- if (appWorkspace.startScriptRecording)
- {
- getScriptRecording();
- }
- #endregion
- }
- /// <summary>
- /// 应用到全部
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button4_Click(object sender, EventArgs e)
- {
- if (this.lstView_img.FocusedItem == null)
- {
- return;
- }
- binaryClass.saveParams();
- binaryClass.applyToAll(this.imageList_img.Images.Keys, this.imageList_img.Images.Keys[this.lstView_img.FocusedItem.Index]);
- userAll = true;
- resultList.Clear();
- hasResultIndexList.Clear();
- var data = new CurrentPageData(this.autoJiaoBen);
- var firstIndex = this.lstView_img.FocusedItem.Index;
- if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
- {
- data = everyImgData[this.lstView_img.FocusedItem.Index];
- }
- for (int i = 0; i < lstView_img.Items.Count; i++)
- {
- this.lstView_img.EnsureVisible(i);
- this.lstView_img.Items[i].Focused = true;
- this.lstView_img.Items[i].Selected = true;
- if (everyImgData.ContainsKey(i))
- {
- everyImgData[i] = data;
- }
- else
- {
- everyImgData.Add(i, data);
- }
- if ((i == 0 && lstView_img.Items.Count == 1) || firstIndex == 0)
- {
- this.startStatistics();
- }
- }
- #region [给最后一张图赋值]
- if (data.thisSelectedColorOfInclusions != null)
- {
- this.colorName = data.thisSelectedColorOfInclusions.colorName;
- getOldCheck();
- this.selectedColorOfInclusions = data.thisSelectedColorOfInclusions;
- CalcRGBOrHLSValue();
- UpdateHistogramStartAndEnd();
- }
- else
- {
- if (this.oldSelectedColorOfInclusions != null)
- {
- this.colorName = this.oldSelectedColorOfInclusions.colorName;
- getOldCheck();
- this.selectedColorOfInclusions = new ColorOfInclusions(this.oldSelectedColorOfInclusions.colorName, this.oldSelectedColorOfInclusions.ofTypes, this.oldSelectedColorOfInclusions.ru, this.oldSelectedColorOfInclusions.rd, this.oldSelectedColorOfInclusions.gu, this.oldSelectedColorOfInclusions.gd, this.oldSelectedColorOfInclusions.bu, this.oldSelectedColorOfInclusions.bd);
- data.thisSelectedColorOfInclusions = this.selectedColorOfInclusions;
- CalcRGBOrHLSValue();
- UpdateHistogramStartAndEnd();
- }
- }
- comboBox1.SelectedIndex = data.kNum;
- if (data.directionIndex >= 0)
- {
- comboBox_rollingDirection.SelectedIndex = data.directionIndex;
- }
- if (data.ratio >= numericUpDown_lwRatioLimit.Minimum)
- {
- numericUpDown_lwRatioLimit.Value = data.ratio;
- }
- checkBox_showColorGamutPhase.Checked = data.colorCheck;
- #endregion
- radioButton1.Enabled = true;
- radioButton2.Enabled = true;
- checkBox1.Enabled = true;
- checkBox2.Enabled = true;
- }
- /// <summary>
- /// 保存到全部
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button3_Click(object sender, EventArgs e)
- {
- if (this.lstView_img.FocusedItem == null)
- {
- return;
- }
- if (resultList.Count() == 0)
- {
- MessageBox.Show(PdnResources.GetString("Menu.PleaseClickApplyAllFirst.text") +"!");
- return;
- }
- if (listBox_analysisResult.Items.Count > 0)
- {
- if (MessageBox.Show(PdnResources.GetString("Menu.Theresuethertoreplace.text") + "?", "", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
- {
- for (int i = 0; i < resultList.Count(); i++)
- {
- if (analysisResults.ContainsKey(this.appWorkspace.DocumentWorkspaces[i]))
- {
- continue;
- }
- else
- {
- analysisResults.Add(this.appWorkspace.DocumentWorkspaces[i], resultList[i]);
- }
- buildListBox_analysisResult();
- }
- return;
- }
- }
- for (int i = 0; i < resultList.Count(); i++)
- {
- if (analysisResults.ContainsKey(this.appWorkspace.DocumentWorkspaces[i]))
- {
- analysisResults[this.appWorkspace.DocumentWorkspaces[i]] = resultList[i];
- }
- else
- {
- analysisResults.Add(this.appWorkspace.DocumentWorkspaces[i], resultList[i]);
- }
- buildListBox_analysisResult();
- }
- }
- private void allCheck()
- {
- if (listBox_analysisResult.Items != null && listBox_analysisResult.Items.Count > 0)
- {
- for (int i = 0; i < listBox_analysisResult.Items.Count; i++)
- {
- listBox_analysisResult.SetItemChecked(i, true);
- }
- buildListView_analysisResult();
- }
- }
- private void getValue(string key, Object value)
- {
- switch (key)
- {
- case "parameter1":
- comboBox_rollingDirection.SelectedIndex = (int)value;
- break;
- case "parameter2":
- numericUpDown_lwRatioLimit.Value = Convert.ToDecimal(value);
- break;
- case "parameter5":
- checkBox_showColorGamutPhase.Checked = Convert.ToBoolean(value);
- break;
- case "parameter17":
- checkBox_generateReport_opensetting.Checked = Convert.ToBoolean(value);
- break;
- case "parameter18":
- radioButton1.Checked = (int)value == 1 ? true : false;
- radioButton2.Checked = (int)value == 1 ? false : true;
- if (radioButton1.Checked)
- {
- this.is_full = 2;
- }
- else
- {
- this.is_full = 1;
- }
- break;
- case "parameter19":
- checkBox2.Checked = Convert.ToBoolean(value);
- is_showRectangle = Convert.ToBoolean(value);
- break;
- case "parameter20":
- checkBox1.Checked = Convert.ToBoolean(value);
- is_showOval = Convert.ToBoolean(value);
- break;
- case "scopeR":
- List<double> redlist = (List<double>)value;
- if (rgbDict.ContainsKey("red"))
- {
- rgbDict["red"] = redlist;
- }
- else
- {
- rgbDict.Add("red", redlist);
- }
- break;
- case "scopeG":
- List<double> greenlist = (List<double>)value;
- if (rgbDict.ContainsKey("green"))
- {
- rgbDict["green"] = greenlist;
- }
- else
- {
- rgbDict.Add("green", greenlist);
- }
- break;
- case "scopeB":
- List<double> bluelist = (List<double>)value;
- if (rgbDict.ContainsKey("blue"))
- {
- rgbDict["blue"] = bluelist;
- }
- else
- {
- rgbDict.Add("blue", bluelist);
- }
- break;
- case "parameter3":
- this.whichChecked = (int)value;
- getInclusionParameters();
- this.numericUpDown_colorAdjustmentRHU.Value = (decimal)rgbDict["red"][0];
- this.numericUpDown_colorAdjustmentRHD.Value = (decimal)rgbDict["red"][1];
- this.numericUpDown_colorAdjustmentGLU.Value = (decimal)rgbDict["green"][0];
- this.numericUpDown_colorAdjustmentGLD.Value = (decimal)rgbDict["green"][1];
- this.numericUpDown_colorAdjustmentBSU.Value = (decimal)rgbDict["blue"][0];
- this.numericUpDown_colorAdjustmentBSD.Value = (decimal)rgbDict["blue"][1];
- CalcRGBOrHLSValue();
- UpdateHistogramStartAndEnd();
- break;
- case "OpenWhileExportReport":
- checkBox_generateReport_opensetting.Checked = Convert.ToBoolean(value);
- break;
- case "CalculatorDecimalDigits":
- this.domainUpDown_resultPrecision.TabIndex = (int)value;
- this.domainUpDown_resultPrecision.Text = value.ToString();
- break;
- case "ExportResults":
- isExportResults = Convert.ToBoolean(value);
- break;
- case "ExportReports":
- isExportReports = Convert.ToBoolean(value);
- break;
- case "ExportProjects":
- isExportProjects = Convert.ToBoolean(value);
- break;
- case "parameter14":
- this.comboBox1.SelectedItem = (Convert.ToInt32(value) - 4).ToString();
- this.autoJiaoBen = this.comboBox1.SelectedIndex;
- break;
- case "viewNum":
- this.viewNum = Convert.ToInt32(value);
- break;
- }
- }
- /// <summary>
- /// 不可点击空白区域
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void listView1_MouseUp(object sender, MouseEventArgs e)
- {
- if (e.Button == MouseButtons.Left)
- {
- if (lstView_img.SelectedItems.Count > 0)
- {
- }
- else if (lstView_img.SelectedItems.Count <= 0)//点击空白区
- {
- if (this.lstView_img.FocusedItem != null)
- {
- ListViewItem item = this.lstView_img.GetItemAt(e.X, e.Y);
- if (item == null)
- {
- this.lstView_img.FocusedItem.Selected = true;
- }
- }
- }
- }
- }
- #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);
- }
- //找出二值相关参数 进行赋值
- List<Args> isNullList = args.Where(m => m.value == null).ToList();
- foreach (var item in isNullList)
- {
- item.value = binaryClass.setScriptRecording(item.key);
- }
- appWorkspace.SetScriptStartRecording(this.menuId, menuName, args);
- }
- private object setScriptRecording(string key)
- {
- object value = null;
- switch (key)
- {
- case "parameter1":
- value = comboBox_rollingDirection.SelectedIndex;
- break;
- case "parameter2":
- value = numericUpDown_lwRatioLimit.Value;
- break;
- case "parameter5":
- value = checkBox_showColorGamutPhase.Checked;
- break;
- case "parameter17":
- value = checkBox_generateReport_opensetting.Checked;
- break;
- case "parameter18":
- value = radioButton1.Checked ? 1 : 2;
- break;
- case "parameter19":
- value = checkBox2.Checked;
- break;
- case "parameter20":
- value = checkBox1.Checked;
- break;
- case "scopeR":
- value = new List<double>() { (double)this.numericUpDown_colorAdjustmentRHU.Value, (double)this.numericUpDown_colorAdjustmentRHD.Value };
- break;
- case "scopeG":
- value = new List<double>() { (double)this.numericUpDown_colorAdjustmentGLU.Value, (double)this.numericUpDown_colorAdjustmentGLD.Value };
- break;
- case "scopeB":
- value = new List<double>() { (double)this.numericUpDown_colorAdjustmentBSU.Value, (double)this.numericUpDown_colorAdjustmentBSD.Value };
- break;
- case "parameter3":
- value = thisParameters.parameter3;
- break;
- case "OpenWhileExportReport":
- value = checkBox_generateReport_opensetting.Checked;
- break;
- case "CalculatorDecimalDigits":
- value = this.domainUpDown_resultPrecision.SelectedItem;
- break;
- case "ExportResults":
- value = isExportResults;
- break;
- case "ExportReports":
- value = isExportReports;
- break;
- case "ExportProjects":
- value = isExportProjects;
- break;
- case "parameter14":
- value = this.comboBox1.SelectedItem;
- break;
- case "viewNum":
- value = this.viewNum;
- break;
- }
- return value;
- }
- #endregion
- }
- }
|