InclusionsStandardDialog.cs 201 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242
  1. using Metis.DedicatedAnalysis.Inclusions;
  2. using Metis.ParameterSet;
  3. using OpenCvSharp;
  4. using OpenCvSharp.Extensions;
  5. using PaintDotNet.Adjust.BaseImage;
  6. using PaintDotNet.Annotation;
  7. using PaintDotNet.Annotation.DedicatedAnalysis;
  8. using PaintDotNet.Annotation.Enum;
  9. using PaintDotNet.Annotation.FieldView;
  10. using PaintDotNet.Base;
  11. using PaintDotNet.Base.CommTool;
  12. using PaintDotNet.Base.DedicatedAnalysis.Inclusions;
  13. using PaintDotNet.Base.DedicatedAnalysis.Inclusions.Model;
  14. using PaintDotNet.Base.Functionodel;
  15. using PaintDotNet.Base.SettingModel;
  16. using PaintDotNet.CustomControl;
  17. using PaintDotNet.Data.Param;
  18. using PaintDotNet.DbOpreate.DbBll;
  19. using PaintDotNet.DbOpreate.DbModel;
  20. using PaintDotNet.Instrument;
  21. using System;
  22. using System.Collections.Generic;
  23. using System.ComponentModel;
  24. using System.Data;
  25. using System.Drawing;
  26. using System.Drawing.Drawing2D;
  27. using System.IO;
  28. using System.Linq;
  29. using System.Windows.Forms;
  30. using static PaintDotNet.Base.DedicatedAnalysis.Inclusions.InclusionsGlobalSettings;
  31. using static PaintDotNet.Base.DedicatedAnalysis.Inclusions.MethodOfAssessment;
  32. namespace PaintDotNet.DedicatedAnalysis.Inclusions
  33. {
  34. internal class InclusionsStandardDialog : PdnBaseForm
  35. {
  36. #region 属性
  37. #region 属性
  38. /// <summary>
  39. /// 主控件
  40. /// </summary>
  41. private AppWorkspace appWorkspace;
  42. /// <summary>
  43. /// 公共按钮
  44. /// </summary>
  45. private CommonControlButtons commonControlButtons;
  46. /// <summary>
  47. /// 图像面板
  48. /// </summary>
  49. private DocumentWorkspaceWindow documentWorkspace;
  50. private Dictionary<int, DocumentItem> documentItems;
  51. /// <summary>
  52. /// 当前选择的图片
  53. /// </summary>
  54. private Mat imageMat;
  55. /// <summary>
  56. /// 初始系统参数配置值
  57. /// </summary>
  58. private BinaryExtractionModel binaryExtractionModel = new BinaryExtractionModel();
  59. /// <summary>
  60. /// 选择的评定方法
  61. /// </summary>
  62. private MethodOfAssessment methodOfAssessment;
  63. private AnalysisResult tempAnalysisResult;
  64. private Dictionary<DocumentWorkspace, AnalysisResult> analysisResults = new Dictionary<DocumentWorkspace, AnalysisResult>();
  65. protected ColorOfInclusions selectedColorOfInclusions;
  66. protected ColorOfInclusions oldSelectedColorOfInclusions;
  67. private int chooseK = 3;
  68. /// <summary>
  69. /// RGB/HLS 选中那个按钮,默认1=R/H 2=G/L 2=B/S
  70. /// </summary>
  71. private int HistogramRGBSelect = 1;
  72. private bool pickColorChecked;
  73. //二值化集成1
  74. private BinaryClass binaryClass;
  75. protected int menuId;
  76. protected string menuName;
  77. // 选定夹杂物类型
  78. private bool clearSelect = false;
  79. private TypesOfInclusions selectedTypesOfInclusions;
  80. // 选定夹杂物类型 操作 记录点
  81. private System.Drawing.Point? selectedTypesOfInclusionsPoint = null;
  82. private System.Drawing.RectangleF? selectedTypesOfInclusionsRectangle = null;
  83. // 视场边长
  84. private int viewNum = 710;
  85. private bool is_showRectangle = false;
  86. private bool is_showOval = false;
  87. private int is_full = 1;
  88. //局部变量
  89. private bool rbcheck = true;
  90. protected InclusionsModel inclusionsModel = new InclusionsModel();
  91. protected InclusionsModel.InclusionParameter thisParameters;
  92. protected int thisParametersIndex = -1;
  93. private bool userAll = false;
  94. private bool firstShow = true;
  95. protected int whichChecked = 0;
  96. private int autoJiaoBen = -1;
  97. #endregion
  98. #region 组件
  99. private GroupBox groupBox_operating;
  100. private Button btn_editInclusions;
  101. private Button btn_statistics;
  102. private GroupBox groupBox_img;
  103. private ListView lstView_img;
  104. private ImageList imageList_img;
  105. private IContainer components;
  106. private GroupBox groupBox_baseSetting;
  107. private ComboBox comboBox_rollingDirection;
  108. private Label label_lwRatioLimit;
  109. private Label label_rollingDirection;
  110. protected NumericUpDown numericUpDown_lwRatioLimit;
  111. protected GroupBox groupBox_colorSetting;
  112. private Panel panel_colorGamut;
  113. protected GroupBox groupBox_displaySetting;
  114. private GroupBox groupBox_histogram;
  115. private CustomControl.HistogramControl histogramControl_colorSetting;
  116. private GroupBox groupBox_colorAdjustment;
  117. private Button button_colorAdjustmentBS;
  118. private Button button_colorAdjustmentGL;
  119. private Button button_colorAdjustmentRH;
  120. private NumericUpDown numericUpDown_colorAdjustmentBSD;
  121. private NumericUpDown numericUpDown_colorAdjustmentBSU;
  122. private Label label_colorAdjustmentBS;
  123. private NumericUpDown numericUpDown_colorAdjustmentGLD;
  124. private NumericUpDown numericUpDown_colorAdjustmentGLU;
  125. private Label label_colorAdjustmentGL;
  126. private NumericUpDown numericUpDown_colorAdjustmentRHD;
  127. private NumericUpDown numericUpDown_colorAdjustmentRHU;
  128. private Label label_colorAdjustmentRH;
  129. private RadioButton radioButton_checkedHLS;
  130. private RadioButton radioButton_checkedRGB;
  131. private GroupBox groupBox_review;
  132. private GroupBox groupBox_report;
  133. private Label label_resultPrecision;
  134. private DomainUpDown domainUpDown_resultPrecision;
  135. private Button button_exportResults;
  136. private Button button_generateReport;
  137. private GroupBox groupBox6groupBox_analysisResult2;
  138. private ListView listView_analysisResult;
  139. private GroupBox groupBox_analysisResult1;
  140. private Button button_remove;
  141. private Button button_all;
  142. private Label label_colorGamut;
  143. private Button button_pickColor;
  144. private Panel panel_colorGamutPhase;
  145. private CheckBox checkBox_showColorGamutPhase;
  146. private ToolTip toolTip_InclusionsDetails;
  147. private ListView listView_analysisResult2;
  148. private Button button_setting;
  149. private CheckedListBox listBox_analysisResult;
  150. private Button btn_clean_result;
  151. private CheckBox checkBox_generateReport_opensetting;
  152. private Button button1;
  153. private ComboBox comboBox1;
  154. private Label label1;
  155. private BinaryControl bc;
  156. private Button btn_drawRecognitionArea;
  157. private Button btn_selectClear;
  158. private Button btn_saveresult;
  159. private Button button2;
  160. private CheckBox checkBox2;
  161. private CheckBox checkBox1;
  162. private RadioButton radioButton2;
  163. private RadioButton radioButton1;
  164. private int isK = 2;
  165. private int imgIndex = -1;
  166. private RectangleF paintRectangle;
  167. private Dictionary<string, List<PhaseModel>> dict = new Dictionary<string, List<PhaseModel>>();
  168. protected double imgPxPerUnit;
  169. protected GroupBox groupBox1;
  170. private Button button4;
  171. private Button button3;
  172. private string dialogText;
  173. private List<AnalysisResult> resultList = new List<AnalysisResult>();
  174. private List<int> hasResultIndexList = new List<int>();
  175. private Dictionary<int, CurrentPageData> everyImgData = new Dictionary<int, CurrentPageData>();
  176. protected string colorName;
  177. private Dictionary<string, List<double>> rgbDict = new Dictionary<string, List<double>>();
  178. private bool isExportResults = false;
  179. private bool isExportReports = false;
  180. private bool isExportProjects = false;
  181. private RadioButton radioButton3;
  182. private RadioButton radioButton4;
  183. private RadioButton radioButton5;
  184. /// <summary>
  185. /// 是否脚本运行
  186. /// </summary>
  187. private Boolean initScriptValues = false;
  188. #endregion
  189. #endregion
  190. #region 构造函数
  191. public InclusionsStandardDialog(AppWorkspace appWorkspace, string dialogText, PdnMenuItem menuitem)
  192. {
  193. this.appWorkspace = appWorkspace;
  194. this.Shown += showImg;
  195. this.Text = dialogText;
  196. this.dialogText = dialogText;
  197. this.Icon = PdnInfo.AppIcon;
  198. InitializeComponent();
  199. this.menuId = menuitem.MenuId;
  200. this.menuName = menuitem.Text;
  201. this.binaryClass = new BinaryClass(menuId);
  202. InitializeComponent2();
  203. Initialize();
  204. //二值化集成2
  205. bc.OriginCheckedChangedAction += new EventHandler(this.bcOriginCheckedChanged);//初始化原图勾选改变事件
  206. binaryClass.createDocumentItems(new string[] { PdnResources.GetString("Menu.binary.Text"), PdnResources.GetString("Menu.Theinclusioncolomatches.Text") }
  207. , this.bc, this.appWorkspace, this.documentWorkspace, this.lstView_img);//初始化相的工作结构
  208. binaryClass.BinaryImplFinishAction += new EventHandler(this.bClassBinaryImplFinishAction);//二值化后续处理事件
  209. this.documentWorkspace.panel.Paint += Panel_Paint;
  210. this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.saveLastData);
  211. }
  212. private void showImg(object sender, EventArgs e)
  213. {
  214. lstView_img.Focus();
  215. if (this.imgIndex != -1)
  216. {
  217. //滚动到指定的行位置
  218. this.lstView_img.EnsureVisible(this.imgIndex);
  219. this.lstView_img.Items[imgIndex].Focused = true;
  220. this.lstView_img.Items[imgIndex].Selected = true;
  221. }
  222. this.methodOfAssessment = getMethodOfAssessment();
  223. MethodOfAssessment.activeMethod = this.methodOfAssessment;
  224. SetAnalyzeModelFromXml(this.methodOfAssessment.resourcesName);
  225. SubclassInitialize();
  226. initColorSetting();
  227. initDisplaySetting();
  228. //如果是脚本执行,将参数带入
  229. if (appWorkspace.ScriptRunning && appWorkspace.ScriptCurrentParam != null)
  230. {
  231. this.initScriptValues = true;//ScriptAutomatic
  232. //Boolean initScriptValues = true;
  233. ////在这里反射出对应功能的参数类
  234. string className = InvariantData.path_Action + ".Action" + menuId;
  235. ParamObject param = (ParamObject)System.Reflection.Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
  236. foreach (Args arg in param.Lists)
  237. {
  238. Args param1 = appWorkspace.ScriptCurrentParam.Lists.Find(m => m.Key.Equals(arg.Key));
  239. if (param1.value != null)
  240. arg.Value = param1.value;
  241. getValue(arg.key, arg.Value);
  242. }
  243. appWorkspace.ScriptCurrentParam = null;//阻止第二次进入仍然被赋值参数
  244. }
  245. else
  246. {//读取上次关闭窗口时保存的参数
  247. getLastData();
  248. }
  249. this.firstShow = false;
  250. binaryClass.RefreshHistogramControl1Values();
  251. // 初始化显示设置区域
  252. foreach (var item in this.groupBox_displaySetting.Controls)
  253. {
  254. if (item is Button)
  255. {
  256. ((Button)item).Click += this.label_displaySetting;
  257. }
  258. }
  259. if (this.initScriptValues && this.appWorkspace.ScriptAutomatic)
  260. this.startScriptAutomaticAction();
  261. }
  262. /// <summary>
  263. /// 执行脚本自动化的步骤
  264. /// </summary>
  265. private void startScriptAutomaticAction()
  266. {
  267. this.button4.PerformClick();
  268. this.button3.PerformClick();
  269. this.allCheck();
  270. if (isExportResults)//导出结果
  271. this.button_exportResults.PerformClick();
  272. if (isExportReports)//生成报告
  273. this.button_generateReport.PerformClick();
  274. if (isExportProjects)//导出项目
  275. this.button1.PerformClick();
  276. this.appWorkspace.ScriptAutomatic = false;
  277. this.Close();
  278. }
  279. public InclusionsStandardDialog()
  280. {
  281. InitializeComponent();
  282. }
  283. #endregion
  284. #region 初始化组件
  285. private void InitializeComponent2()
  286. {
  287. this.bc = new PaintDotNet.CustomControl.BinaryControl();
  288. //
  289. // bc
  290. //
  291. this.bc.BinaryBackColor = System.Drawing.Color.Red;
  292. this.bc.BinaryChecked = false;
  293. this.bc.BinaryStyle = 1;
  294. this.bc.Location = new System.Drawing.Point(178, 72);
  295. this.bc.Name = "bc";
  296. this.bc.OriginChecked = false;
  297. this.bc.scope1End = 0D;
  298. this.bc.scope1Start = 0D;
  299. this.bc.scope2End = 0D;
  300. this.bc.scope2Start = 0D;
  301. this.bc.scope3End = 0D;
  302. this.bc.scope3Start = 0D;
  303. this.bc.Size = new System.Drawing.Size(360, 292);
  304. this.bc.TabIndex = 35;
  305. this.Controls.Add(this.bc);
  306. this.Controls.SetChildIndex(this.bc, 0);
  307. //
  308. // histogramControl_colorSetting
  309. //
  310. this.histogramControl_colorSetting = new PaintDotNet.CustomControl.HistogramControl();
  311. this.histogramControl_colorSetting.Flag = 1;
  312. this.histogramControl_colorSetting.Location = new System.Drawing.Point(7, 15);
  313. this.histogramControl_colorSetting.Name = "histogramControl_colorSetting";
  314. this.histogramControl_colorSetting.Size = new System.Drawing.Size(167, 114);
  315. this.histogramControl_colorSetting.TabIndex = 0;
  316. this.groupBox_histogram.Controls.Add(this.histogramControl_colorSetting);
  317. this.comboBox_rollingDirection.Items.AddRange(new object[] {
  318. PdnResources.GetString("Menu.vertical.text"),
  319. PdnResources.GetString("Menu.Level.text")});
  320. this.groupBox_operating.Text = PdnResources.GetString("Menu.operation.text");
  321. this.btn_drawRecognitionArea.Text = PdnResources.GetString("Menu.dentificationarea.Text");
  322. this.checkBox_generateReport_opensetting.Text = PdnResources.GetString("Menu.Opensettingsatingreport.text");
  323. this.btn_clean_result.Text = PdnResources.GetString("Menu.Clearstatistics.text");
  324. this.button_setting.Text = PdnResources.GetString("Menu.Setting.Text");
  325. this.btn_editInclusions.Text = PdnResources.GetString("Menu.Editinclusions.text");
  326. this.btn_statistics.Text = PdnResources.GetString("Menu.Startstatistics.text");
  327. this.btn_saveresult.Text = PdnResources.GetString("Menu.Saveresult.text");
  328. this.groupBox_img.Text = PdnResources.GetString("Menu.Tools.ImageIndex.Text");
  329. this.groupBox_baseSetting.Text = PdnResources.GetString("Menu.BasicSettings.text");
  330. this.label1.Text = "K" + PdnResources.GetString("Menu.Imagement.Measurementlist.value.text");
  331. this.label_lwRatioLimit.Text = PdnResources.GetString("Menu.lengthwidthratio.Text");
  332. this.label_rollingDirection.Text = PdnResources.GetString("Menu.Rollingdirection.text");
  333. this.groupBox_colorSetting.Text = PdnResources.GetString("Menu.Inclusioncolorsetting.text");
  334. this.checkBox_showColorGamutPhase.Text = PdnResources.GetString("Menu.Matchthecoloreffect.text");
  335. this.button_pickColor.Text = PdnResources.GetString("Menu.Pickcolor.text");
  336. this.label_colorGamut.Text = PdnResources.GetString("Menu.Colorinterval.text");
  337. this.groupBox_displaySetting.Text = PdnResources.GetString("Menu.displaysetting.text");
  338. this.btn_selectClear.Text = PdnResources.GetString("Menu.Removalofinclusion.Text");
  339. this.groupBox_histogram.Text = PdnResources.GetString("Menu.Tools.Histogram.Text");
  340. this.groupBox_colorAdjustment.Text = PdnResources.GetString("Menu.Coloradjustment.text");
  341. this.groupBox_review.Text = PdnResources.GetString("Menu.Preview.text");
  342. this.button1.Text = PdnResources.GetString("Menu.Tools.OpenProject.Text");
  343. this.label_resultPrecision.Text = PdnResources.GetString("Menu.Decimal.text") + ":";
  344. this.button_exportResults.Text = PdnResources.GetString("Menu.Exportresults.text");
  345. this.button_generateReport.Text = PdnResources.GetString("Menu.Tools.CreateReport.Text");
  346. this.groupBox_analysisResult1.Text = PdnResources.GetString("Menu.Analysisresult.text");
  347. this.button_remove.Text = PdnResources.GetString("Menu.Edit.Delete.Text");
  348. this.button2.Text = PdnResources.GetString("Menu.ViewSetting.Text");
  349. this.button_all.Text = PdnResources.GetString("Menu.Showall.text");
  350. this.checkBox1.Text = PdnResources.GetString("Menu.Ellipsebox.text");
  351. this.checkBox2.Text = PdnResources.GetString("Menu.Rectangularbox.text");
  352. this.radioButton1.Text = PdnResources.GetString("Menu.ImageCollection.CameraFrame.Text");
  353. this.radioButton2.Text = PdnResources.GetString("Menu.solid.text");
  354. this.button4.Text = PdnResources.GetString("Menu.Applyall.text");
  355. this.button3.Text = PdnResources.GetString("Menu.File.SaveAll.Text");
  356. }
  357. private void InitializeComponent()
  358. {
  359. this.components = new System.ComponentModel.Container();
  360. this.groupBox_operating = new System.Windows.Forms.GroupBox();
  361. this.radioButton2 = new System.Windows.Forms.RadioButton();
  362. this.radioButton1 = new System.Windows.Forms.RadioButton();
  363. this.checkBox2 = new System.Windows.Forms.CheckBox();
  364. this.checkBox1 = new System.Windows.Forms.CheckBox();
  365. this.btn_selectClear = new System.Windows.Forms.Button();
  366. this.btn_drawRecognitionArea = new System.Windows.Forms.Button();
  367. this.checkBox_generateReport_opensetting = new System.Windows.Forms.CheckBox();
  368. this.btn_clean_result = new System.Windows.Forms.Button();
  369. this.button_setting = new System.Windows.Forms.Button();
  370. this.btn_editInclusions = new System.Windows.Forms.Button();
  371. this.btn_statistics = new System.Windows.Forms.Button();
  372. this.btn_saveresult = new System.Windows.Forms.Button();
  373. this.button2 = new System.Windows.Forms.Button();
  374. this.groupBox_img = new System.Windows.Forms.GroupBox();
  375. this.lstView_img = new System.Windows.Forms.ListView();
  376. this.imageList_img = new System.Windows.Forms.ImageList(this.components);
  377. this.groupBox_baseSetting = new System.Windows.Forms.GroupBox();
  378. this.comboBox1 = new System.Windows.Forms.ComboBox();
  379. this.label1 = new System.Windows.Forms.Label();
  380. this.comboBox_rollingDirection = new System.Windows.Forms.ComboBox();
  381. this.label_lwRatioLimit = new System.Windows.Forms.Label();
  382. this.label_rollingDirection = new System.Windows.Forms.Label();
  383. this.numericUpDown_lwRatioLimit = new System.Windows.Forms.NumericUpDown();
  384. this.groupBox_colorSetting = new System.Windows.Forms.GroupBox();
  385. this.checkBox_showColorGamutPhase = new System.Windows.Forms.CheckBox();
  386. this.panel_colorGamutPhase = new System.Windows.Forms.Panel();
  387. this.button_pickColor = new System.Windows.Forms.Button();
  388. this.label_colorGamut = new System.Windows.Forms.Label();
  389. this.panel_colorGamut = new System.Windows.Forms.Panel();
  390. this.groupBox_displaySetting = new System.Windows.Forms.GroupBox();
  391. this.groupBox_histogram = new System.Windows.Forms.GroupBox();
  392. this.groupBox_colorAdjustment = new System.Windows.Forms.GroupBox();
  393. this.button_colorAdjustmentBS = new System.Windows.Forms.Button();
  394. this.button_colorAdjustmentGL = new System.Windows.Forms.Button();
  395. this.button_colorAdjustmentRH = new System.Windows.Forms.Button();
  396. this.numericUpDown_colorAdjustmentBSD = new System.Windows.Forms.NumericUpDown();
  397. this.numericUpDown_colorAdjustmentBSU = new System.Windows.Forms.NumericUpDown();
  398. this.label_colorAdjustmentBS = new System.Windows.Forms.Label();
  399. this.numericUpDown_colorAdjustmentGLD = new System.Windows.Forms.NumericUpDown();
  400. this.numericUpDown_colorAdjustmentGLU = new System.Windows.Forms.NumericUpDown();
  401. this.label_colorAdjustmentGL = new System.Windows.Forms.Label();
  402. this.numericUpDown_colorAdjustmentRHD = new System.Windows.Forms.NumericUpDown();
  403. this.numericUpDown_colorAdjustmentRHU = new System.Windows.Forms.NumericUpDown();
  404. this.label_colorAdjustmentRH = new System.Windows.Forms.Label();
  405. this.radioButton_checkedHLS = new System.Windows.Forms.RadioButton();
  406. this.radioButton_checkedRGB = new System.Windows.Forms.RadioButton();
  407. this.groupBox_review = new System.Windows.Forms.GroupBox();
  408. this.groupBox_report = new System.Windows.Forms.GroupBox();
  409. this.button1 = new System.Windows.Forms.Button();
  410. this.label_resultPrecision = new System.Windows.Forms.Label();
  411. this.domainUpDown_resultPrecision = new System.Windows.Forms.DomainUpDown();
  412. this.button_exportResults = new System.Windows.Forms.Button();
  413. this.button_generateReport = new System.Windows.Forms.Button();
  414. this.groupBox6groupBox_analysisResult2 = new System.Windows.Forms.GroupBox();
  415. this.listView_analysisResult2 = new System.Windows.Forms.ListView();
  416. this.listView_analysisResult = new System.Windows.Forms.ListView();
  417. this.groupBox_analysisResult1 = new System.Windows.Forms.GroupBox();
  418. this.listBox_analysisResult = new System.Windows.Forms.CheckedListBox();
  419. this.button_remove = new System.Windows.Forms.Button();
  420. this.button_all = new System.Windows.Forms.Button();
  421. this.toolTip_InclusionsDetails = new System.Windows.Forms.ToolTip(this.components);
  422. this.groupBox1 = new System.Windows.Forms.GroupBox();
  423. this.radioButton3 = new System.Windows.Forms.RadioButton();
  424. this.radioButton4 = new System.Windows.Forms.RadioButton();
  425. this.button4 = new System.Windows.Forms.Button();
  426. this.button3 = new System.Windows.Forms.Button();
  427. this.radioButton5 = new System.Windows.Forms.RadioButton();
  428. this.groupBox_operating.SuspendLayout();
  429. this.groupBox_img.SuspendLayout();
  430. this.groupBox_baseSetting.SuspendLayout();
  431. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).BeginInit();
  432. this.groupBox_colorSetting.SuspendLayout();
  433. this.groupBox_colorAdjustment.SuspendLayout();
  434. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentBSD)).BeginInit();
  435. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentBSU)).BeginInit();
  436. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentGLD)).BeginInit();
  437. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentGLU)).BeginInit();
  438. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentRHD)).BeginInit();
  439. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentRHU)).BeginInit();
  440. this.groupBox_report.SuspendLayout();
  441. this.groupBox6groupBox_analysisResult2.SuspendLayout();
  442. this.groupBox_analysisResult1.SuspendLayout();
  443. this.groupBox1.SuspendLayout();
  444. this.SuspendLayout();
  445. //
  446. // groupBox_operating
  447. //
  448. this.groupBox_operating.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  449. | System.Windows.Forms.AnchorStyles.Right)));
  450. this.groupBox_operating.Controls.Add(this.radioButton2);
  451. this.groupBox_operating.Controls.Add(this.radioButton1);
  452. this.groupBox_operating.Controls.Add(this.checkBox2);
  453. this.groupBox_operating.Controls.Add(this.checkBox1);
  454. this.groupBox_operating.Controls.Add(this.btn_selectClear);
  455. this.groupBox_operating.Controls.Add(this.btn_drawRecognitionArea);
  456. this.groupBox_operating.Controls.Add(this.checkBox_generateReport_opensetting);
  457. this.groupBox_operating.Controls.Add(this.btn_clean_result);
  458. this.groupBox_operating.Controls.Add(this.button_setting);
  459. this.groupBox_operating.Controls.Add(this.btn_editInclusions);
  460. this.groupBox_operating.Controls.Add(this.btn_statistics);
  461. this.groupBox_operating.Controls.Add(this.btn_saveresult);
  462. this.groupBox_operating.Controls.Add(this.button2);
  463. this.groupBox_operating.Location = new System.Drawing.Point(13, 12);
  464. this.groupBox_operating.Name = "groupBox_operating";
  465. this.groupBox_operating.Size = new System.Drawing.Size(1152, 53);
  466. this.groupBox_operating.TabIndex = 12;
  467. this.groupBox_operating.TabStop = false;
  468. //
  469. // radioButton2
  470. //
  471. this.radioButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  472. this.radioButton2.AutoSize = true;
  473. this.radioButton2.Checked = true;
  474. this.radioButton2.Location = new System.Drawing.Point(405, 23);
  475. this.radioButton2.Name = "radioButton2";
  476. this.radioButton2.Size = new System.Drawing.Size(14, 13);
  477. this.radioButton2.TabIndex = 12;
  478. this.radioButton2.TabStop = true;
  479. this.radioButton2.UseVisualStyleBackColor = true;
  480. this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
  481. //
  482. // radioButton1
  483. //
  484. this.radioButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  485. this.radioButton1.AutoSize = true;
  486. this.radioButton1.Location = new System.Drawing.Point(348, 22);
  487. this.radioButton1.Name = "radioButton1";
  488. this.radioButton1.Size = new System.Drawing.Size(14, 13);
  489. this.radioButton1.TabIndex = 11;
  490. this.radioButton1.UseVisualStyleBackColor = true;
  491. this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
  492. //
  493. // checkBox2
  494. //
  495. this.checkBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  496. this.checkBox2.AutoSize = true;
  497. this.checkBox2.Location = new System.Drawing.Point(504, 24);
  498. this.checkBox2.Name = "checkBox2";
  499. this.checkBox2.Size = new System.Drawing.Size(15, 14);
  500. this.checkBox2.TabIndex = 10;
  501. this.checkBox2.UseVisualStyleBackColor = true;
  502. this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged);
  503. //
  504. // checkBox1
  505. //
  506. this.checkBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  507. this.checkBox1.AutoSize = true;
  508. this.checkBox1.Location = new System.Drawing.Point(591, 23);
  509. this.checkBox1.Name = "checkBox1";
  510. this.checkBox1.Size = new System.Drawing.Size(15, 14);
  511. this.checkBox1.TabIndex = 9;
  512. this.checkBox1.UseVisualStyleBackColor = true;
  513. this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
  514. //
  515. // btn_selectClear
  516. //
  517. this.btn_selectClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  518. this.btn_selectClear.Location = new System.Drawing.Point(829, 20);
  519. this.btn_selectClear.Name = "btn_selectClear";
  520. this.btn_selectClear.Size = new System.Drawing.Size(75, 23);
  521. this.btn_selectClear.TabIndex = 0;
  522. this.btn_selectClear.UseVisualStyleBackColor = true;
  523. this.btn_selectClear.Click += new System.EventHandler(this.btn_selectClear_Click);
  524. //
  525. // btn_drawRecognitionArea
  526. //
  527. this.btn_drawRecognitionArea.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  528. this.btn_drawRecognitionArea.Location = new System.Drawing.Point(667, 20);
  529. this.btn_drawRecognitionArea.Name = "btn_drawRecognitionArea";
  530. this.btn_drawRecognitionArea.Size = new System.Drawing.Size(75, 23);
  531. this.btn_drawRecognitionArea.TabIndex = 7;
  532. this.btn_drawRecognitionArea.UseVisualStyleBackColor = true;
  533. this.btn_drawRecognitionArea.Click += new System.EventHandler(this.btn_drawRecognitionArea_Click);
  534. //
  535. // checkBox_generateReport_opensetting
  536. //
  537. this.checkBox_generateReport_opensetting.AutoSize = true;
  538. this.checkBox_generateReport_opensetting.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
  539. this.checkBox_generateReport_opensetting.Location = new System.Drawing.Point(91, 24);
  540. this.checkBox_generateReport_opensetting.Name = "checkBox_generateReport_opensetting";
  541. this.checkBox_generateReport_opensetting.Size = new System.Drawing.Size(15, 14);
  542. this.checkBox_generateReport_opensetting.TabIndex = 6;
  543. this.checkBox_generateReport_opensetting.UseVisualStyleBackColor = true;
  544. //
  545. // btn_clean_result
  546. //
  547. this.btn_clean_result.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  548. this.btn_clean_result.Location = new System.Drawing.Point(991, 20);
  549. this.btn_clean_result.Name = "btn_clean_result";
  550. this.btn_clean_result.Size = new System.Drawing.Size(75, 23);
  551. this.btn_clean_result.TabIndex = 5;
  552. this.btn_clean_result.UseVisualStyleBackColor = true;
  553. this.btn_clean_result.Click += new System.EventHandler(this.btn_clean_result_Click);
  554. //
  555. // button_setting
  556. //
  557. this.button_setting.Location = new System.Drawing.Point(6, 20);
  558. this.button_setting.Name = "button_setting";
  559. this.button_setting.Size = new System.Drawing.Size(75, 23);
  560. this.button_setting.TabIndex = 4;
  561. this.button_setting.UseVisualStyleBackColor = true;
  562. this.button_setting.Click += new System.EventHandler(this.button_setting_Click);
  563. //
  564. // btn_editInclusions
  565. //
  566. this.btn_editInclusions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  567. this.btn_editInclusions.Location = new System.Drawing.Point(748, 20);
  568. this.btn_editInclusions.Name = "btn_editInclusions";
  569. this.btn_editInclusions.Size = new System.Drawing.Size(75, 23);
  570. this.btn_editInclusions.TabIndex = 3;
  571. this.btn_editInclusions.UseVisualStyleBackColor = true;
  572. this.btn_editInclusions.Click += new System.EventHandler(this.btn_editInclusions_Click);
  573. //
  574. // btn_statistics
  575. //
  576. this.btn_statistics.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  577. this.btn_statistics.Location = new System.Drawing.Point(910, 20);
  578. this.btn_statistics.Name = "btn_statistics";
  579. this.btn_statistics.Size = new System.Drawing.Size(75, 23);
  580. this.btn_statistics.TabIndex = 3;
  581. this.btn_statistics.UseVisualStyleBackColor = true;
  582. this.btn_statistics.Click += new System.EventHandler(this.btn_statistics_Click);
  583. //
  584. // btn_saveresult
  585. //
  586. this.btn_saveresult.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  587. this.btn_saveresult.Location = new System.Drawing.Point(1072, 20);
  588. this.btn_saveresult.Name = "btn_saveresult";
  589. this.btn_saveresult.Size = new System.Drawing.Size(75, 23);
  590. this.btn_saveresult.TabIndex = 2;
  591. this.btn_saveresult.UseVisualStyleBackColor = true;
  592. this.btn_saveresult.Click += new System.EventHandler(this.btn_saveresult_Click);
  593. //
  594. // button2
  595. //
  596. this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  597. this.button2.Location = new System.Drawing.Point(667, 20);
  598. this.button2.Name = "button2";
  599. this.button2.Size = new System.Drawing.Size(75, 23);
  600. this.button2.TabIndex = 8;
  601. this.button2.UseVisualStyleBackColor = true;
  602. this.button2.Click += new System.EventHandler(this.button2_Click);
  603. //
  604. // groupBox_img
  605. //
  606. this.groupBox_img.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  607. | System.Windows.Forms.AnchorStyles.Left)));
  608. this.groupBox_img.Controls.Add(this.lstView_img);
  609. this.groupBox_img.Location = new System.Drawing.Point(13, 72);
  610. this.groupBox_img.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  611. this.groupBox_img.Name = "groupBox_img";
  612. this.groupBox_img.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
  613. this.groupBox_img.Size = new System.Drawing.Size(158, 630);
  614. this.groupBox_img.TabIndex = 13;
  615. this.groupBox_img.TabStop = false;
  616. //
  617. // lstView_img
  618. //
  619. this.lstView_img.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  620. | System.Windows.Forms.AnchorStyles.Left)
  621. | System.Windows.Forms.AnchorStyles.Right)));
  622. this.lstView_img.HideSelection = false;
  623. this.lstView_img.LargeImageList = this.imageList_img;
  624. this.lstView_img.Location = new System.Drawing.Point(8, 26);
  625. this.lstView_img.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  626. this.lstView_img.MultiSelect = false;
  627. this.lstView_img.Name = "lstView_img";
  628. this.lstView_img.Size = new System.Drawing.Size(140, 596);
  629. this.lstView_img.TabIndex = 0;
  630. this.lstView_img.UseCompatibleStateImageBehavior = false;
  631. this.lstView_img.SelectedIndexChanged += new System.EventHandler(this.lstView_img_SelectedIndexChanged);
  632. this.lstView_img.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseUp);
  633. //
  634. // imageList_img
  635. //
  636. this.imageList_img.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
  637. this.imageList_img.ImageSize = new System.Drawing.Size(64, 64);
  638. this.imageList_img.TransparentColor = System.Drawing.Color.Transparent;
  639. //
  640. // groupBox_baseSetting
  641. //
  642. this.groupBox_baseSetting.Controls.Add(this.comboBox1);
  643. this.groupBox_baseSetting.Controls.Add(this.label1);
  644. this.groupBox_baseSetting.Controls.Add(this.comboBox_rollingDirection);
  645. this.groupBox_baseSetting.Controls.Add(this.label_lwRatioLimit);
  646. this.groupBox_baseSetting.Controls.Add(this.label_rollingDirection);
  647. this.groupBox_baseSetting.Controls.Add(this.numericUpDown_lwRatioLimit);
  648. this.groupBox_baseSetting.Location = new System.Drawing.Point(178, 370);
  649. this.groupBox_baseSetting.Name = "groupBox_baseSetting";
  650. this.groupBox_baseSetting.Size = new System.Drawing.Size(360, 51);
  651. this.groupBox_baseSetting.TabIndex = 18;
  652. this.groupBox_baseSetting.TabStop = false;
  653. //
  654. // comboBox1
  655. //
  656. this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  657. this.comboBox1.FormattingEnabled = true;
  658. this.comboBox1.Items.AddRange(new object[] {
  659. "0",
  660. "1",
  661. "2",
  662. "3",
  663. "4",
  664. "5",
  665. "6",
  666. "7",
  667. "8"});
  668. this.comboBox1.Location = new System.Drawing.Point(296, 21);
  669. this.comboBox1.Name = "comboBox1";
  670. this.comboBox1.Size = new System.Drawing.Size(56, 20);
  671. this.comboBox1.TabIndex = 9;
  672. this.comboBox1.SelectionChangeCommitted += new System.EventHandler(this.abc);
  673. //
  674. // label1
  675. //
  676. this.label1.AutoSize = true;
  677. this.label1.Location = new System.Drawing.Point(268, 25);
  678. this.label1.Name = "label1";
  679. this.label1.Size = new System.Drawing.Size(0, 12);
  680. this.label1.TabIndex = 10;
  681. //
  682. // comboBox_rollingDirection
  683. //
  684. this.comboBox_rollingDirection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  685. this.comboBox_rollingDirection.FormattingEnabled = true;
  686. this.comboBox_rollingDirection.Location = new System.Drawing.Point(68, 23);
  687. this.comboBox_rollingDirection.Name = "comboBox_rollingDirection";
  688. this.comboBox_rollingDirection.Size = new System.Drawing.Size(56, 20);
  689. this.comboBox_rollingDirection.TabIndex = 3;
  690. //
  691. // label_lwRatioLimit
  692. //
  693. this.label_lwRatioLimit.AutoSize = true;
  694. this.label_lwRatioLimit.Location = new System.Drawing.Point(130, 26);
  695. this.label_lwRatioLimit.Name = "label_lwRatioLimit";
  696. this.label_lwRatioLimit.Size = new System.Drawing.Size(0, 12);
  697. this.label_lwRatioLimit.TabIndex = 7;
  698. //
  699. // label_rollingDirection
  700. //
  701. this.label_rollingDirection.AutoSize = true;
  702. this.label_rollingDirection.Location = new System.Drawing.Point(8, 26);
  703. this.label_rollingDirection.Name = "label_rollingDirection";
  704. this.label_rollingDirection.Size = new System.Drawing.Size(0, 12);
  705. this.label_rollingDirection.TabIndex = 8;
  706. //
  707. // numericUpDown_lwRatioLimit
  708. //
  709. this.numericUpDown_lwRatioLimit.DecimalPlaces = 2;
  710. this.numericUpDown_lwRatioLimit.Location = new System.Drawing.Point(201, 20);
  711. this.numericUpDown_lwRatioLimit.Maximum = new decimal(new int[] {
  712. 10,
  713. 0,
  714. 0,
  715. 0});
  716. this.numericUpDown_lwRatioLimit.Minimum = new decimal(new int[] {
  717. 1,
  718. 0,
  719. 0,
  720. 0});
  721. this.numericUpDown_lwRatioLimit.Name = "numericUpDown_lwRatioLimit";
  722. this.numericUpDown_lwRatioLimit.Size = new System.Drawing.Size(56, 21);
  723. this.numericUpDown_lwRatioLimit.TabIndex = 5;
  724. this.numericUpDown_lwRatioLimit.Value = new decimal(new int[] {
  725. 3,
  726. 0,
  727. 0,
  728. 0});
  729. this.numericUpDown_lwRatioLimit.ValueChanged += new System.EventHandler(this.numericUpDown_lwRatioLimit_ValueChanged);
  730. //
  731. // groupBox_colorSetting
  732. //
  733. this.groupBox_colorSetting.Controls.Add(this.checkBox_showColorGamutPhase);
  734. this.groupBox_colorSetting.Controls.Add(this.panel_colorGamutPhase);
  735. this.groupBox_colorSetting.Controls.Add(this.button_pickColor);
  736. this.groupBox_colorSetting.Controls.Add(this.label_colorGamut);
  737. this.groupBox_colorSetting.Controls.Add(this.panel_colorGamut);
  738. this.groupBox_colorSetting.Location = new System.Drawing.Point(179, 427);
  739. this.groupBox_colorSetting.Name = "groupBox_colorSetting";
  740. this.groupBox_colorSetting.Size = new System.Drawing.Size(359, 72);
  741. this.groupBox_colorSetting.TabIndex = 26;
  742. this.groupBox_colorSetting.TabStop = false;
  743. //
  744. // checkBox_showColorGamutPhase
  745. //
  746. this.checkBox_showColorGamutPhase.AutoSize = true;
  747. this.checkBox_showColorGamutPhase.Location = new System.Drawing.Point(185, 48);
  748. this.checkBox_showColorGamutPhase.Name = "checkBox_showColorGamutPhase";
  749. this.checkBox_showColorGamutPhase.Size = new System.Drawing.Size(15, 14);
  750. this.checkBox_showColorGamutPhase.TabIndex = 41;
  751. this.checkBox_showColorGamutPhase.UseVisualStyleBackColor = true;
  752. this.checkBox_showColorGamutPhase.CheckedChanged += new System.EventHandler(this.checkBox_showColorGamutPhase_CheckedChanged);
  753. //
  754. // panel_colorGamutPhase
  755. //
  756. this.panel_colorGamutPhase.BackColor = System.Drawing.Color.Lime;
  757. this.panel_colorGamutPhase.Location = new System.Drawing.Point(284, 46);
  758. this.panel_colorGamutPhase.Name = "panel_colorGamutPhase";
  759. this.panel_colorGamutPhase.Size = new System.Drawing.Size(69, 17);
  760. this.panel_colorGamutPhase.TabIndex = 40;
  761. //
  762. // button_pickColor
  763. //
  764. this.button_pickColor.Location = new System.Drawing.Point(284, 17);
  765. this.button_pickColor.Name = "button_pickColor";
  766. this.button_pickColor.Size = new System.Drawing.Size(69, 23);
  767. this.button_pickColor.TabIndex = 36;
  768. this.button_pickColor.UseVisualStyleBackColor = true;
  769. this.button_pickColor.Click += new System.EventHandler(this.button_pickColor_Click);
  770. //
  771. // label_colorGamut
  772. //
  773. this.label_colorGamut.AutoSize = true;
  774. this.label_colorGamut.Location = new System.Drawing.Point(5, 51);
  775. this.label_colorGamut.Name = "label_colorGamut";
  776. this.label_colorGamut.Size = new System.Drawing.Size(0, 12);
  777. this.label_colorGamut.TabIndex = 35;
  778. //
  779. // panel_colorGamut
  780. //
  781. this.panel_colorGamut.Location = new System.Drawing.Point(64, 47);
  782. this.panel_colorGamut.Name = "panel_colorGamut";
  783. this.panel_colorGamut.Size = new System.Drawing.Size(110, 17);
  784. this.panel_colorGamut.TabIndex = 34;
  785. this.panel_colorGamut.Paint += new System.Windows.Forms.PaintEventHandler(this.panel_colorGamut_Paint);
  786. //
  787. // groupBox_displaySetting
  788. //
  789. this.groupBox_displaySetting.Location = new System.Drawing.Point(179, 646);
  790. this.groupBox_displaySetting.Name = "groupBox_displaySetting";
  791. this.groupBox_displaySetting.Size = new System.Drawing.Size(359, 56);
  792. this.groupBox_displaySetting.TabIndex = 29;
  793. this.groupBox_displaySetting.TabStop = false;
  794. //
  795. // groupBox_histogram
  796. //
  797. this.groupBox_histogram.Location = new System.Drawing.Point(179, 505);
  798. this.groupBox_histogram.Name = "groupBox_histogram";
  799. this.groupBox_histogram.Size = new System.Drawing.Size(179, 135);
  800. this.groupBox_histogram.TabIndex = 28;
  801. this.groupBox_histogram.TabStop = false;
  802. //
  803. // groupBox_colorAdjustment
  804. //
  805. this.groupBox_colorAdjustment.Controls.Add(this.button_colorAdjustmentBS);
  806. this.groupBox_colorAdjustment.Controls.Add(this.button_colorAdjustmentGL);
  807. this.groupBox_colorAdjustment.Controls.Add(this.button_colorAdjustmentRH);
  808. this.groupBox_colorAdjustment.Controls.Add(this.numericUpDown_colorAdjustmentBSD);
  809. this.groupBox_colorAdjustment.Controls.Add(this.numericUpDown_colorAdjustmentBSU);
  810. this.groupBox_colorAdjustment.Controls.Add(this.label_colorAdjustmentBS);
  811. this.groupBox_colorAdjustment.Controls.Add(this.numericUpDown_colorAdjustmentGLD);
  812. this.groupBox_colorAdjustment.Controls.Add(this.numericUpDown_colorAdjustmentGLU);
  813. this.groupBox_colorAdjustment.Controls.Add(this.label_colorAdjustmentGL);
  814. this.groupBox_colorAdjustment.Controls.Add(this.numericUpDown_colorAdjustmentRHD);
  815. this.groupBox_colorAdjustment.Controls.Add(this.numericUpDown_colorAdjustmentRHU);
  816. this.groupBox_colorAdjustment.Controls.Add(this.label_colorAdjustmentRH);
  817. this.groupBox_colorAdjustment.Controls.Add(this.radioButton_checkedHLS);
  818. this.groupBox_colorAdjustment.Controls.Add(this.radioButton_checkedRGB);
  819. this.groupBox_colorAdjustment.Location = new System.Drawing.Point(364, 505);
  820. this.groupBox_colorAdjustment.Name = "groupBox_colorAdjustment";
  821. this.groupBox_colorAdjustment.Size = new System.Drawing.Size(174, 135);
  822. this.groupBox_colorAdjustment.TabIndex = 27;
  823. this.groupBox_colorAdjustment.TabStop = false;
  824. //
  825. // button_colorAdjustmentBS
  826. //
  827. this.button_colorAdjustmentBS.Location = new System.Drawing.Point(134, 99);
  828. this.button_colorAdjustmentBS.Name = "button_colorAdjustmentBS";
  829. this.button_colorAdjustmentBS.Size = new System.Drawing.Size(34, 21);
  830. this.button_colorAdjustmentBS.TabIndex = 34;
  831. this.button_colorAdjustmentBS.Text = "B";
  832. this.button_colorAdjustmentBS.UseVisualStyleBackColor = true;
  833. this.button_colorAdjustmentBS.Click += new System.EventHandler(this.button_colorAdjustmentBS_Click);
  834. //
  835. // button_colorAdjustmentGL
  836. //
  837. this.button_colorAdjustmentGL.Location = new System.Drawing.Point(134, 72);
  838. this.button_colorAdjustmentGL.Name = "button_colorAdjustmentGL";
  839. this.button_colorAdjustmentGL.Size = new System.Drawing.Size(34, 21);
  840. this.button_colorAdjustmentGL.TabIndex = 33;
  841. this.button_colorAdjustmentGL.Text = "G";
  842. this.button_colorAdjustmentGL.UseVisualStyleBackColor = true;
  843. this.button_colorAdjustmentGL.Click += new System.EventHandler(this.button_colorAdjustmentGL_Click);
  844. //
  845. // button_colorAdjustmentRH
  846. //
  847. this.button_colorAdjustmentRH.BackColor = System.Drawing.SystemColors.Control;
  848. this.button_colorAdjustmentRH.Location = new System.Drawing.Point(134, 45);
  849. this.button_colorAdjustmentRH.Margin = new System.Windows.Forms.Padding(0);
  850. this.button_colorAdjustmentRH.Name = "button_colorAdjustmentRH";
  851. this.button_colorAdjustmentRH.Size = new System.Drawing.Size(34, 21);
  852. this.button_colorAdjustmentRH.TabIndex = 32;
  853. this.button_colorAdjustmentRH.Text = "R";
  854. this.button_colorAdjustmentRH.UseVisualStyleBackColor = true;
  855. this.button_colorAdjustmentRH.Click += new System.EventHandler(this.button_colorAdjustmentRH_Click);
  856. //
  857. // numericUpDown_colorAdjustmentBSD
  858. //
  859. this.numericUpDown_colorAdjustmentBSD.Location = new System.Drawing.Point(82, 99);
  860. this.numericUpDown_colorAdjustmentBSD.Maximum = new decimal(new int[] {
  861. 255,
  862. 0,
  863. 0,
  864. 0});
  865. this.numericUpDown_colorAdjustmentBSD.Name = "numericUpDown_colorAdjustmentBSD";
  866. this.numericUpDown_colorAdjustmentBSD.Size = new System.Drawing.Size(40, 21);
  867. this.numericUpDown_colorAdjustmentBSD.TabIndex = 30;
  868. this.numericUpDown_colorAdjustmentBSD.Tag = "max";
  869. this.numericUpDown_colorAdjustmentBSD.Value = new decimal(new int[] {
  870. 10,
  871. 0,
  872. 0,
  873. 0});
  874. this.numericUpDown_colorAdjustmentBSD.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
  875. this.numericUpDown_colorAdjustmentBSD.KeyUp += new System.Windows.Forms.KeyEventHandler(this.RGBoRHLSValue_Changed);
  876. //
  877. // numericUpDown_colorAdjustmentBSU
  878. //
  879. this.numericUpDown_colorAdjustmentBSU.Location = new System.Drawing.Point(37, 99);
  880. this.numericUpDown_colorAdjustmentBSU.Maximum = new decimal(new int[] {
  881. 255,
  882. 0,
  883. 0,
  884. 0});
  885. this.numericUpDown_colorAdjustmentBSU.Name = "numericUpDown_colorAdjustmentBSU";
  886. this.numericUpDown_colorAdjustmentBSU.Size = new System.Drawing.Size(40, 21);
  887. this.numericUpDown_colorAdjustmentBSU.TabIndex = 29;
  888. this.numericUpDown_colorAdjustmentBSU.Tag = "min";
  889. this.numericUpDown_colorAdjustmentBSU.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
  890. this.numericUpDown_colorAdjustmentBSU.KeyUp += new System.Windows.Forms.KeyEventHandler(this.RGBoRHLSValue_Changed);
  891. //
  892. // label_colorAdjustmentBS
  893. //
  894. this.label_colorAdjustmentBS.AutoSize = true;
  895. this.label_colorAdjustmentBS.Location = new System.Drawing.Point(10, 103);
  896. this.label_colorAdjustmentBS.Name = "label_colorAdjustmentBS";
  897. this.label_colorAdjustmentBS.Size = new System.Drawing.Size(23, 12);
  898. this.label_colorAdjustmentBS.TabIndex = 31;
  899. this.label_colorAdjustmentBS.Text = "B:";
  900. //
  901. // numericUpDown_colorAdjustmentGLD
  902. //
  903. this.numericUpDown_colorAdjustmentGLD.Location = new System.Drawing.Point(82, 72);
  904. this.numericUpDown_colorAdjustmentGLD.Maximum = new decimal(new int[] {
  905. 255,
  906. 0,
  907. 0,
  908. 0});
  909. this.numericUpDown_colorAdjustmentGLD.Name = "numericUpDown_colorAdjustmentGLD";
  910. this.numericUpDown_colorAdjustmentGLD.Size = new System.Drawing.Size(40, 21);
  911. this.numericUpDown_colorAdjustmentGLD.TabIndex = 27;
  912. this.numericUpDown_colorAdjustmentGLD.Tag = "max";
  913. this.numericUpDown_colorAdjustmentGLD.Value = new decimal(new int[] {
  914. 10,
  915. 0,
  916. 0,
  917. 0});
  918. this.numericUpDown_colorAdjustmentGLD.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
  919. this.numericUpDown_colorAdjustmentGLD.KeyUp += new System.Windows.Forms.KeyEventHandler(this.RGBoRHLSValue_Changed);
  920. //
  921. // numericUpDown_colorAdjustmentGLU
  922. //
  923. this.numericUpDown_colorAdjustmentGLU.Location = new System.Drawing.Point(37, 72);
  924. this.numericUpDown_colorAdjustmentGLU.Maximum = new decimal(new int[] {
  925. 255,
  926. 0,
  927. 0,
  928. 0});
  929. this.numericUpDown_colorAdjustmentGLU.Name = "numericUpDown_colorAdjustmentGLU";
  930. this.numericUpDown_colorAdjustmentGLU.Size = new System.Drawing.Size(40, 21);
  931. this.numericUpDown_colorAdjustmentGLU.TabIndex = 26;
  932. this.numericUpDown_colorAdjustmentGLU.Tag = "min";
  933. this.numericUpDown_colorAdjustmentGLU.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
  934. this.numericUpDown_colorAdjustmentGLU.KeyUp += new System.Windows.Forms.KeyEventHandler(this.RGBoRHLSValue_Changed);
  935. //
  936. // label_colorAdjustmentGL
  937. //
  938. this.label_colorAdjustmentGL.AutoSize = true;
  939. this.label_colorAdjustmentGL.Location = new System.Drawing.Point(10, 76);
  940. this.label_colorAdjustmentGL.Name = "label_colorAdjustmentGL";
  941. this.label_colorAdjustmentGL.Size = new System.Drawing.Size(23, 12);
  942. this.label_colorAdjustmentGL.TabIndex = 28;
  943. this.label_colorAdjustmentGL.Text = "G:";
  944. //
  945. // numericUpDown_colorAdjustmentRHD
  946. //
  947. this.numericUpDown_colorAdjustmentRHD.Location = new System.Drawing.Point(82, 45);
  948. this.numericUpDown_colorAdjustmentRHD.Maximum = new decimal(new int[] {
  949. 255,
  950. 0,
  951. 0,
  952. 0});
  953. this.numericUpDown_colorAdjustmentRHD.Name = "numericUpDown_colorAdjustmentRHD";
  954. this.numericUpDown_colorAdjustmentRHD.Size = new System.Drawing.Size(40, 21);
  955. this.numericUpDown_colorAdjustmentRHD.TabIndex = 8;
  956. this.numericUpDown_colorAdjustmentRHD.Tag = "max";
  957. this.numericUpDown_colorAdjustmentRHD.Value = new decimal(new int[] {
  958. 10,
  959. 0,
  960. 0,
  961. 0});
  962. this.numericUpDown_colorAdjustmentRHD.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
  963. this.numericUpDown_colorAdjustmentRHD.KeyUp += new System.Windows.Forms.KeyEventHandler(this.RGBoRHLSValue_Changed);
  964. //
  965. // numericUpDown_colorAdjustmentRHU
  966. //
  967. this.numericUpDown_colorAdjustmentRHU.Location = new System.Drawing.Point(37, 45);
  968. this.numericUpDown_colorAdjustmentRHU.Maximum = new decimal(new int[] {
  969. 255,
  970. 0,
  971. 0,
  972. 0});
  973. this.numericUpDown_colorAdjustmentRHU.Name = "numericUpDown_colorAdjustmentRHU";
  974. this.numericUpDown_colorAdjustmentRHU.Size = new System.Drawing.Size(40, 21);
  975. this.numericUpDown_colorAdjustmentRHU.TabIndex = 7;
  976. this.numericUpDown_colorAdjustmentRHU.Tag = "min";
  977. this.numericUpDown_colorAdjustmentRHU.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
  978. this.numericUpDown_colorAdjustmentRHU.KeyUp += new System.Windows.Forms.KeyEventHandler(this.RGBoRHLSValue_Changed);
  979. //
  980. // label_colorAdjustmentRH
  981. //
  982. this.label_colorAdjustmentRH.AutoSize = true;
  983. this.label_colorAdjustmentRH.Location = new System.Drawing.Point(10, 49);
  984. this.label_colorAdjustmentRH.Name = "label_colorAdjustmentRH";
  985. this.label_colorAdjustmentRH.Size = new System.Drawing.Size(23, 12);
  986. this.label_colorAdjustmentRH.TabIndex = 25;
  987. this.label_colorAdjustmentRH.Text = "R:";
  988. //
  989. // radioButton_checkedHLS
  990. //
  991. this.radioButton_checkedHLS.AutoSize = true;
  992. this.radioButton_checkedHLS.Location = new System.Drawing.Point(66, 20);
  993. this.radioButton_checkedHLS.Name = "radioButton_checkedHLS";
  994. this.radioButton_checkedHLS.Size = new System.Drawing.Size(41, 16);
  995. this.radioButton_checkedHLS.TabIndex = 4;
  996. this.radioButton_checkedHLS.Text = "HLS";
  997. this.radioButton_checkedHLS.UseVisualStyleBackColor = true;
  998. this.radioButton_checkedHLS.Visible = false;
  999. this.radioButton_checkedHLS.CheckedChanged += new System.EventHandler(this.radioButton_checkedHLS_CheckedChanged);
  1000. //
  1001. // radioButton_checkedRGB
  1002. //
  1003. this.radioButton_checkedRGB.AutoSize = true;
  1004. this.radioButton_checkedRGB.Checked = true;
  1005. this.radioButton_checkedRGB.Location = new System.Drawing.Point(7, 20);
  1006. this.radioButton_checkedRGB.Name = "radioButton_checkedRGB";
  1007. this.radioButton_checkedRGB.Size = new System.Drawing.Size(41, 16);
  1008. this.radioButton_checkedRGB.TabIndex = 3;
  1009. this.radioButton_checkedRGB.TabStop = true;
  1010. this.radioButton_checkedRGB.Text = "RGB";
  1011. this.radioButton_checkedRGB.UseVisualStyleBackColor = true;
  1012. this.radioButton_checkedRGB.CheckedChanged += new System.EventHandler(this.radioButton_checkedRGB_CheckedChanged);
  1013. //
  1014. // groupBox_review
  1015. //
  1016. this.groupBox_review.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  1017. | System.Windows.Forms.AnchorStyles.Left)
  1018. | System.Windows.Forms.AnchorStyles.Right)));
  1019. this.groupBox_review.Location = new System.Drawing.Point(544, 121);
  1020. this.groupBox_review.Name = "groupBox_review";
  1021. this.groupBox_review.Size = new System.Drawing.Size(622, 581);
  1022. this.groupBox_review.TabIndex = 30;
  1023. this.groupBox_review.TabStop = false;
  1024. //
  1025. // groupBox_report
  1026. //
  1027. this.groupBox_report.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
  1028. this.groupBox_report.Controls.Add(this.button1);
  1029. this.groupBox_report.Controls.Add(this.label_resultPrecision);
  1030. this.groupBox_report.Controls.Add(this.domainUpDown_resultPrecision);
  1031. this.groupBox_report.Controls.Add(this.button_exportResults);
  1032. this.groupBox_report.Controls.Add(this.button_generateReport);
  1033. this.groupBox_report.Location = new System.Drawing.Point(1024, 708);
  1034. this.groupBox_report.Name = "groupBox_report";
  1035. this.groupBox_report.Size = new System.Drawing.Size(142, 188);
  1036. this.groupBox_report.TabIndex = 33;
  1037. this.groupBox_report.TabStop = false;
  1038. //
  1039. // button1
  1040. //
  1041. this.button1.Location = new System.Drawing.Point(28, 104);
  1042. this.button1.Name = "button1";
  1043. this.button1.Size = new System.Drawing.Size(75, 23);
  1044. this.button1.TabIndex = 4;
  1045. this.button1.UseVisualStyleBackColor = true;
  1046. this.button1.Click += new System.EventHandler(this.button1_Click);
  1047. //
  1048. // label_resultPrecision
  1049. //
  1050. this.label_resultPrecision.AutoSize = true;
  1051. this.label_resultPrecision.Location = new System.Drawing.Point(21, 148);
  1052. this.label_resultPrecision.Name = "label_resultPrecision";
  1053. this.label_resultPrecision.Size = new System.Drawing.Size(0, 12);
  1054. this.label_resultPrecision.TabIndex = 3;
  1055. //
  1056. // domainUpDown_resultPrecision
  1057. //
  1058. this.domainUpDown_resultPrecision.Location = new System.Drawing.Point(63, 142);
  1059. this.domainUpDown_resultPrecision.Name = "domainUpDown_resultPrecision";
  1060. this.domainUpDown_resultPrecision.ReadOnly = true;
  1061. this.domainUpDown_resultPrecision.Size = new System.Drawing.Size(41, 21);
  1062. this.domainUpDown_resultPrecision.TabIndex = 2;
  1063. this.domainUpDown_resultPrecision.Text = "2";
  1064. this.domainUpDown_resultPrecision.SelectedItemChanged += new System.EventHandler(this.domainUpDown_resultPrecision_SelectedItemChanged);
  1065. //
  1066. // button_exportResults
  1067. //
  1068. this.button_exportResults.Location = new System.Drawing.Point(28, 63);
  1069. this.button_exportResults.Name = "button_exportResults";
  1070. this.button_exportResults.Size = new System.Drawing.Size(75, 24);
  1071. this.button_exportResults.TabIndex = 1;
  1072. this.button_exportResults.UseVisualStyleBackColor = true;
  1073. this.button_exportResults.Click += new System.EventHandler(this.button_exportResults_Click);
  1074. //
  1075. // button_generateReport
  1076. //
  1077. this.button_generateReport.Location = new System.Drawing.Point(29, 24);
  1078. this.button_generateReport.Name = "button_generateReport";
  1079. this.button_generateReport.Size = new System.Drawing.Size(75, 23);
  1080. this.button_generateReport.TabIndex = 0;
  1081. this.button_generateReport.UseVisualStyleBackColor = true;
  1082. this.button_generateReport.Click += new System.EventHandler(this.button_generateReport_Click);
  1083. //
  1084. // groupBox6groupBox_analysisResult2
  1085. //
  1086. this.groupBox6groupBox_analysisResult2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
  1087. | System.Windows.Forms.AnchorStyles.Right)));
  1088. this.groupBox6groupBox_analysisResult2.Controls.Add(this.listView_analysisResult2);
  1089. this.groupBox6groupBox_analysisResult2.Controls.Add(this.listView_analysisResult);
  1090. this.groupBox6groupBox_analysisResult2.Location = new System.Drawing.Point(242, 708);
  1091. this.groupBox6groupBox_analysisResult2.Name = "groupBox6groupBox_analysisResult2";
  1092. this.groupBox6groupBox_analysisResult2.Size = new System.Drawing.Size(769, 188);
  1093. this.groupBox6groupBox_analysisResult2.TabIndex = 32;
  1094. this.groupBox6groupBox_analysisResult2.TabStop = false;
  1095. //
  1096. // listView_analysisResult2
  1097. //
  1098. this.listView_analysisResult2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  1099. | System.Windows.Forms.AnchorStyles.Right)));
  1100. this.listView_analysisResult2.FullRowSelect = true;
  1101. this.listView_analysisResult2.GridLines = true;
  1102. this.listView_analysisResult2.HideSelection = false;
  1103. this.listView_analysisResult2.Location = new System.Drawing.Point(6, 114);
  1104. this.listView_analysisResult2.MultiSelect = false;
  1105. this.listView_analysisResult2.Name = "listView_analysisResult2";
  1106. this.listView_analysisResult2.Size = new System.Drawing.Size(757, 63);
  1107. this.listView_analysisResult2.TabIndex = 2;
  1108. this.listView_analysisResult2.UseCompatibleStateImageBehavior = false;
  1109. //
  1110. // listView_analysisResult
  1111. //
  1112. this.listView_analysisResult.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  1113. | System.Windows.Forms.AnchorStyles.Right)));
  1114. this.listView_analysisResult.FullRowSelect = true;
  1115. this.listView_analysisResult.GridLines = true;
  1116. this.listView_analysisResult.HideSelection = false;
  1117. this.listView_analysisResult.Location = new System.Drawing.Point(6, 20);
  1118. this.listView_analysisResult.MultiSelect = false;
  1119. this.listView_analysisResult.Name = "listView_analysisResult";
  1120. this.listView_analysisResult.Size = new System.Drawing.Size(757, 88);
  1121. this.listView_analysisResult.TabIndex = 2;
  1122. this.listView_analysisResult.UseCompatibleStateImageBehavior = false;
  1123. //
  1124. // groupBox_analysisResult1
  1125. //
  1126. this.groupBox_analysisResult1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
  1127. this.groupBox_analysisResult1.Controls.Add(this.listBox_analysisResult);
  1128. this.groupBox_analysisResult1.Controls.Add(this.button_remove);
  1129. this.groupBox_analysisResult1.Controls.Add(this.button_all);
  1130. this.groupBox_analysisResult1.Location = new System.Drawing.Point(12, 708);
  1131. this.groupBox_analysisResult1.Name = "groupBox_analysisResult1";
  1132. this.groupBox_analysisResult1.Size = new System.Drawing.Size(224, 188);
  1133. this.groupBox_analysisResult1.TabIndex = 31;
  1134. this.groupBox_analysisResult1.TabStop = false;
  1135. //
  1136. // listBox_analysisResult
  1137. //
  1138. this.listBox_analysisResult.CheckOnClick = true;
  1139. this.listBox_analysisResult.FormattingEnabled = true;
  1140. this.listBox_analysisResult.HorizontalScrollbar = true;
  1141. this.listBox_analysisResult.Location = new System.Drawing.Point(6, 53);
  1142. this.listBox_analysisResult.Name = "listBox_analysisResult";
  1143. this.listBox_analysisResult.Size = new System.Drawing.Size(199, 116);
  1144. this.listBox_analysisResult.TabIndex = 0;
  1145. this.listBox_analysisResult.SelectedIndexChanged += new System.EventHandler(this.listBox_analysisResult_SelectedIndexChanged);
  1146. //
  1147. // button_remove
  1148. //
  1149. this.button_remove.Location = new System.Drawing.Point(130, 24);
  1150. this.button_remove.Name = "button_remove";
  1151. this.button_remove.Size = new System.Drawing.Size(75, 23);
  1152. this.button_remove.TabIndex = 8;
  1153. this.button_remove.UseVisualStyleBackColor = true;
  1154. this.button_remove.Click += new System.EventHandler(this.button_remove_Click);
  1155. //
  1156. // button_all
  1157. //
  1158. this.button_all.Location = new System.Drawing.Point(14, 24);
  1159. this.button_all.Name = "button_all";
  1160. this.button_all.Size = new System.Drawing.Size(75, 23);
  1161. this.button_all.TabIndex = 1;
  1162. this.button_all.UseVisualStyleBackColor = true;
  1163. this.button_all.Click += new System.EventHandler(this.button_all_Click);
  1164. //
  1165. // groupBox1
  1166. //
  1167. this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  1168. | System.Windows.Forms.AnchorStyles.Right)));
  1169. this.groupBox1.Controls.Add(this.radioButton5);
  1170. this.groupBox1.Controls.Add(this.radioButton3);
  1171. this.groupBox1.Controls.Add(this.radioButton4);
  1172. this.groupBox1.Controls.Add(this.button4);
  1173. this.groupBox1.Controls.Add(this.button3);
  1174. this.groupBox1.Location = new System.Drawing.Point(544, 71);
  1175. this.groupBox1.Name = "groupBox1";
  1176. this.groupBox1.Size = new System.Drawing.Size(621, 44);
  1177. this.groupBox1.TabIndex = 34;
  1178. this.groupBox1.TabStop = false;
  1179. //
  1180. // radioButton3
  1181. //
  1182. this.radioButton3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1183. this.radioButton3.AutoSize = true;
  1184. this.radioButton3.Checked = true;
  1185. this.radioButton3.Location = new System.Drawing.Point(377, 19);
  1186. this.radioButton3.Name = "radioButton3";
  1187. this.radioButton3.Size = new System.Drawing.Size(59, 16);
  1188. this.radioButton3.TabIndex = 14;
  1189. this.radioButton3.TabStop = true;
  1190. this.radioButton3.Text = "旧算法";
  1191. this.radioButton3.UseVisualStyleBackColor = true;
  1192. //
  1193. // radioButton4
  1194. //
  1195. this.radioButton4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1196. this.radioButton4.AutoSize = true;
  1197. this.radioButton4.Location = new System.Drawing.Point(314, 19);
  1198. this.radioButton4.Name = "radioButton4";
  1199. this.radioButton4.Size = new System.Drawing.Size(59, 16);
  1200. this.radioButton4.TabIndex = 13;
  1201. this.radioButton4.Text = "新算法";
  1202. this.radioButton4.UseVisualStyleBackColor = true;
  1203. //
  1204. // button4
  1205. //
  1206. this.button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1207. this.button4.Location = new System.Drawing.Point(459, 15);
  1208. this.button4.Name = "button4";
  1209. this.button4.Size = new System.Drawing.Size(75, 23);
  1210. this.button4.TabIndex = 9;
  1211. this.button4.Text = "应用全部";
  1212. this.button4.UseVisualStyleBackColor = true;
  1213. this.button4.Click += new System.EventHandler(this.button4_Click);
  1214. //
  1215. // button3
  1216. //
  1217. this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1218. this.button3.Location = new System.Drawing.Point(540, 15);
  1219. this.button3.Name = "button3";
  1220. this.button3.Size = new System.Drawing.Size(75, 23);
  1221. this.button3.TabIndex = 8;
  1222. this.button3.Text = "保存全部";
  1223. this.button3.UseVisualStyleBackColor = true;
  1224. this.button3.Click += new System.EventHandler(this.button3_Click);
  1225. //
  1226. // radioButton5
  1227. //
  1228. this.radioButton5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1229. this.radioButton5.AutoSize = true;
  1230. this.radioButton5.Location = new System.Drawing.Point(225, 18);
  1231. this.radioButton5.Name = "radioButton5";
  1232. this.radioButton5.Size = new System.Drawing.Size(83, 16);
  1233. this.radioButton5.TabIndex = 15;
  1234. this.radioButton5.Text = "新算法(二)";
  1235. this.radioButton5.UseVisualStyleBackColor = true;
  1236. //
  1237. // InclusionsStandardDialog
  1238. //
  1239. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  1240. this.ClientSize = new System.Drawing.Size(1177, 908);
  1241. this.Controls.Add(this.groupBox1);
  1242. this.Controls.Add(this.groupBox_baseSetting);
  1243. this.Controls.Add(this.groupBox_report);
  1244. this.Controls.Add(this.groupBox6groupBox_analysisResult2);
  1245. this.Controls.Add(this.groupBox_analysisResult1);
  1246. this.Controls.Add(this.groupBox_review);
  1247. this.Controls.Add(this.groupBox_displaySetting);
  1248. this.Controls.Add(this.groupBox_histogram);
  1249. this.Controls.Add(this.groupBox_colorAdjustment);
  1250. this.Controls.Add(this.groupBox_colorSetting);
  1251. this.Controls.Add(this.groupBox_img);
  1252. this.Controls.Add(this.groupBox_operating);
  1253. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  1254. this.Location = new System.Drawing.Point(0, 0);
  1255. this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
  1256. this.Name = "InclusionsStandardDialog";
  1257. this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.InclusionsStandardDialog_FormClosing);
  1258. this.Controls.SetChildIndex(this.groupBox_operating, 0);
  1259. this.Controls.SetChildIndex(this.groupBox_img, 0);
  1260. this.Controls.SetChildIndex(this.groupBox_colorSetting, 0);
  1261. this.Controls.SetChildIndex(this.groupBox_colorAdjustment, 0);
  1262. this.Controls.SetChildIndex(this.groupBox_histogram, 0);
  1263. this.Controls.SetChildIndex(this.groupBox_displaySetting, 0);
  1264. this.Controls.SetChildIndex(this.groupBox_review, 0);
  1265. this.Controls.SetChildIndex(this.groupBox_analysisResult1, 0);
  1266. this.Controls.SetChildIndex(this.groupBox6groupBox_analysisResult2, 0);
  1267. this.Controls.SetChildIndex(this.groupBox_report, 0);
  1268. this.Controls.SetChildIndex(this.groupBox_baseSetting, 0);
  1269. this.Controls.SetChildIndex(this.groupBox1, 0);
  1270. this.groupBox_operating.ResumeLayout(false);
  1271. this.groupBox_operating.PerformLayout();
  1272. this.groupBox_img.ResumeLayout(false);
  1273. this.groupBox_baseSetting.ResumeLayout(false);
  1274. this.groupBox_baseSetting.PerformLayout();
  1275. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_lwRatioLimit)).EndInit();
  1276. this.groupBox_colorSetting.ResumeLayout(false);
  1277. this.groupBox_colorSetting.PerformLayout();
  1278. this.groupBox_colorAdjustment.ResumeLayout(false);
  1279. this.groupBox_colorAdjustment.PerformLayout();
  1280. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentBSD)).EndInit();
  1281. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentBSU)).EndInit();
  1282. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentGLD)).EndInit();
  1283. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentGLU)).EndInit();
  1284. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentRHD)).EndInit();
  1285. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_colorAdjustmentRHU)).EndInit();
  1286. this.groupBox_report.ResumeLayout(false);
  1287. this.groupBox_report.PerformLayout();
  1288. this.groupBox6groupBox_analysisResult2.ResumeLayout(false);
  1289. this.groupBox_analysisResult1.ResumeLayout(false);
  1290. this.groupBox1.ResumeLayout(false);
  1291. this.groupBox1.PerformLayout();
  1292. this.ResumeLayout(false);
  1293. }
  1294. private void abc(object sender, EventArgs e)
  1295. {
  1296. if (this.listBox_analysisResult.Items.Count > 0)
  1297. {
  1298. MessageBox.Show(PdnResources.GetString("Menu.sultsbeforemodifyingtheKvalue.Text"));
  1299. this.comboBox1.SelectedIndex = chooseK;
  1300. return;
  1301. }
  1302. if (this.lstView_img.FocusedItem != null)
  1303. {
  1304. if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
  1305. {
  1306. everyImgData[this.lstView_img.FocusedItem.Index].kNum = Convert.ToInt32(this.comboBox1.SelectedItem);
  1307. }
  1308. else
  1309. {
  1310. CurrentPageData data = new CurrentPageData(this.autoJiaoBen);
  1311. data.directionIndex = comboBox_rollingDirection.SelectedIndex;
  1312. data.ratio = numericUpDown_lwRatioLimit.Value;
  1313. data.colorCheck = this.checkBox_showColorGamutPhase.Checked;
  1314. data.kNum = Convert.ToInt32(this.comboBox1.SelectedItem);
  1315. everyImgData.Add(this.lstView_img.FocusedItem.Index, data);
  1316. }
  1317. }
  1318. this.comboBox1_SelectedIndexChanged(sender, e);
  1319. }
  1320. public void Initialize()
  1321. {
  1322. if (this.Text == "DIN50602_1985_MethodK")
  1323. {
  1324. this.comboBox1.Visible = true;
  1325. this.label1.Visible = true;
  1326. this.button2.Visible = true;
  1327. this.btn_drawRecognitionArea.Visible = false;
  1328. this.isK = 1;
  1329. }
  1330. else
  1331. {
  1332. this.comboBox1.Visible = false;
  1333. this.label1.Visible = false;
  1334. this.button2.Visible = false;
  1335. this.btn_drawRecognitionArea.Visible = true;
  1336. this.isK = 2;
  1337. }
  1338. radioButton1.Enabled = false;
  1339. radioButton2.Enabled = false;
  1340. checkBox1.Enabled = false;
  1341. checkBox2.Enabled = false;
  1342. this.Load += new System.EventHandler(this.GrainSizeDialog_Load);
  1343. this.comboBox_rollingDirection.SelectedIndex = 0;
  1344. this.comboBox_rollingDirection.SelectedIndexChanged += new System.EventHandler(this.comboBox_rollingDirection_SelectedIndexChanged);
  1345. this.comboBox1.SelectedIndex = 3;
  1346. //this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
  1347. for (int i = 10; i >= 1; i--)
  1348. {
  1349. this.domainUpDown_resultPrecision.Items.Add(i.ToString());
  1350. }
  1351. this.domainUpDown_resultPrecision.SelectedIndex = 8;
  1352. this.documentItems = new Dictionary<int, DocumentItem>();
  1353. //初始化图片列表
  1354. for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
  1355. {
  1356. this.imageList_img.Images.Add("img" + i, this.appWorkspace.DocumentWorkspaces[i].BinarizationThumbnail);
  1357. this.lstView_img.Items.Add("", i);
  1358. this.lstView_img.Items[i].ImageIndex = i;
  1359. this.lstView_img.Items[i].Text = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
  1360. this.lstView_img.Items[i].Name = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
  1361. if (this.appWorkspace.DocumentWorkspaces[i].Equals(this.appWorkspace.ActiveDocumentWorkspace))
  1362. {
  1363. this.imgIndex = i;
  1364. }
  1365. }
  1366. //
  1367. //初始化图像控件
  1368. //
  1369. this.documentWorkspace = new DocumentWorkspaceWindow(this.appWorkspace);
  1370. this.documentWorkspace.Cursor = Cursors.Default;
  1371. this.documentWorkspace.Dock = DockStyle.Fill;
  1372. this.documentWorkspace.HookMouseEvents();
  1373. this.documentWorkspace.AuxiliaryLineEnabled = false;
  1374. this.documentWorkspace.Visible = true;
  1375. this.documentWorkspace.panel.Click += new EventHandler(this.documentWorkspace_panel_Click);
  1376. this.documentWorkspace.panel.MouseDown += new MouseEventHandler(this.documentWorkspace_panel_MouseDown);
  1377. this.documentWorkspace.panel.MouseMove += new MouseEventHandler(this.documentWorkspace_panel_MouseMove);
  1378. this.documentWorkspace.panel.MouseUp += new MouseEventHandler(this.documentWorkspace_panel_MouseUp);
  1379. PdnBaseForm.RegisterFormHotKey(Keys.Delete, (key) => { this.documentWorkspace.MouseEvent_Del(null, null); return true; });
  1380. this.groupBox_review.Controls.Add(this.documentWorkspace);
  1381. //
  1382. //初始化操作按钮
  1383. //
  1384. this.commonControlButtons = new CommonControlButtons();
  1385. this.commonControlButtons.Dock = DockStyle.Top;
  1386. this.commonControlButtons.Height = 30;
  1387. this.commonControlButtons.HideZoomToWindowAndActualSize();
  1388. this.commonControlButtons.zoomInButton.Click += new EventHandler(zoomInButton_Click);
  1389. this.commonControlButtons.zoomOutButton.Click += new EventHandler(zoomOutButton_Click);
  1390. this.commonControlButtons.zoomToWindowButton.Click += new EventHandler(zoomToWindowButton_Click);
  1391. this.commonControlButtons.actualSizeButton.Click += new EventHandler(actualSizeButton_Click);
  1392. this.commonControlButtons.pointerButton.Click += new EventHandler(pointerButton_Click);
  1393. this.commonControlButtons.mobileModeButton.Click += new EventHandler(mobileModeButton_Click);
  1394. groupBox_review.Controls.Add(this.commonControlButtons);
  1395. this.binaryExtractionModel.ColorInterval = 1;
  1396. this.radioButton_checkedRGB.FlatStyle = FlatStyle.Flat;
  1397. this.radioButton_checkedRGB.BackColor = Color.FromArgb(225, 225, 225);
  1398. this.radioButton_checkedRGB.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215);
  1399. this.radioButton_checkedRGB.FlatAppearance.BorderSize = 2;
  1400. // 直方图
  1401. this.histogramControl_colorSetting.DragOneEventActionFinish += new EventHandler<EventArgs<int>>(this.histogramControl_colorSetting_DragOneEvent);
  1402. this.histogramControl_colorSetting.DragTwoEventActionFinish += new EventHandler<EventArgs<int>>(this.histogramControl_colorSetting_DragTwoEvent);
  1403. // 初始化报告列表
  1404. this.listView_analysisResult.View = View.Details;
  1405. this.listView_analysisResult2.View = View.Details;
  1406. this.listBox_analysisResult.DisplayMember = "Display";
  1407. this.listBox_analysisResult.ValueMember = "Value";
  1408. }
  1409. #endregion
  1410. #region 事件
  1411. #region 公共按钮
  1412. private void zoomInButton_Click(object sender, EventArgs e)
  1413. {
  1414. this.documentWorkspace.ZoomIn();
  1415. }
  1416. private void zoomOutButton_Click(object sender, EventArgs e)
  1417. {
  1418. this.documentWorkspace.ZoomOut();
  1419. }
  1420. private void zoomToWindowButton_Click(object sender, EventArgs e)
  1421. {
  1422. this.documentWorkspace.ZoomBasis = ZoomBasis.FitToWindow;
  1423. }
  1424. private void actualSizeButton_Click(object sender, EventArgs e)
  1425. {
  1426. this.documentWorkspace.ZoomBasis = ZoomBasis.ScaleFactor;
  1427. this.documentWorkspace.ScaleFactor = ScaleFactor.OneToOne;
  1428. }
  1429. private void pointerButton_Click(object sender, EventArgs e)
  1430. {
  1431. this.documentWorkspace.Cursor = Cursors.Default;
  1432. this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.InclusionSelectRecognitionArea;
  1433. }
  1434. private void mobileModeButton_Click(object sender, EventArgs e)
  1435. {
  1436. this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.MoveMode;
  1437. }
  1438. #endregion
  1439. private void btn_selectClear_Click(object sender, EventArgs e)
  1440. {
  1441. this.clearSelect = true;
  1442. }
  1443. private void label_displaySetting(object sender, EventArgs e)
  1444. {
  1445. if (this.lstView_img.FocusedItem == null || !this.lstView_img.FocusedItem.Selected)
  1446. {
  1447. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text"));
  1448. return;
  1449. }
  1450. if (this.documentWorkspace.phaseModels[0].mat == null)
  1451. {
  1452. MessageBox.Show(PdnResources.GetString("Menu.Pleaseperformabinaryoperationfirst.text"));
  1453. return;
  1454. }
  1455. //按钮选择
  1456. if (this.isK == 1)
  1457. {
  1458. this.documentWorkspace.ActiveTool = DrawToolType.InclusionSelectRecognitionArea;
  1459. }
  1460. if (this.selectedTypesOfInclusions != null)
  1461. {
  1462. if (this.selectedTypesOfInclusions.Equals(this.methodOfAssessment.inclusionsStandard.globalSettings.typeDics[((Button)sender).Text]))
  1463. {
  1464. this.selectedTypesOfInclusions = null;
  1465. this.button1.Focus();
  1466. }
  1467. else
  1468. {
  1469. this.selectedTypesOfInclusions = this.methodOfAssessment.inclusionsStandard.globalSettings.typeDics[((Button)sender).Text];
  1470. }
  1471. }
  1472. else
  1473. {
  1474. this.selectedTypesOfInclusions = this.methodOfAssessment.inclusionsStandard.globalSettings.typeDics[((Button)sender).Text];
  1475. }
  1476. }
  1477. private void button_setting_Click(object sender, EventArgs e)
  1478. {
  1479. AnalyzeSettingDialog recombinationRateSetDialog = new AnalyzeSettingDialog(this, this.methodOfAssessment.resourcesName);
  1480. if (recombinationRateSetDialog.hasModule)
  1481. {
  1482. recombinationRateSetDialog.StartPosition = FormStartPosition.CenterScreen;
  1483. recombinationRateSetDialog.ShowDialog();
  1484. }
  1485. else
  1486. {
  1487. recombinationRateSetDialog = null;
  1488. }
  1489. }
  1490. private void checkBox_showColorGamutPhase_CheckedChanged(object sender, EventArgs e)
  1491. {
  1492. if (this.documentWorkspace.phaseModels.Count == 0)
  1493. {
  1494. return;
  1495. }
  1496. CheckBox checkBox = (CheckBox)sender;
  1497. if (this.lstView_img.FocusedItem != null)
  1498. {
  1499. if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
  1500. {
  1501. everyImgData[this.lstView_img.FocusedItem.Index].colorCheck = this.checkBox_showColorGamutPhase.Checked;
  1502. }
  1503. else
  1504. {
  1505. CurrentPageData data = new CurrentPageData(this.autoJiaoBen);
  1506. data.directionIndex = comboBox_rollingDirection.SelectedIndex;
  1507. data.ratio = numericUpDown_lwRatioLimit.Value;
  1508. data.colorCheck = this.checkBox_showColorGamutPhase.Checked;
  1509. everyImgData.Add(this.lstView_img.FocusedItem.Index, data);
  1510. }
  1511. }
  1512. this.documentWorkspace.phaseModels[this.documentWorkspace.phaseModels.Count - 1].choise = checkBox.Checked;
  1513. this.documentWorkspace.Refresh();
  1514. }
  1515. private void btn_clean_result_Click(object sender, EventArgs e)
  1516. {
  1517. this.tempAnalysisResult = null;
  1518. ToolInclusionSelect.CleanInclusionAll(this.documentWorkspace);
  1519. radioButton1.Enabled = false;
  1520. radioButton2.Enabled = false;
  1521. checkBox1.Enabled = false;
  1522. checkBox2.Enabled = false;
  1523. userAll = false;
  1524. }
  1525. private void btn_statistics_Click(object sender, EventArgs e)
  1526. {
  1527. if (this.isK == 1)
  1528. {
  1529. this.documentWorkspace.ActiveTool = DrawToolType.InclusionSelectRecognitionArea;
  1530. }
  1531. this.startStatistics();
  1532. radioButton1.Enabled = true;
  1533. radioButton2.Enabled = true;
  1534. checkBox1.Enabled = true;
  1535. checkBox2.Enabled = true;
  1536. }
  1537. private void btn_saveresult_Click(object sender, EventArgs e)
  1538. {
  1539. if (this.tempAnalysisResult == null)
  1540. {
  1541. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttostartstatistics.text"));
  1542. return;
  1543. }
  1544. if (analysisResults.ContainsKey(this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index]))
  1545. {
  1546. DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Theresuethertoreplace.text") + "?", PdnResources.GetString("Form.OkButton.Text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
  1547. if (dr != DialogResult.OK)
  1548. {
  1549. return;
  1550. }
  1551. analysisResults[this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index]] = this.tempAnalysisResult;
  1552. }
  1553. else
  1554. {
  1555. analysisResults.Add(this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index], this.tempAnalysisResult);
  1556. }
  1557. buildListBox_analysisResult();
  1558. }
  1559. private void lstView_img_SelectedIndexChanged(object sender, EventArgs e)
  1560. {
  1561. if (this.lstView_img.FocusedItem != null && this.lstView_img.FocusedItem.Selected)
  1562. {
  1563. this.imgPxPerUnit = this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].GetRuler(MeasurementUnit.Micron);
  1564. if (this.methodOfAssessment != null)
  1565. {
  1566. this.methodOfAssessment = getMethodOfAssessment();
  1567. MethodOfAssessment.activeMethod = this.methodOfAssessment;
  1568. SetAnalyzeModelFromXml(this.methodOfAssessment.resourcesName);
  1569. }
  1570. this.imageMat = this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].CompositionSurface.CreatedAliasedMat();
  1571. this.tempAnalysisResult = null;
  1572. //二值化
  1573. binaryClass.listView1_SelectedIndexChanged(this.imageMat.Clone(), this.imageList_img.Images.Keys[this.lstView_img.FocusedItem.Index]);
  1574. var gList = new GraphicsList();
  1575. for (int i = 0; i < this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].GraphicsList.Count; i++)
  1576. {
  1577. var obj = this.appWorkspace.DocumentWorkspaces[this.lstView_img.FocusedItem.Index].GraphicsList[i].Clone();
  1578. gList.Add(obj);
  1579. }
  1580. this.documentWorkspace.GraphicsList = gList;
  1581. this.documentWorkspace.ActiveTool = DrawToolType.InclusionSelectRecognitionArea;
  1582. if (this.isK == 1)
  1583. {
  1584. this.documentWorkspace.GraphicsList.DeleteAllView();
  1585. var line = new ViewRectangle(0, 0, this.imageMat.Width, this.imageMat.Height);
  1586. line.ISurfaceBox = documentWorkspace;
  1587. line.combineMode = (CombineMode)Enum.Parse(typeof(CombineMode), "Union");
  1588. line.Selected = true;
  1589. this.documentWorkspace.AddGraphicsFromForm(line);
  1590. if (!this.bcBinaryChecked())
  1591. {
  1592. this.documentWorkspace.ActiveTool = DrawToolType.Pointer;
  1593. }
  1594. this.documentWorkspace.Refresh();
  1595. }
  1596. this.histogramControl_colorSetting.CreateHistogram(this.imageMat, false, this.histogramControl_colorSetting.Width - 1, this.histogramControl_colorSetting.Height - 5, HistogramRGBSelect);
  1597. if (userAll)
  1598. {
  1599. this.startStatistics();
  1600. }
  1601. if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
  1602. {
  1603. if (everyImgData[this.lstView_img.FocusedItem.Index].thisSelectedColorOfInclusions != null)
  1604. {
  1605. this.colorName = everyImgData[this.lstView_img.FocusedItem.Index].thisSelectedColorOfInclusions.colorName;
  1606. getOldCheck();
  1607. this.selectedColorOfInclusions = everyImgData[this.lstView_img.FocusedItem.Index].thisSelectedColorOfInclusions;
  1608. CalcRGBOrHLSValue();
  1609. UpdateHistogramStartAndEnd();
  1610. }
  1611. else
  1612. {
  1613. if (this.oldSelectedColorOfInclusions != null)
  1614. {
  1615. this.colorName = this.oldSelectedColorOfInclusions.colorName;
  1616. getOldCheck();
  1617. 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);
  1618. everyImgData[this.lstView_img.FocusedItem.Index].thisSelectedColorOfInclusions = this.selectedColorOfInclusions;
  1619. CalcRGBOrHLSValue();
  1620. UpdateHistogramStartAndEnd();
  1621. }
  1622. }
  1623. comboBox1.SelectedIndex = everyImgData[this.lstView_img.FocusedItem.Index].kNum;
  1624. if (everyImgData[this.lstView_img.FocusedItem.Index].directionIndex >= 0)
  1625. {
  1626. comboBox_rollingDirection.SelectedIndex = everyImgData[this.lstView_img.FocusedItem.Index].directionIndex;
  1627. }
  1628. if (everyImgData[this.lstView_img.FocusedItem.Index].ratio >= numericUpDown_lwRatioLimit.Minimum)
  1629. {
  1630. numericUpDown_lwRatioLimit.Value = everyImgData[this.lstView_img.FocusedItem.Index].ratio;
  1631. }
  1632. checkBox_showColorGamutPhase.Checked = everyImgData[this.lstView_img.FocusedItem.Index].colorCheck;
  1633. }
  1634. else
  1635. {
  1636. if (this.oldSelectedColorOfInclusions != null)
  1637. {
  1638. this.colorName = this.oldSelectedColorOfInclusions.colorName;
  1639. getOldCheck();
  1640. 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);
  1641. CalcRGBOrHLSValue();
  1642. UpdateHistogramStartAndEnd();
  1643. }
  1644. comboBox1.SelectedIndex = 5;
  1645. if (thisParameters != null)
  1646. {
  1647. if (thisParameters.parameter1 >= 0)
  1648. {
  1649. comboBox_rollingDirection.SelectedIndex = thisParameters.parameter1;
  1650. }
  1651. if (thisParameters.parameter2 >= numericUpDown_lwRatioLimit.Minimum)
  1652. {
  1653. numericUpDown_lwRatioLimit.Value = thisParameters.parameter2;
  1654. }
  1655. checkBox_showColorGamutPhase.Checked = thisParameters.parameter5;
  1656. }
  1657. }
  1658. }
  1659. else
  1660. {
  1661. this.documentWorkspace.Visible = false;
  1662. }
  1663. }
  1664. private void listBox_analysisResult_SelectedIndexChanged(object sender, EventArgs e)
  1665. {
  1666. buildListView_analysisResult();
  1667. }
  1668. private void button_all_Click(object sender, EventArgs e)
  1669. {
  1670. for (int i = 0; i < this.listBox_analysisResult.Items.Count; i++)
  1671. {
  1672. this.listBox_analysisResult.SetItemChecked(i, true);
  1673. }
  1674. buildListView_analysisResult();
  1675. }
  1676. private void button_remove_Click(object sender, EventArgs e)
  1677. {
  1678. if (this.listBox_analysisResult.Items.Count == 0)
  1679. {
  1680. MessageBox.Show(PdnResources.GetString("Menu.Noresultsatmeasuring.text"));
  1681. return;
  1682. }
  1683. if (MessageBox.Show(PdnResources.GetString("Menu.Areyousuretodeleteth.text") + "?", "", MessageBoxButtons.OKCancel) == DialogResult.OK)
  1684. {
  1685. if (this.listBox_analysisResult.CheckedItems.Count == 0)
  1686. {
  1687. return;
  1688. }
  1689. foreach (var item in this.listBox_analysisResult.CheckedItems)
  1690. {
  1691. this.analysisResults.Remove(((LocalListViewItem)item).Value);
  1692. }
  1693. buildListBox_analysisResult();
  1694. }
  1695. }
  1696. private void btn_editInclusions_Click(object sender, EventArgs e)
  1697. {
  1698. if (this.tempAnalysisResult == null)
  1699. {
  1700. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttostartstatistics.text"));
  1701. return;
  1702. }
  1703. DocumentItem item = new DocumentItem(this.imageMat.Clone(), this.documentWorkspace.GraphicsList, this.documentWorkspace.phaseModels);
  1704. new InclusionEditDialog(this.Text, this.appWorkspace, item, this.tempAnalysisResult, this.inclusionEditDialogCloseCallback, this.is_showRectangle, this.is_showOval, this.is_full, this.isK).ShowDialog();
  1705. }
  1706. private void numericUpDown_lwRatioLimit_ValueChanged(object sender, EventArgs e)
  1707. {
  1708. this.methodOfAssessment.inclusionsStandard.globalSettings.lwRatioLimit = Decimal.ToDouble(this.numericUpDown_lwRatioLimit.Value);
  1709. if (this.lstView_img.FocusedItem != null)
  1710. {
  1711. if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
  1712. {
  1713. everyImgData[this.lstView_img.FocusedItem.Index].ratio = this.numericUpDown_lwRatioLimit.Value;
  1714. }
  1715. else
  1716. {
  1717. CurrentPageData data = new CurrentPageData(this.autoJiaoBen);
  1718. data.directionIndex = comboBox_rollingDirection.SelectedIndex;
  1719. data.ratio = numericUpDown_lwRatioLimit.Value;
  1720. everyImgData.Add(this.lstView_img.FocusedItem.Index, data);
  1721. }
  1722. }
  1723. }
  1724. private void numericUpDown_threshold_ValueChanged(object sender, EventArgs e)
  1725. {
  1726. //this.methodOfAssessment.inclusionsStandard.globalSettings.binaryThreshold = Decimal.ToInt32(this.numericUpDown_threshold.Value);
  1727. }
  1728. private void radioButton_colorSelect_CheckedChanged(object sender, EventArgs e)
  1729. {
  1730. RadioButton checkedButton = this.groupBox_colorSetting.Controls.OfType<RadioButton>()
  1731. .FirstOrDefault(r => r.Checked);
  1732. }
  1733. private void radioButton_checkedRGB_CheckedChanged(object sender, EventArgs e)
  1734. {
  1735. if (this.radioButton_checkedRGB.Checked)
  1736. {
  1737. this.label_colorAdjustmentRH.Text = "R";
  1738. this.label_colorAdjustmentGL.Text = "G";
  1739. this.label_colorAdjustmentBS.Text = "B";
  1740. this.button_colorAdjustmentRH.Text = "R";
  1741. this.button_colorAdjustmentGL.Text = "G";
  1742. this.button_colorAdjustmentBS.Text = "B";
  1743. CalcRGBOrHLSValue();
  1744. UpdateHistogramStartAndEnd();
  1745. }
  1746. }
  1747. private void radioButton_checkedHLS_CheckedChanged(object sender, EventArgs e)
  1748. {
  1749. if (this.radioButton_checkedHLS.Checked)
  1750. {
  1751. this.label_colorAdjustmentRH.Text = "H";
  1752. this.label_colorAdjustmentGL.Text = "L";
  1753. this.label_colorAdjustmentBS.Text = "S";
  1754. this.button_colorAdjustmentRH.Text = "H";
  1755. this.button_colorAdjustmentGL.Text = "L";
  1756. this.button_colorAdjustmentBS.Text = "S";
  1757. CalcRGBOrHLSValue();
  1758. UpdateHistogramStartAndEnd();
  1759. }
  1760. }
  1761. private void RGBoRHLSValue_Changed(object sender, EventArgs e)
  1762. {
  1763. UpdateHistogramStartAndEnd();
  1764. SetPhaseModelRGBOrHLS();
  1765. }
  1766. /// <summary>
  1767. /// RGB/HLS的Button的R/H点击事件
  1768. /// </summary>
  1769. /// <param name="sender"></param>
  1770. /// <param name="e"></param>
  1771. private void button_colorAdjustmentRH_Click(object sender, EventArgs e)
  1772. {
  1773. this.HistogramRGBSelect = 1;
  1774. this.button_colorAdjustmentRH.FlatStyle = FlatStyle.Flat;
  1775. this.button_colorAdjustmentRH.BackColor = Color.FromArgb(225, 225, 225);
  1776. this.button_colorAdjustmentRH.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215);
  1777. this.button_colorAdjustmentRH.FlatAppearance.BorderSize = 1;
  1778. this.button_colorAdjustmentGL.FlatStyle = FlatStyle.Standard;
  1779. this.button_colorAdjustmentGL.BackColor = Control.DefaultBackColor;
  1780. this.button_colorAdjustmentGL.FlatAppearance.BorderColor = Control.DefaultBackColor;
  1781. this.button_colorAdjustmentBS.FlatStyle = FlatStyle.Standard;
  1782. this.button_colorAdjustmentBS.BackColor = Control.DefaultBackColor;
  1783. this.button_colorAdjustmentBS.FlatAppearance.BorderColor = Control.DefaultBackColor;
  1784. //处理直方图
  1785. this.histogramControl_colorSetting.UpdateVerticalBarWithOneScope((int)this.numericUpDown_colorAdjustmentRHU.Value, (int)this.numericUpDown_colorAdjustmentRHD.Value);
  1786. }
  1787. /// <summary>
  1788. /// RGB/HLS的Button的G/L点击事件
  1789. /// </summary>
  1790. /// <param name="sender"></param>
  1791. /// <param name="e"></param>
  1792. private void button_colorAdjustmentGL_Click(object sender, EventArgs e)
  1793. {
  1794. this.HistogramRGBSelect = 2;
  1795. this.button_colorAdjustmentRH.FlatStyle = FlatStyle.Standard;
  1796. this.button_colorAdjustmentRH.BackColor = Control.DefaultBackColor;
  1797. this.button_colorAdjustmentRH.FlatAppearance.BorderColor = Control.DefaultBackColor;
  1798. this.button_colorAdjustmentGL.FlatStyle = FlatStyle.Flat;
  1799. this.button_colorAdjustmentGL.BackColor = Color.FromArgb(225, 225, 225);
  1800. this.button_colorAdjustmentGL.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215);
  1801. this.button_colorAdjustmentGL.FlatAppearance.BorderSize = 1;
  1802. this.button_colorAdjustmentBS.FlatStyle = FlatStyle.Standard;
  1803. this.button_colorAdjustmentBS.BackColor = Control.DefaultBackColor;
  1804. this.button_colorAdjustmentBS.FlatAppearance.BorderColor = Control.DefaultBackColor;
  1805. //处理直方图
  1806. this.histogramControl_colorSetting.UpdateVerticalBarWithOneScope((int)this.numericUpDown_colorAdjustmentGLU.Value, (int)this.numericUpDown_colorAdjustmentGLD.Value);
  1807. }
  1808. /// <summary>
  1809. /// RGB/HLS的Button的B/S点击事件
  1810. /// </summary>
  1811. /// <param name="sender"></param>
  1812. /// <param name="e"></param>
  1813. private void button_colorAdjustmentBS_Click(object sender, EventArgs e)
  1814. {
  1815. this.HistogramRGBSelect = 3;
  1816. this.button_colorAdjustmentRH.FlatStyle = FlatStyle.Standard;
  1817. this.button_colorAdjustmentRH.BackColor = Control.DefaultBackColor;
  1818. this.button_colorAdjustmentRH.FlatAppearance.BorderColor = Control.DefaultBackColor;
  1819. this.button_colorAdjustmentGL.FlatStyle = FlatStyle.Standard;
  1820. this.button_colorAdjustmentGL.BackColor = Control.DefaultBackColor;
  1821. this.button_colorAdjustmentGL.FlatAppearance.BorderColor = Control.DefaultBackColor;
  1822. this.button_colorAdjustmentBS.FlatStyle = FlatStyle.Flat;
  1823. this.button_colorAdjustmentBS.BackColor = Color.FromArgb(225, 225, 225);
  1824. this.button_colorAdjustmentBS.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215);
  1825. this.button_colorAdjustmentBS.FlatAppearance.BorderSize = 1;
  1826. //处理直方图
  1827. this.histogramControl_colorSetting.UpdateVerticalBarWithOneScope((int)this.numericUpDown_colorAdjustmentBSU.Value, (int)this.numericUpDown_colorAdjustmentBSD.Value);
  1828. }
  1829. private void panel_colorGamut_Paint(object sender, PaintEventArgs e)
  1830. {
  1831. Graphics g = e.Graphics;
  1832. Color fColor = Color.FromArgb(Decimal.ToInt32(this.numericUpDown_colorAdjustmentRHU.Value), Decimal.ToInt32(this.numericUpDown_colorAdjustmentGLU.Value), Decimal.ToInt32(this.numericUpDown_colorAdjustmentBSU.Value));
  1833. Color tColor = Color.FromArgb(Decimal.ToInt32(this.numericUpDown_colorAdjustmentRHD.Value), Decimal.ToInt32(this.numericUpDown_colorAdjustmentGLD.Value), Decimal.ToInt32(this.numericUpDown_colorAdjustmentBSD.Value));
  1834. Brush b = new LinearGradientBrush(this.panel_colorGamut.ClientRectangle, fColor, tColor, LinearGradientMode.Horizontal);
  1835. g.FillRectangle(b, this.panel_colorGamut.ClientRectangle);
  1836. if (this.imageMat == null)
  1837. {
  1838. return;
  1839. }
  1840. Mat mat = this.imageMat.Clone();
  1841. Color c = this.panel_colorGamutPhase.BackColor;
  1842. for (int i = 0; i < mat.Height; i++)
  1843. {
  1844. for (int j = 0; j < mat.Width; j++)
  1845. {
  1846. Vec3b vec3b = mat.At<Vec3b>(i, j);
  1847. if (this.numericUpDown_colorAdjustmentRHU.Value <= vec3b.Item2 &&
  1848. this.numericUpDown_colorAdjustmentRHD.Value >= vec3b.Item2 &&
  1849. this.numericUpDown_colorAdjustmentGLU.Value <= vec3b.Item1 &&
  1850. this.numericUpDown_colorAdjustmentGLD.Value >= vec3b.Item1 &&
  1851. this.numericUpDown_colorAdjustmentBSU.Value <= vec3b.Item0 &&
  1852. this.numericUpDown_colorAdjustmentBSD.Value >= vec3b.Item0)
  1853. {
  1854. mat.Set<Vec3b>(i, j, new Vec3b(c.B, c.G, c.R));
  1855. }
  1856. }
  1857. }
  1858. if (this.documentWorkspace.phaseModels.Count > 1 && checkBox_showColorGamutPhase.Checked)
  1859. {
  1860. this.documentWorkspace.phaseModels[this.documentWorkspace.phaseModels.Count - 1].mat = mat;
  1861. }
  1862. this.documentWorkspace.Refresh();
  1863. }
  1864. private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  1865. {
  1866. chooseK = this.comboBox1.SelectedIndex;
  1867. this.btn_statistics_Click(sender, e);
  1868. }
  1869. private void comboBox_rollingDirection_SelectedIndexChanged(object sender, EventArgs e)
  1870. {
  1871. this.methodOfAssessment.inclusionsStandard.globalSettings.rollingDirection = (InclusionsGlobalSettings.RollingDirection)this.comboBox_rollingDirection.SelectedIndex;
  1872. if (this.lstView_img.FocusedItem != null)
  1873. {
  1874. if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
  1875. {
  1876. everyImgData[this.lstView_img.FocusedItem.Index].directionIndex = this.comboBox_rollingDirection.SelectedIndex;
  1877. }
  1878. else
  1879. {
  1880. CurrentPageData data = new CurrentPageData(this.autoJiaoBen);
  1881. data.directionIndex = comboBox_rollingDirection.SelectedIndex;
  1882. data.ratio = numericUpDown_lwRatioLimit.Value;
  1883. everyImgData.Add(this.lstView_img.FocusedItem.Index, data);
  1884. }
  1885. }
  1886. }
  1887. private void histogramControl_colorSetting_DragOneEvent(object sender, EventArgs<int> e)
  1888. {
  1889. if (this.HistogramRGBSelect == 1)
  1890. {
  1891. this.numericUpDown_colorAdjustmentRHU.Value = e.Data;
  1892. }
  1893. if (this.HistogramRGBSelect == 2)
  1894. {
  1895. this.numericUpDown_colorAdjustmentGLU.Value = e.Data;
  1896. }
  1897. if (this.HistogramRGBSelect == 3)
  1898. {
  1899. this.numericUpDown_colorAdjustmentBSU.Value = e.Data;
  1900. }
  1901. this.panel_colorGamut.Refresh();
  1902. }
  1903. private void histogramControl_colorSetting_DragTwoEvent(object sender, EventArgs<int> e)
  1904. {
  1905. if (!button_colorAdjustmentRH.Focused && !button_colorAdjustmentGL.Focused && !button_colorAdjustmentBS.Focused)
  1906. {
  1907. MessageBox.Show("请选择颜色!");
  1908. return;
  1909. }
  1910. if (this.HistogramRGBSelect == 1)
  1911. {
  1912. this.numericUpDown_colorAdjustmentRHD.Value = e.Data;
  1913. }
  1914. if (this.HistogramRGBSelect == 2)
  1915. {
  1916. this.numericUpDown_colorAdjustmentGLD.Value = e.Data;
  1917. }
  1918. if (this.HistogramRGBSelect == 3)
  1919. {
  1920. this.numericUpDown_colorAdjustmentBSD.Value = e.Data;
  1921. }
  1922. this.panel_colorGamut.Refresh();
  1923. }
  1924. protected void colorSettingRadioButton(object sender, EventArgs e)
  1925. {
  1926. this.selectedColorOfInclusions = MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions[((RadioButton)sender).Name.Split('_')[1]];
  1927. CalcRGBOrHLSValue();
  1928. UpdateHistogramStartAndEnd();
  1929. if (this.lstView_img.FocusedItem != null)
  1930. {
  1931. if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
  1932. {
  1933. everyImgData[this.lstView_img.FocusedItem.Index].thisSelectedColorOfInclusions = this.selectedColorOfInclusions;
  1934. }
  1935. else
  1936. {
  1937. CurrentPageData data = new CurrentPageData(this.autoJiaoBen);
  1938. data.directionIndex = comboBox_rollingDirection.SelectedIndex;
  1939. data.ratio = numericUpDown_lwRatioLimit.Value;
  1940. data.thisSelectedColorOfInclusions = this.selectedColorOfInclusions;
  1941. everyImgData.Add(this.lstView_img.FocusedItem.Index, data);
  1942. }
  1943. }
  1944. }
  1945. private void btn_drawRecognitionArea_Click(object sender, EventArgs e)
  1946. {
  1947. this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.InclusionDrawRecognitionArea;
  1948. }
  1949. /// <summary>
  1950. /// 自动阈值
  1951. /// </summary>
  1952. /// <param name="sender"></param>
  1953. /// <param name="e"></param>
  1954. private void checkBox_autoThreshold_CheckedChanged(object sender, EventArgs e)
  1955. {
  1956. bool check = ((CheckBox)sender).Checked;
  1957. this.methodOfAssessment.inclusionsStandard.globalSettings.autoThreshold = check;
  1958. //numericUpDown_threshold.Visible = !check;
  1959. }
  1960. private void documentWorkspace_panel_Click(object sender, EventArgs e)
  1961. {
  1962. System.Windows.Forms.MouseEventArgs me = (System.Windows.Forms.MouseEventArgs)e;
  1963. if (me.Button == MouseButtons.Left)
  1964. {
  1965. if (this.pickColorChecked)
  1966. {
  1967. if (this.imageMat == null)
  1968. {
  1969. return;
  1970. }
  1971. System.Drawing.Point pointscroll = this.documentWorkspace.GetScalePoint(me.Location);
  1972. Mat mat = this.imageMat.Clone();
  1973. Vec3b vec3b = mat.At<Vec3b>(pointscroll.Y, pointscroll.X);
  1974. Color c = Color.FromArgb(vec3b.Item2, vec3b.Item1, vec3b.Item0);
  1975. this.selectedColorOfInclusions.setColor(c);
  1976. CalcRGBOrHLSValue();
  1977. UpdateHistogramStartAndEnd();
  1978. this.pickColorChecked = false;
  1979. this.documentWorkspace.Cursor = Cursors.Default;
  1980. this.button_pickColor.FlatStyle = FlatStyle.Standard;
  1981. this.button_pickColor.BackColor = Control.DefaultBackColor;
  1982. this.button_pickColor.FlatAppearance.BorderColor = Control.DefaultBackColor;
  1983. }
  1984. }
  1985. else
  1986. {
  1987. System.Drawing.Point pointscroll = this.documentWorkspace.GetScalePoint(((System.Windows.Forms.MouseEventArgs)e).Location);
  1988. for (int i = 0; i < this.documentWorkspace.GraphicsList.Count; i++)
  1989. {
  1990. DrawObject drawObject = this.documentWorkspace.GraphicsList[i];
  1991. if (drawObject.drawToolType == DrawToolType.InclusionSelect)
  1992. {
  1993. Inclusion inclusion = ((InclusionDrawObject)drawObject).inclusion;
  1994. if (inclusion.rectProfile.Contains(pointscroll))
  1995. {
  1996. string showText = "";
  1997. if (inclusion.shape == ParticleShape.Globular)
  1998. {
  1999. showText += PdnResources.GetString("Menu.diameter.text") + ":" + inclusion.diameter;
  2000. }
  2001. else
  2002. {
  2003. showText += PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text") + ":" + inclusion.physicalLength;
  2004. showText += "\n宽度:" + inclusion.physicalWidth;
  2005. }
  2006. showText += "\n面积:" + inclusion.area;
  2007. showText += "\n类型:" + inclusion.type.type;
  2008. showText += "\n化学特性:" + inclusion.chemicalCharacteristics;
  2009. this.toolTip_InclusionsDetails.Show(showText, (System.Windows.Forms.Control)sender);
  2010. }
  2011. }
  2012. }
  2013. }
  2014. }
  2015. private void documentWorkspace_panel_MouseDown(object sender, MouseEventArgs e)
  2016. {
  2017. if (this.selectedTypesOfInclusions == null && !this.clearSelect)
  2018. {
  2019. return;
  2020. }
  2021. if (e.Button == MouseButtons.Left)
  2022. {
  2023. this.selectedTypesOfInclusionsPoint = e.Location;
  2024. }
  2025. }
  2026. private void documentWorkspace_panel_MouseMove(object sender, MouseEventArgs e)
  2027. {
  2028. Pen pen = null;
  2029. if (this.selectedTypesOfInclusionsPoint == null)
  2030. {
  2031. return;
  2032. }
  2033. if (this.selectedTypesOfInclusions != null)
  2034. {
  2035. pen = new Pen(Color.FromArgb(this.selectedTypesOfInclusions.showColor), 1);
  2036. }
  2037. else if (this.clearSelect)
  2038. {
  2039. pen = new Pen(Color.Black, 1);
  2040. pen.DashStyle = DashStyle.Dash;
  2041. }
  2042. this.documentWorkspace.Refresh();
  2043. float x = Math.Min(this.selectedTypesOfInclusionsPoint.Value.X, e.Location.X);
  2044. float y = Math.Min(this.selectedTypesOfInclusionsPoint.Value.Y, e.Location.Y);
  2045. float width = Math.Abs(this.selectedTypesOfInclusionsPoint.Value.X - e.Location.X);
  2046. float height = Math.Abs(this.selectedTypesOfInclusionsPoint.Value.Y - e.Location.Y);
  2047. this.documentWorkspace.panel.CreateGraphics().DrawRectangles(pen, new RectangleF[] { new RectangleF(x, y, width, height) });
  2048. }
  2049. private void documentWorkspace_panel_MouseUp(object sender, MouseEventArgs e)
  2050. {
  2051. if (this.selectedTypesOfInclusions == null && !this.clearSelect)
  2052. {
  2053. return;
  2054. }
  2055. if (e.Button == MouseButtons.Left)
  2056. {
  2057. if (this.selectedTypesOfInclusionsPoint == null)
  2058. {
  2059. return;
  2060. }
  2061. var startPoint = this.documentWorkspace.GetScalePoint(this.selectedTypesOfInclusionsPoint.Value);
  2062. var stopPoint = this.documentWorkspace.GetScalePoint(e.Location);
  2063. float x = Math.Min(startPoint.X, stopPoint.X);
  2064. float y = Math.Min(startPoint.Y, stopPoint.Y);
  2065. float width = Math.Abs(startPoint.X - stopPoint.X);
  2066. float height = Math.Abs(startPoint.Y - stopPoint.Y);
  2067. this.selectedTypesOfInclusionsRectangle = new RectangleF(x, y, width, height);
  2068. if (this.selectedTypesOfInclusions != null)
  2069. {
  2070. startStatistics();
  2071. }
  2072. else
  2073. {
  2074. if (this.tempAnalysisResult != null)
  2075. {
  2076. for (int i = this.tempAnalysisResult.inclusions.Count - 1; i >= 0; i--)
  2077. {
  2078. if (this.selectedTypesOfInclusionsRectangle.Value.Contains(this.tempAnalysisResult.inclusions[i].rectProfile)
  2079. || this.selectedTypesOfInclusionsRectangle.Value.IntersectsWith(this.tempAnalysisResult.inclusions[i].rectProfile))
  2080. {
  2081. this.tempAnalysisResult.inclusions.RemoveAt(i);
  2082. }
  2083. }
  2084. ToolInclusionSelect.CleanAndDrawInclusionAll(this.documentWorkspace, this.tempAnalysisResult.inclusions, is_showRectangle, is_showOval, is_full);
  2085. }
  2086. }
  2087. this.clearSelect = false;
  2088. //this.selectedTypesOfInclusions = null;
  2089. this.selectedTypesOfInclusionsPoint = null;
  2090. this.selectedTypesOfInclusionsRectangle = null;
  2091. radioButton1.Enabled = true;
  2092. radioButton2.Enabled = true;
  2093. checkBox1.Enabled = true;
  2094. checkBox2.Enabled = true;
  2095. }
  2096. }
  2097. #endregion
  2098. #region 内部方法
  2099. private void startStatistics()
  2100. {
  2101. if (this.lstView_img.FocusedItem == null || !this.lstView_img.FocusedItem.Selected)
  2102. {
  2103. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text"));
  2104. return;
  2105. }
  2106. if (this.documentWorkspace.phaseModels[0].mat == null || !this.bcBinaryChecked())
  2107. {
  2108. MessageBox.Show(PdnResources.GetString("Menu.Pleaseperformabinaryoperationfirst.text"));
  2109. return;
  2110. }
  2111. ProgressThreadProcClass procClass = new ProgressThreadProcClass();
  2112. int itemCount = 100;
  2113. ProgressThreadProcClass.IFileTransferProgressEvents progressEvents = new ProgressThreadProcClass.IFileTransferProgressEvents();
  2114. System.Threading.ThreadStart copyThreadProc =
  2115. delegate ()
  2116. {
  2117. try
  2118. {
  2119. if (dict.ContainsKey(this.lstView_img.FocusedItem.Text))
  2120. {
  2121. dict[this.lstView_img.FocusedItem.Text] = this.documentWorkspace.phaseModels;
  2122. }
  2123. else
  2124. {
  2125. dict.Add(this.lstView_img.FocusedItem.Text, this.documentWorkspace.phaseModels);
  2126. }
  2127. Mat mat = this.documentWorkspace.phaseModels[0].mat.Clone();
  2128. List<RectangleF> rectangles = new List<RectangleF>();
  2129. if (this.selectedTypesOfInclusionsRectangle != null)
  2130. {
  2131. // 添加框选范围
  2132. rectangles.Add(this.selectedTypesOfInclusionsRectangle.Value);
  2133. // 删除框选范围内夹杂物
  2134. if (this.tempAnalysisResult != null)
  2135. {
  2136. for (int i = this.tempAnalysisResult.inclusions.Count - 1; i >= 0; i--)
  2137. {
  2138. if (this.selectedTypesOfInclusionsRectangle.Value.Contains(this.tempAnalysisResult.inclusions[i].rectProfile)
  2139. || this.selectedTypesOfInclusionsRectangle.Value.IntersectsWith(this.tempAnalysisResult.inclusions[i].rectProfile))
  2140. {
  2141. this.tempAnalysisResult.inclusions.RemoveAt(i);
  2142. }
  2143. }
  2144. }
  2145. }
  2146. for (int i = 0; i < this.documentWorkspace.GraphicsList.Count; i++)
  2147. {
  2148. if (this.documentWorkspace.GraphicsList[i].drawToolType == DrawToolType.InclusionDrawRecognitionArea)
  2149. {
  2150. DedicatedAnalysisDrawObject drawObject = (DrawRecognitionAreaDrawObject)this.documentWorkspace.GraphicsList[i];
  2151. rectangles.Add(drawObject.Rectangle);
  2152. }
  2153. }
  2154. // 二值图非黑色点涂白
  2155. for (int i = 0; i < mat.Height; i++)
  2156. {
  2157. for (int j = 0; j < mat.Width; j++)
  2158. {
  2159. if (mat.At<int>(i, j) == 0)
  2160. {
  2161. mat.Set<Vec3b>(i, j, new Vec3b(255, 255, 255));
  2162. }
  2163. else
  2164. {
  2165. if (rectangles.Count == 0)
  2166. {
  2167. continue;
  2168. }
  2169. bool contains = false;
  2170. // 二值图过滤未选中区域
  2171. foreach (var item in rectangles)
  2172. {
  2173. if (item.Contains(j, i))
  2174. {
  2175. contains = true;
  2176. }
  2177. }
  2178. if (!contains)
  2179. {
  2180. mat.Set<Vec3b>(i, j, new Vec3b(255, 255, 255));
  2181. }
  2182. }
  2183. }
  2184. }
  2185. // 找出正方形视场
  2186. List<RectangleF> rectangleF = new List<RectangleF>();
  2187. for (int i = 0; i < this.documentWorkspace.GraphicsList.Count; i++)
  2188. {
  2189. if (this.documentWorkspace.GraphicsList[i].drawToolType == DrawToolType.ViewSquare || this.documentWorkspace.GraphicsList[i].drawToolType == DrawToolType.ViewRectangle || this.documentWorkspace.GraphicsList[i].drawToolType == DrawToolType.ViewRectangleEx)
  2190. {
  2191. rectangleF.Add(this.documentWorkspace.GraphicsList[i].Rectangle);
  2192. }
  2193. }
  2194. int k = Convert.ToInt32(this.comboBox1.SelectedItem);
  2195. var rollingDirection = (InclusionsGlobalSettings.RollingDirection)this.comboBox_rollingDirection.SelectedIndex;
  2196. AnalysisResult report;
  2197. if (this.radioButton3.Checked)
  2198. {
  2199. report = this.methodOfAssessment.generateReport(this.imageMat.Clone(), mat, rectangleF, isK, this.viewNum, k, this.is_full, rollingDirection);
  2200. }
  2201. else {
  2202. bool isNew = this.radioButton5.Checked ? true : false;
  2203. report = this.methodOfAssessment.NewGenerateReport(this.imageMat.Clone(), mat, rectangleF, isK, this.viewNum, k, this.is_full, rollingDirection, isNew);
  2204. }
  2205. if (this.selectedTypesOfInclusionsRectangle == null)
  2206. {
  2207. this.tempAnalysisResult = report;
  2208. }
  2209. else
  2210. {
  2211. foreach (var item in report.inclusions)
  2212. {
  2213. item.type = this.selectedTypesOfInclusions;
  2214. }
  2215. if (this.tempAnalysisResult == null)
  2216. {
  2217. this.tempAnalysisResult = report;
  2218. }
  2219. else
  2220. {
  2221. this.tempAnalysisResult.inclusions.AddRange(report.inclusions);
  2222. }
  2223. this.tempAnalysisResult.buildResultBody();
  2224. }
  2225. if (userAll)
  2226. {
  2227. if (hasResultIndexList.IndexOf(this.lstView_img.FocusedItem.Index) == -1)
  2228. {
  2229. resultList.Add(this.tempAnalysisResult);
  2230. hasResultIndexList.Add(this.lstView_img.FocusedItem.Index);
  2231. }
  2232. else
  2233. {
  2234. resultList[this.lstView_img.FocusedItem.Index] = this.tempAnalysisResult;
  2235. }
  2236. }
  2237. ToolInclusionSelect.CleanAndDrawInclusionAll(this.documentWorkspace, this.tempAnalysisResult.inclusions, is_showRectangle, is_showOval, is_full);
  2238. }
  2239. catch (Exception ex)
  2240. {
  2241. }
  2242. finally
  2243. {
  2244. progressEvents.EndOperation(OperationResult.Finished);
  2245. }
  2246. };
  2247. procClass.StartProgressAction(this, itemCount, copyThreadProc, progressEvents, null);
  2248. }
  2249. private void Panel_Paint(object sender, PaintEventArgs e)
  2250. {
  2251. if (isK == 2)
  2252. {
  2253. return;
  2254. }
  2255. Rectangle rc = this.documentWorkspace.panel.ClientRectangle;
  2256. int wid = this.documentWorkspace.CompositionSurface == null ? this.documentWorkspace.Width : this.documentWorkspace.CompositionSurface.Width;
  2257. int hei = this.documentWorkspace.CompositionSurface == null ? this.documentWorkspace.Height : this.documentWorkspace.CompositionSurface.Height;
  2258. int width = (int)(wid * this.documentWorkspace.ScaleFactor.Ratio);
  2259. int height = (int)(hei * this.documentWorkspace.ScaleFactor.Ratio);
  2260. int x = (rc.Width < width) ? this.documentWorkspace.panel.AutoScrollPosition.X : (rc.Width - width) / 2;
  2261. int y = (rc.Height < height) ? this.documentWorkspace.panel.AutoScrollPosition.Y : (rc.Height - height) / 2;
  2262. e.Graphics.TranslateTransform(x, y);
  2263. e.Graphics.ScaleTransform((float)this.documentWorkspace.ScaleFactor.Ratio, (float)this.documentWorkspace.ScaleFactor.Ratio);
  2264. if (this.documentWorkspace.GraphicsList.Count > 0)
  2265. {
  2266. Font font = new Font(System.Drawing.SystemFonts.DefaultFont.FontFamily, 40, System.Drawing.SystemFonts.DefaultFont.Style);
  2267. double pxPerUnit = this.imgPxPerUnit;
  2268. int allWidth = (int)(this.imageMat.Width * pxPerUnit);
  2269. int allHeight = (int)(this.imageMat.Height * pxPerUnit);
  2270. if (this.tempAnalysisResult == null)
  2271. {
  2272. this.paintRectangle = this.documentWorkspace.GraphicsList[0].Rectangle;
  2273. }
  2274. int realWidth = (int)(this.paintRectangle.Width * pxPerUnit);
  2275. int realHeight = (int)(this.paintRectangle.Height * pxPerUnit);
  2276. e.Graphics.DrawString($"{realWidth}/{allWidth}", font, new SolidBrush(Color.Blue), this.paintRectangle.Right, this.paintRectangle.Bottom / 2);
  2277. e.Graphics.DrawString($"{realHeight}/{allHeight}", font, new SolidBrush(Color.Blue), this.paintRectangle.Right / 2, this.paintRectangle.Bottom + 10);
  2278. }
  2279. if (this.tempAnalysisResult != null && this.tempAnalysisResult.segmentationView == 2)
  2280. {
  2281. foreach (var s in this.tempAnalysisResult.MedthodKRectangles)
  2282. {
  2283. e.Graphics.DrawRectangle(new Pen(Color.Black, 0.1f), new Rectangle((int)s.X, (int)s.Y, (int)s.Width, (int)s.Height));
  2284. }
  2285. }
  2286. e.Graphics.ScaleTransform(1 / (float)this.documentWorkspace.ScaleFactor.Ratio, 1 / (float)this.documentWorkspace.ScaleFactor.Ratio);
  2287. e.Graphics.TranslateTransform(-x, -y);
  2288. }
  2289. private void buildListBox_analysisResult()
  2290. {
  2291. this.listBox_analysisResult.Items.Clear();
  2292. foreach (var item in analysisResults.Keys)
  2293. {
  2294. this.listBox_analysisResult.Items.Add(new LocalListViewItem(item, item.GetFriendlyName()));
  2295. }
  2296. buildListView_analysisResult();
  2297. }
  2298. private List<ListViewItem> buildAnalysisResults(DocumentWorkspace workspace, AnalysisResult analysisResult)
  2299. {
  2300. List<ListViewItem> listViews = new List<ListViewItem>();
  2301. foreach (var fieldOfView in analysisResult.resultBody.Keys)
  2302. {
  2303. ListViewItem lvi = new ListViewItem();
  2304. lvi.Text = workspace.GetFriendlyName();
  2305. lvi.SubItems.Add(fieldOfView.name);
  2306. foreach (var item in analysisResult.resultBody[fieldOfView])
  2307. {
  2308. try
  2309. {
  2310. int num = 2;
  2311. if (this.domainUpDown_resultPrecision.SelectedIndex != -1)
  2312. {
  2313. num = Convert.ToInt32(this.domainUpDown_resultPrecision.Items[this.domainUpDown_resultPrecision.SelectedIndex]);
  2314. }
  2315. lvi.SubItems.Add(Math.Round(Convert.ToDecimal(item), num).ToString());
  2316. }
  2317. catch (Exception ex)
  2318. {
  2319. lvi.SubItems.Add(item);
  2320. }
  2321. }
  2322. listViews.Add(lvi);
  2323. }
  2324. return listViews;
  2325. }
  2326. #region [二值化相关方法]
  2327. /// <summary>
  2328. /// 添加参数改变的监听
  2329. /// </summary>
  2330. /// <param name="sender"></param>
  2331. /// <param name="e"></param>
  2332. private void GrainSizeDialog_Load(object sender, EventArgs e)
  2333. {
  2334. this.binaryClass.loadParams();
  2335. System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
  2336. if (this.initScriptValues && this.appWorkspace.ScriptAutomatic)
  2337. this.startScriptAutomaticAction();
  2338. }
  2339. /// <summary>
  2340. /// 参数改变时,重新处理图像
  2341. /// </summary>
  2342. /// <param name="sender"></param>
  2343. /// <param name="e"></param>
  2344. private void bClassBinaryImplFinishAction(object sender, EventArgs e)
  2345. {
  2346. if (!bcOriginChecked())
  2347. {
  2348. if (bcBinaryChecked())
  2349. {
  2350. if (this.isK == 1)
  2351. {
  2352. this.documentWorkspace.ActiveTool = DrawToolType.InclusionSelectRecognitionArea;
  2353. this.documentWorkspace.Cursor = Cursors.Default;
  2354. }
  2355. }
  2356. else
  2357. {
  2358. if (this.isK == 1)
  2359. {
  2360. this.documentWorkspace.ActiveTool = DrawToolType.Pointer;
  2361. }
  2362. }
  2363. }
  2364. else
  2365. {
  2366. if (this.isK == 1)
  2367. {
  2368. this.documentWorkspace.ActiveTool = DrawToolType.Pointer;
  2369. }
  2370. }
  2371. this.documentWorkspace.Refresh();
  2372. }
  2373. private bool bcBinaryChecked()
  2374. {
  2375. return bc != null && bc.BinaryChecked;
  2376. }
  2377. private bool bcOriginChecked()
  2378. {
  2379. return bc != null && bc.OriginChecked;
  2380. }
  2381. /// <summary>
  2382. /// 显示原图/原图+二值图
  2383. /// </summary>
  2384. /// <param name="sender"></param>
  2385. /// <param name="e"></param>
  2386. private void bcOriginCheckedChanged(object sender, EventArgs e)
  2387. {
  2388. if (!bcOriginChecked())
  2389. {
  2390. if (bcBinaryChecked())
  2391. {
  2392. this.documentWorkspace.PhaseModels[0].choise = true;
  2393. if (this.isK == 1)
  2394. {
  2395. this.documentWorkspace.ActiveTool = DrawToolType.InclusionSelectRecognitionArea;
  2396. this.documentWorkspace.Cursor = Cursors.Default;
  2397. }
  2398. }
  2399. }
  2400. else
  2401. {
  2402. this.documentWorkspace.PhaseModels[0].choise = false;
  2403. if (this.isK == 1)
  2404. {
  2405. this.documentWorkspace.ActiveTool = DrawToolType.Pointer;
  2406. }
  2407. }
  2408. this.documentWorkspace.Refresh();
  2409. }
  2410. #endregion [二值化相关方法]
  2411. private void buildListView_analysisResult()
  2412. {
  2413. List<AnalysisResult> conclusions = new List<AnalysisResult>();
  2414. this.listView_analysisResult.Columns.Clear();
  2415. this.listView_analysisResult.Items.Clear();
  2416. this.listView_analysisResult2.Columns.Clear();
  2417. this.listView_analysisResult2.Items.Clear();
  2418. if (analysisResults.Count == 0)
  2419. {
  2420. return;
  2421. }
  2422. if (this.listBox_analysisResult.CheckedItems.Count == 0)
  2423. {
  2424. return;
  2425. }
  2426. this.listView_analysisResult.BeginUpdate();
  2427. // 构建头
  2428. foreach (var item in analysisResults.First().Value.getResultHead())
  2429. {
  2430. ColumnHeader header = new ColumnHeader();
  2431. header.Text = item;
  2432. header.Width = 150;
  2433. this.listView_analysisResult.Columns.Add(header);
  2434. }
  2435. foreach (var item in this.listBox_analysisResult.CheckedItems)
  2436. {
  2437. DocumentWorkspace workspace = ((LocalListViewItem)item).Value;
  2438. this.listView_analysisResult.Items.AddRange(buildAnalysisResults(workspace, analysisResults[workspace]).ToArray());
  2439. conclusions.Add(analysisResults[workspace]);
  2440. }
  2441. this.listView_analysisResult.EndUpdate();
  2442. if (this.listView_analysisResult.Items.Count > 0)
  2443. {
  2444. this.listView_analysisResult.Items[0].Selected = true;
  2445. }
  2446. this.listView_analysisResult2.Columns.Clear();
  2447. this.listView_analysisResult2.Items.Clear();
  2448. ListViewItem lvi = new ListViewItem();
  2449. List<string> strings = this.methodOfAssessment.buildResultConclusion(conclusions);
  2450. // 构建头
  2451. foreach (var item in this.methodOfAssessment.getResultConclusionHead())
  2452. {
  2453. ColumnHeader header = new ColumnHeader();
  2454. header.Text = item;
  2455. header.Width = 150;
  2456. this.listView_analysisResult2.Columns.Add(header);
  2457. }
  2458. try
  2459. {
  2460. int num = 2;
  2461. if (this.domainUpDown_resultPrecision.SelectedIndex != -1)
  2462. {
  2463. num = Convert.ToInt32(this.domainUpDown_resultPrecision.Items[this.domainUpDown_resultPrecision.SelectedIndex]);
  2464. }
  2465. lvi.Text = Math.Round(Convert.ToDecimal(strings[0]), num).ToString();
  2466. }
  2467. catch (Exception ex)
  2468. {
  2469. lvi.Text = strings[0];
  2470. }
  2471. for (int i = 1; i < strings.Count; i++)
  2472. {
  2473. try
  2474. {
  2475. int num = 2;
  2476. if (this.domainUpDown_resultPrecision.SelectedIndex != -1)
  2477. {
  2478. num = Convert.ToInt32(this.domainUpDown_resultPrecision.Items[this.domainUpDown_resultPrecision.SelectedIndex]);
  2479. }
  2480. lvi.SubItems.Add(Math.Round(Convert.ToDecimal(strings[i]), num).ToString());
  2481. }
  2482. catch (Exception ex)
  2483. {
  2484. lvi.SubItems.Add(strings[i]);
  2485. }
  2486. }
  2487. this.listView_analysisResult2.Items.Add(lvi);
  2488. this.listView_analysisResult2.EndUpdate();
  2489. }
  2490. private void inclusionEditDialogCloseCallback()
  2491. {
  2492. if (this.tempAnalysisResult.segmentationView != 2)
  2493. {
  2494. ToolInclusionSelect.CleanAndDrawInclusionAll(this.documentWorkspace, this.tempAnalysisResult.inclusions, is_showRectangle, is_showOval, is_full);
  2495. }
  2496. else
  2497. {
  2498. this.documentWorkspace.Refresh();
  2499. }
  2500. }
  2501. private void UpdateHistogramStartAndEnd()
  2502. {
  2503. if (this.HistogramRGBSelect == 1)
  2504. {
  2505. this.histogramControl_colorSetting.UpdateVerticalBarWithOneScope((int)this.numericUpDown_colorAdjustmentRHU.Value, (int)this.numericUpDown_colorAdjustmentRHD.Value);
  2506. }
  2507. if (this.HistogramRGBSelect == 2)
  2508. {
  2509. this.histogramControl_colorSetting.UpdateVerticalBarWithOneScope((int)this.numericUpDown_colorAdjustmentGLU.Value, (int)this.numericUpDown_colorAdjustmentGLD.Value);
  2510. }
  2511. if (this.HistogramRGBSelect == 3)
  2512. {
  2513. this.histogramControl_colorSetting.UpdateVerticalBarWithOneScope((int)this.numericUpDown_colorAdjustmentBSU.Value, (int)this.numericUpDown_colorAdjustmentBSD.Value);
  2514. }
  2515. }
  2516. private void CalcRGBOrHLSValue()
  2517. {
  2518. this.numericUpDown_colorAdjustmentRHU.ValueChanged -= new System.EventHandler(this.RGBoRHLSValue_Changed);
  2519. this.numericUpDown_colorAdjustmentRHD.ValueChanged -= new System.EventHandler(this.RGBoRHLSValue_Changed);
  2520. this.numericUpDown_colorAdjustmentGLU.ValueChanged -= new System.EventHandler(this.RGBoRHLSValue_Changed);
  2521. this.numericUpDown_colorAdjustmentGLD.ValueChanged -= new System.EventHandler(this.RGBoRHLSValue_Changed);
  2522. this.numericUpDown_colorAdjustmentBSU.ValueChanged -= new System.EventHandler(this.RGBoRHLSValue_Changed);
  2523. this.numericUpDown_colorAdjustmentBSD.ValueChanged -= new System.EventHandler(this.RGBoRHLSValue_Changed);
  2524. this.numericUpDown_colorAdjustmentRHU.KeyUp -= new KeyEventHandler(this.RGBoRHLSValue_Changed);
  2525. this.numericUpDown_colorAdjustmentRHD.KeyUp -= new KeyEventHandler(this.RGBoRHLSValue_Changed);
  2526. this.numericUpDown_colorAdjustmentGLU.KeyUp -= new KeyEventHandler(this.RGBoRHLSValue_Changed);
  2527. this.numericUpDown_colorAdjustmentGLD.KeyUp -= new KeyEventHandler(this.RGBoRHLSValue_Changed);
  2528. this.numericUpDown_colorAdjustmentBSU.KeyUp -= new KeyEventHandler(this.RGBoRHLSValue_Changed);
  2529. this.numericUpDown_colorAdjustmentBSD.KeyUp -= new KeyEventHandler(this.RGBoRHLSValue_Changed);
  2530. if (this.radioButton_checkedRGB.Checked)
  2531. {
  2532. this.numericUpDown_colorAdjustmentRHU.Value = this.selectedColorOfInclusions.rd;
  2533. this.numericUpDown_colorAdjustmentRHD.Value = this.selectedColorOfInclusions.ru;
  2534. this.numericUpDown_colorAdjustmentGLU.Value = this.selectedColorOfInclusions.gd;
  2535. this.numericUpDown_colorAdjustmentGLD.Value = this.selectedColorOfInclusions.gu;
  2536. this.numericUpDown_colorAdjustmentBSU.Value = this.selectedColorOfInclusions.bd;
  2537. this.numericUpDown_colorAdjustmentBSD.Value = this.selectedColorOfInclusions.bu;
  2538. }
  2539. else
  2540. {
  2541. Vec3b rgbd = new Vec3b();
  2542. Vec3b rgbu = new Vec3b();
  2543. rgbd[2] = Decimal.ToByte(this.numericUpDown_colorAdjustmentRHU.Value);
  2544. rgbu[2] = Decimal.ToByte(this.numericUpDown_colorAdjustmentRHD.Value);
  2545. rgbd[1] = Decimal.ToByte(this.numericUpDown_colorAdjustmentGLU.Value);
  2546. rgbu[1] = Decimal.ToByte(this.numericUpDown_colorAdjustmentGLD.Value);
  2547. rgbd[0] = Decimal.ToByte(this.numericUpDown_colorAdjustmentBSU.Value);
  2548. rgbu[0] = Decimal.ToByte(this.numericUpDown_colorAdjustmentBSD.Value);
  2549. double hd, ld, sd, hu, lu, su;
  2550. BaseTools.RGBtoHLS(rgbd, out hd, out ld, out sd);
  2551. BaseTools.RGBtoHLS(rgbu, out hu, out lu, out su);
  2552. this.numericUpDown_colorAdjustmentRHD.Value = new Decimal(hd);
  2553. this.numericUpDown_colorAdjustmentRHU.Value = new Decimal(hu);
  2554. this.numericUpDown_colorAdjustmentGLD.Value = new Decimal(ld);
  2555. this.numericUpDown_colorAdjustmentGLU.Value = new Decimal(lu);
  2556. this.numericUpDown_colorAdjustmentBSD.Value = new Decimal(sd);
  2557. this.numericUpDown_colorAdjustmentBSU.Value = new Decimal(su);
  2558. }
  2559. this.numericUpDown_colorAdjustmentRHU.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
  2560. this.numericUpDown_colorAdjustmentRHD.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
  2561. this.numericUpDown_colorAdjustmentGLU.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
  2562. this.numericUpDown_colorAdjustmentGLD.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
  2563. this.numericUpDown_colorAdjustmentBSU.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
  2564. this.numericUpDown_colorAdjustmentBSD.ValueChanged += new System.EventHandler(this.RGBoRHLSValue_Changed);
  2565. this.numericUpDown_colorAdjustmentRHU.KeyUp += new KeyEventHandler(this.RGBoRHLSValue_Changed);
  2566. this.numericUpDown_colorAdjustmentRHD.KeyUp += new KeyEventHandler(this.RGBoRHLSValue_Changed);
  2567. this.numericUpDown_colorAdjustmentGLU.KeyUp += new KeyEventHandler(this.RGBoRHLSValue_Changed);
  2568. this.numericUpDown_colorAdjustmentGLD.KeyUp += new KeyEventHandler(this.RGBoRHLSValue_Changed);
  2569. this.numericUpDown_colorAdjustmentBSU.KeyUp += new KeyEventHandler(this.RGBoRHLSValue_Changed);
  2570. this.numericUpDown_colorAdjustmentBSD.KeyUp += new KeyEventHandler(this.RGBoRHLSValue_Changed);
  2571. this.panel_colorGamut.Refresh();
  2572. }
  2573. /// <summary>
  2574. /// 修改当前model的rgb或hls
  2575. /// </summary>
  2576. private void SetPhaseModelRGBOrHLS()
  2577. {
  2578. if (this.radioButton_checkedRGB.Checked)
  2579. {
  2580. if (this.selectedColorOfInclusions != null)
  2581. {
  2582. this.selectedColorOfInclusions.rd = Decimal.ToByte(this.numericUpDown_colorAdjustmentRHU.Value);
  2583. this.selectedColorOfInclusions.ru = Decimal.ToByte(this.numericUpDown_colorAdjustmentRHD.Value);
  2584. this.selectedColorOfInclusions.gd = Decimal.ToByte(this.numericUpDown_colorAdjustmentGLU.Value);
  2585. this.selectedColorOfInclusions.gu = Decimal.ToByte(this.numericUpDown_colorAdjustmentGLD.Value);
  2586. this.selectedColorOfInclusions.bd = Decimal.ToByte(this.numericUpDown_colorAdjustmentBSU.Value);
  2587. this.selectedColorOfInclusions.bu = Decimal.ToByte(this.numericUpDown_colorAdjustmentBSD.Value);
  2588. }
  2589. }
  2590. else
  2591. {
  2592. Vec3b rgbd = BaseTools.HLStoRGB(Decimal.ToDouble(this.numericUpDown_colorAdjustmentRHU.Value), Decimal.ToDouble(this.numericUpDown_colorAdjustmentGLU.Value), Decimal.ToDouble(this.numericUpDown_colorAdjustmentBSU.Value));
  2593. Vec3b rgbu = BaseTools.HLStoRGB(Decimal.ToDouble(this.numericUpDown_colorAdjustmentRHD.Value), Decimal.ToDouble(this.numericUpDown_colorAdjustmentGLD.Value), Decimal.ToDouble(this.numericUpDown_colorAdjustmentBSD.Value));
  2594. this.selectedColorOfInclusions.rd = rgbd[2];
  2595. this.selectedColorOfInclusions.ru = rgbu[2];
  2596. this.selectedColorOfInclusions.gd = rgbd[1];
  2597. this.selectedColorOfInclusions.gu = rgbu[1];
  2598. this.selectedColorOfInclusions.bd = rgbd[0];
  2599. this.selectedColorOfInclusions.bu = rgbu[0];
  2600. }
  2601. if (this.lstView_img.FocusedItem != null)
  2602. {
  2603. if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
  2604. {
  2605. everyImgData[this.lstView_img.FocusedItem.Index].thisSelectedColorOfInclusions = this.selectedColorOfInclusions;
  2606. }
  2607. else
  2608. {
  2609. CurrentPageData data = new CurrentPageData(this.autoJiaoBen);
  2610. data.directionIndex = comboBox_rollingDirection.SelectedIndex;
  2611. data.ratio = numericUpDown_lwRatioLimit.Value;
  2612. data.thisSelectedColorOfInclusions = this.selectedColorOfInclusions;
  2613. everyImgData.Add(this.lstView_img.FocusedItem.Index, data);
  2614. }
  2615. }
  2616. }
  2617. private void button_pickColor_Click(object sender, EventArgs e)
  2618. {
  2619. //this.checkBox_showBinary.Checked = false;
  2620. this.documentWorkspace.Cursor = new Cursor(PdnResources.GetResourceStream("Cursors.ColorPickerToolCursor.cur"));
  2621. this.pickColorChecked = true;
  2622. this.button_pickColor.FlatStyle = FlatStyle.Flat;
  2623. this.button_pickColor.BackColor = Color.FromArgb(225, 225, 225);
  2624. this.button_pickColor.FlatAppearance.BorderColor = Color.FromArgb(0, 120, 215);
  2625. this.button_pickColor.FlatAppearance.BorderSize = 1;
  2626. }
  2627. private void button_generateReport_Click(object sender, EventArgs e)
  2628. {
  2629. if (this.listView_analysisResult.Items.Count == 0)
  2630. {
  2631. MessageBox.Show(PdnResources.GetString("Menu.Noresults.text"));
  2632. return;
  2633. }
  2634. if (this.checkBox_generateReport_opensetting.Checked)
  2635. {
  2636. AnalyzeSettingDialog recombinationRateSetDialog = new AnalyzeSettingDialog(this, this.methodOfAssessment.resourcesName);
  2637. if (recombinationRateSetDialog.hasModule)
  2638. {
  2639. recombinationRateSetDialog.StartPosition = FormStartPosition.CenterScreen;
  2640. recombinationRateSetDialog.ShowDialog();
  2641. }
  2642. else
  2643. {
  2644. recombinationRateSetDialog = null;
  2645. }
  2646. }
  2647. if (this.analyzeSettingModel != null && !string.IsNullOrEmpty(this.analyzeSettingModel.analyzeClassify))
  2648. {
  2649. //获取word书签与excel单元格的关系,以字典方式存储
  2650. List<mic_module_infos> mic_module_infos = mic_module_infos_BLL.FindAll().FindAll(a => a.analyze_classify == this.analyzeSettingModel.analyzeClassify);
  2651. Dictionary<string, string> tagInfos = new Dictionary<string, string>();
  2652. if (mic_module_infos != null && mic_module_infos.Count > 0)
  2653. {
  2654. foreach (mic_module_infos info in mic_module_infos)
  2655. {
  2656. tagInfos.Add(info.tag_name, info.cell_position);
  2657. }
  2658. }
  2659. List<List<List<string>>> sheets = new List<List<List<string>>>();
  2660. sheets.Add(new List<List<string>>());
  2661. List<List<string>> contentList = new List<List<string>>();
  2662. List<string> contentHead = new List<string>();
  2663. contentList.Add(contentHead);
  2664. foreach (ColumnHeader c in this.listView_analysisResult2.Columns)
  2665. {
  2666. contentHead.Add(c.Text);
  2667. }
  2668. for (int r = 0; r < this.listView_analysisResult2.Items.Count; r++)
  2669. {
  2670. List<string> contentBody = new List<string>();
  2671. for (int c = 0; c < this.listView_analysisResult2.Items[r].SubItems.Count; c++)
  2672. {
  2673. contentBody.Add(this.listView_analysisResult2.Items[r].SubItems[c].Text);
  2674. }
  2675. contentList.Add(contentBody);
  2676. }
  2677. contentList.Add(new List<string>());
  2678. contentHead = new List<string>();
  2679. contentList.Add(contentHead);
  2680. foreach (ColumnHeader c in this.listView_analysisResult.Columns)
  2681. {
  2682. contentHead.Add(c.Text);
  2683. }
  2684. for (int r = 0; r < this.listView_analysisResult.Items.Count; r++)
  2685. {
  2686. List<string> contentBody = new List<string>();
  2687. for (int c = 0; c < this.listView_analysisResult.Items[r].SubItems.Count; c++)
  2688. {
  2689. contentBody.Add(this.listView_analysisResult.Items[r].SubItems[c].Text);
  2690. }
  2691. contentList.Add(contentBody);
  2692. }
  2693. sheets.Add(contentList);
  2694. List<List<string>> inclusionList = new List<List<string>>();
  2695. List<string> inclusionHead = new List<string>();
  2696. inclusionList.Add(inclusionHead);
  2697. inclusionHead.Add("pixelLength");
  2698. inclusionHead.Add("pixelWidth");
  2699. inclusionHead.Add("physicalLength");
  2700. inclusionHead.Add("physicalWidth");
  2701. inclusionHead.Add("lwRatio");
  2702. inclusionHead.Add("arrangement");
  2703. inclusionHead.Add("shape");
  2704. inclusionHead.Add("shapeFactor");
  2705. inclusionHead.Add("area");
  2706. inclusionHead.Add("diameter");
  2707. inclusionHead.Add("type");
  2708. inclusionHead.Add("color");
  2709. inclusionHead.Add("chemicalCharacteristics");
  2710. inclusionHead.Add("X-Position");
  2711. inclusionHead.Add("Y-Position");
  2712. if (this.isK == 1)
  2713. {
  2714. inclusionHead.Add("fieldNumber");
  2715. inclusionHead.Add("fieldLeftLimit");
  2716. inclusionHead.Add("fieldRightLimit");
  2717. inclusionHead.Add("fieldTopLimit");
  2718. inclusionHead.Add("fieldBottomLimit");
  2719. inclusionHead.Add("rating");
  2720. }
  2721. foreach (var analysisResult in this.analysisResults.Values)
  2722. {
  2723. foreach (var inclusion in analysisResult.inclusions)
  2724. {
  2725. List<string> inclusionBody = new List<string>();
  2726. inclusionList.Add(inclusionBody);
  2727. inclusionBody.Add(inclusion.pixelLength + "");
  2728. inclusionBody.Add(inclusion.pixelWidth + "");
  2729. inclusionBody.Add(inclusion.physicalLength + "");
  2730. inclusionBody.Add(inclusion.physicalWidth + "");
  2731. inclusionBody.Add(inclusion.lwRatio + "");
  2732. inclusionBody.Add(inclusion.arrangement + "");
  2733. inclusionBody.Add(inclusion.shape + "");
  2734. inclusionBody.Add(inclusion.shapeFactor + "");
  2735. inclusionBody.Add(inclusion.area + "");
  2736. inclusionBody.Add(inclusion.diameter + "");
  2737. inclusionBody.Add(inclusion.type.type + "");
  2738. inclusionBody.Add(inclusion.color == null ? "" : inclusion.color.colorName + "");
  2739. inclusionBody.Add(inclusion.chemicalCharacteristics + "");
  2740. inclusionBody.Add(inclusion.rectProfile.X + "");
  2741. inclusionBody.Add(inclusion.rectProfile.Y + "");
  2742. if (this.isK == 1)
  2743. {
  2744. inclusionBody.Add(inclusion.viewNum + "");
  2745. inclusionBody.Add(inclusion.viewLeft + "");
  2746. inclusionBody.Add(inclusion.viewRight + "");
  2747. inclusionBody.Add(inclusion.viewTop + "");
  2748. inclusionBody.Add(inclusion.viewBottom + "");
  2749. inclusionBody.Add(inclusion.rating + "");
  2750. }
  2751. }
  2752. }
  2753. sheets.Add(inclusionList);
  2754. List<Bitmap> bitList = new List<Bitmap>();
  2755. foreach (var item in this.listBox_analysisResult.CheckedItems)
  2756. {
  2757. DocumentWorkspace workspace = ((LocalListViewItem)item).Value;
  2758. double pantographRatio = workspace.GetRulerMultiple(MeasurementUnit.Micron);
  2759. Bitmap originalBit = workspace.CompositionSurface.CreateAliasedBitmap();
  2760. originalBit.Tag = pantographRatio;
  2761. Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
  2762. newBit.Tag = pantographRatio;
  2763. Graphics graphics = Graphics.FromImage(newBit);
  2764. foreach (var phase in dict[((LocalListViewItem)item).Display])
  2765. {
  2766. if (phase.mat == null)
  2767. {
  2768. continue;
  2769. }
  2770. Bitmap processedBit = BitmapConverter.ToBitmap(phase.mat);
  2771. graphics.DrawImage(processedBit, new PointF(0, 0));
  2772. }
  2773. foreach (var inclusion in analysisResults[workspace].inclusions)
  2774. {
  2775. new InclusionDrawObject(workspace, inclusion, this.is_full).Draw(graphics);
  2776. }
  2777. bitList.Add(originalBit);
  2778. bitList.Add(newBit);
  2779. }
  2780. try
  2781. {
  2782. //OfficeFileHandleHelper.CreateAnalysisReportInclusion(this.analyzeSettingModel, sheets, bitList, tagInfos);
  2783. this.appWorkspace.CreateAnalysisReportInclusion(this.analyzeSettingModel, sheets, bitList, tagInfos);
  2784. }
  2785. catch (Exception ex)
  2786. {
  2787. MessageBox.Show(ex.Message);
  2788. }
  2789. }
  2790. else
  2791. MessageBox.Show(PdnResources.GetString("Menu.Pleasesettheanalysisreportfirst.text") + "!");
  2792. }
  2793. private void button_exportResults_Click(object sender, EventArgs e)
  2794. {
  2795. if (this.listView_analysisResult.Items.Count == 0)
  2796. {
  2797. MessageBox.Show(PdnResources.GetString("Menu.Noresults.text"));
  2798. return;
  2799. }
  2800. SaveFileDialog exe = new SaveFileDialog();
  2801. exe.Filter = "Execl files (*.xlsx)|*.xlsx";
  2802. exe.FilterIndex = 0;
  2803. exe.RestoreDirectory = true;
  2804. //exe.CreatePrompt = true;
  2805. exe.Title = "Export Excel File";
  2806. exe.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
  2807. exe.FileName = DateTime.Now.ToString("yyyyMMddhhmmss") + this.methodOfAssessment.resourcesName;
  2808. DialogResult dr = exe.ShowDialog();
  2809. if (dr != DialogResult.OK)
  2810. {
  2811. return;
  2812. }
  2813. List<DataTable> list = new List<DataTable>();
  2814. DataTable dtb = new DataTable();
  2815. foreach (ColumnHeader c in this.listView_analysisResult.Columns)
  2816. {
  2817. dtb.Columns.Add(c.Text);
  2818. }
  2819. for (int r = 0; r < this.listView_analysisResult.Items.Count; r++)
  2820. {
  2821. DataRow dataRow = dtb.NewRow();
  2822. for (int c = 0; c < this.listView_analysisResult.Items[r].SubItems.Count; c++)
  2823. {
  2824. dataRow[c] = this.listView_analysisResult.Items[r].SubItems[c].Text;
  2825. }
  2826. dtb.Rows.Add(dataRow);
  2827. }
  2828. DataTable dtb1 = new DataTable();
  2829. foreach (ColumnHeader c in this.listView_analysisResult2.Columns)
  2830. {
  2831. dtb1.Columns.Add(c.Text);
  2832. }
  2833. for (int r = 0; r < this.listView_analysisResult2.Items.Count; r++)
  2834. {
  2835. DataRow dataRow = dtb1.NewRow();
  2836. for (int c = 0; c < this.listView_analysisResult2.Items[r].SubItems.Count; c++)
  2837. {
  2838. dataRow[c] = this.listView_analysisResult2.Items[r].SubItems[c].Text;
  2839. }
  2840. dtb1.Rows.Add(dataRow);
  2841. }
  2842. DataTable dtb2 = new DataTable();
  2843. dtb2.Columns.Add("pixelLength");
  2844. dtb2.Columns.Add("pixelWidth");
  2845. dtb2.Columns.Add("physicalLength");
  2846. dtb2.Columns.Add("physicalWidth");
  2847. dtb2.Columns.Add("lwRatio");
  2848. dtb2.Columns.Add("arrangement");
  2849. dtb2.Columns.Add("shape");
  2850. dtb2.Columns.Add("shapeFactor");
  2851. dtb2.Columns.Add("area");
  2852. dtb2.Columns.Add("diameter");
  2853. dtb2.Columns.Add("type");
  2854. dtb2.Columns.Add("color");
  2855. dtb2.Columns.Add("chemicalCharacteristics");
  2856. dtb2.Columns.Add("X-Position");
  2857. dtb2.Columns.Add("Y-Position");
  2858. if (this.isK == 1)
  2859. {
  2860. dtb2.Columns.Add("rating");
  2861. }
  2862. foreach (var analysisResult in this.analysisResults.Values)
  2863. {
  2864. foreach (var inclusion in analysisResult.inclusions)
  2865. {
  2866. DataRow dataRow = dtb2.NewRow();
  2867. dataRow[0] = (inclusion.pixelLength + "");
  2868. dataRow[1] = (inclusion.pixelWidth + "");
  2869. dataRow[2] = (inclusion.physicalLength + "");
  2870. dataRow[3] = (inclusion.physicalWidth + "");
  2871. dataRow[4] = (inclusion.lwRatio + "");
  2872. dataRow[5] = (inclusion.arrangement + "");
  2873. dataRow[6] = (inclusion.shape + "");
  2874. dataRow[7] = (inclusion.shapeFactor + "");
  2875. dataRow[8] = (inclusion.area + "");
  2876. dataRow[9] = (inclusion.diameter + "");
  2877. dataRow[10] = (inclusion.type.type + "");
  2878. dataRow[11] = (inclusion.color == null ? "" : inclusion.color.colorName + "");
  2879. dataRow[12] = (inclusion.chemicalCharacteristics + "");
  2880. dataRow[13] = (inclusion.rectProfile.X + "");
  2881. dataRow[14] = (inclusion.rectProfile.Y + "");
  2882. if (this.isK == 1)
  2883. {
  2884. dataRow[15] = (inclusion.rating + "");
  2885. dataRow[8] = (inclusion.areaK + "");
  2886. }
  2887. dtb2.Rows.Add(dataRow);
  2888. }
  2889. }
  2890. dtb.TableName = "Sheet1";
  2891. dtb1.TableName = "Sheet2";
  2892. dtb2.TableName = "Sheet3";
  2893. list.Add(dtb);
  2894. list.Add(dtb1);
  2895. list.Add(dtb2);
  2896. try
  2897. {
  2898. this.appWorkspace.ExportDataToExcelWithProgress(list, exe.FileName, true, true, true);
  2899. }
  2900. catch (Exception ex)
  2901. {
  2902. MessageBox.Show(ex.Message);
  2903. }
  2904. }
  2905. #endregion
  2906. #region 需继承方法
  2907. protected virtual void SubclassInitialize()
  2908. {
  2909. throw new NotImplementedException();
  2910. }
  2911. protected virtual MethodOfAssessment getMethodOfAssessment()
  2912. {
  2913. throw new NotImplementedException();
  2914. }
  2915. protected virtual void initColorSetting()
  2916. {
  2917. throw new NotImplementedException();
  2918. }
  2919. protected virtual void initDisplaySetting()
  2920. {
  2921. throw new NotImplementedException();
  2922. }
  2923. protected virtual void getInclusionParameters()
  2924. {
  2925. }
  2926. protected virtual void saveInclusionParameters()
  2927. {
  2928. }
  2929. protected virtual void getOldCheck()
  2930. {
  2931. }
  2932. #endregion
  2933. #region 内部类
  2934. internal class CurrentPageData
  2935. {
  2936. public CurrentPageData(int isYuanshi)
  2937. {
  2938. if (isYuanshi == -1)
  2939. {
  2940. kNum = 4;
  2941. }
  2942. else
  2943. {
  2944. kNum = isYuanshi;
  2945. }
  2946. }
  2947. public int directionIndex { get; set; }
  2948. public decimal ratio { get; set; }
  2949. public ColorOfInclusions thisSelectedColorOfInclusions { get; set; }
  2950. public bool colorCheck { get; set; }
  2951. public int kNum { get; set; }
  2952. }
  2953. internal class LocalListViewItem
  2954. {
  2955. public DocumentWorkspace Value { get; }
  2956. public string Display { get; }
  2957. public LocalListViewItem(DocumentWorkspace Value, string Display)
  2958. {
  2959. this.Value = Value;
  2960. this.Display = Display;
  2961. }
  2962. }
  2963. internal class DocumentItem
  2964. {
  2965. public Mat imageMat;
  2966. public GraphicsList graphicsList;
  2967. public List<PhaseModel> phaseModels;
  2968. public AnalysisResult analysisResult;
  2969. public DocumentItem(Mat imageMat, GraphicsList graphicsList, List<PhaseModel> phaseModels)
  2970. {
  2971. this.imageMat = imageMat;
  2972. this.graphicsList = graphicsList;
  2973. this.phaseModels = phaseModels;
  2974. }
  2975. }
  2976. #endregion
  2977. private void domainUpDown_resultPrecision_SelectedItemChanged(object sender, EventArgs e)
  2978. {
  2979. buildListView_analysisResult();
  2980. }
  2981. private void button1_Click(object sender, EventArgs e)
  2982. {
  2983. if (this.listView_analysisResult.Items.Count == 0)
  2984. {
  2985. MessageBox.Show(PdnResources.GetString("Menu.Noresults.text"));
  2986. return;
  2987. }
  2988. if (this.analyzeSettingModel == null)
  2989. {
  2990. MessageBox.Show(PdnResources.GetString("Menu.Pleasesetiirst.Text"));
  2991. return;
  2992. }
  2993. //获取项目工程内的文件夹路径
  2994. ProjectEngineering.NodeItem item = this.appWorkspace.GetInsertProjectPath(2, "Menu.DedicatedAnalysis.BlackMetal.Inclusion.Text", this.analyzeSettingModel.savePath);
  2995. if (item != null)
  2996. {
  2997. //向文件夹内保存图片和报告
  2998. if (this.analyzeSettingModel != null && !string.IsNullOrEmpty(this.analyzeSettingModel.analyzeClassify))
  2999. {
  3000. //获取word书签与excel单元格的关系,以字典方式存储
  3001. List<mic_module_infos> mic_module_infos = mic_module_infos_BLL.FindAll().FindAll(a => a.analyze_classify == this.analyzeSettingModel.analyzeClassify);
  3002. Dictionary<string, string> tagInfos = new Dictionary<string, string>();
  3003. if (mic_module_infos != null && mic_module_infos.Count > 0)
  3004. {
  3005. foreach (mic_module_infos info in mic_module_infos)
  3006. {
  3007. tagInfos.Add(info.tag_name, info.cell_position);
  3008. }
  3009. }
  3010. List<List<string>> contentList = new List<List<string>>();
  3011. List<string> contentHead = new List<string>();
  3012. contentList.Add(contentHead);
  3013. foreach (ColumnHeader c in this.listView_analysisResult2.Columns)
  3014. {
  3015. contentHead.Add(c.Text);
  3016. }
  3017. for (int r = 0; r < this.listView_analysisResult2.Items.Count; r++)
  3018. {
  3019. List<string> contentBody = new List<string>();
  3020. for (int c = 0; c < this.listView_analysisResult2.Items[r].SubItems.Count; c++)
  3021. {
  3022. contentBody.Add(this.listView_analysisResult2.Items[r].SubItems[c].Text);
  3023. }
  3024. contentList.Add(contentBody);
  3025. }
  3026. contentList.Add(new List<string>());
  3027. contentHead = new List<string>();
  3028. contentList.Add(contentHead);
  3029. foreach (ColumnHeader c in this.listView_analysisResult.Columns)
  3030. {
  3031. contentHead.Add(c.Text);
  3032. }
  3033. for (int r = 0; r < this.listView_analysisResult.Items.Count; r++)
  3034. {
  3035. List<string> contentBody = new List<string>();
  3036. for (int c = 0; c < this.listView_analysisResult.Items[r].SubItems.Count; c++)
  3037. {
  3038. contentBody.Add(this.listView_analysisResult.Items[r].SubItems[c].Text);
  3039. }
  3040. contentList.Add(contentBody);
  3041. }
  3042. List<Bitmap> bitList = new List<Bitmap>();
  3043. List<ExportProjectModel> exportModel = new List<ExportProjectModel>();
  3044. foreach (var itemIt in this.listBox_analysisResult.CheckedItems)
  3045. {
  3046. List<List<string>> inclusionList = new List<List<string>>();
  3047. List<string> inclusionHead = new List<string>();
  3048. inclusionList.Add(inclusionHead);
  3049. inclusionHead.Add("pixelLength");
  3050. inclusionHead.Add("pixelWidth");
  3051. inclusionHead.Add("physicalLength");
  3052. inclusionHead.Add("physicalWidth");
  3053. inclusionHead.Add("lwRatio");
  3054. inclusionHead.Add("arrangement");
  3055. inclusionHead.Add("shape");
  3056. inclusionHead.Add("shapeFactor");
  3057. inclusionHead.Add("area");
  3058. inclusionHead.Add("diameter");
  3059. inclusionHead.Add("type");
  3060. inclusionHead.Add("color");
  3061. inclusionHead.Add("chemicalCharacteristics");
  3062. inclusionHead.Add("X-Position");
  3063. inclusionHead.Add("Y-Position");
  3064. if (this.isK == 1)
  3065. {
  3066. inclusionHead.Add("fieldNumber");
  3067. inclusionHead.Add("fieldLeftLimit");
  3068. inclusionHead.Add("fieldRightLimit");
  3069. inclusionHead.Add("fieldTopLimit");
  3070. inclusionHead.Add("fieldBottomLimit");
  3071. inclusionHead.Add("rating");
  3072. }
  3073. DocumentWorkspace workspace = ((LocalListViewItem)itemIt).Value;
  3074. double pantographRatio = workspace.GetRulerMultiple(MeasurementUnit.Micron);
  3075. Bitmap originalBit = workspace.CompositionSurface.CreateAliasedBitmap();
  3076. originalBit.Tag = pantographRatio;
  3077. Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
  3078. newBit.Tag = pantographRatio;
  3079. Graphics graphics = Graphics.FromImage(newBit);
  3080. foreach (var phase in dict[((LocalListViewItem)itemIt).Display])
  3081. {
  3082. if (phase.mat == null)
  3083. {
  3084. continue;
  3085. }
  3086. Bitmap processedBit = BitmapConverter.ToBitmap(phase.mat);
  3087. graphics.DrawImage(processedBit, new PointF(0, 0));
  3088. }
  3089. foreach (var inclusion in analysisResults[workspace].inclusions)
  3090. {
  3091. List<string> inclusionBody = new List<string>();
  3092. inclusionBody.Add(inclusion.pixelLength + "");
  3093. inclusionBody.Add(inclusion.pixelWidth + "");
  3094. inclusionBody.Add(inclusion.physicalLength + "");
  3095. inclusionBody.Add(inclusion.physicalWidth + "");
  3096. inclusionBody.Add(inclusion.lwRatio + "");
  3097. inclusionBody.Add(inclusion.arrangement + "");
  3098. inclusionBody.Add(inclusion.shape + "");
  3099. inclusionBody.Add(inclusion.shapeFactor + "");
  3100. if (this.isK == 1)
  3101. {
  3102. inclusionBody.Add(inclusion.areaK + "");
  3103. }
  3104. else
  3105. {
  3106. inclusionBody.Add(inclusion.area + "");
  3107. }
  3108. inclusionBody.Add(inclusion.diameter + "");
  3109. inclusionBody.Add(inclusion.type.type + "");
  3110. inclusionBody.Add(inclusion.color == null ? "" : inclusion.color.colorName + "");
  3111. inclusionBody.Add(inclusion.chemicalCharacteristics + "");
  3112. inclusionBody.Add(inclusion.rectProfile.X + "");
  3113. inclusionBody.Add(inclusion.rectProfile.Y + "");
  3114. if (this.isK == 1)
  3115. {
  3116. inclusionBody.Add(inclusion.viewNum + "");
  3117. inclusionBody.Add(inclusion.viewLeft + "");
  3118. inclusionBody.Add(inclusion.viewRight + "");
  3119. inclusionBody.Add(inclusion.viewTop + "");
  3120. inclusionBody.Add(inclusion.viewBottom + "");
  3121. inclusionBody.Add(inclusion.rating + "");
  3122. }
  3123. inclusionList.Add(inclusionBody);
  3124. new InclusionDrawObject(workspace, inclusion, this.is_full).Draw(graphics);
  3125. }
  3126. ExportProjectModel exportProjectModel = new ExportProjectModel();
  3127. exportProjectModel.dataList = inclusionList;
  3128. exportProjectModel.picName = ((LocalListViewItem)itemIt).Display;
  3129. exportProjectModel.tagName = PdnResources.GetString("Menu.DedicatedAnalysis.BlackMetal.Inclusion.Text");
  3130. exportModel.Add(exportProjectModel);
  3131. bitList.Add(originalBit);
  3132. bitList.Add(newBit);
  3133. }
  3134. try
  3135. {
  3136. this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, contentList, exportModel, bitList, tagInfos, item.path, item.code);
  3137. }
  3138. catch (Exception ex)
  3139. {
  3140. MessageBox.Show(ex.Message);
  3141. }
  3142. }
  3143. else
  3144. {
  3145. MessageBox.Show(PdnResources.GetString("Menu.Pleasesettheanalysisreportfirst.text") + "!");
  3146. return;
  3147. }
  3148. //保存项目信息到数据库
  3149. this.appWorkspace.InsertIntoDB(this.analyzeSettingModel, item);
  3150. }
  3151. }
  3152. private void button2_Click(object sender, EventArgs e)
  3153. {
  3154. new InclusionViewSetting(this.viewNum, this.inclusionViewSettingCloseCallback).ShowDialog();
  3155. }
  3156. private void inclusionViewSettingCloseCallback(int num)
  3157. {
  3158. this.viewNum = num;
  3159. }
  3160. private void checkBox2_CheckedChanged(object sender, EventArgs e)
  3161. {
  3162. if (this.firstShow)
  3163. {
  3164. return;
  3165. }
  3166. if (this.tempAnalysisResult == null)
  3167. {
  3168. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttostartstatistics.text"));
  3169. return;
  3170. }
  3171. is_showRectangle = !is_showRectangle;
  3172. ToolInclusionSelect.CleanAndDrawInclusionAll(this.documentWorkspace, this.tempAnalysisResult.inclusions, is_showRectangle, is_showOval, is_full);
  3173. this.documentWorkspace.Refresh();
  3174. }
  3175. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  3176. {
  3177. if (this.firstShow)
  3178. {
  3179. return;
  3180. }
  3181. if (this.tempAnalysisResult == null)
  3182. {
  3183. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttostartstatistics.text"));
  3184. return;
  3185. }
  3186. is_showOval = !is_showOval;
  3187. ToolInclusionSelect.CleanAndDrawInclusionAll(this.documentWorkspace, this.tempAnalysisResult.inclusions, is_showRectangle, is_showOval, is_full);
  3188. }
  3189. private void radioButton1_CheckedChanged(object sender, EventArgs e)
  3190. {
  3191. if (this.firstShow)
  3192. {
  3193. return;
  3194. }
  3195. if (this.tempAnalysisResult == null)
  3196. {
  3197. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttostartstatistics.text"));
  3198. return;
  3199. }
  3200. if (radioButton1.Checked)
  3201. {
  3202. this.is_full = 2;
  3203. }
  3204. else
  3205. {
  3206. this.is_full = 1;
  3207. }
  3208. if (this.tempAnalysisResult.segmentationView != 2)
  3209. {
  3210. ToolInclusionSelect.CleanAndDrawInclusionAll(this.documentWorkspace, this.tempAnalysisResult.inclusions, is_showRectangle, is_showOval, is_full);
  3211. }
  3212. else
  3213. {
  3214. this.documentWorkspace.Refresh();
  3215. }
  3216. }
  3217. private void InclusionsStandardDialog_FormClosing(object sender, FormClosingEventArgs e)
  3218. {
  3219. binaryClass.saveParams();
  3220. }
  3221. private void ShownChoiseItemAndInitData(object sender, EventArgs e)
  3222. {
  3223. }
  3224. private void getLastData()
  3225. {
  3226. string filePath = Application.StartupPath + "\\Config\\Default\\ParameterSaving\\ParameterInclusionsModel.xml";
  3227. var text = this.dialogText;
  3228. if (!System.IO.File.Exists(filePath))
  3229. {
  3230. inclusionsModel.InclusionParameters = new List<InclusionsModel.InclusionParameter>();
  3231. string[] textList = new string[] { "GBT10561_MethodA", "GBT10561_MethodB", "EN10247_MethodP", "EN10247_MethodM", "EN10247_MethodK", "ISO4967_MethodA",
  3232. "ISO4967_MethodB","JISG0555_MethodA","JISG0555_MethodB","DIN50602_1985_MethodM","DIN50602_1985_MethodK","ASTME45_MethodA","ASTME45_MethodB",
  3233. "ASTME45_MethodC","ASTME45_MethodD","ASTME45_MethodE"};
  3234. for (int i = 0; i < textList.Count(); i++)
  3235. {
  3236. var inclusionParameters = new InclusionsModel.InclusionParameter();
  3237. inclusionParameters.hasUsed = false;
  3238. inclusionParameters.name = textList[i];
  3239. inclusionsModel.InclusionParameters.Add(inclusionParameters);
  3240. }
  3241. this.thisParametersIndex = textList.ToList().IndexOf(text);
  3242. this.thisParameters = inclusionsModel.InclusionParameters[this.thisParametersIndex];
  3243. string porosityInfoXml = XmlSerializeHelper.XmlSerialize<InclusionsModel>(inclusionsModel);
  3244. Directory.CreateDirectory(Application.StartupPath + "\\Config\\Default\\ParameterSaving\\");
  3245. FileOperationHelper.WriteStringToFile(porosityInfoXml, filePath, FileMode.CreateNew);
  3246. }
  3247. else
  3248. {
  3249. inclusionsModel = XmlSerializeHelper.DESerializer<InclusionsModel>(FileOperationHelper.ReadStringFromFile(filePath, FileMode.Open));
  3250. if (inclusionsModel.InclusionParameters == null)
  3251. {
  3252. inclusionsModel.InclusionParameters = new List<InclusionsModel.InclusionParameter>();
  3253. }
  3254. thisParameters = inclusionsModel.InclusionParameters.Where(m => m.name.Equals(text)).FirstOrDefault();
  3255. if (thisParameters == null)
  3256. {
  3257. thisParameters = new InclusionsModel.InclusionParameter();
  3258. thisParameters.hasUsed = false;
  3259. thisParameters.name = text;
  3260. inclusionsModel.InclusionParameters.Add(thisParameters);
  3261. this.thisParametersIndex = inclusionsModel.InclusionParameters.Count() - 1;
  3262. string porosityInfoXml = XmlSerializeHelper.XmlSerialize<InclusionsModel>(inclusionsModel);
  3263. Directory.CreateDirectory(Application.StartupPath + "\\Config\\Default\\ParameterSaving\\");
  3264. FileOperationHelper.WriteStringToFile(porosityInfoXml, filePath, FileMode.CreateNew);
  3265. }
  3266. else
  3267. {
  3268. this.thisParametersIndex = inclusionsModel.InclusionParameters.IndexOf(thisParameters);
  3269. if (thisParameters.hasUsed)
  3270. {
  3271. if (thisParameters.parameter1 >= 0)
  3272. {
  3273. comboBox_rollingDirection.SelectedIndex = thisParameters.parameter1;
  3274. }
  3275. if (thisParameters.parameter2 >= numericUpDown_lwRatioLimit.Minimum)
  3276. {
  3277. numericUpDown_lwRatioLimit.Value = thisParameters.parameter2;
  3278. }
  3279. if (thisParameters.parameter14 >= 0)
  3280. {
  3281. comboBox1.SelectedIndex = thisParameters.parameter14;
  3282. }
  3283. checkBox_showColorGamutPhase.Checked = thisParameters.parameter5;
  3284. domainUpDown_resultPrecision.SelectedIndex = thisParameters.parameter13;
  3285. this.viewNum = thisParameters.parameter16;
  3286. checkBox_generateReport_opensetting.Checked = thisParameters.parameter17;
  3287. radioButton1.Checked = thisParameters.parameter18 == 0 ? true : false;
  3288. radioButton2.Checked = thisParameters.parameter18 == 0 ? false : true;
  3289. if (radioButton1.Checked)
  3290. {
  3291. this.is_full = 2;
  3292. }
  3293. else
  3294. {
  3295. this.is_full = 1;
  3296. }
  3297. checkBox2.Checked = thisParameters.parameter19;
  3298. is_showRectangle = thisParameters.parameter19;
  3299. checkBox1.Checked = thisParameters.parameter20;
  3300. is_showOval = thisParameters.parameter20;
  3301. if (thisParameters.parameter3 > 0)
  3302. {
  3303. this.whichChecked = thisParameters.parameter3;
  3304. getInclusionParameters();
  3305. switch (thisParameters.parameter3)
  3306. {
  3307. case 1:
  3308. if (thisParameters.parameter15 != null && thisParameters.parameter15.Count > 0)
  3309. {
  3310. this.numericUpDown_colorAdjustmentRHU.Value = thisParameters.parameter15[0].parameter7;
  3311. this.numericUpDown_colorAdjustmentRHD.Value = thisParameters.parameter15[0].parameter8;
  3312. this.numericUpDown_colorAdjustmentGLU.Value = thisParameters.parameter15[0].parameter9;
  3313. this.numericUpDown_colorAdjustmentGLD.Value = thisParameters.parameter15[0].parameter10;
  3314. this.numericUpDown_colorAdjustmentBSU.Value = thisParameters.parameter15[0].parameter11;
  3315. this.numericUpDown_colorAdjustmentBSD.Value = thisParameters.parameter15[0].parameter12;
  3316. }
  3317. break;
  3318. case 2:
  3319. if (thisParameters.parameter15 != null && thisParameters.parameter15.Count > 1)
  3320. {
  3321. this.numericUpDown_colorAdjustmentRHU.Value = thisParameters.parameter15[1].parameter7;
  3322. this.numericUpDown_colorAdjustmentRHD.Value = thisParameters.parameter15[1].parameter8;
  3323. this.numericUpDown_colorAdjustmentGLU.Value = thisParameters.parameter15[1].parameter9;
  3324. this.numericUpDown_colorAdjustmentGLD.Value = thisParameters.parameter15[1].parameter10;
  3325. this.numericUpDown_colorAdjustmentBSU.Value = thisParameters.parameter15[1].parameter11;
  3326. this.numericUpDown_colorAdjustmentBSD.Value = thisParameters.parameter15[1].parameter12;
  3327. }
  3328. break;
  3329. case 3:
  3330. if (thisParameters.parameter15 != null && thisParameters.parameter15.Count > 2)
  3331. {
  3332. this.numericUpDown_colorAdjustmentRHU.Value = thisParameters.parameter15[2].parameter7;
  3333. this.numericUpDown_colorAdjustmentRHD.Value = thisParameters.parameter15[2].parameter8;
  3334. this.numericUpDown_colorAdjustmentGLU.Value = thisParameters.parameter15[2].parameter9;
  3335. this.numericUpDown_colorAdjustmentGLD.Value = thisParameters.parameter15[2].parameter10;
  3336. this.numericUpDown_colorAdjustmentBSU.Value = thisParameters.parameter15[2].parameter11;
  3337. this.numericUpDown_colorAdjustmentBSD.Value = thisParameters.parameter15[2].parameter12;
  3338. }
  3339. break;
  3340. case 4:
  3341. if (thisParameters.parameter15 != null && thisParameters.parameter15.Count > 3)
  3342. {
  3343. this.numericUpDown_colorAdjustmentRHU.Value = thisParameters.parameter15[3].parameter7;
  3344. this.numericUpDown_colorAdjustmentRHD.Value = thisParameters.parameter15[3].parameter8;
  3345. this.numericUpDown_colorAdjustmentGLU.Value = thisParameters.parameter15[3].parameter9;
  3346. this.numericUpDown_colorAdjustmentGLD.Value = thisParameters.parameter15[3].parameter10;
  3347. this.numericUpDown_colorAdjustmentBSU.Value = thisParameters.parameter15[3].parameter11;
  3348. this.numericUpDown_colorAdjustmentBSD.Value = thisParameters.parameter15[3].parameter12;
  3349. }
  3350. break;
  3351. }
  3352. button_colorAdjustmentRH.Focus();
  3353. CalcRGBOrHLSValue();
  3354. UpdateHistogramStartAndEnd();
  3355. }
  3356. }
  3357. }
  3358. }
  3359. if (this.selectedColorOfInclusions != null)
  3360. {
  3361. 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);
  3362. this.oldSelectedColorOfInclusions = colorOfInclusions;
  3363. }
  3364. }
  3365. private void saveLastData(object sender, EventArgs e)
  3366. {
  3367. if (this.thisParametersIndex == -1)
  3368. {
  3369. return;
  3370. }
  3371. binaryClass.saveParams();
  3372. this.thisParameters.hasUsed = true;
  3373. if (comboBox_rollingDirection.SelectedIndex >= 0)
  3374. {
  3375. thisParameters.parameter1 = comboBox_rollingDirection.SelectedIndex;
  3376. }
  3377. comboBox_rollingDirection.SelectedIndex = thisParameters.parameter1;
  3378. thisParameters.parameter2 = numericUpDown_lwRatioLimit.Value;
  3379. if (comboBox1.SelectedIndex >= 0)
  3380. {
  3381. thisParameters.parameter14 = comboBox1.SelectedIndex;
  3382. }
  3383. thisParameters.parameter5 = checkBox_showColorGamutPhase.Checked;
  3384. this.thisParameters.parameter13 = domainUpDown_resultPrecision.SelectedIndex;
  3385. this.thisParameters.parameter16 = this.viewNum;
  3386. thisParameters.parameter17 = checkBox_generateReport_opensetting.Checked;
  3387. if (radioButton1.Checked)
  3388. {
  3389. thisParameters.parameter18 = 0;
  3390. }
  3391. else if (radioButton2.Checked)
  3392. {
  3393. thisParameters.parameter18 = 1;
  3394. }
  3395. thisParameters.parameter19 = checkBox2.Checked;
  3396. thisParameters.parameter20 = checkBox1.Checked;
  3397. saveInclusionParameters();
  3398. this.thisParameters.parameter15 = new List<InclusionsModel.InclusionParameter.rgbNum>();
  3399. for (int i = 0; i <= 3; i++)
  3400. {
  3401. var num = new InclusionsModel.InclusionParameter.rgbNum();
  3402. num.parameter7 = 0;
  3403. num.parameter8 = 0;
  3404. num.parameter9 = 0;
  3405. num.parameter10 = 0;
  3406. num.parameter11 = 0;
  3407. num.parameter12 = 0;
  3408. this.thisParameters.parameter15.Add(num);
  3409. }
  3410. foreach (var item in MethodOfAssessment.activeMethod.inclusionsStandard.globalSettings.colorOfInclusions)
  3411. {
  3412. switch (item.Key)
  3413. {
  3414. case "Black":
  3415. this.thisParameters.parameter15[0].parameter7 = item.Value.rd;
  3416. this.thisParameters.parameter15[0].parameter8 = item.Value.ru;
  3417. this.thisParameters.parameter15[0].parameter9 = item.Value.gd;
  3418. this.thisParameters.parameter15[0].parameter10 = item.Value.gu;
  3419. this.thisParameters.parameter15[0].parameter11 = item.Value.bd;
  3420. this.thisParameters.parameter15[0].parameter12 = item.Value.bu;
  3421. break;
  3422. case "LightBlue":
  3423. this.thisParameters.parameter15[1].parameter7 = item.Value.rd;
  3424. this.thisParameters.parameter15[1].parameter8 = item.Value.ru;
  3425. this.thisParameters.parameter15[1].parameter9 = item.Value.gd;
  3426. this.thisParameters.parameter15[1].parameter10 = item.Value.gu;
  3427. this.thisParameters.parameter15[1].parameter11 = item.Value.bd;
  3428. this.thisParameters.parameter15[1].parameter12 = item.Value.bu;
  3429. break;
  3430. case "Colored":
  3431. this.thisParameters.parameter15[1].parameter7 = item.Value.rd;
  3432. this.thisParameters.parameter15[1].parameter8 = item.Value.ru;
  3433. this.thisParameters.parameter15[1].parameter9 = item.Value.gd;
  3434. this.thisParameters.parameter15[1].parameter10 = item.Value.gu;
  3435. this.thisParameters.parameter15[1].parameter11 = item.Value.bd;
  3436. this.thisParameters.parameter15[1].parameter12 = item.Value.bu;
  3437. break;
  3438. case "Gray":
  3439. this.thisParameters.parameter15[2].parameter7 = item.Value.rd;
  3440. this.thisParameters.parameter15[2].parameter8 = item.Value.ru;
  3441. this.thisParameters.parameter15[2].parameter9 = item.Value.gd;
  3442. this.thisParameters.parameter15[2].parameter10 = item.Value.gu;
  3443. this.thisParameters.parameter15[2].parameter11 = item.Value.bd;
  3444. this.thisParameters.parameter15[2].parameter12 = item.Value.bu;
  3445. break;
  3446. case "DarkGray":
  3447. this.thisParameters.parameter15[3].parameter7 = item.Value.rd;
  3448. this.thisParameters.parameter15[3].parameter8 = item.Value.ru;
  3449. this.thisParameters.parameter15[3].parameter9 = item.Value.gd;
  3450. this.thisParameters.parameter15[3].parameter10 = item.Value.gu;
  3451. this.thisParameters.parameter15[3].parameter11 = item.Value.bd;
  3452. this.thisParameters.parameter15[3].parameter12 = item.Value.bu;
  3453. break;
  3454. }
  3455. }
  3456. this.inclusionsModel.InclusionParameters[this.thisParametersIndex] = this.thisParameters;
  3457. string filePath = Application.StartupPath + "\\Config\\Default\\ParameterSaving\\ParameterInclusionsModel.xml";
  3458. string porosityInfoXml = XmlSerializeHelper.XmlSerialize<InclusionsModel>(inclusionsModel);
  3459. Directory.CreateDirectory(Application.StartupPath + "\\Config\\Default\\ParameterSaving\\");
  3460. FileOperationHelper.WriteStringToFile(porosityInfoXml, filePath, FileMode.CreateNew);
  3461. #region [开启脚本录制]
  3462. if (appWorkspace.startScriptRecording)
  3463. {
  3464. getScriptRecording();
  3465. }
  3466. #endregion
  3467. }
  3468. /// <summary>
  3469. /// 应用到全部
  3470. /// </summary>
  3471. /// <param name="sender"></param>
  3472. /// <param name="e"></param>
  3473. private void button4_Click(object sender, EventArgs e)
  3474. {
  3475. if (this.lstView_img.FocusedItem == null)
  3476. {
  3477. return;
  3478. }
  3479. binaryClass.saveParams();
  3480. binaryClass.applyToAll(this.imageList_img.Images.Keys, this.imageList_img.Images.Keys[this.lstView_img.FocusedItem.Index]);
  3481. userAll = true;
  3482. resultList.Clear();
  3483. hasResultIndexList.Clear();
  3484. var data = new CurrentPageData(this.autoJiaoBen);
  3485. var firstIndex = this.lstView_img.FocusedItem.Index;
  3486. if (everyImgData.ContainsKey(this.lstView_img.FocusedItem.Index))
  3487. {
  3488. data = everyImgData[this.lstView_img.FocusedItem.Index];
  3489. }
  3490. for (int i = 0; i < lstView_img.Items.Count; i++)
  3491. {
  3492. this.lstView_img.EnsureVisible(i);
  3493. this.lstView_img.Items[i].Focused = true;
  3494. this.lstView_img.Items[i].Selected = true;
  3495. if (everyImgData.ContainsKey(i))
  3496. {
  3497. everyImgData[i] = data;
  3498. }
  3499. else
  3500. {
  3501. everyImgData.Add(i, data);
  3502. }
  3503. if ((i == 0 && lstView_img.Items.Count == 1) || firstIndex == 0)
  3504. {
  3505. this.startStatistics();
  3506. }
  3507. }
  3508. #region [给最后一张图赋值]
  3509. if (data.thisSelectedColorOfInclusions != null)
  3510. {
  3511. this.colorName = data.thisSelectedColorOfInclusions.colorName;
  3512. getOldCheck();
  3513. this.selectedColorOfInclusions = data.thisSelectedColorOfInclusions;
  3514. CalcRGBOrHLSValue();
  3515. UpdateHistogramStartAndEnd();
  3516. }
  3517. else
  3518. {
  3519. if (this.oldSelectedColorOfInclusions != null)
  3520. {
  3521. this.colorName = this.oldSelectedColorOfInclusions.colorName;
  3522. getOldCheck();
  3523. 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);
  3524. data.thisSelectedColorOfInclusions = this.selectedColorOfInclusions;
  3525. CalcRGBOrHLSValue();
  3526. UpdateHistogramStartAndEnd();
  3527. }
  3528. }
  3529. comboBox1.SelectedIndex = data.kNum;
  3530. if (data.directionIndex >= 0)
  3531. {
  3532. comboBox_rollingDirection.SelectedIndex = data.directionIndex;
  3533. }
  3534. if (data.ratio >= numericUpDown_lwRatioLimit.Minimum)
  3535. {
  3536. numericUpDown_lwRatioLimit.Value = data.ratio;
  3537. }
  3538. checkBox_showColorGamutPhase.Checked = data.colorCheck;
  3539. #endregion
  3540. radioButton1.Enabled = true;
  3541. radioButton2.Enabled = true;
  3542. checkBox1.Enabled = true;
  3543. checkBox2.Enabled = true;
  3544. }
  3545. /// <summary>
  3546. /// 保存到全部
  3547. /// </summary>
  3548. /// <param name="sender"></param>
  3549. /// <param name="e"></param>
  3550. private void button3_Click(object sender, EventArgs e)
  3551. {
  3552. if (this.lstView_img.FocusedItem == null)
  3553. {
  3554. return;
  3555. }
  3556. if (resultList.Count() == 0)
  3557. {
  3558. MessageBox.Show(PdnResources.GetString("Menu.PleaseClickApplyAllFirst.text") +"!");
  3559. return;
  3560. }
  3561. if (listBox_analysisResult.Items.Count > 0)
  3562. {
  3563. if (MessageBox.Show(PdnResources.GetString("Menu.Theresuethertoreplace.text") + "?", "", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
  3564. {
  3565. for (int i = 0; i < resultList.Count(); i++)
  3566. {
  3567. if (analysisResults.ContainsKey(this.appWorkspace.DocumentWorkspaces[i]))
  3568. {
  3569. continue;
  3570. }
  3571. else
  3572. {
  3573. analysisResults.Add(this.appWorkspace.DocumentWorkspaces[i], resultList[i]);
  3574. }
  3575. buildListBox_analysisResult();
  3576. }
  3577. return;
  3578. }
  3579. }
  3580. for (int i = 0; i < resultList.Count(); i++)
  3581. {
  3582. if (analysisResults.ContainsKey(this.appWorkspace.DocumentWorkspaces[i]))
  3583. {
  3584. analysisResults[this.appWorkspace.DocumentWorkspaces[i]] = resultList[i];
  3585. }
  3586. else
  3587. {
  3588. analysisResults.Add(this.appWorkspace.DocumentWorkspaces[i], resultList[i]);
  3589. }
  3590. buildListBox_analysisResult();
  3591. }
  3592. }
  3593. private void allCheck()
  3594. {
  3595. if (listBox_analysisResult.Items != null && listBox_analysisResult.Items.Count > 0)
  3596. {
  3597. for (int i = 0; i < listBox_analysisResult.Items.Count; i++)
  3598. {
  3599. listBox_analysisResult.SetItemChecked(i, true);
  3600. }
  3601. buildListView_analysisResult();
  3602. }
  3603. }
  3604. private void getValue(string key, Object value)
  3605. {
  3606. switch (key)
  3607. {
  3608. case "parameter1":
  3609. comboBox_rollingDirection.SelectedIndex = (int)value;
  3610. break;
  3611. case "parameter2":
  3612. numericUpDown_lwRatioLimit.Value = Convert.ToDecimal(value);
  3613. break;
  3614. case "parameter5":
  3615. checkBox_showColorGamutPhase.Checked = Convert.ToBoolean(value);
  3616. break;
  3617. case "parameter17":
  3618. checkBox_generateReport_opensetting.Checked = Convert.ToBoolean(value);
  3619. break;
  3620. case "parameter18":
  3621. radioButton1.Checked = (int)value == 1 ? true : false;
  3622. radioButton2.Checked = (int)value == 1 ? false : true;
  3623. if (radioButton1.Checked)
  3624. {
  3625. this.is_full = 2;
  3626. }
  3627. else
  3628. {
  3629. this.is_full = 1;
  3630. }
  3631. break;
  3632. case "parameter19":
  3633. checkBox2.Checked = Convert.ToBoolean(value);
  3634. is_showRectangle = Convert.ToBoolean(value);
  3635. break;
  3636. case "parameter20":
  3637. checkBox1.Checked = Convert.ToBoolean(value);
  3638. is_showOval = Convert.ToBoolean(value);
  3639. break;
  3640. case "scopeR":
  3641. List<double> redlist = (List<double>)value;
  3642. if (rgbDict.ContainsKey("red"))
  3643. {
  3644. rgbDict["red"] = redlist;
  3645. }
  3646. else
  3647. {
  3648. rgbDict.Add("red", redlist);
  3649. }
  3650. break;
  3651. case "scopeG":
  3652. List<double> greenlist = (List<double>)value;
  3653. if (rgbDict.ContainsKey("green"))
  3654. {
  3655. rgbDict["green"] = greenlist;
  3656. }
  3657. else
  3658. {
  3659. rgbDict.Add("green", greenlist);
  3660. }
  3661. break;
  3662. case "scopeB":
  3663. List<double> bluelist = (List<double>)value;
  3664. if (rgbDict.ContainsKey("blue"))
  3665. {
  3666. rgbDict["blue"] = bluelist;
  3667. }
  3668. else
  3669. {
  3670. rgbDict.Add("blue", bluelist);
  3671. }
  3672. break;
  3673. case "parameter3":
  3674. this.whichChecked = (int)value;
  3675. getInclusionParameters();
  3676. this.numericUpDown_colorAdjustmentRHU.Value = (decimal)rgbDict["red"][0];
  3677. this.numericUpDown_colorAdjustmentRHD.Value = (decimal)rgbDict["red"][1];
  3678. this.numericUpDown_colorAdjustmentGLU.Value = (decimal)rgbDict["green"][0];
  3679. this.numericUpDown_colorAdjustmentGLD.Value = (decimal)rgbDict["green"][1];
  3680. this.numericUpDown_colorAdjustmentBSU.Value = (decimal)rgbDict["blue"][0];
  3681. this.numericUpDown_colorAdjustmentBSD.Value = (decimal)rgbDict["blue"][1];
  3682. CalcRGBOrHLSValue();
  3683. UpdateHistogramStartAndEnd();
  3684. break;
  3685. case "OpenWhileExportReport":
  3686. checkBox_generateReport_opensetting.Checked = Convert.ToBoolean(value);
  3687. break;
  3688. case "CalculatorDecimalDigits":
  3689. this.domainUpDown_resultPrecision.TabIndex = (int)value;
  3690. this.domainUpDown_resultPrecision.Text = value.ToString();
  3691. break;
  3692. case "ExportResults":
  3693. isExportResults = Convert.ToBoolean(value);
  3694. break;
  3695. case "ExportReports":
  3696. isExportReports = Convert.ToBoolean(value);
  3697. break;
  3698. case "ExportProjects":
  3699. isExportProjects = Convert.ToBoolean(value);
  3700. break;
  3701. case "parameter14":
  3702. this.comboBox1.SelectedItem = (Convert.ToInt32(value) - 4).ToString();
  3703. this.autoJiaoBen = this.comboBox1.SelectedIndex;
  3704. break;
  3705. case "viewNum":
  3706. this.viewNum = Convert.ToInt32(value);
  3707. break;
  3708. }
  3709. }
  3710. /// <summary>
  3711. /// 不可点击空白区域
  3712. /// </summary>
  3713. /// <param name="sender"></param>
  3714. /// <param name="e"></param>
  3715. private void listView1_MouseUp(object sender, MouseEventArgs e)
  3716. {
  3717. if (e.Button == MouseButtons.Left)
  3718. {
  3719. if (lstView_img.SelectedItems.Count > 0)
  3720. {
  3721. }
  3722. else if (lstView_img.SelectedItems.Count <= 0)//点击空白区
  3723. {
  3724. if (this.lstView_img.FocusedItem != null)
  3725. {
  3726. ListViewItem item = this.lstView_img.GetItemAt(e.X, e.Y);
  3727. if (item == null)
  3728. {
  3729. this.lstView_img.FocusedItem.Selected = true;
  3730. }
  3731. }
  3732. }
  3733. }
  3734. }
  3735. #region [脚本录制]
  3736. private void getScriptRecording()
  3737. {
  3738. string className = InvariantData.path_Action + ".Action" + menuId;
  3739. ParamObject param = (ParamObject)System.Reflection.Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
  3740. List<Args> args = param.Lists;
  3741. foreach (var item in args)
  3742. {
  3743. item.value = setScriptRecording(item.key);
  3744. }
  3745. //找出二值相关参数 进行赋值
  3746. List<Args> isNullList = args.Where(m => m.value == null).ToList();
  3747. foreach (var item in isNullList)
  3748. {
  3749. item.value = binaryClass.setScriptRecording(item.key);
  3750. }
  3751. appWorkspace.SetScriptStartRecording(this.menuId, menuName, args);
  3752. }
  3753. private object setScriptRecording(string key)
  3754. {
  3755. object value = null;
  3756. switch (key)
  3757. {
  3758. case "parameter1":
  3759. value = comboBox_rollingDirection.SelectedIndex;
  3760. break;
  3761. case "parameter2":
  3762. value = numericUpDown_lwRatioLimit.Value;
  3763. break;
  3764. case "parameter5":
  3765. value = checkBox_showColorGamutPhase.Checked;
  3766. break;
  3767. case "parameter17":
  3768. value = checkBox_generateReport_opensetting.Checked;
  3769. break;
  3770. case "parameter18":
  3771. value = radioButton1.Checked ? 1 : 2;
  3772. break;
  3773. case "parameter19":
  3774. value = checkBox2.Checked;
  3775. break;
  3776. case "parameter20":
  3777. value = checkBox1.Checked;
  3778. break;
  3779. case "scopeR":
  3780. value = new List<double>() { (double)this.numericUpDown_colorAdjustmentRHU.Value, (double)this.numericUpDown_colorAdjustmentRHD.Value };
  3781. break;
  3782. case "scopeG":
  3783. value = new List<double>() { (double)this.numericUpDown_colorAdjustmentGLU.Value, (double)this.numericUpDown_colorAdjustmentGLD.Value };
  3784. break;
  3785. case "scopeB":
  3786. value = new List<double>() { (double)this.numericUpDown_colorAdjustmentBSU.Value, (double)this.numericUpDown_colorAdjustmentBSD.Value };
  3787. break;
  3788. case "parameter3":
  3789. value = thisParameters.parameter3;
  3790. break;
  3791. case "OpenWhileExportReport":
  3792. value = checkBox_generateReport_opensetting.Checked;
  3793. break;
  3794. case "CalculatorDecimalDigits":
  3795. value = this.domainUpDown_resultPrecision.SelectedItem;
  3796. break;
  3797. case "ExportResults":
  3798. value = isExportResults;
  3799. break;
  3800. case "ExportReports":
  3801. value = isExportReports;
  3802. break;
  3803. case "ExportProjects":
  3804. value = isExportProjects;
  3805. break;
  3806. case "parameter14":
  3807. value = this.comboBox1.SelectedItem;
  3808. break;
  3809. case "viewNum":
  3810. value = this.viewNum;
  3811. break;
  3812. }
  3813. return value;
  3814. }
  3815. #endregion
  3816. }
  3817. }