12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531 |
- using PaintDotNet.Base.CommTool;
- using PaintDotNet.Base.SettingModel;
- using PaintDotNet.DedicatedAnalysis;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.IO;
- using System.Windows.Forms;
- using PaintDotNet.CustomControl;
- using PaintDotNet.DbOpreate.DbBll;
- using PaintDotNet.DbOpreate.DbModel;
- using PaintDotNet.Annotation;
- using PaintDotNet.Base.Functionodel;
- using static PaintDotNet.Base.DedicatedAnalysis.Inclusions.MethodOfAssessment;
- using PaintDotNet.Annotation.Enum;
- using OpenCvSharp;
- using Point = System.Drawing.Point;
- using PaintDotNet.Instrument;
- using OpenCvSharp.Extensions;
- using System.Linq;
- using Metis.ParameterSet;
- using PaintDotNet.Data.Param;
- using PaintDotNet.Base;
- namespace PaintDotNet
- {
- /// <summary>
- /// 复合率
- /// </summary>
- internal class RecombinationRateDialog : PdnBaseForm
- {
- #region 控件
- private GroupBox groupBox1;
- private Button button2;
- private CheckBox checkBox2;
- private CheckBox checkBox1;
- private GroupBox groupBox2;
- private GroupBox groupBox3;
- private Button button4;
- private Button button3;
- private ComboBox comboBox1;
- private GroupBox groupBox4;
- private Button button5;
- private TextBox textBox2;
- private TextBox textBox1;
- private Label label2;
- private Label label1;
- private DataGridView dataGridView1;
- private GroupBox groupBox5;
- private DataGridView dataGridView2;
- private Button button8;
- private Button button7;
- private Button button6;
- private GroupBox groupBox6;
- private Button button10;
- private Button button9;
- private GroupBox groupBox7;
- private GroupBox groupBox8;
- private Label label5;
- private Button button14;
- private Button button13;
- private DataGridView dataGridView4;
- private Button button12;
- private Button button11;
- private ListView listView1;
- private Button button1;
- #endregion
- #region 辅助线样式
- /// <summary>
- /// 线条数
- /// </summary>
- private int linesNumber;
- /// <summary>
- /// 线颜色
- /// </summary>
- private int lineColor;
- /// <summary>
- /// 线宽
- /// </summary>
- private int lineWidth;
- /// <summary>
- /// 间距
- /// </summary>
- private float lineSpacing;
- /// <summary>
- /// 文字字体
- /// </summary>
- private string lineFont;
- /// <summary>
- /// 文字字号
- /// </summary>
- private int lineFontSize;
- #endregion
- #region 测量点样式
- /// <summary>
- /// 点颜色
- /// </summary>
- private int pointColor;
- /// <summary>
- /// 点样式 0:空心 1:实心
- /// </summary>
- private int pointStyle;
- /// <summary>
- /// 点宽度
- /// </summary>
- private int pointWidth;
- /// <summary>
- /// 直径
- /// </summary>
- private float pointDiameter;
- /// <summary>
- /// 文字字体
- /// </summary>
- private string pointFont;
- /// <summary>
- /// 文字字号
- /// </summary>
- private int pointFontSize;
- /// <summary>
- /// 显示点标记符号 true:显示 false:不显示
- /// </summary>
- private bool pointMarkerSymbol;
- /// <summary>
- /// 小数
- /// </summary>
- private int decimalCls;
- /// <summary>
- /// 是否全部显示
- /// </summary>
- private bool allShow = false;
- #endregion
- #region 控制测量点个数
- /// <summary>
- /// 控制测量点个数
- /// </summary>
- private List<int> pointCountA1 = new List<int>();
- private List<int> pointCountA2 = new List<int>();
- private List<int> pointCountA3 = new List<int>();
- private List<int> pointCountB1 = new List<int>();
- private List<int> pointCountB2 = new List<int>();
- private List<int> pointCountB3 = new List<int>();
- private List<int> pointCountB4 = new List<int>();
- private List<int> pointCountC1 = new List<int>();
- private List<int> pointCountC2 = new List<int>();
- private List<int> pointCountC3 = new List<int>();
- private List<int> pointCountC4 = new List<int>();
- private List<int> pointCountC5 = new List<int>();
- #endregion
- private PointF m_StartPoint = Point.Empty;
- private bool m_canMove;
- /// <summary>
- /// 辅助线上可绘制的点数
- /// </summary>
- private int pointDrawCount;
- /// <summary>
- /// 辅助线线条数是否可改变
- /// </summary>
- private bool lineChange = true;
- /// <summary>
- /// 样品测量点记录
- /// </summary>
- private List<DataTable> pointDataTables = new List<DataTable>();
- /// <summary>
- /// 图片测量记录
- /// </summary>
- private List<DataTable> pictureDataTables = new List<DataTable>();
- /// <summary>
- /// 测量点
- /// </summary>
- public List<List<RectangleF>> pointRectangleFs = new List<List<RectangleF>>();
- /// <summary>
- /// 0:添加 1:选择 2:删除
- /// </summary>
- private int operationK = -1;
- /// <summary>
- /// 被选择的点
- /// </summary>
- private int selected = -1;
- /// <summary>
- /// 获取鼠标位置
- /// </summary>
- private int mouseX = 0;
- private int mouseY = 0;
- /// <summary>
- /// 数据变化
- /// </summary>
- private bool saveSuccess = false;
- /// <summary>
- /// 是否开始绘制测量点
- /// </summary>
- private bool pointDrawkb = false;
- /// <summary>
- /// 是否选择了图片
- /// </summary>
- private bool selectPicture = false;
- /// <summary>
- /// 工件类型
- /// </summary>
- private string type;
- private string oldValue;
- public string selectItemValue;
- /// <summary>
- /// 主控件
- /// </summary>
- private AppWorkspace appWorkspace;
- private ImageList imageList1;
- private IContainer components;
- /// <summary>
- /// 图像面板
- /// </summary>
- private DocumentWorkspaceWindow documentWorkspace;
- private Dictionary<int, DocumentItem> documentItems;
- /// <summary>
- /// 公共按钮
- /// </summary>
- private CommonControlButtons commonControlButtons;
- private Button button15;
- /// <summary>
- /// 保存用于生成报告的图片
- /// </summary>
- private List<Bitmap> bitList;
- /// <summary>
- /// 储存点击保存结果后的所有原图与分析图
- /// </summary>
- private Dictionary<string, List<Bitmap>> bitDic = new Dictionary<string, List<Bitmap>>();
- private Dictionary<string, List<Bitmap>> bitDic1 = new Dictionary<string, List<Bitmap>>();
- private int changeCount;
- /// <summary>
- /// 工件类型
- /// </summary>
- private const string constTypeA = "a";
- private const string constTypeB = "b";
- private const string constTypeC = "c";
- private const string constTypeD = "d";
- private const string constTypeE = "e";
- /// <summary>
- /// 单位
- /// </summary>
- private double unitLength;
- /// <summary>
- /// 中间数据
- /// </summary>
- private List<ExportProjectModel> tempDataModel = new List<ExportProjectModel>();
- /// <summary>
- /// 第一条线的各点截距
- /// </summary>
- private List<List<decimal>> lengthL1 = new List<List<decimal>>();
- /// <summary>
- /// 第二条线的各点截距
- /// </summary>
- private List<List<decimal>> lengthL2 = new List<List<decimal>>();
- /// <summary>
- /// 第三条线的各点截距
- /// </summary>
- private List<List<decimal>> lengthL3 = new List<List<decimal>>();
- /// <summary>
- /// 第四条线的各点截距
- /// </summary>
- private List<List<decimal>> lengthL4 = new List<List<decimal>>();
- /// <summary>
- /// 第五条线的各点截距
- /// </summary>
- private List<List<decimal>> lengthL5 = new List<List<decimal>>();
- private Button button16;
- private NumericUpDown numericUpDown1;
- private ListView listView2;
- private DataGridView dataGridView3;
- private Button button17;
- private DataGridViewTextBoxColumn Column1;
- private DataGridViewTextBoxColumn Column2;
- private DataGridViewTextBoxColumn Column3;
- private DataGridViewTextBoxColumn Column4;
- private DataGridViewTextBoxColumn Column5;
- private DataGridViewTextBoxColumn Column6;
- private DataGridViewTextBoxColumn Column7;
- private DataGridViewTextBoxColumn Column8;
- private DataGridViewTextBoxColumn Column9;
- private DataGridViewTextBoxColumn Column10;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
- private DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
- private DataGridViewTextBoxColumn pointName;
- private DataGridViewTextBoxColumn pointDeviation;
- private DataGridViewTextBoxColumn pointL1;
- private DataGridViewTextBoxColumn pointL2;
- private DataGridViewTextBoxColumn pointL3;
- private DataGridViewTextBoxColumn pointL4;
- private DataGridViewTextBoxColumn pointL5;
- private DataGridViewTextBoxColumn pointAverage;
- private DataGridViewTextBoxColumn nname;
- private DataGridViewTextBoxColumn explain;
- private DataGridViewTextBoxColumn operation;
- private DataGridViewTextBoxColumn Column11;
- private WorkpieceMaintenanceModel workpieceMaintenanceModel = new WorkpieceMaintenanceModel();
- private int defaultIndex = -1;
- private int menuId;
- private string menuName;
- /// <summary>
- /// 是否脚本运行
- /// </summary>
- private Boolean initScriptValues = false;
- // <summary>
- /// 保存窗口参数
- /// </summary>
- private GrainSizeAnalysisModel analysisModel;
- private const string ParamKey_ShowData = "showData";//显示数据
- private const string ParamKey_Report = "report";//报告设置
- private const string ParamKey_DecimalPlace = "decimalPlace";//保留小数位数
- public RecombinationRateDialog(AppWorkspace appWorkspace, PdnMenuItem menuItem)
- {
- this.menuId = menuItem.MenuId;
- this.menuName = menuItem.Text;
- string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GrainSizeAnalyze\\GrainSizeAnalysisModel.xml";
- GrainSizeAnalysisModel analysisModelXml = XmlSerializeHelper.DESerializer<GrainSizeAnalysisModel>(FileOperationHelper.ReadStringFromFile(filePath, System.IO.FileMode.Open));
- this.analysisModel = analysisModelXml.cloneListParamModel(this.menuId);
- foreach (var item in this.analysisModel.ListParam)
- item.setValue();
- InitializeComponent();
- InitializeLanguageText();
- this.button3.Visible = true;
- this.button15.Visible = false;
- this.button11.Visible = true;
- this.button16.Visible = false;
- this.appWorkspace = appWorkspace;
- //this.appWorkspace.getMeasureInfo().TryGetValue(MeasurementUnit.Micron, out unitLength);
- //
- //初始化图像控件
- //
- this.documentWorkspace = new DocumentWorkspaceWindow(this.appWorkspace);
- this.documentWorkspace.Dock = DockStyle.Fill;
- this.documentWorkspace.HookMouseEvents();
- this.documentWorkspace.AuxiliaryLineEnabled = false;
- this.documentWorkspace.Visible = false;
- this.groupBox7.Controls.Add(documentWorkspace);
- //
- //初始化操作按钮
- //
- this.commonControlButtons = new CommonControlButtons();
- this.commonControlButtons.Dock = DockStyle.Top;
- this.commonControlButtons.Height = 30;
- this.commonControlButtons.HideZoomToWindowAndActualSize();
- this.commonControlButtons.Visible = false;
- this.groupBox7.Controls.Add(commonControlButtons);
- /// 测量点操作限制
- this.button6.Enabled = this.pointDrawkb;
- this.button7.Enabled = this.pointDrawkb;
- this.button8.Enabled = this.pointDrawkb;
- //初始化头
- this.listView2.View = View.Details;
- ColumnHeader header0 = new ColumnHeader();
- header0.Text = "";
- header0.Width = 180;
- this.listView2.Columns.Add(header0);
- documentWorkspace.panel.MouseDown += OnMouseDown;
- documentWorkspace.panel.Paint += Panel_Paint;
- documentWorkspace.panel.MouseMove += onMouseMove;
- documentWorkspace.panel.MouseUp += onMouseUp;
- //如果是脚本执行,将参数带入
- 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
- {//读取上次关闭窗口时保存的参数
- GetListParamModel();
- }
- InitPicList();
- RefreshCombobox();
- RefreshPanel();
- InitCommonButtonEvent();
- //SetStyle(ControlStyles.UserPaint, true);
- //SetStyle(ControlStyles.AllPaintingInWmPaint, true); // 禁止擦除背景.
- //SetStyle(ControlStyles.DoubleBuffer, true); // 双缓冲
- SetAnalyzeModelFromXml("Template.Manager.item3.RecombinationRate");
- foreach (DataGridViewColumn item in this.dataGridView1.Columns)
- {
- item.SortMode = DataGridViewColumnSortMode.NotSortable;
- }
- 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;
- }
- }
- 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;
- }
- 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;
- }
- }
- /// <summary>
- /// 初始化图片列表数据
- /// </summary>
- public void InitPicList()
- {
- this.documentItems = new Dictionary<int, DocumentItem>();
- // 构造工作结构
- for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
- {
- //Bitmap bitmap = this.appWorkspace.DocumentWorkspaces[i].CompositionSurface.CreateAliasedBitmap();
- GraphicsList graphicsList = new GraphicsList();
- for (int j = 0; j < this.appWorkspace.DocumentWorkspaces[i].GraphicsList.Count; j++)
- {
- graphicsList.Add(this.appWorkspace.DocumentWorkspaces[i].GraphicsList[j]);
- }
- List<PhaseModel> phaseModels = new List<PhaseModel>();
- //二值化相关
- PhaseModel analysisModel = this.appWorkspace.DocumentWorkspaces[i].AnalysisPhaseModel;
- if (analysisModel == null)
- {
- }
- else
- phaseModels.Add(analysisModel);
- this.documentItems.Add(i, new DocumentItem(this.appWorkspace.DocumentWorkspaces[i].CompositionSurface.CreatedAliasedMat().Clone(), graphicsList, phaseModels));
- }
- //初始化图片列表
- 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;
- }
- internal class DocumentItem
- {
- public Mat imageMat;
- public GraphicsList graphicsList;
- public List<PhaseModel> phaseModels;
- public AnalysisResult analysisResult;
- public DocumentItem(Mat imageMat, GraphicsList graphicsList, List<PhaseModel> phaseModels)
- {
- this.imageMat = imageMat;
- this.graphicsList = graphicsList;
- this.phaseModels = phaseModels;
- }
- }
- #region 初始化
- private void InitializeLanguageText()
- {
- this.button1.Text = PdnResources.GetString("Menu.Setting.Text");
- 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.checkBox1.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Non-ferrousmetals.Displaydataontheimage.text");
- this.groupBox2.Text = PdnResources.GetString("Menu.Tools.ImageIndex.Text");
- this.groupBox3.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Non-ferrousmetals.artifactselect.text");
- this.button15.Text = PdnResources.GetString("Menu.Stopmeasure.text");
- this.button4.Text = PdnResources.GetString("Menu.Setting.Text");
- this.button3.Text = PdnResources.GetString("Menu.Startmeasuring.text");
- this.groupBox4.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Samplemaintenance.text");
- this.nname.HeaderText = PdnResources.GetString("Menu.name.text");
- this.operation.HeaderText = PdnResources.GetString("Menu.operation.text");
- this.Column11.HeaderText = PdnResources.GetString("Menu.operation.text");
- this.button5.Text = PdnResources.GetString("CommonAction.Save");
- this.label2.Text = PdnResources.GetString("Menu.instruction.text") + ":";
- this.label1.Text = PdnResources.GetString("Menu.samplename.text") + ":";
- this.groupBox5.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Measuringpointrecord.text");
- this.dataGridViewTextBoxColumn1.HeaderText = PdnResources.GetString("Menu.name.text");
- this.dataGridViewTextBoxColumn2.HeaderText = PdnResources.GetString("Menu.Targetvalue/deviation.text");
- this.dataGridViewTextBoxColumn8.HeaderText = PdnResources.GetString("Menu.Image.Average.Text") + "%";
- this.pointName.HeaderText = PdnResources.GetString("Menu.name.text");
- this.pointDeviation.HeaderText = PdnResources.GetString("Menu.Targetvalue/deviation.text");
- this.pointAverage.HeaderText = PdnResources.GetString("Menu.Image.Average.Text") + "%";
- this.button8.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Selectcompoundnode.text");
- this.button7.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Deletecompoundnode.text");
- this.button6.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Addcompoundnode.text");
- this.groupBox6.Text = PdnResources.GetString("Menu.othersettings.text");
- this.button10.Text = PdnResources.GetString("Menu.Dedicatedanalysis.Nmetals.Measurinsetting.text");
- this.button9.Text = PdnResources.GetString("Menu.Auxiliarylinesettings.text");
- this.groupBox7.Text = PdnResources.GetString("Menu.Preview.text");
- this.groupBox8.Text = PdnResources.GetString("Menu.Analysisresult.text");
- this.button17.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.Dedicatedanalysis.Nmetals.sample.text");
- this.Column3.HeaderText = PdnResources.GetString("Menu.name.text");
- this.Column4.HeaderText = PdnResources.GetString("Menu.Targetvalue/deviation.text");
- this.Column10.HeaderText = PdnResources.GetString("Menu.Image.Average.Text") + "%";
- this.button12.Text = PdnResources.GetString("Menu.Edit.Delete.Text");
- this.button11.Text = PdnResources.GetString("Menu.Showall.text");
- this.Text = PdnResources.GetString("Menu.DedicatedAnalysis.NonferrousMetal.RecombinationRate.Text");
- this.explain.HeaderText = PdnResources.GetString("Menu.instruction.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();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle();
- this.button1 = new System.Windows.Forms.Button();
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.button2 = new System.Windows.Forms.Button();
- this.checkBox2 = new System.Windows.Forms.CheckBox();
- this.checkBox1 = new System.Windows.Forms.CheckBox();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.listView1 = new System.Windows.Forms.ListView();
- this.imageList1 = new System.Windows.Forms.ImageList(this.components);
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.button15 = new System.Windows.Forms.Button();
- this.button4 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.comboBox1 = new System.Windows.Forms.ComboBox();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.dataGridView1 = new System.Windows.Forms.DataGridView();
- this.nname = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.explain = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.operation = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.button5 = new System.Windows.Forms.Button();
- this.textBox2 = new System.Windows.Forms.TextBox();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.label2 = new System.Windows.Forms.Label();
- this.label1 = new System.Windows.Forms.Label();
- this.groupBox5 = new System.Windows.Forms.GroupBox();
- this.dataGridView3 = new System.Windows.Forms.DataGridView();
- this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn2 = 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.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.dataGridView2 = new System.Windows.Forms.DataGridView();
- this.pointName = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.pointDeviation = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.pointL1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.pointL2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.pointL3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.pointL4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.pointL5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.pointAverage = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.button8 = new System.Windows.Forms.Button();
- this.button7 = new System.Windows.Forms.Button();
- this.button6 = new System.Windows.Forms.Button();
- this.groupBox6 = new System.Windows.Forms.GroupBox();
- this.button10 = new System.Windows.Forms.Button();
- this.button9 = new System.Windows.Forms.Button();
- this.groupBox7 = new System.Windows.Forms.GroupBox();
- this.groupBox8 = new System.Windows.Forms.GroupBox();
- this.button17 = 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.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column4 = 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.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
- this.Column10 = 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.dataGridView1)).BeginInit();
- this.groupBox5.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
- this.groupBox6.SuspendLayout();
- this.groupBox8.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).BeginInit();
- this.SuspendLayout();
- //
- // 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);
- //
- // 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.button2);
- this.groupBox1.Controls.Add(this.checkBox2);
- this.groupBox1.Controls.Add(this.checkBox1);
- this.groupBox1.Controls.Add(this.button1);
- this.groupBox1.Location = new System.Drawing.Point(14, 3);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(1081, 50);
- this.groupBox1.TabIndex = 1;
- this.groupBox1.TabStop = false;
- //
- // 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(985, 14);
- 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(288, 25);
- this.checkBox2.Name = "checkBox2";
- this.checkBox2.Size = new System.Drawing.Size(15, 14);
- this.checkBox2.TabIndex = 2;
- this.checkBox2.UseVisualStyleBackColor = true;
- //
- // checkBox1
- //
- this.checkBox1.AutoSize = true;
- this.checkBox1.Location = new System.Drawing.Point(114, 25);
- this.checkBox1.MaximumSize = new System.Drawing.Size(200, 200);
- this.checkBox1.Name = "checkBox1";
- this.checkBox1.Size = new System.Drawing.Size(15, 14);
- this.checkBox1.TabIndex = 1;
- this.checkBox1.UseVisualStyleBackColor = true;
- this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
- //
- // groupBox2
- //
- this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox2.Controls.Add(this.listView1);
- this.groupBox2.Location = new System.Drawing.Point(14, 59);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(135, 497);
- this.groupBox2.TabIndex = 2;
- 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, 474);
- this.listView1.TabIndex = 0;
- this.listView1.UseCompatibleStateImageBehavior = false;
- this.listView1.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.listView1_ItemSelectionChanged);
- 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;
- //
- // groupBox3
- //
- this.groupBox3.Controls.Add(this.button15);
- this.groupBox3.Controls.Add(this.button4);
- this.groupBox3.Controls.Add(this.button3);
- this.groupBox3.Controls.Add(this.comboBox1);
- this.groupBox3.Location = new System.Drawing.Point(153, 59);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(356, 51);
- this.groupBox3.TabIndex = 4;
- this.groupBox3.TabStop = false;
- //
- // button15
- //
- this.button15.BackColor = System.Drawing.SystemColors.Control;
- this.button15.Location = new System.Drawing.Point(195, 15);
- this.button15.Name = "button15";
- this.button15.Size = new System.Drawing.Size(106, 26);
- this.button15.TabIndex = 6;
- this.button15.UseVisualStyleBackColor = false;
- this.button15.Click += new System.EventHandler(this.button15_Click);
- //
- // button4
- //
- this.button4.BackColor = System.Drawing.SystemColors.Control;
- this.button4.Location = new System.Drawing.Point(302, 15);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(53, 26);
- this.button4.TabIndex = 5;
- this.button4.UseVisualStyleBackColor = false;
- this.button4.Click += new System.EventHandler(this.button4_Click);
- //
- // button3
- //
- this.button3.BackColor = System.Drawing.SystemColors.Control;
- this.button3.Location = new System.Drawing.Point(195, 15);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(106, 26);
- this.button3.TabIndex = 4;
- this.button3.UseVisualStyleBackColor = false;
- this.button3.Click += new System.EventHandler(this.button3_Click);
- //
- // comboBox1
- //
- this.comboBox1.FormattingEnabled = true;
- this.comboBox1.Location = new System.Drawing.Point(16, 17);
- this.comboBox1.Name = "comboBox1";
- this.comboBox1.Size = new System.Drawing.Size(173, 20);
- this.comboBox1.TabIndex = 0;
- //
- // groupBox4
- //
- this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox4.Controls.Add(this.dataGridView1);
- this.groupBox4.Controls.Add(this.button5);
- this.groupBox4.Controls.Add(this.textBox2);
- this.groupBox4.Controls.Add(this.textBox1);
- this.groupBox4.Controls.Add(this.label2);
- this.groupBox4.Controls.Add(this.label1);
- this.groupBox4.Location = new System.Drawing.Point(153, 116);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Size = new System.Drawing.Size(356, 168);
- this.groupBox4.TabIndex = 5;
- this.groupBox4.TabStop = false;
- //
- // dataGridView1
- //
- this.dataGridView1.AllowUserToAddRows = false;
- this.dataGridView1.AllowUserToResizeColumns = false;
- this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
- dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.GradientInactiveCaption;
- dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F);
- 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.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
- this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.nname,
- this.explain,
- this.operation,
- this.Column11});
- this.dataGridView1.Location = new System.Drawing.Point(6, 46);
- this.dataGridView1.MultiSelect = false;
- this.dataGridView1.Name = "dataGridView1";
- this.dataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
- this.dataGridView1.RowHeadersVisible = false;
- this.dataGridView1.RowTemplate.Height = 23;
- this.dataGridView1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
- this.dataGridView1.Size = new System.Drawing.Size(340, 116);
- this.dataGridView1.TabIndex = 7;
- this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick);
- this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvData_CellContentClick);
- this.dataGridView1.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvData_CellMouseClick);
- this.dataGridView1.CellValidating += new System.Windows.Forms.DataGridViewCellValidatingEventHandler(this.dataGridView1_CellValidating);
- this.dataGridView1.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellValueChanged);
- this.dataGridView1.RowLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_RowLeave);
- this.dataGridView1.SelectionChanged += new System.EventHandler(this.dataGridView1_SelectionChanged);
- //
- // nname
- //
- dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.nname.DefaultCellStyle = dataGridViewCellStyle2;
- this.nname.FillWeight = 103.5533F;
- this.nname.HeaderText = "nname";
- this.nname.Name = "nname";
- this.nname.Width = 80;
- //
- // explain
- //
- dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- this.explain.DefaultCellStyle = dataGridViewCellStyle3;
- this.explain.FillWeight = 109.3963F;
- this.explain.HeaderText = "explain";
- this.explain.Name = "explain";
- this.explain.Width = 157;
- //
- // operation
- //
- dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.operation.DefaultCellStyle = dataGridViewCellStyle4;
- this.operation.FillWeight = 87.05037F;
- this.operation.HeaderText = "operation";
- this.operation.Name = "operation";
- this.operation.Width = 50;
- //
- // Column11
- //
- dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.Column11.DefaultCellStyle = dataGridViewCellStyle5;
- this.Column11.HeaderText = "Column11";
- this.Column11.Name = "Column11";
- this.Column11.Width = 50;
- //
- // button5
- //
- this.button5.BackColor = System.Drawing.SystemColors.Control;
- this.button5.Location = new System.Drawing.Point(304, 19);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(42, 22);
- this.button5.TabIndex = 6;
- this.button5.UseVisualStyleBackColor = false;
- this.button5.Click += new System.EventHandler(this.button5_Click);
- //
- // textBox2
- //
- this.textBox2.Location = new System.Drawing.Point(166, 19);
- this.textBox2.Name = "textBox2";
- this.textBox2.Size = new System.Drawing.Size(135, 21);
- this.textBox2.TabIndex = 3;
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(65, 19);
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(60, 21);
- this.textBox1.TabIndex = 2;
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(127, 24);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(0, 12);
- this.label2.TabIndex = 1;
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(4, 24);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(0, 12);
- this.label1.TabIndex = 0;
- //
- // groupBox5
- //
- this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox5.Controls.Add(this.dataGridView3);
- this.groupBox5.Controls.Add(this.dataGridView2);
- this.groupBox5.Controls.Add(this.button8);
- this.groupBox5.Controls.Add(this.button7);
- this.groupBox5.Controls.Add(this.button6);
- this.groupBox5.Location = new System.Drawing.Point(153, 290);
- this.groupBox5.Name = "groupBox5";
- this.groupBox5.Size = new System.Drawing.Size(356, 201);
- this.groupBox5.TabIndex = 6;
- this.groupBox5.TabStop = false;
- //
- // dataGridView3
- //
- this.dataGridView3.AllowUserToAddRows = false;
- this.dataGridView3.AllowUserToResizeColumns = false;
- this.dataGridView3.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);
- 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.dataGridView3.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6;
- this.dataGridView3.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView3.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.dataGridViewTextBoxColumn1,
- this.dataGridViewTextBoxColumn2,
- this.dataGridViewTextBoxColumn3,
- this.dataGridViewTextBoxColumn4,
- this.dataGridViewTextBoxColumn5,
- this.dataGridViewTextBoxColumn6,
- this.dataGridViewTextBoxColumn7,
- this.dataGridViewTextBoxColumn8});
- this.dataGridView3.Location = new System.Drawing.Point(6, 52);
- this.dataGridView3.Name = "dataGridView3";
- this.dataGridView3.ReadOnly = true;
- this.dataGridView3.RowHeadersVisible = false;
- this.dataGridView3.RowTemplate.Height = 23;
- this.dataGridView3.Size = new System.Drawing.Size(340, 143);
- this.dataGridView3.TabIndex = 10;
- this.dataGridView3.Visible = false;
- this.dataGridView3.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView3_CellValueChanged);
- //
- // dataGridViewTextBoxColumn1
- //
- dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle7;
- this.dataGridViewTextBoxColumn1.FillWeight = 199.6873F;
- this.dataGridViewTextBoxColumn1.HeaderText = "dataGridViewTextBoxColumn1";
- this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
- this.dataGridViewTextBoxColumn1.ReadOnly = true;
- this.dataGridViewTextBoxColumn1.Width = 84;
- //
- // dataGridViewTextBoxColumn2
- //
- dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle8;
- this.dataGridViewTextBoxColumn2.FillWeight = 154.1869F;
- this.dataGridViewTextBoxColumn2.HeaderText = "dataGridViewTextBoxColumn2";
- this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
- this.dataGridViewTextBoxColumn2.ReadOnly = true;
- this.dataGridViewTextBoxColumn2.Width = 150;
- //
- // dataGridViewTextBoxColumn3
- //
- dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.dataGridViewTextBoxColumn3.DefaultCellStyle = dataGridViewCellStyle9;
- this.dataGridViewTextBoxColumn3.FillWeight = 68.40062F;
- this.dataGridViewTextBoxColumn3.HeaderText = "L1%";
- this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
- this.dataGridViewTextBoxColumn3.ReadOnly = true;
- this.dataGridViewTextBoxColumn3.Width = 29;
- //
- // dataGridViewTextBoxColumn4
- //
- dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle10;
- this.dataGridViewTextBoxColumn4.FillWeight = 70.44655F;
- this.dataGridViewTextBoxColumn4.HeaderText = "L2%";
- this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
- this.dataGridViewTextBoxColumn4.ReadOnly = true;
- this.dataGridViewTextBoxColumn4.Width = 30;
- //
- // dataGridViewTextBoxColumn5
- //
- dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.dataGridViewTextBoxColumn5.DefaultCellStyle = dataGridViewCellStyle11;
- this.dataGridViewTextBoxColumn5.FillWeight = 72.72363F;
- this.dataGridViewTextBoxColumn5.HeaderText = "L3%";
- this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
- this.dataGridViewTextBoxColumn5.ReadOnly = true;
- this.dataGridViewTextBoxColumn5.Width = 30;
- //
- // dataGridViewTextBoxColumn6
- //
- dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.dataGridViewTextBoxColumn6.DefaultCellStyle = dataGridViewCellStyle12;
- this.dataGridViewTextBoxColumn6.FillWeight = 75.25803F;
- this.dataGridViewTextBoxColumn6.HeaderText = "L4%";
- this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
- this.dataGridViewTextBoxColumn6.ReadOnly = true;
- this.dataGridViewTextBoxColumn6.Width = 32;
- //
- // dataGridViewTextBoxColumn7
- //
- dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.dataGridViewTextBoxColumn7.DefaultCellStyle = dataGridViewCellStyle13;
- this.dataGridViewTextBoxColumn7.FillWeight = 78.07879F;
- this.dataGridViewTextBoxColumn7.HeaderText = "L5%";
- this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
- this.dataGridViewTextBoxColumn7.ReadOnly = true;
- this.dataGridViewTextBoxColumn7.Width = 33;
- //
- // dataGridViewTextBoxColumn8
- //
- dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.dataGridViewTextBoxColumn8.DefaultCellStyle = dataGridViewCellStyle14;
- this.dataGridViewTextBoxColumn8.FillWeight = 81.21828F;
- this.dataGridViewTextBoxColumn8.HeaderText = "dataGridViewTextBoxColumn8";
- this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
- this.dataGridViewTextBoxColumn8.ReadOnly = true;
- this.dataGridViewTextBoxColumn8.Width = 150;
- //
- // dataGridView2
- //
- this.dataGridView2.AllowUserToAddRows = false;
- this.dataGridView2.BackgroundColor = System.Drawing.SystemColors.ControlLightLight;
- dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- dataGridViewCellStyle15.BackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle15.Font = new System.Drawing.Font("宋体", 9F);
- dataGridViewCellStyle15.ForeColor = System.Drawing.SystemColors.WindowText;
- dataGridViewCellStyle15.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle15.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.dataGridView2.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle15;
- this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.pointName,
- this.pointDeviation,
- this.pointL1,
- this.pointL2,
- this.pointL3,
- this.pointL4,
- this.pointL5,
- this.pointAverage});
- this.dataGridView2.Location = new System.Drawing.Point(6, 52);
- this.dataGridView2.Name = "dataGridView2";
- this.dataGridView2.ReadOnly = true;
- this.dataGridView2.RowHeadersVisible = false;
- this.dataGridView2.RowTemplate.Height = 23;
- this.dataGridView2.Size = new System.Drawing.Size(340, 143);
- this.dataGridView2.TabIndex = 9;
- //
- // pointName
- //
- dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.pointName.DefaultCellStyle = dataGridViewCellStyle16;
- this.pointName.HeaderText = "pointName";
- this.pointName.Name = "pointName";
- this.pointName.ReadOnly = true;
- this.pointName.Width = 42;
- //
- // pointDeviation
- //
- dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.pointDeviation.DefaultCellStyle = dataGridViewCellStyle17;
- this.pointDeviation.HeaderText = "pointDeviation";
- this.pointDeviation.Name = "pointDeviation";
- this.pointDeviation.ReadOnly = true;
- this.pointDeviation.Width = 150;
- //
- // pointL1
- //
- dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.pointL1.DefaultCellStyle = dataGridViewCellStyle18;
- this.pointL1.HeaderText = "L1%";
- this.pointL1.Name = "pointL1";
- this.pointL1.ReadOnly = true;
- this.pointL1.Width = 42;
- //
- // pointL2
- //
- dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.pointL2.DefaultCellStyle = dataGridViewCellStyle19;
- this.pointL2.HeaderText = "L2%";
- this.pointL2.Name = "pointL2";
- this.pointL2.ReadOnly = true;
- this.pointL2.Width = 43;
- //
- // pointL3
- //
- dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.pointL3.DefaultCellStyle = dataGridViewCellStyle20;
- this.pointL3.HeaderText = "L3%";
- this.pointL3.Name = "pointL3";
- this.pointL3.ReadOnly = true;
- this.pointL3.Width = 42;
- //
- // pointL4
- //
- dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.pointL4.DefaultCellStyle = dataGridViewCellStyle21;
- this.pointL4.HeaderText = "L4%";
- this.pointL4.Name = "pointL4";
- this.pointL4.ReadOnly = true;
- this.pointL4.Width = 42;
- //
- // pointL5
- //
- dataGridViewCellStyle22.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.pointL5.DefaultCellStyle = dataGridViewCellStyle22;
- this.pointL5.HeaderText = "L5%";
- this.pointL5.Name = "pointL5";
- this.pointL5.ReadOnly = true;
- this.pointL5.Width = 42;
- //
- // pointAverage
- //
- dataGridViewCellStyle23.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.pointAverage.DefaultCellStyle = dataGridViewCellStyle23;
- this.pointAverage.HeaderText = "pointAverage";
- this.pointAverage.Name = "pointAverage";
- this.pointAverage.ReadOnly = true;
- this.pointAverage.Width = 70;
- //
- // button8
- //
- this.button8.BackColor = System.Drawing.SystemColors.Control;
- this.button8.Location = new System.Drawing.Point(246, 20);
- this.button8.Name = "button8";
- this.button8.Size = new System.Drawing.Size(99, 26);
- this.button8.TabIndex = 8;
- this.button8.UseVisualStyleBackColor = false;
- this.button8.Click += new System.EventHandler(this.button8_Click);
- this.button8.LostFocus += new System.EventHandler(this.button8_LostFocus);
- //
- // button7
- //
- this.button7.BackColor = System.Drawing.SystemColors.Control;
- this.button7.Location = new System.Drawing.Point(127, 20);
- this.button7.Name = "button7";
- this.button7.Size = new System.Drawing.Size(113, 26);
- this.button7.TabIndex = 7;
- this.button7.UseVisualStyleBackColor = false;
- this.button7.Click += new System.EventHandler(this.button7_Click);
- this.button7.LostFocus += new System.EventHandler(this.button7_LostFocus);
- //
- // button6
- //
- this.button6.BackColor = System.Drawing.SystemColors.Control;
- this.button6.Location = new System.Drawing.Point(9, 20);
- this.button6.Name = "button6";
- this.button6.Size = new System.Drawing.Size(112, 26);
- this.button6.TabIndex = 6;
- this.button6.UseVisualStyleBackColor = false;
- this.button6.Click += new System.EventHandler(this.button6_Click);
- this.button6.LostFocus += new System.EventHandler(this.button6_LostFocus);
- //
- // groupBox6
- //
- this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox6.Controls.Add(this.button10);
- this.groupBox6.Controls.Add(this.button9);
- this.groupBox6.Location = new System.Drawing.Point(153, 497);
- this.groupBox6.Name = "groupBox6";
- this.groupBox6.Size = new System.Drawing.Size(356, 59);
- this.groupBox6.TabIndex = 7;
- this.groupBox6.TabStop = false;
- //
- // button10
- //
- this.button10.BackColor = System.Drawing.SystemColors.Control;
- this.button10.Location = new System.Drawing.Point(182, 24);
- this.button10.Name = "button10";
- this.button10.Size = new System.Drawing.Size(138, 26);
- this.button10.TabIndex = 11;
- this.button10.UseVisualStyleBackColor = false;
- this.button10.Click += new System.EventHandler(this.button10_Click);
- //
- // button9
- //
- this.button9.BackColor = System.Drawing.SystemColors.Control;
- this.button9.Location = new System.Drawing.Point(16, 23);
- this.button9.Name = "button9";
- this.button9.Size = new System.Drawing.Size(148, 26);
- this.button9.TabIndex = 10;
- this.button9.UseVisualStyleBackColor = false;
- this.button9.Click += new System.EventHandler(this.button9_Click);
- //
- // groupBox7
- //
- this.groupBox7.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.groupBox7.Location = new System.Drawing.Point(515, 60);
- this.groupBox7.Name = "groupBox7";
- this.groupBox7.Size = new System.Drawing.Size(580, 496);
- this.groupBox7.TabIndex = 8;
- this.groupBox7.TabStop = false;
- //
- // groupBox8
- //
- this.groupBox8.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.groupBox8.Controls.Add(this.button17);
- 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, 562);
- this.groupBox8.Name = "groupBox8";
- this.groupBox8.Size = new System.Drawing.Size(1081, 204);
- this.groupBox8.TabIndex = 9;
- this.groupBox8.TabStop = false;
- //
- // button17
- //
- this.button17.Anchor = System.Windows.Forms.AnchorStyles.Right;
- this.button17.BackColor = System.Drawing.SystemColors.Control;
- this.button17.Location = new System.Drawing.Point(941, 102);
- this.button17.Name = "button17";
- this.button17.Size = new System.Drawing.Size(128, 26);
- this.button17.TabIndex = 23;
- this.button17.UseVisualStyleBackColor = false;
- this.button17.Click += new System.EventHandler(this.button17_Click);
- //
- // listView2
- //
- this.listView2.Anchor = ((System.Windows.Forms.AnchorStyles)((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(181, 140);
- 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.listView_SelectedIndexChanged);
- //
- // numericUpDown1
- //
- this.numericUpDown1.Anchor = 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(16, 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.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.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.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.Bottom | 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;
- dataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- dataGridViewCellStyle24.BackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle24.Font = new System.Drawing.Font("宋体", 9F);
- dataGridViewCellStyle24.ForeColor = System.Drawing.SystemColors.WindowText;
- dataGridViewCellStyle24.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle24.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle24.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.dataGridView4.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle24;
- this.dataGridView4.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
- this.dataGridView4.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
- this.Column1,
- this.Column2,
- this.Column3,
- this.Column4,
- this.Column5,
- this.Column6,
- this.Column7,
- this.Column8,
- this.Column9,
- this.Column10});
- this.dataGridView4.Location = new System.Drawing.Point(228, 20);
- this.dataGridView4.Name = "dataGridView4";
- this.dataGridView4.RowHeadersVisible = false;
- this.dataGridView4.RowTemplate.Height = 23;
- this.dataGridView4.Size = new System.Drawing.Size(693, 176);
- this.dataGridView4.TabIndex = 15;
- //
- // Column1
- //
- dataGridViewCellStyle25.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.Column1.DefaultCellStyle = dataGridViewCellStyle25;
- this.Column1.FillWeight = 91.37055F;
- this.Column1.HeaderText = "Column1";
- this.Column1.Name = "Column1";
- //
- // Column2
- //
- dataGridViewCellStyle26.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.Column2.DefaultCellStyle = dataGridViewCellStyle26;
- this.Column2.FillWeight = 91.37055F;
- this.Column2.HeaderText = "Column2";
- this.Column2.Name = "Column2";
- //
- // Column3
- //
- dataGridViewCellStyle27.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.Column3.DefaultCellStyle = dataGridViewCellStyle27;
- this.Column3.FillWeight = 91.37055F;
- this.Column3.HeaderText = "Column3";
- this.Column3.Name = "Column3";
- //
- // Column4
- //
- dataGridViewCellStyle28.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.Column4.DefaultCellStyle = dataGridViewCellStyle28;
- this.Column4.FillWeight = 177.665F;
- this.Column4.HeaderText = "Column4";
- this.Column4.Name = "Column4";
- //
- // Column5
- //
- dataGridViewCellStyle29.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.Column5.DefaultCellStyle = dataGridViewCellStyle29;
- this.Column5.FillWeight = 91.37055F;
- this.Column5.HeaderText = "L1%";
- this.Column5.Name = "Column5";
- //
- // Column6
- //
- dataGridViewCellStyle30.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.Column6.DefaultCellStyle = dataGridViewCellStyle30;
- this.Column6.FillWeight = 91.37055F;
- this.Column6.HeaderText = "L2%";
- this.Column6.Name = "Column6";
- //
- // Column7
- //
- dataGridViewCellStyle31.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.Column7.DefaultCellStyle = dataGridViewCellStyle31;
- this.Column7.FillWeight = 91.37055F;
- this.Column7.HeaderText = "L3%";
- this.Column7.Name = "Column7";
- //
- // Column8
- //
- dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.Column8.DefaultCellStyle = dataGridViewCellStyle32;
- this.Column8.FillWeight = 91.37055F;
- this.Column8.HeaderText = "L4%";
- this.Column8.Name = "Column8";
- //
- // Column9
- //
- dataGridViewCellStyle33.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.Column9.DefaultCellStyle = dataGridViewCellStyle33;
- this.Column9.FillWeight = 91.37055F;
- this.Column9.HeaderText = "L5%";
- this.Column9.Name = "Column9";
- //
- // Column10
- //
- dataGridViewCellStyle34.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- this.Column10.DefaultCellStyle = dataGridViewCellStyle34;
- this.Column10.FillWeight = 91.37055F;
- this.Column10.HeaderText = "Column10";
- this.Column10.Name = "Column10";
- //
- // 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);
- //
- // RecombinationRateDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
- this.BackColor = System.Drawing.SystemColors.Control;
- this.ClientSize = new System.Drawing.Size(1107, 770);
- this.Controls.Add(this.groupBox8);
- this.Controls.Add(this.groupBox7);
- this.Controls.Add(this.groupBox6);
- this.Controls.Add(this.groupBox5);
- this.Controls.Add(this.groupBox4);
- this.Controls.Add(this.groupBox3);
- this.Controls.Add(this.groupBox2);
- this.Controls.Add(this.groupBox1);
- this.Font = new System.Drawing.Font("宋体", 9F);
- this.Name = "RecombinationRateDialog";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.RecombinationRateDialog_FormClosing);
- this.Controls.SetChildIndex(this.groupBox1, 0);
- this.Controls.SetChildIndex(this.groupBox2, 0);
- this.Controls.SetChildIndex(this.groupBox3, 0);
- this.Controls.SetChildIndex(this.groupBox4, 0);
- this.Controls.SetChildIndex(this.groupBox5, 0);
- this.Controls.SetChildIndex(this.groupBox6, 0);
- this.Controls.SetChildIndex(this.groupBox7, 0);
- this.Controls.SetChildIndex(this.groupBox8, 0);
- this.groupBox1.ResumeLayout(false);
- this.groupBox1.PerformLayout();
- this.groupBox2.ResumeLayout(false);
- this.groupBox3.ResumeLayout(false);
- this.groupBox4.ResumeLayout(false);
- this.groupBox4.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
- this.groupBox5.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView3)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
- this.groupBox6.ResumeLayout(false);
- this.groupBox8.ResumeLayout(false);
- this.groupBox8.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView4)).EndInit();
- this.ResumeLayout(false);
- }
- #endregion
- /// <summary>
- /// 刷新工件下拉
- /// </summary>
- public void RefreshCombobox()
- {
- WorkpieceMaintenanceModel workpieceMaintenanceModel = XmlSerializeHelper.DESerializer<WorkpieceMaintenanceModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\WorkpieceMaintenanceModel.xml", FileMode.Open));
- ArrayList arrayList = new ArrayList();
- foreach (var item in workpieceMaintenanceModel.Workpieces)
- {
- arrayList.Add(item.Name);
- }
- this.comboBox1.DataSource = null;
- this.comboBox1.DataSource = arrayList;
- if(arrayList.Count > 0)
- {
- if (string.IsNullOrEmpty(this.selectItemValue))
- this.comboBox1.SelectedIndex = 0;
- else
- this.comboBox1.SelectedItem = this.selectItemValue;
- }
- }
- private void listView1_MouseDown(object sender, MouseEventArgs e)
- {
- this.changeCount = 0;
- }
- private void listView1_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
- {
- bool change = false;
- if (this.changeCount == 0)
- {
- if (this.dataGridView2.Rows.Count > 0)
- {
- if(this.saveSuccess)
- {
- DialogResult dt = MessageBox.Show(PdnResources.GetString("Menu.Whethertosavetherrentpicture.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.YesNo, MessageBoxIcon.Question);
- if (dt == DialogResult.Yes)
- {
- string imgName = this.appWorkspace.DocumentWorkspaces[e.ItemIndex].GetFriendlyName();
- string tag = this.imageList1.Images.Keys[e.ItemIndex];
- DataTable dataTable1 = new DataTable();
- bool replace = false;
- int add = 0;
- foreach (ListViewItem item in this.listView2.Items)
- {
- if (item.Name.Equals(tag))
- {
- add++;
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Themeasurementdertoreplace.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
- if (dr == DialogResult.OK)
- {
- replace = true;
- this.listView2.Items.Remove(item);
- }
- break;
- }
- }
- if (replace || this.listView2.Items.Count == 0 || add == 0)
- {
- this.dataGridView4.Rows.Clear();
- if (this.linesNumber == 3)
- {
- this.dataGridView4.Columns[7].Visible = false;
- this.dataGridView4.Columns[8].Visible = false;
- }
- else if (this.linesNumber == 4)
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = false;
- }
- else if (this.linesNumber == 5)
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = true;
- }
- ListViewItem listViewItem = new ListViewItem();
- listViewItem.Name = tag;
- listViewItem.SubItems[0].Text = imgName;
- listViewItem.Tag = "" + this.linesNumber;
- if (this.listView2.Items.Count == 0)
- this.listView2.Items.Add(listViewItem);
- else
- this.listView2.Items.Insert(0, listViewItem);
- dataTable1.TableName = tag;
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dataTable1.Columns.Add(c.HeaderText);
- }
- foreach (DataTable dataTable in this.pointDataTables)
- {
- for (int r = 0; r < dataTable.Rows.Count; r++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < dataTable.Columns.Count; c++)
- {
- dgvr.Cells[0].Value = imgName;
- dgvr.Cells[1].Value = dataTable.TableName;
- if (c > 1 && !dataTable.Rows[r][c].ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text")))
- {
- if (this.linesNumber == 3)
- {
- if (c + 2 != 7 && c + 2 != 8)
- dgvr.Cells[c + 2].Value = Math.Round((double)Convert.ToDecimal(dataTable.Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString();
- else
- dgvr.Cells[c + 2].Value = dataTable.Rows[r][c].ToString();
- }
- else if (this.linesNumber == 4)
- {
- if (c + 2 != 8)
- dgvr.Cells[c + 2].Value = Math.Round((double)Convert.ToDecimal(dataTable.Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString();
- else
- dgvr.Cells[c + 2].Value = dataTable.Rows[r][c].ToString();
- }
- else if (this.linesNumber == 5)
- {
- dgvr.Cells[c + 2].Value = Math.Round((double)Convert.ToDecimal(dataTable.Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString();
- }
- }
- else
- dgvr.Cells[c + 2].Value = dataTable.Rows[r][c].ToString();
- }
- this.dataGridView4.Rows.Add(dgvr);
- DataRow dataRow = dataTable1.NewRow();
- for (int c = 0; c < dataTable.Columns.Count + 2; c++)
- {
- if (c == 0)
- dataRow[this.dataGridView4.Columns[c].HeaderText] = imgName;
- else if (c == 1)
- dataRow[this.dataGridView4.Columns[c].HeaderText] = dataTable.TableName;
- else
- dataRow[this.dataGridView4.Columns[c].HeaderText] = dataTable.Rows[r][c - 2].ToString();
- }
- dataTable1.Rows.Add(dataRow);
- }
- }
- foreach (DataTable dataTable2 in pictureDataTables)
- {
- if (dataTable2.TableName.Equals(dataTable1.TableName))
- {
- pictureDataTables.Remove(dataTable2);
- break;
- }
- }
- this.pictureDataTables.Add(dataTable1);
- if (this.allShow)
- AllShow();
- this.bitDic.Clear();
- foreach (var item in this.bitDic1)
- {
- this.bitDic.Add(item.Key, item.Value);
- }
- this.listView2.Items[0].Selected = true;
- }
- }
- }
- }
- }
- else
- {
- if (change)
- SelectedIndexChanged();
- }
- this.changeCount++;
- }
- private void listView1_SelectedIndexChanged(object sender, EventArgs e)
- {
- SelectedIndexChanged();
- }
- private void SelectedIndexChanged()
- {
- if (this.listView1.FocusedItem != null && this.listView1.FocusedItem.Selected)
- {
- this.unitLength = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetRuler(MeasurementUnit.Micron);
- /// <summary>
- /// 选中图片的bitmap
- Mat imageMat = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreatedAliasedMat();
- Document document = Document.FromImageMat(imageMat.Clone());
- this.documentWorkspace.Document = document;
- this.documentWorkspace.Visible = true;
- this.documentWorkspace.GraphicsList = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GraphicsList;
- //this.documentWorkspace.phaseModels = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].phaseModels;
- this.documentWorkspace.Document = Document.FromImageMat(this.documentItems[this.listView1.FocusedItem.Index].imageMat);
- this.documentWorkspace.Visible = true;
- this.documentWorkspace.ActiveTool = DrawToolType.InclusionNoEffect;
- this.documentWorkspace.PhaseModels.Clear();
- this.documentWorkspace.PhaseModels.AddRange(this.documentItems[this.listView1.FocusedItem.Index].phaseModels);
- // 选择了图片
- this.selectPicture = true;
- this.commonControlButtons.Visible = true;
- this.dataGridView1.Rows.Clear();
- this.dataGridView2.Rows.Clear();
- this.dataGridView3.Rows.Clear();
- this.pointDataTables.Clear();
- this.pointRectangleFs.Clear();
- this.textBox1.Clear();
- this.textBox2.Clear();
- //this.checkBox1.Checked = false;
- //this.checkBox2.Checked = false;
- this.button11.Visible = true;
- this.button16.Visible = false;
- pointCountA1.Clear();
- pointCountA2.Clear();
- pointCountA3.Clear();
- pointCountB1.Clear();
- pointCountB2.Clear();
- pointCountB3.Clear();
- pointCountB4.Clear();
- pointCountC1.Clear();
- pointCountC2.Clear();
- pointCountC3.Clear();
- pointCountC4.Clear();
- pointCountC5.Clear();
- this.lengthL1.Clear();
- this.lengthL2.Clear();
- this.lengthL3.Clear();
- this.lengthL4.Clear();
- this.lengthL5.Clear();
- this.pointDrawkb = false;
- RefreshPanel();
- InitMeasurePoints();
- this.documentWorkspace.Refresh();
-
- //this.documentWorkspace.Refresh();
- //this.applyButtonImpl(sender, e);
- }
- }
- /// <summary>
- /// 初始化测量数据
- /// </summary>
- private bool InitMeasureData()
- {
- bool retu = true;
- this.pointDrawkb = false;
- if (this.listView2.Items.Count > 0)
- {
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Whethertoclearallanalysisresults.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
- if (dr == DialogResult.OK)
- {
- this.dataGridView1.Rows.Clear();
- this.dataGridView2.Rows.Clear();
- this.dataGridView3.Rows.Clear();
- this.pointDataTables.Clear();
- this.pointRectangleFs.Clear();
- this.textBox1.Clear();
- this.textBox2.Clear();
- this.comboBox1.Enabled = true;
- //this.checkBox1.Checked = false;
- //this.checkBox2.Checked = false;
- this.button3.Visible = true;
- this.button15.Visible = false;
- this.button11.Visible = true;
- this.button16.Visible = false;
- pointCountA1.Clear();
- pointCountA2.Clear();
- pointCountA3.Clear();
- pointCountB1.Clear();
- pointCountB2.Clear();
- pointCountB3.Clear();
- pointCountB4.Clear();
- pointCountC1.Clear();
- pointCountC2.Clear();
- pointCountC3.Clear();
- pointCountC4.Clear();
- pointCountC5.Clear();
- this.dataGridView4.Rows.Clear();
- this.pictureDataTables.Clear();
- this.listView2.Items.Clear();
- this.lengthL1.Clear();
- this.lengthL2.Clear();
- this.lengthL3.Clear();
- this.lengthL4.Clear();
- this.lengthL5.Clear();
- }
- else
- {
- retu = false;
- }
- }
- else
- {
- this.dataGridView1.Rows.Clear();
- this.dataGridView2.Rows.Clear();
- this.dataGridView3.Rows.Clear();
- this.pointDataTables.Clear();
- this.pointRectangleFs.Clear();
- this.textBox1.Clear();
- this.textBox2.Clear();
- this.comboBox1.Enabled = true;
- //this.checkBox1.Checked = false;
- //this.checkBox2.Checked = false;
- this.button3.Visible = true;
- this.button15.Visible = false;
- this.button11.Visible = true;
- this.button16.Visible = false;
- pointCountA1.Clear();
- pointCountA2.Clear();
- pointCountA3.Clear();
- pointCountB1.Clear();
- pointCountB2.Clear();
- pointCountB3.Clear();
- pointCountB4.Clear();
- pointCountC1.Clear();
- pointCountC2.Clear();
- pointCountC3.Clear();
- pointCountC4.Clear();
- pointCountC5.Clear();
- this.lengthL1.Clear();
- this.lengthL2.Clear();
- this.lengthL3.Clear();
- this.lengthL4.Clear();
- this.lengthL5.Clear();
- }
- this.documentWorkspace.Refresh();
- return retu;
- }
- /// <summary>
- /// 初始化测量点
- /// </summary>
- public void InitMeasurePoints()
- {
- this.pointDrawkb = true;
- for (int i = 0; i < pointRectangleFs.Count; i++)
- {
- pointRectangleFs[i].Clear();
- }
- for (int i = 0; i < pointCountA1.Count; i++)
- {
- pointCountA1[i] = 0;
- }
- for (int i = 0; i < pointCountA2.Count; i++)
- {
- pointCountA2[i] = 0;
- }
- for (int i = 0; i < pointCountA3.Count; i++)
- {
- pointCountA3[i] = 0;
- }
- for (int i = 0; i < pointCountB1.Count; i++)
- {
- pointCountB1[i] = 0;
- }
- for (int i = 0; i < pointCountB2.Count; i++)
- {
- pointCountB2[i] = 0;
- }
- for (int i = 0; i < pointCountB3.Count; i++)
- {
- pointCountB3[i] = 0;
- }
- for (int i = 0; i < pointCountB4.Count; i++)
- {
- pointCountB4[i] = 0;
- }
- for (int i = 0; i < pointCountC1.Count; i++)
- {
- pointCountC1[i] = 0;
- }
- for (int i = 0; i < pointCountC2.Count; i++)
- {
- pointCountC2[i] = 0;
- }
- for (int i = 0; i < pointCountC3.Count; i++)
- {
- pointCountC3[i] = 0;
- }
- for (int i = 0; i < pointCountC4.Count; i++)
- {
- pointCountC4[i] = 0;
- }
- for (int i = 0; i < pointCountC5.Count; i++)
- {
- pointCountC5[i] = 0;
- }
- this.documentWorkspace.Refresh();
- }
- /// <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.RecombinationRate");
- 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)
- {
- WorkpieceMaintenance workpieceMaintenance = new WorkpieceMaintenance();
- workpieceMaintenance.StartPosition = FormStartPosition.CenterScreen;
- workpieceMaintenance.ShowDialog(this);
- }
- /// <summary>
- /// 开始测量按钮
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button3_Click(object sender, EventArgs e)
- {
- if (this.selectPicture)
- {
- bool retu = InitMeasureData();
- if (this.comboBox1.SelectedIndex >= 0)
- {
- if(retu)
- {
- GetDataFromXML();
- this.button4.Enabled = false;
- this.lineChange = false;
- this.comboBox1.Enabled = false;
- this.button3.Visible = false;
- this.button15.Visible = true;
- this.button15.Focus();
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectaworkpiece.text")+"!");
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectimage.Text")+"!");
- }
- }
- /// <summary>
- /// 停止测量
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button15_Click(object sender, EventArgs e)
- {
- this.button4.Enabled = true;
- this.pointDrawkb = false;
- this.lineChange = true;
- this.comboBox1.Enabled = true;
- this.button3.Visible = true;
- this.button15.Visible = false;
- this.button3.Focus();
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 单元格点击
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void dgvData_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
- {
- if (e.RowIndex > -1)
- {
- if (this.dataGridView1.Columns[e.ColumnIndex].Index == 2)
- {
- mouseX = e.X;
- mouseY = e.Y;
- }
- }
- }
- /// <summary>
- /// 单元格点击内容
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void dgvData_CellContentClick(object sender, DataGridViewCellEventArgs e)
- {
- if (e.RowIndex > -1)
- {
- switch (this.dataGridView1.Columns[e.ColumnIndex].Index)
- {
- case 2:
- Rectangle rc = this.dataGridView1.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false);//单元格区域的矩形
- if (0 < mouseX && mouseX < rc.Width / 2)
- {
- }
- else if (rc.Width / 2 < mouseX && mouseX < rc.Width)
- {
-
- }
- break;
- }
- }
- }
- /// <summary>
- /// 编辑结束后
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void dataGridView1_RowLeave(object sender, DataGridViewCellEventArgs e)
- {
- this.dataGridView1.Rows[e.RowIndex].ReadOnly = true;
- this.dataGridView1.Rows[e.RowIndex].DefaultCellStyle.SelectionBackColor = SystemColors.MenuHighlight;
- }
- /// <summary>
- /// 样品保存
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button5_Click(object sender, EventArgs e)
- {
- if (this.button3.Visible)
- MessageBox.Show(PdnResources.GetString("Menu.Pleasestartmeasuring.text")+"!");
- else
- {
- if (string.IsNullOrEmpty(this.textBox1.Text))
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseenterthesamplename.text")+"!");
- this.textBox1.Focus();
- }
- else
- {
- bool canAdd = true;
- for (int i = 0; i < dataGridView1.Rows.Count; i++)
- {
- if (this.textBox1.Text.Equals(dataGridView1.Rows[i].Cells[0].Value))
- {
- MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
- this.textBox1.Focus();
- canAdd = false;
- }
- }
- if (canAdd)
- {
- this.pointDrawkb = true;
- DataTable dataTable = new DataTable();
- DataGridViewRow row = new DataGridViewRow();
- DataGridViewTextBoxCell textboxcell = new DataGridViewTextBoxCell();
- string name = this.textBox1.Text;
- textboxcell.Value = this.textBox1.Text;
- dataTable.TableName = this.textBox1.Text;
- this.pointDataTables.Add(dataTable);
- row.Cells.Add(textboxcell);
- textboxcell = new DataGridViewTextBoxCell();
- textboxcell.Value = this.textBox2.Text;
- row.Cells.Add(textboxcell);
- DataGridViewButtonCell dataGridViewButtonCell = new DataGridViewButtonCell();
- dataGridViewButtonCell.Value = PdnResources.GetString("Menu.Edit.Text");
- row.Cells.Add(dataGridViewButtonCell);
- dataGridViewButtonCell = new DataGridViewButtonCell();
- dataGridViewButtonCell.Value = PdnResources.GetString("Menu.Edit.Delete.Text");
- row.Cells.Add(dataGridViewButtonCell);
- row.ReadOnly = true;
- this.dataGridView1.Rows.Add(row);
- this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Selected = true;
- InitializeMeasurementPpointList(this.textBox1.Text);
- this.textBox1.Clear();
- this.textBox2.Clear();
- //this.pointCountA1 = 0;
- //this.pointCountA2 = 0;
- //this.pointCountA3 = 0;
- //this.pointCountB1 = 0;
- //this.pointCountB2 = 0;
- //this.pointCountB3 = 0;
- //this.pointCountB4 = 0;
- //this.pointCountC1 = 0;
- //this.pointCountC2 = 0;
- //this.pointCountC3 = 0;
- //this.pointCountC4 = 0;
- //this.pointCountC5 = 0;
- //this.rectangleFs.Clear();
- if (this.dataGridView1.DisplayedRowCount(false) != this.dataGridView1.RowCount)
- this.dataGridView1.Columns[1].Width = 142;
- string tag = this.imageList1.Images.Keys[this.listView1.SelectedItems[0].Index] + "|" + name;
- pointRectangleFs.Add(new List<RectangleF>());
- pointCountA1.Add(0);
- pointCountA2.Add(0);
- pointCountA3.Add(0);
- pointCountB1.Add(0);
- pointCountB2.Add(0);
- pointCountB3.Add(0);
- pointCountB4.Add(0);
- pointCountC1.Add(0);
- pointCountC2.Add(0);
- pointCountC3.Add(0);
- pointCountC4.Add(0);
- pointCountC5.Add(0);
- if(this.linesNumber == 3)
- {
- this.lengthL1.Add(new List<decimal>());
- this.lengthL2.Add(new List<decimal>());
- this.lengthL3.Add(new List<decimal>());
- }
- else if (this.linesNumber == 4)
- {
- this.lengthL1.Add(new List<decimal>());
- this.lengthL2.Add(new List<decimal>());
- this.lengthL3.Add(new List<decimal>());
- this.lengthL4.Add(new List<decimal>());
- }
- else if (this.linesNumber == 5)
- {
- this.lengthL1.Add(new List<decimal>());
- this.lengthL2.Add(new List<decimal>());
- this.lengthL3.Add(new List<decimal>());
- this.lengthL4.Add(new List<decimal>());
- this.lengthL5.Add(new List<decimal>());
- }
- //保存处理后的图片
- 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);
- Graphics graphics;
- Bitmap newBit;
- Bitmap processedBit;
- if (this.documentItems[this.listView1.FocusedItem.Index].phaseModels.Count != 0
- && this.documentItems[this.listView1.FocusedItem.Index].phaseModels[0].mat != null)
- {
- processedBit = BitmapConverter.ToBitmap(this.documentWorkspace.PhaseModels[0].mat);
- newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- graphics = Graphics.FromImage(newBit);
- graphics.DrawImage(processedBit, new PointF(0, 0));
- Draw(graphics);
- newBit.Tag = pantographRatio;
- tempBit.Add(newBit);
- }
- else
- {
- newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- graphics = Graphics.FromImage(newBit);
- Draw(graphics);
- newBit.Tag = pantographRatio;
- tempBit.Add(newBit);
- }
- if (bitDic1.ContainsKey(tag))
- bitDic1[tag] = tempBit;
- else
- bitDic1.Add(tag, tempBit);
- this.saveSuccess = true;
- this.documentWorkspace.Refresh();
- }
- }
- }
- }
- /// <summary>
- /// 单元格点击
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
- {
- dataGridView1.Rows[e.RowIndex].Selected = true;
- if (e.RowIndex < 0)
- return;
- if (e.ColumnIndex < 0)
- return;
- if (PdnResources.GetString("Menu.Edit.Delete.Text").Equals(this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value))
- {
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Areyousuretodeletethesample?.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
- if (dr == DialogResult.OK)
- {
- string tag = this.imageList1.Images.Keys[this.listView1.SelectedItems[0].Index] + "|" + this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
- if (bitDic1.ContainsKey(tag))
- bitDic1.Remove(tag);
- if(this.linesNumber == 3)
- {
- this.lengthL1.RemoveAt(e.RowIndex);
- this.lengthL2.RemoveAt(e.RowIndex);
- this.lengthL3.RemoveAt(e.RowIndex);
- }
- else if (this.linesNumber == 4)
- {
- this.lengthL1.RemoveAt(e.RowIndex);
- this.lengthL2.RemoveAt(e.RowIndex);
- this.lengthL3.RemoveAt(e.RowIndex);
- this.lengthL4.RemoveAt(e.RowIndex);
- }
- else if (this.linesNumber == 5)
- {
- this.lengthL1.RemoveAt(e.RowIndex);
- this.lengthL2.RemoveAt(e.RowIndex);
- this.lengthL3.RemoveAt(e.RowIndex);
- this.lengthL4.RemoveAt(e.RowIndex);
- this.lengthL5.RemoveAt(e.RowIndex);
- }
- if (this.dataGridView1.Rows.Count > 0)
- {
- this.pointRectangleFs.RemoveAt(e.RowIndex);
- this.pointCountA1.RemoveAt(e.RowIndex);
- this.pointCountA2.RemoveAt(e.RowIndex);
- this.pointCountA3.RemoveAt(e.RowIndex);
- this.pointCountB1.RemoveAt(e.RowIndex);
- this.pointCountB2.RemoveAt(e.RowIndex);
- this.pointCountB3.RemoveAt(e.RowIndex);
- this.pointCountB4.RemoveAt(e.RowIndex);
- this.pointCountC1.RemoveAt(e.RowIndex);
- this.pointCountC2.RemoveAt(e.RowIndex);
- this.pointCountC3.RemoveAt(e.RowIndex);
- this.pointCountC4.RemoveAt(e.RowIndex);
- this.pointCountC5.RemoveAt(e.RowIndex);
- }
- int deleteIndex = 0;
- foreach (var dataTable in this.pointDataTables)
- {
- if (this.pointDataTables[deleteIndex].TableName.Equals(this.dataGridView1.Rows[e.RowIndex].Cells[0].Value))
- {
- this.pointDataTables.RemoveAt(deleteIndex);
- break;
- }
- deleteIndex++;
- }
- //if (e.RowIndex == this.dataGridView1.Rows.Count - 1)
- //{
- // this.pointCountA1 = 0;
- // this.pointCountA2 = 0;
- // this.pointCountA3 = 0;
- // this.pointCountB1 = 0;
- // this.pointCountB2 = 0;
- // this.pointCountB3 = 0;
- // this.pointCountB4 = 0;
- // this.pointCountC1 = 0;
- // this.pointCountC2 = 0;
- // this.pointCountC3 = 0;
- // this.pointCountC4 = 0;
- // this.pointCountC5 = 0;
- // this.rectangleFs.Clear();
- //}
- this.dataGridView1.Rows.RemoveAt(e.RowIndex);
- if (this.dataGridView1.Rows.Count > 0)
- this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Selected = true;
- else
- {
- //this.pointCountA1 = 0;
- //this.pointCountA2 = 0;
- //this.pointCountA3 = 0;
- //this.pointCountB1 = 0;
- //this.pointCountB2 = 0;
- //this.pointCountB3 = 0;
- //this.pointCountB4 = 0;
- //this.pointCountC1 = 0;
- //this.pointCountC2 = 0;
- //this.pointCountC3 = 0;
- //this.pointCountC4 = 0;
- //this.pointCountC5 = 0;
- //this.rectangleFs.Clear();
- this.pointDrawkb = false;
- this.dataGridView2.Rows.Clear();
- this.dataGridView3.Rows.Clear();
- }
- if (this.dataGridView1.DisplayedRowCount(false) == this.dataGridView1.RowCount)
- this.dataGridView1.Columns[1].Width = 157;
- this.saveSuccess = true;
- this.documentWorkspace.Refresh();
- }
- }
- else if (PdnResources.GetString("Menu.Edit.Text").Equals(this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value))
- {
- MessageBox.Show(PdnResources.GetString("Menu.Thecurrentlinecanbeedited.text")+"!");
- //this.dataGridView1.ClearSelection();
- this.dataGridView1.Rows[e.RowIndex].ReadOnly = false;
- this.dataGridView1.Rows[e.RowIndex].DefaultCellStyle.SelectionBackColor = Color.GreenYellow;
- }
- }
- /// <summary>
- /// 添加样品成功时初
- /// 始化测量点列表
- /// </summary>
- private void InitializeMeasurementPpointList(string sampleName)
- {
- int dataTableIndex = 0;
- for (int i = 0; i < this.pointDataTables.Count; i++)
- {
- if (this.pointDataTables[i].TableName.Equals(sampleName))
- dataTableIndex = i;
- }
- // 配置文件中取得测量点列表值
- if (workpieceMaintenanceModel.Workpieces != null && this.comboBox1.DataSource != null)
- {
- this.dataGridView2.Rows.Clear();
- this.dataGridView3.Rows.Clear();
- for (int i = 0; i < workpieceMaintenanceModel.Workpieces.Count; i++)
- {
- // 选中的工件
- if (workpieceMaintenanceModel.Workpieces[i].Name.Equals(this.comboBox1.SelectedValue))
- {
- // 工件A
- if (workpieceMaintenanceModel.Workpieces[i].Type.Equals(constTypeA))
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewRow dgvr1 = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- dgvr1.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameA;
- dgvr.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueA + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorA;
- dgvr1.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameA;
- dgvr1.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueA + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorA;
- this.dataGridView2.Rows.Add(dgvr);
- this.dataGridView3.Rows.Add(dgvr1);
- }
- // 工件B
- else if (workpieceMaintenanceModel.Workpieces[i].Type.Equals(constTypeB))
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewRow dgvr1 = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- dgvr1.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameA;
- dgvr.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueA + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorA;
- dgvr1.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameA;
- dgvr1.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueA + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorA;
- this.dataGridView2.Rows.Add(dgvr);
- this.dataGridView3.Rows.Add(dgvr1);
- dgvr = new DataGridViewRow();
- dgvr1 = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- dgvr1.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameB;
- dgvr.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueB + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorB;
- dgvr1.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameB;
- dgvr1.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueB + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorB;
- this.dataGridView2.Rows.Add(dgvr);
- this.dataGridView3.Rows.Add(dgvr1);
- }
- // 工件C
- else if (workpieceMaintenanceModel.Workpieces[i].Type.Equals(constTypeC))
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewRow dgvr1 = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- dgvr1.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameA;
- dgvr.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueA + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorA;
- dgvr1.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameA;
- dgvr1.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueA + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorA;
- this.dataGridView2.Rows.Add(dgvr);
- this.dataGridView3.Rows.Add(dgvr1);
- dgvr = new DataGridViewRow();
- dgvr1 = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- dgvr1.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameB;
- dgvr.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueB + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorB;
- dgvr1.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameB;
- dgvr1.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueB + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorB;
- this.dataGridView2.Rows.Add(dgvr);
- this.dataGridView3.Rows.Add(dgvr1);
- dgvr = new DataGridViewRow();
- dgvr1 = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- dgvr1.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameC;
- dgvr.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueC + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorC;
- dgvr1.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameC;
- dgvr1.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueC + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorC;
- this.dataGridView2.Rows.Add(dgvr);
- this.dataGridView3.Rows.Add(dgvr1);
- }
- // 工件D
- else if (workpieceMaintenanceModel.Workpieces[i].Type.Equals(constTypeD))
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewRow dgvr1 = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- dgvr1.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameA;
- dgvr.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueA + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorA;
- dgvr1.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameA;
- dgvr1.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueA + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorA;
- this.dataGridView2.Rows.Add(dgvr);
- this.dataGridView3.Rows.Add(dgvr1);
- dgvr = new DataGridViewRow();
- dgvr1 = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- dgvr1.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameB;
- dgvr.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueB + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorB;
- dgvr1.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameB;
- dgvr1.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueB + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorB;
- this.dataGridView2.Rows.Add(dgvr);
- this.dataGridView3.Rows.Add(dgvr1);
- dgvr = new DataGridViewRow();
- dgvr1 = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- dgvr1.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameC;
- dgvr.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueC + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorC;
- dgvr1.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameC;
- dgvr1.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueC + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorC;
- this.dataGridView2.Rows.Add(dgvr);
- this.dataGridView3.Rows.Add(dgvr1);
- dgvr = new DataGridViewRow();
- dgvr1 = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- dgvr1.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameD;
- dgvr.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueD + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorD;
- dgvr1.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameD;
- dgvr1.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueD + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorD;
- this.dataGridView2.Rows.Add(dgvr);
- this.dataGridView3.Rows.Add(dgvr1);
- }
- // 工件E
- else if (workpieceMaintenanceModel.Workpieces[i].Type.Equals(constTypeE))
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewRow dgvr1 = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- dgvr1.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameA;
- dgvr.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueA + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorA;
- dgvr1.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameA;
- dgvr1.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueA + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorA;
- this.dataGridView2.Rows.Add(dgvr);
- this.dataGridView3.Rows.Add(dgvr1);
- dgvr = new DataGridViewRow();
- dgvr1 = new DataGridViewRow();
- foreach (DataGridViewColumn c in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- dgvr1.Cells.Add(c.CellTemplate.Clone() as DataGridViewCell);
- }
- dgvr.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameB;
- dgvr.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueB + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorB;
- dgvr1.Cells[0].Value = workpieceMaintenanceModel.Workpieces[i].NameB;
- dgvr1.Cells[1].Value = workpieceMaintenanceModel.Workpieces[i].StandardValueB + "%+-" + workpieceMaintenanceModel.Workpieces[i].ErrorB;
- this.dataGridView2.Rows.Add(dgvr);
- this.dataGridView3.Rows.Add(dgvr1);
- }
- foreach (DataGridViewColumn c in this.dataGridView3.Columns)
- {
- this.pointDataTables[dataTableIndex].Columns.Add(c.Name);
- }
- for (int r = 0; r < this.dataGridView3.Rows.Count; r++)
- {
- DataRow dataRow = this.pointDataTables[dataTableIndex].NewRow();
- for (int c = 0; c < this.dataGridView3.Rows[r].Cells.Count; c++)
- {
- dataRow[this.dataGridView3.Columns[c].Name] = this.dataGridView3.Rows[r].Cells[c].Value;
- }
- this.pointDataTables[dataTableIndex].Rows.Add(dataRow);
- }
- }
- }
-
- }
- }
- /// <summary>
- /// 画布绘制
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Panel_Paint(object sender, PaintEventArgs e)
- {
- if (this.documentWorkspace.CompositionSurface != null)
- {
- //
- // 以下是计算绘制图片的位置和大小并绘制图片
- //
- 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);
- if (this.listView1.SelectedItems.Count > 0 && this.dataGridView1.SelectedCells.Count > 0)
- {
- string tag = this.imageList1.Images.Keys[this.listView1.SelectedItems[0].Index] + "|" + this.dataGridView1.Rows[this.dataGridView1.SelectedCells[0].RowIndex].Cells[0].Value.ToString();
- //保存处理后的图片
- 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);
- Graphics graphics;
- Bitmap newBit;
- Bitmap processedBit;
- if (this.documentItems[this.listView1.FocusedItem.Index].phaseModels.Count != 0
- && this.documentItems[this.listView1.FocusedItem.Index].phaseModels[0].mat != null)
- {
- processedBit = BitmapConverter.ToBitmap(this.documentWorkspace.PhaseModels[0].mat);
- newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- graphics = Graphics.FromImage(newBit);
- graphics.DrawImage(processedBit, new PointF(0, 0));
- Draw(graphics);
- newBit.Tag = pantographRatio;
- tempBit.Add(newBit);
- }
- else
- {
- newBit = originalBit.Clone(new Rectangle(0, 0, originalBit.Width, originalBit.Height), originalBit.PixelFormat);
- graphics = Graphics.FromImage(newBit);
- Draw(graphics);
- newBit.Tag = pantographRatio;
- tempBit.Add(newBit);
- }
- Draw(graphics);
- newBit.Tag = pantographRatio;
- tempBit.Add(newBit);
- if (bitDic1.ContainsKey(tag))
- bitDic1[tag] = tempBit;
- }
- e.Graphics.ScaleTransform(1 / (float)this.documentWorkspace.ScaleFactor.Ratio, 1 / (float)this.documentWorkspace.ScaleFactor.Ratio);
- e.Graphics.TranslateTransform(-x, -y);
- }
- }
- /// <summary>
- /// 获取辅助线和测量点样式
- /// </summary>
- public void RefreshPanel()
- {
- // 辅助线样式
- CompoundRatioStyleModel compoundRatioStyleModelGuideStyle = XmlSerializeHelper.DESerializer<CompoundRatioStyleModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\GuideStyle.xml", FileMode.Open));
- if (compoundRatioStyleModelGuideStyle.guideStyle != null)
- {
- this.lineFont = compoundRatioStyleModelGuideStyle.guideStyle.font;
- this.lineFontSize = compoundRatioStyleModelGuideStyle.guideStyle.fontSize;
- this.lineColor = compoundRatioStyleModelGuideStyle.guideStyle.lineColor;
- this.linesNumber = compoundRatioStyleModelGuideStyle.guideStyle.linesNumber;
- this.lineWidth = compoundRatioStyleModelGuideStyle.guideStyle.lineWidth;
- if(unitLength != 0)
- this.lineSpacing = (float)(compoundRatioStyleModelGuideStyle.guideStyle.spacing / unitLength);
- if (this.linesNumber == 3)
- {
- this.dataGridView2.Columns[5].Visible = false;
- this.dataGridView2.Columns[6].Visible = false;
- this.dataGridView3.Columns[5].Visible = false;
- this.dataGridView3.Columns[6].Visible = false;
- }
- else if(this.linesNumber == 4)
- {
- this.dataGridView2.Columns[5].Visible = true;
- this.dataGridView2.Columns[6].Visible = false;
- this.dataGridView3.Columns[5].Visible = true;
- this.dataGridView3.Columns[6].Visible = false;
- }
- else if (this.linesNumber == 5)
- {
- this.dataGridView2.Columns[5].Visible = true;
- this.dataGridView2.Columns[6].Visible = true;
- this.dataGridView3.Columns[5].Visible = true;
- this.dataGridView3.Columns[6].Visible = true;
- }
- }
- // 测量点样式
- CompoundRatioStyleModel compoundRatioStyleModelSurvePointStyle = XmlSerializeHelper.DESerializer<CompoundRatioStyleModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\SurvePointStyle.xml", FileMode.Open));
- if (compoundRatioStyleModelSurvePointStyle.survePointStyle != null)
- {
- this.pointFont = compoundRatioStyleModelSurvePointStyle.survePointStyle.font;
- this.pointFontSize = compoundRatioStyleModelSurvePointStyle.survePointStyle.fontSize;
- this.pointColor = compoundRatioStyleModelSurvePointStyle.survePointStyle.pointColor;
- this.pointDiameter = (float)(compoundRatioStyleModelSurvePointStyle.survePointStyle.pointDiameter / unitLength);
- this.pointMarkerSymbol = compoundRatioStyleModelSurvePointStyle.survePointStyle.pointMarkerSymbol;
- this.pointStyle = compoundRatioStyleModelSurvePointStyle.survePointStyle.pointStyle;
- this.pointWidth = compoundRatioStyleModelSurvePointStyle.survePointStyle.pointWidth;
- }
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 绘制
- /// </summary>
- private void Draw(Graphics graphics)
- {
- // 抗锯齿
- graphics.SmoothingMode = SmoothingMode.AntiAlias;
- // 以下为绘制样式
- Pen linePen = new Pen(Color.FromArgb(this.lineColor), this.lineWidth);
- Pen pointPen = new Pen(Color.FromArgb(this.pointColor), this.pointWidth);
- Font pointFont = new Font(this.pointFont, this.pointFontSize);
- Font lineFont = new Font(this.lineFont, this.lineFontSize);
- SolidBrush brush = new SolidBrush(Color.FromArgb(this.pointColor));
- /// 测量点操作限制
- if(this.dataGridView1.SelectedRows.Count > 0)
- {
- this.button6.Enabled = this.pointDrawkb;
- this.button7.Enabled = this.pointDrawkb;
- this.button8.Enabled = this.pointDrawkb;
- }
- #region 绘制辅助线
- // 线条数为三
- if (this.linesNumber == 3)
- {
- // 绘制辅助线
- graphics.DrawLine(linePen, new PointF((float)this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing, 0), new PointF((float)this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing, this.documentWorkspace.CompositionSurface.Height));
- graphics.DrawLine(linePen, new PointF((float)this.documentWorkspace.CompositionSurface.Width / 2, 0), new PointF(this.documentWorkspace.CompositionSurface.Width / 2, this.documentWorkspace.CompositionSurface.Height));
- graphics.DrawLine(linePen, new PointF((float)this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing, 0), new PointF((float)this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing, this.documentWorkspace.CompositionSurface.Height));
- }
- // 线条数为四
- else if (this.linesNumber == 4)
- {
- // 绘制辅助线
- graphics.DrawLine(linePen, new PointF(this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.lineSpacing / 2, 0), new PointF(this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.lineSpacing / 2, this.documentWorkspace.CompositionSurface.Height));
- graphics.DrawLine(linePen, new PointF(this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing / 2, 0), new PointF(this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing / 2, this.documentWorkspace.CompositionSurface.Height));
- graphics.DrawLine(linePen, new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing / 2, 0), new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing / 2, this.documentWorkspace.CompositionSurface.Height));
- graphics.DrawLine(linePen, new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineSpacing / 2, 0), new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineSpacing / 2, this.documentWorkspace.CompositionSurface.Height));
- }
- // 线条数为五
- else if (this.linesNumber == 5)
- {
- // 绘制辅助线
- graphics.DrawLine(linePen, new PointF(this.documentWorkspace.CompositionSurface.Width / 2 - 2 * this.lineSpacing, 0), new PointF(this.documentWorkspace.CompositionSurface.Width / 2 - 2 * this.lineSpacing, this.documentWorkspace.CompositionSurface.Height));
- graphics.DrawLine(linePen, new PointF(this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing, 0), new PointF(this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing, this.documentWorkspace.CompositionSurface.Height));
- graphics.DrawLine(linePen, new PointF(this.documentWorkspace.CompositionSurface.Width / 2, 0), new PointF(this.documentWorkspace.CompositionSurface.Width / 2, this.documentWorkspace.CompositionSurface.Height));
- graphics.DrawLine(linePen, new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing, 0), new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing, this.documentWorkspace.CompositionSurface.Height));
- graphics.DrawLine(linePen, new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + 2 * this.lineSpacing, 0), new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + 2 * this.lineSpacing, this.documentWorkspace.CompositionSurface.Height));
- }
- #endregion
- if (this.dataGridView1.SelectedCells.Count == 0
- || this.pointRectangleFs.Count == 0
- || this.dataGridView1.SelectedCells[0].RowIndex >= this.pointRectangleFs.Count)
- return;
- RectangleF rectangleF = new RectangleF();
- #region 线条数为三时的定义
- List<RectangleF> threeLine1RectangleFs = new List<RectangleF>();
- List<RectangleF> threeLine2RectangleFs = new List<RectangleF>();
- List<RectangleF> threeLine3RectangleFs = new List<RectangleF>();
- int threeLine1PointCount = 0;
- int threeLine2PointCount = 0;
- int threeLine3PointCount = 0;
- #endregion
- #region 线条数为四时的定义
- List<RectangleF> fourLine1RectangleFs = new List<RectangleF>();
- List<RectangleF> fourLine2RectangleFs = new List<RectangleF>();
- List<RectangleF> fourLine3RectangleFs = new List<RectangleF>();
- List<RectangleF> fourLine4RectangleFs = new List<RectangleF>();
- int fourLine1PointCount = 0;
- int fourLine2PointCount = 0;
- int fourLine3PointCount = 0;
- int fourLine4PointCount = 0;
- #endregion
- #region 线条数为五时的定义
- List<RectangleF> fiveLine1RectangleFs = new List<RectangleF>();
- List<RectangleF> fiveLine2RectangleFs = new List<RectangleF>();
- List<RectangleF> fiveLine3RectangleFs = new List<RectangleF>();
- List<RectangleF> fiveLine4RectangleFs = new List<RectangleF>();
- List<RectangleF> fiveLine5RectangleFs = new List<RectangleF>();
- int fiveLine1PointCount = 0;
- int fiveLine2PointCount = 0;
- int fiveLine3PointCount = 0;
- int fiveLine4PointCount = 0;
- int fiveLine5PointCount = 0;
- #endregion
- #region 循环用于绘制测量点的矩形的集合
- for (int i = 0; i < this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Count; i++)
- {
- #region 更改样式时的自动绘制
- rectangleF = this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i];
- // 更新矩形的宽高与测量点直径保持一致
- rectangleF.Width = this.pointDiameter;
- rectangleF.Height = this.pointDiameter;
- // 线条数为三
- if (this.linesNumber == 3)
- {
- // 第一条线
- if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing / 2)
- {
- threeLine1PointCount++;
- if (this.type.Equals(constTypeA))
- {
- if (threeLine1PointCount <= 3)
- threeLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeB))
- {
- if (threeLine1PointCount <= 4)
- threeLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeC))
- {
- if (threeLine1PointCount <= 5)
- threeLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeD))
- {
- if (threeLine1PointCount <= 6)
- threeLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeE))
- {
- if (threeLine1PointCount <= 4)
- threeLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- rectangleF.X = this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.pointDiameter / 2;
- }
- // 第二条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing / 2
- && this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing / 2)
- {
- threeLine2PointCount++;
- if (this.type.Equals(constTypeA))
- {
- if (threeLine2PointCount <= 3)
- threeLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeB))
- {
- if (threeLine2PointCount <= 4)
- threeLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeC))
- {
- if (threeLine2PointCount <= 5)
- threeLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeD))
- {
- if (threeLine2PointCount <= 6)
- threeLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeE))
- {
- if (threeLine2PointCount <= 4)
- threeLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- rectangleF.X = this.documentWorkspace.CompositionSurface.Width / 2 - this.pointDiameter / 2;
- }
- // 第三条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 + this.pointDiameter / 2)
- {
- threeLine3PointCount++;
- if (this.type.Equals(constTypeA))
- {
- if (threeLine3PointCount <= 3)
- threeLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeB))
- {
- if (threeLine3PointCount <= 4)
- threeLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeC))
- {
- if (threeLine3PointCount <= 5)
- threeLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeD))
- {
- if (threeLine3PointCount <= 6)
- threeLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeE))
- {
- if (threeLine3PointCount <= 4)
- threeLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- rectangleF.X = this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing - this.pointDiameter / 2;
- }
- }
- // 线条数为四
- else if (this.linesNumber == 4)
- {
- // 第一条线
- if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing)
- {
- fourLine1PointCount++;
- if (this.type.Equals(constTypeA))
- {
- if (fourLine1PointCount <= 3)
- fourLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeB))
- {
- if (fourLine1PointCount <= 4)
- fourLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeC))
- {
- if (fourLine1PointCount <= 5)
- fourLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeD))
- {
- if (fourLine1PointCount <= 6)
- fourLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeE))
- {
- if (fourLine1PointCount <= 4)
- fourLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- rectangleF.X = this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.lineSpacing / 2 - this.pointDiameter / 2;
- }
- // 第二条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2
- && this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing)
- {
- fourLine2PointCount++;
- if (this.type.Equals(constTypeA))
- {
- if (fourLine2PointCount <= 3)
- fourLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeB))
- {
- if (fourLine2PointCount <= 4)
- fourLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeC))
- {
- if (fourLine2PointCount <= 5)
- fourLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeD))
- {
- if (fourLine2PointCount <= 6)
- fourLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeE))
- {
- if (fourLine2PointCount <= 4)
- fourLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- rectangleF.X = this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing / 2 - this.pointDiameter / 2;
- }
- // 第三条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing
- && this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2)
- {
- fourLine3PointCount++;
- if (this.type.Equals(constTypeA))
- {
- if (fourLine3PointCount <= 3)
- fourLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeB))
- {
- if (fourLine3PointCount <= 4)
- fourLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeC))
- {
- if (fourLine3PointCount <= 5)
- fourLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeD))
- {
- if (fourLine3PointCount <= 6)
- fourLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeE))
- {
- if (fourLine3PointCount <= 4)
- fourLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- rectangleF.X = this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing / 2 - this.pointDiameter / 2;
- }
- // 第四条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing)
- {
- fourLine4PointCount++;
- if (this.type.Equals(constTypeA))
- {
- if (fourLine4PointCount <= 3)
- fourLine4RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeB))
- {
- if (fourLine4PointCount <= 4)
- fourLine4RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeC))
- {
- if (fourLine4PointCount <= 5)
- fourLine4RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeD))
- {
- if (fourLine4PointCount <= 6)
- fourLine4RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeE))
- {
- if (fourLine4PointCount <= 4)
- fourLine4RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- rectangleF.X = this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineSpacing / 2 - this.pointDiameter / 2;
- }
- }
- // 线条数为五
- else if(this.linesNumber == 5)
- {
- // 第一条线
- if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.lineSpacing / 2)
- {
- fiveLine1PointCount++;
- if (this.type.Equals(constTypeA))
- {
- if (fiveLine1PointCount <= 3)
- fiveLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeB))
- {
- if (fiveLine1PointCount <= 4)
- fiveLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeC))
- {
- if (fiveLine1PointCount <= 5)
- fiveLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeD))
- {
- if (fiveLine1PointCount <= 6)
- fiveLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeE))
- {
- if (fiveLine1PointCount <= 4)
- fiveLine1RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- rectangleF.X = this.documentWorkspace.CompositionSurface.Width / 2 - 2 * this.lineSpacing - this.pointDiameter / 2;
- }
- // 第二条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing / 2
- && this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.lineSpacing / 2)
- {
- fiveLine2PointCount++;
- if (this.type.Equals(constTypeA))
- {
- if (fiveLine2PointCount <= 3)
- fiveLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeB))
- {
- if (fiveLine2PointCount <= 4)
- fiveLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeC))
- {
- if (fiveLine2PointCount <= 5)
- fiveLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeD))
- {
- if (fiveLine2PointCount <= 6)
- fiveLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeE))
- {
- if (fiveLine2PointCount <= 4)
- fiveLine2RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- rectangleF.X = this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.pointDiameter / 2;
- }
- // 第三条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing / 2
- && this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing / 2)
- {
- fiveLine3PointCount++;
- if (this.type.Equals(constTypeA))
- {
- if (fiveLine3PointCount <= 3)
- fiveLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeB))
- {
- if (fiveLine3PointCount <= 4)
- fiveLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeC))
- {
- if (fiveLine3PointCount <= 5)
- fiveLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeD))
- {
- if (fiveLine3PointCount <= 6)
- fiveLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeE))
- {
- if (fiveLine3PointCount <= 4)
- fiveLine3RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- rectangleF.X = this.documentWorkspace.CompositionSurface.Width / 2 - this.pointDiameter / 2;
- }
- // 第四条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineSpacing / 2
- && this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing / 2)
- {
- fiveLine4PointCount++;
- if (this.type.Equals(constTypeA))
- {
- if (fiveLine4PointCount <= 3)
- fiveLine4RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeB))
- {
- if (fiveLine4PointCount <= 4)
- fiveLine4RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeC))
- {
- if (fiveLine4PointCount <= 5)
- fiveLine4RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeD))
- {
- if (fiveLine4PointCount <= 6)
- fiveLine4RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeE))
- {
- if (fiveLine4PointCount <= 4)
- fiveLine4RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- rectangleF.X = this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing - this.pointDiameter / 2;
- }
- // 第五条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineSpacing / 2)
- {
- fiveLine5PointCount++;
- if (this.type.Equals(constTypeA))
- {
- if (fiveLine5PointCount <= 3)
- fiveLine5RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeB))
- {
- if (fiveLine5PointCount <= 4)
- fiveLine5RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeC))
- {
- if (fiveLine5PointCount <= 5)
- fiveLine5RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeD))
- {
- if (fiveLine5PointCount <= 6)
- fiveLine5RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- else if (this.type.Equals(constTypeE))
- {
- if (fiveLine5PointCount <= 4)
- fiveLine5RectangleFs.Add(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- }
- rectangleF.X = this.documentWorkspace.CompositionSurface.Width / 2 + 2 * this.lineSpacing - this.pointDiameter / 2;
- }
- }
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i] = rectangleF;
- #endregion
- #region 绘制测量点
- // 选中点
- if (i == selected)
- {
- // 绘制选中边框
- graphics.DrawRectangle(new Pen(Color.Black, 2), new Rectangle(new Point((int)this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X, (int)this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].Y), new System.Drawing.Size((int)this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].Width, (int)this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].Height)));
- }
- // 点样式为空心
- if (this.pointStyle == 0)
- graphics.DrawEllipse(pointPen, this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- // 实心
- else
- graphics.FillEllipse(brush, this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i]);
- // 点标记
- if(pointMarkerSymbol)
- graphics.DrawString("p" + (i + 1), pointFont, new SolidBrush(Color.Black), new PointF(this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].Width, this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].Y));
- #endregion
- }
- #endregion
- // 测量点间距
- float a1 = 0, b1 = 0, c1 = 0, d1 = 0;
- float a2 = 0, b2 = 0, c2 = 0, d2 = 0;
- float a3 = 0, b3 = 0, c3 = 0, d3 = 0;
- float a4 = 0, b4 = 0, c4 = 0, d4 = 0;
- float a5 = 0, b5 = 0, c5 = 0, d5 = 0;
- float w = 0;
- // 初始化中间数据
- if(lengthL1.Count > 0 && lengthL1.Count > this.dataGridView1.SelectedCells[0].RowIndex)
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex] = new List<decimal>();
- if (lengthL2.Count > 0 && lengthL2.Count > this.dataGridView1.SelectedCells[0].RowIndex)
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex] = new List<decimal>();
- if (lengthL3.Count > 0 && lengthL3.Count > this.dataGridView1.SelectedCells[0].RowIndex)
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex] = new List<decimal>();
- if (lengthL4.Count > 0 && lengthL4.Count > this.dataGridView1.SelectedCells[0].RowIndex)
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex] = new List<decimal>();
- if (lengthL5.Count > 0 && lengthL5.Count > this.dataGridView1.SelectedCells[0].RowIndex)
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex] = new List<decimal>();
- if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Count > 0)
- {
- #region 是否在图像上显示数据
- // 文本尺寸
- SizeF sizeF;
- #region 线条数为三时的辅助线文本绘制
- if (this.linesNumber == 3)
- {
- if (this.type.Equals(constTypeA))
- {
- if (threeLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength));
- }
- if (threeLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine2RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength));
- }
- if (threeLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine3RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength));
- }
- if (threeLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine1RectangleFs[0].X - sizeF.Width / 4, (threeLine1RectangleFs[0].Y + threeLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y);
- }
- if (threeLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine2RectangleFs[0].X - sizeF.Width / 4, (threeLine2RectangleFs[0].Y + threeLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y);
- }
- if (threeLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine3RectangleFs[0].X - sizeF.Width / 4, (threeLine3RectangleFs[0].Y + threeLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y);
- }
- }
- else if (this.type.Equals(constTypeB))
- {
- if (threeLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength));
- }
- else if (threeLine1RectangleFs.Count == 4)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[2].Y - threeLine1RectangleFs[3].Y) * this.unitLength));
- }
- if (threeLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine2RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength));
- }
- else if (threeLine2RectangleFs.Count == 4)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[2].Y - threeLine2RectangleFs[3].Y) * this.unitLength));
- }
- if (threeLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine2RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength));
- }
- else if (threeLine3RectangleFs.Count == 4)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[2].Y - threeLine3RectangleFs[3].Y) * this.unitLength));
- }
- if (threeLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine1RectangleFs[0].X - sizeF.Width / 4, (threeLine1RectangleFs[0].Y + threeLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y);
- }
- if (threeLine1RectangleFs.Count > 3)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine1RectangleFs[2].Y - threeLine1RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine1RectangleFs[2].Y - threeLine1RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine1RectangleFs[2].X - sizeF.Width / 4, (threeLine1RectangleFs[2].Y + threeLine1RectangleFs[3].Y) / 2));
- b1 = Math.Abs(threeLine1RectangleFs[2].Y - threeLine1RectangleFs[3].Y);
- }
- if (threeLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine2RectangleFs[0].X - sizeF.Width / 4, (threeLine2RectangleFs[0].Y + threeLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y);
- }
- if (threeLine2RectangleFs.Count > 3)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine2RectangleFs[2].Y - threeLine2RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine2RectangleFs[2].Y - threeLine2RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine2RectangleFs[2].X - sizeF.Width / 4, (threeLine2RectangleFs[2].Y + threeLine2RectangleFs[3].Y) / 2));
- b2 = Math.Abs(threeLine2RectangleFs[2].Y - threeLine2RectangleFs[3].Y);
- }
- if (threeLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine3RectangleFs[0].X - sizeF.Width / 4, (threeLine3RectangleFs[0].Y + threeLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y);
- }
- if (threeLine3RectangleFs.Count > 3)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine3RectangleFs[2].Y - threeLine3RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine3RectangleFs[2].Y - threeLine3RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine3RectangleFs[2].X - sizeF.Width / 4, (threeLine3RectangleFs[2].Y + threeLine3RectangleFs[3].Y) / 2));
- b3 = Math.Abs(threeLine3RectangleFs[2].Y - threeLine3RectangleFs[3].Y);
- }
- }
- else if (this.type.Equals(constTypeC))
- {
- if (threeLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength));
- }
- else if (threeLine1RectangleFs.Count == 4)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[2].Y - threeLine1RectangleFs[3].Y) * this.unitLength));
- }
- else if (threeLine1RectangleFs.Count == 5)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[2].Y - threeLine1RectangleFs[3].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[3].Y - threeLine1RectangleFs[4].Y) * this.unitLength));
- }
- if (threeLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine2RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength));
- }
- else if (threeLine2RectangleFs.Count == 4)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[2].Y - threeLine2RectangleFs[3].Y) * this.unitLength));
- }
- else if (threeLine2RectangleFs.Count == 5)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[2].Y - threeLine2RectangleFs[3].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[3].Y - threeLine2RectangleFs[4].Y) * this.unitLength));
- }
- if (threeLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine2RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength));
- }
- else if (threeLine2RectangleFs.Count == 4)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[2].Y - threeLine3RectangleFs[3].Y) * this.unitLength));
- }
- else if (threeLine3RectangleFs.Count == 5)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[2].Y - threeLine3RectangleFs[3].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[3].Y - threeLine3RectangleFs[4].Y) * this.unitLength));
- }
- if (threeLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine1RectangleFs[0].X - sizeF.Width / 4, (threeLine1RectangleFs[0].Y + threeLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y);
- }
- if (threeLine1RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine1RectangleFs[1].X - sizeF.Width / 4, (threeLine1RectangleFs[1].Y + threeLine1RectangleFs[2].Y) / 2));
- c1 = Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y);
- }
- if (threeLine1RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine1RectangleFs[3].Y - threeLine1RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine1RectangleFs[3].Y - threeLine1RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine1RectangleFs[3].X - sizeF.Width / 4, (threeLine1RectangleFs[3].Y + threeLine1RectangleFs[4].Y) / 2));
- b1 = Math.Abs(threeLine1RectangleFs[3].Y - threeLine1RectangleFs[4].Y);
- }
- if (threeLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine2RectangleFs[0].X - sizeF.Width / 4, (threeLine2RectangleFs[0].Y + threeLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y);
- }
- if (threeLine2RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine2RectangleFs[1].X - sizeF.Width / 4, (threeLine2RectangleFs[1].Y + threeLine2RectangleFs[2].Y) / 2));
- c2 = Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y);
- }
- if (threeLine2RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine2RectangleFs[3].Y - threeLine2RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine2RectangleFs[3].Y - threeLine2RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine2RectangleFs[3].X - sizeF.Width / 4, (threeLine2RectangleFs[3].Y + threeLine2RectangleFs[4].Y) / 2));
- b2 = Math.Abs(threeLine2RectangleFs[3].Y - threeLine2RectangleFs[4].Y);
- }
- if (threeLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine3RectangleFs[0].X - sizeF.Width / 4, (threeLine3RectangleFs[0].Y + threeLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y);
- }
- if (threeLine3RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine3RectangleFs[1].X - sizeF.Width / 4, (threeLine3RectangleFs[1].Y + threeLine3RectangleFs[2].Y) / 2));
- c3 = Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y);
- }
- if (threeLine3RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine3RectangleFs[3].Y - threeLine3RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine3RectangleFs[3].Y - threeLine3RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine3RectangleFs[3].X - sizeF.Width / 4, (threeLine3RectangleFs[3].Y + threeLine3RectangleFs[4].Y) / 2));
- b3 = Math.Abs(threeLine3RectangleFs[3].Y - threeLine3RectangleFs[4].Y);
- }
- }
- else if (this.type.Equals(constTypeD))
- {
- if (threeLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength));
- }
- else if (threeLine1RectangleFs.Count == 4)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[2].Y - threeLine1RectangleFs[3].Y) * this.unitLength));
- }
- else if (threeLine1RectangleFs.Count == 5)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[2].Y - threeLine1RectangleFs[3].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[3].Y - threeLine1RectangleFs[4].Y) * this.unitLength));
- }
- else if (threeLine1RectangleFs.Count == 5)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[2].Y - threeLine1RectangleFs[3].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[3].Y - threeLine1RectangleFs[4].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[4].Y - threeLine1RectangleFs[5].Y) * this.unitLength));
- }
- if (threeLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine2RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength));
- }
- else if (threeLine2RectangleFs.Count == 4)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[2].Y - threeLine2RectangleFs[3].Y) * this.unitLength));
- }
- else if (threeLine2RectangleFs.Count == 5)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[2].Y - threeLine2RectangleFs[3].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[3].Y - threeLine2RectangleFs[4].Y) * this.unitLength));
- }
- else if (threeLine2RectangleFs.Count == 5)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[2].Y - threeLine2RectangleFs[3].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[3].Y - threeLine2RectangleFs[4].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[4].Y - threeLine2RectangleFs[5].Y) * this.unitLength));
- }
- if (threeLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine3RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength));
- }
- else if (threeLine3RectangleFs.Count == 4)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[2].Y - threeLine3RectangleFs[3].Y) * this.unitLength));
- }
- else if (threeLine3RectangleFs.Count == 5)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[2].Y - threeLine3RectangleFs[3].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[3].Y - threeLine3RectangleFs[4].Y) * this.unitLength));
- }
- else if (threeLine3RectangleFs.Count == 5)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[2].Y - threeLine3RectangleFs[3].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[3].Y - threeLine3RectangleFs[4].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[4].Y - threeLine3RectangleFs[5].Y) * this.unitLength));
- }
- if (threeLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine1RectangleFs[0].X - sizeF.Width / 4, (threeLine1RectangleFs[0].Y + threeLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y);
- }
- if (threeLine1RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine1RectangleFs[1].X - sizeF.Width / 4, (threeLine1RectangleFs[1].Y + threeLine1RectangleFs[2].Y) / 2));
- c1 = Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y);
- }
- if (threeLine1RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine1RectangleFs[3].Y - threeLine1RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine1RectangleFs[3].Y - threeLine1RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine1RectangleFs[3].X - sizeF.Width / 4, (threeLine1RectangleFs[3].Y + threeLine1RectangleFs[4].Y) / 2));
- d1 = Math.Abs(threeLine1RectangleFs[3].Y - threeLine1RectangleFs[4].Y);
- }
- if (threeLine1RectangleFs.Count > 5)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine1RectangleFs[4].Y - threeLine1RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine1RectangleFs[4].Y - threeLine1RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine1RectangleFs[4].X - sizeF.Width / 4, (threeLine1RectangleFs[4].Y + threeLine1RectangleFs[5].Y) / 2));
- b1 = Math.Abs(threeLine1RectangleFs[4].Y - threeLine1RectangleFs[5].Y);
- }
- if (threeLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine2RectangleFs[0].X - sizeF.Width / 4, (threeLine2RectangleFs[0].Y + threeLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y);
- }
- if (threeLine2RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine2RectangleFs[1].X - sizeF.Width / 4, (threeLine2RectangleFs[1].Y + threeLine2RectangleFs[2].Y) / 2));
- c2 = Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y);
- }
- if (threeLine2RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine2RectangleFs[3].Y - threeLine2RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine2RectangleFs[3].Y - threeLine2RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine2RectangleFs[3].X - sizeF.Width / 4, (threeLine2RectangleFs[3].Y + threeLine2RectangleFs[4].Y) / 2));
- d2 = Math.Abs(threeLine2RectangleFs[3].Y - threeLine2RectangleFs[4].Y);
- }
- if (threeLine2RectangleFs.Count > 5)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine2RectangleFs[4].Y - threeLine2RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine2RectangleFs[4].Y - threeLine2RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine2RectangleFs[4].X - sizeF.Width / 4, (threeLine2RectangleFs[4].Y + threeLine2RectangleFs[5].Y) / 2));
- b2 = Math.Abs(threeLine2RectangleFs[4].Y - threeLine2RectangleFs[5].Y);
- }
- if (threeLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine3RectangleFs[0].X - sizeF.Width / 4, (threeLine3RectangleFs[0].Y + threeLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y);
- }
- if (threeLine3RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine3RectangleFs[1].X - sizeF.Width / 4, (threeLine3RectangleFs[1].Y + threeLine3RectangleFs[2].Y) / 2));
- c3 = Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y);
- }
- if (threeLine3RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine3RectangleFs[3].Y - threeLine3RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine3RectangleFs[3].Y - threeLine3RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine3RectangleFs[3].X - sizeF.Width / 4, (threeLine3RectangleFs[3].Y + threeLine3RectangleFs[4].Y) / 2));
- d3 = Math.Abs(threeLine3RectangleFs[3].Y - threeLine3RectangleFs[4].Y);
- }
- if (threeLine3RectangleFs.Count > 5)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine3RectangleFs[4].Y - threeLine3RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine3RectangleFs[4].Y - threeLine3RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine3RectangleFs[4].X - sizeF.Width / 4, (threeLine3RectangleFs[4].Y + threeLine3RectangleFs[5].Y) / 2));
- b3 = Math.Abs(threeLine3RectangleFs[4].Y - threeLine3RectangleFs[5].Y);
- }
- }
- else if (this.type.Equals(constTypeE))
- {
- if (threeLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength));
- }
- if (threeLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine2RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength));
- }
- if (threeLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (threeLine3RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength));
- }
- if (threeLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine1RectangleFs[0].X - sizeF.Width / 4, (threeLine1RectangleFs[0].Y + threeLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[1].Y);
- }
- if (threeLine1RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine1RectangleFs[1].X - sizeF.Width / 4, (threeLine1RectangleFs[1].Y + threeLine1RectangleFs[2].Y) / 2));
- c1 = Math.Abs(threeLine1RectangleFs[1].Y - threeLine1RectangleFs[2].Y);
- }
- if (threeLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine2RectangleFs[0].X - sizeF.Width / 4, (threeLine2RectangleFs[0].Y + threeLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[1].Y);
- }
- if (threeLine2RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine2RectangleFs[1].X - sizeF.Width / 4, (threeLine2RectangleFs[1].Y + threeLine2RectangleFs[2].Y) / 2));
- c2 = Math.Abs(threeLine2RectangleFs[1].Y - threeLine2RectangleFs[2].Y);
- }
- if (threeLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine3RectangleFs[0].X - sizeF.Width / 4, (threeLine3RectangleFs[0].Y + threeLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[1].Y);
- }
- if (threeLine3RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(threeLine3RectangleFs[1].X - sizeF.Width / 4, (threeLine3RectangleFs[1].Y + threeLine3RectangleFs[2].Y) / 2));
- c3 = Math.Abs(threeLine3RectangleFs[1].Y - threeLine3RectangleFs[2].Y);
- }
- }
- }
- #endregion
- #region 线条数为四时的辅助线文本绘制
- if (this.linesNumber == 4)
- {
- if (this.type.Equals(constTypeA))
- {
- if (fourLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength));
- }
- if (fourLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine2RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength));
- }
- if (fourLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine3RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength));
- }
- if (fourLine4RectangleFs.Count == 2)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine4RectangleFs.Count == 3)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength));
- }
- if (fourLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine1RectangleFs[0].X - sizeF.Width / 4, (fourLine1RectangleFs[0].Y + fourLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y);
- }
- if (fourLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine2RectangleFs[0].X - sizeF.Width / 4, (fourLine2RectangleFs[0].Y + fourLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y);
- }
- if (fourLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine3RectangleFs[0].X - sizeF.Width / 4, (fourLine3RectangleFs[0].Y + fourLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y);
- }
- if (fourLine4RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine4RectangleFs[0].X - sizeF.Width / 4, (fourLine4RectangleFs[0].Y + fourLine4RectangleFs[1].Y) / 2));
- a4 = Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y);
- }
- }
- else if (this.type.Equals(constTypeB))
- {
- if (fourLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength));
- }
- else if (fourLine1RectangleFs.Count == 4)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[2].Y - fourLine1RectangleFs[3].Y) * this.unitLength));
- }
- if (fourLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine2RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength));
- }
- else if (fourLine2RectangleFs.Count == 4)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[2].Y - fourLine2RectangleFs[3].Y) * this.unitLength));
- }
- if (fourLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine3RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength));
- }
- else if (fourLine3RectangleFs.Count == 4)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[2].Y - fourLine3RectangleFs[3].Y) * this.unitLength));
- }
- if (fourLine4RectangleFs.Count == 2)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine4RectangleFs.Count == 3)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength));
- }
- else if (fourLine4RectangleFs.Count == 4)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[2].Y - fourLine4RectangleFs[3].Y) * this.unitLength));
- }
- if (fourLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine1RectangleFs[0].X - sizeF.Width / 4, (fourLine1RectangleFs[0].Y + fourLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y);
- }
- if (fourLine1RectangleFs.Count > 3)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine1RectangleFs[2].Y - fourLine1RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine1RectangleFs[2].Y - fourLine1RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine1RectangleFs[2].X - sizeF.Width / 4, (fourLine1RectangleFs[2].Y + fourLine1RectangleFs[3].Y) / 2));
- b1 = Math.Abs(fourLine1RectangleFs[2].Y - fourLine1RectangleFs[3].Y);
- }
- if (fourLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine2RectangleFs[0].X - sizeF.Width / 4, (fourLine2RectangleFs[0].Y + fourLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y);
- }
- if (fourLine2RectangleFs.Count > 3)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine2RectangleFs[2].Y - fourLine2RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine2RectangleFs[2].Y - fourLine2RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine2RectangleFs[2].X - sizeF.Width / 4, (fourLine2RectangleFs[2].Y + fourLine2RectangleFs[3].Y) / 2));
- b2 = Math.Abs(fourLine2RectangleFs[2].Y - fourLine2RectangleFs[3].Y);
- }
- if (fourLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine3RectangleFs[0].X - sizeF.Width / 4, (fourLine3RectangleFs[0].Y + fourLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y);
- }
- if (fourLine3RectangleFs.Count > 3)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine3RectangleFs[2].Y - fourLine3RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine3RectangleFs[2].Y - fourLine3RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine3RectangleFs[2].X - sizeF.Width / 4, (fourLine3RectangleFs[2].Y + fourLine3RectangleFs[3].Y) / 2));
- b3 = Math.Abs(fourLine3RectangleFs[2].Y - fourLine3RectangleFs[3].Y);
- }
- if (fourLine4RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine4RectangleFs[0].X - sizeF.Width / 4, (fourLine4RectangleFs[0].Y + fourLine4RectangleFs[1].Y) / 2));
- a4 = Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y);
- }
- if (fourLine4RectangleFs.Count > 3)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine4RectangleFs[2].Y - fourLine4RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine4RectangleFs[2].Y - fourLine4RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine4RectangleFs[2].X - sizeF.Width / 4, (fourLine4RectangleFs[2].Y + fourLine4RectangleFs[3].Y) / 2));
- b4 = Math.Abs(fourLine4RectangleFs[2].Y - fourLine4RectangleFs[3].Y);
- }
- }
- else if (this.type.Equals(constTypeC))
- {
- if (fourLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength));
- }
- else if (fourLine1RectangleFs.Count == 4)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[2].Y - fourLine1RectangleFs[3].Y) * this.unitLength));
- }
- else if (fourLine1RectangleFs.Count == 5)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[2].Y - fourLine1RectangleFs[3].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[3].Y - fourLine1RectangleFs[4].Y) * this.unitLength));
- }
- if (fourLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine1RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength));
- }
- else if (fourLine1RectangleFs.Count == 4)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[2].Y - fourLine2RectangleFs[3].Y) * this.unitLength));
- }
- else if (fourLine1RectangleFs.Count == 5)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[2].Y - fourLine2RectangleFs[3].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[3].Y - fourLine2RectangleFs[4].Y) * this.unitLength));
- }
- if (fourLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine3RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength));
- }
- else if (fourLine3RectangleFs.Count == 4)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[2].Y - fourLine3RectangleFs[3].Y) * this.unitLength));
- }
- else if (fourLine3RectangleFs.Count == 5)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[2].Y - fourLine3RectangleFs[3].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[3].Y - fourLine3RectangleFs[4].Y) * this.unitLength));
- }
- if (fourLine4RectangleFs.Count == 2)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine4RectangleFs.Count == 3)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength));
- }
- else if (fourLine4RectangleFs.Count == 4)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[2].Y - fourLine4RectangleFs[3].Y) * this.unitLength));
- }
- else if (fourLine4RectangleFs.Count == 5)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[2].Y - fourLine4RectangleFs[3].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[3].Y - fourLine4RectangleFs[4].Y) * this.unitLength));
- }
- if (fourLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine1RectangleFs[0].X - sizeF.Width / 4, (fourLine1RectangleFs[0].Y + fourLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y);
- }
- if (fourLine1RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine1RectangleFs[1].X - sizeF.Width / 4, (fourLine1RectangleFs[1].Y + fourLine1RectangleFs[2].Y) / 2));
- c1 = Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y);
- }
- if (fourLine1RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine1RectangleFs[3].Y - fourLine1RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine1RectangleFs[3].Y - fourLine1RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine1RectangleFs[3].X - sizeF.Width / 4, (fourLine1RectangleFs[3].Y + fourLine1RectangleFs[4].Y) / 2));
- b1 = Math.Abs(fourLine1RectangleFs[3].Y - fourLine1RectangleFs[4].Y);
- }
- if (fourLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine2RectangleFs[0].X - sizeF.Width / 4, (fourLine2RectangleFs[0].Y + fourLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y);
- }
- if (fourLine2RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine2RectangleFs[1].X - sizeF.Width / 4, (fourLine2RectangleFs[1].Y + fourLine2RectangleFs[2].Y) / 2));
- c2 = Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y);
- }
- if (fourLine2RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine2RectangleFs[3].Y - fourLine2RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine2RectangleFs[3].Y - fourLine2RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine2RectangleFs[3].X - sizeF.Width / 4, (fourLine2RectangleFs[3].Y + fourLine2RectangleFs[4].Y) / 2));
- b2 = Math.Abs(fourLine2RectangleFs[3].Y - fourLine2RectangleFs[4].Y);
- }
- if (fourLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine3RectangleFs[0].X - sizeF.Width / 4, (fourLine3RectangleFs[0].Y + fourLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y);
- }
- if (fourLine3RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine3RectangleFs[1].X - sizeF.Width / 4, (fourLine3RectangleFs[1].Y + fourLine3RectangleFs[2].Y) / 2));
- c3 = Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y);
- }
- if (fourLine3RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine3RectangleFs[3].Y - fourLine3RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine3RectangleFs[3].Y - fourLine3RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine3RectangleFs[3].X - sizeF.Width / 4, (fourLine3RectangleFs[3].Y + fourLine3RectangleFs[4].Y) / 2));
- b3 = Math.Abs(fourLine3RectangleFs[3].Y - fourLine3RectangleFs[4].Y);
- }
- if (fourLine4RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine4RectangleFs[0].X - sizeF.Width / 4, (fourLine4RectangleFs[0].Y + fourLine4RectangleFs[1].Y) / 2));
- a4 = Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y);
- }
- if (fourLine4RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine4RectangleFs[1].X - sizeF.Width / 4, (fourLine4RectangleFs[1].Y + fourLine4RectangleFs[2].Y) / 2));
- c4 = Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y);
- }
- if (fourLine4RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine4RectangleFs[3].Y - fourLine4RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine4RectangleFs[3].Y - fourLine4RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine4RectangleFs[3].X - sizeF.Width / 4, (fourLine4RectangleFs[3].Y + fourLine4RectangleFs[4].Y) / 2));
- b4 = Math.Abs(fourLine4RectangleFs[3].Y - fourLine4RectangleFs[4].Y);
- }
- }
- else if (this.type.Equals(constTypeD))
- {
- if (fourLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength));
- }
- else if (fourLine1RectangleFs.Count == 4)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[2].Y - fourLine1RectangleFs[3].Y) * this.unitLength));
- }
- else if (fourLine1RectangleFs.Count == 5)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[2].Y - fourLine1RectangleFs[3].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[3].Y - fourLine1RectangleFs[4].Y) * this.unitLength));
- }
- else if (fourLine1RectangleFs.Count == 6)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[2].Y - fourLine1RectangleFs[3].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[3].Y - fourLine1RectangleFs[4].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[4].Y - fourLine1RectangleFs[5].Y) * this.unitLength));
- }
- if (fourLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine2RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength));
- }
- else if (fourLine2RectangleFs.Count == 4)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[2].Y - fourLine2RectangleFs[3].Y) * this.unitLength));
- }
- else if (fourLine2RectangleFs.Count == 5)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[2].Y - fourLine2RectangleFs[3].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[3].Y - fourLine2RectangleFs[4].Y) * this.unitLength));
- }
- else if (fourLine2RectangleFs.Count == 6)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[2].Y - fourLine2RectangleFs[3].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[3].Y - fourLine2RectangleFs[4].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[4].Y - fourLine2RectangleFs[5].Y) * this.unitLength));
- }
- if (fourLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine3RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength));
- }
- else if (fourLine3RectangleFs.Count == 4)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[2].Y - fourLine3RectangleFs[3].Y) * this.unitLength));
- }
- else if (fourLine3RectangleFs.Count == 5)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[2].Y - fourLine3RectangleFs[3].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[3].Y - fourLine3RectangleFs[4].Y) * this.unitLength));
- }
- else if (fourLine3RectangleFs.Count == 6)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[2].Y - fourLine3RectangleFs[3].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[3].Y - fourLine3RectangleFs[4].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[4].Y - fourLine3RectangleFs[5].Y) * this.unitLength));
- }
- if (fourLine4RectangleFs.Count == 2)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine4RectangleFs.Count == 3)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength));
- }
- else if (fourLine4RectangleFs.Count == 4)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[2].Y - fourLine4RectangleFs[3].Y) * this.unitLength));
- }
- else if (fourLine4RectangleFs.Count == 5)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[2].Y - fourLine4RectangleFs[3].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[3].Y - fourLine4RectangleFs[4].Y) * this.unitLength));
- }
- else if (fourLine4RectangleFs.Count == 6)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[2].Y - fourLine4RectangleFs[3].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[3].Y - fourLine4RectangleFs[4].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[4].Y - fourLine4RectangleFs[5].Y) * this.unitLength));
- }
- if (fourLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine1RectangleFs[0].X - sizeF.Width / 4, (fourLine1RectangleFs[0].Y + fourLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y);
- }
- if (fourLine1RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine1RectangleFs[1].X - sizeF.Width / 4, (fourLine1RectangleFs[1].Y + fourLine1RectangleFs[2].Y) / 2));
- c1 = Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y);
- }
- if (fourLine1RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine1RectangleFs[3].Y - fourLine1RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine1RectangleFs[3].Y - fourLine1RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine1RectangleFs[3].X - sizeF.Width / 4, (fourLine1RectangleFs[3].Y + fourLine1RectangleFs[4].Y) / 2));
- d1 = Math.Abs(fourLine1RectangleFs[3].Y - fourLine1RectangleFs[4].Y);
- }
- if (fourLine1RectangleFs.Count > 5)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine1RectangleFs[4].Y - fourLine1RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine1RectangleFs[4].Y - fourLine1RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine1RectangleFs[4].X - sizeF.Width / 4, (fourLine1RectangleFs[4].Y + fourLine1RectangleFs[5].Y) / 2));
- b1 = Math.Abs(fourLine1RectangleFs[4].Y - fourLine1RectangleFs[5].Y);
- }
- if (fourLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine2RectangleFs[0].X - sizeF.Width / 4, (fourLine2RectangleFs[0].Y + fourLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y);
- }
- if (fourLine2RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine2RectangleFs[1].X - sizeF.Width / 4, (fourLine2RectangleFs[1].Y + fourLine2RectangleFs[2].Y) / 2));
- c2 = Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y);
- }
- if (fourLine2RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine2RectangleFs[3].Y - fourLine2RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine2RectangleFs[3].Y - fourLine2RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine2RectangleFs[3].X - sizeF.Width / 4, (fourLine2RectangleFs[3].Y + fourLine2RectangleFs[4].Y) / 2));
- d2 = Math.Abs(fourLine2RectangleFs[3].Y - fourLine2RectangleFs[4].Y);
- }
- if (fourLine2RectangleFs.Count > 5)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine2RectangleFs[4].Y - fourLine2RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine2RectangleFs[4].Y - fourLine2RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine2RectangleFs[4].X - sizeF.Width / 4, (fourLine2RectangleFs[4].Y + fourLine2RectangleFs[5].Y) / 2));
- b2 = Math.Abs(fourLine2RectangleFs[4].Y - fourLine2RectangleFs[5].Y);
- }
- if (fourLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine3RectangleFs[0].X - sizeF.Width / 4, (fourLine3RectangleFs[0].Y + fourLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y);
- }
- if (fourLine3RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine3RectangleFs[1].X - sizeF.Width / 4, (fourLine3RectangleFs[1].Y + fourLine3RectangleFs[2].Y) / 2));
- c3 = Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y);
- }
- if (fourLine3RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine3RectangleFs[3].Y - fourLine3RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine3RectangleFs[3].Y - fourLine3RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine3RectangleFs[3].X - sizeF.Width / 4, (fourLine3RectangleFs[3].Y + fourLine3RectangleFs[4].Y) / 2));
- d3 = Math.Abs(fourLine3RectangleFs[3].Y - fourLine3RectangleFs[4].Y);
- }
- if (fourLine3RectangleFs.Count > 5)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine3RectangleFs[4].Y - fourLine3RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine3RectangleFs[4].Y - fourLine3RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine3RectangleFs[4].X - sizeF.Width / 4, (fourLine3RectangleFs[4].Y + fourLine3RectangleFs[5].Y) / 2));
- b3 = Math.Abs(fourLine3RectangleFs[4].Y - fourLine3RectangleFs[5].Y);
- }
- if (fourLine4RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine4RectangleFs[0].X - sizeF.Width / 4, (fourLine4RectangleFs[0].Y + fourLine4RectangleFs[1].Y) / 2));
- a4 = Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y);
- }
- if (fourLine4RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine4RectangleFs[1].X - sizeF.Width / 4, (fourLine4RectangleFs[1].Y + fourLine4RectangleFs[2].Y) / 2));
- c4 = Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y);
- }
- if (fourLine4RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine4RectangleFs[3].Y - fourLine4RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine4RectangleFs[3].Y - fourLine4RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine4RectangleFs[3].X - sizeF.Width / 4, (fourLine4RectangleFs[3].Y + fourLine4RectangleFs[4].Y) / 2));
- d4 = Math.Abs(fourLine4RectangleFs[3].Y - fourLine4RectangleFs[4].Y);
- }
- if (fourLine4RectangleFs.Count > 5)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine4RectangleFs[4].Y - fourLine4RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine4RectangleFs[4].Y - fourLine4RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine4RectangleFs[4].X - sizeF.Width / 4, (fourLine4RectangleFs[4].Y + fourLine4RectangleFs[5].Y) / 2));
- b4 = Math.Abs(fourLine4RectangleFs[4].Y - fourLine4RectangleFs[5].Y);
- }
- }
- else if (this.type.Equals(constTypeE))
- {
- if (fourLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength));
- }
- if (fourLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine2RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength));
- }
- if (fourLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine3RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength));
- }
- if (fourLine4RectangleFs.Count == 2)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- }
- else if (fourLine3RectangleFs.Count == 3)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength));
- }
- if (fourLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine1RectangleFs[0].X - sizeF.Width / 4, (fourLine1RectangleFs[0].Y + fourLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[1].Y);
- }
- if (fourLine1RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine1RectangleFs[1].X - sizeF.Width / 4, (fourLine1RectangleFs[1].Y + fourLine1RectangleFs[2].Y) / 2));
- c1 = Math.Abs(fourLine1RectangleFs[1].Y - fourLine1RectangleFs[2].Y);
- }
- if (fourLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine2RectangleFs[0].X - sizeF.Width / 4, (fourLine2RectangleFs[0].Y + fourLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[1].Y);
- }
- if (fourLine2RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine2RectangleFs[1].X - sizeF.Width / 4, (fourLine2RectangleFs[1].Y + fourLine2RectangleFs[2].Y) / 2));
- c2 = Math.Abs(fourLine2RectangleFs[1].Y - fourLine2RectangleFs[2].Y);
- }
- if (fourLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine3RectangleFs[0].X - sizeF.Width / 4, (fourLine3RectangleFs[0].Y + fourLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[1].Y);
- }
- if (fourLine3RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine3RectangleFs[1].X - sizeF.Width / 4, (fourLine3RectangleFs[1].Y + fourLine3RectangleFs[2].Y) / 2));
- c3 = Math.Abs(fourLine3RectangleFs[1].Y - fourLine3RectangleFs[2].Y);
- }
- if (fourLine4RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine4RectangleFs[0].X - sizeF.Width / 4, (fourLine4RectangleFs[0].Y + fourLine4RectangleFs[1].Y) / 2));
- a4 = Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[1].Y);
- }
- if (fourLine4RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fourLine4RectangleFs[1].X - sizeF.Width / 4, (fourLine4RectangleFs[1].Y + fourLine4RectangleFs[2].Y) / 2));
- c4 = Math.Abs(fourLine4RectangleFs[1].Y - fourLine4RectangleFs[2].Y);
- }
- }
- }
- #endregion
- #region 线条数为五时的辅助线文本绘制
- if (this.linesNumber == 5)
- {
- if (this.type.Equals(constTypeA))
- {
- if (fiveLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength));
- }
- if (fiveLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine2RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength));
- }
- if (fiveLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine3RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength));
- }
- if (fiveLine4RectangleFs.Count == 2)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine4RectangleFs.Count == 3)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength));
- }
- if (fiveLine5RectangleFs.Count == 2)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine5RectangleFs.Count == 3)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength));
- }
- if (fiveLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine1RectangleFs[0].X - sizeF.Width / 4, (fiveLine1RectangleFs[0].Y + fiveLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y);
- }
- if (fiveLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine2RectangleFs[0].X - sizeF.Width / 4, (fiveLine2RectangleFs[0].Y + fiveLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y);
- }
- if (fiveLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine3RectangleFs[0].X - sizeF.Width / 4, (fiveLine3RectangleFs[0].Y + fiveLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y);
- }
- if (fiveLine4RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine4RectangleFs[0].X - sizeF.Width / 4, (fiveLine4RectangleFs[0].Y + fiveLine4RectangleFs[1].Y) / 2));
- a4 = Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y);
- }
- if (fiveLine5RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine5RectangleFs[0].X - sizeF.Width / 4, (fiveLine5RectangleFs[0].Y + fiveLine5RectangleFs[1].Y) / 2));
- a5 = Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y);
- }
- }
- else if (this.type.Equals(constTypeB))
- {
- if (fiveLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine1RectangleFs.Count == 4)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[2].Y - fiveLine1RectangleFs[3].Y) * this.unitLength));
- }
- if (fiveLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine2RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine2RectangleFs.Count == 4)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[2].Y - fiveLine2RectangleFs[3].Y) * this.unitLength));
- }
- if (fiveLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine3RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine3RectangleFs.Count == 4)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[2].Y - fiveLine3RectangleFs[3].Y) * this.unitLength));
- }
- if (fiveLine4RectangleFs.Count == 2)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine4RectangleFs.Count == 3)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine4RectangleFs.Count == 4)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[2].Y - fiveLine4RectangleFs[3].Y) * this.unitLength));
- }
- if (fiveLine5RectangleFs.Count == 2)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine5RectangleFs.Count == 3)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine5RectangleFs.Count == 4)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[2].Y - fiveLine5RectangleFs[3].Y) * this.unitLength));
- }
- if (fiveLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine1RectangleFs[0].X - sizeF.Width / 4, (fiveLine1RectangleFs[0].Y + fiveLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y);
- }
- if (fiveLine1RectangleFs.Count > 3)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[2].Y - fiveLine1RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[2].Y - fiveLine1RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine1RectangleFs[2].X - sizeF.Width / 4, (fiveLine1RectangleFs[2].Y + fiveLine1RectangleFs[3].Y) / 2));
- b1 = Math.Abs(fiveLine1RectangleFs[2].Y - fiveLine1RectangleFs[3].Y);
- }
- if (fiveLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine2RectangleFs[0].X - sizeF.Width / 4, (fiveLine2RectangleFs[0].Y + fiveLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y);
- }
- if (fiveLine2RectangleFs.Count > 3)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[2].Y - fiveLine2RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[2].Y - fiveLine2RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine2RectangleFs[2].X - sizeF.Width / 4, (fiveLine2RectangleFs[2].Y + fiveLine2RectangleFs[3].Y) / 2));
- b2 = Math.Abs(fiveLine2RectangleFs[2].Y - fiveLine2RectangleFs[3].Y);
- }
- if (fiveLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine3RectangleFs[0].X - sizeF.Width / 4, (fiveLine3RectangleFs[0].Y + fiveLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y);
- }
- if (fiveLine3RectangleFs.Count > 3)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[2].Y - fiveLine3RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[2].Y - fiveLine3RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine3RectangleFs[2].X - sizeF.Width / 4, (fiveLine3RectangleFs[2].Y + fiveLine3RectangleFs[3].Y) / 2));
- b3 = Math.Abs(fiveLine3RectangleFs[2].Y - fiveLine3RectangleFs[3].Y);
- }
- if (fiveLine4RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine4RectangleFs[0].X - sizeF.Width / 4, (fiveLine4RectangleFs[0].Y + fiveLine4RectangleFs[1].Y) / 2));
- a4 = Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y);
- }
- if (fiveLine4RectangleFs.Count > 3)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[2].Y - fiveLine4RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[2].Y - fiveLine4RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine4RectangleFs[2].X - sizeF.Width / 4, (fiveLine4RectangleFs[2].Y + fiveLine4RectangleFs[3].Y) / 2));
- b4 = Math.Abs(fiveLine4RectangleFs[2].Y - fiveLine4RectangleFs[3].Y);
- }
- if (fiveLine5RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine5RectangleFs[0].X - sizeF.Width / 4, (fiveLine5RectangleFs[0].Y + fiveLine5RectangleFs[1].Y) / 2));
- a5 = Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y);
- }
- if (fiveLine5RectangleFs.Count > 3)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[2].Y - fiveLine5RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[2].Y - fiveLine5RectangleFs[3].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine5RectangleFs[2].X - sizeF.Width / 4, (fiveLine5RectangleFs[2].Y + fiveLine5RectangleFs[3].Y) / 2));
- b5 = Math.Abs(fiveLine5RectangleFs[2].Y - fiveLine5RectangleFs[3].Y);
- }
- }
- else if (this.type.Equals(constTypeC))
- {
- if (fiveLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine1RectangleFs.Count == 4)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[2].Y - fiveLine1RectangleFs[3].Y) * this.unitLength));
- }
- else if (fiveLine1RectangleFs.Count == 5)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[2].Y - fiveLine1RectangleFs[3].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[3].Y - fiveLine1RectangleFs[4].Y) * this.unitLength));
- }
- if (fiveLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine2RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine2RectangleFs.Count == 4)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[2].Y - fiveLine2RectangleFs[3].Y) * this.unitLength));
- }
- else if (fiveLine2RectangleFs.Count == 5)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[2].Y - fiveLine2RectangleFs[3].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[3].Y - fiveLine2RectangleFs[4].Y) * this.unitLength));
- }
- if (fiveLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine3RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine3RectangleFs.Count == 4)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[2].Y - fiveLine3RectangleFs[3].Y) * this.unitLength));
- }
- else if (fiveLine3RectangleFs.Count == 5)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[2].Y - fiveLine3RectangleFs[3].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[3].Y - fiveLine3RectangleFs[4].Y) * this.unitLength));
- }
- if (fiveLine4RectangleFs.Count == 2)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine4RectangleFs.Count == 3)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine4RectangleFs.Count == 4)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[2].Y - fiveLine4RectangleFs[3].Y) * this.unitLength));
- }
- else if (fiveLine4RectangleFs.Count == 5)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[2].Y - fiveLine4RectangleFs[3].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[3].Y - fiveLine4RectangleFs[4].Y) * this.unitLength));
- }
- if (fiveLine5RectangleFs.Count == 2)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine5RectangleFs.Count == 3)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine5RectangleFs.Count == 4)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[2].Y - fiveLine5RectangleFs[3].Y) * this.unitLength));
- }
- else if (fiveLine5RectangleFs.Count == 5)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[2].Y - fiveLine5RectangleFs[3].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[3].Y - fiveLine5RectangleFs[4].Y) * this.unitLength));
- }
- if (fiveLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine1RectangleFs[0].X - sizeF.Width / 4, (fiveLine1RectangleFs[0].Y + fiveLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y);
- }
- if (fiveLine1RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine1RectangleFs[1].X - sizeF.Width / 4, (fiveLine1RectangleFs[1].Y + fiveLine1RectangleFs[2].Y) / 2));
- c1 = Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y);
- }
- if (fiveLine1RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[3].Y - fiveLine1RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[3].Y - fiveLine1RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine1RectangleFs[3].X - sizeF.Width / 4, (fiveLine1RectangleFs[3].Y + fiveLine1RectangleFs[4].Y) / 2));
- b1 = Math.Abs(fiveLine1RectangleFs[3].Y - fiveLine1RectangleFs[4].Y);
- }
- if (fiveLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine2RectangleFs[0].X - sizeF.Width / 4, (fiveLine2RectangleFs[0].Y + fiveLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y);
- }
- if (fiveLine2RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine2RectangleFs[1].X - sizeF.Width / 4, (fiveLine2RectangleFs[1].Y + fiveLine2RectangleFs[2].Y) / 2));
- c2 = Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y);
- }
- if (fiveLine2RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[3].Y - fiveLine2RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[3].Y - fiveLine2RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine2RectangleFs[3].X - sizeF.Width / 4, (fiveLine2RectangleFs[3].Y + fiveLine2RectangleFs[4].Y) / 2));
- b2 = Math.Abs(fiveLine2RectangleFs[3].Y - fiveLine2RectangleFs[4].Y);
- }
- if (fiveLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine3RectangleFs[0].X - sizeF.Width / 4, (fiveLine3RectangleFs[0].Y + fiveLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y);
- }
- if (fiveLine3RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine3RectangleFs[1].X - sizeF.Width / 4, (fiveLine3RectangleFs[1].Y + fiveLine3RectangleFs[2].Y) / 2));
- c3 = Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y);
- }
- if (fiveLine3RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[3].Y - fiveLine3RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[3].Y - fiveLine3RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine3RectangleFs[3].X - sizeF.Width / 4, (fiveLine3RectangleFs[3].Y + fiveLine3RectangleFs[4].Y) / 2));
- b3 = Math.Abs(fiveLine3RectangleFs[3].Y - fiveLine3RectangleFs[4].Y);
- }
- if (fiveLine4RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine4RectangleFs[0].X - sizeF.Width / 4, (fiveLine4RectangleFs[0].Y + fiveLine4RectangleFs[1].Y) / 2));
- a4 = Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y);
- }
- if (fiveLine4RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine4RectangleFs[1].X - sizeF.Width / 4, (fiveLine4RectangleFs[1].Y + fiveLine4RectangleFs[2].Y) / 2));
- c4 = Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y);
- }
- if (fiveLine4RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[3].Y - fiveLine4RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[3].Y - fiveLine4RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine4RectangleFs[3].X - sizeF.Width / 4, (fiveLine4RectangleFs[3].Y + fiveLine4RectangleFs[4].Y) / 2));
- b4 = Math.Abs(fiveLine4RectangleFs[3].Y - fiveLine4RectangleFs[4].Y);
- }
- if (fiveLine5RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine5RectangleFs[0].X - sizeF.Width / 4, (fiveLine5RectangleFs[0].Y + fiveLine5RectangleFs[1].Y) / 2));
- a5 = Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y);
- }
- if (fiveLine5RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine5RectangleFs[1].X - sizeF.Width / 4, (fiveLine5RectangleFs[1].Y + fiveLine5RectangleFs[2].Y) / 2));
- c5 = Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y);
- }
- if (fiveLine5RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[3].Y - fiveLine5RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[3].Y - fiveLine5RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine5RectangleFs[3].X - sizeF.Width / 4, (fiveLine5RectangleFs[3].Y + fiveLine5RectangleFs[4].Y) / 2));
- b5 = Math.Abs(fiveLine5RectangleFs[3].Y - fiveLine5RectangleFs[4].Y);
- }
- }
- else if (this.type.Equals(constTypeD))
- {
- if (fiveLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine1RectangleFs.Count == 4)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[2].Y - fiveLine1RectangleFs[3].Y) * this.unitLength));
- }
- else if (fiveLine1RectangleFs.Count == 5)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[2].Y - fiveLine1RectangleFs[3].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[3].Y - fiveLine1RectangleFs[4].Y) * this.unitLength));
- }
- else if (fiveLine1RectangleFs.Count == 6)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[2].Y - fiveLine1RectangleFs[3].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[3].Y - fiveLine1RectangleFs[4].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[4].Y - fiveLine1RectangleFs[5].Y) * this.unitLength));
- }
- if (fiveLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine2RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine2RectangleFs.Count == 4)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[2].Y - fiveLine2RectangleFs[3].Y) * this.unitLength));
- }
- else if (fiveLine2RectangleFs.Count == 5)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[2].Y - fiveLine2RectangleFs[3].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[3].Y - fiveLine2RectangleFs[4].Y) * this.unitLength));
- }
- else if (fiveLine2RectangleFs.Count == 6)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[2].Y - fiveLine2RectangleFs[3].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[3].Y - fiveLine2RectangleFs[4].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[4].Y - fiveLine2RectangleFs[5].Y) * this.unitLength));
- }
- if (fiveLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine3RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine3RectangleFs.Count == 4)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[2].Y - fiveLine3RectangleFs[3].Y) * this.unitLength));
- }
- else if (fiveLine3RectangleFs.Count == 5)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[2].Y - fiveLine3RectangleFs[3].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[3].Y - fiveLine3RectangleFs[4].Y) * this.unitLength));
- }
- else if (fiveLine3RectangleFs.Count == 6)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[2].Y - fiveLine3RectangleFs[3].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[3].Y - fiveLine3RectangleFs[4].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[4].Y - fiveLine3RectangleFs[5].Y) * this.unitLength));
- }
- if (fiveLine4RectangleFs.Count == 2)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine4RectangleFs.Count == 3)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine4RectangleFs.Count == 4)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[2].Y - fiveLine4RectangleFs[3].Y) * this.unitLength));
- }
- else if (fiveLine4RectangleFs.Count == 5)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[2].Y - fiveLine4RectangleFs[3].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[3].Y - fiveLine4RectangleFs[4].Y) * this.unitLength));
- }
- else if (fiveLine4RectangleFs.Count == 6)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[2].Y - fiveLine4RectangleFs[3].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[3].Y - fiveLine4RectangleFs[4].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[4].Y - fiveLine4RectangleFs[5].Y) * this.unitLength));
- }
- if (fiveLine5RectangleFs.Count == 2)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine5RectangleFs.Count == 3)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength));
- }
- else if (fiveLine5RectangleFs.Count == 4)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[2].Y - fiveLine5RectangleFs[3].Y) * this.unitLength));
- }
- else if (fiveLine5RectangleFs.Count == 5)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[2].Y - fiveLine5RectangleFs[3].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[3].Y - fiveLine5RectangleFs[4].Y) * this.unitLength));
- }
- else if (fiveLine5RectangleFs.Count == 6)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[2].Y - fiveLine5RectangleFs[3].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[3].Y - fiveLine5RectangleFs[4].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[4].Y - fiveLine5RectangleFs[5].Y) * this.unitLength));
- }
- if (fiveLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine1RectangleFs[0].X - sizeF.Width / 4, (fiveLine1RectangleFs[0].Y + fiveLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y);
- }
- if (fiveLine1RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine1RectangleFs[1].X - sizeF.Width / 4, (fiveLine1RectangleFs[1].Y + fiveLine1RectangleFs[2].Y) / 2));
- c1 = Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y);
- }
- if (fiveLine1RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[3].Y - fiveLine1RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[3].Y - fiveLine1RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine1RectangleFs[3].X - sizeF.Width / 4, (fiveLine1RectangleFs[3].Y + fiveLine1RectangleFs[4].Y) / 2));
- d1 = Math.Abs(fiveLine1RectangleFs[3].Y - fiveLine1RectangleFs[4].Y);
- }
- if (fiveLine1RectangleFs.Count > 5)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[4].Y - fiveLine1RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[4].Y - fiveLine1RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine1RectangleFs[4].X - sizeF.Width / 4, (fiveLine1RectangleFs[4].Y + fiveLine1RectangleFs[5].Y) / 2));
- b1 = Math.Abs(fiveLine1RectangleFs[4].Y - fiveLine1RectangleFs[5].Y);
- }
- if (fiveLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine2RectangleFs[0].X - sizeF.Width / 4, (fiveLine2RectangleFs[0].Y + fiveLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y);
- }
- if (fiveLine2RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine2RectangleFs[1].X - sizeF.Width / 4, (fiveLine2RectangleFs[1].Y + fiveLine2RectangleFs[2].Y) / 2));
- c2 = Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y);
- }
- if (fiveLine2RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[3].Y - fiveLine2RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[3].Y - fiveLine2RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine2RectangleFs[3].X - sizeF.Width / 4, (fiveLine2RectangleFs[3].Y + fiveLine2RectangleFs[4].Y) / 2));
- d2 = Math.Abs(fiveLine2RectangleFs[3].Y - fiveLine2RectangleFs[4].Y);
- }
- if (fiveLine2RectangleFs.Count > 5)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[4].Y - fiveLine2RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[4].Y - fiveLine2RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine2RectangleFs[4].X - sizeF.Width / 4, (fiveLine2RectangleFs[4].Y + fiveLine2RectangleFs[5].Y) / 2));
- b2 = Math.Abs(fiveLine2RectangleFs[4].Y - fiveLine2RectangleFs[5].Y);
- }
- if (fiveLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine3RectangleFs[0].X - sizeF.Width / 4, (fiveLine3RectangleFs[0].Y + fiveLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y);
- }
- if (fiveLine3RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine3RectangleFs[1].X - sizeF.Width / 4, (fiveLine3RectangleFs[1].Y + fiveLine3RectangleFs[2].Y) / 2));
- c3 = Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y);
- }
- if (fiveLine3RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[3].Y - fiveLine3RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[3].Y - fiveLine3RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine3RectangleFs[3].X - sizeF.Width / 4, (fiveLine3RectangleFs[3].Y + fiveLine3RectangleFs[4].Y) / 2));
- d3 = Math.Abs(fiveLine3RectangleFs[3].Y - fiveLine3RectangleFs[4].Y);
- }
- if (fiveLine3RectangleFs.Count > 5)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[4].Y - fiveLine3RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[4].Y - fiveLine3RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine3RectangleFs[4].X - sizeF.Width / 4, (fiveLine3RectangleFs[4].Y + fiveLine3RectangleFs[5].Y) / 2));
- b3 = Math.Abs(fiveLine3RectangleFs[4].Y - fiveLine3RectangleFs[5].Y);
- }
- if (fiveLine4RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine4RectangleFs[0].X - sizeF.Width / 4, (fiveLine4RectangleFs[0].Y + fiveLine4RectangleFs[1].Y) / 2));
- a4 = Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y);
- }
- if (fiveLine4RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine4RectangleFs[1].X - sizeF.Width / 4, (fiveLine4RectangleFs[1].Y + fiveLine4RectangleFs[2].Y) / 2));
- c4 = Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y);
- }
- if (fiveLine4RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[3].Y - fiveLine4RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[3].Y - fiveLine4RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine4RectangleFs[3].X - sizeF.Width / 4, (fiveLine4RectangleFs[3].Y + fiveLine4RectangleFs[4].Y) / 2));
- d4 = Math.Abs(fiveLine4RectangleFs[3].Y - fiveLine4RectangleFs[4].Y);
- }
- if (fiveLine4RectangleFs.Count > 5)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[4].Y - fiveLine4RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[4].Y - fiveLine4RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine4RectangleFs[4].X - sizeF.Width / 4, (fiveLine4RectangleFs[4].Y + fiveLine4RectangleFs[5].Y) / 2));
- b4 = Math.Abs(fiveLine4RectangleFs[4].Y - fiveLine4RectangleFs[5].Y);
- }
- if (fiveLine5RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine5RectangleFs[0].X - sizeF.Width / 4, (fiveLine5RectangleFs[0].Y + fiveLine5RectangleFs[1].Y) / 2));
- a5 = Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y);
- }
- if (fiveLine5RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine5RectangleFs[1].X - sizeF.Width / 4, (fiveLine5RectangleFs[1].Y + fiveLine5RectangleFs[2].Y) / 2));
- c5 = Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y);
- }
- if (fiveLine5RectangleFs.Count > 4)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[3].Y - fiveLine5RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[3].Y - fiveLine5RectangleFs[4].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine5RectangleFs[3].X - sizeF.Width / 4, (fiveLine5RectangleFs[3].Y + fiveLine5RectangleFs[4].Y) / 2));
- d5 = Math.Abs(fiveLine5RectangleFs[3].Y - fiveLine5RectangleFs[4].Y);
- }
- if (fiveLine5RectangleFs.Count > 5)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[4].Y - fiveLine5RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[4].Y - fiveLine5RectangleFs[5].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine5RectangleFs[4].X - sizeF.Width / 4, (fiveLine5RectangleFs[4].Y + fiveLine5RectangleFs[5].Y) / 2));
- b5 = Math.Abs(fiveLine5RectangleFs[4].Y - fiveLine5RectangleFs[5].Y);
- }
- }
- else if (this.type.Equals(constTypeE))
- {
- if (fiveLine1RectangleFs.Count == 2)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine1RectangleFs.Count == 3)
- {
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength));
- this.lengthL1[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength));
- }
- if (fiveLine2RectangleFs.Count == 2)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine2RectangleFs.Count == 3)
- {
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength));
- this.lengthL2[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength));
- }
- if (fiveLine3RectangleFs.Count == 2)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine3RectangleFs.Count == 3)
- {
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength));
- this.lengthL3[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength));
- }
- if (fiveLine4RectangleFs.Count == 2)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine4RectangleFs.Count == 3)
- {
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength));
- this.lengthL4[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength));
- }
- if (fiveLine5RectangleFs.Count == 2)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- }
- else if (fiveLine5RectangleFs.Count == 3)
- {
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength));
- this.lengthL5[this.dataGridView1.SelectedCells[0].RowIndex].Add(Convert.ToDecimal(Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength));
- }
- if (fiveLine1RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine1RectangleFs[0].X - sizeF.Width / 4, (fiveLine1RectangleFs[0].Y + fiveLine1RectangleFs[1].Y) / 2));
- a1 = Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[1].Y);
- }
- if (fiveLine1RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine1RectangleFs[1].X - sizeF.Width / 4, (fiveLine1RectangleFs[1].Y + fiveLine1RectangleFs[2].Y) / 2));
- c1 = Math.Abs(fiveLine1RectangleFs[1].Y - fiveLine1RectangleFs[2].Y);
- }
- if (fiveLine2RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine2RectangleFs[0].X - sizeF.Width / 4, (fiveLine2RectangleFs[0].Y + fiveLine2RectangleFs[1].Y) / 2));
- a2 = Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[1].Y);
- }
- if (fiveLine2RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine2RectangleFs[1].X - sizeF.Width / 4, (fiveLine2RectangleFs[1].Y + fiveLine2RectangleFs[2].Y) / 2));
- c2 = Math.Abs(fiveLine2RectangleFs[1].Y - fiveLine2RectangleFs[2].Y);
- }
- if (fiveLine3RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine3RectangleFs[0].X - sizeF.Width / 4, (fiveLine3RectangleFs[0].Y + fiveLine3RectangleFs[1].Y) / 2));
- a3 = Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[1].Y);
- }
- if (fiveLine3RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine3RectangleFs[1].X - sizeF.Width / 4, (fiveLine3RectangleFs[1].Y + fiveLine3RectangleFs[2].Y) / 2));
- c3 = Math.Abs(fiveLine3RectangleFs[1].Y - fiveLine3RectangleFs[2].Y);
- }
- if (fiveLine4RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine4RectangleFs[0].X - sizeF.Width / 4, (fiveLine4RectangleFs[0].Y + fiveLine4RectangleFs[1].Y) / 2));
- a4 = Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[1].Y);
- }
- if (fiveLine4RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine4RectangleFs[1].X - sizeF.Width / 4, (fiveLine4RectangleFs[1].Y + fiveLine4RectangleFs[2].Y) / 2));
- c4 = Math.Abs(fiveLine4RectangleFs[1].Y - fiveLine4RectangleFs[2].Y);
- }
- if (fiveLine5RectangleFs.Count > 1)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine5RectangleFs[0].X - sizeF.Width / 4, (fiveLine5RectangleFs[0].Y + fiveLine5RectangleFs[1].Y) / 2));
- a5 = Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[1].Y);
- }
- if (fiveLine5RectangleFs.Count > 2)
- {
- sizeF = graphics.MeasureString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm", lineFont);
- if (this.checkBox1.Checked)
- graphics.DrawString("" + Math.Round((Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y) * this.unitLength), this.decimalCls) + "μm",
- lineFont, new SolidBrush(Color.Black),
- new PointF(fiveLine5RectangleFs[1].X - sizeF.Width / 4, (fiveLine5RectangleFs[1].Y + fiveLine5RectangleFs[2].Y) / 2));
- c5 = Math.Abs(fiveLine5RectangleFs[1].Y - fiveLine5RectangleFs[2].Y);
- }
- }
- }
- #endregion
- #endregion
- #region 计算百分比基数
- if (this.linesNumber == 3)
- {
- if (this.type.Equals(constTypeA))
- {
- int line = 0;
- if (threeLine1RectangleFs.Count > 2)
- {
- line++;
- w += Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[2].Y);
- }
- if (threeLine2RectangleFs.Count > 2)
- {
- line++;
- w += Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[2].Y);
- }
- if (threeLine3RectangleFs.Count > 2)
- {
- line++;
- w += Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[2].Y);
- }
- w = w / line;
- }
- else if (this.type.Equals(constTypeB))
- {
- int line = 0;
- if (threeLine1RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[3].Y);
- }
- if (threeLine2RectangleFs.Count > 3 )
- {
- line++;
- w += Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[3].Y);
- }
- if (threeLine3RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[3].Y);
- }
- w = w / line;
- }
- else if (this.type.Equals(constTypeC))
- {
- int line = 0;
- if (threeLine1RectangleFs.Count > 4)
- {
- line++;
- w += Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[4].Y);
- }
- if (threeLine2RectangleFs.Count > 4)
- {
- line++;
- w += Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[4].Y);
- }
- if (threeLine3RectangleFs.Count > 4)
- {
- line++;
- w += Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[4].Y);
- }
- w = w / line;
- }
- else if (this.type.Equals(constTypeD))
- {
- int line = 0;
- if (threeLine1RectangleFs.Count > 5)
- {
- line++;
- w += Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[5].Y);
- }
- if (threeLine2RectangleFs.Count > 5)
- {
- line++;
- w += Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[5].Y);
- }
- if (threeLine3RectangleFs.Count > 5)
- {
- line++;
- w += Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[5].Y);
- }
- w = w / line;
- }
- else if (this.type.Equals(constTypeE))
- {
- int line = 0;
- if (threeLine1RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(threeLine1RectangleFs[0].Y - threeLine1RectangleFs[3].Y);
- }
- if (threeLine2RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(threeLine2RectangleFs[0].Y - threeLine2RectangleFs[3].Y);
- }
- if (threeLine3RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(threeLine3RectangleFs[0].Y - threeLine3RectangleFs[3].Y);
- }
- w = w / line;
- }
- }
- else if (this.linesNumber == 4)
- {
- if (this.type.Equals(constTypeA))
- {
- int line = 0;
- if (fourLine1RectangleFs.Count > 2)
- {
- line++;
- w += Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[2].Y);
- }
- if (fourLine2RectangleFs.Count > 2)
- {
- line++;
- w += Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[2].Y);
- }
- if (fourLine3RectangleFs.Count > 2)
- {
- line++;
- w += Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[2].Y);
- }
- if (fourLine4RectangleFs.Count > 2)
- {
- line++;
- w += Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[2].Y);
- }
- w = w / line;
- }
- else if (this.type.Equals(constTypeB))
- {
- int line = 0;
- if (fourLine1RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[3].Y);
- }
- if (fourLine2RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[3].Y);
- }
- if (fourLine3RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[3].Y);
- }
- if (fourLine4RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[3].Y);
- }
- w = w / line;
- }
- else if (this.type.Equals(constTypeC))
- {
- int line = 0;
- if (fourLine1RectangleFs.Count > 4)
- {
- line++;
- w += Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[4].Y);
- }
- if (fourLine2RectangleFs.Count > 4)
- {
- line++;
- w += Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[4].Y);
- }
- if (fourLine3RectangleFs.Count > 4)
- {
- line++;
- w += Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[4].Y);
- }
- if (fourLine4RectangleFs.Count > 4)
- {
- line++;
- w += Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[4].Y);
- }
- w = w / line;
- }
- else if (this.type.Equals(constTypeD))
- {
- int line = 0;
- if (fourLine1RectangleFs.Count > 5)
- {
- line++;
- w += Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[5].Y);
- }
- if (fourLine2RectangleFs.Count > 5)
- {
- line++;
- w += Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[5].Y);
- }
- if (fourLine3RectangleFs.Count > 5)
- {
- line++;
- w += Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[5].Y);
- }
- if (fourLine4RectangleFs.Count > 5)
- {
- line++;
- w += Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[5].Y);
- }
- w = w / line;
- }
- else if (this.type.Equals(constTypeE))
- {
- int line = 0;
- if (fourLine1RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fourLine1RectangleFs[0].Y - fourLine1RectangleFs[3].Y);
- }
- if (fourLine2RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fourLine2RectangleFs[0].Y - fourLine2RectangleFs[3].Y);
- }
- if (fourLine3RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fourLine3RectangleFs[0].Y - fourLine3RectangleFs[3].Y);
- }
- if (fourLine4RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fourLine4RectangleFs[0].Y - fourLine4RectangleFs[3].Y);
- }
- w = w / line;
- }
- }
- else if (this.linesNumber == 5)
- {
- if (this.type.Equals(constTypeA))
- {
- int line = 0;
- if (fiveLine1RectangleFs.Count > 2)
- {
- line++;
- w += Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[2].Y);
- }
- if (fiveLine2RectangleFs.Count > 2)
- {
- line++;
- w += Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[2].Y);
- }
- if (fiveLine3RectangleFs.Count > 2)
- {
- line++;
- w += Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[2].Y);
- }
- if (fiveLine4RectangleFs.Count > 2)
- {
- line++;
- w += Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[2].Y);
- }
- if (fiveLine5RectangleFs.Count > 2)
- {
- line++;
- w += Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[2].Y);
- }
- w = w / line;
- }
- else if (this.type.Equals(constTypeB))
- {
- int line = 0;
- if (fiveLine1RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[3].Y);
- }
- if (fiveLine2RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[3].Y);
- }
- if (fiveLine3RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[3].Y);
- }
- if (fiveLine4RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[3].Y);
- }
- if (fiveLine5RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[3].Y);
- }
- w = w / line;
- }
- else if (this.type.Equals(constTypeC))
- {
- int line = 0;
- if (fiveLine1RectangleFs.Count > 4)
- {
- line++;
- w += Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[4].Y);
- }
- if (fiveLine2RectangleFs.Count > 4)
- {
- line++;
- w += Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[4].Y);
- }
- if (fiveLine3RectangleFs.Count > 4)
- {
- line++;
- w += Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[4].Y);
- }
- if (fiveLine4RectangleFs.Count > 4)
- {
- line++;
- w += Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[4].Y);
- }
- if (fiveLine5RectangleFs.Count > 4)
- {
- line++;
- w += Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[4].Y);
- }
- w = w / line;
- }
- else if (this.type.Equals(constTypeD))
- {
- int line = 0;
- if (fiveLine1RectangleFs.Count > 5)
- {
- line++;
- w += Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[5].Y);
- }
- if (fiveLine2RectangleFs.Count > 5)
- {
- line++;
- w += Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[5].Y);
- }
- if (fiveLine3RectangleFs.Count > 5)
- {
- line++;
- w += Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[5].Y);
- }
- if (fiveLine4RectangleFs.Count > 5)
- {
- line++;
- w += Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[5].Y);
- }
- if (fiveLine5RectangleFs.Count > 5)
- {
- line++;
- w += Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[5].Y);
- }
- w = w / line;
- }
- else if (this.type.Equals(constTypeE))
- {
- int line = 0;
- if (fiveLine1RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fiveLine1RectangleFs[0].Y - fiveLine1RectangleFs[3].Y);
- }
- if (fiveLine2RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fiveLine2RectangleFs[0].Y - fiveLine2RectangleFs[3].Y);
- }
- if (fiveLine3RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fiveLine3RectangleFs[0].Y - fiveLine3RectangleFs[3].Y);
- }
- if (fiveLine4RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fiveLine4RectangleFs[0].Y - fiveLine4RectangleFs[3].Y);
- }
- if (fiveLine5RectangleFs.Count > 3)
- {
- line++;
- w += Math.Abs(fiveLine5RectangleFs[0].Y - fiveLine5RectangleFs[3].Y);
- }
- w = w / line;
- }
- }
- #endregion
- if(w > 0)
- {
- Matrix mtxSave = graphics.Transform;
- Matrix matrix = graphics.Transform;
- float sp = 0;
- // 线条数为三
- if (this.linesNumber == 3)
- {
- sp = this.documentWorkspace.CompositionSurface.Width - (this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing);
- PointF point = new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + sp / 2 - this.lineWidth / 2, this.documentWorkspace.CompositionSurface.Height / 2);
- graphics.DrawLine(linePen, new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + sp / 2, this.documentWorkspace.CompositionSurface.Height / 2 - (int)w / 2), new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + sp / 2, this.documentWorkspace.CompositionSurface.Height / 2 + (int)w / 2));
- matrix.RotateAt((float)90, new PointF(point.X, point.Y));
- graphics.Transform = matrix;
- graphics.DrawString("" + Math.Round(w * this.unitLength, this.decimalCls) + "μm", lineFont, brush, point);
- //还原为原始旋转矩阵
- graphics.Transform = mtxSave;
- }
- // 线条数为四
- else if (this.linesNumber == 4)
- {
- sp = this.documentWorkspace.CompositionSurface.Width - (this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineSpacing / 2);
- PointF point = new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineSpacing / 2 + sp / 2 - this.lineWidth / 2, this.documentWorkspace.CompositionSurface.Height / 2);
- graphics.DrawLine(linePen, new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineSpacing / 2 + sp / 2, this.documentWorkspace.CompositionSurface.Height / 2 - (int)w / 2), new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineSpacing / 2 + sp / 2, this.documentWorkspace.CompositionSurface.Height / 2 + (int)w / 2));
- matrix.RotateAt((float)90, new PointF(point.X, point.Y));
- graphics.Transform = matrix;
- graphics.DrawString("" + Math.Round(w * this.unitLength, this.decimalCls) + "μm", lineFont, brush, point);
- //还原为原始旋转矩阵
- graphics.Transform = mtxSave;
- }
- // 线条数为五
- else if (this.linesNumber == 5)
- {
- sp = this.documentWorkspace.CompositionSurface.Width - (this.documentWorkspace.CompositionSurface.Width / 2 + 2 * this.lineSpacing);
- PointF point = new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + 2 * this.lineSpacing + sp / 2 - this.lineWidth / 2, this.documentWorkspace.CompositionSurface.Height / 2);
- graphics.DrawLine(linePen, new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + 2 * this.lineSpacing + sp / 2, this.documentWorkspace.CompositionSurface.Height / 2 - (int)w / 2), new PointF(this.documentWorkspace.CompositionSurface.Width / 2 + 2 * this.lineSpacing + sp / 2, this.documentWorkspace.CompositionSurface.Height / 2 + (int)w / 2));
- matrix.RotateAt((float)90, new PointF(point.X, point.Y));
- graphics.Transform = matrix;
- graphics.DrawString("" + Math.Round(w * this.unitLength, this.decimalCls) + "μm", lineFont, brush, point);
- //还原为原始旋转矩阵
- graphics.Transform = mtxSave;
- }
- matrix.Dispose();
- }
- }
- #region 计算测量点百分比
- if (this.pointDrawkb)
- {
- // 取目标值/误差
- int left;
- int right;
- string leftValue;
- string rightValue;
- float length1 = 0;
- float length2 = 0;
- float length3 = 0;
- float length4 = 0;
- float length5 = 0;
- // 线条数为三
- if (this.linesNumber == 3)
- {
- for (int i = 0; i < this.dataGridView2.Rows.Count; i++)
- {
- // 总百分比
- float all = 0;
- if (i == 0)
- {
- length1 = a1;
- length2 = a2;
- length3 = a3;
- }
- else if (i == 1)
- {
- if (this.type.Equals(constTypeE))
- {
- length1 = c1;
- length2 = c2;
- length3 = c3;
- }
- else
- {
- length1 = b1;
- length2 = b2;
- length3 = b3;
- }
- }
- else if (i == 2)
- {
- length1 = c1;
- length2 = c2;
- length3 = c3;
- }
- else if (i == 3)
- {
- length1 = d1;
- length2 = d2;
- length3 = d3;
- }
- left = this.dataGridView2.Rows[i].Cells[1].Value.ToString().IndexOf("%");
- right = this.dataGridView2.Rows[i].Cells[1].Value.ToString().IndexOf("-");
- leftValue = this.dataGridView2.Rows[i].Cells[1].Value.ToString().Substring(0, left);
- rightValue = this.dataGridView2.Rows[i].Cells[1].Value.ToString().Substring(right + 1);
- if (pointCountA1[this.dataGridView1.SelectedCells[0].RowIndex] < this.pointDrawCount)
- {
- this.dataGridView2.Rows[i].Cells[2].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView3.Rows[i].Cells[2].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView2.Rows[i].Cells[2].Style.BackColor = Color.Red;
- }
- else
- {
- this.dataGridView2.Rows[i].Cells[2].Value = "" + Math.Round((length1 / w) * 100, decimalCls);
- this.dataGridView3.Rows[i].Cells[2].Value = "" + ((length1 / w) * 100);
- all += (length1 / w) * 100;
- if (length1 / w * 100 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || length1 / w * 100 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[2].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[2].Style.BackColor = SystemColors.ControlLightLight;
- }
- if (pointCountA2[this.dataGridView1.SelectedCells[0].RowIndex] < this.pointDrawCount)
- {
- this.dataGridView2.Rows[i].Cells[3].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView3.Rows[i].Cells[3].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView2.Rows[i].Cells[3].Style.BackColor = Color.Red;
- }
- else
- {
- this.dataGridView2.Rows[i].Cells[3].Value = "" + Math.Round((length2 / w) * 100, decimalCls);
- this.dataGridView3.Rows[i].Cells[3].Value = "" + ((length2 / w) * 100);
- all += (length2 / w) * 100;
- if (length2 / w * 100 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || length2 / w * 100 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[3].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[3].Style.BackColor = SystemColors.ControlLightLight;
- }
- if (pointCountA3[this.dataGridView1.SelectedCells[0].RowIndex] < this.pointDrawCount)
- {
- this.dataGridView2.Rows[i].Cells[4].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView3.Rows[i].Cells[4].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView2.Rows[i].Cells[4].Style.BackColor = Color.Red;
- }
- else
- {
- this.dataGridView2.Rows[i].Cells[4].Value = "" + Math.Round((length3 / w) * 100, decimalCls);
- this.dataGridView3.Rows[i].Cells[4].Value = "" + ((length3 / w) * 100);
- all += (length3 / w) * 100;
- if (length3 / w * 100 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || length3 / w * 100 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[4].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[4].Style.BackColor = SystemColors.ControlLightLight;
- }
- // 平均值
- this.dataGridView2.Rows[i].Cells[7].Value = "" + Math.Round(all / 3, decimalCls);
- this.dataGridView3.Rows[i].Cells[7].Value = "" + (all / 3);
- if (all / 3 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || all / 3 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[7].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[7].Style.BackColor = SystemColors.ControlLightLight;
- }
- }
- // 线条数为四
- else if (this.linesNumber == 4)
- {
- for (int i = 0; i < this.dataGridView2.Rows.Count; i++)
- {
- // 总百分比
- float all = 0;
- if (i == 0)
- {
- length1 = a1;
- length2 = a2;
- length3 = a3;
- length4 = a4;
- }
- else if (i == 1)
- {
- if (this.type.Equals(constTypeE))
- {
- length1 = c1;
- length2 = c2;
- length3 = c3;
- length4 = c4;
- }
- else
- {
- length1 = b1;
- length2 = b2;
- length3 = b3;
- length4 = b4;
- }
- }
- else if (i == 2)
- {
- length1 = c1;
- length2 = c2;
- length3 = c3;
- length4 = c4;
- }
- else if (i == 3)
- {
- length1 = d1;
- length2 = d2;
- length3 = d3;
- length4 = d4;
- }
- left = this.dataGridView2.Rows[i].Cells[1].Value.ToString().IndexOf("%");
- right = this.dataGridView2.Rows[i].Cells[1].Value.ToString().IndexOf("-");
- leftValue = this.dataGridView2.Rows[i].Cells[1].Value.ToString().Substring(0, left);
- rightValue = this.dataGridView2.Rows[i].Cells[1].Value.ToString().Substring(right + 1);
- if (pointCountB1[this.dataGridView1.SelectedCells[0].RowIndex] < this.pointDrawCount)
- {
- this.dataGridView2.Rows[i].Cells[2].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView3.Rows[i].Cells[2].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView2.Rows[i].Cells[2].Style.BackColor = Color.Red;
- }
- else
- {
- this.dataGridView2.Rows[i].Cells[2].Value = "" + Math.Round((length1 / w) * 100, decimalCls);
- this.dataGridView3.Rows[i].Cells[2].Value = "" + ((length1 / w) * 100);
- all += (length1 / w) * 100;
- if (length1 / w * 100 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || length1 / w * 100 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[2].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[2].Style.BackColor = SystemColors.ControlLightLight;
- }
- if (pointCountB2[this.dataGridView1.SelectedCells[0].RowIndex] < this.pointDrawCount)
- {
- this.dataGridView2.Rows[i].Cells[3].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView3.Rows[i].Cells[3].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView2.Rows[i].Cells[3].Style.BackColor = Color.Red;
- }
- else
- {
- this.dataGridView2.Rows[i].Cells[3].Value = "" + Math.Round((length2 / w) * 100, decimalCls);
- this.dataGridView3.Rows[i].Cells[3].Value = "" + ((length2 / w) * 100);
- all += (length2 / w) * 100;
- if (length2 / w * 100 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || length2 / w * 100 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[3].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[3].Style.BackColor = SystemColors.ControlLightLight;
- }
- if (pointCountB3[this.dataGridView1.SelectedCells[0].RowIndex] < this.pointDrawCount)
- {
- this.dataGridView2.Rows[i].Cells[4].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView3.Rows[i].Cells[4].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView2.Rows[i].Cells[4].Style.BackColor = Color.Red;
- }
- else
- {
- this.dataGridView2.Rows[i].Cells[4].Value = "" + Math.Round((length3 / w) * 100, decimalCls);
- this.dataGridView3.Rows[i].Cells[4].Value = "" + ((length3 / w) * 100);
- all += (length3 / w) * 100;
- if (length3 / w * 100 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || length3 / w * 100 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[4].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[4].Style.BackColor = SystemColors.ControlLightLight;
- }
- if (pointCountB4[this.dataGridView1.SelectedCells[0].RowIndex] < this.pointDrawCount)
- {
- this.dataGridView2.Rows[i].Cells[5].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView3.Rows[i].Cells[5].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView2.Rows[i].Cells[5].Style.BackColor = Color.Red;
- }
- else
- {
- this.dataGridView2.Rows[i].Cells[5].Value = "" + Math.Round((length4 / w) * 100, decimalCls);
- this.dataGridView3.Rows[i].Cells[5].Value = "" + ((length4 / w) * 100);
- all += (length4 / w) * 100;
- if (length4 / w * 100 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || length4 / w * 100 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[5].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[5].Style.BackColor = SystemColors.ControlLightLight;
- }
- // 平均值
- this.dataGridView2.Rows[i].Cells[7].Value = "" + Math.Round(all / 4, decimalCls);
- this.dataGridView3.Rows[i].Cells[7].Value = "" + (all / 4);
- if (all / 4 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || all / 4 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[7].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[7].Style.BackColor = SystemColors.ControlLightLight;
- }
- }
- // 线条数为五
- else if (this.linesNumber == 5)
- {
- for (int i = 0; i < this.dataGridView2.Rows.Count; i++)
- {
- // 总百分比
- float all = 0;
- if (i == 0)
- {
- length1 = a1;
- length2 = a2;
- length3 = a3;
- length4 = a4;
- length5 = a5;
- }
- else if (i == 1)
- {
- if (this.type.Equals(constTypeE))
- {
- length1 = c1;
- length2 = c2;
- length3 = c3;
- length4 = c4;
- length4 = c5;
- }
- else
- {
- length1 = b1;
- length2 = b2;
- length3 = b3;
- length4 = b4;
- length4 = b5;
- }
- }
- else if (i == 2)
- {
- length1 = c1;
- length2 = c2;
- length3 = c3;
- length4 = c4;
- length5 = c5;
- }
- else if (i == 3)
- {
- length1 = d1;
- length2 = d2;
- length3 = d3;
- length4 = d4;
- length5 = d5;
- }
- left = this.dataGridView2.Rows[i].Cells[1].Value.ToString().IndexOf("%");
- right = this.dataGridView2.Rows[i].Cells[1].Value.ToString().IndexOf("-");
- leftValue = this.dataGridView2.Rows[i].Cells[1].Value.ToString().Substring(0, left);
- rightValue = this.dataGridView2.Rows[i].Cells[1].Value.ToString().Substring(right + 1);
- if (pointCountC1[this.dataGridView1.SelectedCells[0].RowIndex] < this.pointDrawCount)
- {
- this.dataGridView2.Rows[i].Cells[2].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView3.Rows[i].Cells[2].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView2.Rows[i].Cells[2].Style.BackColor = Color.Red;
- }
- else
- {
- this.dataGridView2.Rows[i].Cells[2].Value = "" + Math.Round((length1 / w) * 100, decimalCls);
- this.dataGridView3.Rows[i].Cells[2].Value = "" + ((length1 / w) * 100);
- all += (length1 / w) * 100;
- if (length1 / w * 100 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || length1 / w * 100 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[2].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[2].Style.BackColor = SystemColors.ControlLightLight;
- }
- if (pointCountC2[this.dataGridView1.SelectedCells[0].RowIndex] < this.pointDrawCount)
- {
- this.dataGridView2.Rows[i].Cells[3].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView3.Rows[i].Cells[3].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView2.Rows[i].Cells[3].Style.BackColor = Color.Red;
- }
- else
- {
- this.dataGridView2.Rows[i].Cells[3].Value = "" + Math.Round((length2 / w) * 100, decimalCls);
- this.dataGridView3.Rows[i].Cells[3].Value = "" + ((length2 / w) * 100);
- all += (length2 / w) * 100;
- if (length2 / w * 100 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || length2 / w * 100 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[3].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[3].Style.BackColor = SystemColors.ControlLightLight;
- }
- if (pointCountC3[this.dataGridView1.SelectedCells[0].RowIndex] < this.pointDrawCount)
- {
- this.dataGridView2.Rows[i].Cells[4].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView3.Rows[i].Cells[4].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView2.Rows[i].Cells[4].Style.BackColor = Color.Red;
- }
- else
- {
- this.dataGridView2.Rows[i].Cells[4].Value = "" + Math.Round((length3 / w) * 100, decimalCls);
- this.dataGridView3.Rows[i].Cells[4].Value = "" + ((length3 / w) * 100);
- all += (length3 / w) * 100;
- if (length3 / w * 100 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || length3 / w * 100 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[4].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[4].Style.BackColor = SystemColors.ControlLightLight;
- }
- if (pointCountC4[this.dataGridView1.SelectedCells[0].RowIndex] < this.pointDrawCount)
- {
- this.dataGridView2.Rows[i].Cells[5].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView3.Rows[i].Cells[5].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView2.Rows[i].Cells[5].Style.BackColor = Color.Red;
- }
- else
- {
- this.dataGridView2.Rows[i].Cells[5].Value = "" + Math.Round((length4 / w) * 100, decimalCls);
- this.dataGridView3.Rows[i].Cells[5].Value = "" + ((length4 / w) * 100);
- all += (length4 / w) * 100;
- if (length4 / w * 100 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || length4 / w * 100 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[5].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[5].Style.BackColor = SystemColors.ControlLightLight;
- }
- if (pointCountC5[this.dataGridView1.SelectedCells[0].RowIndex] < this.pointDrawCount)
- {
- this.dataGridView2.Rows[i].Cells[6].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView3.Rows[i].Cells[6].Value = PdnResources.GetString("Menu.Alittleless.Text");
- this.dataGridView2.Rows[i].Cells[6].Style.BackColor = Color.Red;
- }
- else
- {
- this.dataGridView2.Rows[i].Cells[6].Value = "" + Math.Round((length5 / w) * 100, decimalCls);
- this.dataGridView3.Rows[i].Cells[6].Value = "" + ((length5 / w) * 100);
- all += (length5 / w) * 100;
- if (length5 / w * 100 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || length5 / w * 100 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[6].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[6].Style.BackColor = SystemColors.ControlLightLight;
- }
- // 平均值
- this.dataGridView2.Rows[i].Cells[7].Value = "" + Math.Round(all / 5, decimalCls);
- this.dataGridView3.Rows[i].Cells[7].Value = "" + (all / 5);
- if (all / 5 > (float)(Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || all / 5 < (float)(Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[7].Style.BackColor = Color.Red;
- else
- this.dataGridView2.Rows[i].Cells[7].Style.BackColor = SystemColors.ControlLightLight;
- }
- }
- }
- #endregion
- brush.Dispose();
- }
- /// <summary>
- /// 鼠标按下
- /// </summary>
- /// <param name="drawArea"></param>
- /// <param name="e"></param>
- private void OnMouseDown(object sender, MouseEventArgs e)
- {
- if (e.Button != MouseButtons.Left)
- return;
- for (int i = 0; i < this.appWorkspace.ActiveDocumentWorkspace.GraphicsList.Count; i++)
- {
- this.appWorkspace.ActiveDocumentWorkspace.GraphicsList[i].Selected = false;
- }
- // 换算后的点
- PointF point1 = documentWorkspace.GetScalePoint(e.Location);
- // 选择范围
- int selectTop = 0;
- int selectBottom = 0;
- if (operationK == 0)
- {
- selectTop = 0;
- selectBottom = this.documentWorkspace.CompositionSurface.Height;
- }
- else if (operationK == 1 || operationK == 2)
- {
- selectTop = - (int)this.pointDiameter / 2;
- selectBottom = this.documentWorkspace.CompositionSurface.Height + (int)this.pointDiameter / 2;
- }
- // 点在图片内
- if (point1.Y >= selectTop && point1.Y <= selectBottom)
- {
- // 添加测量点
- if (operationK == 0)
- {
- // 线条数为三
- if (this.linesNumber == 3)
- {
- // 在线条上添加测量点
- if (point1.X <= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing + this.lineWidth / 2
- && point1.X >= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.lineWidth / 2)
- {
- // 可绘制的点数
- if (pointCountA1[this.dataGridView1.SelectedCells[0].RowIndex] < pointDrawCount)
- {
- // 创建用于绘制测量点的矩形
- RectangleF rectangleF = new RectangleF((this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.pointDiameter / 2), (point1.Y - this.pointDiameter / 2), this.pointDiameter, this.pointDiameter);
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Add(rectangleF);
- this.saveSuccess = true;
- }
- pointCountA1[this.dataGridView1.SelectedCells[0].RowIndex]++;
- if (pointCountA1[this.dataGridView1.SelectedCells[0].RowIndex] > pointDrawCount - 1)
- pointCountA1[this.dataGridView1.SelectedCells[0].RowIndex] = pointDrawCount;
- }
- // 在线条上添加测量点
- else if (point1.X <= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineWidth / 2
- && point1.X >= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineWidth / 2)
- {
- // 可绘制的点数
- if (pointCountA2[this.dataGridView1.SelectedCells[0].RowIndex] < pointDrawCount)
- {
- // 创建用于绘制测量点的矩形
- RectangleF rectangleF = new RectangleF((this.documentWorkspace.CompositionSurface.Width / 2 - this.pointDiameter / 2), (point1.Y - this.pointDiameter / 2), this.pointDiameter, this.pointDiameter);
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Add(rectangleF);
- this.saveSuccess = true;
- }
- pointCountA2[this.dataGridView1.SelectedCells[0].RowIndex]++;
- if (pointCountA2[this.dataGridView1.SelectedCells[0].RowIndex] > pointDrawCount - 1)
- pointCountA2[this.dataGridView1.SelectedCells[0].RowIndex] = pointDrawCount;
- }
- // 在线条上添加测量点
- else if (point1.X <= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineWidth / 2
- && point1.X >= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing - this.lineWidth / 2)
- {
- // 可绘制的点数
- if (pointCountA3[this.dataGridView1.SelectedCells[0].RowIndex] < pointDrawCount)
- {
- // 创建用于绘制测量点的矩形
- RectangleF rectangleF = new RectangleF((this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing - this.pointDiameter / 2), (point1.Y - this.pointDiameter / 2), this.pointDiameter, this.pointDiameter);
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Add(rectangleF);
- this.saveSuccess = true;
- }
- pointCountA3[this.dataGridView1.SelectedCells[0].RowIndex]++;
- if (pointCountA3[this.dataGridView1.SelectedCells[0].RowIndex] > pointDrawCount - 1)
- pointCountA3[this.dataGridView1.SelectedCells[0].RowIndex] = pointDrawCount;
- }
- }
- // 线条数为四
- else if (this.linesNumber == 4)
- {
- // 在线条上添加测量点
- if (point1.X <= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.lineSpacing / 2 + this.lineWidth / 2
- && point1.X >= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.lineSpacing / 2 - this.lineWidth / 2)
- {
- // 可绘制的点数
- if (pointCountB1[this.dataGridView1.SelectedCells[0].RowIndex] < pointDrawCount)
- {
- // 创建用于绘制测量点的矩形
- RectangleF rectangleF = new RectangleF((this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.lineSpacing / 2 - this.pointDiameter / 2), (point1.Y - this.pointDiameter / 2), this.pointDiameter, this.pointDiameter);
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Add(rectangleF);
- this.saveSuccess = true;
- }
- pointCountB1[this.dataGridView1.SelectedCells[0].RowIndex]++;
- if (pointCountB1[this.dataGridView1.SelectedCells[0].RowIndex] > pointDrawCount - 1)
- pointCountB1[this.dataGridView1.SelectedCells[0].RowIndex] = pointDrawCount;
- }
- // 在线条上添加测量点
- else if (point1.X <= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing / 2 + this.lineWidth / 2
- && point1.X >= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing / 2 - this.lineWidth / 2)
- {
- // 可绘制的点数
- if (pointCountB2[this.dataGridView1.SelectedCells[0].RowIndex] < pointDrawCount)
- {
- // 创建用于绘制测量点的矩形
- RectangleF rectangleF = new RectangleF((this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing / 2 - this.pointDiameter / 2), (point1.Y - this.pointDiameter / 2), this.pointDiameter, this.pointDiameter);
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Add(rectangleF);
- this.saveSuccess = true;
- }
- pointCountB2[this.dataGridView1.SelectedCells[0].RowIndex]++;
- if (pointCountB2[this.dataGridView1.SelectedCells[0].RowIndex] > pointDrawCount - 1)
- pointCountB2[this.dataGridView1.SelectedCells[0].RowIndex] = pointDrawCount;
- }
- // 在线条上添加测量点
- else if (point1.X <= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing / 2 + this.lineWidth / 2
- && point1.X >= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing / 2 - this.lineWidth / 2)
- {
- // 可绘制的点数
- if (pointCountB3[this.dataGridView1.SelectedCells[0].RowIndex] < pointDrawCount)
- {
- // 创建用于绘制测量点的矩形
- RectangleF rectangleF = new RectangleF((this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing / 2 - this.pointDiameter / 2), (point1.Y - this.pointDiameter / 2), this.pointDiameter, this.pointDiameter);
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Add(rectangleF);
- this.saveSuccess = true;
- }
- pointCountB3[this.dataGridView1.SelectedCells[0].RowIndex]++;
- if (pointCountB3[this.dataGridView1.SelectedCells[0].RowIndex] > pointDrawCount - 1)
- pointCountB3[this.dataGridView1.SelectedCells[0].RowIndex] = pointDrawCount;
- }
- // 在线条上添加测量点
- else if (point1.X <= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineSpacing / 2 + this.lineWidth / 2
- && point1.X >= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineSpacing / 2 - this.lineWidth / 2)
- {
- // 可绘制的点数
- if (pointCountB4[this.dataGridView1.SelectedCells[0].RowIndex] < pointDrawCount)
- {
- // 创建用于绘制测量点的矩形
- RectangleF rectangleF = new RectangleF((this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineSpacing / 2 - this.pointDiameter / 2), (point1.Y - this.pointDiameter / 2), this.pointDiameter, this.pointDiameter);
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Add(rectangleF);
- this.saveSuccess = true;
- }
- pointCountB4[this.dataGridView1.SelectedCells[0].RowIndex]++;
- if (pointCountB4[this.dataGridView1.SelectedCells[0].RowIndex] > pointDrawCount - 1)
- pointCountB4[this.dataGridView1.SelectedCells[0].RowIndex] = pointDrawCount;
- }
- }
- // 线条数为五
- else if (this.linesNumber == 5)
- {
- // 在线条上添加测量点
- if (point1.X <= this.documentWorkspace.CompositionSurface.Width / 2 - 2 * this.lineSpacing + this.lineWidth / 2
- && point1.X >= this.documentWorkspace.CompositionSurface.Width / 2 - 2 * this.lineSpacing - this.lineWidth / 2)
- {
- // 可绘制的点数
- if (pointCountC1[this.dataGridView1.SelectedCells[0].RowIndex] < pointDrawCount)
- {
- // 创建用于绘制测量点的矩形
- RectangleF rectangleF = new RectangleF((this.documentWorkspace.CompositionSurface.Width / 2 - 2 * this.lineSpacing - this.pointDiameter / 2), (point1.Y - this.pointDiameter / 2), this.pointDiameter, this.pointDiameter);
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Add(rectangleF);
- this.saveSuccess = true;
- }
- pointCountC1[this.dataGridView1.SelectedCells[0].RowIndex]++;
- if (pointCountC1[this.dataGridView1.SelectedCells[0].RowIndex] > pointDrawCount - 1)
- pointCountC1[this.dataGridView1.SelectedCells[0].RowIndex] = pointDrawCount;
- }
- // 在线条上添加测量点
- else if (point1.X <= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing + this.lineWidth / 2
- && point1.X >= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.lineWidth / 2)
- {
- // 可绘制的点数
- if (pointCountC2[this.dataGridView1.SelectedCells[0].RowIndex] < pointDrawCount)
- {
- // 创建用于绘制测量点的矩形
- RectangleF rectangleF = new RectangleF((this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.pointDiameter / 2), (point1.Y - this.pointDiameter / 2), this.pointDiameter, this.pointDiameter);
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Add(rectangleF);
- this.saveSuccess = true;
- }
- pointCountC2[this.dataGridView1.SelectedCells[0].RowIndex]++;
- if (pointCountC2[this.dataGridView1.SelectedCells[0].RowIndex] > pointDrawCount - 1)
- pointCountC2[this.dataGridView1.SelectedCells[0].RowIndex] = pointDrawCount;
- }
- // 在线条上添加测量点
- else if (point1.X <= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineWidth / 2
- && point1.X >= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineWidth / 2)
- {
- // 可绘制的点数
- if (pointCountC3[this.dataGridView1.SelectedCells[0].RowIndex] < pointDrawCount)
- {
- // 创建用于绘制测量点的矩形
- RectangleF rectangleF = new RectangleF((this.documentWorkspace.CompositionSurface.Width / 2 - this.pointDiameter / 2), (point1.Y - this.pointDiameter / 2), this.pointDiameter, this.pointDiameter);
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Add(rectangleF);
- this.saveSuccess = true;
- }
- pointCountC3[this.dataGridView1.SelectedCells[0].RowIndex]++;
- if (pointCountC3[this.dataGridView1.SelectedCells[0].RowIndex] > pointDrawCount - 1)
- pointCountC3[this.dataGridView1.SelectedCells[0].RowIndex] = pointDrawCount;
- }
- // 在线条上添加测量点
- else if (point1.X <= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineWidth / 2
- && point1.X >= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing - this.lineWidth / 2)
- {
- // 可绘制的点数
- if (pointCountC4[this.dataGridView1.SelectedCells[0].RowIndex] < pointDrawCount)
- {
- // 创建用于绘制测量点的矩形
- RectangleF rectangleF = new RectangleF((this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing - this.pointDiameter / 2), (point1.Y - this.pointDiameter / 2), this.pointDiameter, this.pointDiameter);
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Add(rectangleF);
- this.saveSuccess = true;
- }
- pointCountC4[this.dataGridView1.SelectedCells[0].RowIndex]++;
- if (pointCountC4[this.dataGridView1.SelectedCells[0].RowIndex] > pointDrawCount - 1)
- pointCountC4[this.dataGridView1.SelectedCells[0].RowIndex] = pointDrawCount;
- }
- // 在线条上添加测量点
- else if (point1.X <= this.documentWorkspace.CompositionSurface.Width / 2 + 2 * this.lineSpacing + this.lineWidth / 2
- && point1.X >= this.documentWorkspace.CompositionSurface.Width / 2 + 2 * this.lineSpacing - this.lineWidth / 2)
- {
- // 可绘制的点数
- if (pointCountC5[this.dataGridView1.SelectedCells[0].RowIndex] < pointDrawCount)
- {
- // 创建用于绘制测量点的矩形
- RectangleF rectangleF = new RectangleF((this.documentWorkspace.CompositionSurface.Width / 2 + 2 * this.lineSpacing - this.pointDiameter / 2), (point1.Y - this.pointDiameter / 2), this.pointDiameter, this.pointDiameter);
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Add(rectangleF);
- this.saveSuccess = true;
- }
- pointCountC5[this.dataGridView1.SelectedCells[0].RowIndex]++;
- if (pointCountC5[this.dataGridView1.SelectedCells[0].RowIndex] > pointDrawCount - 1)
- pointCountC5[this.dataGridView1.SelectedCells[0].RowIndex] = pointDrawCount;
- }
- }
- }
- // 选择测量点
- else if (operationK == 1)
- {
- for (int i = 0; i < this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Count; i++)
- {
- if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].Contains(point1))
- {
- m_canMove = true;
- selected = i;
- this.m_StartPoint = point1;
- }
- }
- }
- // 删除测量点
- else if (operationK == 2)
- {
- int count = this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].Count;
- // 循环测量点矩形集合
- for (int i = count - 1; i >= 0; i--)
- {
- // 线条数为三
- if (this.linesNumber == 3)
- {
- // 鼠标在矩形内
- if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].Contains(point1))
- {
- // 第一条线
- if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing / 2)
- {
- pointCountA1[this.dataGridView1.SelectedCells[0].RowIndex]--;
- if (pointCountA1[this.dataGridView1.SelectedCells[0].RowIndex] < 0)
- pointCountA1[this.dataGridView1.SelectedCells[0].RowIndex] = 0;
- }
- // 第二条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing / 2
- && this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing / 2)
- {
- pointCountA2[this.dataGridView1.SelectedCells[0].RowIndex]--;
- if (pointCountA2[this.dataGridView1.SelectedCells[0].RowIndex] < 0)
- pointCountA2[this.dataGridView1.SelectedCells[0].RowIndex] = 0;
- }
- // 第三条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing / 2)
- {
- pointCountA3[this.dataGridView1.SelectedCells[0].RowIndex]--;
- if (pointCountA3[this.dataGridView1.SelectedCells[0].RowIndex] < 0)
- pointCountA3[this.dataGridView1.SelectedCells[0].RowIndex] = 0;
- }
- // 删除选择的矩形
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].RemoveAt(i);
- this.saveSuccess = true;
- break;
- }
- }
- // 线条数为四
- else if (this.linesNumber == 4)
- {
- // 鼠标在矩形内
- if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].Contains(point1))
- {
- // 第一条线
- if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 <= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing)
- {
- pointCountB1[this.dataGridView1.SelectedCells[0].RowIndex]--;
- if (pointCountB1[this.dataGridView1.SelectedCells[0].RowIndex] < 0)
- pointCountB1[this.dataGridView1.SelectedCells[0].RowIndex] = 0;
- }
- // 第二条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2
- && this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing)
- {
- pointCountB2[this.dataGridView1.SelectedCells[0].RowIndex]--;
- if (pointCountB2[this.dataGridView1.SelectedCells[0].RowIndex] < 0)
- pointCountB2[this.dataGridView1.SelectedCells[0].RowIndex] = 0;
- }
- // 第三条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing
- && this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2)
- {
- pointCountB3[this.dataGridView1.SelectedCells[0].RowIndex]--;
- if (pointCountB3[this.dataGridView1.SelectedCells[0].RowIndex] < 0)
- pointCountB3[this.dataGridView1.SelectedCells[0].RowIndex] = 0;
- }
- // 第四条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing)
- {
- pointCountB4[this.dataGridView1.SelectedCells[0].RowIndex]--;
- if (pointCountB4[this.dataGridView1.SelectedCells[0].RowIndex] < 0)
- pointCountB4[this.dataGridView1.SelectedCells[0].RowIndex] = 0;
- }
- // 删除选择的矩形
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].RemoveAt(i);
- this.saveSuccess = true;
- break;
- }
- }
- // 线条数为五
- else if (this.linesNumber == 5)
- {
- // 鼠标在矩形内
- if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].Contains(point1))
- {
- // 第一条线
- if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.lineSpacing / 2)
- {
- pointCountC1[this.dataGridView1.SelectedCells[0].RowIndex]--;
- if (pointCountC1[this.dataGridView1.SelectedCells[0].RowIndex] < 0)
- pointCountC1[this.dataGridView1.SelectedCells[0].RowIndex] = 0;
- }
- // 第二条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing / 2
- && this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing - this.lineSpacing / 2)
- {
- pointCountC2[this.dataGridView1.SelectedCells[0].RowIndex]--;
- if (pointCountC2[this.dataGridView1.SelectedCells[0].RowIndex] < 0)
- pointCountC2[this.dataGridView1.SelectedCells[0].RowIndex] = 0;
- }
- // 第三条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing / 2
- && this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 - this.lineSpacing / 2)
- {
- pointCountC3[this.dataGridView1.SelectedCells[0].RowIndex]--;
- if (pointCountC3[this.dataGridView1.SelectedCells[0].RowIndex] < 0)
- pointCountC3[this.dataGridView1.SelectedCells[0].RowIndex] = 0;
- }
- // 第四条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 < this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineSpacing / 2
- && this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing / 2)
- {
- pointCountC4[this.dataGridView1.SelectedCells[0].RowIndex]--;
- if (pointCountC4[this.dataGridView1.SelectedCells[0].RowIndex] < 0)
- pointCountC4[this.dataGridView1.SelectedCells[0].RowIndex] = 0;
- }
- // 第五条线
- else if (this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][i].X + this.pointDiameter / 2 >= this.documentWorkspace.CompositionSurface.Width / 2 + this.lineSpacing + this.lineSpacing / 2)
- {
- pointCountC5[this.dataGridView1.SelectedCells[0].RowIndex]--;
- if (pointCountC5[this.dataGridView1.SelectedCells[0].RowIndex] < 0)
- pointCountC5[this.dataGridView1.SelectedCells[0].RowIndex] = 0;
- }
- // 删除选择的矩形
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex].RemoveAt(i);
- this.saveSuccess = true;
- break;
- }
- }
- }
- }
- }
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 选择测量点移动
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void onMouseMove(object sender, MouseEventArgs e)
- {
- // 换算后的点
- PointF point1 = documentWorkspace.GetScalePoint(e.Location);
- if (e.Button == MouseButtons.Left && m_canMove)
- {
- RectangleF rectangleF = new RectangleF();
- rectangleF = this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][selected];
- // 矩形偏移
- rectangleF.Offset(0, point1.Y - this.m_StartPoint.Y);
- if (rectangleF.Bottom > this.documentWorkspace.CompositionSurface.Height + rectangleF.Height / 2)
- rectangleF.Y = this.documentWorkspace.CompositionSurface.Height - rectangleF.Height + rectangleF.Height / 2;
- if (rectangleF.Top < - rectangleF.Height / 2)
- rectangleF.Y = - rectangleF.Height / 2;
- if (point1.Y <= this.documentWorkspace.CompositionSurface.Height && point1.Y >= 0)
- this.m_StartPoint = point1;
- this.pointRectangleFs[this.dataGridView1.SelectedCells[0].RowIndex][selected] = rectangleF;
- this.saveSuccess = true;
- this.documentWorkspace.Refresh();
- }
- }
- /// <summary>
- /// 鼠标抬起(测量点不可移动)
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void onMouseUp(object sender, MouseEventArgs e)
- {
- m_canMove = false;
- }
- /// <summary>
- /// 添加测量点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button6_Click(object sender, EventArgs e)
- {
- if (dataGridView1.SelectedRows.Count == 0)
- return;
- operationK = 0;
- selected = -1;
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 失去焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button6_LostFocus(object sender, EventArgs e)
- {
- operationK = -1;
- selected = -1;
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 失去焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button7_LostFocus(object sender, EventArgs e)
- {
- operationK = -1;
- selected = -1;
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 失去焦点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button8_LostFocus(object sender, EventArgs e)
- {
- operationK = -1;
- selected = -1;
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 选择测量点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button8_Click(object sender, EventArgs e)
- {
- if (dataGridView1.SelectedRows.Count == 0)
- return;
- operationK = 1;
- }
- /// <summary>
- /// 删除测量点
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button7_Click(object sender, EventArgs e)
- {
- if (dataGridView1.SelectedRows.Count == 0)
- return;
- operationK = 2;
- selected = -1;
- this.documentWorkspace.Refresh();
- }
- /// <summary>
- /// 辅助线样式设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button9_Click(object sender, EventArgs e)
- {
- GuideStyleSettingsDialog guideStyleSettingsDialog = new GuideStyleSettingsDialog(this.lineChange);
- guideStyleSettingsDialog.StartPosition = FormStartPosition.CenterScreen;
- guideStyleSettingsDialog.ShowDialog(this);
- }
- /// <summary>
- /// 测量点样式设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button10_Click(object sender, EventArgs e)
- {
- SurveyPointStyleSettingDialog surveyPointStyleSettingDialog = new SurveyPointStyleSettingDialog();
- surveyPointStyleSettingDialog.StartPosition = FormStartPosition.CenterScreen;
- surveyPointStyleSettingDialog.ShowDialog(this);
- }
- /// <summary>
- /// 从XML获取数据
- /// </summary>
- private void GetDataFromXML()
- {
- workpieceMaintenanceModel = XmlSerializeHelper.DESerializer<WorkpieceMaintenanceModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\WorkpieceMaintenanceModel.xml", FileMode.Open));
- // 工件类型
- this.type = string.Empty;
- if (workpieceMaintenanceModel.Workpieces != null && this.comboBox1.DataSource != null)
- {
- for (int i = 0; i < workpieceMaintenanceModel.Workpieces.Count; i++)
- {
- if (workpieceMaintenanceModel.Workpieces[i].Name.Equals(this.comboBox1.SelectedValue))
- this.type = workpieceMaintenanceModel.Workpieces[i].Type;
- }
- if (this.type.Equals(constTypeA))
- pointDrawCount = 3;
- else if (this.type.Equals(constTypeB))
- pointDrawCount = 4;
- else if (this.type.Equals(constTypeC))
- pointDrawCount = 5;
- else if (this.type.Equals(constTypeD))
- pointDrawCount = 6;
- else if (this.type.Equals(constTypeE))
- pointDrawCount = 4;
- }
- }
- /// <summary>
- /// 选择样品更改
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void dataGridView1_SelectionChanged(object sender, EventArgs e)
- {
- if (this.dataGridView1.SelectedCells.Count > 0)
- {
- int dataTableIndex = 0;
- for (int i = 0; i < this.pointDataTables.Count; i++)
- {
- if (this.pointDataTables[i].TableName.Equals(this.dataGridView1.Rows[this.dataGridView1.SelectedCells[0].RowIndex].Cells[0].Value))
- dataTableIndex = i;
- }
- if (this.pointDataTables[dataTableIndex].Rows.Count > 0)
- {
- this.dataGridView2.Rows.Clear();
- this.dataGridView3.Rows.Clear();
- for (int r = 0; r < this.pointDataTables[dataTableIndex].Rows.Count; r++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewRow dgvr1 = new DataGridViewRow();
- foreach (DataGridViewColumn Column in this.dataGridView2.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- dgvr1.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < this.pointDataTables[dataTableIndex].Columns.Count; c++)
- {
- if(c > 1 && !this.pointDataTables[dataTableIndex].Rows[r][c].ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text")) && !string.IsNullOrEmpty(this.pointDataTables[dataTableIndex].Rows[r][c].ToString()))
- dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.pointDataTables[dataTableIndex].Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString();
- else
- dgvr.Cells[c].Value = this.pointDataTables[dataTableIndex].Rows[r][c].ToString();
- dgvr1.Cells[c].Value = this.pointDataTables[dataTableIndex].Rows[r][c].ToString();
- }
- this.dataGridView2.Rows.Add(dgvr);
- this.dataGridView3.Rows.Add(dgvr1);
- }
- int left;
- int right;
- string leftValue;
- string rightValue;
- for (int i = 0; i < this.dataGridView2.Rows.Count; i++)
- {
- left = this.dataGridView2.Rows[i].Cells[1].Value.ToString().IndexOf("%");
- right = this.dataGridView2.Rows[i].Cells[1].Value.ToString().IndexOf("-");
- leftValue = this.dataGridView2.Rows[i].Cells[1].Value.ToString().Substring(0, left);
- rightValue = this.dataGridView2.Rows[i].Cells[1].Value.ToString().Substring(right + 1);
- if (this.dataGridView2.Rows[i].Cells[2].Value.ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text"))
- || (!string.IsNullOrEmpty(this.dataGridView2.Rows[i].Cells[2].Value.ToString())
- && !this.dataGridView2.Rows[i].Cells[2].Value.ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text"))
- && (Convert.ToDecimal(this.dataGridView2.Rows[i].Cells[2].Value) > (Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || Convert.ToDecimal(this.dataGridView2.Rows[i].Cells[2].Value) < (Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))))
- this.dataGridView2.Rows[i].Cells[2].Style.BackColor = Color.Red;
- if (this.dataGridView2.Rows[i].Cells[3].Value.ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text"))
- || (!string.IsNullOrEmpty(this.dataGridView2.Rows[i].Cells[3].Value.ToString())
- && !this.dataGridView2.Rows[i].Cells[3].Value.ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text"))
- && (Convert.ToDecimal(this.dataGridView2.Rows[i].Cells[3].Value) > (Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || Convert.ToDecimal(this.dataGridView2.Rows[i].Cells[3].Value) < (Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))))
- this.dataGridView2.Rows[i].Cells[3].Style.BackColor = Color.Red;
- if (this.dataGridView2.Rows[i].Cells[4].Value.ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text"))
- || (!string.IsNullOrEmpty(this.dataGridView2.Rows[i].Cells[4].Value.ToString())
- && !this.dataGridView2.Rows[i].Cells[4].Value.ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text"))
- && (Convert.ToDecimal(this.dataGridView2.Rows[i].Cells[4].Value) > (Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || Convert.ToDecimal(this.dataGridView2.Rows[i].Cells[4].Value) < (Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))))
- this.dataGridView2.Rows[i].Cells[4].Style.BackColor = Color.Red;
- if (Convert.ToDecimal(this.dataGridView2.Rows[i].Cells[7].Value) > (Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || Convert.ToDecimal(this.dataGridView2.Rows[i].Cells[7].Value) < (Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))
- this.dataGridView2.Rows[i].Cells[7].Style.BackColor = Color.Red;
- if (this.linesNumber == 4)
- {
- if (this.dataGridView2.Rows[i].Cells[5].Value.ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text"))
- || (!string.IsNullOrEmpty(this.dataGridView2.Rows[i].Cells[5].Value.ToString())
- && !this.dataGridView2.Rows[i].Cells[5].Value.ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text"))
- && (Convert.ToDecimal(this.dataGridView2.Rows[i].Cells[5].Value) > (Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || Convert.ToDecimal(this.dataGridView2.Rows[i].Cells[5].Value) < (Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))))
- this.dataGridView2.Rows[i].Cells[5].Style.BackColor = Color.Red;
- }
- else if (this.linesNumber == 5)
- {
- if (this.dataGridView2.Rows[i].Cells[5].Value.ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text"))
- || (!string.IsNullOrEmpty(this.dataGridView2.Rows[i].Cells[5].Value.ToString())
- && !this.dataGridView2.Rows[i].Cells[5].Value.ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text"))
- && (Convert.ToDecimal(this.dataGridView2.Rows[i].Cells[5].Value) > (Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || Convert.ToDecimal(this.dataGridView2.Rows[i].Cells[5].Value) < (Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))))
- this.dataGridView2.Rows[i].Cells[5].Style.BackColor = Color.Red;
- if (this.dataGridView2.Rows[i].Cells[6].Value.ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text"))
- || (!string.IsNullOrEmpty(this.dataGridView2.Rows[i].Cells[6].Value.ToString())
- && !this.dataGridView2.Rows[i].Cells[6].Value.ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text"))
- && (Convert.ToDecimal(this.dataGridView2.Rows[i].Cells[6].Value) > (Convert.ToDecimal(leftValue) + Convert.ToDecimal(rightValue))
- || Convert.ToDecimal(this.dataGridView2.Rows[i].Cells[6].Value) < (Convert.ToDecimal(leftValue) - Convert.ToDecimal(rightValue)))))
- this.dataGridView2.Rows[i].Cells[6].Style.BackColor = Color.Red;
- }
- }
- }
- this.documentWorkspace.Refresh();
- }
- }
- /// <summary>
- /// 显示测量点间距
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- this.documentWorkspace.Refresh();
- }
- private void dataGridView3_CellValueChanged(object sender, DataGridViewCellEventArgs e)
- {
- int dataTableIndex = 0;
- if (this.dataGridView3.Rows.Count > 0)
- {
- for (int i = 0; i < this.pointDataTables.Count; i++)
- {
- if (this.pointDataTables[i].TableName.Equals(this.dataGridView1.Rows[this.dataGridView1.SelectedCells[0].RowIndex].Cells[0].Value))
- dataTableIndex = i;
- }
- this.pointDataTables[dataTableIndex].Rows.Clear();
- for (int r = 0; r < this.dataGridView3.Rows.Count; r++)
- {
- DataRow dataRow = this.pointDataTables[dataTableIndex].NewRow();
- for (int c = 0; c < this.dataGridView3.Rows[r].Cells.Count; c++)
- {
- dataRow[this.dataGridView3.Columns[c].Name] = this.dataGridView3.Rows[r].Cells[c].Value;
- }
- this.pointDataTables[dataTableIndex].Rows.Add(dataRow);
- }
- }
- }
- /// <summary>
- /// 单元格修改验证
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
- {
- if(e.RowIndex >= 0)
- {
- string newValue = this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
- for (int i = 0; i < dataGridView1.Rows.Count; i++)
- {
- if (i != e.RowIndex && newValue.Equals(this.dataGridView1.Rows[i].Cells[0].Value.ToString()))
- {
- MessageBox.Show(PdnResources.GetString("Menu.Namealreadyexists.text")+"!");
- this.dataGridView1.Rows[e.RowIndex].Cells[0].Value = oldValue;
- return;
- }
- }
- foreach (DataTable item in this.pointDataTables)
- {
- if (item.TableName.Equals(oldValue))
- item.TableName = newValue;
- }
- this.saveSuccess = true;
- }
- }
- /// <summary>
- /// 获取单元格修改之前的值
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void dataGridView1_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
- {
- oldValue = this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
-
- }
- /// <summary>
- /// 保存结果
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button2_Click(object sender, EventArgs e)
- {
- SaveMeasurementResults();
- }
- /// <summary>
- /// 保存结果
- /// </summary>
- private void SaveMeasurementResults()
- {
- if (this.listView1.SelectedItems.Count > 0)
- {
- string imgName = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].GetFriendlyName();
- string tag = this.imageList1.Images.Keys[this.listView1.SelectedItems[0].Index];
- if (this.button3.Visible)
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleasestartmeasuring.text")+"!");
- return;
- }
- if (this.pointDataTables.Count > 0)
- {
- DataTable dataTable1 = new DataTable();
- bool replace = false;
- int add = 0;
- foreach (ListViewItem item in this.listView2.Items)
- {
- if (item.Name.Equals(tag))
- {
- add++;
- DialogResult dr = MessageBox.Show(PdnResources.GetString("Menu.Themeasurementdertoreplace.text")+"?", PdnResources.GetString("Menu.hint.text"), MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
- if (dr == DialogResult.OK)
- {
- replace = true;
- this.listView2.Items.Remove(item);
- }
- break;
- }
- }
- if (replace || this.listView2.Items.Count == 0 || add == 0)
- {
- this.dataGridView4.Rows.Clear();
- if (this.linesNumber == 3)
- {
- this.dataGridView4.Columns[7].Visible = false;
- this.dataGridView4.Columns[8].Visible = false;
- }
- else if (this.linesNumber == 4)
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = false;
- }
- else if (this.linesNumber == 5)
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = true;
- }
- ListViewItem listViewItem = new ListViewItem();
- listViewItem.Name = tag;
- listViewItem.SubItems[0].Text = imgName;
- listViewItem.Tag = "" + this.linesNumber;
- if (this.listView2.Items.Count == 0)
- this.listView2.Items.Add(listViewItem);
- else
- this.listView2.Items.Insert(0, listViewItem);
- dataTable1.TableName = tag;
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dataTable1.Columns.Add(c.HeaderText);
- }
- foreach (DataTable dataTable in this.pointDataTables)
- {
- for (int r = 0; r < dataTable.Rows.Count; r++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = tag;
- foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < dataTable.Columns.Count; c++)
- {
- dgvr.Cells[0].Value = imgName;
- dgvr.Cells[1].Value = dataTable.TableName;
- if (c > 1 && !dataTable.Rows[r][c].ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text")))
- {
- if (this.linesNumber == 3)
- {
- if (c + 2 != 7 && c + 2 != 8)
- dgvr.Cells[c + 2].Value = Math.Round((double)Convert.ToDecimal(dataTable.Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString();
- else
- dgvr.Cells[c + 2].Value = dataTable.Rows[r][c].ToString();
- }
- else if (this.linesNumber == 4)
- {
- if (c + 2 != 8)
- dgvr.Cells[c + 2].Value = Math.Round((double)Convert.ToDecimal(dataTable.Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString();
- else
- dgvr.Cells[c + 2].Value = dataTable.Rows[r][c].ToString();
- }
- else if (this.linesNumber == 5)
- {
- dgvr.Cells[c + 2].Value = Math.Round((double)Convert.ToDecimal(dataTable.Rows[r][c]), Convert.ToInt32(this.numericUpDown1.Value)).ToString();
- }
- }
- else
- dgvr.Cells[c + 2].Value = dataTable.Rows[r][c].ToString();
- }
- this.dataGridView4.Rows.Add(dgvr);
- DataRow dataRow = dataTable1.NewRow();
- for (int c = 0; c < dataTable.Columns.Count + 2; c++)
- {
- if (c == 0)
- dataRow[this.dataGridView4.Columns[c].HeaderText] = imgName;
- else if (c == 1)
- dataRow[this.dataGridView4.Columns[c].HeaderText] = dataTable.TableName;
- else
- dataRow[this.dataGridView4.Columns[c].HeaderText] = dataTable.Rows[r][c - 2].ToString();
- }
- dataTable1.Rows.Add(dataRow);
- }
- }
- foreach (DataTable dataTable2 in pictureDataTables)
- {
- if (dataTable2.TableName.Equals(dataTable1.TableName))
- {
- pictureDataTables.Remove(dataTable2);
- break;
- }
- }
- this.pictureDataTables.Add(dataTable1);
- if (this.allShow)
- AllShow();
- this.listView2.Items[0].Selected = true;
- this.saveSuccess = false;
- this.bitDic.Clear();
- foreach (var item in this.bitDic1)
- {
- this.bitDic.Add(item.Key, item.Value);
- }
- //拼接中间数据
- 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.Thesamplename.Text"));
- columnName.Add(PdnResources.GetString("Menu.Theintersectionsofthefirstline.Text"));
- columnName.Add(PdnResources.GetString("Menu.Theintersectionsofthesecondtline.Text"));
- columnName.Add(PdnResources.GetString("Menu.Theintersectionsofthethirdtline.Text"));
- if (this.linesNumber == 4)
- {
- columnName.Add(PdnResources.GetString("Menu.Theintersectionsoftheforthtline.Text"));
- }
- else if (this.linesNumber == 5)
- {
- columnName.Add(PdnResources.GetString("Menu.Theintersectionsoftheforthtline.Text"));
- columnName.Add(PdnResources.GetString("Menu.Theintersectionsofthefivthtline.Text"));
- }
- dataList.Add(columnName);
- string valuesL1 = string.Empty;
- string valuesL2 = string.Empty;
- string valuesL3 = string.Empty;
- string valuesL4 = string.Empty;
- string valuesL5 = string.Empty;
- int valueCt1 = 0;
- int valueCt2 = 0;
- int valueCt3 = 0;
- int valueCt4 = 0;
- int valueCt5 = 0;
- if (this.linesNumber == 3)
- {
- for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
- {
- valuesL1 = string.Empty;
- valuesL2 = string.Empty;
- valuesL3 = string.Empty;
- List<string> strList = new List<string>();
- strList.Add((i + 1).ToString());
- strList.Add(this.dataGridView1.Rows[i].Cells[0].Value.ToString());
- foreach (var lengthList in this.lengthL1[i])
- {
- if (this.lengthL1[i].Count == 1 || valueCt1 == this.lengthL1[i].Count - 1)
- valuesL1 += lengthList.ToString();
- else
- valuesL1 += lengthList.ToString() + ",";
- valueCt1++;
- }
- foreach (var lengthList in this.lengthL2[i])
- {
- if (this.lengthL2[i].Count == 1 || valueCt2 == this.lengthL2[i].Count - 1)
- valuesL2 += lengthList.ToString();
- else
- valuesL2 += lengthList.ToString() + ",";
- valueCt2++;
- }
- foreach (var lengthList in this.lengthL3[i])
- {
- if (this.lengthL3[i].Count == 1 || valueCt3 == this.lengthL3[i].Count - 1)
- valuesL3 += lengthList.ToString();
- else
- valuesL3 += lengthList.ToString() + ",";
- valueCt3++;
- }
- strList.Add(valuesL1);
- strList.Add(valuesL2);
- strList.Add(valuesL3);
- dataList.Add(strList);
- }
- }
- else if (this.linesNumber == 4)
- {
- for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
- {
- valuesL1 = string.Empty;
- valuesL2 = string.Empty;
- valuesL3 = string.Empty;
- valuesL4 = string.Empty;
- List<string> strList = new List<string>();
- strList.Add((i + 1).ToString());
- strList.Add(this.dataGridView1.Rows[i].Cells[0].Value.ToString());
- foreach (var lengthList in this.lengthL1[i])
- {
- if (this.lengthL1[i].Count == 1 || valueCt1 == this.lengthL1[i].Count - 1)
- valuesL1 += lengthList.ToString();
- else
- valuesL1 += lengthList.ToString() + ",";
- valueCt1++;
- }
- foreach (var lengthList in this.lengthL2[i])
- {
- if (this.lengthL2[i].Count == 1 || valueCt2 == this.lengthL2[i].Count - 1)
- valuesL2 += lengthList.ToString();
- else
- valuesL2 += lengthList.ToString() + ",";
- valueCt2++;
- }
- foreach (var lengthList in this.lengthL3[i])
- {
- if (this.lengthL3[i].Count == 1 || valueCt3 == this.lengthL3[i].Count - 1)
- valuesL3 += lengthList.ToString();
- else
- valuesL3 += lengthList.ToString() + ",";
- valueCt3++;
- }
- foreach (var lengthList in this.lengthL4[i])
- {
- if (this.lengthL4[i].Count == 1 || valueCt4 == this.lengthL4[i].Count - 1)
- valuesL4 += lengthList.ToString();
- else
- valuesL4 += lengthList.ToString() + ",";
- valueCt4++;
- }
- strList.Add(valuesL1);
- strList.Add(valuesL2);
- strList.Add(valuesL3);
- strList.Add(valuesL4);
- dataList.Add(strList);
- }
- }
- else if(this.linesNumber == 5)
- {
- for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
- {
- valuesL1 = string.Empty;
- valuesL2 = string.Empty;
- valuesL3 = string.Empty;
- valuesL4 = string.Empty;
- valuesL5 = string.Empty;
- List<string> strList = new List<string>();
- strList.Add((i + 1).ToString());
- strList.Add(this.dataGridView1.Rows[i].Cells[0].Value.ToString());
- foreach (var lengthList in this.lengthL1[i])
- {
- if (this.lengthL1[i].Count == 1 || valueCt1 == this.lengthL1[i].Count - 1)
- valuesL1 += lengthList.ToString();
- else
- valuesL1 += lengthList.ToString() + ",";
- valueCt1++;
- }
- foreach (var lengthList in this.lengthL2[i])
- {
- if (this.lengthL2[i].Count == 1 || valueCt2 == this.lengthL2[i].Count - 1)
- valuesL2 += lengthList.ToString();
- else
- valuesL2 += lengthList.ToString() + ",";
- valueCt2++;
- }
- foreach (var lengthList in this.lengthL3[i])
- {
- if (this.lengthL3[i].Count == 1 || valueCt3 == this.lengthL3[i].Count - 1)
- valuesL3 += lengthList.ToString();
- else
- valuesL3 += lengthList.ToString() + ",";
- valueCt3++;
- }
- foreach (var lengthList in this.lengthL4[i])
- {
- if (this.lengthL4[i].Count == 1 || valueCt4 == this.lengthL4[i].Count - 1)
- valuesL4 += lengthList.ToString();
- else
- valuesL4 += lengthList.ToString() + ",";
- valueCt4++;
- }
- foreach (var lengthList in this.lengthL5[i])
- {
- if (this.lengthL5[i].Count == 1 || valueCt5 == this.lengthL5[i].Count - 1)
- valuesL5 += lengthList.ToString();
- else
- valuesL5 += lengthList.ToString() + ",";
- valueCt5++;
- }
- strList.Add(valuesL1);
- strList.Add(valuesL2);
- strList.Add(valuesL3);
- strList.Add(valuesL4);
- strList.Add(valuesL5);
- 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);
- }
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseaddsamples.text")+"!");
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Pleaseselectapictureandmeasure.text")+"!");
- }
- }
- /// <summary>
- /// 切换测量记录
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void listView_SelectedIndexChanged(object sender, EventArgs e)
- {
- if(!this.allShow)
- {
- if (this.listView2.SelectedItems.Count > 0)
- {
- if(this.listView2.SelectedItems[0].Tag.ToString().Equals("3"))
- {
- this.dataGridView4.Columns[7].Visible = false;
- this.dataGridView4.Columns[8].Visible = false;
- }
- else if (this.listView2.SelectedItems[0].Tag.ToString().Equals("4"))
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = false;
- }
- else if (this.listView2.SelectedItems[0].Tag.ToString().Equals("5"))
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = true;
- }
- List<int> dataTableIndex = new List<int>();
- for (int i = 0; i < this.pictureDataTables.Count; i++)
- {
- foreach (ListViewItem item in this.listView2.SelectedItems)
- {
- if (this.pictureDataTables[i].TableName.Equals(item.Name))
- dataTableIndex .Add(i);
- }
- }
- this.dataGridView4.Rows.Clear();
- foreach (var item in dataTableIndex)
- {
- if (this.pictureDataTables[item].Rows.Count > 0)
- {
- for (int r = 0; r < this.pictureDataTables[item].Rows.Count; r++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = this.pictureDataTables[item].TableName;
- foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < this.pictureDataTables[item].Columns.Count; c++)
- {
- if (c > 3 && !this.pictureDataTables[item].Rows[r][c].ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text")) && !string.IsNullOrEmpty(this.pictureDataTables[item].Rows[r][c].ToString()))
- dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.pictureDataTables[item].Rows[r][c])
- , Convert.ToInt32(this.numericUpDown1.Value)).ToString();
- else
- dgvr.Cells[c].Value = this.pictureDataTables[item].Rows[r][c].ToString();
- }
- this.dataGridView4.Rows.Add(dgvr);
- }
- }
- }
- }
- }
- else
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = true;
- }
- }
- /// <summary>
- /// 全部显示
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button11_Click(object sender, EventArgs e)
- {
- this.allShow = true;
- this.button11.Visible = false;
- this.button16.Visible = true;
- AllShow();
- }
- private void AllShow()
- {
- this.dataGridView4.Rows.Clear();
- DataTable dataTable = new DataTable();
- foreach (DataTable item in this.pictureDataTables)
- {
- if (item.Columns.Count == 8)
- {
- this.dataGridView4.Columns[7].Visible = false;
- this.dataGridView4.Columns[8].Visible = false;
- }
- if (item.Columns.Count == 9)
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = false;
- }
- if (item.Columns.Count == 10)
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = true;
- }
- }
- for (int i = this.pictureDataTables.Count - 1; i >= 0; i--)
- {
- dataTable = this.pictureDataTables[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 > 3 && !dataTable.Rows[r][c].ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text")) && !string.IsNullOrEmpty(dataTable.Rows[r][c].ToString()))
- dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(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 button16_Click(object sender, EventArgs e)
- {
- this.allShow = false;
- this.button11.Visible = true;
- this.button16.Visible = false;
- if (this.listView2.SelectedItems.Count > 0)
- {
- if (this.listView2.SelectedItems[0].Tag.ToString().Equals("3"))
- {
- this.dataGridView4.Columns[7].Visible = false;
- this.dataGridView4.Columns[8].Visible = false;
- }
- else if (this.listView2.SelectedItems[0].Tag.ToString().Equals("4"))
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = false;
- }
- else if (this.listView2.SelectedItems[0].Tag.ToString().Equals("5"))
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = true;
- }
- List<int> dataTableIndex = new List<int>();
- for (int i = 0; i < this.pictureDataTables.Count; i++)
- {
- foreach (ListViewItem item in this.listView2.SelectedItems)
- {
- if (this.pictureDataTables[i].TableName.Equals(item.Name))
- dataTableIndex.Add(i);
- }
- }
- this.dataGridView4.Rows.Clear();
- foreach (var item in dataTableIndex)
- {
- if (this.pictureDataTables[item].Rows.Count > 0)
- {
- for (int r = 0; r < this.pictureDataTables[item].Rows.Count; r++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = this.pictureDataTables[item].TableName;
- foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < this.pictureDataTables[item].Columns.Count; c++)
- {
- if (c > 3 && !this.pictureDataTables[item].Rows[r][c].ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text")) && !string.IsNullOrEmpty(this.pictureDataTables[item].Rows[r][c].ToString()))
- dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.pictureDataTables[item].Rows[r][c])
- , Convert.ToInt32(this.numericUpDown1.Value)).ToString();
- else
- dgvr.Cells[c].Value = this.pictureDataTables[item].Rows[r][c].ToString();
- }
- this.dataGridView4.Rows.Add(dgvr);
- }
- }
- }
- }
- else
- {
- if (this.listView2.Items.Count >0 )
- {
- this.listView2.Items[0].Selected = true;
- }
-
- if (this.pictureDataTables.Count > 0
- && this.pictureDataTables[this.pictureDataTables.Count - 1].Rows.Count > 0)
- {
- this.dataGridView4.Rows.Clear();
- for (int r = 0; r < this.pictureDataTables[this.pictureDataTables.Count - 1].Rows.Count; r++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = this.pictureDataTables[this.pictureDataTables.Count - 1].TableName;
- foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < this.pictureDataTables[this.pictureDataTables.Count - 1].Columns.Count; c++)
- {
- if (c > 3 && !this.pictureDataTables[this.pictureDataTables.Count - 1].Rows[r][c].ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text")) && !string.IsNullOrEmpty(this.pictureDataTables[this.pictureDataTables.Count - 1].Rows[r][c].ToString()))
- dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.pictureDataTables[this.pictureDataTables.Count - 1].Rows[r][c])
- , Convert.ToInt32(this.numericUpDown1.Value)).ToString();
- else
- dgvr.Cells[c].Value = this.pictureDataTables[this.pictureDataTables.Count - 1].Rows[r][c].ToString();
- }
- this.dataGridView4.Rows.Add(dgvr);
- }
- }
- }
- }
- /// <summary>
- /// 导出结果Excel
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button14_Click(object sender, EventArgs e)
- {
- if(this.listView2.Items.Count > 0)
- {
- SaveFileDialog exe = new SaveFileDialog();
- exe.Filter = "Execl files (*.xlsx)|*.xlsx";
- exe.FilterIndex = 0;
- exe.RestoreDirectory = true;
- exe.Title = "Export Excel File";
- exe.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
- exe.FileName = DateTime.Now.ToString("yyyyMMddhhmmss") + PdnResources.GetString("Menu.DedicatedAnalysis.NonferrousMetal.RecombinationRate.Text")+ PdnResources.GetString("Menu.Analysisresult.text");
- DialogResult dr = exe.ShowDialog();
- if (dr == DialogResult.OK)
- {
- DataTable dtb = new DataTable();
- foreach (DataGridViewColumn c in this.dataGridView4.Columns)
- {
- dtb.Columns.Add(c.HeaderText);
- }
- for (int r = 0; r < this.dataGridView4.Rows.Count; r++)
- {
- DataRow dataRow = dtb.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;
- }
- dtb.Rows.Add(dataRow);
- }
- List<DataTable> list = new List<DataTable>();
- list.Add(dtb);
- this.appWorkspace.ExportDataToExcelWithProgress(list, exe.FileName, true, false, true);
- }
- }
- else
- {
- MessageBox.Show(PdnResources.GetString("Menu.Noanalysisresults.text")+"!");
- }
- }
- /// <summary>
- /// 小数
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown1_ValueChanged(object sender, EventArgs e)
- {
- this.decimalCls = (int)this.numericUpDown1.Value;
- this.documentWorkspace.Refresh();
- RefreshDataGridView4();
- }
- /// <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)
- {
- if (this.listView2.SelectedItems[0].Tag.ToString().Equals("3"))
- {
- this.dataGridView4.Columns[7].Visible = false;
- this.dataGridView4.Columns[8].Visible = false;
- }
- else if (this.listView2.SelectedItems[0].Tag.ToString().Equals("4"))
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = false;
- }
- else if (this.listView2.SelectedItems[0].Tag.ToString().Equals("5"))
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = true;
- }
- 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.Name.ToString());
- this.listView2.Items.Remove(item);
- }
- foreach (string item in detaleName)
- {
- foreach (DataTable dataTable in this.pictureDataTables)
- {
- if (dataTable.TableName.Equals(item))
- {
- this.pictureDataTables.Remove(dataTable);
- break;
- }
- }
- }
- foreach (string tag in detaleName)
- {
- for (int i = 0; i < bitDic.Count; i++)
- {
- foreach (var item in bitDic)
- {
- string keyDe = item.Key.Substring(0, item.Key.IndexOf("|"));
- if (tag.Equals(keyDe))
- {
- bitDic.Remove(item.Key);
- break;
- }
- }
- }
- foreach (ExportProjectModel model in this.tempDataModel)
- {
- if (model.tagName.Equals(tag))
- {
- this.tempDataModel.Remove(model);
- break;
- }
- }
- }
- 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)
- {
- if (this.listView2.SelectedItems[0].Tag.ToString().Equals("3"))
- {
- this.dataGridView4.Columns[7].Visible = false;
- this.dataGridView4.Columns[8].Visible = false;
- }
- else if (this.listView2.SelectedItems[0].Tag.ToString().Equals("4"))
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = false;
- }
- else if (this.listView2.SelectedItems[0].Tag.ToString().Equals("5"))
- {
- this.dataGridView4.Columns[7].Visible = true;
- this.dataGridView4.Columns[8].Visible = true;
- }
- List<int> dataTableIndex = new List<int>();
- for (int i = 0; i < this.pictureDataTables.Count; i++)
- {
- foreach (ListViewItem item in this.listView2.SelectedItems)
- {
- if (this.pictureDataTables[i].TableName.Equals(item.Name))
- dataTableIndex.Add(i);
- }
- }
- this.dataGridView4.Rows.Clear();
- foreach (var item in dataTableIndex)
- {
- if (this.pictureDataTables[item].Rows.Count > 0)
- {
- for (int r = 0; r < this.pictureDataTables[item].Rows.Count; r++)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- dgvr.Tag = this.pictureDataTables[item].TableName;
- foreach (DataGridViewColumn Column in this.dataGridView4.Columns)
- {
- dgvr.Cells.Add(Column.CellTemplate.Clone() as DataGridViewCell);
- }
- for (int c = 0; c < this.pictureDataTables[item].Columns.Count; c++)
- {
- if (c > 3 && !this.pictureDataTables[item].Rows[r][c].ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text")) && !string.IsNullOrEmpty(this.pictureDataTables[item].Rows[r][c].ToString()))
- dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(this.pictureDataTables[item].Rows[r][c])
- , Convert.ToInt32(this.numericUpDown1.Value)).ToString();
- else
- dgvr.Cells[c].Value = this.pictureDataTables[item].Rows[r][c].ToString();
- }
- this.dataGridView4.Rows.Add(dgvr);
- }
- }
- }
- }
- }
- else
- {
- this.dataGridView4.Rows.Clear();
- DataTable dataTable = new DataTable();
- for (int i = this.pictureDataTables.Count - 1; i >= 0; i--)
- {
- dataTable = this.pictureDataTables[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 > 3 && !dataTable.Rows[r][c].ToString().Equals(PdnResources.GetString("Menu.Alittleless.Text")) && !string.IsNullOrEmpty(dataTable.Rows[r][c].ToString()))
- dgvr.Cells[c].Value = Math.Round((double)Convert.ToDecimal(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 button13_Click(object sender, EventArgs e)
- {
- if (this.checkBox2.Checked)
- {
- AnalyzeSettingDialog recombinationRateSetDialog = new AnalyzeSettingDialog(this, "Template.Manager.item3.RecombinationRate");
- 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>>();
- if (this.linesNumber == 3)
- {
- 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);
- content1.Add(this.dataGridView4.Columns[6].HeaderText);
- content1.Add(this.dataGridView4.Columns[9].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());
- content1.Add(this.dataGridView4.Rows[i].Cells[6].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[9].Value.ToString());
- analysisContent.Add(content1);
- }
- }
- else if (this.linesNumber == 4)
- {
- 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);
- content1.Add(this.dataGridView4.Columns[6].HeaderText);
- content1.Add(this.dataGridView4.Columns[7].HeaderText);
- content1.Add(this.dataGridView4.Columns[9].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());
- content1.Add(this.dataGridView4.Rows[i].Cells[6].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[7].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[9].Value.ToString());
- analysisContent.Add(content1);
- }
- }
- else if (this.linesNumber == 5)
- {
- 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);
- content1.Add(this.dataGridView4.Columns[6].HeaderText);
- content1.Add(this.dataGridView4.Columns[7].HeaderText);
- content1.Add(this.dataGridView4.Columns[8].HeaderText);
- content1.Add(this.dataGridView4.Columns[9].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());
- content1.Add(this.dataGridView4.Rows[i].Cells[6].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[7].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[8].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[9].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 (DataGridViewRow itemRow in this.dataGridView4.Rows)
- {
- foreach (ListViewItem item in this.listView2.SelectedItems)
- {
- if (bitDic.ContainsKey(item.Name + "|" + itemRow.Cells[1].Value.ToString()) && itemRow.Tag.Equals(item.Name))
- {
- bitList.Add(bitDic[item.Name + "|" + itemRow.Cells[1].Value.ToString()][0]);
- bitList.Add(bitDic[item.Name + "|" + itemRow.Cells[1].Value.ToString()][1]);
- }
- }
- }
- }
- }
- this.appWorkspace.CreateAnalysisReport(this.analyzeSettingModel, analysisContent, bitList, tagInfos);
- }
- else
- MessageBox.Show(PdnResources.GetString("Menu.Pleasesettheanalysisreportfirst.text")+"!");
- }
- private void listView2_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
- {
- if(!this.allShow)
- {
- if (this.listView2.SelectedItems.Count == 0)
- this.dataGridView4.Rows.Clear();
- }
- }
- /// <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;
- }
- }
- }
- }
- }
- /// <summary>
- /// 导出项目
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button17_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.NonferrousMetal.RecombinationRate.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>>();
- if (this.linesNumber == 3)
- {
- 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);
- content1.Add(this.dataGridView4.Columns[6].HeaderText);
- content1.Add(this.dataGridView4.Columns[9].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());
- content1.Add(this.dataGridView4.Rows[i].Cells[6].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[9].Value.ToString());
- analysisContent.Add(content1);
- }
- }
- else if (this.linesNumber == 4)
- {
- 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);
- content1.Add(this.dataGridView4.Columns[6].HeaderText);
- content1.Add(this.dataGridView4.Columns[7].HeaderText);
- content1.Add(this.dataGridView4.Columns[9].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());
- content1.Add(this.dataGridView4.Rows[i].Cells[6].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[7].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[9].Value.ToString());
- analysisContent.Add(content1);
- }
- }
- else if (this.linesNumber == 5)
- {
- 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);
- content1.Add(this.dataGridView4.Columns[6].HeaderText);
- content1.Add(this.dataGridView4.Columns[7].HeaderText);
- content1.Add(this.dataGridView4.Columns[8].HeaderText);
- content1.Add(this.dataGridView4.Columns[9].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());
- content1.Add(this.dataGridView4.Rows[i].Cells[6].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[7].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[8].Value.ToString());
- content1.Add(this.dataGridView4.Rows[i].Cells[9].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 (DataGridViewRow itemRow in this.dataGridView4.Rows)
- {
- foreach (ListViewItem itemL2 in this.listView2.SelectedItems)
- {
- if (bitDic.ContainsKey(itemL2.Name + "|" + itemRow.Cells[1].Value.ToString()))
- {
- bitList.Add(bitDic[itemL2.Name + "|" + itemRow.Cells[1].Value.ToString()][0]);
- bitList.Add(bitDic[itemL2.Name + "|" + itemRow.Cells[1].Value.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.Name))
- {
- 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)
- {
- }
- }
- #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;
- foreach (var item in this.analysisModel.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.analysisModel.ListParam.Add(analysisItem);
- }
- }
- /// <summary>
- /// 保存界面中的参数到model
- /// </summary>
- private void saveDialogParamValues()
- {
- saveParamValue(ParamKey_ShowData, checkBox1.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//显示数据
- saveParamValue(ParamKey_Report, checkBox2.Checked ? "0" : "1", (int)Base.Dtryt.Boolean);//报告设置
- saveParamValue(ParamKey_DecimalPlace, numericUpDown1 != null ? numericUpDown1.Value.ToString() : "", (int)Base.Dtryt.Decimal);//保留小数位数
- }
- /// <summary>
- /// 获取保存的参数
- /// </summary>
- private void GetListParamModel()
- {
- if (this.analysisModel != null)
- {
- for (int i = 0; i < this.analysisModel.ListParam.Count; i++)
- {
- switch (this.analysisModel.ListParam[i].param_key)
- {
- case ParamKey_ShowData:
- checkBox1.Checked = (Boolean)this.analysisModel.ListParam[i].value;
- break;
- case ParamKey_Report:
- checkBox2.Checked = (Boolean)this.analysisModel.ListParam[i].value;
- break;
- case ParamKey_DecimalPlace:
- numericUpDown1.Value = decimal.Parse(this.analysisModel.ListParam[i].param_value);
- break;
- }
- }
- }
- }
- /// <summary>
- /// 关闭窗体时保存参数
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void RecombinationRateDialog_FormClosing(object sender, FormClosingEventArgs e)
- {
- #region [开启脚本录制]
- if (appWorkspace.startScriptRecording)
- {
- getScriptRecording();
- }
- #endregion
- 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.analysisModel.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);
- }
- #endregion
- #region [脚本相关]
- private void getValue(string key, object value)
- {
- switch (key)
- {
- case "parameter1":
- checkBox1.Checked = Convert.ToBoolean(value);
- break;
- case "OpenWhileExportReport":
- checkBox2.Checked = Convert.ToBoolean(value);
- break;
- case "CalculatorDecimalDigits":
- numericUpDown1.Value = Convert.ToDecimal(value);
- break;
- }
- }
- #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);
- }
- appWorkspace.SetScriptStartRecording(this.menuId, menuName, args);
- }
- private object setScriptRecording(string key)
- {
- object value = null;
- switch (key)
- {
- case "parameter1":
- value = checkBox1.Checked;
- break;
- case "OpenWhileExportReport":
- value = checkBox2.Checked;
- break;
- case "CalculatorDecimalDigits":
- value = numericUpDown1.Value;
- break;
- }
- return value;
- }
- #endregion
- }
- }
|