12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133 |
- 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 Bitmap bitmap;
-
- /// <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;
- /// <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");
- }
- 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.button4 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- 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);
- this.groupBox_img.Name = "groupBox_img";
- this.groupBox_img.Padding = new System.Windows.Forms.Padding(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);
- 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, 132);
- 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.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;
- //
- // 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);
- //
- // 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.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.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.bitmap = this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].CompositionSurface.CreateAliasedBitmap();
- this.tempAnalysisResult = null;
- //二值化
- binaryClass.listView1_SelectedIndexChanged(this.bitmap, 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.bitmap.Width, this.bitmap.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.bitmap, 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.bitmap, 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.bitmap == null)
- {
- return;
- }
- Mat mat = OpenCvSharp.Extensions.BitmapConverter.ToMat(this.bitmap);
- 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.bitmap == null) {
- return;
- }
- System.Drawing.Point pointscroll = this.documentWorkspace.GetScalePoint(me.Location);
- Mat mat = OpenCvSharp.Extensions.BitmapConverter.ToMat(this.bitmap);
- 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;
- var report = this.methodOfAssessment.generateReport(OpenCvSharp.Extensions.BitmapConverter.ToMat(this.bitmap), mat, rectangleF, isK, this.viewNum, k,this.is_full, rollingDirection);
- 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.bitmap.Width * pxPerUnit);
- int allHeight = (int)(this.bitmap.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 Bitmap bitmap;
- public GraphicsList graphicsList;
- public List<PhaseModel> phaseModels;
- public AnalysisResult analysisResult;
- public DocumentItem(Bitmap bitmap, GraphicsList graphicsList, List<PhaseModel> phaseModels)
- {
- this.bitmap = bitmap;
- 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("请先点击应用全部!");
- 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
- }
- }
|