12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742 |
- using OpenCvSharp;
- using PaintDotNet.Base.CommTool;
- using PaintDotNet.Base.SettingModel;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.IO;
- using System.Windows.Forms;
- using Point = System.Drawing.Point;
- using PaintDotNet.Base.Functionodel;
- using PaintDotNet.Base.Enum;
- using PaintDotNet.Annotation.Enum;
- using PaintDotNet.CustomControl;
- using Application = System.Windows.Forms.Application;
- using GroupBox = System.Windows.Forms.GroupBox;
- using CheckBox = System.Windows.Forms.CheckBox;
- using Button = System.Windows.Forms.Button;
- using Label = System.Windows.Forms.Label;
- using PaintDotNet.DedicatedAnalysis.DuctileIron.Common;
- using System.Data;
- using Microsoft.Office.Interop.Excel;
- using Font = System.Drawing.Font;
- using DataTable = System.Data.DataTable;
- using PaintDotNet.DbOpreate.DbBll;
- using PaintDotNet.DbOpreate.DbModel;
- using PaintDotNet.Data.Param;
- using PaintDotNet.Instrument;
- using Metis.ParameterSet;
- using PaintDotNet.Base;
- using System.Linq;
- namespace PaintDotNet.DedicatedAnalysis.PetroleumGeology.SYT5434_1999
- {
- internal class GrainSizeAnalysisMethodOfClasticRockDialog : PdnBaseForm
- {
- #region 控件
- private GroupBox groupBox1;
- private Button button2;
- private CheckBox checkBox2;
- private GroupBox groupBox2;
- private ListView listView1;
- private ImageList imageList1;
- private IContainer components;
- private PaintDotNet.CustomControl.BinaryControl bc;
- private GroupBox groupBox7;
- private GroupBox groupBox3;
- private CheckBox checkBox1;
- private CheckBox checkBox4;
- private CheckBox checkBox3;
- private GroupBox groupBox4;
- private CheckBox checkBox5;
- private CheckBox checkBox6;
- private Label label4;
- private Label label3;
- private Label label2;
- private Label label1;
- private GroupBox groupBox5;
- private DataGridView dataGridView1;
- private GroupBox groupBox8;
- private Button button4;
- private ListView listView2;
- private NumericUpDown numericUpDown1;
- private Button button16;
- private Label label5;
- private Button button14;
- private Button button13;
- private DataGridView dataGridView4;
- private Button button12;
- private Button button11;
- private DataGridView dataGridView2;
- private Button button1;
- #endregion
- /// <summary>
- /// 主控件
- /// </summary>
- private AppWorkspace appWorkspace;
- //二值化集成1
- BinaryClass binaryClass;
- private int menuId;
- private string menuName;
- /// <summary>
- /// 选中图片的mat
- /// </summary>
- private Mat imageMat;
- private DocumentWorkspaceWindow documentWorkspace;
- /// <summary>
- /// 公共按钮
- /// </summary>
- private CommonControlButtons commonControlButtons;
- /// <summary>
- /// 储存点击保存结果后的所有原图与分析图
- /// </summary>
- private Dictionary<string, List<Bitmap>> bitDic = new Dictionary<string, List<Bitmap>>();
- /// <summary>
- /// 处理程序
- /// </summary>
- private ParamObject action = new Data.Action.Action1010();
- /// <summary>
- /// 存在视场标记
- /// </summary>
- private bool existViewFlag = false;
- private NumericUpDown numericUpDown3;
- private NumericUpDown numericUpDown2;
- private Panel panel2;
- private Panel panel1;
- /// <summary>
- /// 调色板
- /// </summary>
- private ColorsForm colorsForm1;
- private ColorsForm colorsForm2;
- /// <summary>
- /// 全部显示
- /// </summary>
- private bool allShow = false;
- /// <summary>
- /// 当前选择的图片
- /// </summary>
- private Mat matOrg;
- /// <summary>
- /// 标尺
- /// </summary>
- private double unitLength = 1.0;
- /// <summary>
- /// 轮廓质点
- /// </summary>
- private List<Dictionary<Point2d, double[]>> keyValuePairs = new List<Dictionary<Point2d, double[]>>();
- /// <summary>
- /// 轮廓质点(所有分析结果)
- /// </summary>
- private Dictionary<string, List<Dictionary<Point2d, double[]>>> keyValuePairsAll = new Dictionary<string, List<Dictionary<Point2d, double[]>>>();
- /// <summary>
- /// 分析结果暂存
- /// </summary>
- private List<System.Data.DataTable> dataTables = new List<System.Data.DataTable>();
- /// <summary>
- /// 保存用于生成报告的图片
- /// </summary>
- private List<Bitmap> bitList;
- /// <summary>
- /// 中间数据
- /// </summary>
- private List<ExportProjectModel> tempDataModel = new List<ExportProjectModel>();
- /// <summary>
- /// 图解法统计数据
- /// </summary>
- private List<DataGridViewRow> dataGridViewRowsGraphic = new List<DataGridViewRow>();
- /// <summary>
- /// 矩阵法统计数据
- /// </summary>
- private List<DataGridViewRow> dataGridViewRowsMatrix = new List<DataGridViewRow>();
- /// <summary>
- /// 图解法统计数据
- /// </summary>
- private Dictionary<string, List<DataGridViewRow>> graphicMethods = new Dictionary<string, List<DataGridViewRow>>();
- /// <summary>
- /// 矩阵法统计数据
- /// </summary>
- private Dictionary<string, List<DataGridViewRow>> matrixMethods = new Dictionary<string, List<DataGridViewRow>>();
- /// <summary>
- /// 图解法统计数据(多视场Φ值)
- /// </summary>
- private List<DataTable> dataTablesFai = new List<DataTable>();
- private DataGridViewTextBoxColumn Column11;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
- private DataGridViewTextBoxColumn Column1;
- private DataGridViewTextBoxColumn Column2;
- private DataGridViewTextBoxColumn Column5;
- private DataGridViewTextBoxColumn Column6;
- private DataGridViewTextBoxColumn Column7;
- private DataGridViewTextBoxColumn Column3;
- private DataGridView dataGridView3;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn10;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn11;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn12;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
- private DataGridViewTextBoxColumn Column4;
- private DataGridViewTextBoxColumn Column9;
- private DataGridViewTextBoxColumn Column10;
- private DataGridViewTextBoxColumn Column8;
- private DataGridViewTextBoxColumn Column12;
- private DataGridViewTextBoxColumn Column13;
- private DataGridViewTextBoxColumn Column14;
- private DataGridViewTextBoxColumn Column15;
- private AppCommon appCommon;
- private int defaultIndex = -1;
- private bool isExportResults = false;
- private bool isExportReports = false;
- private bool isExportProjects = false;
- /// <summary>
- /// 是否脚本运行
- /// </summary>
- private Boolean initScriptValues = false;
- // <summary>
- /// 保存窗口参数 range
- /// </summary>
- /// <summary>
- /// 各个图片对应数据
- /// </summary>
- private Dictionary<string, GrainSizeAnalysisModel> eachData = new Dictionary<string, GrainSizeAnalysisModel>();
- private const string ParamKey_Report = "report";//报告设置
- private const string ParamKey_Correct = "correct";//筛析矫正
- private const string ParamKey_Graphic = "graphic";//图解法
- private const string ParamKey_Matrix = "matrix";//矩阵法
- private const string ParamKey_Number = "number";//显示颗粒编号
- private const string ParamKey_NumberFontSize = "numberFontSize";//编号字体大小
- private const string ParamKey_NumberColour = "numberColour";//编号颜色
- private const string ParamKey_Diameter = "diameter";//显示颗粒直径
- private const string ParamKey_DiameterFontSize = "diameterFontSize";//直径字体大小
- private const string ParamKey_DiameterColour = "diameterColour";//直径颜色
- private Button button3;
- private Button button5;
- private const string ParamKey_DecimalPlace = "decimalPlace";//保留小数位数
- public GrainSizeAnalysisMethodOfClasticRockDialog(AppWorkspace appWorkspace, PdnMenuItem menuItem)
- {
- this.menuId = menuItem.MenuId;
- this.menuName = menuItem.Text;
- binaryClass = new BinaryClass(menuId);
- this.appWorkspace = appWorkspace;
- NullKey();
- InitializeComponent();
- InitializeLanguageText();
- // 标尺
- //this.appWorkspace.getMeasureInfo().TryGetValue(MeasurementUnit.Millimeter, out unitLength);
- //
- //初始化色板
- //
- //调色板
- this.colorsForm1 = new ColorsForm();
- this.colorsForm1.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm1.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- //调色板
- this.colorsForm2 = new ColorsForm();
- this.colorsForm2.StartPosition = FormStartPosition.CenterScreen;
- this.colorsForm2.UserPrimaryColorChanged += new ColorEventHandler(this.colorsFormUserPrimaryColorChanged);
- //
- //初始化图像控件
- //
- this.documentWorkspace = new DocumentWorkspaceWindow(appWorkspace);
- this.documentWorkspace.Dock = DockStyle.Fill;
- this.documentWorkspace.HookMouseEvents();
- this.documentWorkspace.AuxiliaryLineEnabled = false;
- this.documentWorkspace.Visible = false;
- //this.documentWorkspace.panel.MouseDown += OnMouseDown;
- this.documentWorkspace.panel.Paint += Panel_Paint;
- //this.documentWorkspace.panel.MouseMove += onMouseMove;
- //this.documentWorkspace.panel.MouseUp += onMouseUp;
- //this.documentWorkspace.panel.Click += new EventHandler(this.pictureBox1_Click);
- this.groupBox7.Controls.Add(documentWorkspace);
- //
- //初始化操作按钮
- //
- this.commonControlButtons = new CommonControlButtons();
- this.commonControlButtons.Dock = DockStyle.Top;
- this.commonControlButtons.Height = 30;
- this.commonControlButtons.HideZoomToWindowAndActualSize();
- this.groupBox7.Controls.Add(commonControlButtons);
- //初始化头
- this.listView2.View = View.Details;
- ColumnHeader header0 = new ColumnHeader();
- header0.Text = "";
- header0.Width = 180;
- this.listView2.Columns.Add(header0);
- InitCommonButtonEvent();
- Init();
- InitPicList();
- SetAnalyzeModelFromXml("Template.Manager.item3.GrainSizeAnalysis");
- //二值化集成2
- bc.OriginCheckedChangedAction += new EventHandler(this.bcOriginCheckedChanged);//初始化原图勾选改变事件
- binaryClass.createDocumentItems(new string[] { PdnResources.GetString("Menu.BinaryAction.BinaryExtraction.Text"), PdnResources.GetString("Menu.Grainboundarytoreproduce.text") }
- , this.bc, this.appWorkspace, this.documentWorkspace, this.listView1);//初始化相的工作结构
- binaryClass.BinaryImplFinishAction += new EventHandler(this.bClassBinaryImplFinishAction);//二值化后续处理事件
-
- for (int i = 0; i < this.dataGridView1.Columns.Count; i++)
- {
- this.dataGridView1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
- }
- for (int i = 0; i < this.dataGridView2.Columns.Count; i++)
- {
- this.dataGridView2.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
- }
- for (int i = 0; i < this.dataGridView3.Columns.Count; i++)
- {
- this.dataGridView3.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
- }
- for (int i = 0; i < this.dataGridView4.Columns.Count; i++)
- {
- this.dataGridView4.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
- }
- }
- /// <summary>
- /// 初始化参数
- /// </summary>
- private void Init()
- {
- this.button11.Visible = true;
- this.button16.Visible = false;
- this.numericUpDown2.Value = 10;
- this.numericUpDown3.Value = 10;
- this.checkBox3.Checked = true;
- }
- private void ShowImgEvent(object sender, EventArgs e)
- {
- listView1.Focus();
- if (this.defaultIndex != -1)
- {
- this.listView1.Items[defaultIndex].Focused = true;
- this.listView1.Items[defaultIndex].Selected = true;
- //如果是脚本执行,将参数带入
- if (appWorkspace.ScriptRunning && appWorkspace.ScriptCurrentParam != null)
- {
- this.initScriptValues = true;//ScriptAutomatic
- //Boolean initScriptValues = true;
- ////在这里反射出对应功能的参数类
- string className = InvariantData.path_Action + ".Action" + menuId;
- ParamObject param = (ParamObject)System.Reflection.Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
- foreach (Args arg in param.Lists)
- {
- Args param1 = appWorkspace.ScriptCurrentParam.Lists.Find(m => m.Key.Equals(arg.Key));
- if (param1.value != null)
- arg.Value = param1.value;
- getValue(arg.key, arg.Value);
- }
- appWorkspace.ScriptCurrentParam = null;//阻止第二次进入仍然被赋值参数
- }
- else
- {//读取上次关闭窗口时保存的参数
- GetXmlParameter();
- }
- if (this.initScriptValues && this.appWorkspace.ScriptAutomatic)
- this.startScriptAutomaticAction();
- }
- }
- /// <summary>
- /// 初始化图片列表数据
- /// </summary>
- public void InitPicList()
- {
- //初始化图片列表
- for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
- {
- this.imageList1.Images.Add("img" + i, this.appWorkspace.DocumentWorkspaces[i].BinarizationThumbnail);
- this.listView1.Items.Add("", i);
- this.listView1.Items[i].ImageIndex = i;
- this.listView1.Items[i].Text = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
- this.listView1.Items[i].Name = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
- if (this.appWorkspace.DocumentWorkspaces[i].Equals(this.appWorkspace.ActiveDocumentWorkspace))
- {
- defaultIndex = i;
- }
- }
- this.Shown += ShowImgEvent;
- }
- //二值化集成3
- #region 二值化相关方法
- private void InclusionsStandardDialog_FormClosing(object sender, FormClosingEventArgs e)
- {
- #region [开启脚本录制]
- if (appWorkspace.startScriptRecording)
- {
- getScriptRecording();
- }
- #endregion
- binaryClass.saveParams();
- this.saveDialogParamValues();
- //xml保存路径
- string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GrainSizeAnalyze\\GrainSizeAnalysisModel.xml";
- GrainSizeAnalysisModel analysisModelXml = XmlSerializeHelper.DESerializer<GrainSizeAnalysisModel>(FileOperationHelper.ReadStringFromFile(filePath, System.IO.FileMode.Open));
- foreach (var analysisItem in this.eachData[GetImgKey()].ListParam)
- {
- bool foundItem = false;
- foreach (var item in analysisModelXml.ListParam)
- {
- if (item.param_key.Equals(analysisItem.param_key) && item.menuId == analysisItem.menuId)
- {
- item.param_value = analysisItem.param_value;
- foundItem = true;
- break;
- }
- }
- if (!foundItem)
- analysisModelXml.ListParam.Add(analysisItem.cloneModel());
- }
- //按路径和名称保存xml文件
- string userInfoXml = XmlSerializeHelper.XmlSerialize<GrainSizeAnalysisModel>(analysisModelXml);
- //保存xml
- FileOperationHelper.WriteStringToFile(userInfoXml, filePath, System.IO.FileMode.Create);
- }
- private void ShownChoiseItemAndInitData(object sender, EventArgs e)
- {
- binaryClass.RefreshHistogramControl1Values();
- }
- /// <summary>
- /// 添加参数改变的监听
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GrainSizeAnalysisMethodOfClasticRockDialog_Load(object sender, EventArgs e)
- {
- this.binaryClass.loadParams();
- if (this.initScriptValues && this.appWorkspace.ScriptAutomatic)
- this.startScriptAutomaticAction();
- }
- private bool bcBinaryChecked()
- {
- return bc != null && bc.BinaryChecked;
- }
- private bool bcOriginChecked()
- {
- return bc != null && bc.OriginChecked;
- }
- /// <summary>
- /// 参数改变时,重新处理图像
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bClassBinaryImplFinishAction(object sender, EventArgs e)
- {
- ScreeningSpheroidizedTissue();
- RefrashResultData();
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 显示原图/原图+二值图
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void bcOriginCheckedChanged(object sender, EventArgs e)
- {
- if (!bcOriginChecked())
- {
- if (bcBinaryChecked())
- this.documentWorkspace.PhaseModels[0].choise = true;
- }
- else
- {
- this.documentWorkspace.PhaseModels[0].choise = false;
- this.documentWorkspace.PhaseModels[1].choise = false;
- }
- this.documentWorkspace.Refresh();
- }
- #endregion
- #region 公共控件
- private void InitCommonButtonEvent()
- {
- this.commonControlButtons.zoomInButton.Click += new EventHandler(zoomInButton_Click);
- this.commonControlButtons.zoomOutButton.Click += new EventHandler(zoomOutButton_Click);
- this.commonControlButtons.zoomToWindowButton.Click += new EventHandler(zoomToWindowButton_Click);
- this.commonControlButtons.actualSizeButton.Click += new EventHandler(actualSizeButton_Click);
- this.commonControlButtons.pointerButton.Click += new EventHandler(pointerButton_Click);
- this.commonControlButtons.mobileModeButton.Click += new EventHandler(mobileModeButton_Click);
- }
- private void zoomInButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomIn();
- }
- private void zoomOutButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomOut();
- }
- private void zoomToWindowButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomBasis = ZoomBasis.FitToWindow;
- }
- private void actualSizeButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ZoomBasis = ZoomBasis.ScaleFactor;
- this.documentWorkspace.ScaleFactor = ScaleFactor.OneToOne;
- }
- private void pointerButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.Pointer;
- }
- private void mobileModeButton_Click(object sender, EventArgs e)
- {
- this.documentWorkspace.ActiveTool = Annotation.Enum.DrawToolType.MoveMode;
- }
- #endregion
- /// <summary>
- /// 计算颗粒直径
- /// </summary>
- private void ScreeningSpheroidizedTissue()
- {
- appCommon = new AppCommon();
- // 计算所有轮廓质点
- keyValuePairs = new List<Dictionary<Point2d, double[]>>();
- if (this.documentWorkspace.phaseModels.Count == 0 || this.documentWorkspace.phaseModels[0].mat == null)
- return;
- if (this.documentWorkspace.GraphicsList.IsExsitView())
- {
- // 原始轮廓信息
- Mat temp = new Mat();
- this.documentWorkspace.phaseModels[0].mat.CopyTo(temp);
- List<OpenCvSharp.Point[][]> points = new List<OpenCvSharp.Point[][]>();//各石墨轮廓集合
- List<List<int>> lstAttribute = new List<List<int>>();//各个视场属性集合,索引0-横坐标,1-纵坐标,2-视场宽度,3-视场高度,4-视场面积
- int sumFieldl = 0; //视场个数
- //调用处理视场方法
- appCommon.MultiFieldView(appWorkspace, temp, listView1, documentWorkspace, out points, out lstAttribute, out sumFieldl);
- int viewCount = 0;
- int h = 0;
- foreach (OpenCvSharp.Point[][] contours in points)
- {
- h++;
- keyValuePairs.Add(new Dictionary<Point2d, double[]>());
- double[] thisAspectRatio;
- for (int i = 0; i < contours.Length; i++)
- {
- double area = Math.Abs(Cv2.ContourArea(contours[i]));
- for (int f = 0; f < contours[i].Length; f++)
- {
- contours[i][f].X = contours[i][f].X + lstAttribute[h - 1][0];
- contours[i][f].Y = contours[i][f].Y + lstAttribute[h - 1][1];
- }
- thisAspectRatio = new double[3];
- if (contours[i].Length < 5)
- continue;
- else
- {
- OpenCvSharp.RotatedRect rect = OpenCvSharp.Cv2.FitEllipse(contours[i]);
- thisAspectRatio[0] = Convert.ToDouble(rect.Size.Width * this.unitLength);
- thisAspectRatio[2] = area;
- // 取得所有轮廓质点
- OpenCvSharp.Moments moments = new OpenCvSharp.Moments(contours[i], false);
- if (!double.IsNaN(moments.M10 / moments.M00) && !double.IsNaN(moments.M01 / moments.M00))
- keyValuePairs[viewCount].Add(new Point2d(moments.M10 / moments.M00, moments.M01 / moments.M00), thisAspectRatio);
- }
- }
- int count;
- if(keyValuePairs.Count > 0)
- {
- foreach (var item1 in keyValuePairs[viewCount])
- {
- count = 0;
- foreach (var item2 in keyValuePairs[viewCount])
- {
- if (item2.Value[0] < item1.Value[0])
- count++;
- }
- foreach (var item3 in keyValuePairs[0])
- {
- if (item3.Value[1] == count + 1)
- count++;
- }
- item1.Value[1] = count + 1;
- }
- }
- viewCount++;
- }
- }
- else
- {
- // 原始轮廓信息
- OpenCvSharp.Point[][] contours;
- HierarchyIndex[] hierachy;
- Mat temp = new Mat();
- this.documentWorkspace.phaseModels[0].mat.CopyTo(temp);
- List<List<OpenCvSharp.Point>> globularPoint = new List<List<OpenCvSharp.Point>>();
- List<List<OpenCvSharp.Point>> flakyPoint = new List<List<OpenCvSharp.Point>>();
- Cv2.FindContours(BinaryClass.BGRA2GRAY(temp), out contours, out hierachy, RetrievalModes.External, ContourApproximationModes.ApproxNone);
- if (hierachy.Length > 0)
- {
- keyValuePairs.Add(new Dictionary<Point2d, double[]>());
- double[] thisAspectRatio;
- for (int i = 0; i < hierachy.Length; i++)
- {
- thisAspectRatio = new double[3];
- double area = Math.Abs(Cv2.ContourArea(contours[i]));
- if (contours[i].Length < 5)
- continue;
- else
- {
- OpenCvSharp.RotatedRect rect = OpenCvSharp.Cv2.FitEllipse(contours[i]);
- thisAspectRatio[0] = Convert.ToDouble(rect.Size.Width * this.unitLength);
- thisAspectRatio[2] = area;
- // 取得所有轮廓质点
- OpenCvSharp.Moments moments = new OpenCvSharp.Moments(contours[i], false);
- if (!double.IsNaN(moments.M10 / moments.M00) && !double.IsNaN(moments.M01 / moments.M00))
- keyValuePairs[0].Add(new Point2d(moments.M10 / moments.M00, moments.M01 / moments.M00), thisAspectRatio);
- }
- }
- }
- int count;
- if (keyValuePairs.Count > 0)
- {
- foreach (var item1 in keyValuePairs[0])
- {
- count = 0;
- foreach (var item2 in keyValuePairs[0])
- {
- if (item2.Value[0] < item1.Value[0])
- count++;
- }
- foreach (var item3 in keyValuePairs[0])
- {
- if (item3.Value[1] == count + 1)
- count++;
- }
- item1.Value[1] = count + 1;
- }
- }
- }
- }
- /// <summary>
- /// 刷新结果数据
- /// </summary>
- private void RefrashResultData()
- {
- this.dataGridView1.Rows.Clear();
- this.dataGridView3.Rows.Clear();
- int viewCount = 0;
- this.dataGridViewRowsGraphic = new List<DataGridViewRow>();
- this.dataGridViewRowsMatrix = new List<DataGridViewRow>();
- // 巨砾
- double bouldersArea = 0;
- // 粗砾
- double coarseGravelArea = 0;
- // 中砾
- double mediuGravelArea = 0;
- // 细砾
- double fineGravelArea = 0;
- // 巨砂
- double giantSandArea = 0;
- // 粗砂
- double coarseSandArea = 0;
- // 中砂
- double mediumSandArea = 0;
- // 细砂
- double fineSandArea = 0;
- // 极细砂
- double superfineSandArea = 0;
- // 粗粉砂
- double coarseSiltArea = 0;
- // 细粉砂
- double fineSiltArea = 0;
- // 粘土
- double clayArea = 0;
- // 总和
- double allArea = 0;
- // 巨砾
- List<double> bouldersFais;
- // 粗砾
- List<double> coarseGravelFais;
- // 中砾
- List<double> mediuGravelFais;
- // 细砾
- List<double> fineGravelFais;
- // 巨砂
- List<double> giantSandFais;
- // 粗砂
- List<double> coarseSandFais;
- // 中砂
- List<double> mediumSandFais;
- // 细砂
- List<double> fineSandFais;
- // 极细砂
- List<double> superfineSandFais;
- // 粗粉砂
- List<double> coarseSiltFais;
- // 细粉砂
- List<double> fineSiltFais;
- // 粘土
- List<double> clayFais;
- foreach (var keyValuePair in keyValuePairs)
- {
- // 巨砾
- bouldersArea = 0;
- // 粗砾
- coarseGravelArea = 0;
- // 中砾
- mediuGravelArea = 0;
- // 细砾
- fineGravelArea = 0;
- // 巨砂
- giantSandArea = 0;
- // 粗砂
- coarseSandArea = 0;
- // 中砂
- mediumSandArea = 0;
- // 细砂
- fineSandArea = 0;
- // 极细砂
- superfineSandArea = 0;
- // 粗粉砂
- coarseSiltArea = 0;
- // 细粉砂
- fineSiltArea = 0;
- // 粘土
- clayArea = 0;
- // 总和
- allArea = 0;
- // 巨砾
- bouldersFais = new List<double>();
- // 粗砾
- coarseGravelFais = new List<double>();
- // 中砾
- mediuGravelFais = new List<double>();
- // 细砾
- fineGravelFais = new List<double>();
- // 巨砂
- giantSandFais = new List<double>();
- // 粗砂
- coarseSandFais = new List<double>();
- // 中砂
- mediumSandFais = new List<double>();
- // 细砂
- fineSandFais = new List<double>();
- // 极细砂
- superfineSandFais = new List<double>();
- // 粗粉砂
- coarseSiltFais = new List<double>();
- // 细粉砂
- fineSiltFais = new List<double>();
- // 粘土
- clayFais = new List<double>();
- foreach (var item in keyValuePair)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- foreach (DataGridViewColumn Column in this.dataGridView1.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = PdnResources.GetString("Menu.view.text") + viewCount;
- dgvr.Cells[1].Value = item.Value[1];
- dgvr.Cells[2].Value = Math.Round(item.Value[0], Convert.ToInt32(this.numericUpDown1.Value));
- if(item.Value[0] == 0)
- dgvr.Cells[3].Value = 0;
- else
- if(this.checkBox1.Checked)
- dgvr.Cells[3].Value = Math.Round(0.3815 + 0.9027 * -Math.Log((double)item.Value[0], 2), Convert.ToInt32(this.numericUpDown1.Value));
- else
- dgvr.Cells[3].Value = Math.Round(-Math.Log((double)item.Value[0], 2), Convert.ToInt32(this.numericUpDown1.Value));
- this.dataGridView1.Rows.Add(dgvr);
- dgvr = new DataGridViewRow();
- foreach (DataGridViewColumn Column in dataGridView3.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = PdnResources.GetString("Menu.view.text") + viewCount;
- dgvr.Cells[1].Value = item.Value[1];
- dgvr.Cells[2].Value = item.Value[0];
- if (item.Value[0] == 0)
- dgvr.Cells[3].Value = 0;
- else
- {
- if(this.checkBox1.Checked)
- dgvr.Cells[3].Value = 0.3815 + 0.9027 * -Math.Log((double)item.Value[0], 2);
- else
- dgvr.Cells[3].Value = -Math.Log((double)item.Value[0], 2);
- }
-
- dataGridView3.Rows.Add(dgvr);
- allArea += item.Value[2];
- // 巨砾
- if (item.Value[0] > 256)
- {
- bouldersArea += item.Value[2];
- if (this.checkBox1.Checked)
- bouldersFais.Add(0.3815 + 0.9027 * -Math.Log((double)item.Value[0], 2));
- else
- bouldersFais.Add(-Math.Log((double)item.Value[0], 2));
- }
- // 粗砾
- if (item.Value[0] > 64 && item.Value[0] <= 256)
- {
- coarseGravelArea += item.Value[2];
- if (this.checkBox1.Checked)
- coarseGravelFais.Add(0.3815 + 0.9027 * -Math.Log((double)item.Value[0], 2));
- else
- coarseGravelFais.Add(-Math.Log((double)item.Value[0], 2));
- }
- // 中砾
- if (item.Value[0] > 4 && item.Value[0] <= 64)
- {
- mediuGravelArea += item.Value[2];
- if (this.checkBox1.Checked)
- mediuGravelFais.Add(0.3815 + 0.9027 * -Math.Log((double)item.Value[0], 2));
- else
- mediuGravelFais.Add(-Math.Log((double)item.Value[0], 2));
- }
- // 细砾
- if (item.Value[0] > 2 && item.Value[0] <= 4)
- {
- fineGravelArea += item.Value[2];
- if (this.checkBox1.Checked)
- fineGravelFais.Add(0.3815 + 0.9027 * -Math.Log((double)item.Value[0], 2));
- else
- fineGravelFais.Add(-Math.Log((double)item.Value[0], 2));
- }
- // 巨砂
- if (item.Value[0] > 1 && item.Value[0] <= 2)
- {
- giantSandArea += item.Value[2];
- if (this.checkBox1.Checked)
- giantSandFais.Add(0.3815 + 0.9027 * -Math.Log((double)item.Value[0], 2));
- else
- giantSandFais.Add(-Math.Log((double)item.Value[0], 2));
- }
- // 粗砂
- if (Convert.ToDouble(item.Value[0]) > 0.5 && item.Value[0] <= 1)
- {
- coarseSandArea += item.Value[2];
- if (this.checkBox1.Checked)
- coarseSandFais.Add(0.3815 + 0.9027 * -Math.Log((double)item.Value[0], 2));
- else
- coarseSandFais.Add(-Math.Log((double)item.Value[0], 2));
- }
- // 中砂
- if (Convert.ToDouble(item.Value[0]) > 0.25 && Convert.ToDouble(item.Value[0]) <= 0.5)
- {
- mediumSandArea += item.Value[2];
- if (this.checkBox1.Checked)
- mediumSandFais.Add(0.3815 + 0.9027 * -Math.Log((double)item.Value[0], 2));
- else
- mediumSandFais.Add(-Math.Log((double)item.Value[0], 2));
- }
- // 细砂
- if (Convert.ToDouble(item.Value[0]) > 0.125 && Convert.ToDouble(item.Value[0]) <= 0.25)
- {
- fineSandArea += item.Value[2];
- if (this.checkBox1.Checked)
- fineSandFais.Add(0.3815 + 0.9027 * -Math.Log((double)item.Value[0], 2));
- else
- fineSandFais.Add(-Math.Log((double)item.Value[0], 2));
- }
- // 极细砂
- if (Convert.ToDouble(item.Value[0]) > 0.0625 && Convert.ToDouble(item.Value[0]) <= 0.125)
- {
- superfineSandArea += item.Value[2];
- if (this.checkBox1.Checked)
- superfineSandFais.Add(0.3815 + 0.9027 * -Math.Log((double)item.Value[0], 2));
- else
- superfineSandFais.Add(-Math.Log((double)item.Value[0], 2));
- }
- // 粗粉砂
- if (Convert.ToDouble(item.Value[0]) > 0.0312 && Convert.ToDouble(item.Value[0]) <= 0.0625)
- {
- coarseSiltArea += item.Value[2];
- if (this.checkBox1.Checked)
- coarseSiltFais.Add(0.3815 + 0.9027 * -Math.Log((double)item.Value[0], 2));
- else
- coarseSiltFais.Add(-Math.Log((double)item.Value[0], 2));
- }
- // 细粉砂
- if (Convert.ToDouble(item.Value[0]) > 0.0039 && Convert.ToDouble(item.Value[0]) <= 0.0312)
- {
- fineSiltArea += item.Value[2];
- if (this.checkBox1.Checked)
- fineSiltFais.Add(0.3815 + 0.9027 * -Math.Log((double)item.Value[0], 2));
- else
- fineSiltFais.Add(-Math.Log((double)item.Value[0], 2));
- }
- // 粘土
- if (Convert.ToDouble(item.Value[0]) <= 0.0039)
- {
- clayArea += item.Value[2];
- if (this.checkBox1.Checked)
- clayFais.Add(0.3815 + 0.9027 * -Math.Log((double)item.Value[0], 2));
- else
- clayFais.Add(-Math.Log((double)item.Value[0], 2));
- }
- }
- //
- // 图解法
- //
- dataGridView3.Sort(dataGridView3.Columns[1], ListSortDirection.Descending);
- int count = dataGridView3.Rows.Count;
- double count5 = count * 0.05;
- double count16 = count * 0.16;
- double count25 = count * 0.25;
- double count50 = count * 0.5;
- double count75 = count * 0.75;
- double count84 = count * 0.84;
- double count95 = count * 0.95;
- double fai5 = 0;
- double fai16 = 0;
- double fai25 = 0;
- double fai50 = 0;
- double fai75 = 0;
- double fai84 = 0;
- double fai95 = 0;
- foreach (DataGridViewRow dataGridViewRow in dataGridView3.Rows)
- {
- if (Convert.ToDouble(dataGridViewRow.Index + 1)== Convert.ToInt32(count5))
- {
- if(dataGridViewRow.Cells[3].Value.ToString().Equals("0"))
- fai5 = 0;
- else
- fai5 = Convert.ToDouble(dataGridViewRow.Cells[3].Value);
- }
- if (Convert.ToDouble(dataGridViewRow.Index + 1) == Convert.ToInt32(count16))
- {
- if (dataGridViewRow.Cells[3].Value.ToString().Equals("0"))
- fai16 = 0;
- else
- fai16 = Convert.ToDouble(dataGridViewRow.Cells[3].Value);
- }
- if (Convert.ToDouble(dataGridViewRow.Index + 1) == Convert.ToInt32(count25))
- {
- if (dataGridViewRow.Cells[3].Value.ToString().Equals("0"))
- fai25 = 0;
- else
- fai25 = Convert.ToDouble(dataGridViewRow.Cells[3].Value);
- }
- if (Convert.ToDouble(dataGridViewRow.Index + 1) == Convert.ToInt32(count50))
- {
- if (dataGridViewRow.Cells[3].Value.ToString().Equals("0"))
- fai50 = 0;
- else
- fai50 = Convert.ToDouble(dataGridViewRow.Cells[3].Value);
- }
- if (Convert.ToDouble(dataGridViewRow.Index + 1) == Convert.ToInt32(count75))
- {
- if (dataGridViewRow.Cells[3].Value.ToString().Equals("0"))
- fai75 = 0;
- else
- fai75 = Convert.ToDouble(dataGridViewRow.Cells[3].Value);
- }
- if (Convert.ToDouble(dataGridViewRow.Index + 1) == Convert.ToInt32(count84))
- {
- if (dataGridViewRow.Cells[3].Value.ToString().Equals("0"))
- fai84 = 0;
- else
- fai84 = Convert.ToDouble(dataGridViewRow.Cells[3].Value);
- }
- if (Convert.ToDouble(dataGridViewRow.Index + 1) == Convert.ToInt32(count95))
- {
- if (dataGridViewRow.Cells[3].Value.ToString().Equals("0"))
- fai95 = 0;
- else
- fai95 = Convert.ToDouble(dataGridViewRow.Cells[3].Value);
- }
- }
- DataGridViewRow dataGridViewRow1 = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dataGridViewRow1.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dataGridViewRow1.Cells[0].Value = PdnResources.GetString("Menu.Graphicalmethod.text");
- dataGridViewRow1.Cells[1].Value = (fai16 + fai50 + fai84) / 3;
- dataGridViewRow1.Cells[2].Value = (fai84 - fai16) / 4 + (fai95 - fai5) / 6.6;
- dataGridViewRow1.Cells[3].Value = (fai16 + fai84 - 2 * fai50) / (2 * (fai84 - fai16)) + (fai5 + fai95 - 2 * fai50) / (2 * (fai95 - fai5));
- dataGridViewRow1.Cells[4].Value = (fai95 - fai5) / (2.44 * (fai75 - fai25));
- dataGridViewRow1.Cells[5].Value = PdnResources.GetString("Menu.Rocknamed.text");
- dataGridViewRow1.Cells[6].Value = fai5;
- dataGridViewRow1.Cells[7].Value = fai16;
- dataGridViewRow1.Cells[8].Value = fai25;
- dataGridViewRow1.Cells[9].Value = fai50;
- dataGridViewRow1.Cells[10].Value = fai75;
- dataGridViewRow1.Cells[11].Value = fai84;
- dataGridViewRow1.Cells[12].Value = fai95;
- this.dataGridViewRowsGraphic.Add(dataGridViewRow1);
- //
- // 矩阵法
- //
- //组值排序
- bouldersFais.Sort();
- coarseGravelFais.Sort();
- mediuGravelFais.Sort();
- fineGravelFais.Sort();
- giantSandFais.Sort();
- coarseSandFais.Sort();
- mediumSandFais.Sort();
- fineSandFais.Sort();
- superfineSandFais.Sort();
- coarseSiltFais.Sort();
- fineSiltFais.Sort();
- clayFais.Sort();
- // 组中值
- // 巨砾
- double medianBoulders = 0;
- // 粗砾
- double medianCoarseGravel = 0;
- // 中砾
- double medianMediuGravel = 0;
- // 细砾
- double medianFineGravel = 0;
- // 巨砂
- double medianGiantSand = 0;
- // 粗砂
- double medianCoarseSand = 0;
- // 中砂
- double medianMediumSand = 0;
- // 细砂
- double medianFineSand = 0;
- // 极细砂
- double medianSuperfineSand = 0;
- // 粗粉砂
- double medianCoarseSilt = 0;
- // 细粉砂
- double medianFineSilt = 0;
- // 粘土
- double medianClay = 0;
- if(bouldersFais.Count > 0)
- {
- if (bouldersFais.Count % 2 == 0)
- medianBoulders = (bouldersFais[bouldersFais.Count / 2 - 1] + bouldersFais[bouldersFais.Count / 2]) / 2;
- else
- medianBoulders = bouldersFais[(bouldersFais.Count - 1) / 2];
- }
- if (coarseGravelFais.Count > 0)
- {
- if (coarseGravelFais.Count % 2 == 0)
- medianCoarseGravel = (coarseGravelFais[coarseGravelFais.Count / 2 - 1] + coarseGravelFais[coarseGravelFais.Count / 2]) / 2;
- else
- medianCoarseGravel = coarseGravelFais[(coarseGravelFais.Count - 1) / 2];
- }
- if (mediuGravelFais.Count > 0)
- {
- if (mediuGravelFais.Count % 2 == 0)
- medianMediuGravel = (mediuGravelFais[mediuGravelFais.Count / 2 - 1] + mediuGravelFais[mediuGravelFais.Count / 2]) / 2;
- else
- medianMediuGravel = mediuGravelFais[(mediuGravelFais.Count - 1) / 2];
- }
- if (fineGravelFais.Count > 0)
- {
- if (fineGravelFais.Count % 2 == 0)
- medianFineGravel = (fineGravelFais[fineGravelFais.Count / 2 - 1] + fineGravelFais[fineGravelFais.Count / 2]) / 2;
- else
- medianFineGravel = fineGravelFais[(fineGravelFais.Count - 1) / 2];
- }
- if (giantSandFais.Count > 0)
- {
- if (giantSandFais.Count % 2 == 0)
- medianGiantSand = (giantSandFais[giantSandFais.Count / 2 - 1] + giantSandFais[giantSandFais.Count / 2]) / 2;
- else
- medianGiantSand = giantSandFais[(giantSandFais.Count - 1) / 2];
- }
- if (coarseSandFais.Count > 0)
- {
- if (coarseSandFais.Count % 2 == 0)
- medianCoarseSand = (coarseSandFais[coarseSandFais.Count / 2 - 1] + coarseSandFais[coarseSandFais.Count / 2]) / 2;
- else
- medianCoarseSand = coarseSandFais[(coarseSandFais.Count - 1) / 2];
- }
- if (mediumSandFais.Count > 0)
- {
- if (mediumSandFais.Count % 2 == 0)
- medianMediumSand = (mediumSandFais[mediumSandFais.Count / 2 - 1] + mediumSandFais[mediumSandFais.Count / 2]) / 2;
- else
- medianMediumSand = mediumSandFais[(mediumSandFais.Count - 1) / 2];
- }
- if (fineSandFais.Count > 0)
- {
- if (fineSandFais.Count % 2 == 0)
- medianFineSand = (fineSandFais[fineSandFais.Count / 2 - 1] + fineSandFais[fineSandFais.Count / 2]) / 2;
- else
- medianFineSand = fineSandFais[(fineSandFais.Count - 1) / 2];
- }
- if (superfineSandFais.Count > 0)
- {
- if (superfineSandFais.Count % 2 == 0)
- medianSuperfineSand = (superfineSandFais[superfineSandFais.Count / 2 - 1] + superfineSandFais[superfineSandFais.Count / 2]) / 2;
- else
- medianSuperfineSand = superfineSandFais[(superfineSandFais.Count - 1) / 2];
- }
- if (coarseSiltFais.Count > 0)
- {
- if (coarseSiltFais.Count % 2 == 0)
- medianCoarseSilt = (coarseSiltFais[coarseSiltFais.Count / 2 - 1] + coarseSiltFais[coarseSiltFais.Count / 2]) / 2;
- else
- medianCoarseSilt = coarseSiltFais[(coarseSiltFais.Count - 1) / 2];
- }
- if (fineSiltFais.Count > 0)
- {
- if (fineSiltFais.Count % 2 == 0)
- medianFineSilt = (fineSiltFais[fineSiltFais.Count / 2 - 1] + fineSiltFais[fineSiltFais.Count / 2]) / 2;
- else
- medianFineSilt = fineSiltFais[(fineSiltFais.Count - 1) / 2];
- }
- if (clayFais.Count > 0)
- {
- if (clayFais.Count % 2 == 0)
- medianClay = (clayFais[clayFais.Count / 2 - 1] + clayFais[clayFais.Count / 2]) / 2;
- else
- medianClay = clayFais[(clayFais.Count - 1) / 2];
- }
-
- // 组面积频率
- // 巨砾
- double fiBoulders = bouldersArea / allArea;
- // 粗砾
- double fiCoarseGravel = coarseGravelArea / allArea;
- // 中砾
- double fiMediuGravel = mediuGravelArea / allArea;
- // 细砾
- double fiFineGravel = fineGravelArea / allArea;
- // 巨砂
- double fiGiantSand = giantSandArea / allArea;
- // 粗砂
- double fiCoarseSand = coarseSandArea / allArea;
- // 中砂
- double fiMediumSand = mediumSandArea / allArea;
- // 细砂
- double fiFineSand = fineSandArea / allArea;
- // 极细砂
- double fiSuperfineSand = superfineSandArea / allArea;
- // 粗粉砂
- double fiCoarseSilt = coarseSiltArea / allArea;
- // 细粉砂
- double fiFineSilt = fineSiltArea / allArea;
- // 粘土
- double fiClay = clayArea / allArea;
- // 平均值
- double mz = (fiBoulders * medianBoulders + fiCoarseGravel * medianCoarseGravel + fiMediuGravel * medianCoarseGravel
- + fiFineGravel * medianFineGravel + fiGiantSand * medianGiantSand + fiCoarseSand * medianCoarseSand + fiMediumSand * medianMediumSand
- + fiFineSand * medianFineSand + fiSuperfineSand * medianSuperfineSand + fiCoarseSilt * medianCoarseSilt + fiFineSilt * medianFineSilt
- + fiClay * medianClay) / 100;
- // 标准偏差
- double a1 = Math.Sqrt((fiBoulders * Math.Pow((medianBoulders - mz), 2) + fiCoarseGravel * Math.Pow((medianCoarseGravel - mz), 2)
- + fiMediuGravel * Math.Pow((medianMediuGravel - mz), 2) + fiFineGravel * Math.Pow((medianFineGravel - mz), 2)
- + fiGiantSand * Math.Pow((medianGiantSand - mz), 2) + fiCoarseSand * Math.Pow((medianCoarseSand - mz), 2)
- + fiMediumSand * Math.Pow((medianMediumSand - mz), 2) + fiFineSand * Math.Pow((medianFineSand - mz), 2)
- + fiSuperfineSand * Math.Pow((medianSuperfineSand - mz), 2) + fiCoarseSilt * Math.Pow((medianCoarseSilt - mz), 2)
- + fiFineSilt * Math.Pow((medianFineSilt - mz), 2) + fiClay * Math.Pow((medianClay - mz), 2)) / 100);
- // 偏度
- double sk1 = (fiBoulders * Math.Pow((medianBoulders - mz), 3) + fiCoarseGravel * Math.Pow((medianCoarseGravel - mz), 3)
- + fiMediuGravel * Math.Pow((medianMediuGravel - mz), 3) + fiFineGravel * Math.Pow((medianFineGravel - mz), 3)
- + fiGiantSand * Math.Pow((medianGiantSand - mz), 3) + fiCoarseSand * Math.Pow((medianCoarseSand - mz), 3)
- + fiMediumSand * Math.Pow((medianMediumSand - mz), 3) + fiFineSand * Math.Pow((medianFineSand - mz), 3)
- + fiSuperfineSand * Math.Pow((medianSuperfineSand - mz), 3) + fiCoarseSilt * Math.Pow((medianCoarseSilt - mz), 3)
- + fiFineSilt * Math.Pow((medianFineSilt - mz), 3) + fiClay * Math.Pow((medianClay - mz), 3)) / (100 * Math.Pow(a1, 3));
- // 峰度
- double kg = (fiBoulders * Math.Pow((medianBoulders - mz), 4) + fiCoarseGravel * Math.Pow((medianCoarseGravel - mz), 4)
- + fiMediuGravel * Math.Pow((medianMediuGravel - mz), 4) + fiFineGravel * Math.Pow((medianFineGravel - mz), 4)
- + fiGiantSand * Math.Pow((medianGiantSand - mz), 4) + fiCoarseSand * Math.Pow((medianCoarseSand - mz), 4)
- + fiMediumSand * Math.Pow((medianMediumSand - mz), 4) + fiFineSand * Math.Pow((medianFineSand - mz), 4)
- + fiSuperfineSand * Math.Pow((medianSuperfineSand - mz), 4) + fiCoarseSilt * Math.Pow((medianCoarseSilt - mz), 4)
- + fiFineSilt * Math.Pow((medianFineSilt - mz), 4) + fiClay * Math.Pow((medianClay - mz), 4)) / (100 * Math.Pow(a1, 4));
- DataGridViewRow dataGridViewRow2 = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dataGridViewRow2.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dataGridViewRow2.Cells[0].Value = PdnResources.GetString("Menu.Matrixmethod.text");
- dataGridViewRow2.Cells[1].Value = mz;
- dataGridViewRow2.Cells[2].Value = a1;
- dataGridViewRow2.Cells[3].Value = sk1;
- dataGridViewRow2.Cells[4].Value = kg;
- dataGridViewRow2.Cells[5].Value = PdnResources.GetString("Menu.Rocknamed.text");
- dataGridViewRow2.Cells[6].Value = "-";
- dataGridViewRow2.Cells[7].Value = "-";
- dataGridViewRow2.Cells[8].Value = "-";
- dataGridViewRow2.Cells[9].Value = "-";
- dataGridViewRow2.Cells[10].Value = "-";
- dataGridViewRow2.Cells[11].Value = "-";
- dataGridViewRow2.Cells[12].Value = "-";
- this.dataGridViewRowsMatrix.Add(dataGridViewRow2);
- viewCount++;
- }
- this.dataGridView1.Sort(this.dataGridView1.Columns[1], ListSortDirection.Ascending);
- }
- #region 初始化
- private void InitializeLanguageText()
- {
- this.bc = new PaintDotNet.CustomControl.BinaryControl();
- //
- // bc
- //
- this.bc.BinaryBackColor = System.Drawing.Color.Red;
- this.bc.BinaryChecked = false;
- this.bc.BinaryStyle = 1;
- this.bc.Location = new System.Drawing.Point(155, 68);
- this.bc.Name = "bc";
- this.bc.OriginChecked = false;
- this.bc.scope1End = 0D;
- this.bc.scope1Start = 0D;
- this.bc.scope2End = 0D;
- this.bc.scope2Start = 0D;
- this.bc.scope3End = 0D;
- this.bc.scope3Start = 0D;
- this.bc.Size = new System.Drawing.Size(360, 292);
- this.bc.TabIndex = 19;
- this.Controls.Add(this.bc);
- this.Controls.SetChildIndex(this.bc, 0);
- this.groupBox1.Text = PdnResources.GetString("Menu.operation.text");
- this.button2.Text = PdnResources.GetString("Menu.Saveresult.text");
- this.checkBox2.Text = PdnResources.GetString("Menu.Opensettingsatingreport.text");
- this.button1.Text = PdnResources.GetString("Menu.Setting.Text");
- this.groupBox2.Text = PdnResources.GetString("Menu.Tools.ImageIndex.Text");
- this.groupBox7.Text = PdnResources.GetString("Menu.Preview.text");
- this.groupBox3.Text = PdnResources.GetString("Menu.paramssettings.text");
- this.checkBox4.Text = PdnResources.GetString("Menu.Matrixmethod.text");
- this.checkBox3.Text = PdnResources.GetString("Menu.Graphicalmethod.text");
- this.checkBox1.Text = PdnResources.GetString("Menu.Sieveanalysiscorrection.text");
- this.groupBox4.Text = PdnResources.GetString("Menu.displaysetting.text");
- this.label4.Text = PdnResources.GetString("Menu.color.text") + ":";
- this.label3.Text = PdnResources.GetString("Menu.color.text") + ":";
- this.label2.Text = PdnResources.GetString("Menu.Fontsize.text") + ":";
- this.label1.Text = PdnResources.GetString("Menu.Fontsize.text") + ":";
- this.checkBox6.Text = PdnResources.GetString("Menu.Displayparticlediameter.text");
- this.checkBox5.Text = PdnResources.GetString("Menu.Displayparticlenumber.text");
- this.groupBox5.Text = PdnResources.GetString("Menu.Theesultshow.text");
- this.dataGridViewTextBoxColumn9.HeaderText = PdnResources.GetString("Menu.view.text");
- this.dataGridViewTextBoxColumn10.HeaderText = PdnResources.GetString("Menu.Dedicatedanalysis.Non-ferrousmetals.serialnumber.text");
- this.dataGridViewTextBoxColumn11.HeaderText = PdnResources.GetString("Menu.diameter.text");
- this.dataGridViewTextBoxColumn12.HeaderText = "Φ" + PdnResources.GetString("Menu.Imagement.Measurementlist.value.text");
- this.dataGridViewTextBoxColumn3.HeaderText = PdnResources.GetString("Menu.Dedicatedanalysis.Non-ferrousmetals.serialnumber.text");
- this.Column11.HeaderText = PdnResources.GetString("Menu.view.text");
- this.dataGridViewTextBoxColumn4.HeaderText = PdnResources.GetString("Menu.diameter.text");
- this.dataGridViewTextBoxColumn5.HeaderText = "Φ" + PdnResources.GetString("Menu.Imagement.Measurementlist.value.text");
- this.groupBox8.Text = PdnResources.GetString("Menu.Analysisresult.text");
- this.dataGridViewTextBoxColumn1.HeaderText = PdnResources.GetString("Menu.Methodnames.text");
- this.dataGridViewTextBoxColumn2.HeaderText = PdnResources.GetString("Menu.averagevalue.text");
- this.dataGridViewTextBoxColumn6.HeaderText = PdnResources.GetString("Menu.standarddeviation.text");
- this.dataGridViewTextBoxColumn7.HeaderText = PdnResources.GetString("Menu.Partialdegrees.text");
- this.dataGridViewTextBoxColumn8.HeaderText = PdnResources.GetString("Menu.kurtosis.text");
- this.Column4.HeaderText = PdnResources.GetString("Menu.Rocknamed.text");
- this.button4.Text = PdnResources.GetString("Menu.Exportproject.text");
- this.button16.Text = PdnResources.GetString("Menu.Cancelshowall.text");
- this.label5.Text = PdnResources.GetString("Menu.Decimal.text") + ":";
- this.button14.Text = PdnResources.GetString("Menu.Exportresults.text");
- this.button13.Text = PdnResources.GetString("Menu.Tools.CreateReport.Text");
- this.Column1.HeaderText = PdnResources.GetString("Menu.picture.Text");
- this.Column2.HeaderText = PdnResources.GetString("Menu.view.text");
- this.Column5.HeaderText = PdnResources.GetString("Menu.Categories.text");
- this.Column6.HeaderText = PdnResources.GetString("Menu.Smallclass.text");
- this.Column7.HeaderText = PdnResources.GetString("Menu.Number.text");
- this.Column3.HeaderText = PdnResources.GetString("Menu.percent.text");
- this.button12.Text = PdnResources.GetString("Menu.Edit.Delete.Text");
- this.button11.Text = PdnResources.GetString("Menu.Showall.text");
- this.Text = PdnResources.GetString("Menu.Clastiparticlesizeanalysismethod.text");
- this.button3.Text = PdnResources.GetString("Menu.File.SaveAll.Text");
- this.button5.Text = PdnResources.GetString("Menu.Applyall.text");
- }
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.button3 = new System.Windows.Forms.Button();
- this.button5 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.checkBox2 = new System.Windows.Forms.CheckBox();
- this.button1 = new System.Windows.Forms.Button();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.listView1 = new System.Windows.Forms.ListView();
- this.imageList1 = new System.Windows.Forms.ImageList(this.components);
- this.groupBox7 = new System.Windows.Forms.GroupBox();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.checkBox4 = new System.Windows.Forms.CheckBox();
- this.checkBox3 = new System.Windows.Forms.CheckBox();
- this.checkBox1 = new System.Windows.Forms.CheckBox();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.panel2 = new System.Windows.Forms.Panel();
- this.panel1 = new System.Windows.Forms.Panel();
- this.numericUpDown3 = new System.Windows.Forms.NumericUpDown();
- this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
- this.label4 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
- this.checkBox6 = new System.Windows.Forms.CheckBox();
- this.checkBox5 = new System.Windows.Forms.CheckBox();
- this.groupBox5 = new System.Windows.Forms.GroupBox();
- this.dataGridView3 = new System.Windows.Forms.DataGridView();
- this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridView1 = new System.Windows.Forms.DataGridView();
- this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.groupBox8 = new System.Windows.Forms.GroupBox();
- this.dataGridView2 = new System.Windows.Forms.DataGridView();
- this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column13 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column14 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column15 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.button4 = new System.Windows.Forms.Button();
- this.listView2 = new System.Windows.Forms.ListView();
- this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
- this.button16 = new System.Windows.Forms.Button();
- this.label5 = new System.Windows.Forms.Label();
- this.button14 = new System.Windows.Forms.Button();
- this.button13 = new System.Windows.Forms.Button();
- this.dataGridView4 = new System.Windows.Forms.DataGridView();
- this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.button12 = new System.Windows.Forms.Button();
- this.button11 = new System.Windows.Forms.Button();
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.groupBox3.SuspendLayout();
- this.groupBox4.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
- this.groupBox5.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
- this.groupBox8.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).BeginInit();
- this.SuspendLayout();
- //
- // groupBox1
- //
- this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox1.Controls.Add(this.button3);
- this.groupBox1.Controls.Add(this.button5);
- this.groupBox1.Controls.Add(this.button2);
- this.groupBox1.Controls.Add(this.checkBox2);
- this.groupBox1.Controls.Add(this.button1);
- this.groupBox1.Location = new System.Drawing.Point(14, 12);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(1081, 50);
- this.groupBox1.TabIndex = 6;
- this.groupBox1.TabStop = false;
- //
- // button3
- //
- this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button3.Location = new System.Drawing.Point(991, 12);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(84, 30);
- this.button3.TabIndex = 19;
- this.button3.Text = "保存全部";
- this.button3.UseVisualStyleBackColor = false;
- this.button3.Click += new System.EventHandler(this.button3_Click);
- //
- // button5
- //
- this.button5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button5.Location = new System.Drawing.Point(811, 12);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(84, 30);
- this.button5.TabIndex = 18;
- this.button5.Text = "应用全部";
- this.button5.UseVisualStyleBackColor = false;
- this.button5.Click += new System.EventHandler(this.button5_Click);
- //
- // button2
- //
- this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button2.BackColor = System.Drawing.SystemColors.Control;
- this.button2.Location = new System.Drawing.Point(901, 12);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(84, 30);
- this.button2.TabIndex = 3;
- this.button2.UseVisualStyleBackColor = false;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // checkBox2
- //
- this.checkBox2.AutoSize = true;
- this.checkBox2.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
- this.checkBox2.Location = new System.Drawing.Point(105, 20);
- this.checkBox2.Name = "checkBox2";
- this.checkBox2.Size = new System.Drawing.Size(15, 14);
- this.checkBox2.TabIndex = 2;
- this.checkBox2.UseVisualStyleBackColor = true;
- //
- // button1
- //
- this.button1.BackColor = System.Drawing.SystemColors.Control;
- this.button1.Location = new System.Drawing.Point(15, 14);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(84, 30);
- this.button1.TabIndex = 0;
- this.button1.UseVisualStyleBackColor = false;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // groupBox2
- //
- this.groupBox2.Controls.Add(this.listView1);
- this.groupBox2.Location = new System.Drawing.Point(14, 68);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(135, 574);
- this.groupBox2.TabIndex = 7;
- this.groupBox2.TabStop = false;
- //
- // listView1
- //
- this.listView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.listView1.HideSelection = false;
- this.listView1.LargeImageList = this.imageList1;
- this.listView1.Location = new System.Drawing.Point(5, 17);
- this.listView1.MultiSelect = false;
- this.listView1.Name = "listView1";
- this.listView1.Size = new System.Drawing.Size(124, 551);
- this.listView1.TabIndex = 0;
- this.listView1.UseCompatibleStateImageBehavior = false;
- this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
- this.listView1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseDown);
- this.listView1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.listView1_MouseUp);
- //
- // imageList1
- //
- this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
- this.imageList1.ImageSize = new System.Drawing.Size(64, 64);
- this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
- //
- // groupBox7
- //
- this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox7.Location = new System.Drawing.Point(521, 68);
- this.groupBox7.Name = "groupBox7";
- this.groupBox7.Size = new System.Drawing.Size(580, 574);
- this.groupBox7.TabIndex = 20;
- this.groupBox7.TabStop = false;
- //
- // groupBox3
- //
- this.groupBox3.Controls.Add(this.checkBox4);
- this.groupBox3.Controls.Add(this.checkBox3);
- this.groupBox3.Controls.Add(this.checkBox1);
- this.groupBox3.Location = new System.Drawing.Point(155, 366);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(360, 62);
- this.groupBox3.TabIndex = 21;
- this.groupBox3.TabStop = false;
- //
- // checkBox4
- //
- this.checkBox4.AutoSize = true;
- this.checkBox4.Location = new System.Drawing.Point(102, 42);
- this.checkBox4.Name = "checkBox4";
- this.checkBox4.Size = new System.Drawing.Size(15, 14);
- this.checkBox4.TabIndex = 2;
- this.checkBox4.UseVisualStyleBackColor = true;
- this.checkBox4.CheckedChanged += new System.EventHandler(this.checkBox4_CheckedChanged);
- this.checkBox4.Click += new System.EventHandler(this.checkBox4_Click);
- //
- // checkBox3
- //
- this.checkBox3.AutoSize = true;
- this.checkBox3.Location = new System.Drawing.Point(18, 42);
- this.checkBox3.Name = "checkBox3";
- this.checkBox3.Size = new System.Drawing.Size(15, 14);
- this.checkBox3.TabIndex = 1;
- this.checkBox3.UseVisualStyleBackColor = true;
- this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged);
- this.checkBox3.Click += new System.EventHandler(this.checkBox3_Click);
- //
- // checkBox1
- //
- this.checkBox1.AutoSize = true;
- this.checkBox1.Location = new System.Drawing.Point(18, 20);
- this.checkBox1.Name = "checkBox1";
- this.checkBox1.Size = new System.Drawing.Size(15, 14);
- this.checkBox1.TabIndex = 0;
- this.checkBox1.UseVisualStyleBackColor = true;
- this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
- //
- // groupBox4
- //
- this.groupBox4.Controls.Add(this.panel2);
- this.groupBox4.Controls.Add(this.panel1);
- this.groupBox4.Controls.Add(this.numericUpDown3);
- this.groupBox4.Controls.Add(this.numericUpDown2);
- this.groupBox4.Controls.Add(this.label4);
- this.groupBox4.Controls.Add(this.label3);
- this.groupBox4.Controls.Add(this.label2);
- this.groupBox4.Controls.Add(this.label1);
- this.groupBox4.Controls.Add(this.checkBox6);
- this.groupBox4.Controls.Add(this.checkBox5);
- this.groupBox4.Location = new System.Drawing.Point(155, 434);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Size = new System.Drawing.Size(360, 62);
- this.groupBox4.TabIndex = 22;
- this.groupBox4.TabStop = false;
- //
- // panel2
- //
- this.panel2.BackColor = System.Drawing.Color.Yellow;
- this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panel2.Location = new System.Drawing.Point(266, 38);
- this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(74, 21);
- this.panel2.TabIndex = 12;
- this.panel2.BackColorChanged += new System.EventHandler(this.panel2_BackColorChanged);
- this.panel2.Click += new System.EventHandler(this.panel2_Click);
- //
- // panel1
- //
- this.panel1.BackColor = System.Drawing.Color.Blue;
- this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.panel1.Location = new System.Drawing.Point(266, 14);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(74, 21);
- this.panel1.TabIndex = 11;
- this.panel1.BackColorChanged += new System.EventHandler(this.panel1_BackColorChanged);
- this.panel1.Click += new System.EventHandler(this.panel1_Click);
- //
- // numericUpDown3
- //
- this.numericUpDown3.Location = new System.Drawing.Point(165, 40);
- this.numericUpDown3.Maximum = new decimal(new int[] {
- 49000,
- 0,
- 0,
- 0});
- this.numericUpDown3.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown3.Name = "numericUpDown3";
- this.numericUpDown3.Size = new System.Drawing.Size(54, 21);
- this.numericUpDown3.TabIndex = 10;
- this.numericUpDown3.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown3.ValueChanged += new System.EventHandler(this.numericUpDown3_ValueChanged);
- //
- // numericUpDown2
- //
- this.numericUpDown2.Location = new System.Drawing.Point(165, 15);
- this.numericUpDown2.Maximum = new decimal(new int[] {
- 49000,
- 0,
- 0,
- 0});
- this.numericUpDown2.Minimum = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown2.Name = "numericUpDown2";
- this.numericUpDown2.Size = new System.Drawing.Size(54, 21);
- this.numericUpDown2.TabIndex = 9;
- this.numericUpDown2.Value = new decimal(new int[] {
- 1,
- 0,
- 0,
- 0});
- this.numericUpDown2.ValueChanged += new System.EventHandler(this.numericUpDown2_ValueChanged);
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(226, 43);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(0, 12);
- this.label4.TabIndex = 8;
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(226, 18);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(0, 12);
- this.label3.TabIndex = 7;
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(128, 43);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(0, 12);
- this.label2.TabIndex = 6;
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(128, 19);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(0, 12);
- this.label1.TabIndex = 5;
- //
- // checkBox6
- //
- this.checkBox6.AutoSize = true;
- this.checkBox6.Location = new System.Drawing.Point(18, 42);
- this.checkBox6.Name = "checkBox6";
- this.checkBox6.Size = new System.Drawing.Size(15, 14);
- this.checkBox6.TabIndex = 4;
- this.checkBox6.UseVisualStyleBackColor = true;
- this.checkBox6.CheckedChanged += new System.EventHandler(this.checkBox6_CheckedChanged);
- //
- // checkBox5
- //
- this.checkBox5.AutoSize = true;
- this.checkBox5.Location = new System.Drawing.Point(18, 18);
- this.checkBox5.Name = "checkBox5";
- this.checkBox5.Size = new System.Drawing.Size(15, 14);
- this.checkBox5.TabIndex = 3;
- this.checkBox5.UseVisualStyleBackColor = true;
- this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged);
- //
- // groupBox5
- //
- this.groupBox5.Controls.Add(this.dataGridView3);
- this.groupBox5.Controls.Add(this.dataGridView1);
- this.groupBox5.Location = new System.Drawing.Point(155, 502);
- this.groupBox5.Name = "groupBox5";
- this.groupBox5.Size = new System.Drawing.Size(360, 140);
- this.groupBox5.TabIndex = 23;
- this.groupBox5.TabStop = false;
- //
- // dataGridView3
- //
- this.dataGridView3.AllowUserToAddRows = false;
- this.dataGridView3.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
- this.dataGridView3.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
- dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
- dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.dataGridView3.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
- this.dataGridView3.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView3.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.dataGridViewTextBoxColumn9,
- this.dataGridViewTextBoxColumn10,
- this.dataGridViewTextBoxColumn11,
- this.dataGridViewTextBoxColumn12});
- this.dataGridView3.Location = new System.Drawing.Point(6, 16);
- this.dataGridView3.MultiSelect = false;
- this.dataGridView3.Name = "dataGridView3";
- this.dataGridView3.ReadOnly = true;
- this.dataGridView3.RowHeadersVisible = false;
- this.dataGridView3.RowTemplate.Height = 23;
- this.dataGridView3.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
- this.dataGridView3.Size = new System.Drawing.Size(348, 118);
- this.dataGridView3.TabIndex = 3;
- this.dataGridView3.Visible = false;
- //
- // dataGridViewTextBoxColumn9
- //
- dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.dataGridViewTextBoxColumn9.DefaultCellStyle = dataGridViewCellStyle2;
- this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
- this.dataGridViewTextBoxColumn9.ReadOnly = true;
- //
- // dataGridViewTextBoxColumn10
- //
- dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.dataGridViewTextBoxColumn10.DefaultCellStyle = dataGridViewCellStyle3;
- this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
- this.dataGridViewTextBoxColumn10.ReadOnly = true;
- //
- // dataGridViewTextBoxColumn11
- //
- dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.dataGridViewTextBoxColumn11.DefaultCellStyle = dataGridViewCellStyle4;
- this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
- this.dataGridViewTextBoxColumn11.ReadOnly = true;
- //
- // dataGridViewTextBoxColumn12
- //
- dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.dataGridViewTextBoxColumn12.DefaultCellStyle = dataGridViewCellStyle5;
- this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
- this.dataGridViewTextBoxColumn12.ReadOnly = true;
- //
- // dataGridView1
- //
- this.dataGridView1.AllowUserToAddRows = false;
- this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
- this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
- dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
- dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6;
- this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.Column11,
- this.dataGridViewTextBoxColumn3,
- this.dataGridViewTextBoxColumn4,
- this.dataGridViewTextBoxColumn5});
- this.dataGridView1.Location = new System.Drawing.Point(6, 16);
- this.dataGridView1.MultiSelect = false;
- this.dataGridView1.Name = "dataGridView1";
- this.dataGridView1.ReadOnly = true;
- this.dataGridView1.RowHeadersVisible = false;
- this.dataGridView1.RowTemplate.Height = 23;
- this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
- this.dataGridView1.Size = new System.Drawing.Size(348, 118);
- this.dataGridView1.TabIndex = 2;
- //
- // Column11
- //
- dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.Column11.DefaultCellStyle = dataGridViewCellStyle7;
- this.Column11.Name = "Column11";
- this.Column11.ReadOnly = true;
- //
- // dataGridViewTextBoxColumn3
- //
- dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.dataGridViewTextBoxColumn3.DefaultCellStyle = dataGridViewCellStyle8;
- this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
- this.dataGridViewTextBoxColumn3.ReadOnly = true;
- //
- // dataGridViewTextBoxColumn4
- //
- dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle9;
- this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
- this.dataGridViewTextBoxColumn4.ReadOnly = true;
- //
- // dataGridViewTextBoxColumn5
- //
- dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.dataGridViewTextBoxColumn5.DefaultCellStyle = dataGridViewCellStyle10;
- this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
- this.dataGridViewTextBoxColumn5.ReadOnly = true;
- //
- // groupBox8
- //
- this.groupBox8.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox8.Controls.Add(this.dataGridView2);
- this.groupBox8.Controls.Add(this.button4);
- this.groupBox8.Controls.Add(this.listView2);
- this.groupBox8.Controls.Add(this.numericUpDown1);
- this.groupBox8.Controls.Add(this.button16);
- this.groupBox8.Controls.Add(this.label5);
- this.groupBox8.Controls.Add(this.button14);
- this.groupBox8.Controls.Add(this.button13);
- this.groupBox8.Controls.Add(this.dataGridView4);
- this.groupBox8.Controls.Add(this.button12);
- this.groupBox8.Controls.Add(this.button11);
- this.groupBox8.Location = new System.Drawing.Point(14, 648);
- this.groupBox8.Name = "groupBox8";
- this.groupBox8.Size = new System.Drawing.Size(1087, 273);
- this.groupBox8.TabIndex = 24;
- this.groupBox8.TabStop = false;
- //
- // dataGridView2
- //
- this.dataGridView2.AllowUserToAddRows = false;
- this.dataGridView2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.dataGridView2.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
- this.dataGridView2.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
- dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle11.Font = new System.Drawing.Font("宋体", 9F);
- dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.WindowText;
- dataGridViewCellStyle11.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.dataGridView2.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle11;
- this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.dataGridViewTextBoxColumn1,
- this.dataGridViewTextBoxColumn2,
- this.dataGridViewTextBoxColumn6,
- this.dataGridViewTextBoxColumn7,
- this.dataGridViewTextBoxColumn8,
- this.Column4,
- this.Column9,
- this.Column10,
- this.Column8,
- this.Column12,
- this.Column13,
- this.Column14,
- this.Column15});
- this.dataGridView2.Location = new System.Drawing.Point(228, 159);
- this.dataGridView2.Name = "dataGridView2";
- this.dataGridView2.ReadOnly = true;
- this.dataGridView2.RowHeadersVisible = false;
- this.dataGridView2.RowTemplate.Height = 23;
- this.dataGridView2.Size = new System.Drawing.Size(693, 108);
- this.dataGridView2.TabIndex = 24;
- //
- // dataGridViewTextBoxColumn1
- //
- dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle12;
- this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
- this.dataGridViewTextBoxColumn1.ReadOnly = true;
- //
- // dataGridViewTextBoxColumn2
- //
- dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle13;
- this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
- this.dataGridViewTextBoxColumn2.ReadOnly = true;
- //
- // dataGridViewTextBoxColumn6
- //
- dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.dataGridViewTextBoxColumn6.DefaultCellStyle = dataGridViewCellStyle14;
- this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
- this.dataGridViewTextBoxColumn6.ReadOnly = true;
- //
- // dataGridViewTextBoxColumn7
- //
- dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.dataGridViewTextBoxColumn7.DefaultCellStyle = dataGridViewCellStyle15;
- this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
- this.dataGridViewTextBoxColumn7.ReadOnly = true;
- //
- // dataGridViewTextBoxColumn8
- //
- dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.dataGridViewTextBoxColumn8.DefaultCellStyle = dataGridViewCellStyle16;
- this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
- this.dataGridViewTextBoxColumn8.ReadOnly = true;
- //
- // Column4
- //
- dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.Column4.DefaultCellStyle = dataGridViewCellStyle17;
- this.Column4.Name = "Column4";
- this.Column4.ReadOnly = true;
- //
- // Column9
- //
- dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.Column9.DefaultCellStyle = dataGridViewCellStyle18;
- this.Column9.HeaderText = "Φ5";
- this.Column9.Name = "Column9";
- this.Column9.ReadOnly = true;
- //
- // Column10
- //
- dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.Column10.DefaultCellStyle = dataGridViewCellStyle19;
- this.Column10.HeaderText = "Φ16";
- this.Column10.Name = "Column10";
- this.Column10.ReadOnly = true;
- //
- // Column8
- //
- dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.Column8.DefaultCellStyle = dataGridViewCellStyle20;
- this.Column8.HeaderText = "Φ25";
- this.Column8.Name = "Column8";
- this.Column8.ReadOnly = true;
- //
- // Column12
- //
- dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.Column12.DefaultCellStyle = dataGridViewCellStyle21;
- this.Column12.HeaderText = "Φ50";
- this.Column12.Name = "Column12";
- this.Column12.ReadOnly = true;
- //
- // Column13
- //
- dataGridViewCellStyle22.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.Column13.DefaultCellStyle = dataGridViewCellStyle22;
- this.Column13.HeaderText = "Φ75";
- this.Column13.Name = "Column13";
- this.Column13.ReadOnly = true;
- //
- // Column14
- //
- dataGridViewCellStyle23.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.Column14.DefaultCellStyle = dataGridViewCellStyle23;
- this.Column14.HeaderText = "Φ84";
- this.Column14.Name = "Column14";
- this.Column14.ReadOnly = true;
- //
- // Column15
- //
- dataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.Column15.DefaultCellStyle = dataGridViewCellStyle24;
- this.Column15.HeaderText = "Φ95";
- this.Column15.Name = "Column15";
- this.Column15.ReadOnly = true;
- //
- // button4
- //
- this.button4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button4.BackColor = System.Drawing.SystemColors.Control;
- this.button4.Location = new System.Drawing.Point(941, 102);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(128, 26);
- this.button4.TabIndex = 23;
- this.button4.UseVisualStyleBackColor = false;
- this.button4.Click += new System.EventHandler(this.button4_Click);
- //
- // listView2
- //
- this.listView2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.listView2.FullRowSelect = true;
- this.listView2.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
- this.listView2.HideSelection = false;
- this.listView2.Location = new System.Drawing.Point(16, 56);
- this.listView2.Name = "listView2";
- this.listView2.Size = new System.Drawing.Size(180, 210);
- this.listView2.TabIndex = 22;
- this.listView2.UseCompatibleStateImageBehavior = false;
- this.listView2.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.listView2_ItemSelectionChanged);
- this.listView2.SelectedIndexChanged += new System.EventHandler(this.listView2_SelectedIndexChanged);
- //
- // numericUpDown1
- //
- this.numericUpDown1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.numericUpDown1.Location = new System.Drawing.Point(997, 163);
- this.numericUpDown1.Maximum = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.numericUpDown1.Name = "numericUpDown1";
- this.numericUpDown1.Size = new System.Drawing.Size(56, 21);
- this.numericUpDown1.TabIndex = 21;
- this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
- //
- // button16
- //
- this.button16.BackColor = System.Drawing.SystemColors.Control;
- this.button16.Location = new System.Drawing.Point(15, 20);
- this.button16.Name = "button16";
- this.button16.Size = new System.Drawing.Size(93, 26);
- this.button16.TabIndex = 20;
- this.button16.UseVisualStyleBackColor = false;
- this.button16.Click += new System.EventHandler(this.button16_Click);
- //
- // label5
- //
- this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(958, 169);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(0, 12);
- this.label5.TabIndex = 18;
- //
- // button14
- //
- this.button14.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button14.BackColor = System.Drawing.SystemColors.Control;
- this.button14.Location = new System.Drawing.Point(941, 68);
- this.button14.Name = "button14";
- this.button14.Size = new System.Drawing.Size(128, 26);
- this.button14.TabIndex = 16;
- this.button14.UseVisualStyleBackColor = false;
- this.button14.Click += new System.EventHandler(this.button14_Click);
- //
- // button13
- //
- this.button13.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.button13.BackColor = System.Drawing.SystemColors.Control;
- this.button13.Location = new System.Drawing.Point(941, 34);
- this.button13.Name = "button13";
- this.button13.Size = new System.Drawing.Size(128, 26);
- this.button13.TabIndex = 12;
- this.button13.UseVisualStyleBackColor = false;
- this.button13.Click += new System.EventHandler(this.button13_Click);
- //
- // dataGridView4
- //
- this.dataGridView4.AllowUserToAddRows = false;
- this.dataGridView4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.dataGridView4.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
- this.dataGridView4.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
- dataGridViewCellStyle25.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- dataGridViewCellStyle25.BackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle25.Font = new System.Drawing.Font("宋体", 9F);
- dataGridViewCellStyle25.ForeColor = System.Drawing.SystemColors.WindowText;
- dataGridViewCellStyle25.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle25.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle25.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.dataGridView4.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle25;
- this.dataGridView4.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView4.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.Column1,
- this.Column2,
- this.Column5,
- this.Column6,
- this.Column7,
- this.Column3});
- this.dataGridView4.Location = new System.Drawing.Point(228, 20);
- this.dataGridView4.Name = "dataGridView4";
- this.dataGridView4.ReadOnly = true;
- this.dataGridView4.RowHeadersVisible = false;
- this.dataGridView4.RowTemplate.Height = 23;
- this.dataGridView4.Size = new System.Drawing.Size(693, 133);
- this.dataGridView4.TabIndex = 15;
- //
- // Column1
- //
- dataGridViewCellStyle26.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.Column1.DefaultCellStyle = dataGridViewCellStyle26;
- this.Column1.Name = "Column1";
- this.Column1.ReadOnly = true;
- //
- // Column2
- //
- dataGridViewCellStyle27.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.Column2.DefaultCellStyle = dataGridViewCellStyle27;
- this.Column2.Name = "Column2";
- this.Column2.ReadOnly = true;
- //
- // Column5
- //
- dataGridViewCellStyle28.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.Column5.DefaultCellStyle = dataGridViewCellStyle28;
- this.Column5.Name = "Column5";
- this.Column5.ReadOnly = true;
- //
- // Column6
- //
- dataGridViewCellStyle29.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.Column6.DefaultCellStyle = dataGridViewCellStyle29;
- this.Column6.Name = "Column6";
- this.Column6.ReadOnly = true;
- //
- // Column7
- //
- dataGridViewCellStyle30.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.Column7.DefaultCellStyle = dataGridViewCellStyle30;
- this.Column7.Name = "Column7";
- this.Column7.ReadOnly = true;
- //
- // Column3
- //
- dataGridViewCellStyle31.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;
- this.Column3.DefaultCellStyle = dataGridViewCellStyle31;
- this.Column3.Name = "Column3";
- this.Column3.ReadOnly = true;
- //
- // button12
- //
- this.button12.BackColor = System.Drawing.SystemColors.Control;
- this.button12.Location = new System.Drawing.Point(145, 20);
- this.button12.Name = "button12";
- this.button12.Size = new System.Drawing.Size(52, 26);
- this.button12.TabIndex = 13;
- this.button12.UseVisualStyleBackColor = false;
- this.button12.Click += new System.EventHandler(this.button12_Click);
- //
- // button11
- //
- this.button11.BackColor = System.Drawing.SystemColors.Control;
- this.button11.Location = new System.Drawing.Point(15, 20);
- this.button11.Name = "button11";
- this.button11.Size = new System.Drawing.Size(63, 26);
- this.button11.TabIndex = 12;
- this.button11.UseVisualStyleBackColor = false;
- this.button11.Click += new System.EventHandler(this.button11_Click);
- //
- // GrainSizeAnalysisMethodOfClasticRockDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
- this.ClientSize = new System.Drawing.Size(1107, 933);
- this.Controls.Add(this.groupBox8);
- this.Controls.Add(this.groupBox5);
- this.Controls.Add(this.groupBox4);
- this.Controls.Add(this.groupBox3);
- this.Controls.Add(this.groupBox7);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox1);
- this.Name = "GrainSizeAnalysisMethodOfClasticRockDialog";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.InclusionsStandardDialog_FormClosing);
- this.Load += new System.EventHandler(this.GrainSizeAnalysisMethodOfClasticRockDialog_Load);
- this.Shown += new System.EventHandler(this.ShownChoiseItemAndInitData);
- this.Controls.SetChildIndex(this.groupBox1, 0);
- this.Controls.SetChildIndex(this.groupBox2, 0);
- this.Controls.SetChildIndex(this.groupBox7, 0);
- this.Controls.SetChildIndex(this.groupBox3, 0);
- this.Controls.SetChildIndex(this.groupBox4, 0);
- this.Controls.SetChildIndex(this.groupBox5, 0);
- this.Controls.SetChildIndex(this.groupBox8, 0);
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.groupBox2.ResumeLayout(false);
- this.groupBox3.ResumeLayout(false);
- this.groupBox3.PerformLayout();
- this.groupBox4.ResumeLayout(false);
- this.groupBox4.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
- this.groupBox5.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
- this.groupBox8.ResumeLayout(false);
- this.groupBox8.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).EndInit();
- this.ResumeLayout(false);
- }
- #endregion
- private void colorsFormUserPrimaryColorChanged(object sender, ColorEventArgs ce)
- {
- }
- private void panel1_Click(object sender, EventArgs e)
- {
- this.colorsForm1.UserPrimaryColor = ColorBgra.FromColor(this.panel1.BackColor);
- this.colorsForm1.setSaveBtn_Click(new System.EventHandler(this.panel1Changed));
- this.colorsForm1.ShowDialog();
- }
- private void panel1Changed(object sender, EventArgs e)
- {
- this.panel1.BackColor = this.colorsForm1.UserPrimaryColor.ToColor();
- this.colorsForm1.Close();
- }
- private void panel2_Click(object sender, EventArgs e)
- {
- this.colorsForm2.UserPrimaryColor = ColorBgra.FromColor(this.panel2.BackColor);
- this.colorsForm2.setSaveBtn_Click(new System.EventHandler(this.panel2Changed));
- this.colorsForm2.ShowDialog();
- }
- private void panel2Changed(object sender, EventArgs e)
- {
- this.panel2.BackColor = this.colorsForm2.UserPrimaryColor.ToColor();
- this.colorsForm2.Close();
- }
- /// <summary>
- /// ListView图片选择改变事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void listView1_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (this.listView1.FocusedItem != null && this.listView1.FocusedItem.Selected)
- {
- this.unitLength = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRuler(MeasurementUnit.Millimeter);
- GetListParamModel();
- //double physical_area_length_Micron = getCurrentWorkspace().GetRuler(MeasurementUnit.Micron);
- existViewFlag = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GraphicsList.IsExsitView();
- this.imageMat = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreatedAliasedMat();
- if (!existViewFlag)
- matOrg = imageMat.Clone();
- else
- matOrg = PaintDotNet.Camera.Tools.ToMat(this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetFullSizeWithRegion());
-
- //二值化集成4
- binaryClass.listView1_SelectedIndexChangedNoCheckedChanged(this.imageMat.Clone(), this.imageList1.Images.Keys[this.listView1.FocusedItem.Index]);
- if (bcOriginChecked())
- {
- this.documentWorkspace.PhaseModels[0].choise = false;
- this.documentWorkspace.PhaseModels[1].choise = false;
- this.documentWorkspace.Refresh();
- }
- ScreeningSpheroidizedTissue();
- RefrashResultData();
- //if (this.grainBoundryCheckBox.Checked)
- //{
- // this.documentWorkspace.PhaseModels[1].choise = true;
- // this.applyDect();
- //}
- }
- }
- /// <summary>
- /// 颗粒编号改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown2_ValueChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 颗粒直径改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown3_ValueChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 字体颜色改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void panel1_BackColorChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 字体颜色改变
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void panel2_BackColorChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 画布绘制
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Panel_Paint(object sender, PaintEventArgs e)
- {
- if (this.documentWorkspace.CompositionSurface != null)
- {
- //
- // 以下是计算绘制图片的位置和大小并绘制图片
- //
- System.Drawing.Rectangle rc = this.documentWorkspace.panel.ClientRectangle;
- int width = (int)(this.documentWorkspace.CompositionSurface.Width * this.documentWorkspace.ScaleFactor.Ratio);
- int height = (int)(this.documentWorkspace.CompositionSurface.Height * this.documentWorkspace.ScaleFactor.Ratio);
- int x = (rc.Width < width) ? this.documentWorkspace.panel.AutoScrollPosition.X : (rc.Width - width) / 2;
- int y = (rc.Height < height) ? this.documentWorkspace.panel.AutoScrollPosition.Y : (rc.Height - height) / 2;
- //
- // 以下是绘制网格、标注、测量、视场等开始
- //
- e.Graphics.TranslateTransform(x, y);
- e.Graphics.ScaleTransform((float)this.documentWorkspace.ScaleFactor.Ratio, (float)this.documentWorkspace.ScaleFactor.Ratio);
- Draw(e.Graphics);
- e.Graphics.ScaleTransform(1 / (float)this.documentWorkspace.ScaleFactor.Ratio, 1 / (float)this.documentWorkspace.ScaleFactor.Ratio);
- e.Graphics.TranslateTransform(-x, -y);
- }
- }
- private void Draw(Graphics graphics)
- {
- foreach (var keyValuePair in keyValuePairs)
- {
- if (keyValuePair.Count > 0)
- {
- if (this.checkBox5.Checked && this.checkBox6.Checked)
- {
- foreach (var item in keyValuePair)
- {
- 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));
- SizeF sizeF = graphics.MeasureString("(" + item.Value[1] + ")", new Font("宋体", (float)this.numericUpDown2.Value));
- 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));
- }
- }
- else if (!this.checkBox5.Checked && this.checkBox6.Checked)
- {
- foreach (var item in keyValuePair)
- {
- 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));
- }
- }
- else if (this.checkBox5.Checked && !this.checkBox6.Checked)
- {
- foreach (var item in keyValuePair)
- {
- 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));
- }
- }
- }
- }
- }
- /// <summary>
- /// 是否显示编号
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void checkBox5_CheckedChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 是否显示直径
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void checkBox6_CheckedChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 图解法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void checkBox3_CheckedChanged(object sender, EventArgs e)
- {
- if(this.checkBox3.Checked)
- {
- this.checkBox4.Checked = false;
- this.dataGridView2.Columns[6].Visible = true;
- this.dataGridView2.Columns[7].Visible = true;
- this.dataGridView2.Columns[8].Visible = true;
- this.dataGridView2.Columns[9].Visible = true;
- this.dataGridView2.Columns[10].Visible = true;
- this.dataGridView2.Columns[11].Visible = true;
- this.dataGridView2.Columns[12].Visible = true;
- }
- else
- {
- this.dataGridView2.Columns[6].Visible = false;
- this.dataGridView2.Columns[7].Visible = false;
- this.dataGridView2.Columns[8].Visible = false;
- this.dataGridView2.Columns[9].Visible = false;
- this.dataGridView2.Columns[10].Visible = false;
- this.dataGridView2.Columns[11].Visible = false;
- this.dataGridView2.Columns[12].Visible = false;
- }
- RefreshStatistics();
- }
- /// <summary>
- /// 矩阵法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void checkBox4_CheckedChanged(object sender, EventArgs e)
- {
- if (this.checkBox4.Checked)
- {
- this.checkBox3.Checked = false;
- }
- RefreshStatistics();
- }
- /// <summary>
- /// 筛析校正
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- RefrashResultData();
- }
- /// <summary>
- /// 图解法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void checkBox3_Click(object sender, EventArgs e)
- {
- if (!this.checkBox4.Checked)
- checkBox3.Checked = true;
- }
- /// <summary>
- /// 矩阵法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void checkBox4_Click(object sender, EventArgs e)
- {
- if (!this.checkBox3.Checked)
- checkBox4.Checked = true;
- }
- /// <summary>
- /// 小数变化
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown1_ValueChanged(object sender, EventArgs e)
- {
- RefrashResultData();
- RefreshDataGridView4();
- RefreshStatistics();
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 保存结果
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button2_Click(object sender, EventArgs e)
- {
- if (this.listView1.SelectedItems.Count == 0)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapicture.text")+"!");
- return;
- }
- if (this.dataGridView1.Rows.Count == 0)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Noresultdata.text")+"!");
- return;
- }
- string imgName = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetFriendlyName();
- string tag = this.imageList1.Images.Keys[this.listView1.SelectedItems[0].Index];
- DataTable dataTable = new DataTable();
- bool replace = false;
- int add = 0;
- foreach (ListViewItem item in this.listView2.Items)
- {
- if (item.Tag.Equals(tag))
- {
- add++;
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Theresuethertoreplace.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
- if (dr == DialogResult.OK)
- {
- replace = true;
- this.listView2.Items.Remove(item);
- foreach (var keyValuePairs in keyValuePairsAll)
- {
- if (keyValuePairs.Key.Equals(tag))
- {
- this.keyValuePairsAll.Remove(tag);
- break;
- }
- }
- foreach (var graphicMethod in graphicMethods)
- {
- if (graphicMethod.Key.Equals(tag))
- {
- this.graphicMethods.Remove(tag);
- break;
- }
- }
- foreach (var matrixMethod in matrixMethods)
- {
- if (matrixMethod.Key.Equals(tag))
- {
- this.matrixMethods.Remove(tag);
- break;
- }
- }
- }
- break;
- }
- }
- if (replace || this.listView2.Items.Count == 0 || add == 0)
- {
- this.keyValuePairsAll.Add(tag, this.keyValuePairs);
- this.graphicMethods.Add(tag, this.dataGridViewRowsGraphic);
- this.matrixMethods.Add(tag, this.dataGridViewRowsMatrix);
- ListViewItem listViewItem = new ListViewItem();
- listViewItem.SubItems[0].Text = imgName;
- listViewItem.Tag = "" + tag;
- if (this.listView2.Items.Count == 0)
- this.listView2.Items.Add(listViewItem);
- else
- this.listView2.Items.Insert(0, listViewItem);
- this.dataGridView4.Rows.Clear();
- for (int i = 0; i < keyValuePairs.Count; i++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = tag;
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = imgName;
- dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
- dgvr.Cells[2].Value = PdnResources.GetString("Menu.gravel.text");
- dgvr.Cells[3].Value = PdnResources.GetString("Menu.boulder.text");
- dgvr.Cells[4].Value = 0;
- dgvr.Cells[5].Value = 0;
- this.dataGridView4.Rows.Add(dgvr);
- dgvr = new DataGridViewRow();
- dgvr.Tag = tag;
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = imgName;
- dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
- dgvr.Cells[2].Value = PdnResources.GetString("Menu.gravel.text");
- dgvr.Cells[3].Value = PdnResources.GetString("Menu.boulwder.text");
- dgvr.Cells[4].Value = 0;
- dgvr.Cells[5].Value = 0;
- this.dataGridView4.Rows.Add(dgvr);
- dgvr = new DataGridViewRow();
- dgvr.Tag = tag;
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = imgName;
- dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
- dgvr.Cells[2].Value = PdnResources.GetString("Menu.gravel.text");
- dgvr.Cells[3].Value = PdnResources.GetString("Menu.Thegravel.text");
- dgvr.Cells[4].Value = 0;
- dgvr.Cells[5].Value = 0;
- this.dataGridView4.Rows.Add(dgvr);
- dgvr = new DataGridViewRow();
- dgvr.Tag = tag;
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = imgName;
- dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
- dgvr.Cells[2].Value = PdnResources.GetString("Menu.gravel.text");
- dgvr.Cells[3].Value = PdnResources.GetString("Menu.Finegravel.text");
- dgvr.Cells[4].Value = 0;
- dgvr.Cells[5].Value = 0;
- this.dataGridView4.Rows.Add(dgvr);
- dgvr = new DataGridViewRow();
- dgvr.Tag = tag;
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = imgName;
- dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
- dgvr.Cells[2].Value = PdnResources.GetString("Menu.sand.text");
- dgvr.Cells[3].Value = PdnResources.GetString("Menu.bigsand.text");
- dgvr.Cells[4].Value = 0;
- dgvr.Cells[5].Value = 0;
- this.dataGridView4.Rows.Add(dgvr);
- dgvr = new DataGridViewRow();
- dgvr.Tag = tag;
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = imgName;
- dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
- dgvr.Cells[2].Value = PdnResources.GetString("Menu.sand.text");
- dgvr.Cells[3].Value = PdnResources.GetString("Menu.Coarsesand.text");
- dgvr.Cells[4].Value = 0;
- dgvr.Cells[5].Value = 0;
- this.dataGridView4.Rows.Add(dgvr);
- dgvr = new DataGridViewRow();
- dgvr.Tag = tag;
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = imgName;
- dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
- dgvr.Cells[2].Value = PdnResources.GetString("Menu.sand.text");
- dgvr.Cells[3].Value = PdnResources.GetString("Menu.Mediumsand.text");
- dgvr.Cells[4].Value = 0;
- dgvr.Cells[5].Value = 0;
- this.dataGridView4.Rows.Add(dgvr);
- dgvr = new DataGridViewRow();
- dgvr.Tag = tag;
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = imgName;
- dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
- dgvr.Cells[2].Value = PdnResources.GetString("Menu.sand.text");
- dgvr.Cells[3].Value = PdnResources.GetString("Menu.Finesand.text");
- dgvr.Cells[4].Value = 0;
- dgvr.Cells[5].Value = 0;
- this.dataGridView4.Rows.Add(dgvr);
- dgvr = new DataGridViewRow();
- dgvr.Tag = tag;
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = imgName;
- dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
- dgvr.Cells[2].Value = PdnResources.GetString("Menu.sand.text");
- dgvr.Cells[3].Value = PdnResources.GetString("Menu.Veryfinesand.text");
- dgvr.Cells[4].Value = 0;
- dgvr.Cells[5].Value = 0;
- this.dataGridView4.Rows.Add(dgvr);
- dgvr = new DataGridViewRow();
- dgvr.Tag = tag;
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = imgName;
- dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
- dgvr.Cells[2].Value = PdnResources.GetString("Menu.silt.text");
- dgvr.Cells[3].Value = PdnResources.GetString("Menu.Coarsesilt.text");
- dgvr.Cells[4].Value = 0;
- dgvr.Cells[5].Value = 0;
- this.dataGridView4.Rows.Add(dgvr);
- dgvr = new DataGridViewRow();
- dgvr.Tag = tag;
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = imgName;
- dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
- dgvr.Cells[2].Value = PdnResources.GetString("Menu.silt.text");
- dgvr.Cells[3].Value = PdnResources.GetString("Menu.Fineowdersand.text");
- dgvr.Cells[4].Value = 0;
- dgvr.Cells[5].Value = 0;
- this.dataGridView4.Rows.Add(dgvr);
- dgvr = new DataGridViewRow();
- dgvr.Tag = tag;
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = imgName;
- dgvr.Cells[1].Value = PdnResources.GetString("Menu.view.text") + i;
- dgvr.Cells[2].Value = PdnResources.GetString("Menu.clay.text");
- dgvr.Cells[3].Value = "-";
- dgvr.Cells[4].Value = 0;
- dgvr.Cells[5].Value = 0;
- this.dataGridView4.Rows.Add(dgvr);
- }
- double index = 0;
- // 巨砾
- double boulders = 0;
- // 粗砾
- double coarseGravel = 0;
- // 中砾
- double mediuGravel = 0;
- // 细砾
- double fineGravel = 0;
- // 巨砂
- double giantSand = 0;
- // 粗砂
- double coarseSand = 0;
- // 中砂
- double mediumSand = 0;
- // 细砂
- double fineSand = 0;
- // 极细砂
- double superfineSand = 0;
- // 粗粉砂
- double coarseSilt = 0;
- // 细粉砂
- double fineSilt = 0;
- // 粘土
- double clay = 0;
- // 总和
- double all = 0;
- foreach (var keyValuePair in keyValuePairs)
- {
- // 巨砾
- boulders = 0;
- // 粗砾
- coarseGravel = 0;
- // 中砾
- mediuGravel = 0;
- // 细砾
- fineGravel = 0;
- // 巨砂
- giantSand = 0;
- // 粗砂
- coarseSand = 0;
- // 中砂
- mediumSand = 0;
- // 细砂
- fineSand = 0;
- // 极细砂
- superfineSand = 0;
- // 粗粉砂
- coarseSilt = 0;
- // 细粉砂
- fineSilt = 0;
- // 粘土
- clay = 0;
- foreach (var item in keyValuePair)
- {
- // 巨砾
- if (item.Value[0] > 256) boulders++;
- // 粗砾
- if (item.Value[0] > 64 && item.Value[0] <= 256) coarseGravel++;
- // 中砾
- if (item.Value[0] > 4 && item.Value[0] <= 64) mediuGravel++;
- // 细砾
- if (item.Value[0] > 2 && item.Value[0] <= 4) fineGravel++;
- // 巨砂
- if (item.Value[0] > 1 && item.Value[0] <= 2) giantSand++;
- // 粗砂
- if (Convert.ToDouble( item.Value[0]) > 0.5 && item.Value[0] <= 1) coarseSand++;
- // 中砂
- if (Convert.ToDouble(item.Value[0]) > 0.25 && Convert.ToDouble(item.Value[0]) <= 0.5) mediumSand++;
- // 细砂
- if (Convert.ToDouble(item.Value[0]) > 0.125 && Convert.ToDouble(item.Value[0]) <= 0.25) fineSand++;
- // 极细砂
- if (Convert.ToDouble(item.Value[0]) > 0.0625 && Convert.ToDouble(item.Value[0]) <= 0.125) superfineSand++;
- // 粗粉砂
- if (Convert.ToDouble(item.Value[0]) > 0.0312 && Convert.ToDouble(item.Value[0]) <= 0.0625) coarseSilt++;
- // 细粉砂
- if (Convert.ToDouble(item.Value[0]) > 0.0039 && Convert.ToDouble(item.Value[0]) <= 0.0312) fineSilt++;
- // 粘土
- if (Convert.ToDouble(item.Value[0]) <= 0.0039) clay++;
- }
- all = boulders + coarseGravel + mediuGravel + fineGravel + giantSand
- + coarseSand + mediumSand + fineSand + superfineSand + coarseSilt + fineSilt + clay;
- foreach (DataGridViewRow dataGridViewRow in this.dataGridView4.Rows)
- {
- if(dataGridViewRow.Cells[1].Value.Equals(PdnResources.GetString("Menu.view.text") + index))
- {
- if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.boulder.text")))
- {
- dataGridViewRow.Cells[4].Value = boulders;
- dataGridViewRow.Cells[5].Value = Math.Round(boulders / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
- }
- else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.boulwder.text")))
- {
- dataGridViewRow.Cells[4].Value = coarseGravel;
- dataGridViewRow.Cells[5].Value = Math.Round(coarseGravel / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
- }
- else if(dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Thegravel.text")))
- {
- dataGridViewRow.Cells[4].Value = mediuGravel;
- dataGridViewRow.Cells[5].Value = Math.Round(mediuGravel / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
- }
- else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Finegravel.text")))
- {
- dataGridViewRow.Cells[4].Value = fineGravel;
- dataGridViewRow.Cells[5].Value = Math.Round(fineGravel / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
- }
- else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.bigsand.text")))
- {
- dataGridViewRow.Cells[4].Value = giantSand;
- dataGridViewRow.Cells[5].Value = Math.Round(giantSand / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
- }
- else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Coarsesand.text")))
- {
- dataGridViewRow.Cells[4].Value = coarseSand;
- dataGridViewRow.Cells[5].Value = Math.Round(coarseSand / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
- }
- else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Mediumsand.text")))
- {
- dataGridViewRow.Cells[4].Value = mediumSand;
- dataGridViewRow.Cells[5].Value = Math.Round(mediumSand / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
- }
- else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Finesand.text")))
- {
- dataGridViewRow.Cells[4].Value = fineSand;
- dataGridViewRow.Cells[5].Value = Math.Round(fineSand / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
- }
- else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Veryfinesand.text")))
- {
- dataGridViewRow.Cells[4].Value = superfineSand;
- dataGridViewRow.Cells[5].Value = Math.Round(superfineSand / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
- }
- else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Coarsesilt.text")))
- {
- dataGridViewRow.Cells[4].Value = coarseSilt;
- dataGridViewRow.Cells[5].Value = Math.Round(coarseSilt / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
- }
- else if (dataGridViewRow.Cells[3].Value.Equals(PdnResources.GetString("Menu.Fineowdersand.text")))
- {
- dataGridViewRow.Cells[4].Value = fineSilt;
- dataGridViewRow.Cells[5].Value = Math.Round(fineSilt / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
- }
- else if (dataGridViewRow.Cells[2].Value.Equals(PdnResources.GetString("Menu.clay.text")))
- {
- dataGridViewRow.Cells[4].Value = clay;
- dataGridViewRow.Cells[5].Value = Math.Round(clay / all, Convert.ToInt32(this.numericUpDown1.Value)) * 100 + "%";
- }
- }
- }
- index++;
- }
- dataTable.TableName = tag;
- foreach (System.Data.DataTable dataTable1 in dataTables)
- {
- if (dataTable1.TableName.Equals(dataTable.TableName))
- {
- dataTables.Remove(dataTable1);
- break;
- }
- }
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dataTable.Columns.Add(c.HeaderText);
- }
- for (int i = 0; i < keyValuePairs.Count; i++)
- {
- DataRow dataRow = dataTable.NewRow();
- dataRow[0] = imgName;
- dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
- dataRow[2] = PdnResources.GetString("Menu.gravel.text");
- dataRow[3] = PdnResources.GetString("Menu.boulder.text");
- dataRow[4] = boulders;
- dataRow[5] = boulders / all * 100;
- dataTable.Rows.Add(dataRow);
- dataRow = dataTable.NewRow();
- dataRow[0] = imgName;
- dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
- dataRow[2] = PdnResources.GetString("Menu.gravel.text");
- dataRow[3] = PdnResources.GetString("Menu.boulwder.text");
- dataRow[4] = coarseGravel;
- dataRow[5] = coarseGravel / all * 100;
- dataTable.Rows.Add(dataRow);
- dataRow = dataTable.NewRow();
- dataRow[0] = imgName;
- dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
- dataRow[2] = PdnResources.GetString("Menu.gravel.text");
- dataRow[3] = PdnResources.GetString("Menu.Thegravel.text");
- dataRow[4] = mediuGravel;
- dataRow[5] = mediuGravel / all * 100;
- dataTable.Rows.Add(dataRow);
- dataRow = dataTable.NewRow();
- dataRow[0] = imgName;
- dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
- dataRow[2] = PdnResources.GetString("Menu.gravel.text");
- dataRow[3] = PdnResources.GetString("Menu.Finegravel.text");
- dataRow[4] = fineGravel;
- dataRow[5] = fineGravel / all * 100;
- dataTable.Rows.Add(dataRow);
- dataRow = dataTable.NewRow();
- dataRow[0] = imgName;
- dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
- dataRow[2] = PdnResources.GetString("Menu.sand.text");
- dataRow[3] = PdnResources.GetString("Menu.bigsand.text");
- dataRow[4] = giantSand;
- dataRow[5] = giantSand / all * 100;
- dataTable.Rows.Add(dataRow);
- dataRow = dataTable.NewRow();
- dataRow[0] = imgName;
- dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
- dataRow[2] = PdnResources.GetString("Menu.sand.text");
- dataRow[3] = PdnResources.GetString("Menu.Coarsesand.text");
- dataRow[4] = coarseSand;
- dataRow[5] = coarseSand / all * 100;
- dataTable.Rows.Add(dataRow);
- dataRow = dataTable.NewRow();
- dataRow[0] = imgName;
- dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
- dataRow[2] = PdnResources.GetString("Menu.sand.text");
- dataRow[3] = PdnResources.GetString("Menu.Mediumsand.text");
- dataRow[4] = mediumSand;
- dataRow[5] = mediumSand / all * 100;
- dataTable.Rows.Add(dataRow);
- dataRow = dataTable.NewRow();
- dataRow[0] = imgName;
- dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
- dataRow[2] = PdnResources.GetString("Menu.sand.text");
- dataRow[3] = PdnResources.GetString("Menu.Finesand.text");
- dataRow[4] = fineSand;
- dataRow[5] = fineSand / all * 100;
- dataTable.Rows.Add(dataRow);
- dataRow = dataTable.NewRow();
- dataRow[0] = imgName;
- dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
- dataRow[2] = PdnResources.GetString("Menu.sand.text");
- dataRow[3] = PdnResources.GetString("Menu.Veryfinesand.text");
- dataRow[4] = superfineSand;
- dataRow[5] = superfineSand / all * 100;
- dataTable.Rows.Add(dataRow);
- dataRow = dataTable.NewRow();
- dataRow[0] = imgName;
- dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
- dataRow[2] = PdnResources.GetString("Menu.silt.text");
- dataRow[3] = PdnResources.GetString("Menu.Coarsesilt.text");
- dataRow[4] = coarseSilt;
- dataRow[5] = coarseSilt / all * 100;
- dataTable.Rows.Add(dataRow);
- dataRow = dataTable.NewRow();
- dataRow[0] = imgName;
- dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
- dataRow[2] = PdnResources.GetString("Menu.silt.text");
- dataRow[3] = PdnResources.GetString("Menu.Fineowdersand.text");
- dataRow[4] = fineSilt;
- dataRow[5] = fineSilt / all * 100;
- dataTable.Rows.Add(dataRow);
- dataRow = dataTable.NewRow();
- dataRow[0] = imgName;
- dataRow[1] = PdnResources.GetString("Menu.view.text") + i;
- dataRow[2] = PdnResources.GetString("Menu.Theclay.text");
- dataRow[3] = "-";
- dataRow[4] = clay;
- dataRow[5] = clay / all * 100;
- dataTable.Rows.Add(dataRow);
- }
- this.dataTables.Add(dataTable);
- if (this.allShow)
- AllShow();
- this.listView2.Items[0].Selected = true;
- //保存处理后的图片
- double pantographRatio = (double)this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRulerMultiple(MeasurementUnit.Micron);//标尺*放大倍数
- List<Bitmap> tempBit = new List<Bitmap>();
- Bitmap originalBit = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreateAliasedBitmap();
- originalBit.Tag = pantographRatio;
- tempBit.Add(originalBit);
- //Mat mat = new Mat();
- //this.documentWorkspace.PhaseModels[0].mat.CopyTo(mat);
- Bitmap processedBit = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(this.documentWorkspace.PhaseModels[0].mat.Clone());
- Bitmap newBit = originalBit.Clone(new System.Drawing.Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].FieldBitmap(newBit);
- //Mat mat = new Mat();
- //this.documentWorkspace.PhaseModels[0].mat.CopyTo(mat);
- //Bitmap newBit = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat);
- Graphics graphics = Graphics.FromImage(newBit);
- graphics.DrawImage(processedBit, new PointF(0, 0));
- Draw(graphics);
- newBit.Tag = pantographRatio;
- tempBit.Add(newBit);
- if (bitDic.ContainsKey(tag))
- bitDic[tag] = tempBit;
- else
- bitDic.Add(tag, tempBit);
- //拼接中间数据
- List<List<string>> dataList = new List<List<string>>();
- List<string> columnName = new List<string>();
- columnName.Add(PdnResources.GetString("Menu.Imagement.Measurementlist.ordernumber.text"));
- columnName.Add(PdnResources.GetString("Menu.diameter.text"));
- columnName.Add("Φ"+ PdnResources.GetString("Menu.Imagement.Measurementlist.value.text"));
- dataList.Add(columnName);
- int no = 0;
- foreach (var keyValuePairs in keyValuePairsAll)
- {
- foreach (var item in keyValuePairs.Value)
- {
- foreach (var value in item)
- {
- no++;
- List<string> strList = new List<string>();
- strList.Add("" + no);
- strList.Add("" + value.Value[0]);
- strList.Add("" + value.Value[1]);
- dataList.Add(strList);
- }
- }
- }
- bool isExist = false;//是否已存在进行替换
- int modelIndex = -1;//要替换的下标
- for (int j = 0; j < tempDataModel.Count; j++)
- {
- if (tempDataModel[j].tagName.Equals(tag))
- {
- isExist = true;
- modelIndex = j;
- break;
- }
- }
- if (isExist && modelIndex > -1)
- tempDataModel[modelIndex].dataList = dataList;
- else
- {
- ExportProjectModel newModel = new ExportProjectModel();
- newModel.tagName = tag;
- newModel.picName = imgName;
- newModel.dataList = dataList;
- tempDataModel.Add(newModel);
- }
- }
- }
- /// <summary>
- /// 取消全部显示
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button16_Click(object sender, EventArgs e)
- {
- this.allShow = false;
- this.button11.Visible = true;
- this.button16.Visible = false;
- if (this.listView2.Items.Count > 0)
- {
- if (this.listView2.SelectedItems.Count > 0)
- {
- List<int> dataTableIndex = new List<int>();
- if (this.dataTables.Count == 0)
- return;
- for (int i = 0; i < this.dataTables.Count; i++)
- {
- foreach (ListViewItem item in this.listView2.SelectedItems)
- {
- if (this.dataTables[i].TableName.Equals(item.Tag))
- dataTableIndex.Add(i);
- }
- }
- this.dataGridView4.Rows.Clear();
- foreach (var item in dataTableIndex)
- {
- if (this.dataTables[item].Rows.Count > 0)
- {
- for (int r = 0; r < this.dataTables[item].Rows.Count; r++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = this.dataTables[item].TableName;
- foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < this.dataTables[item].Columns.Count; c++)
- {
- if (c == this.dataTables[item].Columns.Count - 1)
- dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.dataTables[item].Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString() + "%";
- else
- dgvr.Cells[c].Value = this.dataTables[item].Rows[r][c].ToString();
- }
- this.dataGridView4.Rows.Add(dgvr);
- }
- }
- }
- }
- else
- {
- this.listView2.Items[0].Selected = true;
- if (this.dataTables.Count > 0
- && this.dataTables[this.dataTables.Count - 1].Rows.Count > 0)
- {
- this.dataGridView4.Rows.Clear();
- for (int r = 0; r < this.dataTables[this.dataTables.Count - 1].Rows.Count; r++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = this.dataTables[this.dataTables.Count - 1].TableName;
- foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < this.dataTables[this.dataTables.Count - 1].Columns.Count; c++)
- {
- if (c == this.dataTables[this.dataTables.Count - 1].Columns.Count - 1)
- dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.dataTables[this.dataTables.Count - 1].Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString() + "%";
- else
- dgvr.Cells[c].Value = this.dataTables[this.dataTables.Count - 1].Rows[r][c].ToString();
- }
- this.dataGridView4.Rows.Add(dgvr);
- }
- }
- }
- }
- }
- /// <summary>
- /// 分析结果删除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button12_Click(object sender, EventArgs e)
- {
- if (this.listView2.Items.Count > 0)
- {
- if (this.listView2.SelectedItems.Count > 0)
- {
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretodeletethisanalysisresult.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
- if (dr == DialogResult.OK)
- {
- List<string> detaleName = new List<string>();
- int selectIndex = this.listView2.SelectedItems[0].Index;
- foreach (ListViewItem item in this.listView2.SelectedItems)
- {
- detaleName.Add(item.Tag.ToString());
- this.listView2.Items.Remove(item);
- }
- foreach (string tag in detaleName)
- {
- foreach (DataTable dataTable in this.dataTables)
- {
- if (dataTable.TableName.Equals(tag))
- {
- this.dataTables.Remove(dataTable);
- break;
- }
- }
- if (bitDic.ContainsKey(tag))
- bitDic.Remove(tag);
- foreach (ExportProjectModel model in this.tempDataModel)
- {
- if (model.tagName.Equals(tag))
- {
- this.tempDataModel.Remove(model);
- break;
- }
- }
- this.keyValuePairsAll.Remove(tag);
- this.graphicMethods.Remove(tag);
- this.matrixMethods.Remove(tag);
- }
- if (this.listView2.Items.Count > 0)
- {
- if (selectIndex == 0)
- this.listView2.Items[0].Selected = true;
- else
- this.listView2.Items[selectIndex - 1].Selected = true;
- RefreshDataGridView4();
- }
- else
- {
- this.dataGridView4.Rows.Clear();
- }
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselecttheanalysisresulttodelete.text")+"!");
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Nodataintheanalysisresults.text")+"!");
- }
- }
- /// <summary>
- /// 刷新分析结果数据
- /// </summary>
- private void RefreshDataGridView4()
- {
- if (!this.allShow)
- {
- if (this.listView2.SelectedItems.Count > 0)
- {
- List<int> dataTableIndex = new List<int>();
- for (int i = 0; i < this.dataTables.Count; i++)
- {
- foreach (ListViewItem item in this.listView2.SelectedItems)
- {
- if (this.dataTables[i].TableName.Equals(item.Tag))
- dataTableIndex.Add(i);
- }
- }
- if (this.dataTables.Count == 0)
- return;
- this.dataGridView4.Rows.Clear();
- foreach (var item in dataTableIndex)
- {
- if (this.dataTables[item].Rows.Count > 0)
- {
- for (int r = 0; r < this.dataTables[item].Rows.Count; r++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = this.dataTables[item].TableName;
- foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < this.dataTables[item].Columns.Count; c++)
- {
- if (c != this.dataTables[item].Columns.Count - 1)
- dgvr.Cells[c].Value = this.dataTables[item].Rows[r][c].ToString();
- else
- dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.dataTables[item].Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString() + "%";
- }
- this.dataGridView4.Rows.Add(dgvr);
- }
- }
- }
- }
- }
- else
- {
- this.dataGridView4.Rows.Clear();
- DataTable dataTable = new DataTable();
- for (int i = this.dataTables.Count - 1; i >= 0; i--)
- {
- dataTable = this.dataTables[i];
- for (int r = 0; r < dataTable.Rows.Count; r++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = dataTable.TableName;
- foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < dataTable.Columns.Count; c++)
- {
- if (c != dataTable.Columns.Count - 1)
- dgvr.Cells[c].Value = dataTable.Rows[r][c].ToString();
- else
- dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(dataTable.Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString() + "%";
- }
- this.dataGridView4.Rows.Add(dgvr);
- }
- }
- }
- }
- /// <summary>
- /// 未选择分析结果
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void listView2_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
- {
- if (!this.allShow)
- {
- if (this.listView2.SelectedItems.Count == 0)
- {
- this.dataGridView4.Rows.Clear();
- this.dataGridView2.Rows.Clear();
- }
- }
- }
- /// <summary>
- /// 切换分析结果
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void listView2_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (!this.allShow)
- {
- if (this.listView2.SelectedItems.Count > 0)
- {
- List<int> dataTableIndex = new List<int>();
- if (this.dataTables.Count == 0)
- return;
- for (int i = 0; i < this.dataTables.Count; i++)
- {
- foreach (ListViewItem item in this.listView2.SelectedItems)
- {
- if (this.dataTables[i].TableName.Equals(item.Tag))
- dataTableIndex.Add(i);
- }
- }
- this.dataGridView4.Rows.Clear();
- foreach (var item in dataTableIndex)
- {
- if (this.dataTables[item].Rows.Count > 0)
- {
- for (int r = 0; r < this.dataTables[item].Rows.Count; r++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = this.dataTables[item].TableName;
- foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < this.dataTables[item].Columns.Count; c++)
- {
- if (c == this.dataTables[item].Columns.Count - 1)
- dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.dataTables[item].Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString() + "%";
- else
- dgvr.Cells[c].Value = this.dataTables[item].Rows[r][c].ToString();
- }
- this.dataGridView4.Rows.Add(dgvr);
- }
- }
- }
- }
- }
- RefreshStatistics();
- }
- /// <summary>
- /// 刷新结果数据
- /// </summary>
- private void RefreshStatistics()
- {
- if (this.listView2.SelectedItems.Count == 0 && !this.allShow)
- return;
- this.dataGridView2.Rows.Clear();
- //
- // 岩石定名
- //
- // 大类
- // 砾百分比
- double percentageGravel = 0;
- // 砂百分比
- double percentageSand = 0;
- // 粉砂百分比
- double percentageSilt = 0;
- // 粘土百分比
- double percentageClay = 0;
- // 小类
- // 巨砾百分比
- double percentageBoulders = 0;
- // 粗砾百分比
- double percentageCoarseGravel = 0;
- // 中砾百分比
- double percentageMediuGravel = 0;
- // 细砾百分比
- double percentageFineGravel = 0;
- // 巨砂百分比
- double percentageGiantSand = 0;
- // 粗砂百分比
- double percentageCoarseSand = 0;
- // 中砂百分比
- double percentageMediumSand = 0;
- // 细砂百分比
- double percentageFineSand = 0;
- // 极细砂百分比
- double percentageSuperfineSand = 0;
- // 粗粉砂百分比
- double percentageCoarseSilt = 0;
- // 细粉砂百分比
- double percentageFineSilt = 0;
- foreach (DataTable dataTable in dataTables)
- {
- foreach (ListViewItem listViewItem in this.listView2.SelectedItems)
- {
- if(dataTable.TableName.Equals(listViewItem.Tag))
- {
- for (int r = 0; r < dataTable.Rows.Count; r++)
- {
- if (dataTable.Rows[r][2].Equals(PdnResources.GetString("Menu.gravel.text")))
- {
- percentageGravel += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- else if (dataTable.Rows[r][2].Equals(PdnResources.GetString("Menu.sand.text")))
- {
- percentageSand += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- else if (dataTable.Rows[r][2].Equals(PdnResources.GetString("Menu.silt.text")))
- {
- percentageSilt += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- else if (dataTable.Rows[r][2].Equals(PdnResources.GetString("Menu.clay.text")))
- {
- percentageClay += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.boulder.text")))
- {
- percentageBoulders += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.boulwder.text")))
- {
- percentageCoarseGravel += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Thegravel.text")))
- {
- percentageMediuGravel += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Finegravel.text")))
- {
- percentageFineGravel += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.bigsand.text")))
- {
- percentageGiantSand += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Coarsesand.text")))
- {
- percentageCoarseSand += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Mediumsand.text")))
- {
- percentageMediumSand += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Finesand.text")))
- {
- percentageFineSand += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Veryfinesand.text")))
- {
- percentageSuperfineSand += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Coarsesilt.text")))
- {
- percentageCoarseSilt += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- else if (dataTable.Rows[r][3].Equals(PdnResources.GetString("Menu.Fineowdersand.text")))
- {
- percentageFineSilt += Convert.ToDouble(dataTable.Rows[r][5]);
- }
- }
- }
- }
- }
- // 岩石定名(主)
- string rockNamingFirst = string.Empty;
- if(percentageGravel >= 50 || percentageSand >= 50 || percentageSilt >= 50 || percentageClay >= 50)
- {
- // 砾
- if (percentageGravel >= 50)
- {
- rockNamingFirst = PdnResources.GetString("Menu.conglomerate.text");
- // 其中小类大于等于50%
- if (percentageBoulders >= 50)
- rockNamingFirst = PdnResources.GetString("Menu.Thegiantconglomerate.text");
- else if (percentageCoarseGravel >= 50)
- rockNamingFirst = PdnResources.GetString("Menu.Coarseconglomerate.text");
- else if (percentageMediuGravel >= 50)
- rockNamingFirst = PdnResources.GetString("Menu.Theconglomerate.text");
- else if (percentageFineGravel >= 50)
- rockNamingFirst = PdnResources.GetString("Menu.Fineconglomerate.text");
- // 另有小类大于等于50%小于25%
- if (percentageBoulders >= 25 && percentageBoulders < 50)
- rockNamingFirst = PdnResources.GetString("Menu.Bouldemass.text") + rockNamingFirst;
- else if (percentageCoarseGravel >= 25 && percentageCoarseGravel < 50)
- rockNamingFirst = PdnResources.GetString("Menu.cobbly.text") + rockNamingFirst;
- else if (percentageMediuGravel >= 25 && percentageMediuGravel < 50)
- rockNamingFirst = PdnResources.GetString("Menu.Thegraveql.text") + rockNamingFirst;
- else if (percentageFineGravel >= 25 && percentageFineGravel < 50)
- rockNamingFirst = PdnResources.GetString("Menu.Finegraveql.text") + rockNamingFirst;
- // 砂
- if (percentageSand >= 25 && percentageSand < 50)
- rockNamingFirst = PdnResources.GetString("Menu.sandyq.text") + rockNamingFirst;
- // 粉砂
- else if (percentageSilt >= 25 && percentageSilt < 50)
- rockNamingFirst = PdnResources.GetString("Menu.siltyq.text") + rockNamingFirst;
- // 粘土
- else if (percentageClay >= 25 && percentageClay < 50)
- rockNamingFirst = PdnResources.GetString("Menu.clayq.text") + rockNamingFirst;
- // 砂
- if (percentageSand >= 10 && percentageSand < 25)
- rockNamingFirst = PdnResources.GetString("Menu.sandqa.text") + rockNamingFirst;
- // 粉砂
- else if (percentageSilt >= 10 && percentageSilt < 25)
- rockNamingFirst = PdnResources.GetString("Menu.Containingsilty.text") + rockNamingFirst;
- // 粘土
- else if (percentageClay >= 10 && percentageClay < 25)
- rockNamingFirst = PdnResources.GetString("Menu.Containclay.text") + rockNamingFirst;
- }
- // 砂
- else if (percentageSand >= 50)
- {
- rockNamingFirst = PdnResources.GetString("Menu.sandstone.text");
- if (percentageGiantSand >= 50 || percentageCoarseSand >= 50 || percentageMediumSand >= 50
- || percentageFineSand >= 50 || percentageSuperfineSand >= 50)
- {
- // 其中小类大于等于50%
- if (percentageGiantSand >= 50)
- rockNamingFirst = PdnResources.GetString("Menu.Thegiantsandstone.text");
- else if (percentageCoarseSand >= 50)
- rockNamingFirst = PdnResources.GetString("Menu.grit.text");
- else if (percentageMediumSand >= 50)
- rockNamingFirst = PdnResources.GetString("Menu.Sandstoneinthe.text");
- else if (percentageFineSand >= 50)
- rockNamingFirst = PdnResources.GetString("Menu.Finesandstone.text");
- else if (percentageSuperfineSand >= 50)
- rockNamingFirst = PdnResources.GetString("Menu.Veryfinesandstone.text");
- // 另有小类大于等于25%小于50%
- if (percentageGiantSand >= 25 && percentageGiantSand < 50)
- rockNamingFirst = PdnResources.GetString("Menu.Thegiantsand.text") + rockNamingFirst;
- else if (percentageCoarseSand >= 25 && percentageCoarseSand < 50)
- rockNamingFirst = PdnResources.GetString("Menu.Coqarsesand.text") + rockNamingFirst;
- else if (percentageMediumSand >= 25 && percentageMediumSand < 50)
- rockNamingFirst = PdnResources.GetString("Menu.Mediumsandmass.text") + rockNamingFirst;
- else if (percentageFineSand >= 25 && percentageFineSand < 50)
- rockNamingFirst = PdnResources.GetString("Menu.Fineqsandy.text") + rockNamingFirst;
- else if (percentageSuperfineSand >= 25 && percentageSuperfineSand < 50)
- rockNamingFirst = PdnResources.GetString("Menu.Fineqsandy.text") + rockNamingFirst;
- }
- // 各小类均低于50%
- else
- {
- if (percentageGiantSand >= 25 && percentageCoarseSand >= 25 && percentageMediumSand < 25 && percentageFineSand < 25 && percentageSuperfineSand < 25)
- {
- if (percentageGiantSand > percentageCoarseSand) rockNamingFirst = PdnResources.GetString("Menu.Coarsesandgiantsandstone.text");
- else if (percentageGiantSand < percentageCoarseSand) rockNamingFirst = PdnResources.GetString("Menu.Giantgritsandstone.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Coarsesandgiantsandstone.text");
- }
- else if (percentageGiantSand >= 25 && percentageMediumSand >= 25 && percentageCoarseSand < 25 && percentageFineSand < 25 && percentageSuperfineSand < 25)
- {
- if (percentageGiantSand > percentageMediumSand) rockNamingFirst = PdnResources.GetString("Menu.Middlesandgiantsandstone.text");
- else if (percentageGiantSand < percentageMediumSand) rockNamingFirst = PdnResources.GetString("Menu.Giantsandstone.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Middlesandgiantsandstone.text");
- }
- else if (percentageGiantSand >= 25 && percentageFineSand >= 25 && percentageCoarseSand < 25 && percentageMediumSand < 25 && percentageSuperfineSand < 25)
- {
- if (percentageGiantSand > percentageFineSand) rockNamingFirst = PdnResources.GetString("Menu.Finegiantsandstone.text");
- else if (percentageGiantSand < percentageFineSand) rockNamingFirst = PdnResources.GetString("Menu.Giantfinesandstone.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Finegiantsandstone.text");
- }
- else if (percentageGiantSand >= 25 && percentageSuperfineSand >= 25 && percentageCoarseSand < 25 && percentageMediumSand < 25 && percentageFineSand < 25)
- {
- if (percentageGiantSand > percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Extremelyfinegiansandstone.text");
- else if (percentageGiantSand < percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Megareniteveryfinesandstone.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Extremelyfinegiansandstone.text");
- }
- else if (percentageCoarseSand >= 25 && percentageMediumSand >= 25 && percentageGiantSand < 25 && percentageFineSand < 25 && percentageSuperfineSand < 25)
- {
- if (percentageCoarseSand > percentageMediumSand) rockNamingFirst = PdnResources.GetString("Menu.Mediumsandcoarsesandstone.text");
- else if (percentageCoarseSand < percentageMediumSand) rockNamingFirst = PdnResources.GetString("Menu.Sandstoneincoarsesand.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Mediumsandcoarsesandstone.text");
- }
- else if (percentageCoarseSand >= 25 && percentageFineSand >= 25 && percentageGiantSand < 25 && percentageMediumSand < 25 && percentageSuperfineSand < 25)
- {
- if (percentageCoarseSand > percentageFineSand) rockNamingFirst = PdnResources.GetString("Menu.Finesandandcoarsesandstone.text");
- else if (percentageCoarseSand < percentageFineSand) rockNamingFirst = PdnResources.GetString("Menu.Coarssandandfineandstone.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Finesandandcoarsesandstone.text");
- }
- else if (percentageCoarseSand >= 25 && percentageSuperfineSand >= 25 && percentageGiantSand < 25 && percentageMediumSand < 25 && percentageFineSand < 25)
- {
- if (percentageCoarseSand > percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Veryfinesandcoarsesandstone.text");
- else if (percentageCoarseSand < percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Coarsesandveryfinesandstone.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Veryfinesandcoarsesandstone.text");
- }
- else if (percentageMediumSand >= 25 && percentageFineSand >= 25 && percentageGiantSand < 25 && percentageCoarseSand < 25 && percentageSuperfineSand < 25)
- {
- if (percentageMediumSand > percentageFineSand) rockNamingFirst = PdnResources.GetString("Menu.Finesanmediumsandstone.text");
- else if (percentageMediumSand < percentageFineSand) rockNamingFirst = PdnResources.GetString("Menu.Mediumsandfinesandstone.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Finesanmediumsandstone.text");
- }
- else if (percentageMediumSand >= 25 && percentageSuperfineSand >= 25 && percentageGiantSand < 25 && percentageCoarseSand < 25 && percentageFineSand < 25)
- {
- if (percentageMediumSand > percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Mediumsandstoneofveryfinesand.text");
- else if (percentageMediumSand < percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Mediumsandveryfinesandstone.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Mediumsandstoneofveryfinesand.text");
- }
- else if (percentageFineSand >= 25 && percentageSuperfineSand >= 25 && percentageGiantSand < 25 && percentageCoarseSand < 25 && percentageMediumSand < 25)
- {
- if (percentageFineSand > percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Veryfinesandfinesandstone.text");
- else if (percentageFineSand < percentageSuperfineSand) rockNamingFirst = PdnResources.GetString("Menu.Finesandveryfinesandstone.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Veryfinesandfinesandstone.text");
- }
- else
- {
- rockNamingFirst = PdnResources.GetString("Menu.Unequalsandstone.text");
- }
- }
- // 砾
- if (percentageGravel >= 25 && percentageGravel < 50)
- rockNamingFirst = PdnResources.GetString("Menu.graveal.text") + rockNamingFirst;
- // 粉砂
- else if (percentageSilt >= 25 && percentageSilt < 50)
- rockNamingFirst = PdnResources.GetString("Menu.siltyq.text") + rockNamingFirst;
- // 粘土
- else if (percentageClay >= 25 && percentageClay < 50)
- rockNamingFirst = PdnResources.GetString("Menu.clayq.text") + rockNamingFirst;
- // 砾
- if (percentageGravel >= 10 && percentageGravel < 25)
- rockNamingFirst = PdnResources.GetString("Menu.conglomerati.text") + rockNamingFirst;
- // 粉砂
- else if (percentageSilt >= 10 && percentageSilt < 25)
- rockNamingFirst = PdnResources.GetString("Menu.Containingsilty.text") + rockNamingFirst;
- // 粘土
- else if (percentageClay >= 10 && percentageClay < 25)
- rockNamingFirst = PdnResources.GetString("Menu.Containclay.text") + rockNamingFirst;
- }
- // 粉砂
- else if (percentageSilt >= 50)
- {
- rockNamingFirst = PdnResources.GetString("Menu.siltstone.text");
- // 其中小类大于等于50%
- if (percentageCoarseSilt >= 50)
- rockNamingFirst = PdnResources.GetString("Menu.Coarsesiltstone.text");
- else if (percentageFineSilt >= 50)
- rockNamingFirst = PdnResources.GetString("Menu.Finesiltstone.text");
- // 另有小类大于等于50%小于25%
- if (percentageCoarseSilt >= 25 && percentageCoarseSilt < 50)
- rockNamingFirst = PdnResources.GetString("Menu.Thicksilty.text") + rockNamingFirst;
- else if (percentageFineSilt >= 25 && percentageFineSilt < 50)
- rockNamingFirst = PdnResources.GetString("Menu.Finesilty.text") + rockNamingFirst;
- // 砾
- if (percentageGravel >= 25 && percentageGravel < 50)
- rockNamingFirst = PdnResources.GetString("Menu.graveal.text") + rockNamingFirst;
- // 砂
- else if (percentageSand >= 25 && percentageSand < 50)
- rockNamingFirst = PdnResources.GetString("Menu.sandyq.text") + rockNamingFirst;
- // 粘土
- else if (percentageClay >= 25 && percentageClay < 50)
- rockNamingFirst = PdnResources.GetString("Menu.clayq.text") + rockNamingFirst;
- // 砾
- if (percentageGravel >= 10 && percentageGravel < 25)
- rockNamingFirst = PdnResources.GetString("Menu.conglomerati.text") + rockNamingFirst;
- // 砂
- else if (percentageSand >= 10 && percentageSand < 25)
- rockNamingFirst = PdnResources.GetString("Menu.sandqa.text") + rockNamingFirst;
- // 粘土
- else if (percentageClay >= 10 && percentageClay < 25)
- rockNamingFirst = PdnResources.GetString("Menu.Containclay.text") + rockNamingFirst;
- }
- // 粘土
- else if (percentageClay >= 50)
- {
- rockNamingFirst = PdnResources.GetString("Menu.Clayrock.text");
- // 砾
- if (percentageGravel >= 25 && percentageGravel < 50)
- rockNamingFirst = PdnResources.GetString("Menu.graveal.text") + rockNamingFirst;
- // 砂
- else if (percentageSand >= 25 && percentageSand < 50)
- rockNamingFirst = PdnResources.GetString("Menu.sandyq.text") + rockNamingFirst;
- // 粉砂
- else if (percentageSilt >= 25 && percentageSilt < 50)
- rockNamingFirst = PdnResources.GetString("Menu.siltyq.text") + rockNamingFirst;
- // 砾
- if (percentageGravel >= 25 && percentageGravel < 50)
- rockNamingFirst = PdnResources.GetString("Menu.conglomerati.text") + rockNamingFirst;
- // 砂
- else if (percentageSand >= 25 && percentageSand < 50)
- rockNamingFirst = PdnResources.GetString("Menu.sandqa.text") + rockNamingFirst;
- // 粉砂
- else if (percentageSilt >= 25 && percentageSilt < 50)
- rockNamingFirst = PdnResources.GetString("Menu.Containingsilty.text") + rockNamingFirst;
- }
- }
- // 均低于50%
- else
- {
- if(percentageGravel >= 25 && percentageSand >= 25 && percentageSilt < 25 && percentageClay < 25)
- {
- if (percentageGravel > percentageSand) rockNamingFirst = PdnResources.GetString("Menu.glutenite.text");
- else if (percentageGravel < percentageSand) rockNamingFirst = PdnResources.GetString("Menu.Gravelsandstone.text");
- else rockNamingFirst = PdnResources.GetString("Menu.glutenite.text");
- }
- else if (percentageGravel >= 25 && percentageSilt >= 25 && percentageSand < 25 && percentageClay < 25)
- {
- if (percentageGravel > percentageSilt) rockNamingFirst = PdnResources.GetString("Menu.Powderglutenite.text");
- else if (percentageGravel < percentageSilt) rockNamingFirst = PdnResources.GetString("Menu.Gravelsiltston.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Powderglutenite.text");
- }
- else if(percentageGravel >= 25 && percentageClay >= 25 && percentageSand < 25 && percentageSilt < 25)
- {
- if (percentageGravel > percentageClay) rockNamingFirst = PdnResources.GetString("Menu.Clayconglomerate.text");
- else if (percentageGravel < percentageClay) rockNamingFirst = PdnResources.GetString("Menu.Boulderclayrock.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Clayconglomerate.text");
- }
- else if (percentageSand >= 25 && percentageSilt >= 25 && percentageGravel < 25 && percentageClay < 25)
- {
- if (percentageSand > percentageSilt) rockNamingFirst = PdnResources.GetString("Menu.Siltysandstone.text");
- else if (percentageSand < percentageSilt) rockNamingFirst = PdnResources.GetString("Menu.Sandsiltstone.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Siltysandstone.text");
- }
- else if (percentageSand >= 25 && percentageClay >= 25 && percentageGravel < 25 && percentageSilt < 25)
- {
- if (percentageSand > percentageClay) rockNamingFirst = PdnResources.GetString("Menu.Clasand.text");
- else if (percentageSand < percentageClay) rockNamingFirst = PdnResources.GetString("Menu.Sandclayrock.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Clasand.text");
- }
- else if (percentageSilt >= 25 && percentageClay >= 25 && percentageGravel < 25 && percentageSand < 25)
- {
- if (percentageSilt > percentageClay) rockNamingFirst = PdnResources.GetString("Menu.Claysiltstone.text");
- else if (percentageSilt < percentageClay) rockNamingFirst = PdnResources.GetString("Menu.Siltyclaystone.text");
- else rockNamingFirst = PdnResources.GetString("Menu.Claysiltstone.text");
- }
- else
- {
- rockNamingFirst = PdnResources.GetString("Menu.Mixedclasticrock.text");
- }
- }
- // 图解法
- if (this.checkBox3.Checked)
- {
- //平均值
- double sumMz = 0;
- // 标准偏差
- double sumA = 0;
- // 偏度
- double sumSK1 = 0;
- // 峰度
- double sumKg = 0;
- // Φ5
- double sumF5 = 0;
- // Φ16
- double sumF16 = 0;
- // Φ25
- double sumF25 = 0;
- // Φ50
- double sumF50 = 0;
- // Φ75
- double sumF75 = 0;
- // Φ84
- double sumF84 = 0;
- // Φ95
- double sumF95 = 0;
- int count = 0;
- foreach (ListViewItem listViewItem in this.listView2.SelectedItems)
- {
- foreach (var item in this.graphicMethods)
- {
- if (item.Key.Equals(listViewItem.Tag))
- {
- foreach (DataGridViewRow dataGridViewRow in item.Value)
- {
- count++;
- sumMz +=Convert.ToDouble( dataGridViewRow.Cells[1].Value);
- sumA += Convert.ToDouble(dataGridViewRow.Cells[2].Value);
- sumSK1 += Convert.ToDouble(dataGridViewRow.Cells[3].Value);
- sumKg += Convert.ToDouble(dataGridViewRow.Cells[4].Value);
- sumF5 += Convert.ToDouble(dataGridViewRow.Cells[6].Value);
- sumF16 += Convert.ToDouble(dataGridViewRow.Cells[7].Value);
- sumF25 += Convert.ToDouble(dataGridViewRow.Cells[8].Value);
- sumF50 += Convert.ToDouble(dataGridViewRow.Cells[9].Value);
- sumF75 += Convert.ToDouble(dataGridViewRow.Cells[10].Value);
- sumF84 += Convert.ToDouble(dataGridViewRow.Cells[11].Value);
- sumF95 += Convert.ToDouble(dataGridViewRow.Cells[12].Value);
- }
- }
- }
- }
- DataGridViewRow dgvr = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = PdnResources.GetString("Menu.Graphicalmethod.text");
- dgvr.Cells[1].Value = Math.Round(sumMz / count, Convert.ToInt32(this.numericUpDown1.Value));
- dgvr.Cells[2].Value = Math.Round(sumA / count, Convert.ToInt32(this.numericUpDown1.Value));
- dgvr.Cells[3].Value = Math.Round(sumSK1 / count, Convert.ToInt32(this.numericUpDown1.Value));
- dgvr.Cells[4].Value = Math.Round(sumKg / count, Convert.ToInt32(this.numericUpDown1.Value));
- dgvr.Cells[5].Value = rockNamingFirst;
- dgvr.Cells[6].Value = Math.Round(sumF5 / count, Convert.ToInt32(this.numericUpDown1.Value));
- dgvr.Cells[7].Value = Math.Round(sumF16 / count, Convert.ToInt32(this.numericUpDown1.Value));
- dgvr.Cells[8].Value = Math.Round(sumF25 / count, Convert.ToInt32(this.numericUpDown1.Value));
- dgvr.Cells[9].Value = Math.Round(sumF50 / count, Convert.ToInt32(this.numericUpDown1.Value));
- dgvr.Cells[10].Value = Math.Round(sumF75 / count, Convert.ToInt32(this.numericUpDown1.Value));
- dgvr.Cells[11].Value = Math.Round(sumF84 / count, Convert.ToInt32(this.numericUpDown1.Value));
- dgvr.Cells[12].Value = Math.Round(sumF95 / count, Convert.ToInt32(this.numericUpDown1.Value));
- this.dataGridView2.Rows.Add(dgvr);
- }
- // 矩阵法
- if (this.checkBox4.Checked)
- {
- //平均值
- double sumMz = 0;
- // 标准偏差
- double sumA = 0;
- // 偏度
- double sumSK1 = 0;
- // 峰度
- double sumKg = 0;
- int count = 0;
- foreach (ListViewItem listViewItem in this.listView2.SelectedItems)
- {
- foreach (var item in this.matrixMethods)
- {
- if (item.Key.Equals(listViewItem.Tag))
- {
- foreach (DataGridViewRow dataGridViewRow in item.Value)
- {
- count++;
- sumMz += Convert.ToDouble(dataGridViewRow.Cells[1].Value);
- sumA += Convert.ToDouble(dataGridViewRow.Cells[2].Value);
- sumSK1 += Convert.ToDouble(dataGridViewRow.Cells[3].Value);
- sumKg += Convert.ToDouble(dataGridViewRow.Cells[4].Value);
- }
- }
- }
- }
- DataGridViewRow dgvr = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = PdnResources.GetString("Menu.Matrixmethod.text");
- dgvr.Cells[1].Value = Math.Round(sumMz / count, Convert.ToInt32(this.numericUpDown1.Value));
- dgvr.Cells[2].Value = Math.Round(sumA / count, Convert.ToInt32(this.numericUpDown1.Value));
- dgvr.Cells[3].Value = Math.Round(sumSK1 / count, Convert.ToInt32(this.numericUpDown1.Value));
- dgvr.Cells[4].Value = Math.Round(sumKg / count, Convert.ToInt32(this.numericUpDown1.Value));
- dgvr.Cells[5].Value = rockNamingFirst;
- dgvr.Cells[6].Value = "-";
- dgvr.Cells[7].Value = "-";
- dgvr.Cells[8].Value = "-";
- dgvr.Cells[9].Value = "-";
- dgvr.Cells[10].Value = "-";
- dgvr.Cells[11].Value = "-";
- dgvr.Cells[12].Value = "-";
- this.dataGridView2.Rows.Add(dgvr);
- }
- }
- /// <summary>
- /// 全部显示
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button11_Click(object sender, EventArgs e)
- {
- if (this.listView2.Items.Count > 0)
- {
- this.button11.Visible = false;
- this.button16.Visible = true;
- this.button16.Focus();
- this.allShow = true;
- AllShow();
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.nodata.text")+"!");
- }
- }
- private void AllShow()
- {
- this.dataGridView4.Rows.Clear();
- DataTable dataTable = new DataTable();
- for (int i = this.dataTables.Count - 1; i >= 0; i--)
- {
- dataTable = this.dataTables[i];
- for (int r = 0; r < dataTable.Rows.Count; r++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = dataTable.TableName;
- foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < dataTable.Columns.Count; c++)
- {
- if (c == dataTable.Columns.Count - 1)
- dgvr.Cells[c].Value = Math.Round(Convert.ToDouble( dataTable.Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString() + "%";
- else
- dgvr.Cells[c].Value = dataTable.Rows[r][c].ToString();
- }
- this.dataGridView4.Rows.Add(dgvr);
- }
- }
- }
- /// <summary>
- /// 导出结果
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button14_Click(object sender, EventArgs e)
- {
- if (this.listView2.Items.Count > 0)
- {
- System.Data.DataSet ds = new DataSet();
- DataTable table1 = new DataTable();
- table1.TableName = PdnResources.GetString("Menu.breakdown.text");
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- table1.Columns.Add(c.HeaderText);
- }
- for (int r = 0; r < this.dataGridView4.Rows.Count; r++)
- {
- DataRow dataRow = table1.NewRow();
- if (r == 0)
- {
- for (int c = 0; c < this.dataGridView4.Rows[r].Cells.Count; c++)
- {
- dataRow[this.dataGridView4.Columns[c].HeaderText] = this.dataGridView4.Columns[c].HeaderText;
- }
- table1.Rows.Add(dataRow);
- }
- dataRow = table1.NewRow();
- for (int c = 0; c < this.dataGridView4.Rows[r].Cells.Count; c++)
- {
- dataRow[this.dataGridView4.Columns[c].HeaderText] = this.dataGridView4.Rows[r].Cells[c].Value;
- }
- table1.Rows.Add(dataRow);
- }
- DataTable table2 = new DataTable();
- table2.TableName = PdnResources.GetString("Menu.statisaatics.text");
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- table2.Columns.Add(c.HeaderText);
- }
- for (int r = 0; r < this.dataGridView2.Rows.Count; r++)
- {
- DataRow dataRow = table2.NewRow();
- if (r == 0)
- {
- for (int c = 0; c < this.dataGridView2.Rows[r].Cells.Count; c++)
- {
- dataRow[this.dataGridView2.Columns[c].HeaderText] = this.dataGridView2.Columns[c].HeaderText;
- }
- table2.Rows.Add(dataRow);
- }
- dataRow = table2.NewRow();
- for (int c = 0; c < this.dataGridView2.Rows[r].Cells.Count; c++)
- {
- dataRow[this.dataGridView2.Columns[c].HeaderText] = this.dataGridView2.Rows[r].Cells[c].Value;
- }
- table2.Rows.Add(dataRow);
- }
- if (table1.Rows.Count > 0) ds.Tables.Add(table1);
- if (table2.Rows.Count > 0) ds.Tables.Add(table2);
- if (ds.Tables.Count > 0)
- DataToExcle(ds);
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Noanalysisresults.text")+"!");
- }
- }
- /// <summary>
- /// 导出多 Sheet 报表
- /// </summary>
- /// <param name="ds">要导出的数据</param>
- public void DataToExcle(System.Data.DataSet ds)
- {
- try
- {
- if (ds.Tables == null || ds.Tables.Count == 0)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Nonedata.Text")+"!");
- return;
- }
- SaveFileDialog saveFileDialog = new SaveFileDialog();
- saveFileDialog.DefaultExt = "xlsx";
- saveFileDialog.Title = PdnResources.GetString("Menu.ExportdatatoEXECLtable.Text");
- saveFileDialog.FileName = PdnResources.GetString("Menu.nalysimethodforlasticrocks.text") + DateTime.Now.ToString("yyyyMMddhhmmss");
- saveFileDialog.Filter = "microsoft office execl files (*.xlsx)|*.xlsx";
- saveFileDialog.RestoreDirectory = true;
- if (saveFileDialog.ShowDialog() == DialogResult.OK)
- {
- List<DataTable> list = new List<DataTable>();
- foreach (DataTable itemTable in ds.Tables)
- {
- list.Add(itemTable);
- }
- this.appWorkspace.ExportDataToExcelWithProgress(list, saveFileDialog.FileName, true, false, true);
- }
- }
- catch (Exception e)
- {
- throw e;
- }
- }
- /// <summary>
- /// 生成报告
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button13_Click(object sender, EventArgs e)
- {
- if (this.checkBox2.Checked)
- {
- AnalyzeSettingDialog recombinationRateSetDialog = new AnalyzeSettingDialog(this, "Template.Manager.item3.GrainSizeAnalysis");
- if (recombinationRateSetDialog.hasModule)
- {
- recombinationRateSetDialog.StartPosition = FormStartPosition.CenterScreen;
- recombinationRateSetDialog.ShowDialog();
- }
- else
- {
- recombinationRateSetDialog = null;
- }
- }
- if (this.analyzeSettingModel != null && !string.IsNullOrEmpty(this.analyzeSettingModel.analyzeClassify))
- {
- //获取word书签与excel单元格的关系,以字典方式存储
- List<mic_module_infos> mic_module_infos = mic_module_infos_BLL.FindAll().FindAll(a => a.analyze_classify == this.analyzeSettingModel.analyzeClassify);
- Dictionary<string, string> tagInfos = new Dictionary<string, string>();
- if (mic_module_infos != null && mic_module_infos.Count > 0)
- {
- foreach (mic_module_infos info in mic_module_infos)
- {
- tagInfos.Add(info.tag_name, info.cell_position);
- }
- }
- List<List<string>> analysisContent = new List<List<string>>();
- for (int i = 0; i < this.dataGridView4.Rows.Count; i++)
- {
- List<string> content1 = new List<string>();
- if (i == 0)
- {
- content1.Add(this.dataGridView4.Columns[0].HeaderText);
- content1.Add(this.dataGridView4.Columns[1].HeaderText);
- content1.Add(this.dataGridView4.Columns[2].HeaderText);
- content1.Add(this.dataGridView4.Columns[3].HeaderText);
- content1.Add(this.dataGridView4.Columns[4].HeaderText);
- content1.Add(this.dataGridView4.Columns[5].HeaderText);
- analysisContent.Add(content1);
- }
- content1 = new List<string>();
- content1.Add(this.dataGridView4.Rows[i].Cells[0].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[1].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[2].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[3].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[4].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[5].Value.ToString());
- analysisContent.Add(content1);
- }
- List<string> content2 = new List<string>();
- analysisContent.Add(content2);
- for (int i = 0; i < this.dataGridView2.Rows.Count; i++)
- {
- List<string> content1 = new List<string>();
- if (i == 0)
- {
- content1.Add(this.dataGridView2.Columns[0].HeaderText);
- content1.Add(this.dataGridView2.Columns[1].HeaderText);
- content1.Add(this.dataGridView2.Columns[2].HeaderText);
- content1.Add(this.dataGridView2.Columns[3].HeaderText);
- content1.Add(this.dataGridView2.Columns[4].HeaderText);
- content1.Add(this.dataGridView2.Columns[5].HeaderText);
- content1.Add(this.dataGridView2.Columns[6].HeaderText);
- content1.Add(this.dataGridView2.Columns[7].HeaderText);
- content1.Add(this.dataGridView2.Columns[8].HeaderText);
- content1.Add(this.dataGridView2.Columns[9].HeaderText);
- content1.Add(this.dataGridView2.Columns[10].HeaderText);
- content1.Add(this.dataGridView2.Columns[11].HeaderText);
- content1.Add(this.dataGridView2.Columns[12].HeaderText);
- analysisContent.Add(content1);
- }
- content1 = new List<string>();
- content1.Add(this.dataGridView2.Rows[i].Cells[0].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[1].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[2].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[3].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[4].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[5].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[6].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[7].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[8].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[9].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[10].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[11].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[12].Value.ToString());
- analysisContent.Add(content1);
- }
- bitList = new List<Bitmap>();
- if (this.allShow)
- {
- foreach (KeyValuePair<string, List<Bitmap>> kv in this.bitDic)
- {
- bitList.Add(kv.Value[0]);
- bitList.Add(kv.Value[1]);
- }
- }
- else
- {
- if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
- {
- foreach (ListViewItem item in this.listView2.SelectedItems)
- {
- if (bitDic.ContainsKey(item.Tag.ToString()))
- {
- bitList.Add(bitDic[item.Tag.ToString()][0]);
- bitList.Add(bitDic[item.Tag.ToString()][1]);
- }
- }
- }
- }
- this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, analysisContent, bitList, tagInfos);
- }
- else
- MessageBox.Show(PdnResources.GetString("Menu.Pleasesettheanalysisreportfirst.text")+"!");
- }
- /// <summary>
- /// 设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button1_Click(object sender, EventArgs e)
- {
- AnalyzeSettingDialog recombinationRateSetDialog = new AnalyzeSettingDialog(this, "Template.Manager.item3.GrainSizeAnalysis");
- if (recombinationRateSetDialog.hasModule)
- {
- recombinationRateSetDialog.StartPosition = FormStartPosition.CenterScreen;
- recombinationRateSetDialog.ShowDialog();
- }
- else
- {
- recombinationRateSetDialog = null;
- }
- }
- /// <summary>
- /// 导出项目
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button4_Click(object sender, EventArgs e)
- {
- try
- {
- if (this.analyzeSettingModel == null)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Settheexporteitemfirst.Text"));
- return;
- }
- //获取项目工程内的文件夹路径
- ProjectEngineering.NodeItem item = this.appWorkspace.GetInsertProjectPath(2, "Menu.DedicatedAnalysis.PetroleumGeology.PetroleumGeologySon.Text", this.analyzeSettingModel.savePath);
- if (item != null)
- {
- //向文件夹内保存图片和报告
- if (!string.IsNullOrEmpty(this.analyzeSettingModel.analyzeClassify))
- {
- //获取word书签与excel单元格的关系,以字典方式存储
- List<mic_module_infos> mic_module_infos = mic_module_infos_BLL.FindAll().FindAll(a => a.analyze_classify == this.analyzeSettingModel.analyzeClassify);
- Dictionary<string, string> tagInfos = new Dictionary<string, string>();
- if (mic_module_infos != null && mic_module_infos.Count > 0)
- {
- foreach (mic_module_infos info in mic_module_infos)
- {
- tagInfos.Add(info.tag_name, info.cell_position);
- }
- }
- //分析结果
- List<List<string>> analysisContent = new List<List<string>>();
- for (int i = 0; i < this.dataGridView4.Rows.Count; i++)
- {
- List<string> content1 = new List<string>();
- if (i == 0)
- {
- content1.Add(this.dataGridView4.Columns[0].HeaderText);
- content1.Add(this.dataGridView4.Columns[1].HeaderText);
- content1.Add(this.dataGridView4.Columns[2].HeaderText);
- content1.Add(this.dataGridView4.Columns[3].HeaderText);
- content1.Add(this.dataGridView4.Columns[4].HeaderText);
- content1.Add(this.dataGridView4.Columns[5].HeaderText);
- analysisContent.Add(content1);
- }
- content1 = new List<string>();
- content1.Add(this.dataGridView4.Rows[i].Cells[0].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[1].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[2].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[3].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[4].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[5].Value.ToString());
- analysisContent.Add(content1);
- }
- List<string> content2 = new List<string>();
- analysisContent.Add(content2);
- for (int i = 0; i < this.dataGridView2.Rows.Count; i++)
- {
- List<string> content1 = new List<string>();
- if (i == 0)
- {
- content1.Add(this.dataGridView2.Columns[0].HeaderText);
- content1.Add(this.dataGridView2.Columns[1].HeaderText);
- content1.Add(this.dataGridView2.Columns[2].HeaderText);
- content1.Add(this.dataGridView2.Columns[3].HeaderText);
- content1.Add(this.dataGridView2.Columns[4].HeaderText);
- content1.Add(this.dataGridView2.Columns[5].HeaderText);
- content1.Add(this.dataGridView2.Columns[6].HeaderText);
- content1.Add(this.dataGridView2.Columns[7].HeaderText);
- content1.Add(this.dataGridView2.Columns[8].HeaderText);
- content1.Add(this.dataGridView2.Columns[9].HeaderText);
- content1.Add(this.dataGridView2.Columns[10].HeaderText);
- content1.Add(this.dataGridView2.Columns[11].HeaderText);
- content1.Add(this.dataGridView2.Columns[12].HeaderText);
- analysisContent.Add(content1);
- }
- content1 = new List<string>();
- content1.Add(this.dataGridView2.Rows[i].Cells[0].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[1].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[2].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[3].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[4].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[5].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[6].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[7].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[8].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[9].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[10].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[11].Value.ToString());
- content1.Add(this.dataGridView2.Rows[i].Cells[12].Value.ToString());
- analysisContent.Add(content1);
- }
- bitList = new List<Bitmap>();
- if (this.allShow)
- {
- foreach (KeyValuePair<string, List<Bitmap>> kv in this.bitDic)
- {
- bitList.Add(kv.Value[0]);
- bitList.Add(kv.Value[1]);
- }
- }
- else
- {
- if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
- {
- foreach (ListViewItem itemL2 in this.listView2.SelectedItems)
- {
- if (bitDic.ContainsKey(itemL2.Tag.ToString()))
- {
- bitList.Add(bitDic[itemL2.Tag.ToString()][0]);
- bitList.Add(bitDic[itemL2.Tag.ToString()][1]);
- }
- }
- }
- }
- //中间数据
- if (!this.allShow)
- {
- if (this.listView2.SelectedItems != null && this.listView2.SelectedItems.Count > 0)
- {
- List<ExportProjectModel> exportModel = new List<ExportProjectModel>();
- foreach (ListViewItem rowItem in this.listView2.SelectedItems)
- {
- foreach (ExportProjectModel model in this.tempDataModel)
- {
- if (model.tagName.Equals(rowItem.Tag))
- {
- ExportProjectModel tempModel = new ExportProjectModel();
- tempModel.tagName = model.tagName;
- tempModel.picName = model.picName;
- tempModel.dataList = model.dataList;
- exportModel.Add(tempModel);
- break;
- }
- }
- }
- this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, analysisContent, exportModel, bitList, tagInfos, item.path, item.code);
- }
- }
- else
- this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, analysisContent, tempDataModel, bitList, tagInfos, item.path, item.code);
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleasesettheanalysisreportfirst.text")+"!");
- return;
- }
- //保存项目信息到数据库
- this.appWorkspace.InsertIntoDB(this.analyzeSettingModel, item);
- }
- }
- catch (Exception)
- {
- }
- }
- /// <summary>
- /// 不可点击空白区域
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void listView1_MouseUp(object sender, MouseEventArgs e)
- {
- if (e.Button == MouseButtons.Left)
- {
- if (listView1.SelectedItems.Count > 0)
- {
- }
- else if (listView1.SelectedItems.Count <= 0)//点击空白区
- {
- if (this.listView1.FocusedItem != null)
- {
- ListViewItem item = this.listView1.GetItemAt(e.X, e.Y);
- if (item == null)
- {
- this.listView1.FocusedItem.Selected = true;
- }
- }
- }
- }
- }
- #region 参数保存及提取
- /// <summary>
- /// 保存参数的key,value和type
- /// </summary>
- /// <param name="param_key"></param>
- /// <param name="param_value"></param>
- /// <param name="param_type"></param>
- private void saveParamValue(string param_key, string param_value, int param_type)
- {
- bool foundItem = false;
- if (!this.eachData.ContainsKey(GetImgKey()))
- {
- GrainSizeAnalysisModel analysisItem = new GrainSizeAnalysisModel();
- analysisItem.menuId = this.menuId;
- analysisItem.param_key = param_key;
- analysisItem.param_type = param_type;
- analysisItem.param_value = param_value;
- analysisItem.setValue();
- analysisItem.ListParam = new List<GrainSizeAnalysisModel>();
- analysisItem.ListParam.Add(analysisItem);
- this.eachData.Add(GetImgKey(), analysisItem);
- }
- foreach (var item in this.eachData[GetImgKey()].ListParam)
- {
- if (item.param_key.Equals(param_key) && item.menuId == this.menuId)
- {
- item.param_value = param_value;
- item.setValue();
- foundItem = true;
- break;
- }
- }
- if (!foundItem)
- {
- GrainSizeAnalysisModel analysisItem = new GrainSizeAnalysisModel();
- analysisItem.menuId = this.menuId;
- analysisItem.param_key = param_key;
- analysisItem.param_type = param_type;
- analysisItem.param_value = param_value;
- analysisItem.setValue();
- this.eachData[GetImgKey()].ListParam.Add(analysisItem);
- }
- }
- /// <summary>
- /// 保存界面中的参数到model
- /// </summary>
- private void saveDialogParamValues()
- {
- saveParamValue(ParamKey_Report, checkBox2.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//报告设置
- saveParamValue(ParamKey_Correct, checkBox1.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//筛析矫正
- saveParamValue(ParamKey_Graphic, checkBox3.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//图解法
- saveParamValue(ParamKey_Matrix, checkBox4.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//矩阵法
- saveParamValue(ParamKey_Number, checkBox5.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//显示颗粒编号
- saveParamValue(ParamKey_NumberFontSize, numericUpDown2.Value.ToString(), (int)Base.Dtryt.Decimal);//编号字体大小
- saveParamValue(ParamKey_NumberColour, panel1.BackColor.ToArgb().ToString(), (int)Base.Dtryt.Color);//编号颜色
- saveParamValue(ParamKey_Diameter, checkBox6.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//显示颗粒直径
- saveParamValue(ParamKey_DiameterFontSize, numericUpDown3.Value.ToString(), (int)Base.Dtryt.Decimal);//直径字体大小
- saveParamValue(ParamKey_DiameterColour, panel2.BackColor.ToArgb().ToString(), (int)Base.Dtryt.Color);//直径颜色
- saveParamValue(ParamKey_DecimalPlace, numericUpDown1.Value.ToString(), (int)Base.Dtryt.Decimal);//保留小数位数
- }
- /// <summary>
- /// 获取保存的参数
- /// </summary>
- private void GetListParamModel()
- {
- if (this.eachData.ContainsKey(GetImgKey()) && this.eachData[GetImgKey()] != null)
- {
- for (int i = 0; i < this.eachData[GetImgKey()].ListParam.Count; i++)
- {
- switch (this.eachData[GetImgKey()].ListParam[i].param_key)
- {
- case ParamKey_Report:
- checkBox2.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
- break;
- case ParamKey_Correct:
- checkBox1.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
- break;
- case ParamKey_Graphic:
- checkBox3.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
- break;
- case ParamKey_Matrix:
- checkBox4.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
- break;
- case ParamKey_Number:
- checkBox5.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
- break;
- case ParamKey_NumberFontSize:
- numericUpDown2.Value = decimal.Parse(this.eachData[GetImgKey()].ListParam[i].param_value);
- break;
- case ParamKey_NumberColour:
- panel1.BackColor = Color.FromArgb((int)this.eachData[GetImgKey()].ListParam[i].value);
- break;
- case ParamKey_Diameter:
- checkBox6.Checked = (Boolean)this.eachData[GetImgKey()].ListParam[i].value;
- break;
- case ParamKey_DiameterFontSize:
- numericUpDown3.Value = decimal.Parse(this.eachData[GetImgKey()].ListParam[i].param_value);
- break;
- case ParamKey_DiameterColour:
- panel2.BackColor = Color.FromArgb((int)this.eachData[GetImgKey()].ListParam[i].value);
- break;
- case ParamKey_DecimalPlace:
- numericUpDown1.Value = decimal.Parse(this.eachData[GetImgKey()].ListParam[i].param_value);
- break;
- }
- }
- }
- }
- /// <summary>
- /// 获取XML保存的参数
- /// </summary>
- private void GetXmlParameter()
- {
- string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GrainSizeAnalyze\\GrainSizeAnalysisModel.xml";
- GrainSizeAnalysisModel analysisModelXml = XmlSerializeHelper.DESerializer<GrainSizeAnalysisModel>(FileOperationHelper.ReadStringFromFile(filePath, System.IO.FileMode.Open));
- for (int i = 0; i < listView1.Items.Count; i++)
- {
- if (this.eachData.ContainsKey(listView1.Items[i].Index.ToString()))
- {
- this.eachData[listView1.Items[i].Index.ToString()] = analysisModelXml.cloneListParamModel(this.menuId);
- }
- else
- {
- this.eachData.Add(listView1.Items[i].Index.ToString(), analysisModelXml.cloneListParamModel(this.menuId));
- }
- }
- foreach (var item in this.eachData[GetImgKey()].ListParam)
- item.setValue();
- }
- /// <summary>
- /// 保存参数,防止没有图片
- /// </summary>
- private void NullKey()
- {
- GrainSizeAnalysisModel grainsizeanalysismodel = new GrainSizeAnalysisModel();
- grainsizeanalysismodel.ListParam = new List<GrainSizeAnalysisModel>();
- this.eachData.Add("null", grainsizeanalysismodel);
- }
- private string GetImgKey()
- {
- string key = this.listView1.FocusedItem != null ? this.listView1.FocusedItem.Index.ToString() : "null";
- return key;
- }
- #endregion
- private void button5_Click(object sender, EventArgs e)
- {
- if (this.listView1.FocusedItem == null)
- {
- return;
- }
- binaryClass.saveParams();
- binaryClass.applyToAll(this.imageList1.Images.Keys, this.imageList1.Images.Keys[int.Parse(GetImgKey())]);
- saveDialogParamValues();
- GrainSizeAnalysisModel data = new GrainSizeAnalysisModel();
- if (eachData.ContainsKey(GetImgKey()))
- {
- data = eachData[GetImgKey()];
- }
- for (int i = 0; i < listView1.Items.Count; i++)
- {
- eachData[i.ToString()] = data.cloneListParamModel(this.menuId);
- this.listView1.EnsureVisible(i);
- this.listView1.Items[i].Focused = true;
- this.listView1.Items[i].Selected = true;
- }
- }
- private void button3_Click(object sender, EventArgs e)
- {
- if (this.listView1.FocusedItem == null)
- {
- return;
- }
- if (eachData.Count - 1 != listView1.Items.Count)
- {
- MessageBox.Show("请先点击应用全部!");
- return;
- }
- saveDialogParamValues();
- int current = int.Parse(GetImgKey());
- for (int i = 0; i < listView1.Items.Count; i++)
- {
- this.listView1.EnsureVisible(i);
- this.listView1.Items[i].Focused = true;
- this.listView1.Items[i].Selected = true;
- this.button2.PerformClick();
- }
- this.listView1.EnsureVisible(current);
- this.listView1.Items[current].Focused = true;
- this.listView1.Items[current].Selected = true;
- }
- private void listView1_MouseDown(object sender, MouseEventArgs e)
- {
- if (this.listView1.FocusedItem != null)
- saveDialogParamValues();
- }
- #region [脚本相关]
- private void getValue(string key, object value)
- {
- switch (key)
- {
- case "parameter1":
- checkBox1.Checked = Convert.ToBoolean(value);
- break;
- case "parameter2":
- checkBox3.Checked = Convert.ToBoolean(value);
- break;
- case "parameter3":
- checkBox4.Checked = Convert.ToBoolean(value);
- break;
- case "parameter4":
- checkBox5.Checked = Convert.ToBoolean(value);
- break;
- case "parameter5":
- numericUpDown2.Value = Convert.ToDecimal(value);
- break;
- case "parameter6":
- panel1.BackColor = Color.FromArgb((int)value);
- break;
- case "parameter7":
- checkBox6.Checked = Convert.ToBoolean(value);
- break;
- case "parameter8":
- numericUpDown3.Value = Convert.ToDecimal(value);
- break;
- case "parameter9":
- panel2.BackColor = Color.FromArgb((int)value);
- break;
- case "OpenWhileExportReport":
- checkBox2.Checked = Convert.ToBoolean(value);
- break;
- case "CalculatorDecimalDigits":
- numericUpDown1.Value = Convert.ToDecimal(value);
- break;
- case "ExportResults":
- isExportResults = Convert.ToBoolean(value);
- break;
- case "ExportReports":
- isExportReports = Convert.ToBoolean(value);
- break;
- case "ExportProjects":
- isExportProjects = Convert.ToBoolean(value);
- break;
- }
- }
- private void startScriptAutomaticAction()
- {
- this.button5.PerformClick();
- this.button3.PerformClick();
- if (this.listView2.Items.Count > 0)
- {
- this.button11.Visible = false;
- this.button16.Visible = true;
- this.button16.Focus();
- this.allShow = true;
- AllShow();
- }
- if (isExportResults)//导出结果
- this.button14.PerformClick();
- if (isExportReports)//生成报告
- this.button13.PerformClick();
- if (isExportProjects)//导出项目
- this.button4.PerformClick();
- this.appWorkspace.ScriptAutomatic = false;
- this.Close();
- }
- #endregion
- #region [脚本录制]
- private void getScriptRecording()
- {
- string className = InvariantData.path_Action + ".Action" + menuId;
- ParamObject param = (ParamObject)System.Reflection.Assembly.Load(InvariantData.assembly_Data).CreateInstance(className);
- List<Args> args = param.Lists;
- foreach (var item in args)
- {
- item.value = setScriptRecording(item.key);
- }
- //找出二值相关参数 进行赋值
- List<Args> isNullList = args.Where(m => m.value == null).ToList();
- foreach (var item in isNullList)
- {
- item.value = binaryClass.setScriptRecording(item.key);
- }
- appWorkspace.SetScriptStartRecording(this.menuId, menuName, args);
- }
- private object setScriptRecording(string key)
- {
- object value = null;
- switch (key)
- {
- case "parameter1":
- value = checkBox1.Checked;
- break;
- case "parameter2":
- value = checkBox3.Checked;
- break;
- case "parameter3":
- value = checkBox4.Checked;
- break;
- case "parameter4":
- value = checkBox5.Checked;
- break;
- case "parameter5":
- value = numericUpDown2.Value;
- break;
- case "parameter6":
- value = panel1.BackColor.ToArgb();
- break;
- case "parameter7":
- value = checkBox6.Checked;
- break;
- case "parameter8":
- value = numericUpDown3.Value;
- break;
- case "parameter9":
- value = panel2.BackColor.ToArgb();
- break;
- case "OpenWhileExportReport":
- value = checkBox2.Checked;
- break;
- case "CalculatorDecimalDigits":
- value = numericUpDown1.Value;
- break;
- case "ExportResults":
- value = isExportResults;
- break;
- case "ExportReports":
- value = isExportReports;
- break;
- case "ExportProjects":
- value = isExportProjects;
- break;
- }
- return value;
- }
- #endregion
- }
- }
|