CharacteristicsOfRockParticlesDialog.cs 238 KB

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