123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529 |
- 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>
- /// 选中图片的bitmap
- /// </summary>
- private Bitmap bitmap;
- /// <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(bitmap, 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 Bitmap bitmap;
- public GraphicsList graphicsList;
- public List<PhaseModel> phaseModels;
- public AnalysisResult analysisResult;
- public DocumentItem(Bitmap bitmap, GraphicsList graphicsList, List<PhaseModel> phaseModels)
- {
- this.bitmap = bitmap;
- 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);
- this.bitmap = this.appWorkspace.DocumentWorkspaces[this.listView1.FocusedItem.Index].CompositionSurface.CreateAliasedBitmap();
- Document document = Document.FromImage(bitmap);
- 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.FromImage(this.documentItems[this.listView1.FocusedItem.Index].bitmap);
- 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.BackColor = SystemColors.ControlLightLight;
- }
- /// <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.BackColor = 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
- {
- 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
- }
- }
|