CharacteristicsOfRockParticlesDialog.cs 238 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710
  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. /// 选中图片的mat
  86. /// </summary>
  87. private Mat imageMat;
  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 dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle();
  1236. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle();
  1237. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle();
  1238. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle();
  1239. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle();
  1240. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle();
  1241. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle();
  1242. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle();
  1243. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle();
  1244. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle41 = new System.Windows.Forms.DataGridViewCellStyle();
  1245. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle42 = new System.Windows.Forms.DataGridViewCellStyle();
  1246. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle43 = new System.Windows.Forms.DataGridViewCellStyle();
  1247. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle44 = new System.Windows.Forms.DataGridViewCellStyle();
  1248. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle45 = new System.Windows.Forms.DataGridViewCellStyle();
  1249. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle46 = new System.Windows.Forms.DataGridViewCellStyle();
  1250. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle47 = new System.Windows.Forms.DataGridViewCellStyle();
  1251. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle48 = new System.Windows.Forms.DataGridViewCellStyle();
  1252. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle49 = new System.Windows.Forms.DataGridViewCellStyle();
  1253. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle50 = new System.Windows.Forms.DataGridViewCellStyle();
  1254. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle51 = new System.Windows.Forms.DataGridViewCellStyle();
  1255. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle52 = new System.Windows.Forms.DataGridViewCellStyle();
  1256. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle53 = new System.Windows.Forms.DataGridViewCellStyle();
  1257. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle54 = new System.Windows.Forms.DataGridViewCellStyle();
  1258. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle55 = new System.Windows.Forms.DataGridViewCellStyle();
  1259. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle56 = new System.Windows.Forms.DataGridViewCellStyle();
  1260. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle57 = new System.Windows.Forms.DataGridViewCellStyle();
  1261. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle58 = new System.Windows.Forms.DataGridViewCellStyle();
  1262. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle59 = new System.Windows.Forms.DataGridViewCellStyle();
  1263. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle60 = new System.Windows.Forms.DataGridViewCellStyle();
  1264. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle61 = new System.Windows.Forms.DataGridViewCellStyle();
  1265. System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle62 = new System.Windows.Forms.DataGridViewCellStyle();
  1266. this.groupBox1 = new System.Windows.Forms.GroupBox();
  1267. this.button3 = new System.Windows.Forms.Button();
  1268. this.button5 = new System.Windows.Forms.Button();
  1269. this.button2 = new System.Windows.Forms.Button();
  1270. this.checkBox2 = new System.Windows.Forms.CheckBox();
  1271. this.button1 = new System.Windows.Forms.Button();
  1272. this.groupBox2 = new System.Windows.Forms.GroupBox();
  1273. this.listView1 = new System.Windows.Forms.ListView();
  1274. this.imageList1 = new System.Windows.Forms.ImageList(this.components);
  1275. this.groupBox7 = new System.Windows.Forms.GroupBox();
  1276. this.groupBox3 = new System.Windows.Forms.GroupBox();
  1277. this.checkBox4 = new System.Windows.Forms.CheckBox();
  1278. this.checkBox3 = new System.Windows.Forms.CheckBox();
  1279. this.checkBox1 = new System.Windows.Forms.CheckBox();
  1280. this.groupBox4 = new System.Windows.Forms.GroupBox();
  1281. this.panel2 = new System.Windows.Forms.Panel();
  1282. this.panel1 = new System.Windows.Forms.Panel();
  1283. this.numericUpDown3 = new System.Windows.Forms.NumericUpDown();
  1284. this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
  1285. this.label4 = new System.Windows.Forms.Label();
  1286. this.label3 = new System.Windows.Forms.Label();
  1287. this.label2 = new System.Windows.Forms.Label();
  1288. this.label1 = new System.Windows.Forms.Label();
  1289. this.checkBox6 = new System.Windows.Forms.CheckBox();
  1290. this.checkBox5 = new System.Windows.Forms.CheckBox();
  1291. this.groupBox5 = new System.Windows.Forms.GroupBox();
  1292. this.dataGridView3 = new System.Windows.Forms.DataGridView();
  1293. this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1294. this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1295. this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1296. this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1297. this.dataGridView1 = new System.Windows.Forms.DataGridView();
  1298. this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1299. this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1300. this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1301. this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1302. this.groupBox8 = new System.Windows.Forms.GroupBox();
  1303. this.dataGridView2 = new System.Windows.Forms.DataGridView();
  1304. this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1305. this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1306. this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1307. this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1308. this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1309. this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1310. this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1311. this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1312. this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1313. this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1314. this.Column13 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1315. this.Column14 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1316. this.Column15 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1317. this.button4 = new System.Windows.Forms.Button();
  1318. this.listView2 = new System.Windows.Forms.ListView();
  1319. this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
  1320. this.button16 = new System.Windows.Forms.Button();
  1321. this.label5 = new System.Windows.Forms.Label();
  1322. this.button14 = new System.Windows.Forms.Button();
  1323. this.button13 = new System.Windows.Forms.Button();
  1324. this.dataGridView4 = new System.Windows.Forms.DataGridView();
  1325. this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1326. this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1327. this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1328. this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1329. this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1330. this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
  1331. this.button12 = new System.Windows.Forms.Button();
  1332. this.button11 = 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. // button3
  1364. //
  1365. this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1366. this.button3.Location = new System.Drawing.Point(991, 14);
  1367. this.button3.Name = "button3";
  1368. this.button3.Size = new System.Drawing.Size(84, 30);
  1369. this.button3.TabIndex = 21;
  1370. this.button3.Text = "保存全部";
  1371. this.button3.UseVisualStyleBackColor = false;
  1372. this.button3.Click += new System.EventHandler(this.button3_Click);
  1373. //
  1374. // button5
  1375. //
  1376. this.button5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1377. this.button5.Location = new System.Drawing.Point(811, 14);
  1378. this.button5.Name = "button5";
  1379. this.button5.Size = new System.Drawing.Size(84, 30);
  1380. this.button5.TabIndex = 20;
  1381. this.button5.Text = "应用全部";
  1382. this.button5.UseVisualStyleBackColor = false;
  1383. this.button5.Click += new System.EventHandler(this.button5_Click);
  1384. //
  1385. // button2
  1386. //
  1387. this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1388. this.button2.BackColor = System.Drawing.SystemColors.Control;
  1389. this.button2.Location = new System.Drawing.Point(901, 14);
  1390. this.button2.Name = "button2";
  1391. this.button2.Size = new System.Drawing.Size(84, 30);
  1392. this.button2.TabIndex = 3;
  1393. this.button2.UseVisualStyleBackColor = false;
  1394. this.button2.Click += new System.EventHandler(this.button2_Click);
  1395. //
  1396. // checkBox2
  1397. //
  1398. this.checkBox2.AutoSize = true;
  1399. this.checkBox2.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
  1400. this.checkBox2.Location = new System.Drawing.Point(105, 20);
  1401. this.checkBox2.Name = "checkBox2";
  1402. this.checkBox2.Size = new System.Drawing.Size(15, 14);
  1403. this.checkBox2.TabIndex = 2;
  1404. this.checkBox2.UseVisualStyleBackColor = true;
  1405. //
  1406. // button1
  1407. //
  1408. this.button1.BackColor = System.Drawing.SystemColors.Control;
  1409. this.button1.Location = new System.Drawing.Point(15, 14);
  1410. this.button1.Name = "button1";
  1411. this.button1.Size = new System.Drawing.Size(84, 30);
  1412. this.button1.TabIndex = 0;
  1413. this.button1.UseVisualStyleBackColor = false;
  1414. this.button1.Click += new System.EventHandler(this.button1_Click);
  1415. //
  1416. // groupBox2
  1417. //
  1418. this.groupBox2.Controls.Add(this.listView1);
  1419. this.groupBox2.Location = new System.Drawing.Point(14, 68);
  1420. this.groupBox2.Name = "groupBox2";
  1421. this.groupBox2.Size = new System.Drawing.Size(135, 574);
  1422. this.groupBox2.TabIndex = 7;
  1423. this.groupBox2.TabStop = false;
  1424. //
  1425. // listView1
  1426. //
  1427. this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  1428. | System.Windows.Forms.AnchorStyles.Left)
  1429. | System.Windows.Forms.AnchorStyles.Right)));
  1430. this.listView1.HideSelection = false;
  1431. this.listView1.LargeImageList = this.imageList1;
  1432. this.listView1.Location = new System.Drawing.Point(5, 17);
  1433. this.listView1.MultiSelect = false;
  1434. this.listView1.Name = "listView1";
  1435. this.listView1.Size = new System.Drawing.Size(124, 551);
  1436. this.listView1.TabIndex = 0;
  1437. this.listView1.UseCompatibleStateImageBehavior = false;
  1438. this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
  1439. this.listView1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseDown);
  1440. this.listView1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseUp);
  1441. //
  1442. // imageList1
  1443. //
  1444. this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
  1445. this.imageList1.ImageSize = new System.Drawing.Size(64, 64);
  1446. this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
  1447. //
  1448. // groupBox7
  1449. //
  1450. this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  1451. | System.Windows.Forms.AnchorStyles.Right)));
  1452. this.groupBox7.Location = new System.Drawing.Point(521, 68);
  1453. this.groupBox7.Name = "groupBox7";
  1454. this.groupBox7.Size = new System.Drawing.Size(580, 574);
  1455. this.groupBox7.TabIndex = 20;
  1456. this.groupBox7.TabStop = false;
  1457. //
  1458. // groupBox3
  1459. //
  1460. this.groupBox3.Controls.Add(this.checkBox4);
  1461. this.groupBox3.Controls.Add(this.checkBox3);
  1462. this.groupBox3.Controls.Add(this.checkBox1);
  1463. this.groupBox3.Location = new System.Drawing.Point(155, 366);
  1464. this.groupBox3.Name = "groupBox3";
  1465. this.groupBox3.Size = new System.Drawing.Size(360, 62);
  1466. this.groupBox3.TabIndex = 21;
  1467. this.groupBox3.TabStop = false;
  1468. //
  1469. // checkBox4
  1470. //
  1471. this.checkBox4.AutoSize = true;
  1472. this.checkBox4.Location = new System.Drawing.Point(102, 42);
  1473. this.checkBox4.Name = "checkBox4";
  1474. this.checkBox4.Size = new System.Drawing.Size(15, 14);
  1475. this.checkBox4.TabIndex = 2;
  1476. this.checkBox4.UseVisualStyleBackColor = true;
  1477. this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged);
  1478. this.checkBox4.Click += new System.EventHandler(this.checkBox4_Click);
  1479. //
  1480. // checkBox3
  1481. //
  1482. this.checkBox3.AutoSize = true;
  1483. this.checkBox3.Location = new System.Drawing.Point(18, 42);
  1484. this.checkBox3.Name = "checkBox3";
  1485. this.checkBox3.Size = new System.Drawing.Size(15, 14);
  1486. this.checkBox3.TabIndex = 1;
  1487. this.checkBox3.UseVisualStyleBackColor = true;
  1488. this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged);
  1489. this.checkBox3.Click += new System.EventHandler(this.checkBox3_Click);
  1490. //
  1491. // checkBox1
  1492. //
  1493. this.checkBox1.AutoSize = true;
  1494. this.checkBox1.Location = new System.Drawing.Point(18, 20);
  1495. this.checkBox1.Name = "checkBox1";
  1496. this.checkBox1.Size = new System.Drawing.Size(15, 14);
  1497. this.checkBox1.TabIndex = 0;
  1498. this.checkBox1.UseVisualStyleBackColor = true;
  1499. this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
  1500. //
  1501. // groupBox4
  1502. //
  1503. this.groupBox4.Controls.Add(this.panel2);
  1504. this.groupBox4.Controls.Add(this.panel1);
  1505. this.groupBox4.Controls.Add(this.numericUpDown3);
  1506. this.groupBox4.Controls.Add(this.numericUpDown2);
  1507. this.groupBox4.Controls.Add(this.label4);
  1508. this.groupBox4.Controls.Add(this.label3);
  1509. this.groupBox4.Controls.Add(this.label2);
  1510. this.groupBox4.Controls.Add(this.label1);
  1511. this.groupBox4.Controls.Add(this.checkBox6);
  1512. this.groupBox4.Controls.Add(this.checkBox5);
  1513. this.groupBox4.Location = new System.Drawing.Point(155, 434);
  1514. this.groupBox4.Name = "groupBox4";
  1515. this.groupBox4.Size = new System.Drawing.Size(360, 62);
  1516. this.groupBox4.TabIndex = 22;
  1517. this.groupBox4.TabStop = false;
  1518. //
  1519. // panel2
  1520. //
  1521. this.panel2.BackColor = System.Drawing.Color.Yellow;
  1522. this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  1523. this.panel2.Location = new System.Drawing.Point(266, 38);
  1524. this.panel2.Name = "panel2";
  1525. this.panel2.Size = new System.Drawing.Size(74, 21);
  1526. this.panel2.TabIndex = 12;
  1527. this.panel2.BackColorChanged += new System.EventHandler(this.panel2_BackColorChanged);
  1528. this.panel2.Click += new System.EventHandler(this.panel2_Click);
  1529. //
  1530. // panel1
  1531. //
  1532. this.panel1.BackColor = System.Drawing.Color.Blue;
  1533. this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  1534. this.panel1.Location = new System.Drawing.Point(266, 14);
  1535. this.panel1.Name = "panel1";
  1536. this.panel1.Size = new System.Drawing.Size(74, 21);
  1537. this.panel1.TabIndex = 11;
  1538. this.panel1.BackColorChanged += new System.EventHandler(this.panel1_BackColorChanged);
  1539. this.panel1.Click += new System.EventHandler(this.panel1_Click);
  1540. //
  1541. // numericUpDown3
  1542. //
  1543. this.numericUpDown3.Location = new System.Drawing.Point(165, 40);
  1544. this.numericUpDown3.Maximum = new decimal(new int[] {
  1545. 49000,
  1546. 0,
  1547. 0,
  1548. 0});
  1549. this.numericUpDown3.Name = "numericUpDown3";
  1550. this.numericUpDown3.Size = new System.Drawing.Size(54, 21);
  1551. this.numericUpDown3.TabIndex = 10;
  1552. this.numericUpDown3.ValueChanged += new System.EventHandler(this.numericUpDown3_ValueChanged);
  1553. //
  1554. // numericUpDown2
  1555. //
  1556. this.numericUpDown2.Location = new System.Drawing.Point(165, 15);
  1557. this.numericUpDown2.Maximum = new decimal(new int[] {
  1558. 49000,
  1559. 0,
  1560. 0,
  1561. 0});
  1562. this.numericUpDown2.Name = "numericUpDown2";
  1563. this.numericUpDown2.Size = new System.Drawing.Size(54, 21);
  1564. this.numericUpDown2.TabIndex = 9;
  1565. this.numericUpDown2.ValueChanged += new System.EventHandler(this.numericUpDown2_ValueChanged);
  1566. //
  1567. // label4
  1568. //
  1569. this.label4.AutoSize = true;
  1570. this.label4.Location = new System.Drawing.Point(226, 43);
  1571. this.label4.Name = "label4";
  1572. this.label4.Size = new System.Drawing.Size(0, 12);
  1573. this.label4.TabIndex = 8;
  1574. //
  1575. // label3
  1576. //
  1577. this.label3.AutoSize = true;
  1578. this.label3.Location = new System.Drawing.Point(226, 18);
  1579. this.label3.Name = "label3";
  1580. this.label3.Size = new System.Drawing.Size(0, 12);
  1581. this.label3.TabIndex = 7;
  1582. //
  1583. // label2
  1584. //
  1585. this.label2.AutoSize = true;
  1586. this.label2.Location = new System.Drawing.Point(128, 43);
  1587. this.label2.Name = "label2";
  1588. this.label2.Size = new System.Drawing.Size(0, 12);
  1589. this.label2.TabIndex = 6;
  1590. //
  1591. // label1
  1592. //
  1593. this.label1.AutoSize = true;
  1594. this.label1.Location = new System.Drawing.Point(128, 19);
  1595. this.label1.Name = "label1";
  1596. this.label1.Size = new System.Drawing.Size(0, 12);
  1597. this.label1.TabIndex = 5;
  1598. //
  1599. // checkBox6
  1600. //
  1601. this.checkBox6.AutoSize = true;
  1602. this.checkBox6.Location = new System.Drawing.Point(18, 42);
  1603. this.checkBox6.Name = "checkBox6";
  1604. this.checkBox6.Size = new System.Drawing.Size(15, 14);
  1605. this.checkBox6.TabIndex = 4;
  1606. this.checkBox6.UseVisualStyleBackColor = true;
  1607. this.checkBox6.CheckedChanged += new System.EventHandler(this.checkBox6_CheckedChanged);
  1608. //
  1609. // checkBox5
  1610. //
  1611. this.checkBox5.AutoSize = true;
  1612. this.checkBox5.Location = new System.Drawing.Point(18, 18);
  1613. this.checkBox5.Name = "checkBox5";
  1614. this.checkBox5.Size = new System.Drawing.Size(15, 14);
  1615. this.checkBox5.TabIndex = 3;
  1616. this.checkBox5.UseVisualStyleBackColor = true;
  1617. this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged);
  1618. //
  1619. // groupBox5
  1620. //
  1621. this.groupBox5.Controls.Add(this.dataGridView3);
  1622. this.groupBox5.Controls.Add(this.dataGridView1);
  1623. this.groupBox5.Location = new System.Drawing.Point(155, 502);
  1624. this.groupBox5.Name = "groupBox5";
  1625. this.groupBox5.Size = new System.Drawing.Size(360, 140);
  1626. this.groupBox5.TabIndex = 23;
  1627. this.groupBox5.TabStop = false;
  1628. //
  1629. // dataGridView3
  1630. //
  1631. this.dataGridView3.AllowUserToAddRows = false;
  1632. this.dataGridView3.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
  1633. this.dataGridView3.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
  1634. dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
  1635. dataGridViewCellStyle32.BackColor = System.Drawing.SystemColors.Control;
  1636. dataGridViewCellStyle32.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  1637. dataGridViewCellStyle32.ForeColor = System.Drawing.SystemColors.WindowText;
  1638. dataGridViewCellStyle32.SelectionBackColor = System.Drawing.SystemColors.Highlight;
  1639. dataGridViewCellStyle32.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
  1640. dataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
  1641. this.dataGridView3.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle32;
  1642. this.dataGridView3.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
  1643. this.dataGridView3.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
  1644. this.dataGridViewTextBoxColumn9,
  1645. this.dataGridViewTextBoxColumn10,
  1646. this.dataGridViewTextBoxColumn11,
  1647. this.dataGridViewTextBoxColumn12});
  1648. this.dataGridView3.Location = new System.Drawing.Point(6, 16);
  1649. this.dataGridView3.MultiSelect = false;
  1650. this.dataGridView3.Name = "dataGridView3";
  1651. this.dataGridView3.ReadOnly = true;
  1652. this.dataGridView3.RowHeadersVisible = false;
  1653. this.dataGridView3.RowTemplate.Height = 23;
  1654. this.dataGridView3.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
  1655. this.dataGridView3.Size = new System.Drawing.Size(348, 118);
  1656. this.dataGridView3.TabIndex = 3;
  1657. this.dataGridView3.Visible = false;
  1658. //
  1659. // dataGridViewTextBoxColumn9
  1660. //
  1661. dataGridViewCellStyle33.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
  1662. this.dataGridViewTextBoxColumn9.DefaultCellStyle = dataGridViewCellStyle33;
  1663. this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
  1664. this.dataGridViewTextBoxColumn9.ReadOnly = true;
  1665. //
  1666. // dataGridViewTextBoxColumn10
  1667. //
  1668. dataGridViewCellStyle34.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1669. this.dataGridViewTextBoxColumn10.DefaultCellStyle = dataGridViewCellStyle34;
  1670. this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
  1671. this.dataGridViewTextBoxColumn10.ReadOnly = true;
  1672. //
  1673. // dataGridViewTextBoxColumn11
  1674. //
  1675. dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1676. this.dataGridViewTextBoxColumn11.DefaultCellStyle = dataGridViewCellStyle35;
  1677. this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
  1678. this.dataGridViewTextBoxColumn11.ReadOnly = true;
  1679. //
  1680. // dataGridViewTextBoxColumn12
  1681. //
  1682. dataGridViewCellStyle36.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1683. this.dataGridViewTextBoxColumn12.DefaultCellStyle = dataGridViewCellStyle36;
  1684. this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
  1685. this.dataGridViewTextBoxColumn12.ReadOnly = true;
  1686. //
  1687. // dataGridView1
  1688. //
  1689. this.dataGridView1.AllowUserToAddRows = false;
  1690. this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
  1691. this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
  1692. dataGridViewCellStyle37.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
  1693. dataGridViewCellStyle37.BackColor = System.Drawing.SystemColors.Control;
  1694. dataGridViewCellStyle37.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
  1695. dataGridViewCellStyle37.ForeColor = System.Drawing.SystemColors.WindowText;
  1696. dataGridViewCellStyle37.SelectionBackColor = System.Drawing.SystemColors.Highlight;
  1697. dataGridViewCellStyle37.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
  1698. dataGridViewCellStyle37.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
  1699. this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle37;
  1700. this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
  1701. this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
  1702. this.Column11,
  1703. this.dataGridViewTextBoxColumn3,
  1704. this.dataGridViewTextBoxColumn4,
  1705. this.dataGridViewTextBoxColumn5});
  1706. this.dataGridView1.Location = new System.Drawing.Point(6, 16);
  1707. this.dataGridView1.MultiSelect = false;
  1708. this.dataGridView1.Name = "dataGridView1";
  1709. this.dataGridView1.ReadOnly = true;
  1710. this.dataGridView1.RowHeadersVisible = false;
  1711. this.dataGridView1.RowTemplate.Height = 23;
  1712. this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
  1713. this.dataGridView1.Size = new System.Drawing.Size(348, 118);
  1714. this.dataGridView1.TabIndex = 2;
  1715. //
  1716. // Column11
  1717. //
  1718. dataGridViewCellStyle38.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
  1719. this.Column11.DefaultCellStyle = dataGridViewCellStyle38;
  1720. this.Column11.Name = "Column11";
  1721. this.Column11.ReadOnly = true;
  1722. //
  1723. // dataGridViewTextBoxColumn3
  1724. //
  1725. dataGridViewCellStyle39.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1726. this.dataGridViewTextBoxColumn3.DefaultCellStyle = dataGridViewCellStyle39;
  1727. this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
  1728. this.dataGridViewTextBoxColumn3.ReadOnly = true;
  1729. //
  1730. // dataGridViewTextBoxColumn4
  1731. //
  1732. dataGridViewCellStyle40.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1733. this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle40;
  1734. this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
  1735. this.dataGridViewTextBoxColumn4.ReadOnly = true;
  1736. //
  1737. // dataGridViewTextBoxColumn5
  1738. //
  1739. dataGridViewCellStyle41.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1740. this.dataGridViewTextBoxColumn5.DefaultCellStyle = dataGridViewCellStyle41;
  1741. this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
  1742. this.dataGridViewTextBoxColumn5.ReadOnly = true;
  1743. //
  1744. // groupBox8
  1745. //
  1746. this.groupBox8.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  1747. | System.Windows.Forms.AnchorStyles.Left)
  1748. | System.Windows.Forms.AnchorStyles.Right)));
  1749. this.groupBox8.Controls.Add(this.dataGridView2);
  1750. this.groupBox8.Controls.Add(this.button4);
  1751. this.groupBox8.Controls.Add(this.listView2);
  1752. this.groupBox8.Controls.Add(this.numericUpDown1);
  1753. this.groupBox8.Controls.Add(this.button16);
  1754. this.groupBox8.Controls.Add(this.label5);
  1755. this.groupBox8.Controls.Add(this.button14);
  1756. this.groupBox8.Controls.Add(this.button13);
  1757. this.groupBox8.Controls.Add(this.dataGridView4);
  1758. this.groupBox8.Controls.Add(this.button12);
  1759. this.groupBox8.Controls.Add(this.button11);
  1760. this.groupBox8.Location = new System.Drawing.Point(14, 648);
  1761. this.groupBox8.Name = "groupBox8";
  1762. this.groupBox8.Size = new System.Drawing.Size(1087, 273);
  1763. this.groupBox8.TabIndex = 24;
  1764. this.groupBox8.TabStop = false;
  1765. //
  1766. // dataGridView2
  1767. //
  1768. this.dataGridView2.AllowUserToAddRows = false;
  1769. this.dataGridView2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  1770. | System.Windows.Forms.AnchorStyles.Left)
  1771. | System.Windows.Forms.AnchorStyles.Right)));
  1772. this.dataGridView2.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
  1773. this.dataGridView2.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
  1774. dataGridViewCellStyle42.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
  1775. dataGridViewCellStyle42.BackColor = System.Drawing.SystemColors.Control;
  1776. dataGridViewCellStyle42.Font = new System.Drawing.Font("宋体", 9F);
  1777. dataGridViewCellStyle42.ForeColor = System.Drawing.SystemColors.WindowText;
  1778. dataGridViewCellStyle42.SelectionBackColor = System.Drawing.SystemColors.Highlight;
  1779. dataGridViewCellStyle42.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
  1780. dataGridViewCellStyle42.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
  1781. this.dataGridView2.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle42;
  1782. this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
  1783. this.dataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
  1784. this.dataGridViewTextBoxColumn1,
  1785. this.dataGridViewTextBoxColumn2,
  1786. this.dataGridViewTextBoxColumn6,
  1787. this.dataGridViewTextBoxColumn7,
  1788. this.dataGridViewTextBoxColumn8,
  1789. this.Column4,
  1790. this.Column9,
  1791. this.Column10,
  1792. this.Column8,
  1793. this.Column12,
  1794. this.Column13,
  1795. this.Column14,
  1796. this.Column15});
  1797. this.dataGridView2.Location = new System.Drawing.Point(228, 159);
  1798. this.dataGridView2.Name = "dataGridView2";
  1799. this.dataGridView2.ReadOnly = true;
  1800. this.dataGridView2.RowHeadersVisible = false;
  1801. this.dataGridView2.RowTemplate.Height = 23;
  1802. this.dataGridView2.Size = new System.Drawing.Size(693, 108);
  1803. this.dataGridView2.TabIndex = 24;
  1804. //
  1805. // dataGridViewTextBoxColumn1
  1806. //
  1807. dataGridViewCellStyle43.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
  1808. this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle43;
  1809. this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
  1810. this.dataGridViewTextBoxColumn1.ReadOnly = true;
  1811. //
  1812. // dataGridViewTextBoxColumn2
  1813. //
  1814. dataGridViewCellStyle44.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1815. this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle44;
  1816. this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
  1817. this.dataGridViewTextBoxColumn2.ReadOnly = true;
  1818. //
  1819. // dataGridViewTextBoxColumn6
  1820. //
  1821. dataGridViewCellStyle45.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1822. this.dataGridViewTextBoxColumn6.DefaultCellStyle = dataGridViewCellStyle45;
  1823. this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
  1824. this.dataGridViewTextBoxColumn6.ReadOnly = true;
  1825. //
  1826. // dataGridViewTextBoxColumn7
  1827. //
  1828. dataGridViewCellStyle46.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1829. this.dataGridViewTextBoxColumn7.DefaultCellStyle = dataGridViewCellStyle46;
  1830. this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
  1831. this.dataGridViewTextBoxColumn7.ReadOnly = true;
  1832. //
  1833. // dataGridViewTextBoxColumn8
  1834. //
  1835. dataGridViewCellStyle47.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1836. this.dataGridViewTextBoxColumn8.DefaultCellStyle = dataGridViewCellStyle47;
  1837. this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
  1838. this.dataGridViewTextBoxColumn8.ReadOnly = true;
  1839. //
  1840. // Column4
  1841. //
  1842. dataGridViewCellStyle48.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
  1843. this.Column4.DefaultCellStyle = dataGridViewCellStyle48;
  1844. this.Column4.Name = "Column4";
  1845. this.Column4.ReadOnly = true;
  1846. //
  1847. // Column9
  1848. //
  1849. dataGridViewCellStyle49.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1850. this.Column9.DefaultCellStyle = dataGridViewCellStyle49;
  1851. this.Column9.HeaderText = "Φ5";
  1852. this.Column9.Name = "Column9";
  1853. this.Column9.ReadOnly = true;
  1854. //
  1855. // Column10
  1856. //
  1857. dataGridViewCellStyle50.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1858. this.Column10.DefaultCellStyle = dataGridViewCellStyle50;
  1859. this.Column10.HeaderText = "Φ16";
  1860. this.Column10.Name = "Column10";
  1861. this.Column10.ReadOnly = true;
  1862. //
  1863. // Column8
  1864. //
  1865. dataGridViewCellStyle51.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1866. this.Column8.DefaultCellStyle = dataGridViewCellStyle51;
  1867. this.Column8.HeaderText = "Φ25";
  1868. this.Column8.Name = "Column8";
  1869. this.Column8.ReadOnly = true;
  1870. //
  1871. // Column12
  1872. //
  1873. dataGridViewCellStyle52.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1874. this.Column12.DefaultCellStyle = dataGridViewCellStyle52;
  1875. this.Column12.HeaderText = "Φ50";
  1876. this.Column12.Name = "Column12";
  1877. this.Column12.ReadOnly = true;
  1878. //
  1879. // Column13
  1880. //
  1881. dataGridViewCellStyle53.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1882. this.Column13.DefaultCellStyle = dataGridViewCellStyle53;
  1883. this.Column13.HeaderText = "Φ75";
  1884. this.Column13.Name = "Column13";
  1885. this.Column13.ReadOnly = true;
  1886. //
  1887. // Column14
  1888. //
  1889. dataGridViewCellStyle54.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1890. this.Column14.DefaultCellStyle = dataGridViewCellStyle54;
  1891. this.Column14.HeaderText = "Φ84";
  1892. this.Column14.Name = "Column14";
  1893. this.Column14.ReadOnly = true;
  1894. //
  1895. // Column15
  1896. //
  1897. dataGridViewCellStyle55.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  1898. this.Column15.DefaultCellStyle = dataGridViewCellStyle55;
  1899. this.Column15.HeaderText = "Φ95";
  1900. this.Column15.Name = "Column15";
  1901. this.Column15.ReadOnly = true;
  1902. //
  1903. // button4
  1904. //
  1905. this.button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1906. this.button4.BackColor = System.Drawing.SystemColors.Control;
  1907. this.button4.Location = new System.Drawing.Point(941, 102);
  1908. this.button4.Name = "button4";
  1909. this.button4.Size = new System.Drawing.Size(128, 26);
  1910. this.button4.TabIndex = 23;
  1911. this.button4.UseVisualStyleBackColor = false;
  1912. this.button4.Click += new System.EventHandler(this.button4_Click);
  1913. //
  1914. // listView2
  1915. //
  1916. this.listView2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  1917. | System.Windows.Forms.AnchorStyles.Left)));
  1918. this.listView2.FullRowSelect = true;
  1919. this.listView2.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
  1920. this.listView2.HideSelection = false;
  1921. this.listView2.Location = new System.Drawing.Point(16, 56);
  1922. this.listView2.Name = "listView2";
  1923. this.listView2.Size = new System.Drawing.Size(180, 210);
  1924. this.listView2.TabIndex = 22;
  1925. this.listView2.UseCompatibleStateImageBehavior = false;
  1926. this.listView2.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.listView2_ItemSelectionChanged);
  1927. this.listView2.SelectedIndexChanged += new System.EventHandler(this.listView2_SelectedIndexChanged);
  1928. //
  1929. // numericUpDown1
  1930. //
  1931. this.numericUpDown1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1932. this.numericUpDown1.Location = new System.Drawing.Point(997, 163);
  1933. this.numericUpDown1.Maximum = new decimal(new int[] {
  1934. 10,
  1935. 0,
  1936. 0,
  1937. 0});
  1938. this.numericUpDown1.Name = "numericUpDown1";
  1939. this.numericUpDown1.Size = new System.Drawing.Size(56, 21);
  1940. this.numericUpDown1.TabIndex = 21;
  1941. this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
  1942. //
  1943. // button16
  1944. //
  1945. this.button16.BackColor = System.Drawing.SystemColors.Control;
  1946. this.button16.Location = new System.Drawing.Point(15, 20);
  1947. this.button16.Name = "button16";
  1948. this.button16.Size = new System.Drawing.Size(93, 26);
  1949. this.button16.TabIndex = 20;
  1950. this.button16.UseVisualStyleBackColor = false;
  1951. this.button16.Click += new System.EventHandler(this.button16_Click);
  1952. //
  1953. // label5
  1954. //
  1955. this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1956. this.label5.AutoSize = true;
  1957. this.label5.Location = new System.Drawing.Point(958, 169);
  1958. this.label5.Name = "label5";
  1959. this.label5.Size = new System.Drawing.Size(0, 12);
  1960. this.label5.TabIndex = 18;
  1961. //
  1962. // button14
  1963. //
  1964. this.button14.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1965. this.button14.BackColor = System.Drawing.SystemColors.Control;
  1966. this.button14.Location = new System.Drawing.Point(941, 68);
  1967. this.button14.Name = "button14";
  1968. this.button14.Size = new System.Drawing.Size(128, 26);
  1969. this.button14.TabIndex = 16;
  1970. this.button14.UseVisualStyleBackColor = false;
  1971. this.button14.Click += new System.EventHandler(this.button14_Click);
  1972. //
  1973. // button13
  1974. //
  1975. this.button13.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
  1976. this.button13.BackColor = System.Drawing.SystemColors.Control;
  1977. this.button13.Location = new System.Drawing.Point(941, 34);
  1978. this.button13.Name = "button13";
  1979. this.button13.Size = new System.Drawing.Size(128, 26);
  1980. this.button13.TabIndex = 12;
  1981. this.button13.UseVisualStyleBackColor = false;
  1982. this.button13.Click += new System.EventHandler(this.button13_Click);
  1983. //
  1984. // dataGridView4
  1985. //
  1986. this.dataGridView4.AllowUserToAddRows = false;
  1987. this.dataGridView4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
  1988. | System.Windows.Forms.AnchorStyles.Right)));
  1989. this.dataGridView4.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
  1990. this.dataGridView4.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
  1991. dataGridViewCellStyle56.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
  1992. dataGridViewCellStyle56.BackColor = System.Drawing.SystemColors.Control;
  1993. dataGridViewCellStyle56.Font = new System.Drawing.Font("宋体", 9F);
  1994. dataGridViewCellStyle56.ForeColor = System.Drawing.SystemColors.WindowText;
  1995. dataGridViewCellStyle56.SelectionBackColor = System.Drawing.SystemColors.Highlight;
  1996. dataGridViewCellStyle56.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
  1997. dataGridViewCellStyle56.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
  1998. this.dataGridView4.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle56;
  1999. this.dataGridView4.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
  2000. this.dataGridView4.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
  2001. this.Column1,
  2002. this.Column2,
  2003. this.Column5,
  2004. this.Column6,
  2005. this.Column7,
  2006. this.Column3});
  2007. this.dataGridView4.Location = new System.Drawing.Point(228, 20);
  2008. this.dataGridView4.Name = "dataGridView4";
  2009. this.dataGridView4.ReadOnly = true;
  2010. this.dataGridView4.RowHeadersVisible = false;
  2011. this.dataGridView4.RowTemplate.Height = 23;
  2012. this.dataGridView4.Size = new System.Drawing.Size(693, 133);
  2013. this.dataGridView4.TabIndex = 15;
  2014. //
  2015. // Column1
  2016. //
  2017. dataGridViewCellStyle57.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
  2018. this.Column1.DefaultCellStyle = dataGridViewCellStyle57;
  2019. this.Column1.Name = "Column1";
  2020. this.Column1.ReadOnly = true;
  2021. //
  2022. // Column2
  2023. //
  2024. dataGridViewCellStyle58.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
  2025. this.Column2.DefaultCellStyle = dataGridViewCellStyle58;
  2026. this.Column2.Name = "Column2";
  2027. this.Column2.ReadOnly = true;
  2028. //
  2029. // Column5
  2030. //
  2031. dataGridViewCellStyle59.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
  2032. this.Column5.DefaultCellStyle = dataGridViewCellStyle59;
  2033. this.Column5.Name = "Column5";
  2034. this.Column5.ReadOnly = true;
  2035. //
  2036. // Column6
  2037. //
  2038. dataGridViewCellStyle60.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
  2039. this.Column6.DefaultCellStyle = dataGridViewCellStyle60;
  2040. this.Column6.Name = "Column6";
  2041. this.Column6.ReadOnly = true;
  2042. //
  2043. // Column7
  2044. //
  2045. dataGridViewCellStyle61.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  2046. this.Column7.DefaultCellStyle = dataGridViewCellStyle61;
  2047. this.Column7.Name = "Column7";
  2048. this.Column7.ReadOnly = true;
  2049. //
  2050. // Column3
  2051. //
  2052. dataGridViewCellStyle62.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
  2053. this.Column3.DefaultCellStyle = dataGridViewCellStyle62;
  2054. this.Column3.Name = "Column3";
  2055. this.Column3.ReadOnly = true;
  2056. //
  2057. // button12
  2058. //
  2059. this.button12.BackColor = System.Drawing.SystemColors.Control;
  2060. this.button12.Location = new System.Drawing.Point(145, 20);
  2061. this.button12.Name = "button12";
  2062. this.button12.Size = new System.Drawing.Size(52, 26);
  2063. this.button12.TabIndex = 13;
  2064. this.button12.UseVisualStyleBackColor = false;
  2065. this.button12.Click += new System.EventHandler(this.button12_Click);
  2066. //
  2067. // button11
  2068. //
  2069. this.button11.BackColor = System.Drawing.SystemColors.Control;
  2070. this.button11.Location = new System.Drawing.Point(15, 20);
  2071. this.button11.Name = "button11";
  2072. this.button11.Size = new System.Drawing.Size(63, 26);
  2073. this.button11.TabIndex = 12;
  2074. this.button11.UseVisualStyleBackColor = false;
  2075. this.button11.Click += new System.EventHandler(this.button11_Click);
  2076. //
  2077. // CharacteristicsOfRockParticlesDialog
  2078. //
  2079. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  2080. this.ClientSize = new System.Drawing.Size(1107, 933);
  2081. this.Controls.Add(this.groupBox8);
  2082. this.Controls.Add(this.groupBox5);
  2083. this.Controls.Add(this.groupBox4);
  2084. this.Controls.Add(this.groupBox3);
  2085. this.Controls.Add(this.groupBox7);
  2086. this.Controls.Add(this.groupBox2);
  2087. this.Controls.Add(this.groupBox1);
  2088. this.Name = "CharacteristicsOfRockParticlesDialog";
  2089. this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.InclusionsStandardDialog_FormClosing);
  2090. this.Load += new System.EventHandler(this.GrainSizeAnalysisMethodOfClasticRockDialog_Load);
  2091. this.Shown += new System.EventHandler(this.ShownChoiseItemAndInitData);
  2092. this.Controls.SetChildIndex(this.groupBox1, 0);
  2093. this.Controls.SetChildIndex(this.groupBox2, 0);
  2094. this.Controls.SetChildIndex(this.groupBox7, 0);
  2095. this.Controls.SetChildIndex(this.groupBox3, 0);
  2096. this.Controls.SetChildIndex(this.groupBox4, 0);
  2097. this.Controls.SetChildIndex(this.groupBox5, 0);
  2098. this.Controls.SetChildIndex(this.groupBox8, 0);
  2099. this.groupBox1.ResumeLayout(false);
  2100. this.groupBox1.PerformLayout();
  2101. this.groupBox2.ResumeLayout(false);
  2102. this.groupBox3.ResumeLayout(false);
  2103. this.groupBox3.PerformLayout();
  2104. this.groupBox4.ResumeLayout(false);
  2105. this.groupBox4.PerformLayout();
  2106. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
  2107. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
  2108. this.groupBox5.ResumeLayout(false);
  2109. ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).EndInit();
  2110. ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
  2111. this.groupBox8.ResumeLayout(false);
  2112. this.groupBox8.PerformLayout();
  2113. ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
  2114. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
  2115. ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).EndInit();
  2116. this.ResumeLayout(false);
  2117. }
  2118. #endregion
  2119. private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
  2120. {
  2121. }
  2122. private void panel1_Click(object sender, EventArgs e)
  2123. {
  2124. this.colorsForm1.UserPrimaryColor = ColorBgra.FromColor(this.panel1.BackColor);
  2125. this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.panel1Changed));
  2126. this.colorsForm1.ShowDialog();
  2127. }
  2128. private void panel1Changed(object sender, EventArgs e)
  2129. {
  2130. this.panel1.BackColor = this.colorsForm1.UserPrimaryColor.ToColor();
  2131. this.colorsForm1.Close();
  2132. }
  2133. private void panel2_Click(object sender, EventArgs e)
  2134. {
  2135. this.colorsForm2.UserPrimaryColor = ColorBgra.FromColor(this.panel2.BackColor);
  2136. this.colorsForm2.setSaveBtn_Click(new System.EventHandler(this.panel2Changed));
  2137. this.colorsForm2.ShowDialog();
  2138. }
  2139. private void panel2Changed(object sender, EventArgs e)
  2140. {
  2141. this.panel2.BackColor = this.colorsForm2.UserPrimaryColor.ToColor();
  2142. this.colorsForm2.Close();
  2143. }
  2144. /// <summary>
  2145. /// ListView图片选择改变事件
  2146. /// </summary>
  2147. /// <param name="sender"></param>
  2148. /// <param name="e"></param>
  2149. private void listView1_SelectedIndexChanged(object sender, EventArgs e)
  2150. {
  2151. if (this.listView1.FocusedItem != null && this.listView1.FocusedItem.Selected)
  2152. {
  2153. this.unitLength = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRuler(MeasurementUnit.Millimeter);
  2154. //double physical_area_length_Micron = getCurrentWorkspace().GetRuler(MeasurementUnit.Micron);
  2155. existViewFlag = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GraphicsList.IsExsitView();
  2156. this.imageMat = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreatedAliasedMat();
  2157. if (!existViewFlag)
  2158. matOrg = imageMat.Clone();
  2159. else
  2160. matOrg = PaintDotNet.Camera.Tools.ToMat(this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetFullSizeWithRegion());
  2161. //二值化集成4
  2162. binaryClass.listView1_SelectedIndexChangedNoCheckedChanged(this.imageMat.Clone(), this.imageList1.Images.Keys[this.listView1.FocusedItem.Index]);
  2163. if (bcOriginChecked())
  2164. {
  2165. this.documentWorkspace.PhaseModels[0].choise = false;
  2166. this.documentWorkspace.PhaseModels[1].choise = false;
  2167. this.documentWorkspace.Refresh();
  2168. }
  2169. ScreeningSpheroidizedTissue();
  2170. RefrashResultData();
  2171. //if (this.grainBoundryCheckBox.Checked)
  2172. //{
  2173. // this.documentWorkspace.PhaseModels[1].choise = true;
  2174. // this.applyDect();
  2175. //}
  2176. }
  2177. }
  2178. /// <summary>
  2179. /// 颗粒编号改变
  2180. /// </summary>
  2181. /// <param name="sender"></param>
  2182. /// <param name="e"></param>
  2183. private void numericUpDown2_ValueChanged(object sender, EventArgs e)
  2184. {
  2185. this.documentWorkspace.Refresh();
  2186. }
  2187. /// <summary>
  2188. /// 颗粒直径改变
  2189. /// </summary>
  2190. /// <param name="sender"></param>
  2191. /// <param name="e"></param>
  2192. private void numericUpDown3_ValueChanged(object sender, EventArgs e)
  2193. {
  2194. this.documentWorkspace.Refresh();
  2195. }
  2196. /// <summary>
  2197. /// 字体颜色改变
  2198. /// </summary>
  2199. /// <param name="sender"></param>
  2200. /// <param name="e"></param>
  2201. private void panel1_BackColorChanged(object sender, EventArgs e)
  2202. {
  2203. this.documentWorkspace.Refresh();
  2204. }
  2205. /// <summary>
  2206. /// 字体颜色改变
  2207. /// </summary>
  2208. /// <param name="sender"></param>
  2209. /// <param name="e"></param>
  2210. private void panel2_BackColorChanged(object sender, EventArgs e)
  2211. {
  2212. this.documentWorkspace.Refresh();
  2213. }
  2214. /// <summary>
  2215. /// 画布绘制
  2216. /// </summary>
  2217. /// <param name="sender"></param>
  2218. /// <param name="e"></param>
  2219. private void Panel_Paint(object sender, PaintEventArgs e)
  2220. {
  2221. if (this.documentWorkspace.CompositionSurface != null)
  2222. {
  2223. //
  2224. // 以下是计算绘制图片的位置和大小并绘制图片
  2225. //
  2226. System.Drawing.Rectangle rc = this.documentWorkspace.panel.ClientRectangle;
  2227. int width = (int)(this.documentWorkspace.CompositionSurface.Width * this.documentWorkspace.ScaleFactor.Ratio);
  2228. int height = (int)(this.documentWorkspace.CompositionSurface.Height * this.documentWorkspace.ScaleFactor.Ratio);
  2229. int x = (rc.Width < width) ? this.documentWorkspace.panel.AutoScrollPosition.X : (rc.Width - width) / 2;
  2230. int y = (rc.Height < height) ? this.documentWorkspace.panel.AutoScrollPosition.Y : (rc.Height - height) / 2;
  2231. //
  2232. // 以下是绘制网格、标注、测量、视场等开始
  2233. //
  2234. e.Graphics.TranslateTransform(x, y);
  2235. e.Graphics.ScaleTransform((float)this.documentWorkspace.ScaleFactor.Ratio, (float)this.documentWorkspace.ScaleFactor.Ratio);
  2236. Draw(e.Graphics);
  2237. e.Graphics.ScaleTransform(1 / (float)this.documentWorkspace.ScaleFactor.Ratio, 1 / (float)this.documentWorkspace.ScaleFactor.Ratio);
  2238. e.Graphics.TranslateTransform(-x, -y);
  2239. }
  2240. }
  2241. private void Draw(Graphics graphics)
  2242. {
  2243. foreach (var keyValuePair in keyValuePairs)
  2244. {
  2245. if (keyValuePair.Count > 0)
  2246. {
  2247. if (this.checkBox5.Checked && this.checkBox6.Checked)
  2248. {
  2249. foreach (var item in keyValuePair)
  2250. {
  2251. 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));
  2252. SizeF sizeF = graphics.MeasureString("(" + item.Value[1] + ")", new Font("宋体", (float)this.numericUpDown2.Value));
  2253. 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));
  2254. }
  2255. }
  2256. else if (!this.checkBox5.Checked && this.checkBox6.Checked)
  2257. {
  2258. foreach (var item in keyValuePair)
  2259. {
  2260. 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));
  2261. }
  2262. }
  2263. else if (this.checkBox5.Checked && !this.checkBox6.Checked)
  2264. {
  2265. foreach (var item in keyValuePair)
  2266. {
  2267. 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));
  2268. }
  2269. }
  2270. }
  2271. }
  2272. }
  2273. /// <summary>
  2274. /// 是否显示编号
  2275. /// </summary>
  2276. /// <param name="sender"></param>
  2277. /// <param name="e"></param>
  2278. private void checkBox5_CheckedChanged(object sender, EventArgs e)
  2279. {
  2280. this.documentWorkspace.Refresh();
  2281. }
  2282. /// <summary>
  2283. /// 是否显示直径
  2284. /// </summary>
  2285. /// <param name="sender"></param>
  2286. /// <param name="e"></param>
  2287. private void checkBox6_CheckedChanged(object sender, EventArgs e)
  2288. {
  2289. this.documentWorkspace.Refresh();
  2290. }
  2291. /// <summary>
  2292. /// 图解法
  2293. /// </summary>
  2294. /// <param name="sender"></param>
  2295. /// <param name="e"></param>
  2296. private void checkBox3_CheckedChanged(object sender, EventArgs e)
  2297. {
  2298. if(this.checkBox3.Checked)
  2299. {
  2300. this.checkBox4.Checked = false;
  2301. this.dataGridView2.Columns[6].Visible = true;
  2302. this.dataGridView2.Columns[7].Visible = true;
  2303. this.dataGridView2.Columns[8].Visible = true;
  2304. this.dataGridView2.Columns[9].Visible = true;
  2305. this.dataGridView2.Columns[10].Visible = true;
  2306. this.dataGridView2.Columns[11].Visible = true;
  2307. this.dataGridView2.Columns[12].Visible = true;
  2308. }
  2309. else
  2310. {
  2311. this.dataGridView2.Columns[6].Visible = false;
  2312. this.dataGridView2.Columns[7].Visible = false;
  2313. this.dataGridView2.Columns[8].Visible = false;
  2314. this.dataGridView2.Columns[9].Visible = false;
  2315. this.dataGridView2.Columns[10].Visible = false;
  2316. this.dataGridView2.Columns[11].Visible = false;
  2317. this.dataGridView2.Columns[12].Visible = false;
  2318. }
  2319. RefreshStatistics();
  2320. }
  2321. /// <summary>
  2322. /// 矩阵法
  2323. /// </summary>
  2324. /// <param name="sender"></param>
  2325. /// <param name="e"></param>
  2326. private void checkBox4_CheckedChanged(object sender, EventArgs e)
  2327. {
  2328. if (this.checkBox4.Checked)
  2329. {
  2330. this.checkBox3.Checked = false;
  2331. }
  2332. RefreshStatistics();
  2333. }
  2334. /// <summary>
  2335. /// 筛析校正
  2336. /// </summary>
  2337. /// <param name="sender"></param>
  2338. /// <param name="e"></param>
  2339. private void checkBox1_CheckedChanged(object sender, EventArgs e)
  2340. {
  2341. RefrashResultData();
  2342. }
  2343. /// <summary>
  2344. /// 图解法
  2345. /// </summary>
  2346. /// <param name="sender"></param>
  2347. /// <param name="e"></param>
  2348. private void checkBox3_Click(object sender, EventArgs e)
  2349. {
  2350. if (!this.checkBox4.Checked)
  2351. checkBox3.Checked = true;
  2352. }
  2353. /// <summary>
  2354. /// 矩阵法
  2355. /// </summary>
  2356. /// <param name="sender"></param>
  2357. /// <param name="e"></param>
  2358. private void checkBox4_Click(object sender, EventArgs e)
  2359. {
  2360. if (!this.checkBox3.Checked)
  2361. checkBox4.Checked = true;
  2362. }
  2363. /// <summary>
  2364. /// 小数变化
  2365. /// </summary>
  2366. /// <param name="sender"></param>
  2367. /// <param name="e"></param>
  2368. private void numericUpDown1_ValueChanged(object sender, EventArgs e)
  2369. {
  2370. RefrashResultData();
  2371. RefreshDataGridView4();
  2372. RefreshStatistics();
  2373. this.documentWorkspace.Refresh();
  2374. }
  2375. /// <summary>
  2376. /// 保存结果
  2377. /// </summary>
  2378. /// <param name="sender"></param>
  2379. /// <param name="e"></param>
  2380. private void button2_Click(object sender, EventArgs e)
  2381. {
  2382. if (this.listView1.SelectedItems.Count == 0)
  2383. {
  2384. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
  2385. return;
  2386. }
  2387. if (this.dataGridView1.Rows.Count == 0)
  2388. {
  2389. MessageBox.Show(PdnResources.GetString("Menu.Noresultdata.text")+"!");
  2390. return;
  2391. }
  2392. string imgName = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetFriendlyName();
  2393. string tag = this.imageList1.Images.Keys[this.listView1.SelectedItems[0].Index];
  2394. DataTable dataTable = new DataTable();
  2395. bool replace = false;
  2396. int add = 0;
  2397. foreach (ListViewItem item in this.listView2.Items)
  2398. {
  2399. if (item.Tag.Equals(tag))
  2400. {
  2401. add++;
  2402. DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Theresuethertoreplace.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
  2403. if (dr == DialogResult.OK)
  2404. {
  2405. replace = true;
  2406. this.listView2.Items.Remove(item);
  2407. foreach (var keyValuePairs in keyValuePairsAll)
  2408. {
  2409. if (keyValuePairs.Key.Equals(tag))
  2410. {
  2411. this.keyValuePairsAll.Remove(tag);
  2412. break;
  2413. }
  2414. }
  2415. foreach (var graphicMethod in graphicMethods)
  2416. {
  2417. if (graphicMethod.Key.Equals(tag))
  2418. {
  2419. this.graphicMethods.Remove(tag);
  2420. break;
  2421. }
  2422. }
  2423. foreach (var matrixMethod in matrixMethods)
  2424. {
  2425. if (matrixMethod.Key.Equals(tag))
  2426. {
  2427. this.matrixMethods.Remove(tag);
  2428. break;
  2429. }
  2430. }
  2431. }
  2432. break;
  2433. }
  2434. }
  2435. if (replace || this.listView2.Items.Count == 0 || add == 0)
  2436. {
  2437. this.keyValuePairsAll.Add(tag, this.keyValuePairs);
  2438. this.graphicMethods.Add(tag, this.dataGridViewRowsGraphic);
  2439. this.matrixMethods.Add(tag, this.dataGridViewRowsMatrix);
  2440. ListViewItem listViewItem = new ListViewItem();
  2441. listViewItem.SubItems[0].Text = imgName;
  2442. listViewItem.Tag = "" + tag;
  2443. if (this.listView2.Items.Count == 0)
  2444. this.listView2.Items.Add(listViewItem);
  2445. else
  2446. this.listView2.Items.Insert(0, listViewItem);
  2447. this.dataGridView4.Rows.Clear();
  2448. for (int i = 0; i < keyValuePairs.Count; i++)
  2449. {
  2450. DataGridViewRow dgvr = new DataGridViewRow();
  2451. dgvr.Tag = tag;
  2452. foreach (DataGridViewColumn c in this.dataGridView4.Columns)
  2453. {
  2454. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  2455. }
  2456. dgvr.Cells[0].Value = imgName;
  2457. dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
  2458. dgvr.Cells[2].Value = PdnResources.GetString("Menu.gravel.text");
  2459. dgvr.Cells[3].Value = PdnResources.GetString("Menu.boulder.text");
  2460. dgvr.Cells[4].Value = 0;
  2461. dgvr.Cells[5].Value = 0;
  2462. this.dataGridView4.Rows.Add(dgvr);
  2463. dgvr = new DataGridViewRow();
  2464. dgvr.Tag = tag;
  2465. foreach (DataGridViewColumn c in this.dataGridView4.Columns)
  2466. {
  2467. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  2468. }
  2469. dgvr.Cells[0].Value = imgName;
  2470. dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
  2471. dgvr.Cells[2].Value = PdnResources.GetString("Menu.gravel.text");
  2472. dgvr.Cells[3].Value = PdnResources.GetString("Menu.boulwder.text");
  2473. dgvr.Cells[4].Value = 0;
  2474. dgvr.Cells[5].Value = 0;
  2475. this.dataGridView4.Rows.Add(dgvr);
  2476. dgvr = new DataGridViewRow();
  2477. dgvr.Tag = tag;
  2478. foreach (DataGridViewColumn c in this.dataGridView4.Columns)
  2479. {
  2480. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  2481. }
  2482. dgvr.Cells[0].Value = imgName;
  2483. dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
  2484. dgvr.Cells[2].Value = PdnResources.GetString("Menu.gravel.text");
  2485. dgvr.Cells[3].Value = PdnResources.GetString("Menu.Thegravel.text");
  2486. dgvr.Cells[4].Value = 0;
  2487. dgvr.Cells[5].Value = 0;
  2488. this.dataGridView4.Rows.Add(dgvr);
  2489. dgvr = new DataGridViewRow();
  2490. dgvr.Tag = tag;
  2491. foreach (DataGridViewColumn c in this.dataGridView4.Columns)
  2492. {
  2493. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  2494. }
  2495. dgvr.Cells[0].Value = imgName;
  2496. dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
  2497. dgvr.Cells[2].Value = PdnResources.GetString("Menu.gravel.text");
  2498. dgvr.Cells[3].Value = PdnResources.GetString("Menu.Finegravel.text");
  2499. dgvr.Cells[4].Value = 0;
  2500. dgvr.Cells[5].Value = 0;
  2501. this.dataGridView4.Rows.Add(dgvr);
  2502. dgvr = new DataGridViewRow();
  2503. dgvr.Tag = tag;
  2504. foreach (DataGridViewColumn c in this.dataGridView4.Columns)
  2505. {
  2506. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  2507. }
  2508. dgvr.Cells[0].Value = imgName;
  2509. dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
  2510. dgvr.Cells[2].Value = PdnResources.GetString("Menu.sand.text");
  2511. dgvr.Cells[3].Value = PdnResources.GetString("Menu.bigsand.text");
  2512. dgvr.Cells[4].Value = 0;
  2513. dgvr.Cells[5].Value = 0;
  2514. this.dataGridView4.Rows.Add(dgvr);
  2515. dgvr = new DataGridViewRow();
  2516. dgvr.Tag = tag;
  2517. foreach (DataGridViewColumn c in this.dataGridView4.Columns)
  2518. {
  2519. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  2520. }
  2521. dgvr.Cells[0].Value = imgName;
  2522. dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
  2523. dgvr.Cells[2].Value = PdnResources.GetString("Menu.sand.text");
  2524. dgvr.Cells[3].Value = PdnResources.GetString("Menu.Coarsesand.text");
  2525. dgvr.Cells[4].Value = 0;
  2526. dgvr.Cells[5].Value = 0;
  2527. this.dataGridView4.Rows.Add(dgvr);
  2528. dgvr = new DataGridViewRow();
  2529. dgvr.Tag = tag;
  2530. foreach (DataGridViewColumn c in this.dataGridView4.Columns)
  2531. {
  2532. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  2533. }
  2534. dgvr.Cells[0].Value = imgName;
  2535. dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
  2536. dgvr.Cells[2].Value = PdnResources.GetString("Menu.sand.text");
  2537. dgvr.Cells[3].Value = PdnResources.GetString("Menu.Mediumsand.text");
  2538. dgvr.Cells[4].Value = 0;
  2539. dgvr.Cells[5].Value = 0;
  2540. this.dataGridView4.Rows.Add(dgvr);
  2541. dgvr = new DataGridViewRow();
  2542. dgvr.Tag = tag;
  2543. foreach (DataGridViewColumn c in this.dataGridView4.Columns)
  2544. {
  2545. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  2546. }
  2547. dgvr.Cells[0].Value = imgName;
  2548. dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
  2549. dgvr.Cells[2].Value = PdnResources.GetString("Menu.sand.text");
  2550. dgvr.Cells[3].Value = PdnResources.GetString("Menu.Finesand.text");
  2551. dgvr.Cells[4].Value = 0;
  2552. dgvr.Cells[5].Value = 0;
  2553. this.dataGridView4.Rows.Add(dgvr);
  2554. dgvr = new DataGridViewRow();
  2555. dgvr.Tag = tag;
  2556. foreach (DataGridViewColumn c in this.dataGridView4.Columns)
  2557. {
  2558. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  2559. }
  2560. dgvr.Cells[0].Value = imgName;
  2561. dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
  2562. dgvr.Cells[2].Value = PdnResources.GetString("Menu.sand.text");
  2563. dgvr.Cells[3].Value = PdnResources.GetString("Menu.Veryfinesand.text");
  2564. dgvr.Cells[4].Value = 0;
  2565. dgvr.Cells[5].Value = 0;
  2566. this.dataGridView4.Rows.Add(dgvr);
  2567. dgvr = new DataGridViewRow();
  2568. dgvr.Tag = tag;
  2569. foreach (DataGridViewColumn c in this.dataGridView4.Columns)
  2570. {
  2571. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  2572. }
  2573. dgvr.Cells[0].Value = imgName;
  2574. dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
  2575. dgvr.Cells[2].Value = PdnResources.GetString("Menu.silt.text");
  2576. dgvr.Cells[3].Value = PdnResources.GetString("Menu.Coarsesilt.text");
  2577. dgvr.Cells[4].Value = 0;
  2578. dgvr.Cells[5].Value = 0;
  2579. this.dataGridView4.Rows.Add(dgvr);
  2580. dgvr = new DataGridViewRow();
  2581. dgvr.Tag = tag;
  2582. foreach (DataGridViewColumn c in this.dataGridView4.Columns)
  2583. {
  2584. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  2585. }
  2586. dgvr.Cells[0].Value = imgName;
  2587. dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
  2588. dgvr.Cells[2].Value = PdnResources.GetString("Menu.silt.text");
  2589. dgvr.Cells[3].Value = PdnResources.GetString("Menu.Fineowdersand.text");
  2590. dgvr.Cells[4].Value = 0;
  2591. dgvr.Cells[5].Value = 0;
  2592. this.dataGridView4.Rows.Add(dgvr);
  2593. dgvr = new DataGridViewRow();
  2594. dgvr.Tag = tag;
  2595. foreach (DataGridViewColumn c in this.dataGridView4.Columns)
  2596. {
  2597. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  2598. }
  2599. dgvr.Cells[0].Value = imgName;
  2600. dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
  2601. dgvr.Cells[2].Value = PdnResources.GetString("Menu.clay.text");
  2602. dgvr.Cells[3].Value = "-";
  2603. dgvr.Cells[4].Value = 0;
  2604. dgvr.Cells[5].Value = 0;
  2605. this.dataGridView4.Rows.Add(dgvr);
  2606. }
  2607. double index = 0;
  2608. // 巨砾
  2609. double boulders = 0;
  2610. // 粗砾
  2611. double coarseGravel = 0;
  2612. // 中砾
  2613. double mediuGravel = 0;
  2614. // 细砾
  2615. double fineGravel = 0;
  2616. // 巨砂
  2617. double giantSand = 0;
  2618. // 粗砂
  2619. double coarseSand = 0;
  2620. // 中砂
  2621. double mediumSand = 0;
  2622. // 细砂
  2623. double fineSand = 0;
  2624. // 极细砂
  2625. double superfineSand = 0;
  2626. // 粗粉砂
  2627. double coarseSilt = 0;
  2628. // 细粉砂
  2629. double fineSilt = 0;
  2630. // 粘土
  2631. double clay = 0;
  2632. // 总和
  2633. double all = 0;
  2634. foreach (var keyValuePair in keyValuePairs)
  2635. {
  2636. // 巨砾
  2637. boulders = 0;
  2638. // 粗砾
  2639. coarseGravel = 0;
  2640. // 中砾
  2641. mediuGravel = 0;
  2642. // 细砾
  2643. fineGravel = 0;
  2644. // 巨砂
  2645. giantSand = 0;
  2646. // 粗砂
  2647. coarseSand = 0;
  2648. // 中砂
  2649. mediumSand = 0;
  2650. // 细砂
  2651. fineSand = 0;
  2652. // 极细砂
  2653. superfineSand = 0;
  2654. // 粗粉砂
  2655. coarseSilt = 0;
  2656. // 细粉砂
  2657. fineSilt = 0;
  2658. // 粘土
  2659. clay = 0;
  2660. foreach (var item in keyValuePair)
  2661. {
  2662. // 巨砾
  2663. if (item.Value[0] > 256) boulders++;
  2664. // 粗砾
  2665. if (item.Value[0] > 64 && item.Value[0] <= 256) coarseGravel++;
  2666. // 中砾
  2667. if (item.Value[0] > 4 && item.Value[0] <= 64) mediuGravel++;
  2668. // 细砾
  2669. if (item.Value[0] > 2 && item.Value[0] <= 4) fineGravel++;
  2670. // 巨砂
  2671. if (item.Value[0] > 1 && item.Value[0] <= 2) giantSand++;
  2672. // 粗砂
  2673. if (Convert.ToDouble( item.Value[0]) > 0.5 && item.Value[0] <= 1) coarseSand++;
  2674. // 中砂
  2675. if (Convert.ToDouble(item.Value[0]) > 0.25 && Convert.ToDouble(item.Value[0]) <= 0.5) mediumSand++;
  2676. // 细砂
  2677. if (Convert.ToDouble(item.Value[0]) > 0.125 && Convert.ToDouble(item.Value[0]) <= 0.25) fineSand++;
  2678. // 极细砂
  2679. if (Convert.ToDouble(item.Value[0]) > 0.0625 && Convert.ToDouble(item.Value[0]) <= 0.125) superfineSand++;
  2680. // 粗粉砂
  2681. if (Convert.ToDouble(item.Value[0]) > 0.0312 && Convert.ToDouble(item.Value[0]) <= 0.0625) coarseSilt++;
  2682. // 细粉砂
  2683. if (Convert.ToDouble(item.Value[0]) > 0.0039 && Convert.ToDouble(item.Value[0]) <= 0.0312) fineSilt++;
  2684. // 粘土
  2685. if (Convert.ToDouble(item.Value[0]) <= 0.0039) clay++;
  2686. }
  2687. all = boulders + coarseGravel + mediuGravel + fineGravel + giantSand
  2688. + coarseSand + mediumSand + fineSand + superfineSand + coarseSilt + fineSilt + clay;
  2689. foreach (DataGridViewRow dataGridViewRow in this.dataGridView4.Rows)
  2690. {
  2691. if(dataGridViewRow.Cells[1].Value.Equals(PdnResources.GetString("Menu.view.text") + index))
  2692. {
  2693. if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.boulder.text")))
  2694. {
  2695. dataGridViewRow.Cells[4].Value = boulders;
  2696. dataGridViewRow.Cells[5].Value = Math.Round(boulders / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
  2697. }
  2698. else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.boulwder.text")))
  2699. {
  2700. dataGridViewRow.Cells[4].Value = coarseGravel;
  2701. dataGridViewRow.Cells[5].Value = Math.Round(coarseGravel / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
  2702. }
  2703. else if(dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Thegravel.text")))
  2704. {
  2705. dataGridViewRow.Cells[4].Value = mediuGravel;
  2706. dataGridViewRow.Cells[5].Value = Math.Round(mediuGravel / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
  2707. }
  2708. else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Finegravel.text")))
  2709. {
  2710. dataGridViewRow.Cells[4].Value = fineGravel;
  2711. dataGridViewRow.Cells[5].Value = Math.Round(fineGravel / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
  2712. }
  2713. else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.bigsand.text")))
  2714. {
  2715. dataGridViewRow.Cells[4].Value = giantSand;
  2716. dataGridViewRow.Cells[5].Value = Math.Round(giantSand / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
  2717. }
  2718. else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Coarsesand.text")))
  2719. {
  2720. dataGridViewRow.Cells[4].Value = coarseSand;
  2721. dataGridViewRow.Cells[5].Value = Math.Round(coarseSand / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
  2722. }
  2723. else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Mediumsand.text")))
  2724. {
  2725. dataGridViewRow.Cells[4].Value = mediumSand;
  2726. dataGridViewRow.Cells[5].Value = Math.Round(mediumSand / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
  2727. }
  2728. else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Finesand.text")))
  2729. {
  2730. dataGridViewRow.Cells[4].Value = fineSand;
  2731. dataGridViewRow.Cells[5].Value = Math.Round(fineSand / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
  2732. }
  2733. else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Veryfinesand.text")))
  2734. {
  2735. dataGridViewRow.Cells[4].Value = superfineSand;
  2736. dataGridViewRow.Cells[5].Value = Math.Round(superfineSand / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
  2737. }
  2738. else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Coarsesilt.text")))
  2739. {
  2740. dataGridViewRow.Cells[4].Value = coarseSilt;
  2741. dataGridViewRow.Cells[5].Value = Math.Round(coarseSilt / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
  2742. }
  2743. else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Fineowdersand.text")))
  2744. {
  2745. dataGridViewRow.Cells[4].Value = fineSilt;
  2746. dataGridViewRow.Cells[5].Value = Math.Round(fineSilt / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
  2747. }
  2748. else if (dataGridViewRow.Cells[2].Value.Equals(PdnResources.GetString("Menu.clay.text")))
  2749. {
  2750. dataGridViewRow.Cells[4].Value = clay;
  2751. dataGridViewRow.Cells[5].Value = Math.Round(clay / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
  2752. }
  2753. }
  2754. }
  2755. index++;
  2756. }
  2757. dataTable.TableName = tag;
  2758. foreach (System.Data.DataTable dataTable1 in dataTables)
  2759. {
  2760. if (dataTable1.TableName.Equals(dataTable.TableName))
  2761. {
  2762. dataTables.Remove(dataTable1);
  2763. break;
  2764. }
  2765. }
  2766. foreach (DataGridViewColumn c in this.dataGridView4.Columns)
  2767. {
  2768. dataTable.Columns.Add(c.HeaderText);
  2769. }
  2770. for (int i = 0; i < keyValuePairs.Count; i++)
  2771. {
  2772. DataRow dataRow = dataTable.NewRow();
  2773. dataRow[0] = imgName;
  2774. dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
  2775. dataRow[2] = PdnResources.GetString("Menu.gravel.text");
  2776. dataRow[3] = PdnResources.GetString("Menu.boulder.text");
  2777. dataRow[4] = boulders;
  2778. dataRow[5] = boulders / all * 100;
  2779. dataTable.Rows.Add(dataRow);
  2780. dataRow = dataTable.NewRow();
  2781. dataRow[0] = imgName;
  2782. dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
  2783. dataRow[2] = PdnResources.GetString("Menu.gravel.text");
  2784. dataRow[3] = PdnResources.GetString("Menu.boulwder.text");
  2785. dataRow[4] = coarseGravel;
  2786. dataRow[5] = coarseGravel / all * 100;
  2787. dataTable.Rows.Add(dataRow);
  2788. dataRow = dataTable.NewRow();
  2789. dataRow[0] = imgName;
  2790. dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
  2791. dataRow[2] = PdnResources.GetString("Menu.gravel.text");
  2792. dataRow[3] = PdnResources.GetString("Menu.Thegravel.text");
  2793. dataRow[4] = mediuGravel;
  2794. dataRow[5] = mediuGravel / all * 100;
  2795. dataTable.Rows.Add(dataRow);
  2796. dataRow = dataTable.NewRow();
  2797. dataRow[0] = imgName;
  2798. dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
  2799. dataRow[2] = PdnResources.GetString("Menu.gravel.text");
  2800. dataRow[3] = PdnResources.GetString("Menu.Finegravel.text");
  2801. dataRow[4] = fineGravel;
  2802. dataRow[5] = fineGravel / all * 100;
  2803. dataTable.Rows.Add(dataRow);
  2804. dataRow = dataTable.NewRow();
  2805. dataRow[0] = imgName;
  2806. dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
  2807. dataRow[2] = PdnResources.GetString("Menu.sand.text");
  2808. dataRow[3] = PdnResources.GetString("Menu.bigsand.text");
  2809. dataRow[4] = giantSand;
  2810. dataRow[5] = giantSand / all * 100;
  2811. dataTable.Rows.Add(dataRow);
  2812. dataRow = dataTable.NewRow();
  2813. dataRow[0] = imgName;
  2814. dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
  2815. dataRow[2] = PdnResources.GetString("Menu.sand.text");
  2816. dataRow[3] = PdnResources.GetString("Menu.Coarsesand.text");
  2817. dataRow[4] = coarseSand;
  2818. dataRow[5] = coarseSand / all * 100;
  2819. dataTable.Rows.Add(dataRow);
  2820. dataRow = dataTable.NewRow();
  2821. dataRow[0] = imgName;
  2822. dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
  2823. dataRow[2] = PdnResources.GetString("Menu.sand.text");
  2824. dataRow[3] = PdnResources.GetString("Menu.Mediumsand.text");
  2825. dataRow[4] = mediumSand;
  2826. dataRow[5] = mediumSand / all * 100;
  2827. dataTable.Rows.Add(dataRow);
  2828. dataRow = dataTable.NewRow();
  2829. dataRow[0] = imgName;
  2830. dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
  2831. dataRow[2] = PdnResources.GetString("Menu.sand.text");
  2832. dataRow[3] = PdnResources.GetString("Menu.Finesand.text");
  2833. dataRow[4] = fineSand;
  2834. dataRow[5] = fineSand / all * 100;
  2835. dataTable.Rows.Add(dataRow);
  2836. dataRow = dataTable.NewRow();
  2837. dataRow[0] = imgName;
  2838. dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
  2839. dataRow[2] = PdnResources.GetString("Menu.sand.text");
  2840. dataRow[3] = PdnResources.GetString("Menu.Veryfinesand.text");
  2841. dataRow[4] = superfineSand;
  2842. dataRow[5] = superfineSand / all * 100;
  2843. dataTable.Rows.Add(dataRow);
  2844. dataRow = dataTable.NewRow();
  2845. dataRow[0] = imgName;
  2846. dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
  2847. dataRow[2] = PdnResources.GetString("Menu.silt.text");
  2848. dataRow[3] = PdnResources.GetString("Menu.Coarsesilt.text");
  2849. dataRow[4] = coarseSilt;
  2850. dataRow[5] = coarseSilt / all * 100;
  2851. dataTable.Rows.Add(dataRow);
  2852. dataRow = dataTable.NewRow();
  2853. dataRow[0] = imgName;
  2854. dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
  2855. dataRow[2] = PdnResources.GetString("Menu.silt.text");
  2856. dataRow[3] = PdnResources.GetString("Menu.Fineowdersand.text");
  2857. dataRow[4] = fineSilt;
  2858. dataRow[5] = fineSilt / all * 100;
  2859. dataTable.Rows.Add(dataRow);
  2860. dataRow = dataTable.NewRow();
  2861. dataRow[0] = imgName;
  2862. dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
  2863. dataRow[2] = PdnResources.GetString("Menu.Theclay.text");
  2864. dataRow[3] = "-";
  2865. dataRow[4] = clay;
  2866. dataRow[5] = clay / all * 100;
  2867. dataTable.Rows.Add(dataRow);
  2868. }
  2869. this.dataTables.Add(dataTable);
  2870. if (this.allShow)
  2871. AllShow();
  2872. this.listView2.Items[0].Selected = true;
  2873. //保存处理后的图片
  2874. double pantographRatio = (double)this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRulerMultiple(MeasurementUnit.Micron);//标尺*放大倍数
  2875. List<Bitmap> tempBit = new List<Bitmap>();
  2876. Bitmap originalBit = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreateAliasedBitmap();
  2877. originalBit.Tag = pantographRatio;
  2878. tempBit.Add(originalBit);
  2879. //Mat mat = new Mat();
  2880. Bitmap processedBit = BitmapConverter.ToBitmap(this.documentWorkspace.PhaseModels[0].mat);
  2881. //this.documentWorkspace.PhaseModels[0].mat.CopyTo(mat);
  2882. Bitmap newBit = originalBit.Clone(new System.Drawing.Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
  2883. //Bitmap newBit = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat);
  2884. Graphics graphics = Graphics.FromImage(newBit);
  2885. graphics.DrawImage(processedBit, new PointF(0, 0));
  2886. Draw(graphics);
  2887. newBit.Tag = pantographRatio;
  2888. tempBit.Add(newBit);
  2889. if (bitDic.ContainsKey(tag))
  2890. bitDic[tag] = tempBit;
  2891. else
  2892. bitDic.Add(tag, tempBit);
  2893. //拼接中间数据
  2894. List<List<string>> dataList = new List<List<string>>();
  2895. List<string> columnName = new List<string>();
  2896. columnName.Add(PdnResources.GetString("Menu.Imagement.Measurementlist.ordernumber.text"));
  2897. columnName.Add(PdnResources.GetString("Menu.diameter.text"));
  2898. columnName.Add("Φ"+ PdnResources.GetString("Menu.Imagement.Measurementlist.value.text"));
  2899. dataList.Add(columnName);
  2900. int no = 0;
  2901. foreach (var keyValuePairs in keyValuePairsAll)
  2902. {
  2903. foreach (var item in keyValuePairs.Value)
  2904. {
  2905. foreach (var value in item)
  2906. {
  2907. no++;
  2908. List<string> strList = new List<string>();
  2909. strList.Add("" + no);
  2910. strList.Add("" + value.Value[0]);
  2911. strList.Add("" + value.Value[1]);
  2912. dataList.Add(strList);
  2913. }
  2914. }
  2915. }
  2916. bool isExist = false;//是否已存在进行替换
  2917. int modelIndex = -1;//要替换的下标
  2918. for (int j = 0; j < tempDataModel.Count; j++)
  2919. {
  2920. if (tempDataModel[j].tagName.Equals(tag))
  2921. {
  2922. isExist = true;
  2923. modelIndex = j;
  2924. break;
  2925. }
  2926. }
  2927. if (isExist && modelIndex > -1)
  2928. tempDataModel[modelIndex].dataList = dataList;
  2929. else
  2930. {
  2931. ExportProjectModel newModel = new ExportProjectModel();
  2932. newModel.tagName = tag;
  2933. newModel.picName = imgName;
  2934. newModel.dataList = dataList;
  2935. tempDataModel.Add(newModel);
  2936. }
  2937. }
  2938. }
  2939. /// <summary>
  2940. /// 取消全部显示
  2941. /// </summary>
  2942. /// <param name="sender"></param>
  2943. /// <param name="e"></param>
  2944. private void button16_Click(object sender, EventArgs e)
  2945. {
  2946. this.allShow = false;
  2947. this.button11.Visible = true;
  2948. this.button16.Visible = false;
  2949. if (this.listView2.Items.Count > 0)
  2950. {
  2951. if (this.listView2.SelectedItems.Count > 0)
  2952. {
  2953. List<int> dataTableIndex = new List<int>();
  2954. if (this.dataTables.Count == 0)
  2955. return;
  2956. for (int i = 0; i < this.dataTables.Count; i++)
  2957. {
  2958. foreach (ListViewItem item in this.listView2.SelectedItems)
  2959. {
  2960. if (this.dataTables[i].TableName.Equals(item.Tag))
  2961. dataTableIndex.Add(i);
  2962. }
  2963. }
  2964. this.dataGridView4.Rows.Clear();
  2965. foreach (var item in dataTableIndex)
  2966. {
  2967. if (this.dataTables[item].Rows.Count > 0)
  2968. {
  2969. for (int r = 0; r < this.dataTables[item].Rows.Count; r++)
  2970. {
  2971. DataGridViewRow dgvr = new DataGridViewRow();
  2972. dgvr.Tag = this.dataTables[item].TableName;
  2973. foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
  2974. {
  2975. dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
  2976. }
  2977. for (int c = 0; c < this.dataTables[item].Columns.Count; c++)
  2978. {
  2979. if (c == this.dataTables[item].Columns.Count - 1)
  2980. dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.dataTables[item].Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString() + "%";
  2981. else
  2982. dgvr.Cells[c].Value = this.dataTables[item].Rows[r][c].ToString();
  2983. }
  2984. this.dataGridView4.Rows.Add(dgvr);
  2985. }
  2986. }
  2987. }
  2988. }
  2989. else
  2990. {
  2991. this.listView2.Items[0].Selected = true;
  2992. if (this.dataTables.Count > 0
  2993. && this.dataTables[this.dataTables.Count - 1].Rows.Count > 0)
  2994. {
  2995. this.dataGridView4.Rows.Clear();
  2996. for (int r = 0; r < this.dataTables[this.dataTables.Count - 1].Rows.Count; r++)
  2997. {
  2998. DataGridViewRow dgvr = new DataGridViewRow();
  2999. dgvr.Tag = this.dataTables[this.dataTables.Count - 1].TableName;
  3000. foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
  3001. {
  3002. dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
  3003. }
  3004. for (int c = 0; c < this.dataTables[this.dataTables.Count - 1].Columns.Count; c++)
  3005. {
  3006. if (c == this.dataTables[this.dataTables.Count - 1].Columns.Count - 1)
  3007. dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.dataTables[this.dataTables.Count - 1].Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString() + "%";
  3008. else
  3009. dgvr.Cells[c].Value = this.dataTables[this.dataTables.Count - 1].Rows[r][c].ToString();
  3010. }
  3011. this.dataGridView4.Rows.Add(dgvr);
  3012. }
  3013. }
  3014. }
  3015. }
  3016. }
  3017. /// <summary>
  3018. /// 分析结果删除
  3019. /// </summary>
  3020. /// <param name="sender"></param>
  3021. /// <param name="e"></param>
  3022. private void button12_Click(object sender, EventArgs e)
  3023. {
  3024. if (this.listView2.Items.Count > 0)
  3025. {
  3026. if (this.listView2.SelectedItems.Count > 0)
  3027. {
  3028. DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretodeletethisanalysisresult.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
  3029. if (dr == DialogResult.OK)
  3030. {
  3031. List<string> detaleName = new List<string>();
  3032. int selectIndex = this.listView2.SelectedItems[0].Index;
  3033. foreach (ListViewItem item in this.listView2.SelectedItems)
  3034. {
  3035. detaleName.Add(item.Tag.ToString());
  3036. this.listView2.Items.Remove(item);
  3037. }
  3038. foreach (string tag in detaleName)
  3039. {
  3040. foreach (DataTable dataTable in this.dataTables)
  3041. {
  3042. if (dataTable.TableName.Equals(tag))
  3043. {
  3044. this.dataTables.Remove(dataTable);
  3045. break;
  3046. }
  3047. }
  3048. if (bitDic.ContainsKey(tag))
  3049. bitDic.Remove(tag);
  3050. foreach (ExportProjectModel model in this.tempDataModel)
  3051. {
  3052. if (model.tagName.Equals(tag))
  3053. {
  3054. this.tempDataModel.Remove(model);
  3055. break;
  3056. }
  3057. }
  3058. this.keyValuePairsAll.Remove(tag);
  3059. this.graphicMethods.Remove(tag);
  3060. this.matrixMethods.Remove(tag);
  3061. }
  3062. if (this.listView2.Items.Count > 0)
  3063. {
  3064. if (selectIndex == 0)
  3065. this.listView2.Items[0].Selected = true;
  3066. else
  3067. this.listView2.Items[selectIndex - 1].Selected = true;
  3068. RefreshDataGridView4();
  3069. }
  3070. else
  3071. {
  3072. this.dataGridView4.Rows.Clear();
  3073. }
  3074. }
  3075. }
  3076. else
  3077. {
  3078. MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttheanalysisresulttodelete.text")+"!");
  3079. }
  3080. }
  3081. else
  3082. {
  3083. MessageBox.Show(PdnResources.GetString("Menu.Nodataintheanalysisresults.text")+"!");
  3084. }
  3085. }
  3086. /// <summary>
  3087. /// 刷新分析结果数据
  3088. /// </summary>
  3089. private void RefreshDataGridView4()
  3090. {
  3091. if (!this.allShow)
  3092. {
  3093. if (this.listView2.SelectedItems.Count > 0)
  3094. {
  3095. List<int> dataTableIndex = new List<int>();
  3096. for (int i = 0; i < this.dataTables.Count; i++)
  3097. {
  3098. foreach (ListViewItem item in this.listView2.SelectedItems)
  3099. {
  3100. if (this.dataTables[i].TableName.Equals(item.Tag))
  3101. dataTableIndex.Add(i);
  3102. }
  3103. }
  3104. if (this.dataTables.Count == 0)
  3105. return;
  3106. this.dataGridView4.Rows.Clear();
  3107. foreach (var item in dataTableIndex)
  3108. {
  3109. if (this.dataTables[item].Rows.Count > 0)
  3110. {
  3111. for (int r = 0; r < this.dataTables[item].Rows.Count; r++)
  3112. {
  3113. DataGridViewRow dgvr = new DataGridViewRow();
  3114. dgvr.Tag = this.dataTables[item].TableName;
  3115. foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
  3116. {
  3117. dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
  3118. }
  3119. for (int c = 0; c < this.dataTables[item].Columns.Count; c++)
  3120. {
  3121. if (c != this.dataTables[item].Columns.Count - 1)
  3122. dgvr.Cells[c].Value = this.dataTables[item].Rows[r][c].ToString();
  3123. else
  3124. dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.dataTables[item].Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString() + "%";
  3125. }
  3126. this.dataGridView4.Rows.Add(dgvr);
  3127. }
  3128. }
  3129. }
  3130. }
  3131. }
  3132. else
  3133. {
  3134. this.dataGridView4.Rows.Clear();
  3135. DataTable dataTable = new DataTable();
  3136. for (int i = this.dataTables.Count - 1; i >= 0; i--)
  3137. {
  3138. dataTable = this.dataTables[i];
  3139. for (int r = 0; r < dataTable.Rows.Count; r++)
  3140. {
  3141. DataGridViewRow dgvr = new DataGridViewRow();
  3142. dgvr.Tag = dataTable.TableName;
  3143. foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
  3144. {
  3145. dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
  3146. }
  3147. for (int c = 0; c < dataTable.Columns.Count; c++)
  3148. {
  3149. if (c != dataTable.Columns.Count - 1)
  3150. dgvr.Cells[c].Value = dataTable.Rows[r][c].ToString();
  3151. else
  3152. dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(dataTable.Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString() + "%";
  3153. }
  3154. this.dataGridView4.Rows.Add(dgvr);
  3155. }
  3156. }
  3157. }
  3158. }
  3159. /// <summary>
  3160. /// 未选择分析结果
  3161. /// </summary>
  3162. /// <param name="sender"></param>
  3163. /// <param name="e"></param>
  3164. private void listView2_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
  3165. {
  3166. if (!this.allShow)
  3167. {
  3168. if (this.listView2.SelectedItems.Count == 0)
  3169. {
  3170. this.dataGridView4.Rows.Clear();
  3171. this.dataGridView2.Rows.Clear();
  3172. }
  3173. }
  3174. }
  3175. /// <summary>
  3176. /// 切换分析结果
  3177. /// </summary>
  3178. /// <param name="sender"></param>
  3179. /// <param name="e"></param>
  3180. private void listView2_SelectedIndexChanged(object sender, EventArgs e)
  3181. {
  3182. if (!this.allShow)
  3183. {
  3184. if (this.listView2.SelectedItems.Count > 0)
  3185. {
  3186. List<int> dataTableIndex = new List<int>();
  3187. if (this.dataTables.Count == 0)
  3188. return;
  3189. for (int i = 0; i < this.dataTables.Count; i++)
  3190. {
  3191. foreach (ListViewItem item in this.listView2.SelectedItems)
  3192. {
  3193. if (this.dataTables[i].TableName.Equals(item.Tag))
  3194. dataTableIndex.Add(i);
  3195. }
  3196. }
  3197. this.dataGridView4.Rows.Clear();
  3198. foreach (var item in dataTableIndex)
  3199. {
  3200. if (this.dataTables[item].Rows.Count > 0)
  3201. {
  3202. for (int r = 0; r < this.dataTables[item].Rows.Count; r++)
  3203. {
  3204. DataGridViewRow dgvr = new DataGridViewRow();
  3205. dgvr.Tag = this.dataTables[item].TableName;
  3206. foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
  3207. {
  3208. dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
  3209. }
  3210. for (int c = 0; c < this.dataTables[item].Columns.Count; c++)
  3211. {
  3212. if (c == this.dataTables[item].Columns.Count - 1)
  3213. dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.dataTables[item].Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString() + "%";
  3214. else
  3215. dgvr.Cells[c].Value = this.dataTables[item].Rows[r][c].ToString();
  3216. }
  3217. this.dataGridView4.Rows.Add(dgvr);
  3218. }
  3219. }
  3220. }
  3221. }
  3222. }
  3223. RefreshStatistics();
  3224. }
  3225. /// <summary>
  3226. /// 刷新结果数据
  3227. /// </summary>
  3228. private void RefreshStatistics()
  3229. {
  3230. if (this.listView2.SelectedItems.Count == 0 && !this.allShow)
  3231. return;
  3232. this.dataGridView2.Rows.Clear();
  3233. //
  3234. // 岩石定名
  3235. //
  3236. // 大类
  3237. // 砾百分比
  3238. double percentageGravel = 0;
  3239. // 砂百分比
  3240. double percentageSand = 0;
  3241. // 粉砂百分比
  3242. double percentageSilt = 0;
  3243. // 粘土百分比
  3244. double percentageClay = 0;
  3245. // 小类
  3246. // 巨砾百分比
  3247. double percentageBoulders = 0;
  3248. // 粗砾百分比
  3249. double percentageCoarseGravel = 0;
  3250. // 中砾百分比
  3251. double percentageMediuGravel = 0;
  3252. // 细砾百分比
  3253. double percentageFineGravel = 0;
  3254. // 巨砂百分比
  3255. double percentageGiantSand = 0;
  3256. // 粗砂百分比
  3257. double percentageCoarseSand = 0;
  3258. // 中砂百分比
  3259. double percentageMediumSand = 0;
  3260. // 细砂百分比
  3261. double percentageFineSand = 0;
  3262. // 极细砂百分比
  3263. double percentageSuperfineSand = 0;
  3264. // 粗粉砂百分比
  3265. double percentageCoarseSilt = 0;
  3266. // 细粉砂百分比
  3267. double percentageFineSilt = 0;
  3268. foreach (DataTable dataTable in dataTables)
  3269. {
  3270. foreach (ListViewItem listViewItem in this.listView2.SelectedItems)
  3271. {
  3272. if(dataTable.TableName.Equals(listViewItem.Tag))
  3273. {
  3274. for (int r = 0; r < dataTable.Rows.Count; r++)
  3275. {
  3276. if (dataTable.Rows[r][2].Equals(PdnResources.GetString("Menu.gravel.text")))
  3277. {
  3278. percentageGravel += Convert.ToDouble(dataTable.Rows[r][5]);
  3279. }
  3280. else if (dataTable.Rows[r][2].Equals(PdnResources.GetString("Menu.sand.text")))
  3281. {
  3282. percentageSand += Convert.ToDouble(dataTable.Rows[r][5]);
  3283. }
  3284. else if (dataTable.Rows[r][2].Equals(PdnResources.GetString("Menu.silt.text")))
  3285. {
  3286. percentageSilt += Convert.ToDouble(dataTable.Rows[r][5]);
  3287. }
  3288. else if (dataTable.Rows[r][2].Equals(PdnResources.GetString("Menu.clay.text")))
  3289. {
  3290. percentageClay += Convert.ToDouble(dataTable.Rows[r][5]);
  3291. }
  3292. if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.boulder.text")))
  3293. {
  3294. percentageBoulders += Convert.ToDouble(dataTable.Rows[r][5]);
  3295. }
  3296. else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.boulwder.text")))
  3297. {
  3298. percentageCoarseGravel += Convert.ToDouble(dataTable.Rows[r][5]);
  3299. }
  3300. else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Thegravel.text")))
  3301. {
  3302. percentageMediuGravel += Convert.ToDouble(dataTable.Rows[r][5]);
  3303. }
  3304. else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Finegravel.text")))
  3305. {
  3306. percentageFineGravel += Convert.ToDouble(dataTable.Rows[r][5]);
  3307. }
  3308. if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.bigsand.text")))
  3309. {
  3310. percentageGiantSand += Convert.ToDouble(dataTable.Rows[r][5]);
  3311. }
  3312. else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Coarsesand.text")))
  3313. {
  3314. percentageCoarseSand += Convert.ToDouble(dataTable.Rows[r][5]);
  3315. }
  3316. else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Mediumsand.text")))
  3317. {
  3318. percentageMediumSand += Convert.ToDouble(dataTable.Rows[r][5]);
  3319. }
  3320. else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Finesand.text")))
  3321. {
  3322. percentageFineSand += Convert.ToDouble(dataTable.Rows[r][5]);
  3323. }
  3324. else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Veryfinesand.text")))
  3325. {
  3326. percentageSuperfineSand += Convert.ToDouble(dataTable.Rows[r][5]);
  3327. }
  3328. else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Coarsesilt.text")))
  3329. {
  3330. percentageCoarseSilt += Convert.ToDouble(dataTable.Rows[r][5]);
  3331. }
  3332. else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Fineowdersand.text")))
  3333. {
  3334. percentageFineSilt += Convert.ToDouble(dataTable.Rows[r][5]);
  3335. }
  3336. }
  3337. }
  3338. }
  3339. }
  3340. // 岩石定名(主)
  3341. string rockNamingFirst = string.Empty;
  3342. if(percentageGravel >= 50 || percentageSand >= 50 || percentageSilt >= 50 || percentageClay >= 50)
  3343. {
  3344. // 砾
  3345. if (percentageGravel >= 50)
  3346. {
  3347. rockNamingFirst = PdnResources.GetString("Menu.conglomerate.text");
  3348. // 其中小类大于等于50%
  3349. if (percentageBoulders >= 50)
  3350. rockNamingFirst = PdnResources.GetString("Menu.Thegiantconglomerate.text");
  3351. else if (percentageCoarseGravel >= 50)
  3352. rockNamingFirst = PdnResources.GetString("Menu.Coarseconglomerate.text");
  3353. else if (percentageMediuGravel >= 50)
  3354. rockNamingFirst = PdnResources.GetString("Menu.Theconglomerate.text");
  3355. else if (percentageFineGravel >= 50)
  3356. rockNamingFirst = PdnResources.GetString("Menu.Fineconglomerate.text");
  3357. // 另有小类大于等于50%小于25%
  3358. if (percentageBoulders >= 25 && percentageBoulders < 50)
  3359. rockNamingFirst = PdnResources.GetString("Menu.Bouldemass.text") + rockNamingFirst;
  3360. else if (percentageCoarseGravel >= 25 && percentageCoarseGravel < 50)
  3361. rockNamingFirst = PdnResources.GetString("Menu.cobbly.text") + rockNamingFirst;
  3362. else if (percentageMediuGravel >= 25 && percentageMediuGravel < 50)
  3363. rockNamingFirst = PdnResources.GetString("Menu.Thegraveql.text") + rockNamingFirst;
  3364. else if (percentageFineGravel >= 25 && percentageFineGravel < 50)
  3365. rockNamingFirst = PdnResources.GetString("Menu.Finegraveql.text") + rockNamingFirst;
  3366. // 砂
  3367. if (percentageSand >= 25 && percentageSand < 50)
  3368. rockNamingFirst = PdnResources.GetString("Menu.sandyq.text") + rockNamingFirst;
  3369. // 粉砂
  3370. else if (percentageSilt >= 25 && percentageSilt < 50)
  3371. rockNamingFirst = PdnResources.GetString("Menu.siltyq.text") + rockNamingFirst;
  3372. // 粘土
  3373. else if (percentageClay >= 25 && percentageClay < 50)
  3374. rockNamingFirst = PdnResources.GetString("Menu.clayq.text") + rockNamingFirst;
  3375. // 砂
  3376. if (percentageSand >= 10 && percentageSand < 25)
  3377. rockNamingFirst = PdnResources.GetString("Menu.sandqa.text") + rockNamingFirst;
  3378. // 粉砂
  3379. else if (percentageSilt >= 10 && percentageSilt < 25)
  3380. rockNamingFirst = PdnResources.GetString("Menu.Containingsilty.text") + rockNamingFirst;
  3381. // 粘土
  3382. else if (percentageClay >= 10 && percentageClay < 25)
  3383. rockNamingFirst = PdnResources.GetString("Menu.Containclay.text") + rockNamingFirst;
  3384. }
  3385. // 砂
  3386. else if (percentageSand >= 50)
  3387. {
  3388. rockNamingFirst = PdnResources.GetString("Menu.sandstone.text");
  3389. if (percentageGiantSand >= 50 || percentageCoarseSand >= 50 || percentageMediumSand >= 50
  3390. || percentageFineSand >= 50 || percentageSuperfineSand >= 50)
  3391. {
  3392. // 其中小类大于等于50%
  3393. if (percentageGiantSand >= 50)
  3394. rockNamingFirst = PdnResources.GetString("Menu.Thegiantsandstone.text");
  3395. else if (percentageCoarseSand >= 50)
  3396. rockNamingFirst = PdnResources.GetString("Menu.grit.text");
  3397. else if (percentageMediumSand >= 50)
  3398. rockNamingFirst = PdnResources.GetString("Menu.Sandstoneinthe.text");
  3399. else if (percentageFineSand >= 50)
  3400. rockNamingFirst = PdnResources.GetString("Menu.Veryfinesandstone.text");
  3401. else if (percentageSuperfineSand >= 50)
  3402. rockNamingFirst = PdnResources.GetString("Menu.Veryfinqqesandstone.text");
  3403. // 另有小类大于等于25%小于50%
  3404. if (percentageGiantSand >= 25 && percentageGiantSand < 50)
  3405. rockNamingFirst = PdnResources.GetString("Menu.Thegiantsand.text") + rockNamingFirst;
  3406. else if (percentageCoarseSand >= 25 && percentageCoarseSand < 50)
  3407. rockNamingFirst = PdnResources.GetString("Menu.Coqarsesand.text") + rockNamingFirst;
  3408. else if (percentageMediumSand >= 25 && percentageMediumSand < 50)
  3409. rockNamingFirst = PdnResources.GetString("Menu.Mediumsandmass.text") + rockNamingFirst;
  3410. else if (percentageFineSand >= 25 && percentageFineSand < 50)
  3411. rockNamingFirst = PdnResources.GetString("Menu.Fineqsandy.text") + rockNamingFirst;
  3412. else if (percentageSuperfineSand >= 25 && percentageSuperfineSand < 50)
  3413. rockNamingFirst = PdnResources.GetString("Menu.Fineqsandy.text") + rockNamingFirst;
  3414. }
  3415. // 各小类均低于50%
  3416. else
  3417. {
  3418. if (percentageGiantSand >= 25 && percentageCoarseSand >= 25 && percentageMediumSand < 25 && percentageFineSand < 25 && percentageSuperfineSand < 25)
  3419. {
  3420. if (percentageGiantSand > percentageCoarseSand) rockNamingFirst = PdnResources.GetString("Menu.Coarsesandgiantsandstone.text");
  3421. else if (percentageGiantSand < percentageCoarseSand) rockNamingFirst = PdnResources.GetString("Menu.Giantgritsandstone.text");
  3422. else rockNamingFirst = PdnResources.GetString("Menu.Coarsesandgiantsandstone.text");
  3423. }
  3424. else if (percentageGiantSand >= 25 && percentageMediumSand >= 25 && percentageCoarseSand < 25 && percentageFineSand < 25 && percentageSuperfineSand < 25)
  3425. {
  3426. if (percentageGiantSand > percentageMediumSand) rockNamingFirst = PdnResources.GetString("Menu.Middlesandgiantsandstone.text");
  3427. else if (percentageGiantSand < percentageMediumSand) rockNamingFirst = PdnResources.GetString("Menu.Giantsandstone.text");
  3428. else rockNamingFirst = PdnResources.GetString("Menu.Middlesandgiantsandstone.text");
  3429. }
  3430. else if (percentageGiantSand >= 25 && percentageFineSand >= 25 && percentageCoarseSand < 25 && percentageMediumSand < 25 && percentageSuperfineSand < 25)
  3431. {
  3432. if (percentageGiantSand > percentageFineSand) rockNamingFirst = PdnResources.GetString("Menu.Finegiantsandstone.text");
  3433. else if (percentageGiantSand < percentageFineSand) rockNamingFirst = PdnResources.GetString("Menu.Giantfinesandstone.text");
  3434. else rockNamingFirst = PdnResources.GetString("Menu.Finegiantsandstone.text");
  3435. }
  3436. else if (percentageGiantSand >= 25 && percentageSuperfineSand >= 25 && percentageCoarseSand < 25 && percentageMediumSand < 25 && percentageFineSand < 25)
  3437. {
  3438. if (percentageGiantSand > percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Extremelyfinegiansandstone.text");
  3439. else if (percentageGiantSand < percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Megareniteveryfinesandstone.text");
  3440. else rockNamingFirst = PdnResources.GetString("Menu.Extremelyfinegiansandstone.text");
  3441. }
  3442. else if (percentageCoarseSand >= 25 && percentageMediumSand >= 25 && percentageGiantSand < 25 && percentageFineSand < 25 && percentageSuperfineSand < 25)
  3443. {
  3444. if (percentageCoarseSand > percentageMediumSand) rockNamingFirst = PdnResources.GetString("Menu.Mediumsandcoarsesandstone.text");
  3445. else if (percentageCoarseSand < percentageMediumSand) rockNamingFirst = PdnResources.GetString("Menu.Sandstoneincoarsesand.text");
  3446. else rockNamingFirst = PdnResources.GetString("Menu.Mediumsandcoarsesandstone.text");
  3447. }
  3448. else if (percentageCoarseSand >= 25 && percentageFineSand >= 25 && percentageGiantSand < 25 && percentageMediumSand < 25 && percentageSuperfineSand < 25)
  3449. {
  3450. if (percentageCoarseSand > percentageFineSand) rockNamingFirst = PdnResources.GetString("Menu.Finesandandcoarsesandstone.text");
  3451. else if (percentageCoarseSand < percentageFineSand) rockNamingFirst = PdnResources.GetString("Menu.Coarssandandfineandstone.text");
  3452. else rockNamingFirst = PdnResources.GetString("Menu.Finesandandcoarsesandstone.text");
  3453. }
  3454. else if (percentageCoarseSand >= 25 && percentageSuperfineSand >= 25 && percentageGiantSand < 25 && percentageMediumSand < 25 && percentageFineSand < 25)
  3455. {
  3456. if (percentageCoarseSand > percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Veryfinesandcoarsesandstone.text");
  3457. else if (percentageCoarseSand < percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Coarsesandveryfinesandstone.text");
  3458. else rockNamingFirst = PdnResources.GetString("Menu.Veryfinesandcoarsesandstone.text");
  3459. }
  3460. else if (percentageMediumSand >= 25 && percentageFineSand >= 25 && percentageGiantSand < 25 && percentageCoarseSand < 25 && percentageSuperfineSand < 25)
  3461. {
  3462. if (percentageMediumSand > percentageFineSand) rockNamingFirst = PdnResources.GetString("Menu.Finesanmediumsandstone.text");
  3463. else if (percentageMediumSand < percentageFineSand) rockNamingFirst = PdnResources.GetString("Menu.Mediumsandfinesandstone.text");
  3464. else rockNamingFirst = PdnResources.GetString("Menu.Finesanmediumsandstone.text");
  3465. }
  3466. else if (percentageMediumSand >= 25 && percentageSuperfineSand >= 25 && percentageGiantSand < 25 && percentageCoarseSand < 25 && percentageFineSand < 25)
  3467. {
  3468. if (percentageMediumSand > percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Mediumsandstoneofveryfinesand.text");
  3469. else if (percentageMediumSand < percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Mediumsandveryfinesandstone.text");
  3470. else rockNamingFirst = PdnResources.GetString("Menu.Mediumsandstoneofveryfinesand.text");
  3471. }
  3472. else if (percentageFineSand >= 25 && percentageSuperfineSand >= 25 && percentageGiantSand < 25 && percentageCoarseSand < 25 && percentageMediumSand < 25)
  3473. {
  3474. if (percentageFineSand > percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Veryfinesandfinesandstone.text");
  3475. else if (percentageFineSand < percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Finesandveryfinesandstone.text");
  3476. else rockNamingFirst = PdnResources.GetString("Menu.Veryfinesandfinesandstone.text");
  3477. }
  3478. else
  3479. {
  3480. rockNamingFirst = PdnResources.GetString("Menu.Unequalsandstone.text");
  3481. }
  3482. }
  3483. // 砾
  3484. if (percentageGravel >= 25 && percentageGravel < 50)
  3485. rockNamingFirst = PdnResources.GetString("Menu.graveal.text") + rockNamingFirst;
  3486. // 粉砂
  3487. else if (percentageSilt >= 25 && percentageSilt < 50)
  3488. rockNamingFirst = PdnResources.GetString("Menu.siltyq.text") + rockNamingFirst;
  3489. // 粘土
  3490. else if (percentageClay >= 25 && percentageClay < 50)
  3491. rockNamingFirst = PdnResources.GetString("Menu.clayq.text") + rockNamingFirst;
  3492. // 砾
  3493. if (percentageGravel >= 10 && percentageGravel < 25)
  3494. rockNamingFirst = PdnResources.GetString("Menu.conglomerati.text") + rockNamingFirst;
  3495. // 粉砂
  3496. else if (percentageSilt >= 10 && percentageSilt < 25)
  3497. rockNamingFirst = PdnResources.GetString("Menu.Containingsilty.text") + rockNamingFirst;
  3498. // 粘土
  3499. else if (percentageClay >= 10 && percentageClay < 25)
  3500. rockNamingFirst = PdnResources.GetString("Menu.Containclay.text") + rockNamingFirst;
  3501. }
  3502. // 粉砂
  3503. else if (percentageSilt >= 50)
  3504. {
  3505. rockNamingFirst = PdnResources.GetString("Menu.siltstone.text");
  3506. // 其中小类大于等于50%
  3507. if (percentageCoarseSilt >= 50)
  3508. rockNamingFirst = PdnResources.GetString("Menu.Coarsesiltstone.text");
  3509. else if (percentageFineSilt >= 50)
  3510. rockNamingFirst = PdnResources.GetString("Menu.Finesiltstone.text");
  3511. // 另有小类大于等于50%小于25%
  3512. if (percentageCoarseSilt >= 25 && percentageCoarseSilt < 50)
  3513. rockNamingFirst = PdnResources.GetString("Menu.Thicksilty.text") + rockNamingFirst;
  3514. else if (percentageFineSilt >= 25 && percentageFineSilt < 50)
  3515. rockNamingFirst = PdnResources.GetString("Menu.Finesilty.text") + rockNamingFirst;
  3516. // 砾
  3517. if (percentageGravel >= 25 && percentageGravel < 50)
  3518. rockNamingFirst = PdnResources.GetString("Menu.graveal.text") + rockNamingFirst;
  3519. // 砂
  3520. else if (percentageSand >= 25 && percentageSand < 50)
  3521. rockNamingFirst = PdnResources.GetString("Menu.sandyq.text") + rockNamingFirst;
  3522. // 粘土
  3523. else if (percentageClay >= 25 && percentageClay < 50)
  3524. rockNamingFirst = PdnResources.GetString("Menu.clayq.text") + rockNamingFirst;
  3525. // 砾
  3526. if (percentageGravel >= 10 && percentageGravel < 25)
  3527. rockNamingFirst = PdnResources.GetString("Menu.conglomerati.text") + rockNamingFirst;
  3528. // 砂
  3529. else if (percentageSand >= 10 && percentageSand < 25)
  3530. rockNamingFirst = PdnResources.GetString("Menu.sandqa.text") + rockNamingFirst;
  3531. // 粘土
  3532. else if (percentageClay >= 10 && percentageClay < 25)
  3533. rockNamingFirst = PdnResources.GetString("Menu.Containclay.text") + rockNamingFirst;
  3534. }
  3535. // 粘土
  3536. else if (percentageClay >= 50)
  3537. {
  3538. rockNamingFirst = PdnResources.GetString("Menu.Clayrock.text");
  3539. // 砾
  3540. if (percentageGravel >= 25 && percentageGravel < 50)
  3541. rockNamingFirst = PdnResources.GetString("Menu.graveal.text") + rockNamingFirst;
  3542. // 砂
  3543. else if (percentageSand >= 25 && percentageSand < 50)
  3544. rockNamingFirst = PdnResources.GetString("Menu.sandyq.text") + rockNamingFirst;
  3545. // 粉砂
  3546. else if (percentageSilt >= 25 && percentageSilt < 50)
  3547. rockNamingFirst = PdnResources.GetString("Menu.siltyq.text") + rockNamingFirst;
  3548. // 砾
  3549. if (percentageGravel >= 25 && percentageGravel < 50)
  3550. rockNamingFirst = PdnResources.GetString("Menu.conglomerati.text") + rockNamingFirst;
  3551. // 砂
  3552. else if (percentageSand >= 25 && percentageSand < 50)
  3553. rockNamingFirst = PdnResources.GetString("Menu.sandqa.text") + rockNamingFirst;
  3554. // 粉砂
  3555. else if (percentageSilt >= 25 && percentageSilt < 50)
  3556. rockNamingFirst = PdnResources.GetString("Menu.Containingsilty.text") + rockNamingFirst;
  3557. }
  3558. }
  3559. // 均低于50%
  3560. else
  3561. {
  3562. if(percentageGravel >= 25 && percentageSand >= 25 && percentageSilt < 25 && percentageClay < 25)
  3563. {
  3564. if (percentageGravel > percentageSand) rockNamingFirst = PdnResources.GetString("Menu.glutenite.text");
  3565. else if (percentageGravel < percentageSand) rockNamingFirst = PdnResources.GetString("Menu.Gravelsandstone.text");
  3566. else rockNamingFirst = PdnResources.GetString("Menu.glutenite.text");
  3567. }
  3568. else if (percentageGravel >= 25 && percentageSilt >= 25 && percentageSand < 25 && percentageClay < 25)
  3569. {
  3570. if (percentageGravel > percentageSilt) rockNamingFirst = PdnResources.GetString("Menu.Powderglutenite.text");
  3571. else if (percentageGravel < percentageSilt) rockNamingFirst = PdnResources.GetString("Menu.Gravelsiltston.text");
  3572. else rockNamingFirst = PdnResources.GetString("Menu.Powderglutenite.text");
  3573. }
  3574. else if(percentageGravel >= 25 && percentageClay >= 25 && percentageSand < 25 && percentageSilt < 25)
  3575. {
  3576. if (percentageGravel > percentageClay) rockNamingFirst = PdnResources.GetString("Menu.Clayconglomerate.text");
  3577. else if (percentageGravel < percentageClay) rockNamingFirst = PdnResources.GetString("Menu.Boulderclayrock.text");
  3578. else rockNamingFirst = PdnResources.GetString("Menu.Clayconglomerate.text");
  3579. }
  3580. else if (percentageSand >= 25 && percentageSilt >= 25 && percentageGravel < 25 && percentageClay < 25)
  3581. {
  3582. if (percentageSand > percentageSilt) rockNamingFirst = PdnResources.GetString("Menu.Siltysandstone.text");
  3583. else if (percentageSand < percentageSilt) rockNamingFirst = PdnResources.GetString("Menu.Sandsiltstone.text");
  3584. else rockNamingFirst = PdnResources.GetString("Menu.Siltysandstone.text");
  3585. }
  3586. else if (percentageSand >= 25 && percentageClay >= 25 && percentageGravel < 25 && percentageSilt < 25)
  3587. {
  3588. if (percentageSand > percentageClay) rockNamingFirst = PdnResources.GetString("Menu.Clasand.text");
  3589. else if (percentageSand < percentageClay) rockNamingFirst = PdnResources.GetString("Menu.Sandclayrock.text");
  3590. else rockNamingFirst = PdnResources.GetString("Menu.Clasand.text");
  3591. }
  3592. else if (percentageSilt >= 25 && percentageClay >= 25 && percentageGravel < 25 && percentageSand < 25)
  3593. {
  3594. if (percentageSilt > percentageClay) rockNamingFirst = PdnResources.GetString("Menu.Claysiltstone.text");
  3595. else if (percentageSilt < percentageClay) rockNamingFirst = PdnResources.GetString("Menu.Siltyclaystone.text");
  3596. else rockNamingFirst = PdnResources.GetString("Menu.Claysiltstone.text");
  3597. }
  3598. else
  3599. {
  3600. rockNamingFirst = PdnResources.GetString("Menu.Mixedclasticrock.text");
  3601. }
  3602. }
  3603. // 图解法
  3604. if (this.checkBox3.Checked)
  3605. {
  3606. //平均值
  3607. double sumMz = 0;
  3608. // 标准偏差
  3609. double sumA = 0;
  3610. // 偏度
  3611. double sumSK1 = 0;
  3612. // 峰度
  3613. double sumKg = 0;
  3614. // Φ5
  3615. double sumF5 = 0;
  3616. // Φ16
  3617. double sumF16 = 0;
  3618. // Φ25
  3619. double sumF25 = 0;
  3620. // Φ50
  3621. double sumF50 = 0;
  3622. // Φ75
  3623. double sumF75 = 0;
  3624. // Φ84
  3625. double sumF84 = 0;
  3626. // Φ95
  3627. double sumF95 = 0;
  3628. int count = 0;
  3629. foreach (ListViewItem listViewItem in this.listView2.SelectedItems)
  3630. {
  3631. foreach (var item in this.graphicMethods)
  3632. {
  3633. if (item.Key.Equals(listViewItem.Tag))
  3634. {
  3635. foreach (DataGridViewRow dataGridViewRow in item.Value)
  3636. {
  3637. count++;
  3638. sumMz +=Convert.ToDouble( dataGridViewRow.Cells[1].Value);
  3639. sumA += Convert.ToDouble(dataGridViewRow.Cells[2].Value);
  3640. sumSK1 += Convert.ToDouble(dataGridViewRow.Cells[3].Value);
  3641. sumKg += Convert.ToDouble(dataGridViewRow.Cells[4].Value);
  3642. sumF5 += Convert.ToDouble(dataGridViewRow.Cells[6].Value);
  3643. sumF16 += Convert.ToDouble(dataGridViewRow.Cells[7].Value);
  3644. sumF25 += Convert.ToDouble(dataGridViewRow.Cells[8].Value);
  3645. sumF50 += Convert.ToDouble(dataGridViewRow.Cells[9].Value);
  3646. sumF75 += Convert.ToDouble(dataGridViewRow.Cells[10].Value);
  3647. sumF84 += Convert.ToDouble(dataGridViewRow.Cells[11].Value);
  3648. sumF95 += Convert.ToDouble(dataGridViewRow.Cells[12].Value);
  3649. }
  3650. }
  3651. }
  3652. }
  3653. DataGridViewRow dgvr = new DataGridViewRow();
  3654. foreach (DataGridViewColumn c in this.dataGridView2.Columns)
  3655. {
  3656. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  3657. }
  3658. dgvr.Cells[0].Value = PdnResources.GetString("Menu.Graphicalmethod.text");
  3659. dgvr.Cells[1].Value = Math.Round(sumMz / count, Convert.ToInt32(this.numericUpDown1.Value));
  3660. dgvr.Cells[2].Value = Math.Round(sumA / count, Convert.ToInt32(this.numericUpDown1.Value));
  3661. dgvr.Cells[3].Value = Math.Round(sumSK1 / count, Convert.ToInt32(this.numericUpDown1.Value));
  3662. dgvr.Cells[4].Value = Math.Round(sumKg / count, Convert.ToInt32(this.numericUpDown1.Value));
  3663. dgvr.Cells[5].Value = rockNamingFirst;
  3664. dgvr.Cells[6].Value = Math.Round(sumF5 / count, Convert.ToInt32(this.numericUpDown1.Value));
  3665. dgvr.Cells[7].Value = Math.Round(sumF16 / count, Convert.ToInt32(this.numericUpDown1.Value));
  3666. dgvr.Cells[8].Value = Math.Round(sumF25 / count, Convert.ToInt32(this.numericUpDown1.Value));
  3667. dgvr.Cells[9].Value = Math.Round(sumF50 / count, Convert.ToInt32(this.numericUpDown1.Value));
  3668. dgvr.Cells[10].Value = Math.Round(sumF75 / count, Convert.ToInt32(this.numericUpDown1.Value));
  3669. dgvr.Cells[11].Value = Math.Round(sumF84 / count, Convert.ToInt32(this.numericUpDown1.Value));
  3670. dgvr.Cells[12].Value = Math.Round(sumF95 / count, Convert.ToInt32(this.numericUpDown1.Value));
  3671. this.dataGridView2.Rows.Add(dgvr);
  3672. }
  3673. // 矩阵法
  3674. if (this.checkBox4.Checked)
  3675. {
  3676. //平均值
  3677. double sumMz = 0;
  3678. // 标准偏差
  3679. double sumA = 0;
  3680. // 偏度
  3681. double sumSK1 = 0;
  3682. // 峰度
  3683. double sumKg = 0;
  3684. int count = 0;
  3685. foreach (ListViewItem listViewItem in this.listView2.SelectedItems)
  3686. {
  3687. foreach (var item in this.matrixMethods)
  3688. {
  3689. if (item.Key.Equals(listViewItem.Tag))
  3690. {
  3691. foreach (DataGridViewRow dataGridViewRow in item.Value)
  3692. {
  3693. count++;
  3694. sumMz += Convert.ToDouble(dataGridViewRow.Cells[1].Value);
  3695. sumA += Convert.ToDouble(dataGridViewRow.Cells[2].Value);
  3696. sumSK1 += Convert.ToDouble(dataGridViewRow.Cells[3].Value);
  3697. sumKg += Convert.ToDouble(dataGridViewRow.Cells[4].Value);
  3698. }
  3699. }
  3700. }
  3701. }
  3702. DataGridViewRow dgvr = new DataGridViewRow();
  3703. foreach (DataGridViewColumn c in this.dataGridView2.Columns)
  3704. {
  3705. dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
  3706. }
  3707. dgvr.Cells[0].Value = PdnResources.GetString("Menu.Matrixmethod.text");
  3708. dgvr.Cells[1].Value = Math.Round(sumMz / count, Convert.ToInt32(this.numericUpDown1.Value));
  3709. dgvr.Cells[2].Value = Math.Round(sumA / count, Convert.ToInt32(this.numericUpDown1.Value));
  3710. dgvr.Cells[3].Value = Math.Round(sumSK1 / count, Convert.ToInt32(this.numericUpDown1.Value));
  3711. dgvr.Cells[4].Value = Math.Round(sumKg / count, Convert.ToInt32(this.numericUpDown1.Value));
  3712. dgvr.Cells[5].Value = rockNamingFirst;
  3713. dgvr.Cells[6].Value = "-";
  3714. dgvr.Cells[7].Value = "-";
  3715. dgvr.Cells[8].Value = "-";
  3716. dgvr.Cells[9].Value = "-";
  3717. dgvr.Cells[10].Value = "-";
  3718. dgvr.Cells[11].Value = "-";
  3719. dgvr.Cells[12].Value = "-";
  3720. this.dataGridView2.Rows.Add(dgvr);
  3721. }
  3722. }
  3723. /// <summary>
  3724. /// 全部显示
  3725. /// </summary>
  3726. /// <param name="sender"></param>
  3727. /// <param name="e"></param>
  3728. private void button11_Click(object sender, EventArgs e)
  3729. {
  3730. if (this.listView2.Items.Count > 0)
  3731. {
  3732. this.button11.Visible = false;
  3733. this.button16.Visible = true;
  3734. this.button16.Focus();
  3735. this.allShow = true;
  3736. AllShow();
  3737. }
  3738. else
  3739. {
  3740. MessageBox.Show(PdnResources.GetString("Menu.nodata.text")+"!");
  3741. }
  3742. }
  3743. private void AllShow()
  3744. {
  3745. this.dataGridView4.Rows.Clear();
  3746. DataTable dataTable = new DataTable();
  3747. for (int i = this.dataTables.Count - 1; i >= 0; i--)
  3748. {
  3749. dataTable = this.dataTables[i];
  3750. for (int r = 0; r < dataTable.Rows.Count; r++)
  3751. {
  3752. DataGridViewRow dgvr = new DataGridViewRow();
  3753. dgvr.Tag = dataTable.TableName;
  3754. foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
  3755. {
  3756. dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
  3757. }
  3758. for (int c = 0; c < dataTable.Columns.Count; c++)
  3759. {
  3760. if (c == dataTable.Columns.Count - 1)
  3761. dgvr.Cells[c].Value = Math.Round(Convert.ToDouble( dataTable.Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString() + "%";
  3762. else
  3763. dgvr.Cells[c].Value = dataTable.Rows[r][c].ToString();
  3764. }
  3765. this.dataGridView4.Rows.Add(dgvr);
  3766. }
  3767. }
  3768. }
  3769. /// <summary>
  3770. /// 导出结果
  3771. /// </summary>
  3772. /// <param name="sender"></param>
  3773. /// <param name="e"></param>
  3774. private void button14_Click(object sender, EventArgs e)
  3775. {
  3776. if (this.listView2.Items.Count > 0)
  3777. {
  3778. System.Data.DataSet ds = new DataSet();
  3779. DataTable table1 = new DataTable();
  3780. table1.TableName = PdnResources.GetString("Menu.breakdown.text");
  3781. foreach (DataGridViewColumn c in this.dataGridView4.Columns)
  3782. {
  3783. table1.Columns.Add(c.HeaderText);
  3784. }
  3785. for (int r = 0; r < this.dataGridView4.Rows.Count; r++)
  3786. {
  3787. DataRow dataRow = table1.NewRow();
  3788. if (r == 0)
  3789. {
  3790. for (int c = 0; c < this.dataGridView4.Rows[r].Cells.Count; c++)
  3791. {
  3792. dataRow[this.dataGridView4.Columns[c].HeaderText] = this.dataGridView4.Columns[c].HeaderText;
  3793. }
  3794. table1.Rows.Add(dataRow);
  3795. }
  3796. dataRow = table1.NewRow();
  3797. for (int c = 0; c < this.dataGridView4.Rows[r].Cells.Count; c++)
  3798. {
  3799. dataRow[this.dataGridView4.Columns[c].HeaderText] = this.dataGridView4.Rows[r].Cells[c].Value;
  3800. }
  3801. table1.Rows.Add(dataRow);
  3802. }
  3803. DataTable table2 = new DataTable();
  3804. table2.TableName = PdnResources.GetString("Menu.statisaatics.text");
  3805. foreach (DataGridViewColumn c in this.dataGridView2.Columns)
  3806. {
  3807. table2.Columns.Add(c.HeaderText);
  3808. }
  3809. for (int r = 0; r < this.dataGridView2.Rows.Count; r++)
  3810. {
  3811. DataRow dataRow = table2.NewRow();
  3812. if (r == 0)
  3813. {
  3814. for (int c = 0; c < this.dataGridView2.Rows[r].Cells.Count; c++)
  3815. {
  3816. dataRow[this.dataGridView2.Columns[c].HeaderText] = this.dataGridView2.Columns[c].HeaderText;
  3817. }
  3818. table2.Rows.Add(dataRow);
  3819. }
  3820. dataRow = table2.NewRow();
  3821. for (int c = 0; c < this.dataGridView2.Rows[r].Cells.Count; c++)
  3822. {
  3823. dataRow[this.dataGridView2.Columns[c].HeaderText] = this.dataGridView2.Rows[r].Cells[c].Value;
  3824. }
  3825. table2.Rows.Add(dataRow);
  3826. }
  3827. if (table1.Rows.Count > 0) ds.Tables.Add(table1);
  3828. if (table2.Rows.Count > 0) ds.Tables.Add(table2);
  3829. if (ds.Tables.Count > 0)
  3830. DataToExcle(ds);
  3831. }
  3832. else
  3833. {
  3834. MessageBox.Show(PdnResources.GetString("Menu.Noanalysisresults.text")+"!");
  3835. }
  3836. }
  3837. /// <summary>
  3838. /// 导出多 Sheet 报表
  3839. /// </summary>
  3840. /// <param name="ds">要导出的数据</param>
  3841. public void DataToExcle(System.Data.DataSet ds)
  3842. {
  3843. try
  3844. {
  3845. if (ds.Tables == null || ds.Tables.Count == 0)
  3846. {
  3847. MessageBox.Show(PdnResources.GetString("Menu.Nonedata.Text")+"!");
  3848. return;
  3849. }
  3850. SaveFileDialog saveFileDialog = new SaveFileDialog();
  3851. saveFileDialog.DefaultExt = "xlsx";
  3852. saveFileDialog.Title = PdnResources.GetString("Menu.ExportdatatoEXECLtable.Text");
  3853. saveFileDialog.FileName = PdnResources.GetString("Menu.Rockgraincharacteristics.Text") + DateTime.Now.ToString("yyyyMMddhhmmss");
  3854. saveFileDialog.Filter = "microsoft office execl files (*.xlsx)|*.xlsx";
  3855. saveFileDialog.RestoreDirectory = true;
  3856. if (saveFileDialog.ShowDialog() == DialogResult.OK)
  3857. {
  3858. List<System.Data.DataTable> list = new List<System.Data.DataTable>();
  3859. foreach (System.Data.DataTable itemTable in ds.Tables)
  3860. list.Add(itemTable);
  3861. this.appWorkspace.ExportDataToExcelWithProgress(list, saveFileDialog.FileName, true, false, true);
  3862. }
  3863. }
  3864. catch (Exception e)
  3865. {
  3866. throw e;
  3867. }
  3868. }
  3869. /// <summary>
  3870. /// 生成报告
  3871. /// </summary>
  3872. /// <param name="sender"></param>
  3873. /// <param name="e"></param>
  3874. private void button13_Click(object sender, EventArgs e)
  3875. {
  3876. if (this.checkBox2.Checked)
  3877. {
  3878. AnalyzeSettingDialog recombinationRateSetDialog = new AnalyzeSettingDialog(this, "Template.Manager.item3.Characteristics");
  3879. if (recombinationRateSetDialog.hasModule)
  3880. {
  3881. recombinationRateSetDialog.StartPosition = FormStartPosition.CenterScreen;
  3882. recombinationRateSetDialog.ShowDialog();
  3883. }
  3884. else
  3885. {
  3886. recombinationRateSetDialog = null;
  3887. }
  3888. }
  3889. if (this.analyzeSettingModel != null && !string.IsNullOrEmpty(this.analyzeSettingModel.analyzeClassify))
  3890. {
  3891. //获取word书签与excel单元格的关系,以字典方式存储
  3892. List<mic_module_infos> mic_module_infos = mic_module_infos_BLL.FindAll().FindAll(a => a.analyze_classify == this.analyzeSettingModel.analyzeClassify);
  3893. Dictionary<string, string> tagInfos = new Dictionary<string, string>();
  3894. if (mic_module_infos != null && mic_module_infos.Count > 0)
  3895. {
  3896. foreach (mic_module_infos info in mic_module_infos)
  3897. {
  3898. tagInfos.Add(info.tag_name, info.cell_position);
  3899. }
  3900. }
  3901. List<List<string>> analysisContent = new List<List<string>>();
  3902. for (int i = 0; i < this.dataGridView4.Rows.Count; i++)
  3903. {
  3904. List<string> content1 = new List<string>();
  3905. if (i == 0)
  3906. {
  3907. content1.Add(this.dataGridView4.Columns[0].HeaderText);
  3908. content1.Add(this.dataGridView4.Columns[1].HeaderText);
  3909. content1.Add(this.dataGridView4.Columns[2].HeaderText);
  3910. content1.Add(this.dataGridView4.Columns[3].HeaderText);
  3911. content1.Add(this.dataGridView4.Columns[4].HeaderText);
  3912. content1.Add(this.dataGridView4.Columns[5].HeaderText);
  3913. analysisContent.Add(content1);
  3914. }
  3915. content1 = new List<string>();
  3916. content1.Add(this.dataGridView4.Rows[i].Cells[0].Value.ToString());
  3917. content1.Add(this.dataGridView4.Rows[i].Cells[1].Value.ToString());
  3918. content1.Add(this.dataGridView4.Rows[i].Cells[2].Value.ToString());
  3919. content1.Add(this.dataGridView4.Rows[i].Cells[3].Value.ToString());
  3920. content1.Add(this.dataGridView4.Rows[i].Cells[4].Value.ToString());
  3921. content1.Add(this.dataGridView4.Rows[i].Cells[5].Value.ToString());
  3922. analysisContent.Add(content1);
  3923. }
  3924. List<string> content2 = new List<string>();
  3925. analysisContent.Add(content2);
  3926. for (int i = 0; i < this.dataGridView2.Rows.Count; i++)
  3927. {
  3928. List<string> content1 = new List<string>();
  3929. if (i == 0)
  3930. {
  3931. content1.Add(this.dataGridView2.Columns[0].HeaderText);
  3932. content1.Add(this.dataGridView2.Columns[1].HeaderText);
  3933. content1.Add(this.dataGridView2.Columns[2].HeaderText);
  3934. content1.Add(this.dataGridView2.Columns[3].HeaderText);
  3935. content1.Add(this.dataGridView2.Columns[4].HeaderText);
  3936. content1.Add(this.dataGridView2.Columns[5].HeaderText);
  3937. content1.Add(this.dataGridView2.Columns[6].HeaderText);
  3938. content1.Add(this.dataGridView2.Columns[7].HeaderText);
  3939. content1.Add(this.dataGridView2.Columns[8].HeaderText);
  3940. content1.Add(this.dataGridView2.Columns[9].HeaderText);
  3941. content1.Add(this.dataGridView2.Columns[10].HeaderText);
  3942. content1.Add(this.dataGridView2.Columns[11].HeaderText);
  3943. content1.Add(this.dataGridView2.Columns[12].HeaderText);
  3944. analysisContent.Add(content1);
  3945. }
  3946. content1 = new List<string>();
  3947. content1.Add(this.dataGridView2.Rows[i].Cells[0].Value.ToString());
  3948. content1.Add(this.dataGridView2.Rows[i].Cells[1].Value.ToString());
  3949. content1.Add(this.dataGridView2.Rows[i].Cells[2].Value.ToString());
  3950. content1.Add(this.dataGridView2.Rows[i].Cells[3].Value.ToString());
  3951. content1.Add(this.dataGridView2.Rows[i].Cells[4].Value.ToString());
  3952. content1.Add(this.dataGridView2.Rows[i].Cells[5].Value.ToString());
  3953. content1.Add(this.dataGridView2.Rows[i].Cells[6].Value.ToString());
  3954. content1.Add(this.dataGridView2.Rows[i].Cells[7].Value.ToString());
  3955. content1.Add(this.dataGridView2.Rows[i].Cells[8].Value.ToString());
  3956. content1.Add(this.dataGridView2.Rows[i].Cells[9].Value.ToString());
  3957. content1.Add(this.dataGridView2.Rows[i].Cells[10].Value.ToString());
  3958. content1.Add(this.dataGridView2.Rows[i].Cells[11].Value.ToString());
  3959. content1.Add(this.dataGridView2.Rows[i].Cells[12].Value.ToString());
  3960. analysisContent.Add(content1);
  3961. }
  3962. bitList = new List<Bitmap>();
  3963. if (this.allShow)
  3964. {
  3965. foreach (KeyValuePair<string, List<Bitmap>> kv in this.bitDic)
  3966. {
  3967. bitList.Add(kv.Value[0]);
  3968. bitList.Add(kv.Value[1]);
  3969. }
  3970. }
  3971. else
  3972. {
  3973. if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
  3974. {
  3975. foreach (ListViewItem item in this.listView2.SelectedItems)
  3976. {
  3977. if (bitDic.ContainsKey(item.Tag.ToString()))
  3978. {
  3979. bitList.Add(bitDic[item.Tag.ToString()][0]);
  3980. bitList.Add(bitDic[item.Tag.ToString()][1]);
  3981. }
  3982. }
  3983. }
  3984. }
  3985. this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, analysisContent, bitList, tagInfos);
  3986. }
  3987. else
  3988. MessageBox.Show(PdnResources.GetString("Menu.Pleasesettheanalysisreportfirst.text")+"!");
  3989. }
  3990. /// <summary>
  3991. /// 设置
  3992. /// </summary>
  3993. /// <param name="sender"></param>
  3994. /// <param name="e"></param>
  3995. private void button1_Click(object sender, EventArgs e)
  3996. {
  3997. AnalyzeSettingDialog recombinationRateSetDialog = new AnalyzeSettingDialog(this, "Template.Manager.item3.Characteristics");
  3998. if (recombinationRateSetDialog.hasModule)
  3999. {
  4000. recombinationRateSetDialog.StartPosition = FormStartPosition.CenterScreen;
  4001. recombinationRateSetDialog.ShowDialog();
  4002. }
  4003. else
  4004. {
  4005. recombinationRateSetDialog = null;
  4006. }
  4007. }
  4008. /// <summary>
  4009. /// 导出项目
  4010. /// </summary>
  4011. /// <param name="sender"></param>
  4012. /// <param name="e"></param>
  4013. private void button4_Click(object sender, EventArgs e)
  4014. {
  4015. try
  4016. {
  4017. if (this.analyzeSettingModel == null)
  4018. {
  4019. MessageBox.Show(PdnResources.GetString("Menu.Settheexporteitemfirst.Text"));
  4020. return;
  4021. }
  4022. //获取项目工程内的文件夹路径
  4023. ProjectEngineering.NodeItem item = this.appWorkspace.GetInsertProjectPath(2, "Menu.DedicatedAnalysis.PetroleumGeology.PetroleumGeologySon.Text", this.analyzeSettingModel.savePath);
  4024. if (item != null)
  4025. {
  4026. //向文件夹内保存图片和报告
  4027. if (!string.IsNullOrEmpty(this.analyzeSettingModel.analyzeClassify))
  4028. {
  4029. //获取word书签与excel单元格的关系,以字典方式存储
  4030. List<mic_module_infos> mic_module_infos = mic_module_infos_BLL.FindAll().FindAll(a => a.analyze_classify == this.analyzeSettingModel.analyzeClassify);
  4031. Dictionary<string, string> tagInfos = new Dictionary<string, string>();
  4032. if (mic_module_infos != null && mic_module_infos.Count > 0)
  4033. {
  4034. foreach (mic_module_infos info in mic_module_infos)
  4035. {
  4036. tagInfos.Add(info.tag_name, info.cell_position);
  4037. }
  4038. }
  4039. //分析结果
  4040. List<List<string>> analysisContent = new List<List<string>>();
  4041. for (int i = 0; i < this.dataGridView4.Rows.Count; i++)
  4042. {
  4043. List<string> content1 = new List<string>();
  4044. if (i == 0)
  4045. {
  4046. content1.Add(this.dataGridView4.Columns[0].HeaderText);
  4047. content1.Add(this.dataGridView4.Columns[1].HeaderText);
  4048. content1.Add(this.dataGridView4.Columns[2].HeaderText);
  4049. content1.Add(this.dataGridView4.Columns[3].HeaderText);
  4050. content1.Add(this.dataGridView4.Columns[4].HeaderText);
  4051. content1.Add(this.dataGridView4.Columns[5].HeaderText);
  4052. analysisContent.Add(content1);
  4053. }
  4054. content1 = new List<string>();
  4055. content1.Add(this.dataGridView4.Rows[i].Cells[0].Value.ToString());
  4056. content1.Add(this.dataGridView4.Rows[i].Cells[1].Value.ToString());
  4057. content1.Add(this.dataGridView4.Rows[i].Cells[2].Value.ToString());
  4058. content1.Add(this.dataGridView4.Rows[i].Cells[3].Value.ToString());
  4059. content1.Add(this.dataGridView4.Rows[i].Cells[4].Value.ToString());
  4060. content1.Add(this.dataGridView4.Rows[i].Cells[5].Value.ToString());
  4061. analysisContent.Add(content1);
  4062. }
  4063. List<string> content2 = new List<string>();
  4064. analysisContent.Add(content2);
  4065. for (int i = 0; i < this.dataGridView2.Rows.Count; i++)
  4066. {
  4067. List<string> content1 = new List<string>();
  4068. if (i == 0)
  4069. {
  4070. content1.Add(this.dataGridView2.Columns[0].HeaderText);
  4071. content1.Add(this.dataGridView2.Columns[1].HeaderText);
  4072. content1.Add(this.dataGridView2.Columns[2].HeaderText);
  4073. content1.Add(this.dataGridView2.Columns[3].HeaderText);
  4074. content1.Add(this.dataGridView2.Columns[4].HeaderText);
  4075. content1.Add(this.dataGridView2.Columns[5].HeaderText);
  4076. content1.Add(this.dataGridView2.Columns[6].HeaderText);
  4077. content1.Add(this.dataGridView2.Columns[7].HeaderText);
  4078. content1.Add(this.dataGridView2.Columns[8].HeaderText);
  4079. content1.Add(this.dataGridView2.Columns[9].HeaderText);
  4080. content1.Add(this.dataGridView2.Columns[10].HeaderText);
  4081. content1.Add(this.dataGridView2.Columns[11].HeaderText);
  4082. content1.Add(this.dataGridView2.Columns[12].HeaderText);
  4083. analysisContent.Add(content1);
  4084. }
  4085. content1 = new List<string>();
  4086. content1.Add(this.dataGridView2.Rows[i].Cells[0].Value.ToString());
  4087. content1.Add(this.dataGridView2.Rows[i].Cells[1].Value.ToString());
  4088. content1.Add(this.dataGridView2.Rows[i].Cells[2].Value.ToString());
  4089. content1.Add(this.dataGridView2.Rows[i].Cells[3].Value.ToString());
  4090. content1.Add(this.dataGridView2.Rows[i].Cells[4].Value.ToString());
  4091. content1.Add(this.dataGridView2.Rows[i].Cells[5].Value.ToString());
  4092. content1.Add(this.dataGridView2.Rows[i].Cells[6].Value.ToString());
  4093. content1.Add(this.dataGridView2.Rows[i].Cells[7].Value.ToString());
  4094. content1.Add(this.dataGridView2.Rows[i].Cells[8].Value.ToString());
  4095. content1.Add(this.dataGridView2.Rows[i].Cells[9].Value.ToString());
  4096. content1.Add(this.dataGridView2.Rows[i].Cells[10].Value.ToString());
  4097. content1.Add(this.dataGridView2.Rows[i].Cells[11].Value.ToString());
  4098. content1.Add(this.dataGridView2.Rows[i].Cells[12].Value.ToString());
  4099. analysisContent.Add(content1);
  4100. }
  4101. bitList = new List<Bitmap>();
  4102. if (this.allShow)
  4103. {
  4104. foreach (KeyValuePair<string, List<Bitmap>> kv in this.bitDic)
  4105. {
  4106. bitList.Add(kv.Value[0]);
  4107. bitList.Add(kv.Value[1]);
  4108. }
  4109. }
  4110. else
  4111. {
  4112. if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
  4113. {
  4114. foreach (ListViewItem itemL2 in this.listView2.SelectedItems)
  4115. {
  4116. if (bitDic.ContainsKey(itemL2.Tag.ToString()))
  4117. {
  4118. bitList.Add(bitDic[itemL2.Tag.ToString()][0]);
  4119. bitList.Add(bitDic[itemL2.Tag.ToString()][1]);
  4120. }
  4121. }
  4122. }
  4123. }
  4124. //中间数据
  4125. if (!this.allShow)
  4126. {
  4127. if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
  4128. {
  4129. List<ExportProjectModel> exportModel = new List<ExportProjectModel>();
  4130. foreach (ListViewItem rowItem in this.listView2.SelectedItems)
  4131. {
  4132. foreach (ExportProjectModel model in this.tempDataModel)
  4133. {
  4134. if (model.tagName.Equals(rowItem.Tag))
  4135. {
  4136. ExportProjectModel tempModel = new ExportProjectModel();
  4137. tempModel.tagName = model.tagName;
  4138. tempModel.picName = model.picName;
  4139. tempModel.dataList = model.dataList;
  4140. exportModel.Add(tempModel);
  4141. break;
  4142. }
  4143. }
  4144. }
  4145. this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, analysisContent, exportModel, bitList, tagInfos, item.path, item.code);
  4146. }
  4147. }
  4148. else
  4149. this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, analysisContent, tempDataModel, bitList, tagInfos, item.path, item.code);
  4150. }
  4151. else
  4152. {
  4153. MessageBox.Show(PdnResources.GetString("Menu.Pleasesettheanalysisreportfirst.text")+"!");
  4154. return;
  4155. }
  4156. //保存项目信息到数据库
  4157. this.appWorkspace.InsertIntoDB(this.analyzeSettingModel, item);
  4158. }
  4159. }
  4160. catch (Exception)
  4161. {
  4162. }
  4163. }
  4164. /// <summary>
  4165. /// 不可点击空白区域
  4166. /// </summary>
  4167. /// <param name="sender"></param>
  4168. /// <param name="e"></param>
  4169. private void listView1_MouseUp(object sender, MouseEventArgs e)
  4170. {
  4171. if (e.Button == MouseButtons.Left)
  4172. {
  4173. if (listView1.SelectedItems.Count > 0)
  4174. {
  4175. }
  4176. else if (listView1.SelectedItems.Count <= 0)//点击空白区
  4177. {
  4178. if (this.listView1.FocusedItem != null)
  4179. {
  4180. ListViewItem item = this.listView1.GetItemAt(e.X, e.Y);
  4181. if (item == null)
  4182. {
  4183. this.listView1.FocusedItem.Selected = true;
  4184. }
  4185. }
  4186. }
  4187. }
  4188. }
  4189. #region 参数保存及提取
  4190. /// <summary>
  4191. /// 保存参数的key,value和type
  4192. /// </summary>
  4193. /// <param name="param_key"></param>
  4194. /// <param name="param_value"></param>
  4195. /// <param name="param_type"></param>
  4196. private void saveParamValue(string param_key, string param_value, int param_type)
  4197. {
  4198. bool foundItem = false;
  4199. if (!this.eachData.ContainsKey(GetImgKey()))
  4200. {
  4201. GrainSizeAnalysisModel analysisItem = new GrainSizeAnalysisModel();
  4202. analysisItem.menuId = this.menuId;
  4203. analysisItem.param_key = param_key;
  4204. analysisItem.param_type = param_type;
  4205. analysisItem.param_value = param_value;
  4206. analysisItem.setValue();
  4207. analysisItem.ListParam = new List<GrainSizeAnalysisModel>();
  4208. analysisItem.ListParam.Add(analysisItem);
  4209. this.eachData.Add(GetImgKey(), analysisItem);
  4210. }
  4211. foreach (var item in this.eachData[GetImgKey()].ListParam)
  4212. {
  4213. if (item.param_key.Equals(param_key) && item.menuId == this.menuId)
  4214. {
  4215. item.param_value = param_value;
  4216. item.setValue();
  4217. foundItem = true;
  4218. break;
  4219. }
  4220. }
  4221. if (!foundItem)
  4222. {
  4223. GrainSizeAnalysisModel analysisItem = new GrainSizeAnalysisModel();
  4224. analysisItem.menuId = this.menuId;
  4225. analysisItem.param_key = param_key;
  4226. analysisItem.param_type = param_type;
  4227. analysisItem.param_value = param_value;
  4228. analysisItem.setValue();
  4229. this.eachData[GetImgKey()].ListParam.Add(analysisItem);
  4230. }
  4231. }
  4232. /// <summary>
  4233. /// 保存界面中的参数到model
  4234. /// </summary>
  4235. private void saveDialogParamValues()
  4236. {
  4237. saveParamValue(ParamKey_Report, checkBox2.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//报告设置
  4238. saveParamValue(ParamKey_Correct, checkBox1.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//筛析矫正
  4239. saveParamValue(ParamKey_Graphic, checkBox3.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//图解法
  4240. saveParamValue(ParamKey_Matrix, checkBox4.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//矩阵法
  4241. saveParamValue(ParamKey_Number, checkBox5.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//显示颗粒编号
  4242. saveParamValue(ParamKey_NumberFontSize, numericUpDown2.Value.ToString(), (int)Base.Dtryt.Decimal);//编号字体大小
  4243. saveParamValue(ParamKey_NumberColour, panel1.BackColor.ToArgb().ToString(), (int)Base.Dtryt.Color);//编号颜色
  4244. saveParamValue(ParamKey_Diameter, checkBox6.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//显示颗粒直径
  4245. saveParamValue(ParamKey_DiameterFontSize, numericUpDown3.Value.ToString(), (int)Base.Dtryt.Decimal);//直径字体大小
  4246. saveParamValue(ParamKey_DiameterColour, panel2.BackColor.ToArgb().ToString(), (int)Base.Dtryt.Color);//直径颜色
  4247. saveParamValue(ParamKey_DecimalPlace, numericUpDown1.Value.ToString(), (int)Base.Dtryt.Decimal);//保留小数位数
  4248. }
  4249. /// <summary>
  4250. /// 获取保存的参数
  4251. /// </summary>
  4252. private void GetListParamModel()
  4253. {
  4254. if (this.eachData.ContainsKey(GetImgKey()) && this.eachData[GetImgKey()] != null)
  4255. {
  4256. for (int i = 0; i < this.eachData[GetImgKey()].ListParam.Count; i++)
  4257. {
  4258. switch (this.eachData[GetImgKey()].ListParam[i].param_key)
  4259. {
  4260. case ParamKey_Report:
  4261. checkBox2.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
  4262. break;
  4263. case ParamKey_Correct:
  4264. checkBox1.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
  4265. break;
  4266. case ParamKey_Graphic:
  4267. checkBox3.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
  4268. break;
  4269. case ParamKey_Matrix:
  4270. checkBox4.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
  4271. break;
  4272. case ParamKey_Number:
  4273. checkBox5.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
  4274. break;
  4275. case ParamKey_NumberFontSize:
  4276. numericUpDown2.Value = decimal.Parse(this.eachData[GetImgKey()].ListParam[i].param_value);
  4277. break;
  4278. case ParamKey_NumberColour:
  4279. panel1.BackColor = Color.FromArgb((int)this.eachData[GetImgKey()].ListParam[i].value);
  4280. break;
  4281. case ParamKey_Diameter:
  4282. checkBox6.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
  4283. break;
  4284. case ParamKey_DiameterFontSize:
  4285. numericUpDown3.Value = decimal.Parse(this.eachData[GetImgKey()].ListParam[i].param_value);
  4286. break;
  4287. case ParamKey_DiameterColour:
  4288. panel2.BackColor = Color.FromArgb((int)this.eachData[GetImgKey()].ListParam[i].value);
  4289. break;
  4290. case ParamKey_DecimalPlace:
  4291. numericUpDown1.Value = decimal.Parse(this.eachData[GetImgKey()].ListParam[i].param_value);
  4292. break;
  4293. }
  4294. }
  4295. }
  4296. }
  4297. /// <summary>
  4298. /// 获取XML保存的参数
  4299. /// </summary>
  4300. private void GetXmlParameter()
  4301. {
  4302. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GrainSizeAnalyze\\GrainSizeAnalysisModel.xml";
  4303. GrainSizeAnalysisModel analysisModelXml = XmlSerializeHelper.DESerializer<GrainSizeAnalysisModel>(FileOperationHelper.ReadStringFromFile(filePath, System.IO.FileMode.Open));
  4304. for (int i = 0; i < listView1.Items.Count; i++)
  4305. {
  4306. if (this.eachData.ContainsKey(listView1.Items[i].Index.ToString()))
  4307. {
  4308. this.eachData[listView1.Items[i].Index.ToString()] = analysisModelXml.cloneListParamModel(this.menuId);
  4309. }
  4310. else
  4311. {
  4312. this.eachData.Add(listView1.Items[i].Index.ToString(), analysisModelXml.cloneListParamModel(this.menuId));
  4313. }
  4314. }
  4315. foreach (var item in this.eachData[GetImgKey()].ListParam)
  4316. item.setValue();
  4317. }
  4318. /// <summary>
  4319. /// 保存参数,防止没有图片
  4320. /// </summary>
  4321. private void NullKey()
  4322. {
  4323. GrainSizeAnalysisModel grainsizeanalysismodel = new GrainSizeAnalysisModel();
  4324. grainsizeanalysismodel.ListParam = new List<GrainSizeAnalysisModel>();
  4325. this.eachData.Add("null", grainsizeanalysismodel);
  4326. }
  4327. private string GetImgKey()
  4328. {
  4329. string key = this.listView1.FocusedItem != null ? this.listView1.FocusedItem.Index.ToString() : "null";
  4330. return key;
  4331. }
  4332. #endregion
  4333. private void button5_Click(object sender, EventArgs e)
  4334. {
  4335. if (this.listView1.FocusedItem == null)
  4336. {
  4337. return;
  4338. }
  4339. binaryClass.saveParams();
  4340. binaryClass.applyToAll(this.imageList1.Images.Keys, this.imageList1.Images.Keys[int.Parse(GetImgKey())]);
  4341. saveDialogParamValues();
  4342. GrainSizeAnalysisModel data = new GrainSizeAnalysisModel();
  4343. if (eachData.ContainsKey(GetImgKey()))
  4344. {
  4345. data = eachData[GetImgKey()];
  4346. }
  4347. for (int i = 0; i < listView1.Items.Count; i++)
  4348. {
  4349. eachData[i.ToString()] = data.cloneListParamModel(this.menuId);
  4350. this.listView1.EnsureVisible(i);
  4351. this.listView1.Items[i].Focused = true;
  4352. this.listView1.Items[i].Selected = true;
  4353. }
  4354. }
  4355. private void button3_Click(object sender, EventArgs e)
  4356. {
  4357. if (this.listView1.FocusedItem == null)
  4358. {
  4359. return;
  4360. }
  4361. if (eachData.Count - 1 != listView1.Items.Count)
  4362. {
  4363. MessageBox.Show("请先点击应用全部!");
  4364. return;
  4365. }
  4366. saveDialogParamValues();
  4367. int current = int.Parse(GetImgKey());
  4368. for (int i = 0; i < listView1.Items.Count; i++)
  4369. {
  4370. this.listView1.EnsureVisible(i);
  4371. this.listView1.Items[i].Focused = true;
  4372. this.listView1.Items[i].Selected = true;
  4373. this.button2.PerformClick();
  4374. }
  4375. this.listView1.EnsureVisible(current);
  4376. this.listView1.Items[current].Focused = true;
  4377. this.listView1.Items[current].Selected = true;
  4378. }
  4379. private void listView1_MouseDown(object sender, MouseEventArgs e)
  4380. {
  4381. if (this.listView1.FocusedItem != null)
  4382. saveDialogParamValues();
  4383. }
  4384. #region [脚本相关]
  4385. private void getValue(string key, object value)
  4386. {
  4387. switch (key)
  4388. {
  4389. case "parameter1":
  4390. checkBox1.Checked = Convert.ToBoolean(value);
  4391. break;
  4392. case "parameter2":
  4393. checkBox3.Checked = Convert.ToBoolean(value);
  4394. break;
  4395. case "parameter3":
  4396. checkBox4.Checked = Convert.ToBoolean(value);
  4397. break;
  4398. case "parameter4":
  4399. checkBox5.Checked = Convert.ToBoolean(value);
  4400. break;
  4401. case "parameter5":
  4402. numericUpDown2.Value = Convert.ToDecimal(value);
  4403. break;
  4404. case "parameter6":
  4405. panel1.BackColor = Color.FromArgb((int)value);
  4406. break;
  4407. case "parameter7":
  4408. checkBox6.Checked = Convert.ToBoolean(value);
  4409. break;
  4410. case "parameter8":
  4411. numericUpDown3.Value = Convert.ToDecimal(value);
  4412. break;
  4413. case "parameter9":
  4414. panel2.BackColor = Color.FromArgb((int)value);
  4415. break;
  4416. case "OpenWhileExportReport":
  4417. checkBox2.Checked = Convert.ToBoolean(value);
  4418. break;
  4419. case "CalculatorDecimalDigits":
  4420. numericUpDown1.Value = Convert.ToDecimal(value);
  4421. break;
  4422. case "ExportResults":
  4423. isExportResults = Convert.ToBoolean(value);
  4424. break;
  4425. case "ExportReports":
  4426. isExportReports = Convert.ToBoolean(value);
  4427. break;
  4428. case "ExportProjects":
  4429. isExportProjects = Convert.ToBoolean(value);
  4430. break;
  4431. }
  4432. }
  4433. private void startScriptAutomaticAction()
  4434. {
  4435. this.button5.PerformClick();
  4436. this.button3.PerformClick();
  4437. if (isExportResults)//导出结果
  4438. this.button14.PerformClick();
  4439. if (isExportReports)//生成报告
  4440. this.button13.PerformClick();
  4441. if (isExportProjects)//导出项目
  4442. this.button4.PerformClick();
  4443. this.appWorkspace.ScriptAutomatic = false;
  4444. this.Close();
  4445. }
  4446. #endregion
  4447. #region [脚本录制]
  4448. private void getScriptRecording()
  4449. {
  4450. string className = InvariantData.path_Action + ".Action" + menuId;
  4451. ParamObject param = (ParamObject)System.Reflection.Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
  4452. List<Args> args = param.Lists;
  4453. foreach (var item in args)
  4454. {
  4455. item.value = setScriptRecording(item.key);
  4456. }
  4457. //找出二值相关参数 进行赋值
  4458. List<Args> isNullList = args.Where(m => m.value == null).ToList();
  4459. foreach (var item in isNullList)
  4460. {
  4461. item.value = binaryClass.setScriptRecording(item.key);
  4462. }
  4463. appWorkspace.SetScriptStartRecording(this.menuId, menuName, args);
  4464. }
  4465. private object setScriptRecording(string key)
  4466. {
  4467. object value = null;
  4468. switch (key)
  4469. {
  4470. case "parameter1":
  4471. value = checkBox1.Checked;
  4472. break;
  4473. case "parameter2":
  4474. value = checkBox3.Checked;
  4475. break;
  4476. case "parameter3":
  4477. value = checkBox4.Checked;
  4478. break;
  4479. case "parameter4":
  4480. value = checkBox5.Checked;
  4481. break;
  4482. case "parameter5":
  4483. value = numericUpDown2.Value;
  4484. break;
  4485. case "parameter6":
  4486. value = panel1.BackColor.ToArgb();
  4487. break;
  4488. case "parameter7":
  4489. value = checkBox6.Checked;
  4490. break;
  4491. case "parameter8":
  4492. value = numericUpDown3.Value;
  4493. break;
  4494. case "parameter9":
  4495. value = panel2.BackColor.ToArgb();
  4496. break;
  4497. case "OpenWhileExportReport":
  4498. value = checkBox2.Checked;
  4499. break;
  4500. case "CalculatorDecimalDigits":
  4501. value = numericUpDown1.Value;
  4502. break;
  4503. case "ExportResults":
  4504. value = isExportResults;
  4505. break;
  4506. case "ExportReports":
  4507. value = isExportReports;
  4508. break;
  4509. case "ExportProjects":
  4510. value = isExportProjects;
  4511. break;
  4512. }
  4513. return value;
  4514. }
  4515. #endregion
  4516. }
  4517. }