SpheroidizationGraphiteSize.cs 238 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771
  1. using OpenCvSharp;
  2. using OpenCvSharp.Extensions;
  3. using PaintDotNet.Annotation;
  4. using PaintDotNet.Annotation.Enum;
  5. using PaintDotNet.Base.Functionodel;
  6. using PaintDotNet.CustomControl;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.ComponentModel;
  10. using System.Data;
  11. using System.Drawing;
  12. using System.Drawing.Drawing2D;
  13. using System.Linq;
  14. using System.Text;
  15. using System.Threading.Tasks;
  16. using System.Windows.Forms;
  17. using PaintDotNet.DbOpreate.DbBll;
  18. using PaintDotNet.DbOpreate.DbModel;
  19. using PaintDotNet.Base.CommTool;
  20. using System.IO;
  21. using PaintDotNet.Base;
  22. using PaintDotNet.Base.SettingModel;
  23. using PaintDotNet.Data.Param;
  24. using PaintDotNet.DedicatedAnalysis.DuctileIron.Common;
  25. using PaintDotNet.GeneralAnalysis;
  26. using Metis.ParameterSet;
  27. namespace PaintDotNet.DedicatedAnalysis.DuctileIron.ISO945.GraphiteSize
  28. {
  29. internal class SpheroidizationGraphiteSize : PdnBaseForm
  30. {
  31. #region
  32. /// Required designer variable.
  33. /// </summary>
  34. private System.ComponentModel.IContainer components = null;
  35. /// <summary>
  36. /// Clean up any resources being used.
  37. /// </summary>
  38. /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
  39. protected override void Dispose(bool disposing)
  40. {
  41. if (disposing && (components != null))
  42. {
  43. components.Dispose();
  44. }
  45. base.Dispose(disposing);
  46. }
  47. #region Windows Form Designer generated code
  48. private void InitializeLanguageText()
  49. {
  50. this.bc = new PaintDotNet.CustomControl.BinaryControl();
  51. //
  52. // bc
  53. //
  54. this.bc.BinaryBackColor = System.Drawing.Color.Red;
  55. this.bc.BinaryChecked = false;
  56. this.bc.BinaryStyle = 1;
  57. this.bc.Location = new System.Drawing.Point(151, 59);
  58. this.bc.Name = "bc";
  59. this.bc.OriginChecked = false;
  60. this.bc.scope1End = 0D;
  61. this.bc.scope1Start = 0D;
  62. this.bc.scope2End = 0D;
  63. this.bc.scope2Start = 0D;
  64. this.bc.scope3End = 0D;
  65. this.bc.scope3Start = 0D;
  66. this.bc.Size = new System.Drawing.Size(360, 292);
  67. this.bc.TabIndex = 37;
  68. this.Controls.Add(this.bc);
  69. this.Controls.SetChildIndex(this.bc, 0);
  70. this.Text = "ISO945(" + PdnResources.GetString("Menu.Sizeofgraphite.Text") + ")";
  71. this.btnSetUp.Text = PdnResources.GetString("Menu.Setting.Text");
  72. this.checkBox1.Text = PdnResources.GetString("Menu.Opensettingsatingreport.text");
  73. this.button2.Text = PdnResources.GetString("Menu.Saveresult.text");
  74. this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
  75. this.groupBox2.Text = PdnResources.GetString("Menu.Tools.ImageIndex.Text");
  76. this.groupBox3.Text = PdnResources.GetString("Menu.Preview.text");
  77. this.checkBox3.Text = PdnResources.GetString("Menu.filter.text");
  78. this.label3.Text = PdnResources.GetString("Menu.range.text") + ":";
  79. this.groupBox5.Text = PdnResources.GetString("Menu.Particlescreening.text");
  80. this.checkBox4.Text = PdnResources.GetString("Menu.Dedicatedanalysis.blackmetal.Showdifofcolor.text");
  81. this.checkBox5.Text = PdnResources.GetString("Menu.Dedicatedanalysis.blackmetal.Displaythediualareacircle.text");
  82. this.btnColour.Text = PdnResources.GetString("Menu.Colorsetting.text");
  83. this.btnDisplay.Text = PdnResources.GetString("Menu.Displayparamssettings.text");
  84. this.checkBox6.Text = PdnResources.GetString("Menu.Dedicatedanalysis.blackmetal.Particleshecalculation.text");
  85. this.groupBox6.Text = PdnResources.GetString("Menu.paramssettings.text");
  86. this.groupBox8.Text = PdnResources.GetString("Menu.Number.text");
  87. this.button6.Text = PdnResources.GetString("Menu.Showall.text");
  88. this.button7.Text = PdnResources.GetString("Menu.Edit.Delete.Text");
  89. this.button8.Text = PdnResources.GetString("Menu.Tools.CreateReport.Text");
  90. this.button9.Text = PdnResources.GetString("Menu.Exportresults.text");
  91. this.label8.Text = PdnResources.GetString("Menu.Decimal.text") + ":";
  92. this.button1.Text = PdnResources.GetString("Menu.Exportproject.text");
  93. this.groupBox9.Text = PdnResources.GetString("Menu.Analysisresult.text");
  94. this.groupBox7.Text = PdnResources.GetString("Menu.Percentage.text");
  95. this.button3.Text = PdnResources.GetString("Menu.File.SaveAll.Text");
  96. this.button4.Text = PdnResources.GetString("Menu.Applyall.text");
  97. }
  98. /// <summary>
  99. /// Required method for Designer support - do not modify
  100. /// the contents of this method with the code editor.
  101. /// </summary>
  102. private void InitializeComponent()
  103. {
  104. this.components = new System.ComponentModel.Container();
  105. this.groupBox7 = new System.Windows.Forms.GroupBox();
  106. this.dataGridView3 = new System.Windows.Forms.DataGridView();
  107. this.groupBox9 = new System.Windows.Forms.GroupBox();
  108. this.dataGridView4 = new System.Windows.Forms.DataGridView();
  109. this.button1 = new System.Windows.Forms.Button();
  110. this.label10 = new System.Windows.Forms.Label();
  111. this.label9 = new System.Windows.Forms.Label();
  112. this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
  113. this.label8 = new System.Windows.Forms.Label();
  114. this.button9 = new System.Windows.Forms.Button();
  115. this.button8 = new System.Windows.Forms.Button();
  116. this.dataGridView2 = new System.Windows.Forms.DataGridView();
  117. this.listView2 = new System.Windows.Forms.ListView();
  118. this.button7 = new System.Windows.Forms.Button();
  119. this.button6 = new System.Windows.Forms.Button();
  120. this.groupBox8 = new System.Windows.Forms.GroupBox();
  121. this.dataGridView1 = new System.Windows.Forms.DataGridView();
  122. this.groupBox6 = new System.Windows.Forms.GroupBox();
  123. this.checkBox6 = new System.Windows.Forms.CheckBox();
  124. this.btnDisplay = new System.Windows.Forms.Button();
  125. this.btnColour = new System.Windows.Forms.Button();
  126. this.checkBox5 = new System.Windows.Forms.CheckBox();
  127. this.checkBox4 = new System.Windows.Forms.CheckBox();
  128. this.groupBox5 = new System.Windows.Forms.GroupBox();
  129. this.trackBar4 = new System.Windows.Forms.TrackBar();
  130. this.trackBar2 = new System.Windows.Forms.TrackBar();
  131. this.numericUpDown5 = new System.Windows.Forms.NumericUpDown();
  132. this.numericUpDown4 = new System.Windows.Forms.NumericUpDown();
  133. this.label3 = new System.Windows.Forms.Label();
  134. this.checkBox3 = new System.Windows.Forms.CheckBox();
  135. this.groupBox3 = new System.Windows.Forms.GroupBox();
  136. this.groupBox2 = new System.Windows.Forms.GroupBox();
  137. this.listView1 = new System.Windows.Forms.ListView();
  138. this.imageList1 = new System.Windows.Forms.ImageList(this.components);
  139. this.groupBox1 = new System.Windows.Forms.GroupBox();
  140. this.button3 = new System.Windows.Forms.Button();
  141. this.button4 = new System.Windows.Forms.Button();
  142. this.button2 = new System.Windows.Forms.Button();
  143. this.checkBox1 = new System.Windows.Forms.CheckBox();
  144. this.btnSetUp = new System.Windows.Forms.Button();
  145. this.groupBox7.SuspendLayout();
  146. ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).BeginInit();
  147. this.groupBox9.SuspendLayout();
  148. ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).BeginInit();
  149. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
  150. ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
  151. this.groupBox8.SuspendLayout();
  152. ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
  153. this.groupBox6.SuspendLayout();
  154. this.groupBox5.SuspendLayout();
  155. ((System.ComponentModel.ISupportInitialize)(this.trackBar4)).BeginInit();
  156. ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).BeginInit();
  157. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).BeginInit();
  158. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit();
  159. this.groupBox2.SuspendLayout();
  160. this.groupBox1.SuspendLayout();
  161. this.SuspendLayout();
  162. //
  163. // groupBox7
  164. //
  165. this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  166. | System.Windows.Forms.AnchorStyles.Left)));
  167. this.groupBox7.Controls.Add(this.dataGridView3);
  168. this.groupBox7.Location = new System.Drawing.Point(154, 643);
  169. this.groupBox7.Name = "groupBox7";
  170. this.groupBox7.Size = new System.Drawing.Size(356, 138);
  171. this.groupBox7.TabIndex = 36;
  172. this.groupBox7.TabStop = false;
  173. //
  174. // dataGridView3
  175. //
  176. this.dataGridView3.AllowUserToAddRows = false;
  177. this.dataGridView3.AllowUserToDeleteRows = false;
  178. this.dataGridView3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  179. | System.Windows.Forms.AnchorStyles.Left)));
  180. this.dataGridView3.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
  181. this.dataGridView3.BackgroundColor = System.Drawing.Color.White;
  182. this.dataGridView3.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
  183. this.dataGridView3.Location = new System.Drawing.Point(7, 21);
  184. this.dataGridView3.MultiSelect = false;
  185. this.dataGridView3.Name = "dataGridView3";
  186. this.dataGridView3.RowHeadersVisible = false;
  187. this.dataGridView3.RowTemplate.Height = 23;
  188. this.dataGridView3.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
  189. this.dataGridView3.Size = new System.Drawing.Size(343, 111);
  190. this.dataGridView3.TabIndex = 0;
  191. //
  192. // groupBox9
  193. //
  194. this.groupBox9.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
  195. | System.Windows.Forms.AnchorStyles.Right)));
  196. this.groupBox9.Controls.Add(this.dataGridView4);
  197. this.groupBox9.Controls.Add(this.button1);
  198. this.groupBox9.Controls.Add(this.label10);
  199. this.groupBox9.Controls.Add(this.label9);
  200. this.groupBox9.Controls.Add(this.numericUpDown1);
  201. this.groupBox9.Controls.Add(this.label8);
  202. this.groupBox9.Controls.Add(this.button9);
  203. this.groupBox9.Controls.Add(this.button8);
  204. this.groupBox9.Controls.Add(this.dataGridView2);
  205. this.groupBox9.Controls.Add(this.listView2);
  206. this.groupBox9.Controls.Add(this.button7);
  207. this.groupBox9.Controls.Add(this.button6);
  208. this.groupBox9.Location = new System.Drawing.Point(13, 786);
  209. this.groupBox9.Name = "groupBox9";
  210. this.groupBox9.Size = new System.Drawing.Size(1223, 204);
  211. this.groupBox9.TabIndex = 35;
  212. this.groupBox9.TabStop = false;
  213. //
  214. // dataGridView4
  215. //
  216. this.dataGridView4.AllowUserToAddRows = false;
  217. this.dataGridView4.AllowUserToDeleteRows = false;
  218. this.dataGridView4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  219. | System.Windows.Forms.AnchorStyles.Left)
  220. | System.Windows.Forms.AnchorStyles.Right)));
  221. this.dataGridView4.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
  222. this.dataGridView4.BackgroundColor = System.Drawing.Color.White;
  223. this.dataGridView4.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
  224. this.dataGridView4.Location = new System.Drawing.Point(228, 122);
  225. this.dataGridView4.MultiSelect = false;
  226. this.dataGridView4.Name = "dataGridView4";
  227. this.dataGridView4.RowHeadersVisible = false;
  228. this.dataGridView4.RowTemplate.Height = 23;
  229. this.dataGridView4.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
  230. this.dataGridView4.Size = new System.Drawing.Size(830, 76);
  231. this.dataGridView4.TabIndex = 13;
  232. //
  233. // button1
  234. //
  235. this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  236. this.button1.Location = new System.Drawing.Point(1083, 109);
  237. this.button1.Name = "button1";
  238. this.button1.Size = new System.Drawing.Size(128, 26);
  239. this.button1.TabIndex = 10;
  240. this.button1.UseVisualStyleBackColor = true;
  241. this.button1.Click += new System.EventHandler(this.button1_Click);
  242. //
  243. // label10
  244. //
  245. this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  246. | System.Windows.Forms.AnchorStyles.Right)));
  247. this.label10.AutoSize = true;
  248. this.label10.ForeColor = System.Drawing.SystemColors.ScrollBar;
  249. this.label10.Location = new System.Drawing.Point(1064, 9);
  250. this.label10.Name = "label10";
  251. this.label10.Size = new System.Drawing.Size(11, 192);
  252. this.label10.TabIndex = 9;
  253. this.label10.Text = "|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|";
  254. //
  255. // label9
  256. //
  257. this.label9.AutoSize = true;
  258. this.label9.ForeColor = System.Drawing.SystemColors.ScrollBar;
  259. this.label9.Location = new System.Drawing.Point(210, 9);
  260. this.label9.Name = "label9";
  261. this.label9.Size = new System.Drawing.Size(11, 192);
  262. this.label9.TabIndex = 8;
  263. this.label9.Text = "|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|\r\n|";
  264. //
  265. // numericUpDown1
  266. //
  267. this.numericUpDown1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
  268. this.numericUpDown1.Location = new System.Drawing.Point(1135, 162);
  269. this.numericUpDown1.Maximum = new decimal(new int[] {
  270. 10,
  271. 0,
  272. 0,
  273. 0});
  274. this.numericUpDown1.Name = "numericUpDown1";
  275. this.numericUpDown1.Size = new System.Drawing.Size(70, 21);
  276. this.numericUpDown1.TabIndex = 7;
  277. this.numericUpDown1.Value = new decimal(new int[] {
  278. 2,
  279. 0,
  280. 0,
  281. 0});
  282. this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
  283. //
  284. // label8
  285. //
  286. this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
  287. this.label8.AutoSize = true;
  288. this.label8.Location = new System.Drawing.Point(1097, 167);
  289. this.label8.Name = "label8";
  290. this.label8.Size = new System.Drawing.Size(0, 12);
  291. this.label8.TabIndex = 6;
  292. //
  293. // button9
  294. //
  295. this.button9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  296. this.button9.Location = new System.Drawing.Point(1083, 71);
  297. this.button9.Name = "button9";
  298. this.button9.Size = new System.Drawing.Size(128, 26);
  299. this.button9.TabIndex = 5;
  300. this.button9.UseVisualStyleBackColor = true;
  301. this.button9.Click += new System.EventHandler(this.button9_Click);
  302. //
  303. // button8
  304. //
  305. this.button8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  306. this.button8.Location = new System.Drawing.Point(1083, 34);
  307. this.button8.Name = "button8";
  308. this.button8.Size = new System.Drawing.Size(128, 26);
  309. this.button8.TabIndex = 4;
  310. this.button8.UseVisualStyleBackColor = true;
  311. this.button8.Click += new System.EventHandler(this.button8_Click);
  312. //
  313. // dataGridView2
  314. //
  315. this.dataGridView2.AllowUserToAddRows = false;
  316. this.dataGridView2.AllowUserToDeleteRows = false;
  317. this.dataGridView2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  318. | System.Windows.Forms.AnchorStyles.Left)
  319. | System.Windows.Forms.AnchorStyles.Right)));
  320. this.dataGridView2.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
  321. this.dataGridView2.BackgroundColor = System.Drawing.Color.White;
  322. this.dataGridView2.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
  323. this.dataGridView2.Location = new System.Drawing.Point(228, 15);
  324. this.dataGridView2.MultiSelect = false;
  325. this.dataGridView2.Name = "dataGridView2";
  326. this.dataGridView2.RowHeadersVisible = false;
  327. this.dataGridView2.RowTemplate.Height = 23;
  328. this.dataGridView2.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
  329. this.dataGridView2.Size = new System.Drawing.Size(830, 102);
  330. this.dataGridView2.TabIndex = 3;
  331. //
  332. // listView2
  333. //
  334. this.listView2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  335. | System.Windows.Forms.AnchorStyles.Left)));
  336. this.listView2.HideSelection = false;
  337. this.listView2.Location = new System.Drawing.Point(16, 56);
  338. this.listView2.Name = "listView2";
  339. this.listView2.Size = new System.Drawing.Size(181, 140);
  340. this.listView2.TabIndex = 2;
  341. this.listView2.UseCompatibleStateImageBehavior = false;
  342. this.listView2.SelectedIndexChanged += new System.EventHandler(this.listView2_SelectedIndexChanged);
  343. //
  344. // button7
  345. //
  346. this.button7.Location = new System.Drawing.Point(145, 20);
  347. this.button7.Name = "button7";
  348. this.button7.Size = new System.Drawing.Size(52, 26);
  349. this.button7.TabIndex = 1;
  350. this.button7.UseVisualStyleBackColor = true;
  351. this.button7.Click += new System.EventHandler(this.button7_Click);
  352. //
  353. // button6
  354. //
  355. this.button6.Location = new System.Drawing.Point(16, 20);
  356. this.button6.Name = "button6";
  357. this.button6.Size = new System.Drawing.Size(93, 26);
  358. this.button6.TabIndex = 0;
  359. this.button6.UseVisualStyleBackColor = true;
  360. this.button6.Click += new System.EventHandler(this.button6_Click);
  361. //
  362. // groupBox8
  363. //
  364. this.groupBox8.Controls.Add(this.dataGridView1);
  365. this.groupBox8.Location = new System.Drawing.Point(154, 508);
  366. this.groupBox8.Name = "groupBox8";
  367. this.groupBox8.Size = new System.Drawing.Size(356, 135);
  368. this.groupBox8.TabIndex = 34;
  369. this.groupBox8.TabStop = false;
  370. //
  371. // dataGridView1
  372. //
  373. this.dataGridView1.AllowUserToAddRows = false;
  374. this.dataGridView1.AllowUserToDeleteRows = false;
  375. this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  376. | System.Windows.Forms.AnchorStyles.Left)
  377. | System.Windows.Forms.AnchorStyles.Right)));
  378. this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
  379. this.dataGridView1.BackgroundColor = System.Drawing.Color.White;
  380. this.dataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
  381. this.dataGridView1.Location = new System.Drawing.Point(7, 21);
  382. this.dataGridView1.MultiSelect = false;
  383. this.dataGridView1.Name = "dataGridView1";
  384. this.dataGridView1.RowHeadersVisible = false;
  385. this.dataGridView1.RowTemplate.Height = 23;
  386. this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
  387. this.dataGridView1.Size = new System.Drawing.Size(343, 108);
  388. this.dataGridView1.TabIndex = 0;
  389. //
  390. // groupBox6
  391. //
  392. this.groupBox6.Controls.Add(this.checkBox6);
  393. this.groupBox6.Controls.Add(this.btnDisplay);
  394. this.groupBox6.Controls.Add(this.btnColour);
  395. this.groupBox6.Controls.Add(this.checkBox5);
  396. this.groupBox6.Controls.Add(this.checkBox4);
  397. this.groupBox6.Location = new System.Drawing.Point(153, 419);
  398. this.groupBox6.Name = "groupBox6";
  399. this.groupBox6.Size = new System.Drawing.Size(358, 87);
  400. this.groupBox6.TabIndex = 33;
  401. this.groupBox6.TabStop = false;
  402. //
  403. // checkBox6
  404. //
  405. this.checkBox6.AutoSize = true;
  406. this.checkBox6.Location = new System.Drawing.Point(18, 17);
  407. this.checkBox6.Name = "checkBox6";
  408. this.checkBox6.Size = new System.Drawing.Size(15, 14);
  409. this.checkBox6.TabIndex = 11;
  410. this.checkBox6.UseVisualStyleBackColor = true;
  411. this.checkBox6.CheckedChanged += new System.EventHandler(this.checkBox6_CheckedChanged);
  412. //
  413. // btnDisplay
  414. //
  415. this.btnDisplay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  416. this.btnDisplay.Location = new System.Drawing.Point(249, 58);
  417. this.btnDisplay.Name = "btnDisplay";
  418. this.btnDisplay.Size = new System.Drawing.Size(85, 26);
  419. this.btnDisplay.TabIndex = 10;
  420. this.btnDisplay.UseVisualStyleBackColor = true;
  421. this.btnDisplay.Click += new System.EventHandler(this.btnDisplay_Click);
  422. //
  423. // btnColour
  424. //
  425. this.btnColour.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  426. this.btnColour.Location = new System.Drawing.Point(259, 33);
  427. this.btnColour.Name = "btnColour";
  428. this.btnColour.Size = new System.Drawing.Size(75, 23);
  429. this.btnColour.TabIndex = 9;
  430. this.btnColour.UseVisualStyleBackColor = true;
  431. this.btnColour.Click += new System.EventHandler(this.btnColour_Click);
  432. //
  433. // checkBox5
  434. //
  435. this.checkBox5.AutoSize = true;
  436. this.checkBox5.Location = new System.Drawing.Point(18, 63);
  437. this.checkBox5.Name = "checkBox5";
  438. this.checkBox5.Size = new System.Drawing.Size(15, 14);
  439. this.checkBox5.TabIndex = 8;
  440. this.checkBox5.UseVisualStyleBackColor = true;
  441. this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged);
  442. //
  443. // checkBox4
  444. //
  445. this.checkBox4.AutoSize = true;
  446. this.checkBox4.Location = new System.Drawing.Point(18, 40);
  447. this.checkBox4.Name = "checkBox4";
  448. this.checkBox4.Size = new System.Drawing.Size(15, 14);
  449. this.checkBox4.TabIndex = 7;
  450. this.checkBox4.UseVisualStyleBackColor = true;
  451. this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged);
  452. //
  453. // groupBox5
  454. //
  455. this.groupBox5.Controls.Add(this.trackBar4);
  456. this.groupBox5.Controls.Add(this.trackBar2);
  457. this.groupBox5.Controls.Add(this.numericUpDown5);
  458. this.groupBox5.Controls.Add(this.numericUpDown4);
  459. this.groupBox5.Controls.Add(this.label3);
  460. this.groupBox5.Controls.Add(this.checkBox3);
  461. this.groupBox5.Location = new System.Drawing.Point(153, 351);
  462. this.groupBox5.Name = "groupBox5";
  463. this.groupBox5.Size = new System.Drawing.Size(356, 65);
  464. this.groupBox5.TabIndex = 32;
  465. this.groupBox5.TabStop = false;
  466. //
  467. // trackBar4
  468. //
  469. this.trackBar4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  470. this.trackBar4.AutoSize = false;
  471. this.trackBar4.Location = new System.Drawing.Point(196, 32);
  472. this.trackBar4.Maximum = 0;
  473. this.trackBar4.Name = "trackBar4";
  474. this.trackBar4.Size = new System.Drawing.Size(87, 25);
  475. this.trackBar4.TabIndex = 15;
  476. this.trackBar4.TickStyle = System.Windows.Forms.TickStyle.None;
  477. //
  478. // trackBar2
  479. //
  480. this.trackBar2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  481. | System.Windows.Forms.AnchorStyles.Right)));
  482. this.trackBar2.AutoSize = false;
  483. this.trackBar2.Location = new System.Drawing.Point(106, 32);
  484. this.trackBar2.Maximum = 0;
  485. this.trackBar2.Name = "trackBar2";
  486. this.trackBar2.Size = new System.Drawing.Size(87, 25);
  487. this.trackBar2.TabIndex = 14;
  488. this.trackBar2.TickStyle = System.Windows.Forms.TickStyle.None;
  489. //
  490. // numericUpDown5
  491. //
  492. this.numericUpDown5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  493. this.numericUpDown5.Location = new System.Drawing.Point(285, 33);
  494. this.numericUpDown5.Maximum = new decimal(new int[] {
  495. 0,
  496. 0,
  497. 0,
  498. 0});
  499. this.numericUpDown5.Name = "numericUpDown5";
  500. this.numericUpDown5.Size = new System.Drawing.Size(62, 21);
  501. this.numericUpDown5.TabIndex = 12;
  502. //
  503. // numericUpDown4
  504. //
  505. this.numericUpDown4.Location = new System.Drawing.Point(47, 33);
  506. this.numericUpDown4.Maximum = new decimal(new int[] {
  507. 0,
  508. 0,
  509. 0,
  510. 0});
  511. this.numericUpDown4.Name = "numericUpDown4";
  512. this.numericUpDown4.Size = new System.Drawing.Size(59, 21);
  513. this.numericUpDown4.TabIndex = 10;
  514. //
  515. // label3
  516. //
  517. this.label3.AutoSize = true;
  518. this.label3.Location = new System.Drawing.Point(9, 37);
  519. this.label3.Name = "label3";
  520. this.label3.Size = new System.Drawing.Size(0, 12);
  521. this.label3.TabIndex = 9;
  522. //
  523. // checkBox3
  524. //
  525. this.checkBox3.AutoSize = true;
  526. this.checkBox3.Location = new System.Drawing.Point(30, 16);
  527. this.checkBox3.Name = "checkBox3";
  528. this.checkBox3.Size = new System.Drawing.Size(15, 14);
  529. this.checkBox3.TabIndex = 0;
  530. this.checkBox3.UseVisualStyleBackColor = true;
  531. this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged);
  532. //
  533. // groupBox3
  534. //
  535. this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  536. | System.Windows.Forms.AnchorStyles.Left)
  537. | System.Windows.Forms.AnchorStyles.Right)));
  538. this.groupBox3.Location = new System.Drawing.Point(517, 61);
  539. this.groupBox3.Name = "groupBox3";
  540. this.groupBox3.Size = new System.Drawing.Size(719, 719);
  541. this.groupBox3.TabIndex = 30;
  542. this.groupBox3.TabStop = false;
  543. //
  544. // groupBox2
  545. //
  546. this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  547. | System.Windows.Forms.AnchorStyles.Left)));
  548. this.groupBox2.Controls.Add(this.listView1);
  549. this.groupBox2.Location = new System.Drawing.Point(13, 61);
  550. this.groupBox2.Name = "groupBox2";
  551. this.groupBox2.Size = new System.Drawing.Size(135, 720);
  552. this.groupBox2.TabIndex = 29;
  553. this.groupBox2.TabStop = false;
  554. //
  555. // listView1
  556. //
  557. this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  558. | System.Windows.Forms.AnchorStyles.Left)
  559. | System.Windows.Forms.AnchorStyles.Right)));
  560. this.listView1.HideSelection = false;
  561. this.listView1.LargeImageList = this.imageList1;
  562. this.listView1.Location = new System.Drawing.Point(5, 17);
  563. this.listView1.MultiSelect = false;
  564. this.listView1.Name = "listView1";
  565. this.listView1.Size = new System.Drawing.Size(124, 697);
  566. this.listView1.TabIndex = 0;
  567. this.listView1.UseCompatibleStateImageBehavior = false;
  568. this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
  569. this.listView1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseDown);
  570. //
  571. // imageList1
  572. //
  573. this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
  574. this.imageList1.ImageSize = new System.Drawing.Size(64, 64);
  575. this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
  576. //
  577. // groupBox1
  578. //
  579. this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  580. | System.Windows.Forms.AnchorStyles.Right)));
  581. this.groupBox1.Controls.Add(this.button3);
  582. this.groupBox1.Controls.Add(this.button4);
  583. this.groupBox1.Controls.Add(this.button2);
  584. this.groupBox1.Controls.Add(this.checkBox1);
  585. this.groupBox1.Controls.Add(this.btnSetUp);
  586. this.groupBox1.Location = new System.Drawing.Point(13, 4);
  587. this.groupBox1.Name = "groupBox1";
  588. this.groupBox1.Size = new System.Drawing.Size(1223, 50);
  589. this.groupBox1.TabIndex = 28;
  590. this.groupBox1.TabStop = false;
  591. //
  592. // button3
  593. //
  594. this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  595. this.button3.Location = new System.Drawing.Point(1133, 14);
  596. this.button3.Name = "button3";
  597. this.button3.Size = new System.Drawing.Size(84, 30);
  598. this.button3.TabIndex = 15;
  599. this.button3.Text = "保存全部";
  600. this.button3.UseVisualStyleBackColor = true;
  601. this.button3.Click += new System.EventHandler(this.button3_Click);
  602. //
  603. // button4
  604. //
  605. this.button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  606. this.button4.Location = new System.Drawing.Point(953, 14);
  607. this.button4.Name = "button4";
  608. this.button4.Size = new System.Drawing.Size(84, 30);
  609. this.button4.TabIndex = 14;
  610. this.button4.Text = "应用全部";
  611. this.button4.UseVisualStyleBackColor = true;
  612. this.button4.Click += new System.EventHandler(this.button4_Click);
  613. //
  614. // button2
  615. //
  616. this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  617. | System.Windows.Forms.AnchorStyles.Right)));
  618. this.button2.Location = new System.Drawing.Point(1043, 14);
  619. this.button2.Name = "button2";
  620. this.button2.Size = new System.Drawing.Size(84, 30);
  621. this.button2.TabIndex = 2;
  622. this.button2.UseVisualStyleBackColor = true;
  623. this.button2.Click += new System.EventHandler(this.button2_Click);
  624. //
  625. // checkBox1
  626. //
  627. this.checkBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  628. | System.Windows.Forms.AnchorStyles.Left)));
  629. this.checkBox1.AutoSize = true;
  630. this.checkBox1.Location = new System.Drawing.Point(141, 21);
  631. this.checkBox1.Name = "checkBox1";
  632. this.checkBox1.Size = new System.Drawing.Size(15, 14);
  633. this.checkBox1.TabIndex = 1;
  634. this.checkBox1.UseVisualStyleBackColor = true;
  635. //
  636. // btnSetUp
  637. //
  638. this.btnSetUp.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  639. | System.Windows.Forms.AnchorStyles.Left)));
  640. this.btnSetUp.Location = new System.Drawing.Point(15, 14);
  641. this.btnSetUp.Name = "btnSetUp";
  642. this.btnSetUp.Size = new System.Drawing.Size(84, 30);
  643. this.btnSetUp.TabIndex = 0;
  644. this.btnSetUp.UseVisualStyleBackColor = true;
  645. this.btnSetUp.Click += new System.EventHandler(this.btnSetUp_Click);
  646. //
  647. // SpheroidizationGraphiteSize
  648. //
  649. this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
  650. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  651. this.ClientSize = new System.Drawing.Size(1249, 994);
  652. this.Controls.Add(this.groupBox7);
  653. this.Controls.Add(this.groupBox9);
  654. this.Controls.Add(this.groupBox8);
  655. this.Controls.Add(this.groupBox6);
  656. this.Controls.Add(this.groupBox5);
  657. this.Controls.Add(this.groupBox3);
  658. this.Controls.Add(this.groupBox2);
  659. this.Controls.Add(this.groupBox1);
  660. this.Name = "SpheroidizationGraphiteSize";
  661. this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.InclusionsStandardDialog_FormClosing);
  662. this.Load += new System.EventHandler(this.GrainSizeDialog_Load);
  663. this.Shown += new System.EventHandler(this.ShownChoiseItemAndInitData);
  664. this.Controls.SetChildIndex(this.groupBox1, 0);
  665. this.Controls.SetChildIndex(this.groupBox2, 0);
  666. this.Controls.SetChildIndex(this.groupBox3, 0);
  667. this.Controls.SetChildIndex(this.groupBox5, 0);
  668. this.Controls.SetChildIndex(this.groupBox6, 0);
  669. this.Controls.SetChildIndex(this.groupBox8, 0);
  670. this.Controls.SetChildIndex(this.groupBox9, 0);
  671. this.Controls.SetChildIndex(this.groupBox7, 0);
  672. this.groupBox7.ResumeLayout(false);
  673. ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).EndInit();
  674. this.groupBox9.ResumeLayout(false);
  675. this.groupBox9.PerformLayout();
  676. ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).EndInit();
  677. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
  678. ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
  679. this.groupBox8.ResumeLayout(false);
  680. ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
  681. this.groupBox6.ResumeLayout(false);
  682. this.groupBox6.PerformLayout();
  683. this.groupBox5.ResumeLayout(false);
  684. this.groupBox5.PerformLayout();
  685. ((System.ComponentModel.ISupportInitialize)(this.trackBar4)).EndInit();
  686. ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).EndInit();
  687. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).EndInit();
  688. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();
  689. this.groupBox2.ResumeLayout(false);
  690. this.groupBox1.ResumeLayout(false);
  691. this.groupBox1.PerformLayout();
  692. this.ResumeLayout(false);
  693. }
  694. #endregion
  695. private System.Windows.Forms.GroupBox groupBox7;
  696. private System.Windows.Forms.DataGridView dataGridView3;
  697. private System.Windows.Forms.GroupBox groupBox9;
  698. private System.Windows.Forms.Label label10;
  699. private System.Windows.Forms.Label label9;
  700. private System.Windows.Forms.NumericUpDown numericUpDown1;
  701. private System.Windows.Forms.Label label8;
  702. private System.Windows.Forms.Button button9;
  703. private System.Windows.Forms.Button button8;
  704. private System.Windows.Forms.DataGridView dataGridView2;
  705. private System.Windows.Forms.ListView listView2;
  706. private System.Windows.Forms.Button button7;
  707. private System.Windows.Forms.Button button6;
  708. private System.Windows.Forms.GroupBox groupBox8;
  709. private System.Windows.Forms.DataGridView dataGridView1;
  710. private System.Windows.Forms.GroupBox groupBox6;
  711. private System.Windows.Forms.CheckBox checkBox6;
  712. private System.Windows.Forms.Button btnDisplay;
  713. private System.Windows.Forms.Button btnColour;
  714. public System.Windows.Forms.CheckBox checkBox5;
  715. public System.Windows.Forms.CheckBox checkBox4;
  716. private System.Windows.Forms.GroupBox groupBox5;
  717. private System.Windows.Forms.TrackBar trackBar4;
  718. private System.Windows.Forms.TrackBar trackBar2;
  719. private System.Windows.Forms.NumericUpDown numericUpDown5;
  720. private System.Windows.Forms.NumericUpDown numericUpDown4;
  721. private System.Windows.Forms.Label label3;
  722. private System.Windows.Forms.CheckBox checkBox3;
  723. private System.Windows.Forms.GroupBox groupBox3;
  724. private System.Windows.Forms.GroupBox groupBox2;
  725. private System.Windows.Forms.ListView listView1;
  726. private System.Windows.Forms.GroupBox groupBox1;
  727. private System.Windows.Forms.Button button2;
  728. private System.Windows.Forms.CheckBox checkBox1;
  729. private System.Windows.Forms.Button btnSetUp;
  730. private System.Windows.Forms.ImageList imageList1;
  731. private System.Windows.Forms.Button button1;
  732. private System.Windows.Forms.DataGridView dataGridView4;
  733. private CustomControl.BinaryControl bc;
  734. #endregion
  735. public static SpheroidizationGraphiteSize spheroidizationGraphiteSize;
  736. /// <summary>
  737. /// 调色板
  738. /// </summary>
  739. PaintDotNet.ColorsForm colorsForm1;
  740. PaintDotNet.ColorsForm colorsForm2;
  741. /// <summary>
  742. /// 主控件
  743. /// </summary>
  744. private AppWorkspace appWorkspace;
  745. /// <summary>
  746. /// 图像面板
  747. /// </summary>
  748. public DocumentWorkspaceWindow documentWorkspace;
  749. /// <summary>
  750. /// 公共按钮
  751. /// </summary>
  752. private CommonControlButtons commonControlButtons;
  753. /// <summary>
  754. /// 选中图片的bitmap
  755. /// </summary>
  756. private Bitmap bitmap;
  757. /// <summary>
  758. /// 计算结果的表格集合
  759. /// </summary>
  760. private List<DataTable> resultTableList = new List<DataTable>();
  761. /// <summary>
  762. /// 保存用于生成报告的图片
  763. /// </summary>
  764. private List<Bitmap> bitList;
  765. /// <summary>
  766. /// 储存点击保存结果后的所有原图与分析图
  767. /// </summary>
  768. private Dictionary<string, List<Bitmap>> bitDic = new Dictionary<string, List<Bitmap>>();
  769. /// <summary>
  770. /// 是否显示全部
  771. /// </summary>
  772. private bool showAll = false;
  773. /// <summary>
  774. /// 当前图片是否有视场
  775. /// </summary>
  776. private bool isHadView = false;
  777. /// <summary>
  778. /// 原图mat-包括视场
  779. /// </summary>
  780. private Mat mat;
  781. /// <summary>
  782. /// 二值处理后的mat
  783. /// </summary>
  784. private Mat binarizationMat;
  785. /// <summary>
  786. /// 面积率为0.8-1的mat
  787. /// </summary>
  788. private Mat binarizationMat08_1;
  789. /// <summary>
  790. /// 面积率为0.6-0.8的mat
  791. /// </summary>
  792. private Mat binarizationMat06_08;
  793. /// <summary>
  794. /// 面积率为0.4-0.6的mat
  795. /// </summary>
  796. private Mat binarizationMat04_06;
  797. /// <summary>
  798. /// 面积率为0.2-0.4的mat
  799. /// </summary>
  800. private Mat binarizationMat02_04;
  801. /// <summary>
  802. /// 面积率为0.1-0.2的mat
  803. /// </summary>
  804. private Mat binarizationMat01_02;
  805. /// <summary>
  806. /// 面积率为0-0.1的mat
  807. /// </summary>
  808. private Mat binarizationMat0_01;
  809. /// <summary>
  810. /// 相的集合
  811. /// </summary>
  812. private PhaseModel phaseModel;
  813. /// <summary>
  814. /// 相的集合
  815. /// </summary>
  816. private PhaseModel phaseModel08_1;
  817. /// <summary>
  818. /// 相的集合
  819. /// </summary>
  820. private PhaseModel phaseModel06_08;
  821. /// <summary>
  822. /// 相的集合
  823. /// </summary>
  824. private PhaseModel phaseModel04_06;
  825. /// <summary>
  826. /// 相的集合
  827. /// </summary>
  828. private PhaseModel phaseModel02_04;
  829. /// <summary>
  830. /// 相的集合
  831. /// </summary>
  832. private PhaseModel phaseModel01_02;
  833. /// <summary>
  834. /// 相的集合
  835. /// </summary>
  836. private PhaseModel phaseModel0_01;
  837. /// <summary>
  838. /// 单位标尺
  839. /// </summary>
  840. private double unitLength = 1;
  841. /// <summary>
  842. /// 放大倍数
  843. /// </summary>
  844. private double multiple = 1;
  845. /// <summary>
  846. /// 坐标集合
  847. /// </summary>
  848. private List<OpenCvSharp.Point> pointList = new List<OpenCvSharp.Point>();
  849. /// <summary>
  850. /// 绘制点
  851. /// </summary>
  852. private List<double> leList = new List<double>();
  853. /// <summary>
  854. /// 最大点碳化物点集合
  855. /// </summary>
  856. private List<List<OpenCvSharp.Point>> maxPoint;
  857. /// <summary>
  858. /// 尺寸大于1000微米碳化物点集合
  859. /// </summary>
  860. private List<List<OpenCvSharp.Point>> lstPoint1;
  861. /// <summary>
  862. /// 尺寸500-1000微米碳化物点集合
  863. /// </summary>
  864. private List<List<OpenCvSharp.Point>> lstPoint2;
  865. /// <summary>
  866. /// 尺寸250-500微米碳化物点集合
  867. /// </summary>
  868. private List<List<OpenCvSharp.Point>> lstPoint3;
  869. /// <summary>
  870. /// 尺寸120-250微米碳化物点集合
  871. /// </summary>
  872. private List<List<OpenCvSharp.Point>> lstPoint4;
  873. /// <summary>
  874. /// 尺寸60-120微米碳化物点集合
  875. /// </summary>
  876. private List<List<OpenCvSharp.Point>> lstPoint5;
  877. /// <summary>
  878. /// 尺寸30-60微米碳化物点集合
  879. /// </summary>
  880. private List<List<OpenCvSharp.Point>> lstPoint6;
  881. /// <summary>
  882. /// 尺寸15-30微米碳化物点集合
  883. /// </summary>
  884. private List<List<OpenCvSharp.Point>> lstPoint7;
  885. /// <summary>
  886. /// 尺寸小于15微米碳化物点集合
  887. /// </summary>
  888. private List<List<OpenCvSharp.Point>> lstPoint8;
  889. /// <summary>
  890. /// 钨系A标准
  891. /// </summary>
  892. private double[] tungstenA = new double[] { 18, 21, 23, 25 };
  893. /// <summary>
  894. /// 钨系B标准
  895. /// </summary>
  896. private double[] tungstenB = new double[] { 16, 18, 21, 23 };
  897. /// <summary>
  898. /// 钼系标准
  899. /// </summary>
  900. private double[] molybdenum = new double[] { 6.1, 8.3, 12.5, 15.6, 22.1 };
  901. /// <summary>
  902. /// 面积率
  903. /// </summary>
  904. private double areaRatio = 0;
  905. /// <summary>
  906. /// 面积率最大值
  907. /// </summary>
  908. double maxAreaRatio = 0;
  909. /// <summary>
  910. /// 面积率最小值
  911. /// </summary>
  912. double minAreaRatio = 100;
  913. /// <summary>
  914. /// 球化率
  915. /// </summary>
  916. double spheroidizationRate = 0;
  917. /// <summary>
  918. /// 石墨含量
  919. /// </summary>
  920. double spheroidizationAreaRate = 0;
  921. /// <summary>
  922. /// 存储面积率颜色字典
  923. /// </summary>
  924. public Dictionary<string, Color> colour = new Dictionary<string, Color>();
  925. // <summary>
  926. /// 存储字号与颜色字典
  927. /// </summary>
  928. public Dictionary<string, Color> colourFont = new Dictionary<string, Color>();
  929. /// <summary>
  930. /// 碳化物尺寸最大值
  931. /// </summary>
  932. private double maxSize = 0;
  933. /// <summary>
  934. /// 是否仅修改相的颜色
  935. /// </summary>
  936. private bool changeColor = false;
  937. /// <summary>
  938. /// 是否未对图片做其他操作
  939. /// </summary>
  940. private bool isFirstSwitch = false;
  941. /// <summary>
  942. /// 中间数据
  943. /// </summary>
  944. private List<ExportProjectModel> tempDataModel = new List<ExportProjectModel>();
  945. /// <summary>
  946. /// 类型(球铁-1,灰铁-2,蠕铁-3)
  947. /// </summary>
  948. private int IronType = 0;
  949. private int defaultIndex = -1;
  950. private bool needChange = true;
  951. /// <summary>
  952. /// 保存窗口参数
  953. /// </summary>
  954. /// <summary>
  955. /// 各个图片对应数据
  956. /// </summary>
  957. private Dictionary<string, GrainSizeAnalysisModel> eachData = new Dictionary<string, GrainSizeAnalysisModel>();
  958. private const string ParamKey_Report = "report";//报告设置
  959. private const string ParamKey_Screen = "screen";//筛选
  960. private const string ParamKey_ScreenMin = "screenMin";//面积最小值
  961. private const string ParamKey_ScreenMax = "screenMax";//面积最大值
  962. private const string ParamKey_Diameter = "diameter";//直径小于20um不参与计算
  963. private const string ParamKey_Colour = "colour";//显示不同级别颜色
  964. private const string ParamKey_AreaRatio = "areaRatio";//显示面积率
  965. private const string ParamKey_DecimalPlace = "decimalPlace";//保留小数位数
  966. private const string ParamKey_PanelColour1 = "panelColour1";//不同区间颜色
  967. private const string ParamKey_PanelColour2 = "panelColour2";//不同区间颜色
  968. private const string ParamKey_PanelColour3 = "panelColour3";//不同区间颜色
  969. private const string ParamKey_PanelColour4 = "panelColour4";//不同区间颜色
  970. private const string ParamKey_PanelColour5 = "panelColour5";//不同区间颜色
  971. private const string ParamKey_PanelColour6 = "panelColour6";//不同区间颜色
  972. private const string ParamKey_PanelColour7 = "panelColour7";//不同区间颜色
  973. private const string ParamKey_PanelColour8 = "panelColour8";//不同区间颜色
  974. private const string ParamKey_FontSize = "fontSize";//字体大小
  975. private const string ParamKey_FontColour = "fontColour";//字体颜色
  976. private decimal areaMin = -1;
  977. private decimal areaMax = -1;
  978. private string fontSize = "12";
  979. private Color fontColour = Color.Black;
  980. private bool isExportResults = false;
  981. private bool isExportReports = false;
  982. private bool isExportProjects = false;
  983. /// <summary>
  984. /// 是否脚本运行
  985. /// </summary>
  986. private Boolean initScriptValues = false;
  987. #region 二值化相关
  988. /// <summary>
  989. /// 初始系统参数配置值
  990. /// </summary>
  991. private BinaryExtractionModel binaryExtractionModel;
  992. /// <summary>
  993. /// 处理程序
  994. /// </summary>
  995. private ParamObject action = new Data.Action.Action901();
  996. /// <summary>
  997. /// 调色板
  998. /// </summary>
  999. private ColorsForm colorsFormGrid;
  1000. /// <summary>
  1001. /// 参数下拉的集合
  1002. /// </summary>
  1003. private List<string> files = new List<string>();
  1004. //二值化集成1
  1005. BinaryClass binaryClass;
  1006. private Button button3;
  1007. private Button button4;
  1008. private int menuId;
  1009. private string menuName;
  1010. #endregion
  1011. public SpheroidizationGraphiteSize(AppWorkspace appWorkspace, int type, PdnMenuItem menuItem)
  1012. {
  1013. this.menuId = menuItem.MenuId;
  1014. this.menuName = menuItem.Text;
  1015. binaryClass = new BinaryClass(menuId);
  1016. IronType = type;
  1017. spheroidizationGraphiteSize = this;
  1018. this.appWorkspace = appWorkspace;
  1019. NullKey();
  1020. InitializeComponent();
  1021. InitializeLanguageText();
  1022. InitColour();
  1023. InitPicList();
  1024. InitOtherTools();
  1025. InitCommonButtonEvent();
  1026. InitGridHeader();
  1027. if (IronType == 1)
  1028. {
  1029. SetAnalyzeModelFromXml("Template.Manager.item3.DuctileIronISO945Size");
  1030. }
  1031. else if (IronType == 2)
  1032. {
  1033. SetAnalyzeModelFromXml("Template.Manager.item3.GrayironISO945Size");
  1034. }
  1035. else if (IronType == 3)
  1036. {
  1037. SetAnalyzeModelFromXml("Template.Manager.item3.VermiculateCastIronISO945S");
  1038. }
  1039. }
  1040. private void ShowImgEvent(object sender, EventArgs e)
  1041. {
  1042. listView1.Focus();
  1043. if (this.defaultIndex != -1)
  1044. {
  1045. //如果是脚本执行,将参数带入
  1046. if (appWorkspace.ScriptRunning && appWorkspace.ScriptCurrentParam != null)
  1047. {
  1048. this.initScriptValues = true;//ScriptAutomatic
  1049. //Boolean initScriptValues = true;
  1050. ////在这里反射出对应功能的参数类
  1051. string className = InvariantData.path_Action + ".Action" + menuId;
  1052. ParamObject param = (ParamObject)System.Reflection.Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
  1053. foreach (Args arg in param.Lists)
  1054. {
  1055. Args param1 = appWorkspace.ScriptCurrentParam.Lists.Find(m => m.Key.Equals(arg.Key));
  1056. if (param1.value != null)
  1057. arg.Value = param1.value;
  1058. getValue(arg.key, arg.Value);
  1059. }
  1060. appWorkspace.ScriptCurrentParam = null;//阻止第二次进入仍然被赋值参数
  1061. }
  1062. else
  1063. {//读取上次关闭窗口时保存的参数
  1064. GetXmlParameter();
  1065. GetListParamModel();
  1066. }
  1067. this.listView1.Items[defaultIndex].Focused = true;
  1068. this.listView1.Items[defaultIndex].Selected = true;
  1069. if (this.initScriptValues && this.appWorkspace.ScriptAutomatic)
  1070. this.startScriptAutomaticAction();
  1071. }
  1072. }
  1073. /// <summary>
  1074. /// 初始化面积率颜色、字号颜色
  1075. /// </summary>
  1076. private void InitColour()
  1077. {
  1078. colour.Add("panelColour1", Color.Orange);
  1079. colour.Add("panelColour2", Color.Blue);
  1080. colour.Add("panelColour3", Color.Green);
  1081. colour.Add("panelColour4", Color.Pink);
  1082. colour.Add("panelColour5", Color.Violet);
  1083. colour.Add("panelColour6", Color.Yellow);
  1084. colour.Add("panelColour7", Color.Bisque);
  1085. colour.Add("panelColour8", Color.BlueViolet);
  1086. colourFont.Add("10", Color.Black);
  1087. }
  1088. /// <summary>
  1089. /// 初始化表头
  1090. /// </summary>
  1091. private void InitGridHeader()
  1092. {
  1093. //
  1094. //个数表
  1095. //
  1096. this.dataGridView1.ColumnHeadersHeight = 30;
  1097. DataGridViewTextBoxColumn h1 = new DataGridViewTextBoxColumn();
  1098. h1.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1099. h1.Width = 66;
  1100. DataGridViewTextBoxColumn h2 = new DataGridViewTextBoxColumn();
  1101. h2.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1102. h2.Width = 66;
  1103. DataGridViewTextBoxColumn h3 = new DataGridViewTextBoxColumn();
  1104. h3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1105. h3.Width = 66;
  1106. DataGridViewTextBoxColumn h4 = new DataGridViewTextBoxColumn();
  1107. h4.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1108. h4.Width = 66;
  1109. DataGridViewTextBoxColumn h5 = new DataGridViewTextBoxColumn();
  1110. h5.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1111. h5.Width = 66;
  1112. DataGridViewTextBoxColumn h6 = new DataGridViewTextBoxColumn();
  1113. h6.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1114. h6.Width = 66;
  1115. DataGridViewTextBoxColumn h7 = new DataGridViewTextBoxColumn();
  1116. h7.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1117. h7.Width = 66;
  1118. DataGridViewTextBoxColumn h8 = new DataGridViewTextBoxColumn();
  1119. h8.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1120. h8.Width = 66;
  1121. DataGridViewTextBoxColumn h9 = new DataGridViewTextBoxColumn();
  1122. h9.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1123. h9.Width = 66;
  1124. DataGridViewTextBoxColumn h10 = new DataGridViewTextBoxColumn();
  1125. h10.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1126. h10.Width = 66;
  1127. this.dataGridView1.Columns.Add(h1);
  1128. this.dataGridView1.Columns.Add(h2);
  1129. this.dataGridView1.Columns.Add(h3);
  1130. this.dataGridView1.Columns.Add(h4);
  1131. this.dataGridView1.Columns.Add(h5);
  1132. this.dataGridView1.Columns.Add(h6);
  1133. this.dataGridView1.Columns.Add(h7);
  1134. this.dataGridView1.Columns.Add(h8);
  1135. this.dataGridView1.Columns.Add(h9);
  1136. this.dataGridView1.Columns.Add(h10);
  1137. DataGridViewHelper helper = new DataGridViewHelper(this.dataGridView1);
  1138. helper.Headers.Add(new DataGridViewHelper.TopHeader(0, 1, PdnResources.GetString("Menu.view.text")));
  1139. helper.Headers.Add(new DataGridViewHelper.TopHeader(1, 1, "1"));
  1140. helper.Headers.Add(new DataGridViewHelper.TopHeader(2, 1, "2"));
  1141. helper.Headers.Add(new DataGridViewHelper.TopHeader(3, 1, "3"));
  1142. helper.Headers.Add(new DataGridViewHelper.TopHeader(4, 1, "4"));
  1143. helper.Headers.Add(new DataGridViewHelper.TopHeader(5, 1, "5"));
  1144. helper.Headers.Add(new DataGridViewHelper.TopHeader(6, 1, "6"));
  1145. helper.Headers.Add(new DataGridViewHelper.TopHeader(7, 1, "7"));
  1146. helper.Headers.Add(new DataGridViewHelper.TopHeader(8, 1, "8"));
  1147. helper.Headers.Add(new DataGridViewHelper.TopHeader(9, 1, PdnResources.GetString("Menu.Thetotalnumberof.Text")));
  1148. this.dataGridView1.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
  1149. this.dataGridView1.Columns[0].ReadOnly = true;
  1150. this.dataGridView1.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;//文字居中
  1151. this.dataGridView1.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable;
  1152. this.dataGridView1.Columns[1].ReadOnly = true;
  1153. this.dataGridView1.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1154. this.dataGridView1.Columns[2].SortMode = DataGridViewColumnSortMode.NotSortable;
  1155. this.dataGridView1.Columns[2].ReadOnly = true;
  1156. this.dataGridView1.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1157. this.dataGridView1.Columns[3].SortMode = DataGridViewColumnSortMode.NotSortable;
  1158. this.dataGridView1.Columns[3].ReadOnly = true;
  1159. this.dataGridView1.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1160. this.dataGridView1.Columns[4].SortMode = DataGridViewColumnSortMode.NotSortable;
  1161. this.dataGridView1.Columns[4].ReadOnly = true;
  1162. this.dataGridView1.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1163. this.dataGridView1.Columns[5].SortMode = DataGridViewColumnSortMode.NotSortable;
  1164. this.dataGridView1.Columns[5].ReadOnly = true;
  1165. this.dataGridView1.Columns[5].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1166. this.dataGridView1.Columns[6].SortMode = DataGridViewColumnSortMode.NotSortable;
  1167. this.dataGridView1.Columns[6].ReadOnly = true;
  1168. this.dataGridView1.Columns[6].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1169. this.dataGridView1.Columns[7].SortMode = DataGridViewColumnSortMode.NotSortable;
  1170. this.dataGridView1.Columns[7].ReadOnly = true;
  1171. this.dataGridView1.Columns[7].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1172. this.dataGridView1.Columns[8].SortMode = DataGridViewColumnSortMode.NotSortable;
  1173. this.dataGridView1.Columns[8].ReadOnly = true;
  1174. this.dataGridView1.Columns[8].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1175. this.dataGridView1.Columns[9].SortMode = DataGridViewColumnSortMode.NotSortable;
  1176. this.dataGridView1.Columns[9].ReadOnly = true;
  1177. this.dataGridView1.Columns[9].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1178. this.dataGridView1.AllowUserToResizeRows = false;
  1179. this.dataGridView1.AllowUserToResizeColumns = false;
  1180. //
  1181. //个数百分比
  1182. //
  1183. this.dataGridView3.ColumnHeadersHeight = 30;
  1184. DataGridViewTextBoxColumn b1 = new DataGridViewTextBoxColumn();
  1185. b1.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1186. b1.Width = 66;
  1187. DataGridViewTextBoxColumn b2 = new DataGridViewTextBoxColumn();
  1188. b2.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1189. b2.Width = 66;
  1190. DataGridViewTextBoxColumn b3 = new DataGridViewTextBoxColumn();
  1191. b3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1192. b3.Width = 66;
  1193. DataGridViewTextBoxColumn b4 = new DataGridViewTextBoxColumn();
  1194. b4.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1195. b4.Width = 66;
  1196. DataGridViewTextBoxColumn b5 = new DataGridViewTextBoxColumn();
  1197. b5.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1198. b5.Width = 66;
  1199. DataGridViewTextBoxColumn b6 = new DataGridViewTextBoxColumn();
  1200. b6.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1201. b6.Width = 66;
  1202. DataGridViewTextBoxColumn b7 = new DataGridViewTextBoxColumn();
  1203. b7.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1204. b7.Width = 66;
  1205. DataGridViewTextBoxColumn b8 = new DataGridViewTextBoxColumn();
  1206. b8.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1207. b8.Width = 66;
  1208. DataGridViewTextBoxColumn b9 = new DataGridViewTextBoxColumn();
  1209. b9.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1210. b9.Width = 66;
  1211. DataGridViewTextBoxColumn b10 = new DataGridViewTextBoxColumn();
  1212. b10.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1213. b10.Width = 66;
  1214. DataGridViewTextBoxColumn b11 = new DataGridViewTextBoxColumn();
  1215. b11.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1216. b11.Width = 90;
  1217. DataGridViewTextBoxColumn b12 = new DataGridViewTextBoxColumn();
  1218. b12.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1219. b12.Width = 66;
  1220. this.dataGridView3.Columns.Add(b1);
  1221. this.dataGridView3.Columns.Add(b2);
  1222. this.dataGridView3.Columns.Add(b3);
  1223. this.dataGridView3.Columns.Add(b4);
  1224. this.dataGridView3.Columns.Add(b5);
  1225. this.dataGridView3.Columns.Add(b6);
  1226. this.dataGridView3.Columns.Add(b7);
  1227. this.dataGridView3.Columns.Add(b8);
  1228. this.dataGridView3.Columns.Add(b9);
  1229. this.dataGridView3.Columns.Add(b10);
  1230. this.dataGridView3.Columns.Add(b11);
  1231. this.dataGridView3.Columns.Add(b12);
  1232. DataGridViewHelper helper3 = new DataGridViewHelper(this.dataGridView3);
  1233. helper3.Headers.Add(new DataGridViewHelper.TopHeader(0, 1, PdnResources.GetString("Menu.view.text")));
  1234. helper3.Headers.Add(new DataGridViewHelper.TopHeader(1, 1, "1"));
  1235. helper3.Headers.Add(new DataGridViewHelper.TopHeader(2, 1, "2"));
  1236. helper3.Headers.Add(new DataGridViewHelper.TopHeader(3, 1, "3"));
  1237. helper3.Headers.Add(new DataGridViewHelper.TopHeader(4, 1, "4"));
  1238. helper3.Headers.Add(new DataGridViewHelper.TopHeader(5, 1, "5"));
  1239. helper3.Headers.Add(new DataGridViewHelper.TopHeader(6, 1, "6"));
  1240. helper3.Headers.Add(new DataGridViewHelper.TopHeader(7, 1, "7"));
  1241. helper3.Headers.Add(new DataGridViewHelper.TopHeader(8, 1, "8"));
  1242. helper3.Headers.Add(new DataGridViewHelper.TopHeader(9, 1, PdnResources.GetString("Menu.Theaveragesize.Text")));
  1243. helper3.Headers.Add(new DataGridViewHelper.TopHeader(10, 1, PdnResources.GetString("Menu.Thsizeofthelevel.Text")));
  1244. helper3.Headers.Add(new DataGridViewHelper.TopHeader(11, 1, PdnResources.GetString("Menu.Graphitecontent.text")));
  1245. this.dataGridView3.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
  1246. this.dataGridView3.Columns[0].ReadOnly = true;
  1247. this.dataGridView3.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;//文字居中
  1248. this.dataGridView3.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable;
  1249. this.dataGridView3.Columns[1].ReadOnly = true;
  1250. this.dataGridView3.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1251. this.dataGridView3.Columns[2].SortMode = DataGridViewColumnSortMode.NotSortable;
  1252. this.dataGridView3.Columns[2].ReadOnly = true;
  1253. this.dataGridView3.Columns[2].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1254. this.dataGridView3.Columns[3].SortMode = DataGridViewColumnSortMode.NotSortable;
  1255. this.dataGridView3.Columns[3].ReadOnly = true;
  1256. this.dataGridView3.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1257. this.dataGridView3.Columns[4].SortMode = DataGridViewColumnSortMode.NotSortable;
  1258. this.dataGridView3.Columns[4].ReadOnly = true;
  1259. this.dataGridView3.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1260. this.dataGridView3.Columns[5].SortMode = DataGridViewColumnSortMode.NotSortable;
  1261. this.dataGridView3.Columns[5].ReadOnly = true;
  1262. this.dataGridView3.Columns[5].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1263. this.dataGridView3.Columns[6].SortMode = DataGridViewColumnSortMode.NotSortable;
  1264. this.dataGridView3.Columns[6].ReadOnly = true;
  1265. this.dataGridView3.Columns[6].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1266. this.dataGridView3.Columns[7].SortMode = DataGridViewColumnSortMode.NotSortable;
  1267. this.dataGridView3.Columns[7].ReadOnly = true;
  1268. this.dataGridView3.Columns[7].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1269. this.dataGridView3.Columns[8].SortMode = DataGridViewColumnSortMode.NotSortable;
  1270. this.dataGridView3.Columns[8].ReadOnly = true;
  1271. this.dataGridView3.Columns[8].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1272. this.dataGridView3.Columns[9].SortMode = DataGridViewColumnSortMode.NotSortable;
  1273. this.dataGridView3.Columns[9].ReadOnly = true;
  1274. this.dataGridView3.Columns[9].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1275. this.dataGridView3.Columns[10].SortMode = DataGridViewColumnSortMode.NotSortable;
  1276. this.dataGridView3.Columns[10].ReadOnly = true;
  1277. this.dataGridView3.Columns[10].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1278. this.dataGridView3.Columns[11].SortMode = DataGridViewColumnSortMode.NotSortable;
  1279. this.dataGridView3.Columns[11].ReadOnly = true;
  1280. this.dataGridView3.Columns[11].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
  1281. this.dataGridView3.AllowUserToResizeRows = false;
  1282. this.dataGridView3.AllowUserToResizeColumns = false;
  1283. //
  1284. //分析结果表
  1285. //
  1286. this.dataGridView2.ColumnHeadersHeight = 30;
  1287. DataGridViewTextBoxColumn h11 = new DataGridViewTextBoxColumn();
  1288. //h11.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1289. h11.Width = 115;
  1290. DataGridViewTextBoxColumn h12 = new DataGridViewTextBoxColumn();
  1291. //h12.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1292. h12.Width = 115;
  1293. DataGridViewTextBoxColumn h13 = new DataGridViewTextBoxColumn();
  1294. //h13.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1295. h13.Width = 115;
  1296. DataGridViewTextBoxColumn h14 = new DataGridViewTextBoxColumn();
  1297. //h14.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1298. h14.Width = 115;
  1299. DataGridViewTextBoxColumn h15 = new DataGridViewTextBoxColumn();
  1300. //h15.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1301. h15.Width = 115;
  1302. DataGridViewTextBoxColumn h16 = new DataGridViewTextBoxColumn();
  1303. //h16.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1304. h16.Width = 115;
  1305. DataGridViewTextBoxColumn h17 = new DataGridViewTextBoxColumn();
  1306. //h17.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1307. h17.Width = 115;
  1308. DataGridViewTextBoxColumn h18 = new DataGridViewTextBoxColumn();
  1309. //h18.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1310. h18.Width = 115;
  1311. DataGridViewTextBoxColumn h19 = new DataGridViewTextBoxColumn();
  1312. //h19.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1313. h19.Width = 115;
  1314. DataGridViewTextBoxColumn h20 = new DataGridViewTextBoxColumn();
  1315. //h20.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1316. h20.Width = 115;
  1317. DataGridViewTextBoxColumn h21 = new DataGridViewTextBoxColumn();
  1318. //h21.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1319. h21.Width = 115;
  1320. DataGridViewTextBoxColumn h22 = new DataGridViewTextBoxColumn();
  1321. //h22.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1322. h22.Width = 115;
  1323. DataGridViewTextBoxColumn h23 = new DataGridViewTextBoxColumn();
  1324. //h23.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1325. h23.Width = 115;
  1326. this.dataGridView2.Columns.Add(h11);
  1327. this.dataGridView2.Columns.Add(h12);
  1328. this.dataGridView2.Columns.Add(h13);
  1329. this.dataGridView2.Columns.Add(h14);
  1330. this.dataGridView2.Columns.Add(h15);
  1331. this.dataGridView2.Columns.Add(h16);
  1332. this.dataGridView2.Columns.Add(h17);
  1333. this.dataGridView2.Columns.Add(h18);
  1334. this.dataGridView2.Columns.Add(h19);
  1335. this.dataGridView2.Columns.Add(h20);
  1336. this.dataGridView2.Columns.Add(h21);
  1337. this.dataGridView2.Columns.Add(h22);
  1338. this.dataGridView2.Columns.Add(h23);
  1339. DataGridViewHelper helper2 = new DataGridViewHelper(this.dataGridView2);
  1340. helper2.Headers.Add(new DataGridViewHelper.TopHeader(0, 1, PdnResources.GetString("Menu.picture.Text")));
  1341. helper2.Headers.Add(new DataGridViewHelper.TopHeader(1, 1, PdnResources.GetString("Menu.view.text")));
  1342. helper2.Headers.Add(new DataGridViewHelper.TopHeader(2, 1, "1"));
  1343. helper2.Headers.Add(new DataGridViewHelper.TopHeader(3, 1, "2"));
  1344. helper2.Headers.Add(new DataGridViewHelper.TopHeader(4, 1, "3"));
  1345. helper2.Headers.Add(new DataGridViewHelper.TopHeader(5, 1, "4"));
  1346. helper2.Headers.Add(new DataGridViewHelper.TopHeader(6, 1, "5"));
  1347. helper2.Headers.Add(new DataGridViewHelper.TopHeader(7, 1, "6"));
  1348. helper2.Headers.Add(new DataGridViewHelper.TopHeader(8, 1, "7"));
  1349. helper2.Headers.Add(new DataGridViewHelper.TopHeader(9, 1, "8"));
  1350. helper2.Headers.Add(new DataGridViewHelper.TopHeader(10, 1, PdnResources.GetString("Menu.Theaveragesize.Text")));
  1351. helper2.Headers.Add(new DataGridViewHelper.TopHeader(11, 1, PdnResources.GetString("Menu.Thsizeofthelevel.Text")));
  1352. helper2.Headers.Add(new DataGridViewHelper.TopHeader(12, 1, PdnResources.GetString("Menu.Graphitecontent.text")));
  1353. this.dataGridView2.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
  1354. this.dataGridView2.Columns[0].ReadOnly = true;
  1355. this.dataGridView2.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable;
  1356. this.dataGridView2.Columns[1].ReadOnly = true;
  1357. this.dataGridView2.Columns[2].SortMode = DataGridViewColumnSortMode.NotSortable;
  1358. this.dataGridView2.Columns[2].ReadOnly = true;
  1359. this.dataGridView2.Columns[3].SortMode = DataGridViewColumnSortMode.NotSortable;
  1360. this.dataGridView2.Columns[3].ReadOnly = true;
  1361. this.dataGridView2.Columns[4].SortMode = DataGridViewColumnSortMode.NotSortable;
  1362. this.dataGridView2.Columns[4].ReadOnly = true;
  1363. this.dataGridView2.Columns[5].SortMode = DataGridViewColumnSortMode.NotSortable;
  1364. this.dataGridView2.Columns[5].ReadOnly = true;
  1365. this.dataGridView2.Columns[6].SortMode = DataGridViewColumnSortMode.NotSortable;
  1366. this.dataGridView2.Columns[6].ReadOnly = true;
  1367. this.dataGridView2.Columns[7].SortMode = DataGridViewColumnSortMode.NotSortable;
  1368. this.dataGridView2.Columns[7].ReadOnly = true;
  1369. this.dataGridView2.Columns[8].SortMode = DataGridViewColumnSortMode.NotSortable;
  1370. this.dataGridView2.Columns[8].ReadOnly = true;
  1371. this.dataGridView2.Columns[9].SortMode = DataGridViewColumnSortMode.NotSortable;
  1372. this.dataGridView2.Columns[9].ReadOnly = true;
  1373. this.dataGridView2.Columns[10].SortMode = DataGridViewColumnSortMode.NotSortable;
  1374. this.dataGridView2.Columns[10].ReadOnly = true;
  1375. this.dataGridView2.Columns[11].SortMode = DataGridViewColumnSortMode.NotSortable;
  1376. this.dataGridView2.Columns[11].ReadOnly = true;
  1377. this.dataGridView2.Columns[12].SortMode = DataGridViewColumnSortMode.NotSortable;
  1378. this.dataGridView2.Columns[12].ReadOnly = true;
  1379. this.dataGridView2.AllowUserToResizeRows = false;
  1380. this.dataGridView2.AllowUserToResizeColumns = false;
  1381. this.dataGridView4.ColumnHeadersHeight = 30;
  1382. DataGridViewTextBoxColumn h24 = new DataGridViewTextBoxColumn();
  1383. //h24.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1384. h24.Width = 115;
  1385. DataGridViewTextBoxColumn h25 = new DataGridViewTextBoxColumn();
  1386. //h25.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1387. h25.Width = 115;
  1388. DataGridViewTextBoxColumn h26 = new DataGridViewTextBoxColumn();
  1389. //h26.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1390. h26.Width = 115;
  1391. DataGridViewTextBoxColumn h27 = new DataGridViewTextBoxColumn();
  1392. //h27.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1393. h27.Width = 115;
  1394. DataGridViewTextBoxColumn h28 = new DataGridViewTextBoxColumn();
  1395. //h28.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1396. h28.Width = 115;
  1397. DataGridViewTextBoxColumn h29 = new DataGridViewTextBoxColumn();
  1398. //h29.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1399. h29.Width = 115;
  1400. DataGridViewTextBoxColumn h30 = new DataGridViewTextBoxColumn();
  1401. //h30.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1402. h30.Width = 115;
  1403. DataGridViewTextBoxColumn h31 = new DataGridViewTextBoxColumn();
  1404. //h31.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1405. h31.Width = 115;
  1406. DataGridViewTextBoxColumn h32 = new DataGridViewTextBoxColumn();
  1407. //h32.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1408. h32.Width = 115;
  1409. DataGridViewTextBoxColumn h33 = new DataGridViewTextBoxColumn();
  1410. //h33.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1411. h33.Width = 115;
  1412. DataGridViewTextBoxColumn h34 = new DataGridViewTextBoxColumn();
  1413. //h34.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1414. h34.Width = 115;
  1415. DataGridViewTextBoxColumn h35 = new DataGridViewTextBoxColumn();
  1416. //h35.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1417. h35.Width = 115;
  1418. DataGridViewTextBoxColumn h36 = new DataGridViewTextBoxColumn();
  1419. //h36.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
  1420. h36.Width = 115;
  1421. this.dataGridView4.Columns.Add(h24);
  1422. this.dataGridView4.Columns.Add(h25);
  1423. this.dataGridView4.Columns.Add(h26);
  1424. this.dataGridView4.Columns.Add(h27);
  1425. this.dataGridView4.Columns.Add(h28);
  1426. this.dataGridView4.Columns.Add(h29);
  1427. this.dataGridView4.Columns.Add(h30);
  1428. this.dataGridView4.Columns.Add(h31);
  1429. this.dataGridView4.Columns.Add(h32);
  1430. this.dataGridView4.Columns.Add(h33);
  1431. this.dataGridView4.Columns.Add(h34);
  1432. this.dataGridView4.Columns.Add(h35);
  1433. this.dataGridView4.Columns.Add(h36);
  1434. DataGridViewHelper helper4 = new DataGridViewHelper(this.dataGridView4);
  1435. helper4.Headers.Add(new DataGridViewHelper.TopHeader(0, 1, PdnResources.GetString("Menu.picture.Text")));
  1436. helper4.Headers.Add(new DataGridViewHelper.TopHeader(1, 1, PdnResources.GetString("Menu.view.text")));
  1437. helper4.Headers.Add(new DataGridViewHelper.TopHeader(2, 1, "1"));
  1438. helper4.Headers.Add(new DataGridViewHelper.TopHeader(3, 1, "2"));
  1439. helper4.Headers.Add(new DataGridViewHelper.TopHeader(4, 1, "3"));
  1440. helper4.Headers.Add(new DataGridViewHelper.TopHeader(5, 1, "4"));
  1441. helper4.Headers.Add(new DataGridViewHelper.TopHeader(6, 1, "5"));
  1442. helper4.Headers.Add(new DataGridViewHelper.TopHeader(7, 1, "6"));
  1443. helper4.Headers.Add(new DataGridViewHelper.TopHeader(8, 1, "7"));
  1444. helper4.Headers.Add(new DataGridViewHelper.TopHeader(9, 1, "8"));
  1445. helper4.Headers.Add(new DataGridViewHelper.TopHeader(10, 1, PdnResources.GetString("Menu.Theaveragesize.Text")));
  1446. helper4.Headers.Add(new DataGridViewHelper.TopHeader(11, 1, PdnResources.GetString("Menu.Thsizeofthelevel.Text")));
  1447. helper4.Headers.Add(new DataGridViewHelper.TopHeader(12, 1, PdnResources.GetString("Menu.Graphitecontent.text")));
  1448. this.dataGridView4.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable;
  1449. this.dataGridView4.Columns[0].ReadOnly = true;
  1450. this.dataGridView4.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable;
  1451. this.dataGridView4.Columns[1].ReadOnly = true;
  1452. this.dataGridView4.Columns[2].SortMode = DataGridViewColumnSortMode.NotSortable;
  1453. this.dataGridView4.Columns[2].ReadOnly = true;
  1454. this.dataGridView4.Columns[3].SortMode = DataGridViewColumnSortMode.NotSortable;
  1455. this.dataGridView4.Columns[3].ReadOnly = true;
  1456. this.dataGridView4.Columns[4].SortMode = DataGridViewColumnSortMode.NotSortable;
  1457. this.dataGridView4.Columns[4].ReadOnly = true;
  1458. this.dataGridView4.Columns[5].SortMode = DataGridViewColumnSortMode.NotSortable;
  1459. this.dataGridView4.Columns[5].ReadOnly = true;
  1460. this.dataGridView4.Columns[6].SortMode = DataGridViewColumnSortMode.NotSortable;
  1461. this.dataGridView4.Columns[6].ReadOnly = true;
  1462. this.dataGridView4.Columns[7].SortMode = DataGridViewColumnSortMode.NotSortable;
  1463. this.dataGridView4.Columns[7].ReadOnly = true;
  1464. this.dataGridView4.Columns[8].SortMode = DataGridViewColumnSortMode.NotSortable;
  1465. this.dataGridView4.Columns[8].ReadOnly = true;
  1466. this.dataGridView4.Columns[9].SortMode = DataGridViewColumnSortMode.NotSortable;
  1467. this.dataGridView4.Columns[9].ReadOnly = true;
  1468. this.dataGridView4.Columns[10].SortMode = DataGridViewColumnSortMode.NotSortable;
  1469. this.dataGridView4.Columns[10].ReadOnly = true;
  1470. this.dataGridView4.Columns[11].SortMode = DataGridViewColumnSortMode.NotSortable;
  1471. this.dataGridView4.Columns[11].ReadOnly = true;
  1472. this.dataGridView4.Columns[12].SortMode = DataGridViewColumnSortMode.NotSortable;
  1473. this.dataGridView4.Columns[12].ReadOnly = true;
  1474. this.dataGridView4.AllowUserToResizeRows = false;
  1475. this.dataGridView4.AllowUserToResizeColumns = false;
  1476. //
  1477. //左下表
  1478. //
  1479. this.listView2.View = View.Details;
  1480. ColumnHeader header0 = new ColumnHeader();
  1481. header0.Text = PdnResources.GetString("Menu.Imagelist.Text");
  1482. header0.Width = 175;
  1483. this.listView2.Columns.Add(header0);
  1484. }
  1485. /// <summary>
  1486. /// 初始化画布按键功能
  1487. /// </summary>
  1488. private void InitCommonButtonEvent()
  1489. {
  1490. this.commonControlButtons.zoomInButton.Click += new EventHandler(zoomInButton_Click);
  1491. this.commonControlButtons.zoomOutButton.Click += new EventHandler(zoomOutButton_Click);
  1492. this.commonControlButtons.zoomToWindowButton.Click += new EventHandler(zoomToWindowButton_Click);
  1493. this.commonControlButtons.actualSizeButton.Click += new EventHandler(actualSizeButton_Click);
  1494. this.commonControlButtons.pointerButton.Click += new EventHandler(pointerButton_Click);
  1495. this.commonControlButtons.mobileModeButton.Click += new EventHandler(mobileModeButton_Click);
  1496. }
  1497. private void zoomInButton_Click(object sender, EventArgs e)
  1498. {
  1499. this.documentWorkspace.ZoomIn();
  1500. }
  1501. private void zoomOutButton_Click(object sender, EventArgs e)
  1502. {
  1503. this.documentWorkspace.ZoomOut();
  1504. }
  1505. private void zoomToWindowButton_Click(object sender, EventArgs e)
  1506. {
  1507. this.documentWorkspace.ZoomBasis = ZoomBasis.FitToWindow;
  1508. }
  1509. private void actualSizeButton_Click(object sender, EventArgs e)
  1510. {
  1511. this.documentWorkspace.ZoomBasis = ZoomBasis.ScaleFactor;
  1512. this.documentWorkspace.ScaleFactor = ScaleFactor.OneToOne;
  1513. }
  1514. private void pointerButton_Click(object sender, EventArgs e)
  1515. {
  1516. this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.Pointer;
  1517. }
  1518. private void mobileModeButton_Click(object sender, EventArgs e)
  1519. {
  1520. this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.MoveMode;
  1521. }
  1522. /// <summary>
  1523. /// 调色板回调函数
  1524. /// </summary>
  1525. /// <param name="sender"></param>
  1526. /// <param name="ce"></param>
  1527. private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
  1528. {
  1529. }
  1530. /// <summary>
  1531. /// 初始化其他控件
  1532. /// </summary>
  1533. private void InitOtherTools()
  1534. {
  1535. //
  1536. //初始化图像控件
  1537. //
  1538. this.documentWorkspace = new DocumentWorkspaceWindow(this.appWorkspace);
  1539. this.documentWorkspace.Dock = DockStyle.Fill;
  1540. this.documentWorkspace.HookMouseEvents();
  1541. this.documentWorkspace.AuxiliaryLineEnabled = false;
  1542. this.documentWorkspace.Visible = false;
  1543. this.documentWorkspace.activeTool = Annotation.Enum.DrawToolType.NullTool;
  1544. this.groupBox3.Controls.Add(documentWorkspace);
  1545. //
  1546. //初始化操作按钮
  1547. //
  1548. this.commonControlButtons = new CommonControlButtons();
  1549. this.commonControlButtons.Dock = DockStyle.Top;
  1550. this.commonControlButtons.Height = 30;
  1551. this.commonControlButtons.HideZoomToWindowAndActualSize();
  1552. this.commonControlButtons.Visible = false;
  1553. this.groupBox3.Controls.Add(commonControlButtons);
  1554. //二值化集成2
  1555. bc.OriginCheckedChangedAction += new EventHandler(this.bcOriginCheckedChanged);//初始化原图勾选改变事件
  1556. binaryClass.createDocumentItems(new string[] { PdnResources.GetString("Menu.BinaryAction.BinaryExtraction.Text"), PdnResources.GetString("Menu.Particlescreening.text") }
  1557. , this.bc, this.appWorkspace, this.documentWorkspace, this.listView1);//初始化相的工作结构
  1558. binaryClass.BinaryImplFinishAction += new EventHandler(this.bClassBinaryImplFinishAction);//二值化后续处理事件
  1559. //
  1560. //调色板
  1561. //
  1562. //this.colorsForm1 = new ColorsForm();
  1563. //this.colorsForm1.StartPosition = FormStartPosition.CenterScreen;
  1564. //this.colorsForm1.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  1565. //
  1566. //调色板
  1567. //
  1568. this.colorsForm1 = new ColorsForm();
  1569. this.colorsForm1.StartPosition = FormStartPosition.CenterScreen;
  1570. this.colorsForm1.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
  1571. this.colorsFormGrid = new ColorsForm();
  1572. this.colorsFormGrid.StartPosition = FormStartPosition.CenterScreen;
  1573. this.colorsFormGrid.setSaveBtn_Click(new System.EventHandler(this.gridColorChanged));
  1574. //
  1575. //颜色panel给定初始值
  1576. //
  1577. //this.panel1.BackColor = Color.Red;
  1578. ////获取系统标尺-微米
  1579. ////
  1580. //this.appWorkspace.getMeasureInfo().TryGetValue(MeasurementUnit.Micron, out unitLength);
  1581. //
  1582. //获取系统标尺-放大倍数
  1583. //
  1584. if (this.documentWorkspace.GetGainMultiple() != 0)
  1585. {
  1586. multiple = double.Parse(this.documentWorkspace.GetGainMultiple().ToString());
  1587. }
  1588. }
  1589. //二值化集成3
  1590. #region 二值化相关方法
  1591. private void InclusionsStandardDialog_FormClosing(object sender, FormClosingEventArgs e)
  1592. {
  1593. #region [开启脚本录制]
  1594. if (appWorkspace.startScriptRecording)
  1595. {
  1596. getScriptRecording();
  1597. }
  1598. #endregion
  1599. this.saveDialogParamValues();
  1600. binaryClass.saveParams();
  1601. //xml保存路径
  1602. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GrainSizeAnalyze\\GrainSizeAnalysisModel.xml";
  1603. GrainSizeAnalysisModel analysisModelXml = XmlSerializeHelper.DESerializer<GrainSizeAnalysisModel>(FileOperationHelper.ReadStringFromFile(filePath, System.IO.FileMode.Open));
  1604. foreach (var analysisItem in this.eachData[GetImgKey()].ListParam)
  1605. {
  1606. bool foundItem = false;
  1607. foreach (var item in analysisModelXml.ListParam)
  1608. {
  1609. if (item.param_key.Equals(analysisItem.param_key) && item.menuId == analysisItem.menuId)
  1610. {
  1611. item.param_value = analysisItem.param_value;
  1612. foundItem = true;
  1613. break;
  1614. }
  1615. }
  1616. if (!foundItem)
  1617. analysisModelXml.ListParam.Add(analysisItem.cloneModel());
  1618. }
  1619. //按路径和名称保存xml文件
  1620. string userInfoXml = XmlSerializeHelper.XmlSerialize<GrainSizeAnalysisModel>(analysisModelXml);
  1621. //保存xml
  1622. FileOperationHelper.WriteStringToFile(userInfoXml, filePath, System.IO.FileMode.Create);
  1623. }
  1624. private void ShownChoiseItemAndInitData(object sender, EventArgs e)
  1625. {
  1626. binaryClass.RefreshHistogramControl1Values();
  1627. }
  1628. /// <summary>
  1629. /// 添加参数改变的监听
  1630. /// </summary>
  1631. /// <param name="sender"></param>
  1632. /// <param name="e"></param>
  1633. private void GrainSizeDialog_Load(object sender, EventArgs e)
  1634. {
  1635. this.binaryClass.loadParams();
  1636. }
  1637. private bool bcBinaryChecked()
  1638. {
  1639. return bc != null && bc.BinaryChecked;
  1640. }
  1641. private bool bcOriginChecked()
  1642. {
  1643. return bc != null && bc.OriginChecked;
  1644. }
  1645. /// <summary>
  1646. /// Panel2的调色板颜色改变
  1647. /// </summary>
  1648. /// <param name="sender"></param>
  1649. /// <param name="e"></param>
  1650. private void gridColorChanged(object sender, EventArgs e)
  1651. {
  1652. this.colorsForm1.Close();
  1653. changeColor = true;
  1654. //ReLoadBinarization();
  1655. this.documentWorkspace.Refresh();
  1656. }
  1657. /// <summary>
  1658. /// 参数改变时,重新处理图像
  1659. /// </summary>
  1660. /// <param name="sender"></param>
  1661. /// <param name="e"></param>
  1662. private void bClassBinaryImplFinishAction(object sender, EventArgs e)
  1663. {
  1664. if (phaseModel != null)
  1665. {
  1666. sum++;
  1667. this.documentWorkspace.PhaseModels[0].choise = false;
  1668. if (bcBinaryChecked())
  1669. {
  1670. if (bcOriginChecked())
  1671. {
  1672. phaseModel.choise = false;
  1673. }
  1674. else
  1675. {
  1676. phaseModel.choise = true;
  1677. }
  1678. binarizationMat = this.documentWorkspace.PhaseModels[0].mat;
  1679. //changeColor = false;
  1680. ResetAreaAndContent();
  1681. ReloadDebrisSelection();
  1682. //appCommonDisplay.DisplayData(this.dataGridView1, true);
  1683. //appCommonDisplay.DisplayData(this.dataGridView3, true);
  1684. }
  1685. else
  1686. {
  1687. phaseModel.choise = false;
  1688. if (this.checkBox5.Checked)
  1689. {
  1690. this.documentWorkspace.panel.Paint -= new PaintEventHandler(this.BoxPaintHandler);
  1691. }
  1692. appCommonDisplay.DisplayData(this.dataGridView1, false);
  1693. appCommonDisplay.DisplayData(this.dataGridView3, false);
  1694. }
  1695. this.documentWorkspace.Refresh();
  1696. }
  1697. else
  1698. {
  1699. //MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
  1700. }
  1701. }
  1702. AppCommon appCommonDisplay = new AppCommon();
  1703. /// <summary>
  1704. /// 显示原图/原图+二值图
  1705. /// </summary>
  1706. /// <param name="sender"></param>
  1707. /// <param name="e"></param>
  1708. private void bcOriginCheckedChanged(object sender, EventArgs e)
  1709. {
  1710. if (phaseModel != null)
  1711. {
  1712. this.documentWorkspace.PhaseModels[0].choise = false;
  1713. if (!bcBinaryChecked())
  1714. {
  1715. phaseModel.choise = false;
  1716. appCommonDisplay.DisplayData(this.dataGridView1, false);
  1717. appCommonDisplay.DisplayData(this.dataGridView3, false);
  1718. }
  1719. else
  1720. {
  1721. if (bcOriginChecked())
  1722. {
  1723. phaseModel.choise = false;
  1724. if (this.checkBox5.Checked)
  1725. {
  1726. this.documentWorkspace.panel.Paint -= new PaintEventHandler(this.BoxPaintHandler);
  1727. }
  1728. appCommonDisplay.DisplayData(this.dataGridView1, false);
  1729. appCommonDisplay.DisplayData(this.dataGridView3, false);
  1730. }
  1731. else
  1732. {
  1733. phaseModel.choise = true;
  1734. if (this.checkBox5.Checked)
  1735. {
  1736. this.documentWorkspace.panel.Paint += new PaintEventHandler(this.BoxPaintHandler);
  1737. }
  1738. appCommonDisplay.DisplayData(this.dataGridView1, true);
  1739. appCommonDisplay.DisplayData(this.dataGridView3, true);
  1740. }
  1741. }
  1742. this.documentWorkspace.Refresh();
  1743. }
  1744. else
  1745. {
  1746. //MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
  1747. }
  1748. }
  1749. #endregion
  1750. /// <summary>
  1751. /// 初始化图片列表数据
  1752. /// </summary>
  1753. public void InitPicList()
  1754. {
  1755. //初始化图片列表
  1756. for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
  1757. {
  1758. this.imageList1.Images.Add("img" + i, this.appWorkspace.DocumentWorkspaces[i].BinarizationThumbnail);
  1759. this.listView1.Items.Add("", i);
  1760. this.listView1.Items[i].ImageIndex = i;
  1761. this.listView1.Items[i].Text = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
  1762. this.listView1.Items[i].Name = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
  1763. if (this.appWorkspace.DocumentWorkspaces[i].Equals(this.appWorkspace.ActiveDocumentWorkspace))
  1764. {
  1765. defaultIndex = i;
  1766. }
  1767. }
  1768. this.Shown += ShowImgEvent;
  1769. }
  1770. /// <summary>
  1771. /// 颜色设置设置按钮
  1772. /// </summary>
  1773. /// <param name="sender"></param>
  1774. /// <param name="e"></param>
  1775. private void btnColour_Click(object sender, EventArgs e)
  1776. {
  1777. ColorSetting colorSetting = new ColorSetting();
  1778. colorSetting.ShowDialog();
  1779. }
  1780. /// <summary>
  1781. /// 显示参数设置按钮
  1782. /// </summary>
  1783. /// <param name="sender"></param>
  1784. /// <param name="e"></param>
  1785. private void btnDisplay_Click(object sender, EventArgs e)
  1786. {
  1787. DisplaySetting displaySetting = new DisplaySetting();
  1788. displaySetting.ShowDialog();
  1789. }
  1790. /// <summary>
  1791. /// 设置按钮
  1792. /// </summary>
  1793. /// <param name="sender"></param>
  1794. /// <param name="e"></param>
  1795. private void btnSetUp_Click(object sender, EventArgs e)
  1796. {
  1797. AnalyzeSettingDialog metallographicMethodSetDialog = null;
  1798. if (IronType == 1)
  1799. {
  1800. metallographicMethodSetDialog = new AnalyzeSettingDialog(this, "Template.Manager.item3.DuctileIronISO945Size");
  1801. }
  1802. else if (IronType == 2)
  1803. {
  1804. metallographicMethodSetDialog = new AnalyzeSettingDialog(this, "Template.Manager.item3.GrayironISO945Size");
  1805. }
  1806. else if (IronType == 3)
  1807. {
  1808. metallographicMethodSetDialog = new AnalyzeSettingDialog(this, "Template.Manager.item3.VermiculateCastIronISO945S");
  1809. }
  1810. if (metallographicMethodSetDialog.hasModule)
  1811. {
  1812. metallographicMethodSetDialog.StartPosition = FormStartPosition.CenterScreen;
  1813. metallographicMethodSetDialog.ShowDialog();
  1814. }
  1815. else
  1816. {
  1817. metallographicMethodSetDialog = null;
  1818. }
  1819. }
  1820. /// <summary>
  1821. /// 图像索引切换选中事件
  1822. /// </summary>
  1823. /// <param name="sender"></param>
  1824. /// <param name="e"></param>
  1825. double picArea = 0;//图片面积
  1826. int sum;
  1827. private void listView1_SelectedIndexChanged(object sender, EventArgs e)
  1828. {
  1829. if (this.listView1.FocusedItem != null && this.listView1.FocusedItem.Selected)
  1830. {
  1831. //获取标尺-微米
  1832. unitLength = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRuler(MeasurementUnit.Micron);
  1833. GetListParamModel();
  1834. sum = 0;
  1835. if (this.checkBox5.Checked)
  1836. {
  1837. this.documentWorkspace.panel.Paint -= new PaintEventHandler(this.BoxPaintHandler);
  1838. }
  1839. this.dataGridView1.Rows.Clear();
  1840. this.dataGridView3.Rows.Clear();
  1841. if (this.documentWorkspace.PhaseModels.Count > 1)
  1842. this.documentWorkspace.PhaseModels.Remove(this.documentWorkspace.PhaseModels[1]);
  1843. this.commonControlButtons.Visible = true;
  1844. this.documentWorkspace.GraphicsList = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GraphicsList;
  1845. this.bitmap = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreateAliasedBitmap();
  1846. //总面积
  1847. picArea = AnalysisTools.GetPointsFromMat(BitmapConverter.ToMat(this.bitmap));
  1848. changeColor = false;
  1849. phaseModel = new PhaseModel();//同上
  1850. phaseModel.choise = true;
  1851. //二值化集成4
  1852. binaryClass.listView1_SelectedIndexChangedNoCheckedChanged(this.bitmap, this.imageList1.Images.Keys[this.listView1.FocusedItem.Index]);
  1853. this.documentWorkspace.PhaseModels[0].choise = false;
  1854. if (binaryClass.getModelMat(this.imageList1.Images.Keys[this.listView1.FocusedItem.Index]) != null)
  1855. {
  1856. this.binarizationMat = binaryClass.getModelMat(this.imageList1.Images.Keys[this.listView1.FocusedItem.Index]).Clone();
  1857. }
  1858. else
  1859. {
  1860. if (this.documentWorkspace.PhaseModels[0].mat == null)
  1861. {
  1862. this.binarizationMat = new Mat();
  1863. }
  1864. else
  1865. {
  1866. this.binarizationMat = this.documentWorkspace.PhaseModels[0].mat.Clone();
  1867. }
  1868. }
  1869. this.documentWorkspace.phaseModels.Add(phaseModel);
  1870. if (sum == 0)
  1871. {
  1872. if (bcOriginChecked() || !bcBinaryChecked())
  1873. {
  1874. phaseModel.choise = false;
  1875. }
  1876. ResetAreaAndContent();
  1877. ReloadDebrisSelection();
  1878. }
  1879. else
  1880. {
  1881. if (bcOriginChecked() || !bcBinaryChecked())
  1882. {
  1883. phaseModel.choise = false;
  1884. }
  1885. else
  1886. {
  1887. phaseModel.choise = true;
  1888. }
  1889. this.documentWorkspace.Refresh();
  1890. }
  1891. sum = 0;
  1892. }
  1893. }
  1894. Mat temp;//中间变量
  1895. List<List<OpenCvSharp.Point>> ps;//轮廓的拓扑信息
  1896. double totalSum;//石墨总数
  1897. double avgAreaRatio;//平均面积率
  1898. double avgequalDiameter;//平均尺寸
  1899. List<double> lstEqualDiameter;
  1900. DataTable dtDataGridView1 = null;
  1901. DataTable dtDataGridView3 = null;
  1902. DataTable dtResult = null;
  1903. AppCommon appCommon = new AppCommon();
  1904. /// <summary>
  1905. /// 刷新颗粒筛选颜色面积率效果
  1906. /// </summary>
  1907. private void ReloadDebrisSelection()
  1908. {
  1909. if (binarizationMat != null && bcBinaryChecked())
  1910. {
  1911. this.dataGridView1.Rows.Clear();
  1912. this.dataGridView3.Rows.Clear();
  1913. dtDataGridView1 = new DataTable();
  1914. dtDataGridView3 = new DataTable();
  1915. lstPoint1 = new List<List<OpenCvSharp.Point>>();
  1916. lstPoint2 = new List<List<OpenCvSharp.Point>>();
  1917. lstPoint3 = new List<List<OpenCvSharp.Point>>();
  1918. lstPoint4 = new List<List<OpenCvSharp.Point>>();
  1919. lstPoint5 = new List<List<OpenCvSharp.Point>>();
  1920. lstPoint6 = new List<List<OpenCvSharp.Point>>();
  1921. lstPoint7 = new List<List<OpenCvSharp.Point>>();
  1922. lstPoint8 = new List<List<OpenCvSharp.Point>>();
  1923. //记录上个视场内个数
  1924. int sumLstPoint1 = 0;
  1925. int sumLstPoint2 = 0;
  1926. int sumLstPoint3 = 0;
  1927. int sumLstPoint4 = 0;
  1928. int sumLstPoint5 = 0;
  1929. int sumLstPoint6 = 0;
  1930. int sumLstPoint7 = 0;
  1931. int sumLstPoint8 = 0;
  1932. double sumTotalSum = 0;
  1933. double sumAvgequalDiameter = 0;//记录平均平均尺寸总和
  1934. double sumSpheroidizationAreaRate = 0;//记录石墨含量总和
  1935. ps = new List<List<OpenCvSharp.Point>>();//轮廓的拓扑信息
  1936. pointList.Clear();
  1937. leList.Clear();
  1938. temp = new Mat();
  1939. lstEqualDiameter = new List<double>();//大于20um等积圆直径集合
  1940. if (this.documentWorkspace.GraphicsList.IsExsitView())
  1941. {
  1942. List<OpenCvSharp.Point[][]> points = new List<OpenCvSharp.Point[][]>();//各石墨轮廓集合
  1943. List<List<int>> lstAttribute = new List<List<int>>();//各个视场属性集合,索引0-横坐标,1-纵坐标,2-视场宽度,3-视场高度,4-视场面积
  1944. int sumFieldl = 0; //视场个数
  1945. Mat tempCopy = BinaryClass.BGRA2GRAY(binarizationMat);
  1946. //调用处理视场方法
  1947. appCommon.MultiFieldView(appWorkspace, binarizationMat, listView1, documentWorkspace, out points, out lstAttribute, out sumFieldl);
  1948. int h = 0;
  1949. foreach (OpenCvSharp.Point[][] contours in points)
  1950. {
  1951. h++;
  1952. double spheroidizationSum = 0;//石墨个数
  1953. double areaRatioSum = 0; //面积率总和
  1954. double equalDiameterSum = 0; //尺寸总和
  1955. double totalAreaSum = 0;//面积总数
  1956. avgAreaRatio = 0;
  1957. totalSum = 0;//石墨总数
  1958. for (int i = 0; i < contours.Length; i++)
  1959. {
  1960. for (int f = 0; f < contours[i].Length; f++)
  1961. {
  1962. contours[i][f].X = contours[i][f].X + lstAttribute[h - 1][0];
  1963. contours[i][f].Y = contours[i][f].Y + lstAttribute[h - 1][1];
  1964. }
  1965. double radius; //外接圆半径
  1966. double area = appCommon.Area(tempCopy, contours[i][0]);
  1967. double equalDiameter = Math.Sqrt(area / Math.PI) * 2 * unitLength;
  1968. if (this.checkBox3.Checked)
  1969. {
  1970. if (this.checkBox6.Checked)
  1971. {
  1972. if (equalDiameter < 20)
  1973. {
  1974. ps.Add(contours[i].ToList());
  1975. continue;
  1976. }
  1977. if (area >= (this.trackBar2.Value / (unitLength * unitLength)) && area <= (this.trackBar4.Value / (unitLength * unitLength)))
  1978. {
  1979. ps.Add(contours[i].ToList());
  1980. }
  1981. else
  1982. {
  1983. if (contours[i].Length < 5)
  1984. {
  1985. continue;
  1986. }
  1987. else
  1988. {
  1989. OpenCvSharp.RotatedRect rect = OpenCvSharp.Cv2.FitEllipse(contours[i]);
  1990. radius = BasicCalculationHelper.CalcLongTrail(contours[i]);
  1991. double outerCircle = radius * radius * Math.PI;//外接圆面积
  1992. double areaRatio = (area - contours[i].Length / 2.0) / outerCircle;
  1993. if (areaRatio > 0 && areaRatio <= 1)
  1994. {
  1995. lstEqualDiameter.Add(equalDiameter);
  1996. equalDiameterSum += equalDiameter;
  1997. areaRatioSum += areaRatio;
  1998. totalAreaSum += area;
  1999. totalSum++;
  2000. pointList.Add(contours[i][0]);
  2001. leList.Add(Math.Round(double.Parse(string.IsNullOrEmpty(equalDiameter.ToString()) ? "0" :
  2002. equalDiameter.ToString()), Convert.ToInt32(this.numericUpDown1.Value)));
  2003. if (equalDiameter > 1000)
  2004. {
  2005. lstPoint1.Add(contours[i].ToList());
  2006. }
  2007. else if (equalDiameter > 500 && equalDiameter <= 1000)
  2008. {
  2009. lstPoint2.Add(contours[i].ToList());
  2010. }
  2011. else if (equalDiameter > 250 && equalDiameter <= 500)
  2012. {
  2013. lstPoint3.Add(contours[i].ToList());
  2014. }
  2015. else if (equalDiameter > 120 && equalDiameter <= 250)
  2016. {
  2017. lstPoint4.Add(contours[i].ToList());
  2018. }
  2019. else if (equalDiameter > 60 && equalDiameter <= 120)
  2020. {
  2021. lstPoint5.Add(contours[i].ToList());
  2022. }
  2023. else if (equalDiameter > 30 && equalDiameter <= 60)
  2024. {
  2025. lstPoint6.Add(contours[i].ToList());
  2026. }
  2027. else if (equalDiameter > 15 && equalDiameter <= 30)
  2028. {
  2029. lstPoint7.Add(contours[i].ToList());
  2030. }
  2031. else if (equalDiameter > 0 && equalDiameter <= 15)
  2032. {
  2033. lstPoint8.Add(contours[i].ToList());
  2034. }
  2035. }
  2036. else
  2037. {
  2038. ps.Add(contours[i].ToList());
  2039. }
  2040. }
  2041. }
  2042. }
  2043. else
  2044. {
  2045. if (area >= (this.trackBar2.Value / (unitLength * unitLength)) && area <= (this.trackBar4.Value / (unitLength * unitLength)))
  2046. {
  2047. ps.Add(contours[i].ToList());
  2048. }
  2049. else
  2050. {
  2051. if (contours[i].Length < 5)
  2052. {
  2053. continue;
  2054. }
  2055. else
  2056. {
  2057. OpenCvSharp.RotatedRect rect = OpenCvSharp.Cv2.FitEllipse(contours[i]);
  2058. radius = BasicCalculationHelper.CalcLongTrail(contours[i]);
  2059. double outerCircle = radius * radius * Math.PI;//外接圆面积
  2060. double areaRatio = (area - contours[i].Length / 2.0) / outerCircle;
  2061. if (areaRatio > 0 && areaRatio <= 1)
  2062. {
  2063. lstEqualDiameter.Add(equalDiameter);
  2064. equalDiameterSum += equalDiameter;
  2065. areaRatioSum += areaRatio;
  2066. totalAreaSum += area;
  2067. totalSum++;
  2068. pointList.Add(contours[i][0]);
  2069. leList.Add(Math.Round(double.Parse(string.IsNullOrEmpty(equalDiameter.ToString()) ? "0" :
  2070. equalDiameter.ToString()), Convert.ToInt32(this.numericUpDown1.Value)));
  2071. if (equalDiameter > 1000)
  2072. {
  2073. lstPoint1.Add(contours[i].ToList());
  2074. }
  2075. else if (equalDiameter > 500 && equalDiameter <= 1000)
  2076. {
  2077. lstPoint2.Add(contours[i].ToList());
  2078. }
  2079. else if (equalDiameter > 250 && equalDiameter <= 500)
  2080. {
  2081. lstPoint3.Add(contours[i].ToList());
  2082. }
  2083. else if (equalDiameter > 120 && equalDiameter <= 250)
  2084. {
  2085. lstPoint4.Add(contours[i].ToList());
  2086. }
  2087. else if (equalDiameter > 60 && equalDiameter <= 120)
  2088. {
  2089. lstPoint5.Add(contours[i].ToList());
  2090. }
  2091. else if (equalDiameter > 30 && equalDiameter <= 60)
  2092. {
  2093. lstPoint6.Add(contours[i].ToList());
  2094. }
  2095. else if (equalDiameter > 15 && equalDiameter <= 30)
  2096. {
  2097. lstPoint7.Add(contours[i].ToList());
  2098. }
  2099. else if (equalDiameter > 0 && equalDiameter <= 15)
  2100. {
  2101. lstPoint8.Add(contours[i].ToList());
  2102. }
  2103. }
  2104. else
  2105. {
  2106. ps.Add(contours[i].ToList());
  2107. }
  2108. }
  2109. }
  2110. }
  2111. }
  2112. else
  2113. {
  2114. if (this.checkBox6.Checked)
  2115. {
  2116. if (equalDiameter < 20)
  2117. {
  2118. ps.Add(contours[i].ToList());
  2119. }
  2120. }
  2121. if (contours[i].Length < 5)
  2122. continue;
  2123. else
  2124. {
  2125. if (this.checkBox6.Checked)
  2126. {
  2127. //if (equalDiameter < 20)
  2128. //{
  2129. // ps.Add(contours[i].ToList());
  2130. //}
  2131. if (equalDiameter >= 20)
  2132. {
  2133. OpenCvSharp.RotatedRect rect = OpenCvSharp.Cv2.FitEllipse(contours[i]);
  2134. radius = BasicCalculationHelper.CalcLongTrail(contours[i]);
  2135. double outerCircle = radius * radius * Math.PI;//外接圆面积
  2136. double areaRatio = (area - contours[i].Length / 2.0) / outerCircle;
  2137. if (areaRatio > 0 && areaRatio <= 1)
  2138. {
  2139. lstEqualDiameter.Add(equalDiameter);
  2140. equalDiameterSum += equalDiameter;
  2141. areaRatioSum += areaRatio;
  2142. totalAreaSum += area;
  2143. totalSum++;
  2144. pointList.Add(contours[i][0]);
  2145. leList.Add(Math.Round(double.Parse(string.IsNullOrEmpty(equalDiameter.ToString()) ? "0" :
  2146. equalDiameter.ToString()), Convert.ToInt32(this.numericUpDown1.Value)));
  2147. if (equalDiameter > 1000)
  2148. {
  2149. lstPoint1.Add(contours[i].ToList());
  2150. }
  2151. else if (equalDiameter > 500 && equalDiameter <= 1000)
  2152. {
  2153. lstPoint2.Add(contours[i].ToList());
  2154. }
  2155. else if (equalDiameter > 250 && equalDiameter <= 500)
  2156. {
  2157. lstPoint3.Add(contours[i].ToList());
  2158. }
  2159. else if (equalDiameter > 120 && equalDiameter <= 250)
  2160. {
  2161. lstPoint4.Add(contours[i].ToList());
  2162. }
  2163. else if (equalDiameter > 60 && equalDiameter <= 120)
  2164. {
  2165. lstPoint5.Add(contours[i].ToList());
  2166. }
  2167. else if (equalDiameter > 30 && equalDiameter <= 60)
  2168. {
  2169. lstPoint6.Add(contours[i].ToList());
  2170. }
  2171. else if (equalDiameter > 15 && equalDiameter <= 30)
  2172. {
  2173. lstPoint7.Add(contours[i].ToList());
  2174. }
  2175. else if (equalDiameter > 0 && equalDiameter <= 15)
  2176. {
  2177. lstPoint8.Add(contours[i].ToList());
  2178. }
  2179. }
  2180. else
  2181. {
  2182. ps.Add(contours[i].ToList());
  2183. }
  2184. }
  2185. }
  2186. else
  2187. {
  2188. OpenCvSharp.RotatedRect rect = OpenCvSharp.Cv2.FitEllipse(contours[i]);
  2189. radius = BasicCalculationHelper.CalcLongTrail(contours[i]);
  2190. double outerCircle = radius * radius * Math.PI;//外接圆面积
  2191. double areaRatio = (area - contours[i].Length / 2.0) / outerCircle;
  2192. if (areaRatio > 0 && areaRatio <= 1)
  2193. {
  2194. lstEqualDiameter.Add(equalDiameter);
  2195. equalDiameterSum += equalDiameter;
  2196. areaRatioSum += areaRatio;
  2197. totalAreaSum += area;
  2198. totalSum++;
  2199. pointList.Add(contours[i][0]);
  2200. leList.Add(Math.Round(double.Parse(string.IsNullOrEmpty(equalDiameter.ToString()) ? "0" :
  2201. equalDiameter.ToString()), Convert.ToInt32(this.numericUpDown1.Value)));
  2202. if (equalDiameter > 1000)
  2203. {
  2204. lstPoint1.Add(contours[i].ToList());
  2205. }
  2206. else if (equalDiameter > 500 && equalDiameter <= 1000)
  2207. {
  2208. lstPoint2.Add(contours[i].ToList());
  2209. }
  2210. else if (equalDiameter > 250 && equalDiameter <= 500)
  2211. {
  2212. lstPoint3.Add(contours[i].ToList());
  2213. }
  2214. else if (equalDiameter > 120 && equalDiameter <= 250)
  2215. {
  2216. lstPoint4.Add(contours[i].ToList());
  2217. }
  2218. else if (equalDiameter > 60 && equalDiameter <= 120)
  2219. {
  2220. lstPoint5.Add(contours[i].ToList());
  2221. }
  2222. else if (equalDiameter > 30 && equalDiameter <= 60)
  2223. {
  2224. lstPoint6.Add(contours[i].ToList());
  2225. }
  2226. else if (equalDiameter > 15 && equalDiameter <= 30)
  2227. {
  2228. lstPoint7.Add(contours[i].ToList());
  2229. }
  2230. else if (equalDiameter > 0 && equalDiameter <= 15)
  2231. {
  2232. lstPoint8.Add(contours[i].ToList());
  2233. }
  2234. }
  2235. else
  2236. {
  2237. ps.Add(contours[i].ToList());
  2238. }
  2239. }
  2240. }
  2241. }
  2242. }
  2243. if (totalSum > 0)
  2244. {
  2245. avgequalDiameter = equalDiameterSum / totalSum;//平均尺寸
  2246. avgAreaRatio = areaRatioSum / totalSum;//平均面积率
  2247. spheroidizationRate = spheroidizationSum / totalSum;//球化率
  2248. spheroidizationAreaRate = totalAreaSum / lstAttribute[h - 1][4];//石墨含量
  2249. string leve = string.Empty;
  2250. if (avgequalDiameter > 1000)
  2251. {
  2252. leve = "Ⅰ";
  2253. }
  2254. else if (avgequalDiameter > 500 && avgequalDiameter <= 1000)
  2255. {
  2256. leve = "2";
  2257. }
  2258. else if (avgequalDiameter > 250 && avgequalDiameter <= 500)
  2259. {
  2260. leve = "3";
  2261. }
  2262. else if (avgequalDiameter > 120 && avgequalDiameter <= 250)
  2263. {
  2264. leve = "4";
  2265. }
  2266. else if (avgequalDiameter > 60 && avgequalDiameter <= 120)
  2267. {
  2268. leve = "5";
  2269. }
  2270. else if (avgequalDiameter > 30 && avgequalDiameter <= 60)
  2271. {
  2272. leve = "6";
  2273. }
  2274. else if (avgequalDiameter > 15 && avgequalDiameter <= 30)
  2275. {
  2276. leve = "7";
  2277. }
  2278. else if (avgequalDiameter > 0 && avgequalDiameter <= 15)
  2279. {
  2280. leve = "8";
  2281. }
  2282. else
  2283. {
  2284. leve = "-";
  2285. }
  2286. this.dataGridView1.Rows.Add($"{PdnResources.GetString("Menu.view.text")}{h}", lstPoint1.Count - sumLstPoint1, lstPoint2.Count - sumLstPoint2, lstPoint3.Count - sumLstPoint3, lstPoint4.Count - sumLstPoint4, lstPoint5.Count - sumLstPoint5, lstPoint6.Count - sumLstPoint6, lstPoint7.Count - sumLstPoint7, lstPoint8.Count - sumLstPoint8, totalSum);
  2287. this.dataGridView3.Rows.Add($"{PdnResources.GetString("Menu.view.text")}{h}", 100 * (double)(lstPoint1.Count - sumLstPoint1) / totalSum, 100 * (double)(lstPoint2.Count - sumLstPoint2) / totalSum, 100 * (double)(lstPoint3.Count - sumLstPoint3) / totalSum, 100 * (double)(lstPoint4.Count - sumLstPoint4) / totalSum, 100 * (double)(lstPoint5.Count - sumLstPoint5) / totalSum, 100 * (double)(lstPoint6.Count - sumLstPoint6) / totalSum, 100 * (double)(lstPoint7.Count - sumLstPoint7) / totalSum, 100 * (double)(lstPoint8.Count - sumLstPoint8) / totalSum, avgequalDiameter, leve, 100 * spheroidizationAreaRate);
  2288. sumLstPoint1 = lstPoint1.Count;
  2289. sumLstPoint2 = lstPoint2.Count;
  2290. sumLstPoint3 = lstPoint3.Count;
  2291. sumLstPoint4 = lstPoint4.Count;
  2292. sumLstPoint5 = lstPoint5.Count;
  2293. sumLstPoint6 = lstPoint6.Count;
  2294. sumLstPoint7 = lstPoint7.Count;
  2295. sumLstPoint8 = lstPoint8.Count;
  2296. sumTotalSum += totalSum;
  2297. sumAvgequalDiameter += avgequalDiameter;//记录平均面积率总和
  2298. sumSpheroidizationAreaRate += spheroidizationAreaRate;//记录石墨含量总和
  2299. }
  2300. else
  2301. {
  2302. this.dataGridView1.Rows.Add($"{PdnResources.GetString("Menu.view.text")}{h}", 0, 0, 0, 0, 0, 0, 0, 0, 0);
  2303. this.dataGridView3.Rows.Add($"{PdnResources.GetString("Menu.view.text")}{h}", 0, 0, 0, 0, 0, 0, 0, 0, 0, "-", 0);
  2304. }
  2305. }
  2306. if (sumFieldl > 1)
  2307. {
  2308. double avgSumAvgequalDiameter = sumAvgequalDiameter / sumFieldl;
  2309. string avgLeve = string.Empty;//石墨类型
  2310. if (avgSumAvgequalDiameter > 1000)
  2311. {
  2312. avgLeve = "Ⅰ";
  2313. }
  2314. else if (avgSumAvgequalDiameter > 500 && avgSumAvgequalDiameter <= 1000)
  2315. {
  2316. avgLeve = "2";
  2317. }
  2318. else if (avgSumAvgequalDiameter > 250 && avgSumAvgequalDiameter <= 500)
  2319. {
  2320. avgLeve = "3";
  2321. }
  2322. else if (avgSumAvgequalDiameter > 120 && avgSumAvgequalDiameter <= 250)
  2323. {
  2324. avgLeve = "4";
  2325. }
  2326. else if (avgSumAvgequalDiameter > 60 && avgSumAvgequalDiameter <= 120)
  2327. {
  2328. avgLeve = "5";
  2329. }
  2330. else if (avgSumAvgequalDiameter > 30 && avgSumAvgequalDiameter <= 60)
  2331. {
  2332. avgLeve = "6";
  2333. }
  2334. else if (avgSumAvgequalDiameter > 15 && avgSumAvgequalDiameter <= 30)
  2335. {
  2336. avgLeve = "7";
  2337. }
  2338. else if (avgSumAvgequalDiameter > 0 && avgSumAvgequalDiameter <= 15)
  2339. {
  2340. avgLeve = "8";
  2341. }
  2342. else
  2343. {
  2344. avgLeve = "-";
  2345. }
  2346. this.dataGridView1.Rows.Add(PdnResources.GetString("Menu.Image.Average.Text"), (double)sumLstPoint1 / sumFieldl, (double)sumLstPoint2 / sumFieldl, (double)sumLstPoint3 / sumFieldl, (double)sumLstPoint4 / sumFieldl, (double)sumLstPoint5 / sumFieldl, (double)sumLstPoint6 / sumFieldl, (double)sumLstPoint7 / sumFieldl, (double)sumLstPoint8 / sumFieldl, sumTotalSum / sumFieldl);
  2347. this.dataGridView3.Rows.Add(PdnResources.GetString("Menu.Image.Average.Text"), 100 * (double)sumLstPoint1 / sumFieldl / totalSum, 100 * (double)sumLstPoint2 / sumFieldl / totalSum, 100 * (double)sumLstPoint3 / sumFieldl / totalSum, 100 * (double)sumLstPoint4 / sumFieldl / totalSum, 100 * (double)sumLstPoint5 / sumFieldl / totalSum, 100 * (double)sumLstPoint6 / sumFieldl / totalSum, 100 * (double)sumLstPoint7 / sumFieldl / totalSum, 100 * (double)sumLstPoint8 / sumFieldl / totalSum, avgSumAvgequalDiameter, avgLeve, 100 * sumSpheroidizationAreaRate / sumFieldl);
  2348. }
  2349. if (tempCopy != null)
  2350. {
  2351. tempCopy.Release();
  2352. }
  2353. }
  2354. else
  2355. {
  2356. OpenCvSharp.Point[][] contours;//原始轮廓信息
  2357. HierarchyIndex[] hierachy;
  2358. Mat tempCopy = BinaryClass.BGRA2GRAY(binarizationMat);
  2359. Cv2.FindContours(BinaryClass.BGRA2GRAY(binarizationMat), out contours, out hierachy, RetrievalModes.CComp, ContourApproximationModes.ApproxNone);
  2360. double spheroidizationSum = 0;//石墨个数
  2361. double areaRatioSum = 0; //面积率总和
  2362. double equalDiameterSum = 0; //尺寸总和
  2363. double totalAreaSum = 0;//面积总数
  2364. avgAreaRatio = 0;
  2365. totalSum = 0;//石墨总数
  2366. for (int i = 0; i < hierachy.Length; i++)
  2367. {
  2368. if (hierachy[i].Parent == -1)
  2369. {
  2370. double radius; //外接圆半径
  2371. double area = appCommon.Area(tempCopy, contours[i][0]);
  2372. double equalDiameter = Math.Sqrt(area / Math.PI) * 2 * unitLength;
  2373. if (this.checkBox3.Checked)
  2374. {
  2375. if (this.checkBox6.Checked)
  2376. {
  2377. if (equalDiameter < 20)
  2378. {
  2379. ps.Add(contours[i].ToList());
  2380. continue;
  2381. }
  2382. if (area >= (this.trackBar2.Value / (unitLength * unitLength)) && area <= (this.trackBar4.Value / (unitLength * unitLength)))
  2383. {
  2384. ps.Add(contours[i].ToList());
  2385. }
  2386. else
  2387. {
  2388. if (contours[i].Length < 5)
  2389. {
  2390. continue;
  2391. }
  2392. else
  2393. {
  2394. OpenCvSharp.RotatedRect rect = OpenCvSharp.Cv2.FitEllipse(contours[i]);
  2395. radius = BasicCalculationHelper.CalcLongTrail(contours[i]);
  2396. double outerCircle = radius * radius * Math.PI;//外接圆面积
  2397. double areaRatio = (area - contours[i].Length / 2.0) / outerCircle;
  2398. if (areaRatio > 0 && areaRatio <= 1)
  2399. {
  2400. lstEqualDiameter.Add(equalDiameter);
  2401. equalDiameterSum += equalDiameter;
  2402. areaRatioSum += areaRatio;
  2403. totalAreaSum += area;
  2404. totalSum++;
  2405. pointList.Add(contours[i][0]);
  2406. leList.Add(Math.Round(double.Parse(string.IsNullOrEmpty(equalDiameter.ToString()) ? "0" :
  2407. equalDiameter.ToString()), Convert.ToInt32(this.numericUpDown1.Value)));
  2408. if (equalDiameter > 1000)
  2409. {
  2410. lstPoint1.Add(contours[i].ToList());
  2411. }
  2412. else if (equalDiameter > 500 && equalDiameter <= 1000)
  2413. {
  2414. lstPoint2.Add(contours[i].ToList());
  2415. }
  2416. else if (equalDiameter > 250 && equalDiameter <= 500)
  2417. {
  2418. lstPoint3.Add(contours[i].ToList());
  2419. }
  2420. else if (equalDiameter > 120 && equalDiameter <= 250)
  2421. {
  2422. lstPoint4.Add(contours[i].ToList());
  2423. }
  2424. else if (equalDiameter > 60 && equalDiameter <= 120)
  2425. {
  2426. lstPoint5.Add(contours[i].ToList());
  2427. }
  2428. else if (equalDiameter > 30 && equalDiameter <= 60)
  2429. {
  2430. lstPoint6.Add(contours[i].ToList());
  2431. }
  2432. else if (equalDiameter > 15 && equalDiameter <= 30)
  2433. {
  2434. lstPoint7.Add(contours[i].ToList());
  2435. }
  2436. else if (equalDiameter > 0 && equalDiameter <= 15)
  2437. {
  2438. lstPoint8.Add(contours[i].ToList());
  2439. }
  2440. }
  2441. else
  2442. {
  2443. ps.Add(contours[i].ToList());
  2444. }
  2445. }
  2446. }
  2447. }
  2448. else
  2449. {
  2450. if (area >= (this.trackBar2.Value / (unitLength * unitLength)) && area <= (this.trackBar4.Value / (unitLength * unitLength)))
  2451. {
  2452. ps.Add(contours[i].ToList());
  2453. }
  2454. else
  2455. {
  2456. if (contours[i].Length < 5)
  2457. {
  2458. continue;
  2459. }
  2460. else
  2461. {
  2462. OpenCvSharp.RotatedRect rect = OpenCvSharp.Cv2.FitEllipse(contours[i]);
  2463. radius = BasicCalculationHelper.CalcLongTrail(contours[i]);
  2464. double outerCircle = radius * radius * Math.PI;//外接圆面积
  2465. double areaRatio = (area - contours[i].Length / 2.0) / outerCircle;
  2466. if (areaRatio > 0 && areaRatio <= 1)
  2467. {
  2468. lstEqualDiameter.Add(equalDiameter);
  2469. equalDiameterSum += equalDiameter;
  2470. areaRatioSum += areaRatio;
  2471. totalAreaSum += area;
  2472. totalSum++;
  2473. pointList.Add(contours[i][0]);
  2474. leList.Add(Math.Round(double.Parse(string.IsNullOrEmpty(equalDiameter.ToString()) ? "0" :
  2475. equalDiameter.ToString()), Convert.ToInt32(this.numericUpDown1.Value)));
  2476. if (equalDiameter > 1000)
  2477. {
  2478. lstPoint1.Add(contours[i].ToList());
  2479. }
  2480. else if (equalDiameter > 500 && equalDiameter <= 1000)
  2481. {
  2482. lstPoint2.Add(contours[i].ToList());
  2483. }
  2484. else if (equalDiameter > 250 && equalDiameter <= 500)
  2485. {
  2486. lstPoint3.Add(contours[i].ToList());
  2487. }
  2488. else if (equalDiameter > 120 && equalDiameter <= 250)
  2489. {
  2490. lstPoint4.Add(contours[i].ToList());
  2491. }
  2492. else if (equalDiameter > 60 && equalDiameter <= 120)
  2493. {
  2494. lstPoint5.Add(contours[i].ToList());
  2495. }
  2496. else if (equalDiameter > 30 && equalDiameter <= 60)
  2497. {
  2498. lstPoint6.Add(contours[i].ToList());
  2499. }
  2500. else if (equalDiameter > 15 && equalDiameter <= 30)
  2501. {
  2502. lstPoint7.Add(contours[i].ToList());
  2503. }
  2504. else if (equalDiameter > 0 && equalDiameter <= 15)
  2505. {
  2506. lstPoint8.Add(contours[i].ToList());
  2507. }
  2508. }
  2509. else
  2510. {
  2511. ps.Add(contours[i].ToList());
  2512. }
  2513. }
  2514. }
  2515. }
  2516. }
  2517. else
  2518. {
  2519. if (this.checkBox6.Checked)
  2520. {
  2521. if (equalDiameter < 20)
  2522. {
  2523. ps.Add(contours[i].ToList());
  2524. }
  2525. }
  2526. if (contours[i].Length < 5)
  2527. continue;
  2528. else
  2529. {
  2530. if (this.checkBox6.Checked)
  2531. {
  2532. //if (equalDiameter < 20)
  2533. //{
  2534. // ps.Add(contours[i].ToList());
  2535. //}
  2536. if (equalDiameter >= 20)
  2537. {
  2538. OpenCvSharp.RotatedRect rect = OpenCvSharp.Cv2.FitEllipse(contours[i]);
  2539. radius = BasicCalculationHelper.CalcLongTrail(contours[i]);
  2540. double outerCircle = radius * radius * Math.PI;//外接圆面积
  2541. double areaRatio = (area - contours[i].Length / 2.0) / outerCircle;
  2542. if (areaRatio > 0 && areaRatio <= 1)
  2543. {
  2544. lstEqualDiameter.Add(equalDiameter);
  2545. equalDiameterSum += equalDiameter;
  2546. areaRatioSum += areaRatio;
  2547. totalAreaSum += area;
  2548. totalSum++;
  2549. pointList.Add(contours[i][0]);
  2550. leList.Add(Math.Round(double.Parse(string.IsNullOrEmpty(equalDiameter.ToString()) ? "0" :
  2551. equalDiameter.ToString()), Convert.ToInt32(this.numericUpDown1.Value)));
  2552. if (equalDiameter > 1000)
  2553. {
  2554. lstPoint1.Add(contours[i].ToList());
  2555. }
  2556. else if (equalDiameter > 500 && equalDiameter <= 1000)
  2557. {
  2558. lstPoint2.Add(contours[i].ToList());
  2559. }
  2560. else if (equalDiameter > 250 && equalDiameter <= 500)
  2561. {
  2562. lstPoint3.Add(contours[i].ToList());
  2563. }
  2564. else if (equalDiameter > 120 && equalDiameter <= 250)
  2565. {
  2566. lstPoint4.Add(contours[i].ToList());
  2567. }
  2568. else if (equalDiameter > 60 && equalDiameter <= 120)
  2569. {
  2570. lstPoint5.Add(contours[i].ToList());
  2571. }
  2572. else if (equalDiameter > 30 && equalDiameter <= 60)
  2573. {
  2574. lstPoint6.Add(contours[i].ToList());
  2575. }
  2576. else if (equalDiameter > 15 && equalDiameter <= 30)
  2577. {
  2578. lstPoint7.Add(contours[i].ToList());
  2579. }
  2580. else if (equalDiameter > 0 && equalDiameter <= 15)
  2581. {
  2582. lstPoint8.Add(contours[i].ToList());
  2583. }
  2584. }
  2585. else
  2586. {
  2587. ps.Add(contours[i].ToList());
  2588. }
  2589. }
  2590. }
  2591. else
  2592. {
  2593. OpenCvSharp.RotatedRect rect = OpenCvSharp.Cv2.FitEllipse(contours[i]);
  2594. radius = BasicCalculationHelper.CalcLongTrail(contours[i]);
  2595. double outerCircle = radius * radius * Math.PI;//外接圆面积
  2596. double areaRatio = (area - contours[i].Length / 2.0) / outerCircle;
  2597. if (areaRatio > 0 && areaRatio <= 1)
  2598. {
  2599. lstEqualDiameter.Add(equalDiameter);
  2600. equalDiameterSum += equalDiameter;
  2601. areaRatioSum += areaRatio;
  2602. totalAreaSum += area;
  2603. totalSum++;
  2604. pointList.Add(contours[i][0]);
  2605. leList.Add(Math.Round(double.Parse(string.IsNullOrEmpty(equalDiameter.ToString()) ? "0" :
  2606. equalDiameter.ToString()), Convert.ToInt32(this.numericUpDown1.Value)));
  2607. if (equalDiameter > 1000)
  2608. {
  2609. lstPoint1.Add(contours[i].ToList());
  2610. }
  2611. else if (equalDiameter > 500 && equalDiameter <= 1000)
  2612. {
  2613. lstPoint2.Add(contours[i].ToList());
  2614. }
  2615. else if (equalDiameter > 250 && equalDiameter <= 500)
  2616. {
  2617. lstPoint3.Add(contours[i].ToList());
  2618. }
  2619. else if (equalDiameter > 120 && equalDiameter <= 250)
  2620. {
  2621. lstPoint4.Add(contours[i].ToList());
  2622. }
  2623. else if (equalDiameter > 60 && equalDiameter <= 120)
  2624. {
  2625. lstPoint5.Add(contours[i].ToList());
  2626. }
  2627. else if (equalDiameter > 30 && equalDiameter <= 60)
  2628. {
  2629. lstPoint6.Add(contours[i].ToList());
  2630. }
  2631. else if (equalDiameter > 15 && equalDiameter <= 30)
  2632. {
  2633. lstPoint7.Add(contours[i].ToList());
  2634. }
  2635. else if (equalDiameter > 0 && equalDiameter <= 15)
  2636. {
  2637. lstPoint8.Add(contours[i].ToList());
  2638. }
  2639. }
  2640. else
  2641. {
  2642. ps.Add(contours[i].ToList());
  2643. }
  2644. }
  2645. }
  2646. }
  2647. }
  2648. }
  2649. if (pointList.Count > 0)
  2650. {
  2651. avgequalDiameter = equalDiameterSum / totalSum;//平均尺寸
  2652. avgAreaRatio = areaRatioSum / totalSum;//平均面积率
  2653. spheroidizationRate = spheroidizationSum / totalSum;//球化率
  2654. spheroidizationAreaRate = totalAreaSum / picArea;//石墨含量
  2655. string leve = string.Empty;
  2656. if (avgequalDiameter > 1000)
  2657. {
  2658. leve = "Ⅰ";
  2659. }
  2660. else if (avgequalDiameter > 500 && avgequalDiameter <= 1000)
  2661. {
  2662. leve = "2";
  2663. }
  2664. else if (avgequalDiameter > 250 && avgequalDiameter <= 500)
  2665. {
  2666. leve = "3";
  2667. }
  2668. else if (avgequalDiameter > 120 && avgequalDiameter <= 250)
  2669. {
  2670. leve = "4";
  2671. }
  2672. else if (avgequalDiameter > 60 && avgequalDiameter <= 120)
  2673. {
  2674. leve = "5";
  2675. }
  2676. else if (avgequalDiameter > 30 && avgequalDiameter <= 60)
  2677. {
  2678. leve = "6";
  2679. }
  2680. else if (avgequalDiameter > 15 && avgequalDiameter <= 30)
  2681. {
  2682. leve = "7";
  2683. }
  2684. else if (avgequalDiameter > 0 && avgequalDiameter <= 15)
  2685. {
  2686. leve = "8";
  2687. }
  2688. else
  2689. {
  2690. leve = "-";
  2691. }
  2692. this.dataGridView1.Rows.Add(PdnResources.GetString("Menu.view.text")+"1", lstPoint1.Count, lstPoint2.Count, lstPoint3.Count, lstPoint4.Count, lstPoint5.Count, lstPoint6.Count, lstPoint7.Count, lstPoint8.Count, totalSum);
  2693. this.dataGridView3.Rows.Add(PdnResources.GetString("Menu.view.text")+"1", 100 * (double)(lstPoint1.Count) / totalSum, 100 * (double)(lstPoint2.Count) / totalSum, 100 * (double)(lstPoint3.Count) / totalSum, 100 * (double)(lstPoint4.Count) / totalSum, 100 * (double)(lstPoint5.Count) / totalSum, 100 * (double)(lstPoint6.Count) / totalSum, 100 * (double)(lstPoint7.Count) / totalSum, 100 * (double)(lstPoint8.Count) / totalSum, avgequalDiameter, leve, 100 * spheroidizationAreaRate);
  2694. }
  2695. if (tempCopy != null)
  2696. {
  2697. tempCopy.Release();
  2698. }
  2699. }
  2700. binarizationMat.CopyTo(temp);
  2701. if (checkBox4.Checked)
  2702. {
  2703. DisplayColor();
  2704. }
  2705. if (checkBox5.Checked && !bcOriginChecked())
  2706. {
  2707. AddPictureBoxEvent();
  2708. }
  2709. //筛选颜色
  2710. Cv2.FillPoly(temp, ps, new Scalar(0, 0, 0, 0));
  2711. phaseModel.mat = temp;
  2712. this.documentWorkspace.Refresh();
  2713. //数据结果保存
  2714. dtDataGridView1 = appCommon.ResultDataSaving(dataGridView1);
  2715. dtDataGridView3 = appCommon.ResultDataSaving(dataGridView3);
  2716. string imgName = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetFriendlyName();
  2717. string tag = this.imageList1.Images.Keys[this.listView1.FocusedItem.Index];
  2718. //dtResult = new DataTable(tag);
  2719. //分析数据保存
  2720. dtResult = appCommon.AnalysisDataSaving(dataGridView3, imgName, tag);
  2721. if (dtDataGridView1.Rows.Count > 0)
  2722. {
  2723. RefreshDataGridView1();
  2724. }
  2725. if (dtDataGridView3.Rows.Count > 0)
  2726. {
  2727. RefreshDataGridView3();
  2728. }
  2729. if (bcOriginChecked())
  2730. {
  2731. appCommonDisplay.DisplayData(this.dataGridView1, false);
  2732. appCommonDisplay.DisplayData(this.dataGridView3, false);
  2733. }
  2734. }
  2735. }
  2736. /// <summary>
  2737. /// 显示不同颜色方法
  2738. /// </summary>
  2739. public void DisplayColor()
  2740. {
  2741. //填充颜色
  2742. if (this.checkBox4.Checked)
  2743. {
  2744. Mat[] arr = temp.Split();
  2745. temp = temp.CvtColor(ColorConversionCodes.BGRA2BGR);
  2746. for (int i = 0; i < lstPoint1.Count; i++)
  2747. {
  2748. int length = Cv2.FloodFill(temp, lstPoint1[i][lstPoint1[i].Count - 1], new Scalar(colour["panelColour1"].B, colour["panelColour1"].G, colour["panelColour1"].R));
  2749. }
  2750. for (int i = 0; i < lstPoint2.Count; i++)
  2751. {
  2752. int length = Cv2.FloodFill(temp, lstPoint2[i][lstPoint2[i].Count - 1], new Scalar(colour["panelColour2"].B, colour["panelColour2"].G, colour["panelColour2"].R));
  2753. }
  2754. for (int i = 0; i < lstPoint3.Count; i++)
  2755. {
  2756. int length = Cv2.FloodFill(temp, lstPoint3[i][lstPoint3[i].Count - 1], new Scalar(colour["panelColour3"].B, colour["panelColour3"].G, colour["panelColour3"].R));
  2757. }
  2758. for (int i = 0; i < lstPoint4.Count; i++)
  2759. {
  2760. int length = Cv2.FloodFill(temp, lstPoint4[i][lstPoint4[i].Count - 1], new Scalar(colour["panelColour4"].B, colour["panelColour4"].G, colour["panelColour4"].R));
  2761. }
  2762. for (int i = 0; i < lstPoint5.Count; i++)
  2763. {
  2764. int length = Cv2.FloodFill(temp, lstPoint5[i][lstPoint5[i].Count - 1], new Scalar(colour["panelColour5"].B, colour["panelColour5"].G, colour["panelColour5"].R));
  2765. }
  2766. for (int i = 0; i < lstPoint6.Count; i++)
  2767. {
  2768. int length = Cv2.FloodFill(temp, lstPoint6[i][lstPoint6[i].Count - 1], new Scalar(colour["panelColour6"].B, colour["panelColour6"].G, colour["panelColour6"].R));
  2769. }
  2770. for (int i = 0; i < lstPoint7.Count; i++)
  2771. {
  2772. int length = Cv2.FloodFill(temp, lstPoint7[i][lstPoint7[i].Count - 1], new Scalar(colour["panelColour7"].B, colour["panelColour7"].G, colour["panelColour7"].R));
  2773. }
  2774. for (int i = 0; i < lstPoint8.Count; i++)
  2775. {
  2776. int length = Cv2.FloodFill(temp, lstPoint8[i][lstPoint8[i].Count - 1], new Scalar(colour["panelColour8"].B, colour["panelColour8"].G, colour["panelColour8"].R));
  2777. }
  2778. Mat[] arr2 = temp.Split();
  2779. arr[0] = arr2[0];
  2780. arr[1] = arr2[1];
  2781. arr[2] = arr2[2];
  2782. Cv2.Merge(arr, temp);
  2783. phaseModel.mat = temp;
  2784. }
  2785. this.documentWorkspace.Refresh();
  2786. }
  2787. /// <summary>
  2788. /// 添加内容单元格
  2789. /// </summary>
  2790. /// <param name="text"></param>
  2791. /// <param name="tag"></param>
  2792. /// <returns></returns>
  2793. private DataGridViewTextBoxCell CreateTextBoxCell(string text, object tag)
  2794. {
  2795. DataGridViewTextBoxCell textboxcell = new DataGridViewTextBoxCell();
  2796. textboxcell.Value = text;
  2797. textboxcell.Tag = tag;
  2798. return textboxcell;
  2799. }
  2800. /// <summary>
  2801. /// 刷新其他信息
  2802. /// </summary>
  2803. private void ResetAreaAndContent()
  2804. {
  2805. //二值判断
  2806. if (binarizationMat != null && bcBinaryChecked())
  2807. {
  2808. OpenCvSharp.Point[][] contours;//原始轮廓信息
  2809. HierarchyIndex[] hierachy;
  2810. Mat tempCopy = BinaryClass.BGRA2GRAY(binarizationMat);
  2811. //Mat temp = new Mat();
  2812. //binarizationMat.CopyTo(temp);
  2813. Cv2.FindContours(BinaryClass.BGRA2GRAY(binarizationMat), out contours, out hierachy, RetrievalModes.CComp, ContourApproximationModes.ApproxNone);
  2814. if (hierachy.Length > 0)
  2815. {
  2816. double maxArea = 0;//面积最大值
  2817. double minArea = 9999999999;//面积最小值
  2818. double maxAreaRatio = 0;//面积率最大值
  2819. double minAreaRatio = 100;//面积率最小值
  2820. double radius = 0;//外接圆半径
  2821. double area = 0;
  2822. for (int i = 0; i < hierachy.Length; i++)
  2823. {
  2824. if (hierachy[i].Parent == -1)
  2825. {
  2826. area = appCommon.Area(tempCopy, contours[i][0]);
  2827. if (maxArea < area)
  2828. maxArea = area;
  2829. if (minArea > area)
  2830. minArea = area;
  2831. }
  2832. //if (contours[i].Length < 5)
  2833. // continue;
  2834. //else
  2835. //{
  2836. // OpenCvSharp.RotatedRect rect = OpenCvSharp.Cv2.FitEllipse(contours[i]);
  2837. // if (rect.Size.Height > rect.Size.Width)
  2838. // {
  2839. // radius = rect.Size.Height / 2;
  2840. // }
  2841. // else
  2842. // {
  2843. // radius = rect.Size.Width / 2;
  2844. // }
  2845. // double outerCircle = radius * radius * Math.PI;//外接圆面积
  2846. // double areaRatio = area / outerCircle;
  2847. // if (areaRatio >= 0 && areaRatio <= 1)
  2848. // {
  2849. // if (maxAreaRatio < areaRatio * 100)
  2850. // maxAreaRatio = areaRatio * 100;
  2851. // if (minAreaRatio > areaRatio * 100)
  2852. // minAreaRatio = areaRatio * 100;
  2853. // }
  2854. //}
  2855. }
  2856. //phaseModel.mat = temp;
  2857. if (!changeColor)
  2858. {
  2859. maxArea = maxArea * unitLength * unitLength;
  2860. minArea = minArea * unitLength * unitLength;
  2861. //maxAreaRatio = maxAreaRatio;
  2862. //minAreaRatio = minAreaRatio;
  2863. int maxNum = (int)Math.Ceiling(maxArea);//获取面积最大值
  2864. int minNum = (int)Math.Floor(minArea);//获取面积最小值
  2865. //先解绑事件以防数据赋值异常
  2866. this.numericUpDown4.ValueChanged -= numericUpDown4_ValueChanged;
  2867. this.numericUpDown5.ValueChanged -= numericUpDown5_ValueChanged;
  2868. this.trackBar2.Scroll -= trackBar2_Scroll;
  2869. this.trackBar4.Scroll -= trackBar4_Scroll;
  2870. this.numericUpDown4.Maximum = maxNum;
  2871. this.numericUpDown4.Minimum = minNum;
  2872. this.trackBar2.Maximum = maxNum;
  2873. this.trackBar2.Minimum = minNum;
  2874. this.numericUpDown5.Maximum = maxNum;
  2875. this.numericUpDown5.Minimum = minNum;
  2876. this.trackBar4.Maximum = maxNum;
  2877. this.trackBar4.Minimum = minNum;
  2878. this.numericUpDown4.Value = minNum;
  2879. this.trackBar2.Value = minNum;
  2880. this.numericUpDown5.Value = maxNum;
  2881. this.trackBar4.Value = maxNum;
  2882. if (areaMin != -1 && areaMin >= this.numericUpDown4.Minimum && areaMin <= this.numericUpDown5.Maximum)
  2883. {
  2884. trackBar2.Value = (int)areaMin;
  2885. this.numericUpDown4.Value = areaMin;
  2886. }
  2887. if (areaMax != -1 && areaMax >= this.numericUpDown4.Value && areaMax <= this.numericUpDown5.Maximum)
  2888. {
  2889. trackBar4.Value = (int)areaMax;
  2890. this.numericUpDown5.Value = areaMax;
  2891. }
  2892. this.numericUpDown4.ValueChanged += new EventHandler(numericUpDown4_ValueChanged);
  2893. this.numericUpDown5.ValueChanged += new EventHandler(numericUpDown5_ValueChanged);
  2894. this.trackBar2.Scroll += new EventHandler(trackBar2_Scroll);
  2895. this.trackBar4.Scroll += new EventHandler(trackBar4_Scroll);
  2896. //RefreshDataGridView1();
  2897. }
  2898. }
  2899. else
  2900. {
  2901. this.trackBar2.Maximum = 0;
  2902. this.trackBar2.Minimum = 0;
  2903. this.trackBar4.Maximum = 0;
  2904. this.trackBar4.Minimum = 0;
  2905. this.numericUpDown4.Maximum = 0;
  2906. this.numericUpDown4.Minimum = 0;
  2907. this.numericUpDown5.Maximum = 0;
  2908. this.numericUpDown5.Minimum = 0;
  2909. }
  2910. if (tempCopy != null)
  2911. {
  2912. tempCopy.Release();
  2913. }
  2914. }
  2915. }
  2916. /// <summary>
  2917. /// 小数数字框值改变
  2918. /// </summary>
  2919. /// <param name="sender"></param>
  2920. /// <param name="e"></param>
  2921. private void numericUpDown1_ValueChanged(object sender, EventArgs e)
  2922. {
  2923. if (this.numericUpDown1.Value > this.numericUpDown1.Maximum)
  2924. this.numericUpDown1.Value = this.numericUpDown1.Maximum;
  2925. if (this.numericUpDown1.Value < this.numericUpDown1.Minimum)
  2926. this.numericUpDown1.Value = this.numericUpDown1.Minimum;
  2927. RefreshDataGridView1();
  2928. RefreshDataGridView3();
  2929. RefreshDataGridView2();
  2930. ReloadDebrisSelection();
  2931. }
  2932. /// <summary>
  2933. /// 是否筛选
  2934. /// </summary>
  2935. /// <param name="sender"></param>
  2936. /// <param name="e"></param>
  2937. private void checkBox3_CheckedChanged(object sender, EventArgs e)
  2938. {
  2939. if (this.documentWorkspace == null || this.documentWorkspace.CompositionSurface == null)
  2940. return;
  2941. ResetAreaAndContent();
  2942. ReloadDebrisSelection();
  2943. }
  2944. /// <summary>
  2945. /// 颗粒筛选范围最小值
  2946. /// </summary>
  2947. /// <param name="sender"></param>
  2948. /// <param name="e"></param>
  2949. private void numericUpDown4_ValueChanged(object sender, EventArgs e)
  2950. {
  2951. if (this.numericUpDown4.Value > this.numericUpDown5.Value)
  2952. this.numericUpDown4.Value = this.numericUpDown5.Value;
  2953. this.trackBar2.Value = Convert.ToInt32(this.numericUpDown4.Value);
  2954. areaMin = this.numericUpDown4.Value;
  2955. areaMax = this.numericUpDown5.Value;
  2956. if (this.checkBox3.Checked && bcBinaryChecked() && !this.checkBox4.Checked)
  2957. {
  2958. ReloadDebrisSelection();
  2959. }
  2960. if (this.checkBox3.Checked && bcBinaryChecked() && this.checkBox4.Checked)
  2961. {
  2962. ReloadDebrisSelection();
  2963. }
  2964. }
  2965. /// <summary>
  2966. /// 颗粒筛选范围最大值
  2967. /// </summary>
  2968. /// <param name="sender"></param>
  2969. /// <param name="e"></param>
  2970. private void numericUpDown5_ValueChanged(object sender, EventArgs e)
  2971. {
  2972. if (this.numericUpDown5.Value < this.numericUpDown4.Value)
  2973. this.numericUpDown5.Value = this.numericUpDown4.Value;
  2974. this.trackBar4.Value = Convert.ToInt32(this.numericUpDown5.Value);
  2975. areaMin = this.numericUpDown4.Value;
  2976. areaMax = this.numericUpDown5.Value;
  2977. if (this.checkBox3.Checked && bcBinaryChecked() && !this.checkBox4.Checked)
  2978. {
  2979. ReloadDebrisSelection();
  2980. }
  2981. if (this.checkBox3.Checked && bcBinaryChecked() && this.checkBox4.Checked)
  2982. {
  2983. ReloadDebrisSelection();
  2984. }
  2985. }
  2986. /// <summary>
  2987. /// 颗粒筛选最小值滚动条
  2988. /// </summary>
  2989. /// <param name="sender"></param>
  2990. /// <param name="e"></param>
  2991. private void trackBar2_Scroll(object sender, EventArgs e)
  2992. {
  2993. this.numericUpDown4.Value = this.trackBar2.Value;
  2994. }
  2995. /// <summary>
  2996. /// 颗粒筛选最大值滚动条
  2997. /// </summary>
  2998. /// <param name="sender"></param>
  2999. /// <param name="e"></param>
  3000. private void trackBar4_Scroll(object sender, EventArgs e)
  3001. {
  3002. this.numericUpDown5.Value = this.trackBar4.Value;
  3003. }
  3004. /// <summary>
  3005. /// 显示不同颜色
  3006. /// </summary>
  3007. /// <param name="sender"></param>
  3008. /// <param name="e"></param>
  3009. private void checkBox4_CheckedChanged(object sender, EventArgs e)
  3010. {
  3011. ReloadDebrisSelection();
  3012. }
  3013. /// <summary>
  3014. /// 添加画布绑定事件
  3015. /// </summary>
  3016. public void AddPictureBoxEvent()
  3017. {
  3018. this.documentWorkspace.panel.Paint -= new PaintEventHandler(this.BoxPaintHandler);
  3019. this.documentWorkspace.panel.Paint += new PaintEventHandler(this.BoxPaintHandler);
  3020. }
  3021. /// <summary>
  3022. /// 绘制事件
  3023. /// </summary>
  3024. /// <param name="sender"></param>
  3025. /// <param name="e"></param>
  3026. private void BoxPaintHandler(object sender, PaintEventArgs e)
  3027. {
  3028. if (this.documentWorkspace.CompositionSurface != null)
  3029. {
  3030. Rectangle rc = this.documentWorkspace.panel.ClientRectangle;
  3031. int width = (int)(this.documentWorkspace.CompositionSurface.Width * this.documentWorkspace.ScaleFactor.Ratio);
  3032. int height = (int)(this.documentWorkspace.CompositionSurface.Height * this.documentWorkspace.ScaleFactor.Ratio);
  3033. int x = (rc.Width < width) ? this.documentWorkspace.panel.AutoScrollPosition.X : (rc.Width - width) / 2;
  3034. int y = (rc.Height < height) ? this.documentWorkspace.panel.AutoScrollPosition.Y : (rc.Height - height) / 2;
  3035. e.Graphics.TranslateTransform(x, y);
  3036. e.Graphics.ScaleTransform((float)this.documentWorkspace.ScaleFactor.Ratio, (float)this.documentWorkspace.ScaleFactor.Ratio);
  3037. Draw(e.Graphics);
  3038. e.Graphics.ScaleTransform(1 / (float)this.documentWorkspace.ScaleFactor.Ratio, 1 / (float)this.documentWorkspace.ScaleFactor.Ratio);
  3039. e.Graphics.TranslateTransform(-x, -y);
  3040. }
  3041. }
  3042. /// <summary>
  3043. /// 绘制
  3044. /// </summary>
  3045. private void Draw(Graphics graphics)
  3046. {
  3047. graphics.SmoothingMode = SmoothingMode.AntiAlias;
  3048. Pen rectPen = new Pen(Color.Black);
  3049. rectPen.DashStyle = DashStyle.Custom;
  3050. float[] dashArray = { 2.0f, 3.0f };
  3051. rectPen.DashPattern = dashArray;
  3052. if (pointList.Count > 0)
  3053. {
  3054. for (int i = 0; i < pointList.Count; i++)
  3055. {
  3056. graphics.DrawString(leList[i].ToString(), new Font("宋体", float.Parse(colourFont.Keys.First()), System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))), new SolidBrush(colourFont.Values.First()), pointList[i].X, pointList[i].Y);
  3057. }
  3058. }
  3059. }
  3060. /// <summary>
  3061. /// 显示面积率
  3062. /// </summary>
  3063. /// <param name="sender"></param>
  3064. /// <param name="e"></param>
  3065. private void checkBox5_CheckedChanged(object sender, EventArgs e)
  3066. {
  3067. if (bcBinaryChecked() && !bcOriginChecked())
  3068. {
  3069. if (checkBox5.Checked)
  3070. {
  3071. AddPictureBoxEvent();
  3072. this.documentWorkspace.Refresh();
  3073. }
  3074. else
  3075. {
  3076. this.documentWorkspace.panel.Paint -= new PaintEventHandler(this.BoxPaintHandler);
  3077. this.documentWorkspace.Refresh();
  3078. }
  3079. }
  3080. }
  3081. /// <summary>
  3082. /// 等积圆直径小于20um的颗粒不参与计算
  3083. /// </summary>
  3084. /// <param name="sender"></param>
  3085. /// <param name="e"></param>
  3086. private void checkBox6_CheckedChanged(object sender, EventArgs e)
  3087. {
  3088. //ResetAreaAndContent();
  3089. ReloadDebrisSelection();
  3090. }
  3091. DialogResult dr;
  3092. /// <summary>
  3093. /// 保存结果
  3094. /// </summary>
  3095. /// <param name="sender"></param>
  3096. /// <param name="e"></param>
  3097. private void button2_Click(object sender, EventArgs e)
  3098. {
  3099. if (picArea == 0)
  3100. {
  3101. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
  3102. return;
  3103. }
  3104. else
  3105. {
  3106. if (!bcBinaryChecked())
  3107. {
  3108. MessageBox.Show(PdnResources.GetString("Menu.PleaseBinarize.text")+"!");
  3109. return;
  3110. }
  3111. }
  3112. if (this.listView1.SelectedItems.Count > 0)
  3113. {
  3114. string imgName = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetFriendlyName();
  3115. string tag = this.imageList1.Images.Keys[this.listView1.SelectedItems[0].Index];
  3116. bool replace = false;
  3117. int rowIndex = 0;
  3118. if (this.dataGridView3.Rows.Count > 0 && dataGridView3.Rows[0].Visible)
  3119. {
  3120. if (this.listView2.Items.Count > 0)
  3121. {
  3122. foreach (ListViewItem item in this.listView2.Items)
  3123. {
  3124. if (!blSaveAll && item.Name.Equals(tag))
  3125. {
  3126. dr = MessageBox.Show(PdnResources.GetString("Menu.Theanalysisreertoreplaceit.text") + "?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
  3127. break;
  3128. }
  3129. }
  3130. foreach (ListViewItem item in this.listView2.Items)
  3131. {
  3132. if (item.Name.Equals(tag))
  3133. {
  3134. if (dr == DialogResult.OK || blSaveAll)
  3135. {
  3136. replace = true;
  3137. }
  3138. else
  3139. {
  3140. return;
  3141. }
  3142. break;
  3143. }
  3144. }
  3145. }
  3146. //有重名需要替换
  3147. if (replace)
  3148. {
  3149. for (int i = 0; i < this.resultTableList.Count; i++)
  3150. {
  3151. if (this.resultTableList[i].TableName.Equals(tag))
  3152. {
  3153. rowIndex = i;
  3154. this.resultTableList.Remove(this.resultTableList[i]);
  3155. if (this.pointList.Count > 0)
  3156. {
  3157. resultTableList.Insert(rowIndex, dtResult);
  3158. }
  3159. }
  3160. }
  3161. }
  3162. else
  3163. {
  3164. ListViewItem listViewItem = new ListViewItem();
  3165. listViewItem.Name = tag;
  3166. listViewItem.SubItems[0].Text = imgName;
  3167. this.listView2.Items.Add(listViewItem);
  3168. this.listView2.SelectedItems.Clear();
  3169. this.listView2.Items[this.listView2.Items.Count - 1].Selected = true;
  3170. if (this.pointList.Count > 0)
  3171. {
  3172. resultTableList.Insert(rowIndex, dtResult);
  3173. }
  3174. }
  3175. RefreshDataGridView2();
  3176. //保存处理后的图片
  3177. double pantographRatio = (double)this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRulerMultiple(MeasurementUnit.Micron);//标尺*放大倍数
  3178. List<Bitmap> tempBit = new List<Bitmap>();
  3179. Bitmap originalBit = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreateAliasedBitmap();
  3180. originalBit.Tag = pantographRatio;
  3181. tempBit.Add(originalBit);
  3182. Bitmap processedBit = BitmapConverter.ToBitmap(phaseModel.mat);
  3183. Bitmap newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
  3184. Graphics graphics = Graphics.FromImage(newBit);
  3185. graphics.DrawImage(processedBit, new PointF(0, 0));
  3186. if (this.checkBox4.Checked)
  3187. {
  3188. DisplayColor();
  3189. }
  3190. if (this.checkBox5.Checked)
  3191. {
  3192. Draw(graphics);
  3193. }
  3194. newBit.Tag = pantographRatio;
  3195. tempBit.Add(newBit);
  3196. if (bitDic.ContainsKey(tag))
  3197. bitDic[tag] = tempBit;
  3198. else
  3199. bitDic.Add(tag, tempBit);
  3200. //拼接中间数据
  3201. List<List<string>> dataList = new List<List<string>>();
  3202. List<string> columnName = new List<string>();
  3203. columnName.Add(PdnResources.GetString("Menu.Imagement.Measurementlist.ordernumber.text"));
  3204. if (this.checkBox6.Checked)
  3205. {
  3206. columnName.Add(PdnResources.GetString("Menu.umisoproductcirclediameter.text"));
  3207. }
  3208. else
  3209. {
  3210. columnName.Add(PdnResources.GetString("Menu.Diameterofequalareacircle.text"));
  3211. }
  3212. dataList.Add(columnName);
  3213. if (this.lstEqualDiameter.Count > 0)
  3214. {
  3215. for (int i = 0; i < this.lstEqualDiameter.Count; i++)
  3216. {
  3217. List<string> strList = new List<string>();
  3218. strList.Add((i + 1).ToString());
  3219. strList.Add(this.lstEqualDiameter[i].ToString());
  3220. dataList.Add(strList);
  3221. }
  3222. }
  3223. bool isExist = false;//是否已存在进行替换
  3224. int modelIndex = -1;//要替换的下标
  3225. for (int j = 0; j < tempDataModel.Count; j++)
  3226. {
  3227. if (tempDataModel[j].tagName.Equals(tag))
  3228. {
  3229. isExist = true;
  3230. modelIndex = j;
  3231. break;
  3232. }
  3233. }
  3234. if (isExist && modelIndex > -1)
  3235. tempDataModel[modelIndex].dataList = dataList;
  3236. else
  3237. {
  3238. ExportProjectModel newModel = new ExportProjectModel();
  3239. newModel.tagName = tag;
  3240. newModel.picName = imgName;
  3241. newModel.dataList = dataList;
  3242. tempDataModel.Add(newModel);
  3243. }
  3244. }
  3245. else
  3246. {
  3247. MessageBox.Show(PdnResources.GetString("Menu.Nodatatosave.text"));
  3248. }
  3249. }
  3250. }
  3251. /// <summary>
  3252. /// 刷新个数百分比展示表
  3253. /// </summary>
  3254. private void RefreshDataGridView3()
  3255. {
  3256. this.dataGridView3.Rows.Clear();
  3257. if (dtDataGridView3 != null)
  3258. {
  3259. dataGridView3.Rows.Add(dtDataGridView3.Rows.Count);//增加同等数量的行数
  3260. int i = 0;
  3261. foreach (DataRow row in dtDataGridView3.Rows)//逐个读取单元格的内容;
  3262. {
  3263. DataGridViewRow r1 = dataGridView3.Rows[i];
  3264. r1.Cells[0].Value = row.RowState.ToString();
  3265. for (int j = 0; j < dtDataGridView3.Columns.Count; j++)
  3266. {
  3267. if (j == 0 || j == 10)
  3268. {
  3269. r1.Cells[j].Value = row[j].ToString();
  3270. }
  3271. else
  3272. {
  3273. r1.Cells[j].Value = Math.Round(double.Parse(string.IsNullOrEmpty(row[j].ToString()) ? "0" :
  3274. row[j].ToString()), Convert.ToInt32(this.numericUpDown1.Value));
  3275. }
  3276. }
  3277. i++;
  3278. }
  3279. }
  3280. }
  3281. /// <summary>
  3282. /// 刷新个数展示表
  3283. /// </summary>
  3284. private void RefreshDataGridView1()
  3285. {
  3286. this.dataGridView1.Rows.Clear();
  3287. if (dtDataGridView1 != null && dtDataGridView1.Rows.Count > 0)
  3288. {
  3289. dataGridView1.Rows.Add(dtDataGridView1.Rows.Count);//增加同等数量的行数
  3290. int i = 0;
  3291. foreach (DataRow row in dtDataGridView1.Rows)//逐个读取单元格的内容;
  3292. {
  3293. DataGridViewRow r1 = dataGridView1.Rows[i];
  3294. r1.Cells[0].Value = row.RowState.ToString();
  3295. for (int j = 0; j < dtDataGridView1.Columns.Count; j++)
  3296. {
  3297. r1.Cells[j].Value = row[j].ToString();
  3298. }
  3299. i++;
  3300. }
  3301. }
  3302. }
  3303. /// <summary>
  3304. /// 刷新分析结果表
  3305. /// </summary>
  3306. private void RefreshDataGridView2()
  3307. {
  3308. //需要计算平均值的集合
  3309. List<double> lst1 = new List<double>();
  3310. List<double> lst2 = new List<double>();
  3311. List<double> lst3 = new List<double>();
  3312. List<double> lst4 = new List<double>();
  3313. List<double> lst5 = new List<double>();
  3314. List<double> lst6 = new List<double>();
  3315. List<double> lst7 = new List<double>();
  3316. List<double> lst8 = new List<double>();
  3317. List<double> lstRate = new List<double>();
  3318. List<double> lstContent = new List<double>();
  3319. //综合平均值
  3320. double avglst1 = 0;
  3321. double avglst2 = 0;
  3322. double avglst3 = 0;
  3323. double avglst4 = 0;
  3324. double avglst5 = 0;
  3325. double avglst6 = 0;
  3326. double avglst7 = 0;
  3327. double avglst8 = 0;
  3328. double avglstRate = 0;
  3329. double avglstContent = 0;
  3330. this.dataGridView2.Rows.Clear();
  3331. if (resultTableList.Count > 0)
  3332. {
  3333. dataGridView2.Rows.Clear();
  3334. dataGridView4.Rows.Clear();
  3335. if (this.showAll)
  3336. {
  3337. //dataGridView2.Rows.Clear();
  3338. int i = 0;
  3339. for (int k = 0; k < resultTableList.Count; k++)
  3340. {
  3341. dataGridView2.Rows.Add(resultTableList[k].Rows.Count);//增加同等数量的行数
  3342. foreach (DataRow row in resultTableList[k].Rows)//逐个读取单元格的内容;
  3343. {
  3344. DataGridViewRow r1 = dataGridView2.Rows[i];
  3345. r1.Cells[0].Value = row.RowState.ToString();
  3346. for (int j = 0; j < resultTableList[k].Columns.Count; j++)
  3347. {
  3348. if (j == 0 || j == 1 || j == 11)
  3349. {
  3350. r1.Cells[j].Value = row[j].ToString();
  3351. }
  3352. else
  3353. {
  3354. r1.Cells[j].Value = Math.Round(double.Parse(string.IsNullOrEmpty(row[j].ToString()) ? "0" :
  3355. row[j].ToString()), Convert.ToInt32(this.numericUpDown1.Value));
  3356. }
  3357. //r1.Cells[j].Value = row[j];
  3358. if (!row[1].Equals(PdnResources.GetString("Menu.Image.Average.Text")))
  3359. {
  3360. if (j == 2)
  3361. {
  3362. lst1.Add(double.Parse(row[j].ToString()));
  3363. }
  3364. if (j == 3)
  3365. {
  3366. lst2.Add(double.Parse(row[j].ToString()));
  3367. }
  3368. if (j == 4)
  3369. {
  3370. lst3.Add(double.Parse(row[j].ToString()));
  3371. }
  3372. if (j == 5)
  3373. {
  3374. lst4.Add(double.Parse(row[j].ToString()));
  3375. }
  3376. if (j == 6)
  3377. {
  3378. lst5.Add(double.Parse(row[j].ToString()));
  3379. }
  3380. if (j == 7)
  3381. {
  3382. lst6.Add(double.Parse(row[j].ToString()));
  3383. }
  3384. if (j == 8)
  3385. {
  3386. lst7.Add(double.Parse(row[j].ToString()));
  3387. }
  3388. if (j == 9)
  3389. {
  3390. lst8.Add(double.Parse(row[j].ToString()));
  3391. }
  3392. if (j == 10)
  3393. {
  3394. lstRate.Add(double.Parse(row[j].ToString()));
  3395. }
  3396. if (j == 12)
  3397. {
  3398. lstContent.Add(double.Parse(row[j].ToString()));
  3399. }
  3400. }
  3401. }
  3402. i++;
  3403. }
  3404. }
  3405. }
  3406. else
  3407. {
  3408. //dataGridView2.Rows.Clear();
  3409. if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
  3410. {
  3411. int h = 0;
  3412. for (int i = 0; i < this.listView2.SelectedItems.Count; i++)
  3413. {
  3414. string tableName = this.listView2.SelectedItems[i].Name;
  3415. foreach (DataTable dt in resultTableList)
  3416. {
  3417. if (dt.TableName.Equals(tableName))
  3418. {
  3419. dataGridView2.Rows.Add(dt.Rows.Count);//增加同等数量的行数
  3420. foreach (DataRow row in dt.Rows)//逐个读取单元格的内容;
  3421. {
  3422. DataGridViewRow r1 = dataGridView2.Rows[h];
  3423. r1.Cells[0].Value = row.RowState.ToString();
  3424. for (int j = 0; j < dt.Columns.Count; j++)
  3425. {
  3426. if (j == 0 || j == 1 || j == 11)
  3427. {
  3428. r1.Cells[j].Value = row[j].ToString();
  3429. }
  3430. else
  3431. {
  3432. r1.Cells[j].Value = Math.Round(double.Parse(string.IsNullOrEmpty(row[j].ToString()) ? "0" :
  3433. row[j].ToString()), Convert.ToInt32(this.numericUpDown1.Value));
  3434. }
  3435. //r1.Cells[j].Value = row[j];
  3436. if (!row[1].Equals(PdnResources.GetString("Menu.Image.Average.Text")))
  3437. {
  3438. if (j == 2)
  3439. {
  3440. lst1.Add(double.Parse(row[j].ToString()));
  3441. }
  3442. if (j == 3)
  3443. {
  3444. lst2.Add(double.Parse(row[j].ToString()));
  3445. }
  3446. if (j == 4)
  3447. {
  3448. lst3.Add(double.Parse(row[j].ToString()));
  3449. }
  3450. if (j == 5)
  3451. {
  3452. lst4.Add(double.Parse(row[j].ToString()));
  3453. }
  3454. if (j == 6)
  3455. {
  3456. lst5.Add(double.Parse(row[j].ToString()));
  3457. }
  3458. if (j == 7)
  3459. {
  3460. lst6.Add(double.Parse(row[j].ToString()));
  3461. }
  3462. if (j == 8)
  3463. {
  3464. lst7.Add(double.Parse(row[j].ToString()));
  3465. }
  3466. if (j == 9)
  3467. {
  3468. lst8.Add(double.Parse(row[j].ToString()));
  3469. }
  3470. if (j == 10)
  3471. {
  3472. lstRate.Add(double.Parse(row[j].ToString()));
  3473. }
  3474. if (j == 12)
  3475. {
  3476. lstContent.Add(double.Parse(row[j].ToString()));
  3477. }
  3478. }
  3479. }
  3480. h++;
  3481. }
  3482. }
  3483. }
  3484. }
  3485. }
  3486. }
  3487. if (dataGridView2.Rows.Count > 0)
  3488. {
  3489. if (lst1.Count > 0)
  3490. {
  3491. avglst1 = (double)lst1.Average();
  3492. }
  3493. if (lst2.Count > 0)
  3494. {
  3495. avglst2 = (double)lst2.Average();
  3496. }
  3497. if (lst3.Count > 0)
  3498. {
  3499. avglst3 = (double)lst3.Average();
  3500. }
  3501. if (lst4.Count > 0)
  3502. {
  3503. avglst4 = (double)lst4.Average();
  3504. }
  3505. if (lst5.Count > 0)
  3506. {
  3507. avglst5 = (double)lst5.Average();
  3508. }
  3509. if (lst6.Count > 0)
  3510. {
  3511. avglst6 = (double)lst6.Average();
  3512. }
  3513. if (lst7.Count > 0)
  3514. {
  3515. avglst7 = (double)lst7.Average();
  3516. }
  3517. if (lst8.Count > 0)
  3518. {
  3519. avglst8 = (double)lst8.Average();
  3520. }
  3521. if (lstRate.Count > 0)
  3522. {
  3523. avglstRate = (double)lstRate.Average();
  3524. }
  3525. if (lstContent.Count > 0)
  3526. {
  3527. avglstContent = (double)lstContent.Average();
  3528. }
  3529. string avgLeve = string.Empty;//石墨类型
  3530. //等级
  3531. if (avglstRate > 1000)
  3532. {
  3533. avgLeve = "Ⅰ";
  3534. }
  3535. else if (avglstRate > 500 && avglstRate <= 1000)
  3536. {
  3537. avgLeve = "2";
  3538. }
  3539. else if (avglstRate > 250 && avglstRate <= 500)
  3540. {
  3541. avgLeve = "3";
  3542. }
  3543. else if (avglstRate > 120 && avglstRate <= 250)
  3544. {
  3545. avgLeve = "4";
  3546. }
  3547. else if (avglstRate > 60 && avglstRate <= 120)
  3548. {
  3549. avgLeve = "5";
  3550. }
  3551. else if (avglstRate > 30 && avglstRate <= 60)
  3552. {
  3553. avgLeve = "6";
  3554. }
  3555. else if (avglstRate > 15 && avglstRate <= 30)
  3556. {
  3557. avgLeve = "7";
  3558. }
  3559. else if (avglstRate > 0 && avglstRate <= 15)
  3560. {
  3561. avgLeve = "8";
  3562. }
  3563. else
  3564. {
  3565. avgLeve = "-";
  3566. }
  3567. this.dataGridView4.Rows.Add(PdnResources.GetString("Menu.comprehensive.text"), PdnResources.GetString("Menu.Comprehensivaverage.text"), Math.Round(double.Parse(string.IsNullOrEmpty(avglst1.ToString()) ? "0" : avglst1.ToString()), Convert.ToInt32(this.numericUpDown1.Value)), Math.Round(double.Parse(string.IsNullOrEmpty(avglst2.ToString()) ? "0" : avglst2.ToString()), Convert.ToInt32(this.numericUpDown1.Value)), Math.Round(double.Parse(string.IsNullOrEmpty(avglst3.ToString()) ? "0" : avglst3.ToString()), Convert.ToInt32(this.numericUpDown1.Value)), Math.Round(double.Parse(string.IsNullOrEmpty(avglst4.ToString()) ? "0" : avglst4.ToString()), Convert.ToInt32(this.numericUpDown1.Value)), Math.Round(double.Parse(string.IsNullOrEmpty(avglst5.ToString()) ? "0" : avglst5.ToString()), Convert.ToInt32(this.numericUpDown1.Value)), Math.Round(double.Parse(string.IsNullOrEmpty(avglst6.ToString()) ? "0" : avglst6.ToString()), Convert.ToInt32(this.numericUpDown1.Value)), Math.Round(double.Parse(string.IsNullOrEmpty(avglst7.ToString()) ? "0" : avglst7.ToString()), Convert.ToInt32(this.numericUpDown1.Value)), Math.Round(double.Parse(string.IsNullOrEmpty(avglst8.ToString()) ? "0" : avglst8.ToString()), Convert.ToInt32(this.numericUpDown1.Value)), Math.Round(double.Parse(string.IsNullOrEmpty(avglstRate.ToString()) ? "0" : avglstRate.ToString()), Convert.ToInt32(this.numericUpDown1.Value)), avgLeve, Math.Round(double.Parse(string.IsNullOrEmpty(avglstContent.ToString()) ? "0" : avglstContent.ToString()), Convert.ToInt32(this.numericUpDown1.Value)));
  3568. }
  3569. }
  3570. else
  3571. {
  3572. dataGridView2.Rows.Clear();
  3573. dataGridView4.Rows.Clear();
  3574. }
  3575. }
  3576. /// <summary>
  3577. /// 生成报告
  3578. /// </summary>
  3579. /// <param name="sender"></param>
  3580. /// <param name="e"></param>
  3581. private void button8_Click(object sender, EventArgs e)
  3582. {
  3583. if (dataGridView2.Rows.Count == 0)
  3584. {
  3585. MessageBox.Show(PdnResources.GetString("Menu.Noanalysineratereport.text")+"!");
  3586. return;
  3587. }
  3588. if (this.checkBox1.Checked)
  3589. this.btnSetUp.PerformClick();
  3590. if (this.analyzeSettingModel != null && !string.IsNullOrEmpty(this.analyzeSettingModel.analyzeClassify))
  3591. {
  3592. //获取word书签与excel单元格的关系,以字典方式存储
  3593. List<mic_module_infos> mic_module_infos = mic_module_infos_BLL.FindAll().FindAll(a => a.analyze_classify == this.analyzeSettingModel.analyzeClassify);
  3594. Dictionary<string, string> tagInfos = new Dictionary<string, string>();
  3595. if (mic_module_infos != null && mic_module_infos.Count > 0)
  3596. {
  3597. foreach (mic_module_infos info in mic_module_infos)
  3598. {
  3599. tagInfos.Add(info.tag_name, info.cell_position);
  3600. }
  3601. }
  3602. //分析结果
  3603. List<List<string>> analysisContent = new List<List<string>>();
  3604. List<string> contentHead = new List<string>();
  3605. contentHead.Add(PdnResources.GetString("Menu.picture.Text"));
  3606. contentHead.Add(PdnResources.GetString("Menu.view.text"));
  3607. contentHead.Add("1");
  3608. contentHead.Add("2");
  3609. contentHead.Add("3");
  3610. contentHead.Add("4");
  3611. contentHead.Add("5");
  3612. contentHead.Add("6");
  3613. contentHead.Add("7");
  3614. contentHead.Add("8");
  3615. contentHead.Add(PdnResources.GetString("Menu.Theaveragesize.Text"));
  3616. contentHead.Add(PdnResources.GetString("Menu.Thsizeofthelevel.Text"));
  3617. contentHead.Add(PdnResources.GetString("Menu.Graphitecontent.text"));
  3618. analysisContent.Add(contentHead);
  3619. foreach (DataGridViewRow item in this.dataGridView2.Rows)
  3620. {
  3621. List<string> content = new List<string>();
  3622. content.Add(item.Cells[0].Value.ToString());
  3623. content.Add(item.Cells[1].Value.ToString());
  3624. content.Add(item.Cells[2].Value.ToString());
  3625. content.Add(item.Cells[3].Value.ToString());
  3626. content.Add(item.Cells[4].Value.ToString());
  3627. content.Add(item.Cells[5].Value.ToString());
  3628. content.Add(item.Cells[6].Value.ToString());
  3629. content.Add(item.Cells[7].Value.ToString());
  3630. content.Add(item.Cells[8].Value.ToString());
  3631. content.Add(item.Cells[9].Value.ToString());
  3632. content.Add(item.Cells[10].Value.ToString());
  3633. content.Add(item.Cells[11].Value.ToString());
  3634. content.Add(item.Cells[12].Value.ToString());
  3635. analysisContent.Add(content);
  3636. }
  3637. analysisContent.Add(new List<string>() { "\r" });
  3638. foreach (DataGridViewRow item in this.dataGridView4.Rows)
  3639. {
  3640. List<string> content = new List<string>();
  3641. content.Add(item.Cells[0].Value.ToString());
  3642. content.Add(item.Cells[1].Value.ToString());
  3643. content.Add(item.Cells[2].Value.ToString());
  3644. content.Add(item.Cells[3].Value.ToString());
  3645. content.Add(item.Cells[4].Value.ToString());
  3646. content.Add(item.Cells[5].Value.ToString());
  3647. content.Add(item.Cells[6].Value.ToString());
  3648. content.Add(item.Cells[7].Value.ToString());
  3649. content.Add(item.Cells[8].Value.ToString());
  3650. content.Add(item.Cells[9].Value.ToString());
  3651. content.Add(item.Cells[10].Value.ToString());
  3652. content.Add(item.Cells[11].Value.ToString());
  3653. content.Add(item.Cells[12].Value.ToString());
  3654. analysisContent.Add(content);
  3655. }
  3656. //图片
  3657. bitList = new List<Bitmap>();
  3658. if (this.showAll)
  3659. {
  3660. foreach (KeyValuePair<string, List<Bitmap>> kv in this.bitDic)
  3661. {
  3662. bitList.Add(kv.Value[0]);
  3663. bitList.Add(kv.Value[1]);
  3664. }
  3665. }
  3666. else
  3667. {
  3668. if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
  3669. {
  3670. foreach (ListViewItem item in this.listView2.SelectedItems)
  3671. {
  3672. if (bitDic.ContainsKey(item.Name))
  3673. {
  3674. bitList.Add(bitDic[item.Name][0]);
  3675. bitList.Add(bitDic[item.Name][1]);
  3676. }
  3677. }
  3678. }
  3679. }
  3680. this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, analysisContent, bitList, tagInfos);
  3681. }
  3682. else
  3683. MessageBox.Show(PdnResources.GetString("Menu.Pleasesettheanalysisreportfirst.text")+"!");
  3684. }
  3685. /// <summary>
  3686. /// 导出项目
  3687. /// </summary>
  3688. /// <param name="sender"></param>
  3689. /// <param name="e"></param>
  3690. private void button1_Click(object sender, EventArgs e)
  3691. {
  3692. if (dataGridView2.Rows.Count == 0)
  3693. {
  3694. MessageBox.Show(PdnResources.GetString("Menu.Noanalysineratereport.text")+"!");
  3695. return;
  3696. }
  3697. if (this.checkBox1.Checked)
  3698. this.btnSetUp.PerformClick();
  3699. if (this.analyzeSettingModel != null && !string.IsNullOrEmpty(this.analyzeSettingModel.analyzeClassify))
  3700. {
  3701. Instrument.ProjectEngineering.NodeItem nodeItem = this.appWorkspace.GetInsertProjectPath(2, "Menu.DedicatedAnalysis.BlackMetal.DuctileIron.Text", this.analyzeSettingModel.savePath);
  3702. if (nodeItem == null) return;
  3703. //获取word书签与excel单元格的关系,以字典方式存储
  3704. List<mic_module_infos> mic_module_infos = mic_module_infos_BLL.FindAll().FindAll(a => a.analyze_classify == this.analyzeSettingModel.analyzeClassify);
  3705. Dictionary<string, string> tagInfos = new Dictionary<string, string>();
  3706. if (mic_module_infos != null && mic_module_infos.Count > 0)
  3707. {
  3708. foreach (mic_module_infos info in mic_module_infos)
  3709. {
  3710. tagInfos.Add(info.tag_name, info.cell_position);
  3711. }
  3712. }
  3713. //分析结果
  3714. List<List<string>> analysisContent = new List<List<string>>();
  3715. List<string> contentHead = new List<string>();
  3716. contentHead.Add(PdnResources.GetString("Menu.picture.Text"));
  3717. contentHead.Add(PdnResources.GetString("Menu.view.text"));
  3718. contentHead.Add("1");
  3719. contentHead.Add("2");
  3720. contentHead.Add("3");
  3721. contentHead.Add("4");
  3722. contentHead.Add("5");
  3723. contentHead.Add("6");
  3724. contentHead.Add("7");
  3725. contentHead.Add("8");
  3726. contentHead.Add(PdnResources.GetString("Menu.Theaveragesize.Text"));
  3727. contentHead.Add(PdnResources.GetString("Menu.Thsizeofthelevel.Text"));
  3728. contentHead.Add(PdnResources.GetString("Menu.Graphitecontent.text"));
  3729. analysisContent.Add(contentHead);
  3730. foreach (DataGridViewRow item in this.dataGridView2.Rows)
  3731. {
  3732. List<string> content = new List<string>();
  3733. content.Add(item.Cells[0].Value.ToString());
  3734. content.Add(item.Cells[1].Value.ToString());
  3735. content.Add(item.Cells[2].Value.ToString());
  3736. content.Add(item.Cells[3].Value.ToString());
  3737. content.Add(item.Cells[4].Value.ToString());
  3738. content.Add(item.Cells[5].Value.ToString());
  3739. content.Add(item.Cells[6].Value.ToString());
  3740. content.Add(item.Cells[7].Value.ToString());
  3741. content.Add(item.Cells[8].Value.ToString());
  3742. content.Add(item.Cells[9].Value.ToString());
  3743. content.Add(item.Cells[10].Value.ToString());
  3744. content.Add(item.Cells[11].Value.ToString());
  3745. content.Add(item.Cells[12].Value.ToString());
  3746. analysisContent.Add(content);
  3747. }
  3748. analysisContent.Add(new List<string>() { "\r" });
  3749. foreach (DataGridViewRow item in this.dataGridView4.Rows)
  3750. {
  3751. List<string> content = new List<string>();
  3752. content.Add(item.Cells[0].Value.ToString());
  3753. content.Add(item.Cells[1].Value.ToString());
  3754. content.Add(item.Cells[2].Value.ToString());
  3755. content.Add(item.Cells[3].Value.ToString());
  3756. content.Add(item.Cells[4].Value.ToString());
  3757. content.Add(item.Cells[5].Value.ToString());
  3758. content.Add(item.Cells[6].Value.ToString());
  3759. content.Add(item.Cells[7].Value.ToString());
  3760. content.Add(item.Cells[8].Value.ToString());
  3761. content.Add(item.Cells[9].Value.ToString());
  3762. content.Add(item.Cells[10].Value.ToString());
  3763. content.Add(item.Cells[11].Value.ToString());
  3764. content.Add(item.Cells[12].Value.ToString());
  3765. analysisContent.Add(content);
  3766. }
  3767. //图片
  3768. bitList = new List<Bitmap>();
  3769. if (this.showAll)
  3770. {
  3771. foreach (KeyValuePair<string, List<Bitmap>> kv in this.bitDic)
  3772. {
  3773. bitList.Add(kv.Value[0]);
  3774. bitList.Add(kv.Value[1]);
  3775. }
  3776. }
  3777. else
  3778. {
  3779. if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
  3780. {
  3781. foreach (ListViewItem item in this.listView2.SelectedItems)
  3782. {
  3783. if (bitDic.ContainsKey(item.Name))
  3784. {
  3785. bitList.Add(bitDic[item.Name][0]);
  3786. bitList.Add(bitDic[item.Name][1]);
  3787. }
  3788. }
  3789. }
  3790. }
  3791. this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, analysisContent, tempDataModel, bitList, tagInfos, nodeItem.path, nodeItem.code);
  3792. //保存项目信息到数据库
  3793. this.appWorkspace.InsertIntoDB(this.analyzeSettingModel, nodeItem);
  3794. }
  3795. else
  3796. MessageBox.Show(PdnResources.GetString("Menu.Pleasesettheanalysisreportfirst.text")+"!");
  3797. }
  3798. /// <summary>
  3799. /// 导出结果
  3800. /// </summary>
  3801. /// <param name="sender"></param>
  3802. /// <param name="e"></param>
  3803. private void button9_Click(object sender, EventArgs e)
  3804. {
  3805. if (this.dataGridView2.Rows.Count > 0)
  3806. {
  3807. SaveFileDialog exe = new SaveFileDialog();
  3808. exe.Filter = "Execl files (*.xlsx)|*.xlsx";
  3809. exe.FilterIndex = 0;
  3810. exe.RestoreDirectory = true;
  3811. //exe.CreatePrompt = true;
  3812. exe.Title = "Export Excel File";
  3813. exe.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
  3814. if (IronType == 1)
  3815. {
  3816. exe.FileName = PdnResources.GetString("Menu.DedicatedAnalysis.BlackMetal.DuctileIron.Text")+"(ISO945" + PdnResources.GetString("Menu.Sizeofgraphite.Text")+ ")" + PdnResources.GetString("Menu.Analysisresult.text") + DateTime.Now.ToString("yyyyMMddHHmmss");
  3817. }
  3818. else if (IronType == 2)
  3819. {
  3820. exe.FileName = PdnResources.GetString("Menu.DedicatedAnalysis.BlackMetal.GrayIron.Text")+"(ISO945" + PdnResources.GetString("Menu.Sizeofgraphite.Text")+ ")" + PdnResources.GetString("Menu.Analysisresult.text") + DateTime.Now.ToString("yyyyMMddHHmmss");
  3821. }
  3822. else if (IronType == 3)
  3823. {
  3824. exe.FileName = PdnResources.GetString("Menu.DedicatedAnalysis.BlackMetal.VermiculateCastIron.Text")+"(ISO945" + PdnResources.GetString("Menu.Sizeofgraphite.Text")+ ")" + PdnResources.GetString("Menu.Analysisresult.text") + DateTime.Now.ToString("yyyyMMddHHmmss");
  3825. }
  3826. DialogResult dr = exe.ShowDialog();
  3827. if (dr != DialogResult.OK)
  3828. return;
  3829. DataTable dtb = new DataTable();
  3830. dtb.Columns.Add(PdnResources.GetString("Menu.picture.Text"));
  3831. dtb.Columns.Add(PdnResources.GetString("Menu.view.text"));
  3832. dtb.Columns.Add("1");
  3833. dtb.Columns.Add("2");
  3834. dtb.Columns.Add("3");
  3835. dtb.Columns.Add("4");
  3836. dtb.Columns.Add("5");
  3837. dtb.Columns.Add("6");
  3838. dtb.Columns.Add("7");
  3839. dtb.Columns.Add("8");
  3840. dtb.Columns.Add(PdnResources.GetString("Menu.Theaveragesize.Text"));
  3841. dtb.Columns.Add(PdnResources.GetString("Menu.Thsizeofthelevel.Text"));
  3842. dtb.Columns.Add(PdnResources.GetString("Menu.Graphitecontent.text"));
  3843. for (int i = 0; i < this.dataGridView2.Rows.Count; i++)
  3844. {
  3845. DataRow dataRow = dtb.NewRow();
  3846. dataRow[PdnResources.GetString("Menu.picture.Text")] = this.dataGridView2.Rows[i].Cells[0].Value;
  3847. dataRow[PdnResources.GetString("Menu.view.text")] = this.dataGridView2.Rows[i].Cells[1].Value;
  3848. dataRow["1"] = this.dataGridView2.Rows[i].Cells[2].Value;
  3849. dataRow["2"] = this.dataGridView2.Rows[i].Cells[3].Value;
  3850. dataRow["3"] = this.dataGridView2.Rows[i].Cells[4].Value;
  3851. dataRow["4"] = this.dataGridView2.Rows[i].Cells[5].Value;
  3852. dataRow["5"] = this.dataGridView2.Rows[i].Cells[6].Value;
  3853. dataRow["6"] = this.dataGridView2.Rows[i].Cells[7].Value;
  3854. dataRow["7"] = this.dataGridView2.Rows[i].Cells[8].Value;
  3855. dataRow["8"] = this.dataGridView2.Rows[i].Cells[9].Value;
  3856. dataRow[PdnResources.GetString("Menu.Theaveragesize.Text")] = this.dataGridView2.Rows[i].Cells[10].Value;
  3857. dataRow[PdnResources.GetString("Menu.Thsizeofthelevel.Text")] = this.dataGridView2.Rows[i].Cells[11].Value;
  3858. dataRow[PdnResources.GetString("Menu.Graphitecontent.text")] = this.dataGridView2.Rows[i].Cells[12].Value;
  3859. dtb.Rows.Add(dataRow);
  3860. }
  3861. for (int i = 0; i < this.dataGridView4.Rows.Count; i++)
  3862. {
  3863. DataRow dataRow = dtb.NewRow();
  3864. dataRow[PdnResources.GetString("Menu.picture.Text")] = this.dataGridView4.Rows[i].Cells[0].Value;
  3865. dataRow[PdnResources.GetString("Menu.view.text")] = this.dataGridView4.Rows[i].Cells[1].Value;
  3866. dataRow["1"] = this.dataGridView4.Rows[i].Cells[2].Value;
  3867. dataRow["2"] = this.dataGridView4.Rows[i].Cells[3].Value;
  3868. dataRow["3"] = this.dataGridView4.Rows[i].Cells[4].Value;
  3869. dataRow["4"] = this.dataGridView4.Rows[i].Cells[5].Value;
  3870. dataRow["5"] = this.dataGridView4.Rows[i].Cells[6].Value;
  3871. dataRow["6"] = this.dataGridView4.Rows[i].Cells[7].Value;
  3872. dataRow["7"] = this.dataGridView4.Rows[i].Cells[8].Value;
  3873. dataRow["8"] = this.dataGridView4.Rows[i].Cells[9].Value;
  3874. dataRow[PdnResources.GetString("Menu.Theaveragesize.Text")] = this.dataGridView4.Rows[i].Cells[10].Value;
  3875. dataRow[PdnResources.GetString("Menu.Thsizeofthelevel.Text")] = this.dataGridView4.Rows[i].Cells[11].Value;
  3876. dataRow[PdnResources.GetString("Menu.Graphitecontent.text")] = this.dataGridView4.Rows[i].Cells[12].Value;
  3877. dtb.Rows.Add(dataRow);
  3878. }
  3879. //DataTable dtb1 = new DataTable();
  3880. //dtb1.Columns.Add(PdnResources.GetString("Menu.picture.Text"));
  3881. //dtb1.Columns.Add(PdnResources.GetString("Menu.view.text"));
  3882. //dtb1.Columns.Add("1");
  3883. //dtb1.Columns.Add("2");
  3884. //dtb1.Columns.Add("3");
  3885. //dtb1.Columns.Add("4");
  3886. //dtb1.Columns.Add("5");
  3887. //dtb1.Columns.Add("6");
  3888. //dtb1.Columns.Add("7");
  3889. //dtb1.Columns.Add("8");
  3890. //dtb1.Columns.Add(PdnResources.GetString("Menu.Theaveragesize.Text"));
  3891. //dtb1.Columns.Add(PdnResources.GetString("Menu.Thsizeofthelevel.Text"));
  3892. //dtb1.Columns.Add(PdnResources.GetString("Menu.Graphitecontent.text"));
  3893. //for (int i = 0; i < this.dataGridView4.Rows.Count; i++)
  3894. //{
  3895. // DataRow dataRow = dtb1.NewRow();
  3896. // dataRow[PdnResources.GetString("Menu.picture.Text")] = this.dataGridView4.Rows[i].Cells[0].Value;
  3897. // dataRow[PdnResources.GetString("Menu.view.text")] = this.dataGridView4.Rows[i].Cells[1].Value;
  3898. // dataRow["1"] = this.dataGridView4.Rows[i].Cells[2].Value;
  3899. // dataRow["2"] = this.dataGridView4.Rows[i].Cells[3].Value;
  3900. // dataRow["3"] = this.dataGridView4.Rows[i].Cells[4].Value;
  3901. // dataRow["4"] = this.dataGridView4.Rows[i].Cells[5].Value;
  3902. // dataRow["5"] = this.dataGridView4.Rows[i].Cells[6].Value;
  3903. // dataRow["6"] = this.dataGridView4.Rows[i].Cells[7].Value;
  3904. // dataRow["7"] = this.dataGridView4.Rows[i].Cells[8].Value;
  3905. // dataRow["8"] = this.dataGridView4.Rows[i].Cells[9].Value;
  3906. // dataRow[PdnResources.GetString("Menu.Theaveragesize.Text")] = this.dataGridView4.Rows[i].Cells[10].Value;
  3907. // dataRow[PdnResources.GetString("Menu.Thsizeofthelevel.Text")] = this.dataGridView4.Rows[i].Cells[11].Value;
  3908. // dataRow[PdnResources.GetString("Menu.Graphitecontent.text")] = this.dataGridView4.Rows[i].Cells[12].Value;
  3909. // dtb1.Rows.Add(dataRow);
  3910. //}
  3911. List<DataTable> list = new List<DataTable>();
  3912. list.Add(dtb);
  3913. //list.Add(dtb1);
  3914. this.appWorkspace.ExportDataToExcelWithProgress(list, exe.FileName, true, false, true);
  3915. }
  3916. else
  3917. MessageBox.Show(PdnResources.GetString("Menu.Noanalysineratereport.text")+"!");
  3918. }
  3919. private void listView2_SelectedIndexChanged(object sender, EventArgs e)
  3920. {
  3921. if (this.showAll)
  3922. return;
  3923. RefreshDataGridView2();
  3924. }
  3925. /// <summary>
  3926. /// 全部显示
  3927. /// </summary>
  3928. /// <param name="sender"></param>
  3929. /// <param name="e"></param>
  3930. private void button6_Click(object sender, EventArgs e)
  3931. {
  3932. if (this.button6.Text == PdnResources.GetString("Menu.Showall.text"))
  3933. {
  3934. this.button6.Text = PdnResources.GetString("Menu.Cancelshowall.text");
  3935. this.showAll = true;
  3936. RefreshDataGridView2();
  3937. }
  3938. else if (this.button6.Text == PdnResources.GetString("Menu.Cancelshowall.text"))
  3939. {
  3940. this.button6.Text = PdnResources.GetString("Menu.Showall.text");
  3941. this.showAll = false;
  3942. RefreshDataGridView2();
  3943. }
  3944. }
  3945. /// <summary>
  3946. /// 删除
  3947. /// </summary>
  3948. /// <param name="sender"></param>
  3949. /// <param name="e"></param>
  3950. private void button7_Click(object sender, EventArgs e)
  3951. {
  3952. if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
  3953. {
  3954. DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Determineallanalysisrlete.text")+"?", PdnResources.GetString("Menu.alert.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
  3955. if (dr == DialogResult.OK)
  3956. {
  3957. for (int i = 0; i < this.listView2.SelectedItems.Count; i++)
  3958. {
  3959. string tableName = this.listView2.SelectedItems[i].Name;
  3960. foreach (DataTable dt in resultTableList)
  3961. {
  3962. if (dt.TableName.Equals(tableName))
  3963. {
  3964. resultTableList.Remove(dt);
  3965. break;
  3966. }
  3967. }
  3968. if (bitDic.ContainsKey(tableName))
  3969. bitDic.Remove(tableName);
  3970. }
  3971. foreach (ListViewItem item in this.listView2.Items)
  3972. {
  3973. if (item.Selected)
  3974. this.listView2.Items.Remove(item);
  3975. }
  3976. RefreshDataGridView2();
  3977. }
  3978. }
  3979. }
  3980. #region 参数保存及提取
  3981. /// <summary>
  3982. /// 保存参数的key,value和type
  3983. /// </summary>
  3984. /// <param name="param_key"></param>
  3985. /// <param name="param_value"></param>
  3986. /// <param name="param_type"></param>
  3987. private void saveParamValue(string param_key, string param_value, int param_type)
  3988. {
  3989. bool foundItem = false;
  3990. if (!this.eachData.ContainsKey(GetImgKey()))
  3991. {
  3992. GrainSizeAnalysisModel analysisItem = new GrainSizeAnalysisModel();
  3993. analysisItem.menuId = this.menuId;
  3994. analysisItem.param_key = param_key;
  3995. analysisItem.param_type = param_type;
  3996. analysisItem.param_value = param_value;
  3997. analysisItem.setValue();
  3998. analysisItem.ListParam = new List<GrainSizeAnalysisModel>();
  3999. analysisItem.ListParam.Add(analysisItem);
  4000. this.eachData.Add(GetImgKey(), analysisItem);
  4001. }
  4002. foreach (var item in this.eachData[GetImgKey()].ListParam)
  4003. {
  4004. if (item.param_key.Equals(param_key) && item.menuId == this.menuId)
  4005. {
  4006. item.param_value = param_value;
  4007. item.setValue();
  4008. foundItem = true;
  4009. break;
  4010. }
  4011. }
  4012. if (!foundItem)
  4013. {
  4014. GrainSizeAnalysisModel analysisItem = new GrainSizeAnalysisModel();
  4015. analysisItem.menuId = this.menuId;
  4016. analysisItem.param_key = param_key;
  4017. analysisItem.param_type = param_type;
  4018. analysisItem.param_value = param_value;
  4019. analysisItem.setValue();
  4020. this.eachData[GetImgKey()].ListParam.Add(analysisItem);
  4021. }
  4022. }
  4023. /// <summary>
  4024. /// 保存界面中的参数到model
  4025. /// </summary>
  4026. private void saveDialogParamValues()
  4027. {
  4028. saveParamValue(ParamKey_Report, checkBox1.Checked ? "0" : "1", (int)PaintDotNet.Base.Dtryt.Boolean);//报告设置
  4029. saveParamValue(ParamKey_Screen, checkBox3.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//筛选
  4030. saveParamValue(ParamKey_ScreenMin, numericUpDown4 != null ? numericUpDown4.Value.ToString() : "", (int)Base.Dtryt.Decimal);//面积最小值
  4031. saveParamValue(ParamKey_ScreenMax, numericUpDown5 != null ? numericUpDown5.Value.ToString() : "", (int)Base.Dtryt.Decimal);//面积最大值
  4032. saveParamValue(ParamKey_Diameter, checkBox6.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//直径小于20um
  4033. saveParamValue(ParamKey_Colour, checkBox4.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//显示不同颜色
  4034. saveParamValue(ParamKey_AreaRatio, checkBox5.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//显示面积率
  4035. saveParamValue(ParamKey_DecimalPlace, numericUpDown1 != null ? numericUpDown1.Value.ToString() : "", (int)Base.Dtryt.Decimal);//保留小数位数
  4036. saveParamValue(ParamKey_PanelColour1, colour != null ? colour[ParamKey_PanelColour1].ToArgb().ToString() : Color.Orange.ToArgb().ToString(), (int)PaintDotNet.Base.Dtryt.Color);//不同区间颜色
  4037. saveParamValue(ParamKey_PanelColour2, colour != null ? colour[ParamKey_PanelColour2].ToArgb().ToString() : Color.Blue.ToArgb().ToString(), (int)PaintDotNet.Base.Dtryt.Color);//不同区间颜色
  4038. saveParamValue(ParamKey_PanelColour3, colour != null ? colour[ParamKey_PanelColour3].ToArgb().ToString() : Color.Green.ToArgb().ToString(), (int)PaintDotNet.Base.Dtryt.Color);//不同区间颜色
  4039. saveParamValue(ParamKey_PanelColour4, colour != null ? colour[ParamKey_PanelColour4].ToArgb().ToString() : Color.Pink.ToArgb().ToString(), (int)PaintDotNet.Base.Dtryt.Color);//不同区间颜色
  4040. saveParamValue(ParamKey_PanelColour5, colour != null ? colour[ParamKey_PanelColour5].ToArgb().ToString() : Color.Violet.ToArgb().ToString(), (int)PaintDotNet.Base.Dtryt.Color);//不同区间颜色
  4041. saveParamValue(ParamKey_PanelColour6, colour != null ? colour[ParamKey_PanelColour6].ToArgb().ToString() : Color.Yellow.ToArgb().ToString(), (int)PaintDotNet.Base.Dtryt.Color);//不同区间颜色
  4042. saveParamValue(ParamKey_PanelColour7, colour != null ? colour[ParamKey_PanelColour7].ToArgb().ToString() : Color.Bisque.ToArgb().ToString(), (int)PaintDotNet.Base.Dtryt.Color);//不同区间颜色
  4043. saveParamValue(ParamKey_PanelColour8, colour != null ? colour[ParamKey_PanelColour8].ToArgb().ToString() : Color.BlueViolet.ToArgb().ToString(), (int)PaintDotNet.Base.Dtryt.Color);//不同区间颜色
  4044. saveParamValue(ParamKey_FontSize, colourFont != null ? colourFont.Keys.First() : "12", (int)Base.Dtryt.Interger);//字体大小
  4045. saveParamValue(ParamKey_FontColour, colour != null ? colourFont.Values.First().ToArgb().ToString() : Color.Black.ToArgb().ToString(), (int)PaintDotNet.Base.Dtryt.Color);//字体颜色
  4046. }
  4047. /// <summary>
  4048. /// 获取保存的参数
  4049. /// </summary>
  4050. private void GetListParamModel()
  4051. {
  4052. if (this.eachData.ContainsKey(GetImgKey()) && this.eachData[GetImgKey()] != null)
  4053. {
  4054. for (int i = 0; i < this.eachData[GetImgKey()].ListParam.Count; i++)
  4055. {
  4056. switch (this.eachData[GetImgKey()].ListParam[i].param_key)
  4057. {
  4058. case ParamKey_Report:
  4059. checkBox1.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
  4060. break;
  4061. case ParamKey_Screen:
  4062. checkBox3.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
  4063. break;
  4064. case ParamKey_ScreenMin:
  4065. areaMin = decimal.Parse(this.eachData[GetImgKey()].ListParam[i].param_value);
  4066. break;
  4067. case ParamKey_ScreenMax:
  4068. areaMax = decimal.Parse(this.eachData[GetImgKey()].ListParam[i].param_value);
  4069. break;
  4070. case ParamKey_Diameter:
  4071. checkBox6.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
  4072. break;
  4073. case ParamKey_Colour:
  4074. checkBox4.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
  4075. break;
  4076. case ParamKey_AreaRatio:
  4077. checkBox5.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
  4078. break;
  4079. case ParamKey_DecimalPlace:
  4080. numericUpDown1.Value = decimal.Parse(this.eachData[GetImgKey()].ListParam[i].param_value);
  4081. break;
  4082. case ParamKey_PanelColour1:
  4083. colour.Remove(ParamKey_PanelColour1);
  4084. colour.Add(ParamKey_PanelColour1, Color.FromArgb((int)this.eachData[GetImgKey()].ListParam[i].value));
  4085. break;
  4086. case ParamKey_PanelColour2:
  4087. colour.Remove(ParamKey_PanelColour2);
  4088. colour.Add(ParamKey_PanelColour2, Color.FromArgb((int)this.eachData[GetImgKey()].ListParam[i].value));
  4089. break;
  4090. case ParamKey_PanelColour3:
  4091. colour.Remove(ParamKey_PanelColour3);
  4092. colour.Add(ParamKey_PanelColour3, Color.FromArgb((int)this.eachData[GetImgKey()].ListParam[i].value));
  4093. break;
  4094. case ParamKey_PanelColour4:
  4095. colour.Remove(ParamKey_PanelColour4);
  4096. colour.Add(ParamKey_PanelColour4, Color.FromArgb((int)this.eachData[GetImgKey()].ListParam[i].value));
  4097. break;
  4098. case ParamKey_PanelColour5:
  4099. colour.Remove(ParamKey_PanelColour5);
  4100. colour.Add(ParamKey_PanelColour5, Color.FromArgb((int)this.eachData[GetImgKey()].ListParam[i].value));
  4101. break;
  4102. case ParamKey_PanelColour6:
  4103. colour.Remove(ParamKey_PanelColour6);
  4104. colour.Add(ParamKey_PanelColour6, Color.FromArgb((int)this.eachData[GetImgKey()].ListParam[i].value));
  4105. break;
  4106. case ParamKey_PanelColour7:
  4107. colour.Remove(ParamKey_PanelColour7);
  4108. colour.Add(ParamKey_PanelColour7, Color.FromArgb((int)this.eachData[GetImgKey()].ListParam[i].value));
  4109. break;
  4110. case ParamKey_PanelColour8:
  4111. colour.Remove(ParamKey_PanelColour8);
  4112. colour.Add(ParamKey_PanelColour8, Color.FromArgb((int)this.eachData[GetImgKey()].ListParam[i].value));
  4113. break;
  4114. case ParamKey_FontSize:
  4115. fontSize = this.eachData[GetImgKey()].ListParam[i].value.ToString();
  4116. break;
  4117. case ParamKey_FontColour:
  4118. fontColour = Color.FromArgb((int)this.eachData[GetImgKey()].ListParam[i].value);
  4119. break;
  4120. }
  4121. }
  4122. colourFont.Clear();
  4123. colourFont.Add(fontSize, fontColour);
  4124. }
  4125. }
  4126. /// <summary>
  4127. /// 获取XML保存的参数
  4128. /// </summary>
  4129. private void GetXmlParameter()
  4130. {
  4131. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GrainSizeAnalyze\\GrainSizeAnalysisModel.xml";
  4132. GrainSizeAnalysisModel analysisModelXml = XmlSerializeHelper.DESerializer<GrainSizeAnalysisModel>(FileOperationHelper.ReadStringFromFile(filePath, System.IO.FileMode.Open));
  4133. for (int i = 0; i < listView1.Items.Count; i++)
  4134. {
  4135. if (this.eachData.ContainsKey(listView1.Items[i].Index.ToString()))
  4136. {
  4137. this.eachData[listView1.Items[i].Index.ToString()] = analysisModelXml.cloneListParamModel(this.menuId);
  4138. }
  4139. else
  4140. {
  4141. this.eachData.Add(listView1.Items[i].Index.ToString(), analysisModelXml.cloneListParamModel(this.menuId));
  4142. }
  4143. }
  4144. foreach (var item in this.eachData[GetImgKey()].ListParam)
  4145. item.setValue();
  4146. }
  4147. /// <summary>
  4148. /// 保存参数,防止没有图片
  4149. /// </summary>
  4150. private void NullKey()
  4151. {
  4152. GrainSizeAnalysisModel grainsizeanalysismodel = new GrainSizeAnalysisModel();
  4153. grainsizeanalysismodel.ListParam = new List<GrainSizeAnalysisModel>();
  4154. this.eachData.Add("null", grainsizeanalysismodel);
  4155. }
  4156. private string GetImgKey()
  4157. {
  4158. string key = this.listView1.FocusedItem != null ? this.listView1.FocusedItem.Index.ToString() : "null";
  4159. return key;
  4160. }
  4161. #endregion
  4162. private void button4_Click(object sender, EventArgs e)
  4163. {
  4164. if (this.listView1.FocusedItem == null)
  4165. {
  4166. return;
  4167. }
  4168. binaryClass.saveParams();
  4169. binaryClass.applyToAll(this.imageList1.Images.Keys, this.imageList1.Images.Keys[int.Parse(GetImgKey())]);
  4170. saveDialogParamValues();
  4171. GrainSizeAnalysisModel data = new GrainSizeAnalysisModel();
  4172. if (eachData.ContainsKey(GetImgKey()))
  4173. {
  4174. data = eachData[GetImgKey()];
  4175. }
  4176. for (int i = 0; i < listView1.Items.Count; i++)
  4177. {
  4178. eachData[i.ToString()] = data.cloneListParamModel(this.menuId);
  4179. this.listView1.EnsureVisible(i);
  4180. this.listView1.Items[i].Focused = true;
  4181. this.listView1.Items[i].Selected = true;
  4182. }
  4183. }
  4184. private bool blSaveAll = false;
  4185. private void button3_Click(object sender, EventArgs e)
  4186. {
  4187. if (this.listView1.FocusedItem == null)
  4188. {
  4189. return;
  4190. }
  4191. if (eachData.Count - 1 != listView1.Items.Count)
  4192. {
  4193. MessageBox.Show("请先点击应用全部!");
  4194. return;
  4195. }
  4196. saveDialogParamValues();
  4197. int current = int.Parse(GetImgKey());
  4198. for (int i = 0; i < listView1.Items.Count; i++)
  4199. {
  4200. this.listView1.EnsureVisible(i);
  4201. this.listView1.Items[i].Focused = true;
  4202. this.listView1.Items[i].Selected = true;
  4203. this.button2.PerformClick();
  4204. blSaveAll = true;
  4205. }
  4206. this.listView1.EnsureVisible(current);
  4207. this.listView1.Items[current].Focused = true;
  4208. this.listView1.Items[current].Selected = true;
  4209. blSaveAll = false;
  4210. }
  4211. private void listView1_MouseDown(object sender, MouseEventArgs e)
  4212. {
  4213. if (this.listView1.FocusedItem != null)
  4214. saveDialogParamValues();
  4215. }
  4216. #region [脚本相关]
  4217. private void getValue(string key, object value)
  4218. {
  4219. switch (key)
  4220. {
  4221. case "parameter1":
  4222. checkBox3.Checked = Convert.ToBoolean(value);
  4223. break;
  4224. case "parameter2":
  4225. int min = Convert.ToInt32(value);
  4226. decimal minDec = Convert.ToDecimal(value);
  4227. if (bcBinaryChecked())
  4228. {
  4229. if (trackBar2.Minimum > min || trackBar2.Maximum < min)
  4230. {
  4231. trackBar2.Value = trackBar2.Minimum;
  4232. }
  4233. else
  4234. {
  4235. trackBar2.Value = min;
  4236. }
  4237. if (numericUpDown4.Minimum > minDec || numericUpDown4.Maximum < minDec)
  4238. {
  4239. numericUpDown4.Value = numericUpDown4.Minimum;
  4240. }
  4241. else
  4242. {
  4243. numericUpDown4.Value = minDec;
  4244. }
  4245. }
  4246. break;
  4247. case "parameter3":
  4248. int max = Convert.ToInt32(value);
  4249. decimal maxDec = Convert.ToDecimal(value);
  4250. if (bcBinaryChecked())
  4251. {
  4252. if (trackBar4.Minimum > max || trackBar4.Maximum < max)
  4253. {
  4254. trackBar4.Value = trackBar4.Maximum;
  4255. }
  4256. else
  4257. {
  4258. trackBar4.Value = max;
  4259. }
  4260. if (numericUpDown5.Minimum > maxDec || numericUpDown5.Maximum < maxDec)
  4261. {
  4262. numericUpDown5.Value = numericUpDown5.Maximum;
  4263. }
  4264. else
  4265. {
  4266. numericUpDown5.Value = maxDec;
  4267. }
  4268. }
  4269. break;
  4270. case "parameter4":
  4271. checkBox6.Checked = Convert.ToBoolean(value);
  4272. break;
  4273. case "parameter5":
  4274. checkBox4.Checked = Convert.ToBoolean(value);
  4275. break;
  4276. case "parameter6":
  4277. checkBox5.Checked = Convert.ToBoolean(value);
  4278. break;
  4279. case "parameter7":
  4280. fontSize = value.ToString();
  4281. colourFont.Clear();
  4282. colourFont.Add(fontSize, Color.Black);
  4283. break;
  4284. case "parameter8":
  4285. fontColour = Color.FromArgb((int)value);
  4286. if (colourFont.ContainsKey(fontSize))
  4287. {
  4288. colourFont[fontSize] = fontColour;
  4289. }
  4290. else
  4291. {
  4292. colourFont.Add("10", fontColour);
  4293. }
  4294. this.documentWorkspace.Refresh();
  4295. break;
  4296. case "parameter9":
  4297. if (colour.ContainsKey("panelColour1"))
  4298. {
  4299. colour["panelColour1"] = Color.FromArgb((int)value);
  4300. }
  4301. else
  4302. {
  4303. colour.Add("panelColour1", Color.FromArgb((int)value));
  4304. }
  4305. break;
  4306. case "parameter10":
  4307. if (colour.ContainsKey("panelColour2"))
  4308. {
  4309. colour["panelColour2"] = Color.FromArgb((int)value);
  4310. }
  4311. else
  4312. {
  4313. colour.Add("panelColour2", Color.FromArgb((int)value));
  4314. }
  4315. break;
  4316. case "parameter11":
  4317. if (colour.ContainsKey("panelColour3"))
  4318. {
  4319. colour["panelColour3"] = Color.FromArgb((int)value);
  4320. }
  4321. else
  4322. {
  4323. colour.Add("panelColour3", Color.FromArgb((int)value));
  4324. }
  4325. break;
  4326. case "parameter12":
  4327. if (colour.ContainsKey("panelColour4"))
  4328. {
  4329. colour["panelColour4"] = Color.FromArgb((int)value);
  4330. }
  4331. else
  4332. {
  4333. colour.Add("panelColour4", Color.FromArgb((int)value));
  4334. }
  4335. break;
  4336. case "parameter13":
  4337. if (colour.ContainsKey("panelColour5"))
  4338. {
  4339. colour["panelColour5"] = Color.FromArgb((int)value);
  4340. }
  4341. else
  4342. {
  4343. colour.Add("panelColour5", Color.FromArgb((int)value));
  4344. }
  4345. break;
  4346. case "parameter14":
  4347. if (colour.ContainsKey("panelColour6"))
  4348. {
  4349. colour["panelColour6"] = Color.FromArgb((int)value);
  4350. }
  4351. else
  4352. {
  4353. colour.Add("panelColour6", Color.FromArgb((int)value));
  4354. }
  4355. break;
  4356. case "parameter15":
  4357. if (colour.ContainsKey("panelColour7"))
  4358. {
  4359. colour["panelColour7"] = Color.FromArgb((int)value);
  4360. }
  4361. else
  4362. {
  4363. colour.Add("panelColour7", Color.FromArgb((int)value));
  4364. }
  4365. break;
  4366. case "parameter16":
  4367. if (colour.ContainsKey("panelColour8"))
  4368. {
  4369. colour["panelColour8"] = Color.FromArgb((int)value);
  4370. }
  4371. else
  4372. {
  4373. colour.Add("panelColour8", Color.FromArgb((int)value));
  4374. }
  4375. break;
  4376. case "OpenWhileExportReport":
  4377. checkBox1.Checked = Convert.ToBoolean(value);
  4378. break;
  4379. case "CalculatorDecimalDigits":
  4380. numericUpDown1.Value = Convert.ToDecimal(value);
  4381. break;
  4382. case "ExportResults":
  4383. isExportResults = Convert.ToBoolean(value);
  4384. break;
  4385. case "ExportReports":
  4386. isExportReports = Convert.ToBoolean(value);
  4387. break;
  4388. case "ExportProjects":
  4389. isExportProjects = Convert.ToBoolean(value);
  4390. break;
  4391. }
  4392. }
  4393. private void startScriptAutomaticAction()
  4394. {
  4395. this.button4.PerformClick();
  4396. this.button3.PerformClick();
  4397. this.button6.Text = PdnResources.GetString("Menu.Cancelshowall.text");
  4398. this.showAll = true;
  4399. RefreshDataGridView2();
  4400. if (isExportResults)//导出结果
  4401. this.button9.PerformClick();
  4402. if (isExportReports)//生成报告
  4403. this.button8.PerformClick();
  4404. if (isExportProjects)//导出项目
  4405. this.button1.PerformClick();
  4406. this.appWorkspace.ScriptAutomatic = false;
  4407. this.Close();
  4408. }
  4409. #endregion
  4410. #region [脚本录制]
  4411. private void getScriptRecording()
  4412. {
  4413. string className = InvariantData.path_Action + ".Action" + menuId;
  4414. ParamObject param = (ParamObject)System.Reflection.Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
  4415. List<Args> args = param.Lists;
  4416. foreach (var item in args)
  4417. {
  4418. item.value = setScriptRecording(item.key);
  4419. }
  4420. //找出二值相关参数 进行赋值
  4421. List<Args> isNullList = args.Where(m => m.value == null).ToList();
  4422. foreach (var item in isNullList)
  4423. {
  4424. item.value = binaryClass.setScriptRecording(item.key);
  4425. }
  4426. appWorkspace.SetScriptStartRecording(this.menuId, menuName, args);
  4427. }
  4428. private object setScriptRecording(string key)
  4429. {
  4430. object value = null;
  4431. switch (key)
  4432. {
  4433. case "parameter1":
  4434. value = checkBox3.Checked;
  4435. break;
  4436. case "parameter2":
  4437. value = trackBar2.Value;
  4438. break;
  4439. case "parameter3":
  4440. value = trackBar4.Value;
  4441. break;
  4442. case "parameter4":
  4443. value = checkBox6.Checked;
  4444. break;
  4445. case "parameter5":
  4446. value = checkBox4.Checked;
  4447. break;
  4448. case "parameter6":
  4449. value = checkBox5.Checked;
  4450. break;
  4451. case "parameter7":
  4452. value = colourFont.First().Key;
  4453. break;
  4454. case "parameter8":
  4455. value = colourFont.First().Value.ToArgb();
  4456. break;
  4457. case "parameter9":
  4458. if (colour.ContainsKey("panelColour1"))
  4459. {
  4460. value = colour["panelColour1"].ToArgb();
  4461. }
  4462. else
  4463. {
  4464. value = Color.Orange.ToArgb();
  4465. }
  4466. break;
  4467. case "parameter10":
  4468. if (colour.ContainsKey("panelColour2"))
  4469. {
  4470. value = colour["panelColour2"].ToArgb();
  4471. }
  4472. else
  4473. {
  4474. value = Color.Blue.ToArgb();
  4475. }
  4476. break;
  4477. case "parameter11":
  4478. if (colour.ContainsKey("panelColour3"))
  4479. {
  4480. value = colour["panelColour3"].ToArgb();
  4481. }
  4482. else
  4483. {
  4484. value = Color.Green.ToArgb();
  4485. }
  4486. break;
  4487. case "parameter12":
  4488. if (colour.ContainsKey("panelColour4"))
  4489. {
  4490. value = colour["panelColour4"].ToArgb();
  4491. }
  4492. else
  4493. {
  4494. value = Color.Pink.ToArgb();
  4495. }
  4496. break;
  4497. case "parameter13":
  4498. if (colour.ContainsKey("panelColour5"))
  4499. {
  4500. value = colour["panelColour5"].ToArgb();
  4501. }
  4502. else
  4503. {
  4504. value = Color.Purple.ToArgb();
  4505. }
  4506. break;
  4507. case "parameter14":
  4508. if (colour.ContainsKey("panelColour6"))
  4509. {
  4510. value = colour["panelColour6"].ToArgb();
  4511. }
  4512. else
  4513. {
  4514. value = Color.Yellow.ToArgb();
  4515. }
  4516. break;
  4517. case "parameter15":
  4518. if (colour.ContainsKey("panelColour7"))
  4519. {
  4520. value = colour["panelColour7"].ToArgb();
  4521. }
  4522. else
  4523. {
  4524. value = Color.Bisque.ToArgb();
  4525. }
  4526. break;
  4527. case "parameter16":
  4528. if (colour.ContainsKey("panelColour8"))
  4529. {
  4530. value = colour["panelColour8"].ToArgb();
  4531. }
  4532. else
  4533. {
  4534. value = Color.BlueViolet.ToArgb();
  4535. }
  4536. break;
  4537. case "OpenWhileExportReport":
  4538. value = checkBox1.Checked;
  4539. break;
  4540. case "CalculatorDecimalDigits":
  4541. value = numericUpDown1.Value;
  4542. break;
  4543. case "ExportResults":
  4544. value = isExportResults;
  4545. break;
  4546. case "ExportReports":
  4547. value = isExportReports;
  4548. break;
  4549. case "ExportProjects":
  4550. value = isExportProjects;
  4551. break;
  4552. }
  4553. return value;
  4554. }
  4555. #endregion
  4556. }
  4557. }