12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392 |
- using Metis.ParameterSet;
- using PaintDotNet;
- using PaintDotNet.Annotation;
- using PaintDotNet.Annotation.Enum;
- using PaintDotNet.Annotation.Measure;
- using PaintDotNet.Base.CommTool;
- using PaintDotNet.Base.SettingModel;
- using PaintDotNet.Menus;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace Metis.Measuring
- {
- internal partial class GeometryMeasureDialog : FloatingToolForm
- {
- /// <summary>
- /// 展开前宽度
- /// </summary>
- private int smallHeight = 339;
- /// <summary>
- /// 展开后宽度
- /// </summary>
- private int bigHelght = 996;
- /// <summary>
- /// 是否展开
- /// </summary>
- private bool isEnlarge = false;
- /// <summary>
- /// 测量属性实体
- /// </summary>
- private MeasureListSetModel measureListSetModel;
- private ImageList imageList1 = new ImageList();
- /// <summary>
- /// 工具集合
- /// </summary>
- private List<string> toolNameList = new List<string>();
- /// <summary>
- /// 工具别名集合
- /// </summary>
- private List<string> toolNickNameList = new List<string>();
- private Dictionary<int, List<ListViewItem>> filterDict = new Dictionary<int, List<ListViewItem>>();
- private AppWorkspace appWorkspace;
- DocumentWorkspaceWindow _p2Document => MeasureActionMenu._p2Form?._document;
- private MeasureListInteractiveDataModel measureListInteractiveDataModel;
- private MeasureStyleModel measureStyleModel = Startup.instance.measureStyleModel;
- /// <summary>
- /// 多值类型
- /// </summary>
- private List<string> moreTypeList = new List<string>() { "MeasureMulLine", "MeasureMulHVLine", "MeasureMulSegment", "MeasureMulVLine",
- "MeasureMulPLine", "MeasureHMulPLine","MeasureVMulPLine","MeasureMulParallelLine","MeasureVMulParallelLine","MeasureHMulParallelLine", };
- #region 控件
- private GroupBox groupBox2;
- private GroupBox groupBox3;
- private Label label1;
- private ComboBox comboBox1;
- private Label label6;
- private Label label5;
- private Label label4;
- private Label label3;
- private Label label2;
- public NumericUpDown numericUpDown5;
- private Button button3;
- private Button button2;
- private Button button1;
- private GroupBox groupBox4;
- private GroupBox groupBox5;
- private GroupBox groupBox6;
- private GroupBox groupBox7;
- private GroupBox groupBox8;
- private Button button4;
- private PaintDotNet.CustomControl.TreeViewEnhanced treeView1;
- private PaintDotNet.CustomControl.TreeViewEnhanced treeView2;
- private Button button8;
- private Button button7;
- private Button button6;
- private Button button5;
- private Button button12;
- private Button button11;
- private Button button10;
- private Button button9;
- private ListView listView2;
- private RadioButton radioButton8;
- private RadioButton radioButton7;
- private RadioButton radioButton6;
- private RadioButton radioButton5;
- private RadioButton radioButton4;
- private RadioButton radioButton3;
- private RadioButton radioButton2;
- private RadioButton radioButton1;
- private TextBox textBox2;
- private TextBox textBox1;
- private TextBox textBox4;
- private TextBox textBox3;
- private TextBox textBox8;
- private TextBox textBox7;
- private TextBox textBox6;
- private TextBox textBox5;
- private ListView listView1;
- private GroupBox groupBox1;
- #endregion
- public GeometryMeasureDialog(AppWorkspace appWorkspace)
- {
- InitializeComponent();
- InitializeLanguageText();
- this.Width = this.smallHeight;
- this.textBox1.Focus();
- this.appWorkspace = appWorkspace;
- this.comboBox1.SelectedIndex = 0;
- #region [初始化listView1]
- this.listView1.View = View.Details;
- ColumnHeader header1 = new ColumnHeader();
- header1.Text = PdnResources.GetString("Menu.params.text");
- header1.TextAlign = HorizontalAlignment.Center;
- header1.Width = 0;
- this.listView1.Columns.Add(header1);
- ColumnHeader header5 = new ColumnHeader();
- header5.Text = PdnResources.GetString("Menu.params.text");
- header5.TextAlign = HorizontalAlignment.Center;
- header5.Width = 73;
- this.listView1.Columns.Add(header5);
- ColumnHeader header2 = new ColumnHeader();
- header2.Text = PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text");
- header2.TextAlign = HorizontalAlignment.Center;
- header2.Width = 73;
- this.listView1.Columns.Add(header2);
- ColumnHeader header3 = new ColumnHeader();
- header3.Text = PdnResources.GetString("Menu.TheAngle.text");
- header3.TextAlign = HorizontalAlignment.Center;
- header3.Width = 73;
- this.listView1.Columns.Add(header3);
- ColumnHeader header4 = new ColumnHeader();
- header4.Text = PdnResources.GetString("Menu.area.text");
- header4.TextAlign = HorizontalAlignment.Center;
- header4.Width = 73;
- this.listView1.Columns.Add(header4);
- this.imageList1.ImageSize = new System.Drawing.Size(2, 30);
- this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
- this.listView1.SmallImageList = this.imageList1;
- #endregion
- #region [初始化listView2]
- this.listView2.View = View.Details;
- ColumnHeader header = new ColumnHeader();
- header.Text = PdnResources.GetString("Menu.Type.text");
- header.TextAlign = HorizontalAlignment.Center;
- header.Width = 70;
- this.listView2.Columns.Add(header);
- this.imageList1.ImageSize = new System.Drawing.Size(2, 30);
- this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
- this.listView2.SmallImageList = this.imageList1;
- #endregion
- #region [获取测量属性实体]
- measureListSetModel = XmlSerializeHelper.DESerializer<MeasureListSetModel>(FileOperationHelper.ReadStringFromFile(System.Windows.Forms.Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\MeasureListInteractiveModel.xml", FileMode.Open));
- #endregion
- #region [数据属性初始化]
- this.treeView1.ItemHeight = 18;
- this.treeView2.ItemHeight = 18;
- this.allDataTree();
- #endregion
- #region [元素属性初始化]
- this.allToolTree();
- #endregion
- #region [默认展示长度及角度]
- if (this.appWorkspace.Units == null)
- {
- label3.Text = "µm";
- }
- else
- {
- switch (this.appWorkspace.Units)
- {
- case MeasurementUnit.Inch://英寸
- label3.Text = "in";
- break;
- case MeasurementUnit.Mil://米尔
- label3.Text = "mil";
- break;
- case MeasurementUnit.Centimeter://厘米
- label3.Text = "cm";
- break;
- case MeasurementUnit.Millimeter://毫米
- label3.Text = "mm";
- break;
- case MeasurementUnit.Micron://微米
- label3.Text = "µm";
- break;
- case MeasurementUnit.Nano://纳米
- label3.Text = "nm";
- break;
- default:
- label3.Text = "µm";
- break;
- }
- }
- MeasureStyleModel model = XmlSerializeHelper.DESerializer<MeasureStyleModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Measure\\" + Startup.instance.configModel.MeasurementStyle, FileMode.Open));
- label5.Text = model.measureThreePointAngle.isAngle ? PdnResources.GetString("GeometryMeasure.mil") : PdnResources.GetString("Menu.degree.Text");
- #endregion
- #region [获取参数]
- this.getLastData();
- #endregion
- this.appWorkspace.ActiveDocumentWorkspaceChanged += new EventHandler(RefreshListView);
- this.FormClosing += new FormClosingEventHandler(this.saveLastData);
- }
- private new void InitializeLanguageText()
- {
- //this.groupBox13.Text = PdnResources.GetString("Menu.Puzzleeffect.text");
- this.groupBox8.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.Focus.text");
- this.comboBox1.Items.AddRange(new object[] {
- PdnResources.GetString("GeometryMeasure.Whole"),
- PdnResources.GetString("GeometryMeasure.SingleValue"),
- PdnResources.GetString("GeometryMeasure.Multivalued")});
- this.groupBox1.Text = PdnResources.GetString("Menu.Tools.ToolsFast.Text");
- this.radioButton8.Text = PdnResources.GetString("Menu.Isnotset.Text");
- this.radioButton7.Text = PdnResources.GetString("Menu.Isnotset.Text");
- this.radioButton6.Text = PdnResources.GetString("Menu.Isnotset.Text");
- this.radioButton5.Text = PdnResources.GetString("Menu.Isnotset.Text");
- this.radioButton4.Text = PdnResources.GetString("Menu.Isnotset.Text");
- this.radioButton3.Text = PdnResources.GetString("Menu.Isnotset.Text");
- this.radioButton2.Text = PdnResources.GetString("Menu.Isnotset.Text");
- this.radioButton1.Text = PdnResources.GetString("Menu.Isnotset.Text");
- this.groupBox2.Text = PdnResources.GetString("MeasureAction.DataSheet");
- this.label1.Text = PdnResources.GetString("Menu.filter.text") + ":";
- this.groupBox3.Text = PdnResources.GetString("Menu.operation.text");
- this.button3.Text = PdnResources.GetString("Menu.Edit.Delete.Text");
- this.button2.Text = PdnResources.GetString("Menu.Empty.text");
- this.button1.Text = PdnResources.GetString("MeasureAction.output");
- this.label6.Text = PdnResources.GetString("MeasureAction.DecimalPlaces") + ":";
- this.label5.Text = PdnResources.GetString("Menu.degree.Text");
- this.label4.Text = PdnResources.GetString("Menu.TheAngle.text") + ":";
- this.label2.Text = PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text") + ":";
- this.groupBox4.Text = PdnResources.GetString("Menu.Tools.ToolsFast.Text");
- this.groupBox5.Text = PdnResources.GetString("Menu.Dataattrs.text");
- this.groupBox6.Text = PdnResources.GetString("Menu.Tools.Text");
- this.button8.Text = PdnResources.GetString("Menu.down.Text");
- this.button7.Text = PdnResources.GetString("Menu.upward.Text");
- this.button6.Text = ">" + PdnResources.GetString("MeasureAction.Remove");
- this.button5.Text = "<" + PdnResources.GetString("Menu.Addto.text");
- this.groupBox7.Text = PdnResources.GetString("MeasureAction.Data");
- this.button12.Text = PdnResources.GetString("Menu.down.Text");
- this.button11.Text = PdnResources.GetString("Menu.upward.Text");
- this.button10.Text = ">" + PdnResources.GetString("MeasureAction.Remove");
- this.button9.Text = "<" + PdnResources.GetString("Menu.Addto.text");
- this.groupBox8.Text = PdnResources.GetString("Menu.Imagement.Measurementlist.Elementattributes.text");
- this.Text = PdnResources.GetString("MeasureAction.InteractiveMeasurement");
- }
- private void InitializeComponent()
- {
- this.groupBox1 = new System.Windows.Forms.GroupBox();
- this.textBox8 = new System.Windows.Forms.TextBox();
- this.textBox7 = new System.Windows.Forms.TextBox();
- this.textBox6 = new System.Windows.Forms.TextBox();
- this.textBox5 = new System.Windows.Forms.TextBox();
- this.textBox2 = new System.Windows.Forms.TextBox();
- this.textBox1 = new System.Windows.Forms.TextBox();
- this.textBox4 = new System.Windows.Forms.TextBox();
- this.textBox3 = new System.Windows.Forms.TextBox();
- this.radioButton8 = new System.Windows.Forms.RadioButton();
- this.radioButton7 = new System.Windows.Forms.RadioButton();
- this.radioButton6 = new System.Windows.Forms.RadioButton();
- this.radioButton5 = new System.Windows.Forms.RadioButton();
- this.radioButton4 = new System.Windows.Forms.RadioButton();
- this.radioButton3 = new System.Windows.Forms.RadioButton();
- this.radioButton2 = new System.Windows.Forms.RadioButton();
- this.radioButton1 = new System.Windows.Forms.RadioButton();
- this.groupBox2 = new System.Windows.Forms.GroupBox();
- this.listView1 = new System.Windows.Forms.ListView();
- this.comboBox1 = new System.Windows.Forms.ComboBox();
- this.label1 = new System.Windows.Forms.Label();
- this.groupBox3 = new System.Windows.Forms.GroupBox();
- this.button4 = new System.Windows.Forms.Button();
- this.button3 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.button1 = new System.Windows.Forms.Button();
- this.numericUpDown5 = new System.Windows.Forms.NumericUpDown();
- this.label6 = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
- this.label4 = new System.Windows.Forms.Label();
- this.label3 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.groupBox4 = new System.Windows.Forms.GroupBox();
- this.listView2 = new System.Windows.Forms.ListView();
- this.groupBox5 = new System.Windows.Forms.GroupBox();
- this.treeView1 = new PaintDotNet.CustomControl.TreeViewEnhanced();
- this.groupBox6 = new System.Windows.Forms.GroupBox();
- this.button8 = new System.Windows.Forms.Button();
- this.button7 = new System.Windows.Forms.Button();
- this.button6 = new System.Windows.Forms.Button();
- this.button5 = new System.Windows.Forms.Button();
- this.groupBox7 = new System.Windows.Forms.GroupBox();
- this.button12 = new System.Windows.Forms.Button();
- this.button11 = new System.Windows.Forms.Button();
- this.button10 = new System.Windows.Forms.Button();
- this.button9 = new System.Windows.Forms.Button();
- this.groupBox8 = new System.Windows.Forms.GroupBox();
- this.treeView2 = new PaintDotNet.CustomControl.TreeViewEnhanced();
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.groupBox3.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).BeginInit();
- this.groupBox4.SuspendLayout();
- this.groupBox5.SuspendLayout();
- this.groupBox6.SuspendLayout();
- this.groupBox7.SuspendLayout();
- this.groupBox8.SuspendLayout();
- this.SuspendLayout();
- //
- // groupBox1
- //
- this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox1.Controls.Add(this.textBox8);
- this.groupBox1.Controls.Add(this.textBox7);
- this.groupBox1.Controls.Add(this.textBox6);
- this.groupBox1.Controls.Add(this.textBox5);
- this.groupBox1.Controls.Add(this.textBox2);
- this.groupBox1.Controls.Add(this.textBox1);
- this.groupBox1.Controls.Add(this.textBox4);
- this.groupBox1.Controls.Add(this.textBox3);
- this.groupBox1.Controls.Add(this.radioButton8);
- this.groupBox1.Controls.Add(this.radioButton7);
- this.groupBox1.Controls.Add(this.radioButton6);
- this.groupBox1.Controls.Add(this.radioButton5);
- this.groupBox1.Controls.Add(this.radioButton4);
- this.groupBox1.Controls.Add(this.radioButton3);
- this.groupBox1.Controls.Add(this.radioButton2);
- this.groupBox1.Controls.Add(this.radioButton1);
- this.groupBox1.Location = new System.Drawing.Point(8, 3);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(310, 181);
- this.groupBox1.TabIndex = 3;
- this.groupBox1.TabStop = false;
- this.groupBox1.Text = "快捷工具";
- //
- // textBox8
- //
- this.textBox8.Location = new System.Drawing.Point(238, 130);
- this.textBox8.Name = "textBox8";
- this.textBox8.ReadOnly = true;
- this.textBox8.Size = new System.Drawing.Size(61, 21);
- this.textBox8.TabIndex = 15;
- this.textBox8.Leave += new System.EventHandler(this.textBox1_TextChanged);
- //
- // textBox7
- //
- this.textBox7.Location = new System.Drawing.Point(83, 130);
- this.textBox7.Name = "textBox7";
- this.textBox7.ReadOnly = true;
- this.textBox7.Size = new System.Drawing.Size(70, 21);
- this.textBox7.TabIndex = 14;
- this.textBox7.Leave += new System.EventHandler(this.textBox1_TextChanged);
- //
- // textBox6
- //
- this.textBox6.Location = new System.Drawing.Point(238, 96);
- this.textBox6.Name = "textBox6";
- this.textBox6.ReadOnly = true;
- this.textBox6.Size = new System.Drawing.Size(61, 21);
- this.textBox6.TabIndex = 13;
- this.textBox6.Leave += new System.EventHandler(this.textBox1_TextChanged);
- //
- // textBox5
- //
- this.textBox5.Location = new System.Drawing.Point(84, 96);
- this.textBox5.Name = "textBox5";
- this.textBox5.ReadOnly = true;
- this.textBox5.Size = new System.Drawing.Size(69, 21);
- this.textBox5.TabIndex = 12;
- this.textBox5.Leave += new System.EventHandler(this.textBox1_TextChanged);
- //
- // textBox2
- //
- this.textBox2.Location = new System.Drawing.Point(238, 26);
- this.textBox2.Name = "textBox2";
- this.textBox2.ReadOnly = true;
- this.textBox2.Size = new System.Drawing.Size(61, 21);
- this.textBox2.TabIndex = 11;
- this.textBox2.Leave += new System.EventHandler(this.textBox1_TextChanged);
- //
- // textBox1
- //
- this.textBox1.Location = new System.Drawing.Point(84, 26);
- this.textBox1.Name = "textBox1";
- this.textBox1.ReadOnly = true;
- this.textBox1.Size = new System.Drawing.Size(69, 21);
- this.textBox1.TabIndex = 10;
- this.textBox1.Leave += new System.EventHandler(this.textBox1_TextChanged);
- //
- // textBox4
- //
- this.textBox4.Location = new System.Drawing.Point(238, 61);
- this.textBox4.Name = "textBox4";
- this.textBox4.ReadOnly = true;
- this.textBox4.Size = new System.Drawing.Size(61, 21);
- this.textBox4.TabIndex = 9;
- this.textBox4.Leave += new System.EventHandler(this.textBox1_TextChanged);
- //
- // textBox3
- //
- this.textBox3.Location = new System.Drawing.Point(84, 62);
- this.textBox3.Name = "textBox3";
- this.textBox3.ReadOnly = true;
- this.textBox3.Size = new System.Drawing.Size(69, 21);
- this.textBox3.TabIndex = 8;
- this.textBox3.Leave += new System.EventHandler(this.textBox1_TextChanged);
- //
- // radioButton8
- //
- this.radioButton8.AutoSize = true;
- this.radioButton8.Location = new System.Drawing.Point(165, 132);
- this.radioButton8.Name = "radioButton8";
- this.radioButton8.Size = new System.Drawing.Size(59, 16);
- this.radioButton8.TabIndex = 7;
- this.radioButton8.TabStop = true;
- this.radioButton8.Text = "未设置";
- this.radioButton8.UseVisualStyleBackColor = true;
- this.radioButton8.Click += new System.EventHandler(this.radioButton_SelectedChanged);
- //
- // radioButton7
- //
- this.radioButton7.AutoSize = true;
- this.radioButton7.Location = new System.Drawing.Point(11, 132);
- this.radioButton7.Name = "radioButton7";
- this.radioButton7.Size = new System.Drawing.Size(59, 16);
- this.radioButton7.TabIndex = 6;
- this.radioButton7.TabStop = true;
- this.radioButton7.Text = "未设置";
- this.radioButton7.UseVisualStyleBackColor = true;
- this.radioButton7.Click += new System.EventHandler(this.radioButton_SelectedChanged);
- //
- // radioButton6
- //
- this.radioButton6.AutoSize = true;
- this.radioButton6.Location = new System.Drawing.Point(165, 97);
- this.radioButton6.Name = "radioButton6";
- this.radioButton6.Size = new System.Drawing.Size(59, 16);
- this.radioButton6.TabIndex = 5;
- this.radioButton6.TabStop = true;
- this.radioButton6.Text = "未设置";
- this.radioButton6.UseVisualStyleBackColor = true;
- this.radioButton6.Click += new System.EventHandler(this.radioButton_SelectedChanged);
- //
- // radioButton5
- //
- this.radioButton5.AutoSize = true;
- this.radioButton5.Location = new System.Drawing.Point(11, 97);
- this.radioButton5.Name = "radioButton5";
- this.radioButton5.Size = new System.Drawing.Size(59, 16);
- this.radioButton5.TabIndex = 4;
- this.radioButton5.TabStop = true;
- this.radioButton5.Text = "未设置";
- this.radioButton5.UseVisualStyleBackColor = true;
- this.radioButton5.Click += new System.EventHandler(this.radioButton_SelectedChanged);
- //
- // radioButton4
- //
- this.radioButton4.AutoSize = true;
- this.radioButton4.Location = new System.Drawing.Point(163, 62);
- this.radioButton4.Name = "radioButton4";
- this.radioButton4.Size = new System.Drawing.Size(59, 16);
- this.radioButton4.TabIndex = 3;
- this.radioButton4.TabStop = true;
- this.radioButton4.Text = "未设置";
- this.radioButton4.UseVisualStyleBackColor = true;
- this.radioButton4.Click += new System.EventHandler(this.radioButton_SelectedChanged);
- //
- // radioButton3
- //
- this.radioButton3.AutoSize = true;
- this.radioButton3.Location = new System.Drawing.Point(11, 62);
- this.radioButton3.Name = "radioButton3";
- this.radioButton3.Size = new System.Drawing.Size(59, 16);
- this.radioButton3.TabIndex = 2;
- this.radioButton3.TabStop = true;
- this.radioButton3.Text = "未设置";
- this.radioButton3.UseVisualStyleBackColor = true;
- this.radioButton3.Click += new System.EventHandler(this.radioButton_SelectedChanged);
- //
- // radioButton2
- //
- this.radioButton2.AutoSize = true;
- this.radioButton2.Location = new System.Drawing.Point(163, 27);
- this.radioButton2.Name = "radioButton2";
- this.radioButton2.Size = new System.Drawing.Size(59, 16);
- this.radioButton2.TabIndex = 1;
- this.radioButton2.TabStop = true;
- this.radioButton2.Text = "未设置";
- this.radioButton2.UseVisualStyleBackColor = true;
- this.radioButton2.Click += new System.EventHandler(this.radioButton_SelectedChanged);
- //
- // radioButton1
- //
- this.radioButton1.AutoSize = true;
- this.radioButton1.Location = new System.Drawing.Point(11, 27);
- this.radioButton1.Name = "radioButton1";
- this.radioButton1.Size = new System.Drawing.Size(59, 16);
- this.radioButton1.TabIndex = 0;
- this.radioButton1.TabStop = true;
- this.radioButton1.Text = "未设置";
- this.radioButton1.UseVisualStyleBackColor = true;
- this.radioButton1.Click += new System.EventHandler(this.radioButton_SelectedChanged);
- //
- // 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.Controls.Add(this.comboBox1);
- this.groupBox2.Controls.Add(this.label1);
- this.groupBox2.Location = new System.Drawing.Point(8, 190);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new System.Drawing.Size(310, 305);
- this.groupBox2.TabIndex = 4;
- this.groupBox2.TabStop = false;
- this.groupBox2.Text = "数据表";
- //
- // listView1
- //
- this.listView1.FullRowSelect = true;
- this.listView1.GridLines = true;
- this.listView1.HideSelection = false;
- this.listView1.Location = new System.Drawing.Point(6, 56);
- this.listView1.Name = "listView1";
- this.listView1.Size = new System.Drawing.Size(293, 243);
- this.listView1.TabIndex = 2;
- this.listView1.UseCompatibleStateImageBehavior = false;
- //
- // comboBox1
- //
- this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox1.FormattingEnabled = true;
- this.comboBox1.Location = new System.Drawing.Point(45, 30);
- this.comboBox1.Name = "comboBox1";
- this.comboBox1.Size = new System.Drawing.Size(254, 20);
- this.comboBox1.TabIndex = 1;
- this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(6, 33);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(41, 12);
- this.label1.TabIndex = 0;
- this.label1.Text = "筛选:";
- //
- // groupBox3
- //
- this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox3.Controls.Add(this.button4);
- this.groupBox3.Controls.Add(this.button3);
- this.groupBox3.Controls.Add(this.button2);
- this.groupBox3.Controls.Add(this.button1);
- this.groupBox3.Controls.Add(this.numericUpDown5);
- this.groupBox3.Controls.Add(this.label6);
- this.groupBox3.Controls.Add(this.label5);
- this.groupBox3.Controls.Add(this.label4);
- this.groupBox3.Controls.Add(this.label3);
- this.groupBox3.Controls.Add(this.label2);
- this.groupBox3.Location = new System.Drawing.Point(8, 501);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new System.Drawing.Size(310, 110);
- this.groupBox3.TabIndex = 5;
- this.groupBox3.TabStop = false;
- this.groupBox3.Text = "操作";
- //
- // button4
- //
- this.button4.Location = new System.Drawing.Point(259, 18);
- this.button4.Name = "button4";
- this.button4.Size = new System.Drawing.Size(40, 23);
- this.button4.TabIndex = 10;
- this.button4.Text = ">>";
- this.button4.UseVisualStyleBackColor = true;
- this.button4.Click += new System.EventHandler(this.button4_Click);
- //
- // button3
- //
- this.button3.Location = new System.Drawing.Point(165, 18);
- this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(38, 23);
- this.button3.TabIndex = 9;
- this.button3.Text = "删除";
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += new System.EventHandler(this.Delete_Click);
- //
- // button2
- //
- this.button2.Location = new System.Drawing.Point(211, 18);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(40, 23);
- this.button2.TabIndex = 8;
- this.button2.Text = "清空";
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.Clear_Click);
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(259, 63);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(40, 23);
- this.button1.TabIndex = 7;
- this.button1.Text = "输出";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // numericUpDown5
- //
- this.numericUpDown5.Location = new System.Drawing.Point(165, 64);
- this.numericUpDown5.Maximum = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.numericUpDown5.Minimum = new decimal(new int[] {
- 2,
- 0,
- 0,
- 0});
- this.numericUpDown5.Name = "numericUpDown5";
- this.numericUpDown5.Size = new System.Drawing.Size(86, 21);
- this.numericUpDown5.TabIndex = 6;
- this.numericUpDown5.Value = new decimal(new int[] {
- 2,
- 0,
- 0,
- 0});
- this.numericUpDown5.ValueChanged += new System.EventHandler(this.numericUpDown5_ValueChanged);
- //
- // label6
- //
- this.label6.AutoSize = true;
- this.label6.Location = new System.Drawing.Point(82, 68);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(77, 12);
- this.label6.TabIndex = 4;
- this.label6.Text = "小数点位数:";
- //
- // label5
- //
- this.label5.AutoSize = true;
- this.label5.Location = new System.Drawing.Point(113, 23);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(17, 12);
- this.label5.TabIndex = 3;
- this.label5.Text = "度";
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(76, 23);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(41, 12);
- this.label4.TabIndex = 2;
- this.label4.Text = "角度:";
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Location = new System.Drawing.Point(43, 23);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(17, 12);
- this.label3.TabIndex = 1;
- this.label3.Text = "mm";
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(6, 23);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(41, 12);
- this.label2.TabIndex = 0;
- this.label2.Text = "长度:";
- //
- // 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.listView2);
- this.groupBox4.Location = new System.Drawing.Point(324, 3);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Size = new System.Drawing.Size(83, 608);
- this.groupBox4.TabIndex = 6;
- this.groupBox4.TabStop = false;
- this.groupBox4.Text = "快捷工具";
- //
- // listView2
- //
- this.listView2.FullRowSelect = true;
- this.listView2.GridLines = true;
- this.listView2.HideSelection = false;
- this.listView2.Location = new System.Drawing.Point(6, 20);
- this.listView2.Name = "listView2";
- this.listView2.Size = new System.Drawing.Size(71, 578);
- this.listView2.TabIndex = 0;
- this.listView2.UseCompatibleStateImageBehavior = false;
- //
- // groupBox5
- //
- this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox5.Controls.Add(this.treeView1);
- this.groupBox5.Location = new System.Drawing.Point(413, 3);
- this.groupBox5.Name = "groupBox5";
- this.groupBox5.Size = new System.Drawing.Size(220, 608);
- this.groupBox5.TabIndex = 7;
- this.groupBox5.TabStop = false;
- this.groupBox5.Text = "数据属性";
- //
- // treeView1
- //
- this.treeView1.Location = new System.Drawing.Point(6, 20);
- this.treeView1.Name = "treeView1";
- this.treeView1.Size = new System.Drawing.Size(208, 578);
- this.treeView1.TabIndex = 17;
- //
- // groupBox6
- //
- this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox6.Controls.Add(this.button8);
- this.groupBox6.Controls.Add(this.button7);
- this.groupBox6.Controls.Add(this.button6);
- this.groupBox6.Controls.Add(this.button5);
- this.groupBox6.Location = new System.Drawing.Point(639, 3);
- this.groupBox6.Name = "groupBox6";
- this.groupBox6.Size = new System.Drawing.Size(107, 301);
- this.groupBox6.TabIndex = 8;
- this.groupBox6.TabStop = false;
- this.groupBox6.Text = "工具";
- //
- // button8
- //
- this.button8.Location = new System.Drawing.Point(16, 219);
- this.button8.Name = "button8";
- this.button8.Size = new System.Drawing.Size(75, 23);
- this.button8.TabIndex = 3;
- this.button8.Text = "向下";
- this.button8.UseVisualStyleBackColor = true;
- this.button8.Click += new System.EventHandler(this.button8_Click);
- //
- // button7
- //
- this.button7.Location = new System.Drawing.Point(16, 164);
- this.button7.Name = "button7";
- this.button7.Size = new System.Drawing.Size(75, 23);
- this.button7.TabIndex = 2;
- this.button7.Text = "向上";
- this.button7.UseVisualStyleBackColor = true;
- this.button7.Click += new System.EventHandler(this.button7_Click);
- //
- // button6
- //
- this.button6.Location = new System.Drawing.Point(16, 109);
- this.button6.Name = "button6";
- this.button6.Size = new System.Drawing.Size(75, 23);
- this.button6.TabIndex = 1;
- this.button6.Text = ">移除";
- this.button6.UseVisualStyleBackColor = true;
- this.button6.Click += new System.EventHandler(this.button6_Click);
- //
- // button5
- //
- this.button5.Location = new System.Drawing.Point(16, 54);
- this.button5.Name = "button5";
- this.button5.Size = new System.Drawing.Size(75, 23);
- this.button5.TabIndex = 0;
- this.button5.Text = "<添加";
- this.button5.UseVisualStyleBackColor = true;
- this.button5.Click += new System.EventHandler(this.button5_Click);
- //
- // groupBox7
- //
- this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox7.Controls.Add(this.button12);
- this.groupBox7.Controls.Add(this.button11);
- this.groupBox7.Controls.Add(this.button10);
- this.groupBox7.Controls.Add(this.button9);
- this.groupBox7.Location = new System.Drawing.Point(639, 310);
- this.groupBox7.Name = "groupBox7";
- this.groupBox7.Size = new System.Drawing.Size(107, 301);
- this.groupBox7.TabIndex = 9;
- this.groupBox7.TabStop = false;
- this.groupBox7.Text = "数据";
- //
- // button12
- //
- this.button12.Location = new System.Drawing.Point(16, 214);
- this.button12.Name = "button12";
- this.button12.Size = new System.Drawing.Size(75, 23);
- this.button12.TabIndex = 3;
- this.button12.Text = "向下";
- this.button12.UseVisualStyleBackColor = true;
- this.button12.Click += new System.EventHandler(this.button12_Click);
- //
- // button11
- //
- this.button11.Location = new System.Drawing.Point(16, 159);
- this.button11.Name = "button11";
- this.button11.Size = new System.Drawing.Size(75, 23);
- this.button11.TabIndex = 2;
- this.button11.Text = "向上";
- this.button11.UseVisualStyleBackColor = true;
- this.button11.Click += new System.EventHandler(this.button11_Click);
- //
- // button10
- //
- this.button10.Location = new System.Drawing.Point(16, 104);
- this.button10.Name = "button10";
- this.button10.Size = new System.Drawing.Size(75, 23);
- this.button10.TabIndex = 1;
- this.button10.Text = ">移除";
- this.button10.UseVisualStyleBackColor = true;
- this.button10.Click += new System.EventHandler(this.button10_Click);
- //
- // button9
- //
- this.button9.Location = new System.Drawing.Point(16, 49);
- this.button9.Name = "button9";
- this.button9.Size = new System.Drawing.Size(75, 23);
- this.button9.TabIndex = 0;
- this.button9.Text = "<添加";
- this.button9.UseVisualStyleBackColor = true;
- this.button9.Click += new System.EventHandler(this.button9_Click);
- //
- // groupBox8
- //
- this.groupBox8.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)));
- this.groupBox8.Controls.Add(this.treeView2);
- this.groupBox8.Location = new System.Drawing.Point(752, 3);
- this.groupBox8.Name = "groupBox8";
- this.groupBox8.Size = new System.Drawing.Size(220, 608);
- this.groupBox8.TabIndex = 10;
- this.groupBox8.TabStop = false;
- this.groupBox8.Text = "元素属性";
- //
- // treeView2
- //
- this.treeView2.Location = new System.Drawing.Point(6, 20);
- this.treeView2.Name = "treeView2";
- this.treeView2.Size = new System.Drawing.Size(208, 578);
- this.treeView2.TabIndex = 18;
- //
- // GeometryMeasureDialog
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
- this.BackColor = System.Drawing.SystemColors.Control;
- this.ClientSize = new System.Drawing.Size(980, 621);
- 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.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.Name = "GeometryMeasureDialog";
- this.Text = "交互测量";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.GeometryMeasureDialog_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.groupBox2.PerformLayout();
- this.groupBox3.ResumeLayout(false);
- this.groupBox3.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).EndInit();
- this.groupBox4.ResumeLayout(false);
- this.groupBox5.ResumeLayout(false);
- this.groupBox6.ResumeLayout(false);
- this.groupBox7.ResumeLayout(false);
- this.groupBox8.ResumeLayout(false);
- this.ResumeLayout(false);
- }
- /// <summary>
- /// 刷新别名
- /// </summary>
- public void RefreshAliasName()
- {
- this.measureStyleModel = Startup.instance.measureStyleModel;
- for (int i = 1; i <= 8; i++)
- {
- if (i > this.toolNameList.Count)
- {
- break;
- }
- string toolName = this.toolNameList[i - 1];
- string enName = string.Empty;
- foreach (var item in measureListSetModel.AttributeMapAllDataNodes)
- {
- var tool = item.Attribute.Where(m => m.Text.Equals(toolName)).FirstOrDefault();
- if (tool == null)
- {
- continue;
- }
- enName = tool.Name;
- }
- if (!string.IsNullOrEmpty(enName))
- {
- string name;
- getAliasName(out name, enName);
- this.toolNickNameList[i - 1] = name;
- #region [文本赋值]
- switch (i)
- {
- case 1:
- textBox1.Text = name;
- break;
- case 2:
- textBox2.Text = name;
- break;
- case 3:
- textBox3.Text = name;
- break;
- case 4:
- textBox4.Text = name;
- break;
- case 5:
- textBox5.Text = name;
- break;
- case 6:
- textBox6.Text = name;
- break;
- case 7:
- textBox7.Text = name;
- break;
- case 8:
- textBox8.Text = name;
- break;
- }
- #endregion
- }
- }
- RefreshListView(null, null);
- }
- /// <summary>
- /// 获取参数保存
- /// </summary>
- private void getLastData()
- {
- string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\ParameterSaving\\MeasureListInteractiveDataModel.xml";
- if (!File.Exists(filePath))
- {
- measureListInteractiveDataModel = new MeasureListInteractiveDataModel();
- }
- else
- {
- measureListInteractiveDataModel = XmlSerializeHelper.DESerializer<MeasureListInteractiveDataModel>(FileOperationHelper.ReadStringFromFile(filePath, FileMode.Open));
- if (measureListInteractiveDataModel != null)
- {
- this.numericUpDown5.Value = measureListInteractiveDataModel.num;
- this.comboBox1.SelectedIndex = measureListInteractiveDataModel.selectIndex;
- foreach (var item in measureListInteractiveDataModel.FastToolList)
- {
- var index = measureListInteractiveDataModel.FastToolList.IndexOf(item) + 1;
- string name = item.name;
- if (name.Length >= 5)
- {
- name = $"{name.Substring(0, 4)}\r\n{name.Substring(4, name.Length - 4)}";
- }
- switch (index)
- {
- case 1:
- radioButton1.Text = name;
- textBox1.Text = item.nickName;
- break;
- case 2:
- radioButton2.Text = name;
- textBox2.Text = item.nickName;
- break;
- case 3:
- radioButton3.Text = name;
- textBox3.Text = item.nickName;
- break;
- case 4:
- radioButton4.Text = name;
- textBox4.Text = item.nickName;
- break;
- case 5:
- radioButton5.Text = name;
- textBox5.Text = item.nickName;
- break;
- case 6:
- radioButton6.Text = name;
- textBox6.Text = item.nickName;
- break;
- case 7:
- radioButton7.Text = name;
- textBox7.Text = item.nickName;
- break;
- case 8:
- radioButton8.Text = name;
- textBox8.Text = item.nickName;
- break;
- }
- toolNameList.Add(item.name);
- toolNickNameList.Add(item.nickName);
- ListViewItem lvi = new ListViewItem();
- lvi.Text = item.name;
- this.listView2.Items.Add(lvi);
- }
- if (measureListInteractiveDataModel.FastToolList.Count > 0)
- {
- radioButton_SelectedChanged(radioButton1, null);
- }
- }
- }
- }
- /// <summary>
- /// 数据属性初始化
- /// </summary>
- private void allDataTree()
- {
- if (measureListSetModel != null && measureListSetModel.AttributeMapAllDataNodes != null)
- {
- for (int i = 0; i < measureListSetModel.AttributeMapAllDataNodes.Count; i++)
- {
- TreeNode firstNode = new TreeNode();
- firstNode.Text = measureListSetModel.AttributeMapAllDataNodes[i].Name;
- for (int j = 0; j < measureListSetModel.AttributeMapAllDataNodes[i].Attribute.Count; j++)
- {
- TreeNode scondNode = new TreeNode();
- scondNode.Text = measureListSetModel.AttributeMapAllDataNodes[i].Attribute[j].Text;
- scondNode.Name = measureListSetModel.AttributeMapAllDataNodes[i].Attribute[j].Name;
- for (int k = 0; k < measureListSetModel.AttributeMapAllDataNodes[i].Attribute[j].Attribute.Count; k++)
- {
- if (measureListSetModel.AttributeMapAllDataNodes[i].Attribute[j].Attribute.Count > 0)
- {
- TreeNode thirdNode = new TreeNode();
- thirdNode.Text = measureListSetModel.AttributeMapAllDataNodes[i].Attribute[j].Attribute[k].Text;
- thirdNode.Name = measureListSetModel.AttributeMapAllDataNodes[i].Attribute[j].Attribute[k].Name;
- scondNode.Nodes.Add(thirdNode);
- }
- }
- firstNode.Nodes.Add(scondNode);
- }
- this.treeView2.Nodes.Add(firstNode);
- }
- }
- }
- /// <summary>
- /// 元素属性初始化
- /// </summary>
- private void allToolTree()
- {
- if (measureListSetModel != null && measureListSetModel.AttributeMapDataNodes != null)
- {
- for (int i = 0; i < measureListSetModel.AttributeMapDataNodes.Count; i++)
- {
- TreeNode firstNode = new TreeNode();
- firstNode.Text = measureListSetModel.AttributeMapDataNodes[i].Name;
- for (int j = 0; j < measureListSetModel.AttributeMapDataNodes[i].Attribute.Count; j++)
- {
- TreeNode scondNode = new TreeNode();
- scondNode.Text = measureListSetModel.AttributeMapDataNodes[i].Attribute[j].Text;
- scondNode.Name = measureListSetModel.AttributeMapDataNodes[i].Attribute[j].Name;
- for (int k = 0; k < measureListSetModel.AttributeMapDataNodes[i].Attribute[j].Attribute.Count; k++)
- {
- if (measureListSetModel.AttributeMapDataNodes[i].Attribute[j].Attribute.Count > 0)
- {
- TreeNode thirdNode = new TreeNode();
- thirdNode.Text = measureListSetModel.AttributeMapDataNodes[i].Attribute[j].Attribute[k].Text;
- thirdNode.Name = measureListSetModel.AttributeMapDataNodes[i].Attribute[j].Attribute[k].Name;
- scondNode.Nodes.Add(thirdNode);
- }
- }
- firstNode.Nodes.Add(scondNode);
- }
- this.treeView1.Nodes.Add(firstNode);
- }
- }
- }
- /// <summary>
- /// 面板伸缩事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button4_Click(object sender, EventArgs e)
- {
- if (isEnlarge)
- {
- this.Width = this.smallHeight;
- this.button4.Text = ">>";
- }
- else
- {
- this.Width = this.bigHelght;
- this.button4.Text = "<<";
- }
- this.isEnlarge = !isEnlarge;
- }
- #region [数据面板操作]
- /// <summary>
- /// 数据添加
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button9_Click(object sender, EventArgs e)
- {
- if (this.treeView2.SelectedNode != null && this.treeView2.SelectedNode.Level == 2)
- {
- string name = string.Empty;
- string orName = this.treeView2.SelectedNode.Name;
- if (this.treeView2.SelectedNode.Parent != null)
- name = this.treeView2.SelectedNode.Parent.Name;
- TreeNode treeNode = this.treeView2.SelectedNode;
- int count = treeView1.Nodes.Count;
- for (int i = 0; i < count; i++)
- {
- foreach (TreeNode node in this.treeView1.Nodes[i].Nodes)
- {
- if (node.Name == name)
- {
- this.treeView2.SelectedNode.Remove();
- node.Nodes.Add(treeNode);
- }
- }
- }
- MeasureListSetModel.FirstNode.SecondNode.Item hasAttr = null;
- foreach (var item in measureListSetModel.AttributeMapAllDataNodes)
- {
- var tool = item.Attribute.Where(m => m.Name.Equals(name)).FirstOrDefault();
- if (tool != null)
- {
- hasAttr = tool.Attribute.Where(m => m.Name.Equals(orName)).FirstOrDefault();
- if (hasAttr != null)
- {
- tool.Attribute.Remove(hasAttr);
- }
- }
- }
- foreach (var item in measureListSetModel.AttributeMapDataNodes)
- {
- var tool = item.Attribute.Where(m => m.Name.Equals(name)).FirstOrDefault();
- if (tool != null)
- {
- if (hasAttr != null)
- {
- tool.Attribute.Add(hasAttr);
- }
- }
- }
- RefreshListView(null, null);
- }
- }
- /// <summary>
- /// 数据移除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button10_Click(object sender, EventArgs e)
- {
- if (this.treeView1.SelectedNode != null && this.treeView1.SelectedNode.Level == 2)
- {
- string name = string.Empty;
- string orName = this.treeView1.SelectedNode.Name;
- if (this.treeView1.SelectedNode.Parent != null)
- name = this.treeView1.SelectedNode.Parent.Name;
- TreeNode treeNode = this.treeView1.SelectedNode;
- int count = treeView2.Nodes.Count;
- for (int i = 0; i < count; i++)
- {
- foreach (TreeNode node in this.treeView2.Nodes[i].Nodes)
- {
- if (node.Name == name)
- {
- this.treeView1.SelectedNode.Remove();
- node.Nodes.Add(treeNode);
- }
- }
- }
- MeasureListSetModel.FirstNode.SecondNode.Item hasAttr = null;
- foreach (var item in measureListSetModel.AttributeMapDataNodes)
- {
- var tool = item.Attribute.Where(m => m.Name.Equals(name)).FirstOrDefault();
- if (tool != null)
- {
- hasAttr = tool.Attribute.Where(m => m.Name.Equals(orName)).FirstOrDefault();
- if (hasAttr != null)
- {
- tool.Attribute.Remove(hasAttr);
- }
- }
- }
- foreach (var item in measureListSetModel.AttributeMapAllDataNodes)
- {
- var tool = item.Attribute.Where(m => m.Name.Equals(name)).FirstOrDefault();
- if (tool != null)
- {
- if (hasAttr != null)
- {
- tool.Attribute.Add(hasAttr);
- }
- }
- }
- RefreshListView(null, null);
- }
- }
- /// <summary>
- /// 数据向上
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button11_Click(object sender, EventArgs e)
- {
- if (this.treeView1.SelectedNode == null || this.treeView1.SelectedNode.Level != 2)
- {
- return;
- }
- #region [树状图信息向上]
- string name = string.Empty;
- if (this.treeView1.SelectedNode.Parent != null)
- {
- name = this.treeView1.SelectedNode.Parent.Name;
- }
- TreeNode treeNode = this.treeView1.SelectedNode;
- int count = treeView1.Nodes.Count;
- for (int i = 0; i < count; i++)
- {
- foreach (TreeNode node in this.treeView1.Nodes[i].Nodes)
- {
- if (node.Name != name)
- {
- continue;
- }
- int index = node.Nodes.IndexOf(treeNode);
- if (index != 0)
- {
- TreeNode lastNode = node.Nodes[index - 1];
- node.Nodes.RemoveAt(index);
- node.Nodes.RemoveAt(index - 1);
- node.Nodes.Insert(index, lastNode);
- node.Nodes.Insert(index - 1, treeNode);
- treeView1.Focus();
- treeView1.SelectedNode = treeNode;
- }
- }
- }
- #endregion
- #region [表格信息向上]
- #endregion
- }
- /// <summary>
- /// 数据向下
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button12_Click(object sender, EventArgs e)
- {
- if (this.treeView1.SelectedNode == null || this.treeView1.SelectedNode.Level != 2)
- {
- return;
- }
- #region [树状图信息向下]
- string name = string.Empty;
- if (this.treeView1.SelectedNode.Parent != null)
- {
- name = this.treeView1.SelectedNode.Parent.Name;
- }
- TreeNode treeNode = this.treeView1.SelectedNode;
- int count = treeView1.Nodes.Count;
- for (int i = 0; i < count; i++)
- {
- foreach (TreeNode node in this.treeView1.Nodes[i].Nodes)
- {
- if (node.Name != name)
- {
- continue;
- }
- int index = node.Nodes.IndexOf(treeNode);
- if (index != node.Nodes.Count - 1)
- {
- TreeNode lastNode = node.Nodes[index + 1];
- node.Nodes.RemoveAt(index + 1);
- node.Nodes.RemoveAt(index);
- node.Nodes.Insert(index, lastNode);
- node.Nodes.Insert(index + 1, treeNode);
- treeView1.Focus();
- treeView1.SelectedNode = treeNode;
- }
- }
- }
- #endregion
- #region [表格信息向下]
- #endregion
- }
- #endregion
- #region [工具面板操作]
- /// <summary>
- /// 工具添加
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button5_Click(object sender, EventArgs e)
- {
- if (this.treeView2.SelectedNode == null || this.treeView2.SelectedNode.Level != 1)
- {
- return;
- }
- if (this.listView2.Items.Count >= 8)
- {
- MessageBox.Show("最多只能添加8个快捷工具!");
- return;
- }
- if (this.toolNameList.Contains(this.treeView2.SelectedNode.Text))
- {
- MessageBox.Show("不可添加重复的快捷工具!");
- return;
- }
- #region [快捷工具列表中添加]
- ListViewItem lvi = new ListViewItem();
- lvi.Text = this.treeView2.SelectedNode.Text;
- this.listView2.Items.Add(lvi);
- #endregion
- #region [快捷工具中添加]
- string measureTpye = this.treeView2.SelectedNode.Name;
- #region [通过类型 获取别名]
- string name;
- getAliasName(out name, measureTpye);
- #endregion
- this.addToolName(this.listView2.Items.Count, this.treeView2.SelectedNode.Text, name);
- this.toolNameList.Add(this.treeView2.SelectedNode.Text);
- this.toolNickNameList.Add(name);
- if (toolNameList.Count == 1)
- {
- radioButton_SelectedChanged(radioButton1, e);
- }
- #endregion
- }
- /// <summary>
- ///
- /// </summary>
- private void getAliasName(out string name, string typeName)
- {
- switch (typeName)
- {
- case "MeasureLine":
- name = this.measureStyleModel.measureLine.aliasName;
- break;
- case "MeasureLength":
- name = this.measureStyleModel.measureLength.aliasName;
- break;
- case "MeasureDistanceLine":
- name = this.measureStyleModel.measureDistanceLine.aliasName;
- break;
- case "MeasureHLine":
- name = this.measureStyleModel.measureHLine.aliasName;
- break;
- case "MeasureVLine":
- name = this.measureStyleModel.measureVLine.aliasName;
- break;
- case "MeasureMulLine":
- name = this.measureStyleModel.measureMulLine.aliasName;
- break;
- case "MeasureMulHVLine":
- name = this.measureStyleModel.measureMulHVLine.aliasName;
- break;
- case "MeasureMulSegment":
- name = this.measureStyleModel.measureMulSegment.aliasName;
- break;
- case "MeasureMulVLine":
- name = this.measureStyleModel.measureMulVLine.aliasName;
- break;
- case "MeasureBrokenLine":
- name = this.measureStyleModel.measureBrokenLine.aliasName;
- break;
- case "MeasureTraceCurve":
- name = this.measureStyleModel.measureTraceCurve.aliasName;
- break;
- case "MeasureCurveLine":
- name = this.measureStyleModel.measureCurveLine.aliasName;
- break;
- case "MeasurePLine":
- name = this.measureStyleModel.measurePLine.aliasName;
- break;
- case "MeasureMulPLine":
- name = this.measureStyleModel.measureMulPLine.aliasName;
- break;
- case "MeasureHMulPLine":
- name = this.measureStyleModel.measureHMulPLine.aliasName;
- break;
- case "MeasureVMulPLine":
- name = this.measureStyleModel.measureVMulPLine.aliasName;
- break;
- case "MeasurePointHLine":
- name = this.measureStyleModel.measurePointHLine.aliasName;
- break;
- case "MeasureParallelLine":
- name = this.measureStyleModel.measureParallelLine.aliasName;
- break;
- case "MeasureMulParallelLine":
- name = this.measureStyleModel.measureMulParallelLine.aliasName;
- break;
- case "MeasureVMulParallelLine":
- name = this.measureStyleModel.measureVMulParallelLine.aliasName;
- break;
- case "MeasureHMulParallelLine":
- name = this.measureStyleModel.measureHMulParallelLine.aliasName;
- break;
- case "MeasureClosedCurve":
- name = this.measureStyleModel.measureClosedCurve.aliasName;
- break;
- case "MeasurePolygon":
- name = this.measureStyleModel.measurePolygon.aliasName;
- break;
- case "MeasureRectangle":
- name = this.measureStyleModel.measureRectangle.aliasName;
- break;
- case "MeasureRandRectangle":
- name = this.measureStyleModel.measureRandRectangle.aliasName;
- break;
- case "MeasureSquare":
- name = this.measureStyleModel.measureSquare.aliasName;
- break;
- case "MeasureRandSquare":
- name = this.measureStyleModel.measureRandSquare.aliasName;
- break;
- case "MeasureTracePolygon":
- name = this.measureStyleModel.measureTracePolygon.aliasName;
- break;
- case "MeasureCircle":
- name = this.measureStyleModel.measureCircle.aliasName;
- break;
- case "MeasureInnerCircle":
- name = this.measureStyleModel.measureInnerCircle.aliasName;
- break;
- case "MeasureOuterCircle":
- name = this.measureStyleModel.measureOuterCircle.aliasName;
- break;
- case "MeasureDiameterCircle":
- name = this.measureStyleModel.measureDiameterCircle.aliasName;
- break;
- case "MeasurePointCenterSize":
- name = this.measureStyleModel.measurePointCenterSize.aliasName;
- break;
- case "MeasureCenterCenterSize":
- name = this.measureStyleModel.measureCenterCenterSize.aliasName;
- break;
- case "MeasurePointArcSize":
- name = this.measureStyleModel.measurePointArcSize.aliasName;
- break;
- case "MeasureTwoLineVLDistance":
- name = this.measureStyleModel.measureTwoLineVLDistance.aliasName;
- break;
- case "MeasurePointEdgeSize":
- name = this.measureStyleModel.measurePointEdgeSize.aliasName;
- break;
- case "MeasureThreePointAngle":
- name = this.measureStyleModel.measureThreePointAngle.aliasName;
- break;
- case "MeasureFourPointAngle":
- name = this.measureStyleModel.measureFourPointAngle.aliasName;
- break;
- case "MeasureThreePointArc":
- name = this.measureStyleModel.measureThreePointArc.aliasName;
- break;
- default:
- name = string.Empty;
- break;
- }
- }
- /// <summary>
- /// 工具移除
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button6_Click(object sender, EventArgs e)
- {
- if (this.listView2.FocusedItem != null && this.listView2.FocusedItem.Selected)
- {
- int index = this.listView2.FocusedItem.Index;
- this.removeToolName(index, this.listView2.FocusedItem.Text);
- this.listView2.Items.RemoveAt(index);
- }
- }
- /// <summary>
- /// 工具向上
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button7_Click(object sender, EventArgs e)
- {
- if (this.treeView2.SelectedNode == null || this.treeView2.SelectedNode.Level != 1)
- {
- return;
- }
- #region [快捷工具列表中向上]
- if (this.listView2.FocusedItem != null && this.listView2.FocusedItem.Selected)
- {
- int index = this.listView2.FocusedItem.Index;
- if (index != 0)
- {
- ListViewItem item = this.listView2.FocusedItem;
- ListViewItem lastItem = this.listView2.Items[index - 1];
- this.listView2.Items.RemoveAt(index);
- this.listView2.Items.RemoveAt(index - 1);
- this.listView2.Items.Insert(index - 1, item);
- this.listView2.Items.Insert(index, lastItem);
- moveToolName(index, 1);
- }
- }
- #endregion
- }
- /// <summary>
- /// 工具向下
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button8_Click(object sender, EventArgs e)
- {
- if (this.treeView2.SelectedNode == null || this.treeView2.SelectedNode.Level != 1)
- {
- return;
- }
- #region [快捷工具列表中向下]
- if (this.listView2.FocusedItem != null && this.listView2.FocusedItem.Selected)
- {
- int index = this.listView2.FocusedItem.Index;
- if (index != this.listView2.Items.Count - 1)
- {
- ListViewItem item = this.listView2.FocusedItem;
- ListViewItem lastItem = this.listView2.Items[index + 1];
- this.listView2.Items.RemoveAt(index + 1);
- this.listView2.Items.RemoveAt(index);
- this.listView2.Items.Insert(index, lastItem);
- this.listView2.Items.Insert(index + 1, item);
- moveToolName(index, 2);
- }
- }
- #endregion
- }
- /// <summary>
- /// 添加快捷工具面板
- /// </summary>
- private void addToolName(int index, string name, string textName = "")
- {
- if (name.Length >= 5)
- {
- name = $"{name.Substring(0, 4)}\r\n{name.Substring(4, name.Length - 4)}";
- }
- switch (index)
- {
- case 1:
- this.radioButton1.Text = name;
- if (!string.IsNullOrEmpty(textName))
- textBox1.Text = textName;
- break;
- case 2:
- this.radioButton2.Text = name;
- if (!string.IsNullOrEmpty(textName))
- textBox2.Text = textName;
- break;
- case 3:
- this.radioButton3.Text = name;
- if (!string.IsNullOrEmpty(textName))
- textBox3.Text = textName;
- break;
- case 4:
- this.radioButton4.Text = name;
- if (!string.IsNullOrEmpty(textName))
- textBox4.Text = textName;
- break;
- case 5:
- this.radioButton5.Text = name;
- if (!string.IsNullOrEmpty(textName))
- textBox5.Text = textName;
- break;
- case 6:
- this.radioButton6.Text = name;
- if (!string.IsNullOrEmpty(textName))
- textBox6.Text = textName;
- break;
- case 7:
- this.radioButton7.Text = name;
- if (!string.IsNullOrEmpty(textName))
- textBox7.Text = textName;
- break;
- case 8:
- this.radioButton8.Text = name;
- if (!string.IsNullOrEmpty(textName))
- textBox8.Text = textName;
- break;
- }
- }
- /// <summary>
- /// 移除快捷工具面板
- /// </summary>
- private void removeToolName(int index, string name)
- {
- this.toolNameList.RemoveAt(index);
- this.toolNickNameList.RemoveAt(index);
- this.resetButton();
- for (int i = 0; i < toolNameList.Count; i++)
- {
- addToolName(i + 1, toolNameList[i], toolNickNameList[i]);
- }
- }
- /// <summary>
- /// 重置状态
- /// </summary>
- private void resetButton()
- {
- this.radioButton1.Text = "未设置";
- this.radioButton2.Text = "未设置";
- this.radioButton3.Text = "未设置";
- this.radioButton4.Text = "未设置";
- this.radioButton5.Text = "未设置";
- this.radioButton6.Text = "未设置";
- this.radioButton7.Text = "未设置";
- this.radioButton8.Text = "未设置";
- this.textBox1.Text = "";
- this.textBox2.Text = "";
- this.textBox3.Text = "";
- this.textBox4.Text = "";
- this.textBox5.Text = "";
- this.textBox6.Text = "";
- this.textBox7.Text = "";
- this.textBox8.Text = "";
- #region [取消选中状态]
- if (radioButton1.Checked)
- {
- radioButton1.Checked = false;
- }
- else if (radioButton2.Checked)
- {
- radioButton2.Checked = false;
- }
- else if (radioButton3.Checked)
- {
- radioButton3.Checked = false;
- }
- else if (radioButton4.Checked)
- {
- radioButton4.Checked = false;
- }
- else if (radioButton5.Checked)
- {
- radioButton5.Checked = false;
- }
- else if (radioButton6.Checked)
- {
- radioButton6.Checked = false;
- }
- else if (radioButton7.Checked)
- {
- radioButton7.Checked = false;
- }
- else if (radioButton8.Checked)
- {
- radioButton8.Checked = false;
- }
- #endregion
- if (this.appWorkspace.ActiveDocumentWorkspace != null)
- {
- this.appWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.Pointer;
- }
- }
- /// <summary>
- /// 向上/向下移动快捷工具面板
- /// </summary>
- private void moveToolName(int index, int type)
- {
- switch (type)
- {
- case 1:
- string toolName = this.toolNameList[index];
- string lastToolName = this.toolNameList[index - 1];
- string toolNickName = this.toolNickNameList[index];
- string lastNickName = this.toolNickNameList[index - 1];
- this.toolNameList.RemoveAt(index);
- this.toolNameList.RemoveAt(index - 1);
- this.toolNickNameList.RemoveAt(index);
- this.toolNickNameList.RemoveAt(index - 1);
- this.toolNameList.Insert(index - 1, toolName);
- this.toolNameList.Insert(index, lastToolName);
- this.toolNickNameList.Insert(index - 1, toolNickName);
- this.toolNickNameList.Insert(index, lastNickName);
- break;
- case 2:
- string toolName1 = this.toolNameList[index];
- string lastToolName1 = this.toolNameList[index + 1];
- string toolNickName1 = this.toolNickNameList[index];
- string lastNickName1 = this.toolNickNameList[index + 1];
- this.toolNameList.RemoveAt(index + 1);
- this.toolNameList.RemoveAt(index);
- this.toolNickNameList.RemoveAt(index + 1);
- this.toolNickNameList.RemoveAt(index);
- this.toolNameList.Insert(index, lastToolName1);
- this.toolNameList.Insert(index + 1, toolName1);
- this.toolNickNameList.Insert(index, lastNickName1);
- this.toolNickNameList.Insert(index + 1, toolNickName1);
- break;
- }
- for (int i = 0; i < toolNameList.Count; i++)
- {
- addToolName(i + 1, toolNameList[i], toolNickNameList[i]);
- }
- }
- #endregion
- /// <summary>
- /// 修改别名
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- var textbox = (TextBox)sender;
- int type = Convert.ToInt32(textbox.Name.Substring(textbox.Name.Length - 1, 1));
- if (toolNickNameList.Count > 0 && toolNickNameList.Count >= type)
- {
- toolNickNameList[type - 1] = textbox.Text;
- RefreshListView(null, null);
- }
- }
- /// <summary>
- /// 选择快捷工具
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void radioButton_SelectedChanged(object sender, EventArgs e)
- {
- if (this.appWorkspace.ActiveDocumentWorkspace == null)
- {
- return;
- }
- var radioButto = (RadioButton)sender;
- if (!radioButto.Checked)
- {
- return;
- }
- int type = Convert.ToInt32(radioButto.Name.Substring(radioButto.Name.Length - 1, 1));
- if (toolNameList.Count < type)
- {
- this.appWorkspace.ActiveDocumentWorkspace.ActiveTool = new DrawToolType();
- return;
- }
- var toolName = toolNameList[type - 1];
- //获取工具英文
- string enName = string.Empty;
- foreach (var item in measureListSetModel.AttributeMapAllDataNodes)
- {
- var tool = item.Attribute.Where(m => m.Text.Equals(toolName)).FirstOrDefault();
- if (tool == null)
- {
- continue;
- }
- enName = tool.Name;
- }
- if (!string.IsNullOrEmpty(enName))
- {
- if (this.appWorkspace.ActiveDocumentWorkspace != null)
- {
- this.appWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- this.appWorkspace.ActiveDocumentWorkspace.ActiveTool = (DrawToolType)Enum.Parse(typeof(DrawToolType), enName);
- if (this.appWorkspace.Widgets != null && this.appWorkspace.Widgets.GeometryMeasureDialog.Visible)
- {
- ContinuousDrawingAction();
- }
- }
- }
- }
- /// <summary>
- /// 连续绘制
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ContinuousDrawingAction()
- {
- if (this.appWorkspace.ActiveDocumentWorkspace != null)
- {
- DocumentView.ContinuousDrawing = true;
- this.appWorkspace.continuousDrawingMeasure = true;
- for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
- {
- this.appWorkspace.DocumentWorkspaces[i].ContinuousDrawingMeasure = true;
- }
- this.appWorkspace.toolBar.RefreshBtnSelect(DocumentView.ContinuousDrawing, "ContinuousDrawingMeasure");
- this.appWorkspace.toolsPanel.RefreshBtnSelect(DocumentView.ContinuousDrawing, "ContinuousDrawingMeasure");
- if (!DocumentView.ContinuousDrawing
- && this.appWorkspace.ActiveDocumentWorkspace.ActiveTool >= DrawToolType.MeasureLine && this.appWorkspace.ActiveDocumentWorkspace.ActiveTool <= DrawToolType.MeasureThreePointArc)
- {
- this.appWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- this.appWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.Pointer;
- }
- DocumentView.ContinuousDrawing = true;
- }
- if (this.appWorkspace.cameraPreviewDialog != null && !this.appWorkspace.cameraPreviewDialog.IsDisposed)
- {
- this.appWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure = true;
- if (this.appWorkspace.ActiveDocumentWorkspace != null) this.appWorkspace.continuousDrawingMeasure = true;
- for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
- {
- this.appWorkspace.DocumentWorkspaces[i].ContinuousDrawingMeasure = true;
- }
- this.appWorkspace.toolBar.RefreshBtnSelect(this.appWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure, "ContinuousDrawingMeasure");
- this.appWorkspace.toolsPanel.RefreshBtnSelect(this.appWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure, "ContinuousDrawingMeasure");
- if (!this.appWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure)
- {
- this.appWorkspace.cameraPreviewDialog.documentWorkspace.ActiveTool = DrawToolType.Pointer;
- }
- if (this.appWorkspace.ActiveDocumentWorkspace != null
- && this.appWorkspace.ActiveDocumentWorkspace.ActiveTool >= DrawToolType.MeasureLine
- && this.appWorkspace.ActiveDocumentWorkspace.ActiveTool <= DrawToolType.MeasureThreePointArc)
- {
- this.appWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
- }
- DocumentView.ContinuousDrawing = true;
- }
- }
- /// <summary>
- /// 删除一条数据
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Delete_Click(object sender, EventArgs e)
- {
- if (this.listView1.FocusedItem != null && this.listView1.FocusedItem.Selected)
- {
- var index = this.listView1.FocusedItem.Index;
- DrawObject drawObject = (DrawObject)this.listView1.Items[index].Tag;
- _p2Document?.GraphicsList.RemoveObj(drawObject);
- this.listView1.Items.RemoveAt(index);
- if (this.appWorkspace.DocumentWorkspaces != null && this.appWorkspace.DocumentWorkspaces.Length > 0)
- {
- for (int k = 0; k <= this.appWorkspace.DocumentWorkspaces.Length - 1; k++)
- {
- for (int i = 0; i < this.appWorkspace.DocumentWorkspaces[k].GraphicsList.Count; i++)
- {
- if (!this.appWorkspace.DocumentWorkspaces[k].GraphicsList[i].Equals(drawObject))
- {
- continue;
- }
- this.appWorkspace.DocumentWorkspaces[k].GraphicsList.RemoveObj(drawObject);
- this.appWorkspace.DocumentWorkspaces[k].Refresh();
- }
- }
- }
- }
- }
- /// <summary>
- /// 清空数据
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void Clear_Click(object sender, EventArgs e)
- {
- this.listView1.Items.Clear();
- if (this.appWorkspace.DocumentWorkspaces != null && this.appWorkspace.DocumentWorkspaces.Length > 0)
- {
- for (int k = 0; k <= this.appWorkspace.DocumentWorkspaces.Length - 1; k++)
- {
- this.appWorkspace.DocumentWorkspaces[k].GraphicsList.Clear();
- this.appWorkspace.DocumentWorkspaces[k].Refresh();
- }
- }
- _p2Document?.GraphicsList.Clear();
- }
- /// <summary>
- /// 获取别名
- /// </summary>
- /// <returns></returns>
- private string getNickName(DrawObject measureDrawObject)
- {
- try
- {
- var enName = measureDrawObject.drawToolType.ToString();
- string name;
- getAliasName(out name, enName);
- if (string.IsNullOrEmpty(name))
- {
- foreach (var item in measureListSetModel.AttributeMapAllDataNodes)
- {
- var tool = item.Attribute.Where(m => m.Name.Equals(enName)).FirstOrDefault();
- if (tool == null)
- {
- continue;
- }
- if (toolNameList.Contains(tool.Text))
- {
- var index = toolNameList.IndexOf(tool.Text);
- return string.IsNullOrEmpty(toolNickNameList[index]) ? toolNameList[index] : toolNickNameList[index];
- }
- return tool.Text;
- }
- }
- return name;
- }
- catch (Exception)
- {
- return "默认";
- }
- }
- /// <summary>
- /// 获取数据
- /// </summary>
- /// <param name="drawToolType"></param>
- /// <returns></returns>
- private void getLstViewItem(DrawObject measureDrawObject, int index)
- {
- double length;
- double area;
- double angle;
- string name = getNickName(measureDrawObject) + index;
- MeasureDrawObject measureData = (MeasureDrawObject)measureDrawObject;
- Dictionary<System.Enum, object> data = measureData.GetData();
- switch (measureDrawObject.drawToolType)
- {
- case DrawToolType.MeasureLine:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- area = 0;
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureDistanceLine:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- area = 0;
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureLength:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- area = 0;
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureHLine:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- area = 0;
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureVLine:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- area = 0;
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureMulLine:
- MeasureMulLine line = (MeasureMulLine)measureDrawObject;
- area = 0;
- angle = 0;
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- for (int i = 0; i <= line.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, Convert.ToDouble(line.lengthParagraphs[i]), area, angle, measureDrawObject);
- }
- }
- else
- {
- for (int i = 0; i <= line.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, 0, area, angle, measureDrawObject);
- }
- }
- break;
- case DrawToolType.MeasureMulHVLine:
- MeasureMulHVLine measureMulHVLine = (MeasureMulHVLine)measureDrawObject;
- area = 0;
- angle = 0;
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- for (int i = 0; i <= measureMulHVLine.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, Convert.ToDouble(measureMulHVLine.lengthParagraphs[i]), area, angle, measureDrawObject);
- }
- }
- else
- {
- for (int i = 0; i <= measureMulHVLine.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, 0, area, angle, measureDrawObject);
- }
- }
- break;
- case DrawToolType.MeasureMulSegment:
- MeasureMulSegment measureMulSegment = (MeasureMulSegment)measureDrawObject;
- area = 0;
- angle = 0;
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- for (int i = 0; i <= measureMulSegment.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, Convert.ToDouble(measureMulSegment.lengthParagraphs[i]), area, angle, measureDrawObject);
- }
- }
- else
- {
- for (int i = 0; i <= measureMulSegment.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, 0, area, angle, measureDrawObject);
- }
- }
- break;
- case DrawToolType.MeasureMulVLine:
- MeasureMulVLine measureMulVLine = (MeasureMulVLine)measureDrawObject;
- area = 0;
- angle = 0;
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- for (int i = 0; i <= measureMulVLine.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, Convert.ToDouble(measureMulVLine.lengthParagraphs[i]), area, angle, measureDrawObject);
- }
- }
- else
- {
- for (int i = 0; i <= measureMulVLine.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, 0, area, angle, measureDrawObject);
- }
- }
- break;
- case DrawToolType.MeasureBrokenLine:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- area = 0;
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureTraceCurve:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- area = 0;
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureCurveLine:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- area = 0;
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasurePLine:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- area = 0;
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureMulPLine:
- MeasureMulPLine measureMulPLine = (MeasureMulPLine)measureDrawObject;
- area = 0;
- angle = 0;
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- for (int i = 0; i <= measureMulPLine.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, Convert.ToDouble(measureMulPLine.lengthParagraphs[i]), area, angle, measureDrawObject);
- }
- }
- else
- {
- for (int i = 0; i <= measureMulPLine.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, 0, area, angle, measureDrawObject);
- }
- }
- break;
- case DrawToolType.MeasureHMulPLine:
- MeasureHMulPLine measureHMulPLine = (MeasureHMulPLine)measureDrawObject;
- area = 0;
- angle = 0;
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- for (int i = 0; i <= measureHMulPLine.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, Convert.ToDouble(measureHMulPLine.lengthParagraphs[i]), area, angle, measureDrawObject);
- }
- }
- else
- {
- for (int i = 0; i <= measureHMulPLine.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, 0, area, angle, measureDrawObject);
- }
- }
- break;
- case DrawToolType.MeasureVMulPLine:
- MeasureVMulPLine measureVMulPLine = (MeasureVMulPLine)measureDrawObject;
- area = 0;
- angle = 0;
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- for (int i = 0; i <= measureVMulPLine.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, Convert.ToDouble(measureVMulPLine.lengthParagraphs[i]), area, angle, measureDrawObject);
- }
- }
- else
- {
- for (int i = 0; i <= measureVMulPLine.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, 0, area, angle, measureDrawObject);
- }
- }
- break;
- case DrawToolType.MeasurePointHLine:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- area = 0;
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureParallelLine:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- area = 0;
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureMulParallelLine:
- MeasureMulParallelLine measureVMulPLine1 = (MeasureMulParallelLine)measureDrawObject;
- area = 0;
- angle = 0;
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- for (int i = 0; i <= measureVMulPLine1.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, Convert.ToDouble(measureVMulPLine1.lengthParagraphs[i]), area, angle, measureDrawObject);
- }
- }
- else
- {
- for (int i = 0; i <= measureVMulPLine1.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, 0, area, angle, measureDrawObject);
- }
- }
- break;
- case DrawToolType.MeasureVMulParallelLine:
- MeasureVMulParallelLine measureVMulParallelLine = (MeasureVMulParallelLine)measureDrawObject;
- area = 0;
- angle = 0;
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- for (int i = 0; i <= measureVMulParallelLine.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, Convert.ToDouble(measureVMulParallelLine.lengthParagraphs[i]), area, angle, measureDrawObject);
- }
- }
- else
- {
- for (int i = 0; i <= measureVMulParallelLine.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, 0, area, angle, measureDrawObject);
- }
- }
- break;
- case DrawToolType.MeasureHMulParallelLine:
- MeasureHMulParallelLine measureHMulParallelLine = (MeasureHMulParallelLine)measureDrawObject;
- area = 0;
- angle = 0;
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- for (int i = 0; i <= measureHMulParallelLine.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, Convert.ToDouble(measureHMulParallelLine.lengthParagraphs[i]), area, angle, measureDrawObject);
- }
- }
- else
- {
- for (int i = 0; i <= measureHMulParallelLine.lengthParagraphs.Count - 1; i++)
- {
- addListViewData(name, 0, area, angle, measureDrawObject);
- }
- }
- break;
- case DrawToolType.MeasureClosedCurve:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasurePolygon:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureRectangle:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureRandRectangle:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureSquare:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureRandSquare:
- MeasureDrawObject measureRandSquare = (MeasureDrawObject)measureDrawObject;
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureTracePolygon:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureCircle:
- if (data.ContainsKey(MeasureAttributes.PhysicalRadius))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalRadius, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureInnerCircle:
- if (data.ContainsKey(MeasureAttributes.PhysicalRadius))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalRadius, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureOuterCircle:
- if (data.ContainsKey(MeasureAttributes.PhysicalRadius))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalRadius, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureDiameterCircle:
- if (data.ContainsKey(MeasureAttributes.PhysicalRadius))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalRadius, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasurePointCenterSize:
- if (data.ContainsKey(MeasureAttributes.PhysicalDistance))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalDistance, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureCenterCenterSize:
- if (data.ContainsKey(MeasureAttributes.PhysicalDistance))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalDistance, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasurePointArcSize:
- if (data.ContainsKey(MeasureAttributes.PhysicalDistance))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalDistance, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureTwoLineVLDistance:
- if (data.ContainsKey(MeasureAttributes.PhysicalLength))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- area = 0;
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasurePointEdgeSize:
- if (data.ContainsKey(MeasureAttributes.PhysicalDistance))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalDistance, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- angle = 0;
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureThreePointAngle:
- length = 0;
- area = 0;
- if (data.ContainsKey(MeasureAttributes.Angle))
- {
- object val;
- data.TryGetValue(MeasureAttributes.Angle, out val);
- angle = Convert.ToDouble(val);
- }
- else
- {
- angle = 0;
- }
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureFourPointAngle:
- length = 0;
- area = 0;
- if (data.ContainsKey(MeasureAttributes.Angle))
- {
- object val;
- data.TryGetValue(MeasureAttributes.Angle, out val);
- angle = Convert.ToDouble(val);
- }
- else
- {
- angle = 0;
- }
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- case DrawToolType.MeasureThreePointArc:
- if (data.ContainsKey(MeasureAttributes.PhysicalRadius))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalRadius, out val);
- length = Convert.ToDouble(val);
- }
- else
- {
- length = 0;
- }
- if (data.ContainsKey(MeasureAttributes.PhysicalArea))
- {
- object val;
- data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
- area = Convert.ToDouble(val);
- }
- else
- {
- area = 0;
- }
- if (data.ContainsKey(MeasureAttributes.Angle))
- {
- object val;
- data.TryGetValue(MeasureAttributes.Angle, out val);
- angle = Convert.ToDouble(val);
- }
- else
- {
- angle = 0;
- }
- addListViewData(name, length, area, angle, measureDrawObject, 1);
- break;
- }
- }
- /// <summary>
- /// 添加数据
- /// </summary>
- /// <param name="name"></param>
- /// <param name="length"></param>
- /// <param name="area"></param>
- /// <param name="angle"></param>
- /// <param name="drawObject"></param>
- /// <param name="type"></param>
- private void addListViewData(string name, double length, double area, double angle, DrawObject drawObject, int type = 2)
- {
- if (!hasAttributes(drawObject.drawToolType.ToString(), "PhysicalLength") && !hasAttributes(drawObject.drawToolType.ToString(), "PhysicalRadius") && !hasAttributes(drawObject.drawToolType.ToString(), "PhysicalDistance") && !hasAttributes(drawObject.drawToolType.ToString(), "PhysicalCircumference"))
- {
- length = 0;
- }
- if (!hasAttributes(drawObject.drawToolType.ToString(), "PhysicalArea"))
- {
- area = 0;
- }
- if (!hasAttributes(drawObject.drawToolType.ToString(), "Angle"))
- {
- angle = 0;
- }
- int round = Convert.ToInt32(this.numericUpDown5.Value);
- length = Math.Round(length, round);
- area = Math.Round(area, round);
- angle = Math.Round(angle, round);
- ListViewItem lvi = new ListViewItem();
- lvi.Text = name;
- lvi.SubItems.Add(name);
- lvi.SubItems.Add(length == 0 ? "-" : length.ToString());
- lvi.SubItems.Add(angle == 0 ? "-" : angle.ToString());
- lvi.SubItems.Add(area == 0 ? "-" : area.ToString());
- lvi.Tag = drawObject;
- if (comboBox1.SelectedIndex == 0 || comboBox1.SelectedIndex == type)
- {
- this.listView1.Items.Add(lvi);
- }
- if (this.filterDict.ContainsKey(type))
- {
- this.filterDict[type].Add(lvi);
- }
- else
- {
- this.filterDict.Add(type, new List<ListViewItem>() { lvi });
- }
- }
- /// <summary>
- /// 刷新列表数据
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- public void RefreshListView(object sender, EventArgs e)
- {
- this.listView1.Items.Clear();
- this.filterDict.Clear();
- if (this.appWorkspace.DocumentWorkspaces != null && this.appWorkspace.DocumentWorkspaces.Length > 0)
- {
- for (int k = 0; k <= this.appWorkspace.DocumentWorkspaces.Length - 1; k++)
- {
- int index = 1;
- for (int i = this.appWorkspace.DocumentWorkspaces[k].GraphicsList.Count - 1; i >= 0; i--)
- {
- if (this.appWorkspace.DocumentWorkspaces[k].GraphicsList[i].objectType == DrawClass.Measure)
- {
- var drawTool = (MeasureDrawObject)this.appWorkspace.DocumentWorkspaces[k].GraphicsList[i];
- getLstViewItem(drawTool, index);
- index++;
- }
- }
- }
- }
- if (_p2Document != null)
- {
- for (int i = 0; i < _p2Document.GraphicsList.Count; i++)
- {
- if (_p2Document.GraphicsList[i].objectType == DrawClass.Measure)
- {
- var drawTool = (MeasureDrawObject)_p2Document.GraphicsList[i];
- getLstViewItem(drawTool, i + 1);
- }
- }
- }
- }
- /// <summary>
- /// 小数位数修改
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void numericUpDown5_ValueChanged(object sender, EventArgs e)
- {
- if (this.appWorkspace.Widgets != null)
- this.appWorkspace.Widgets.MeasureListDialog.numericUpDown1.Value = numericUpDown5.Value;
- RefreshListView(null, null);
- }
- /// <summary>
- /// 输出
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void button1_Click(object sender, EventArgs e)
- {
- if (this.listView1.Items.Count > 0)
- {
- this.InitialDataExcel();
- }
- else
- MessageBox.Show("暂无数据可导出");
- }
- /// <summary>
- /// 导出Excel
- /// </summary>
- private void InitialDataExcel()
- {
- DataTable dtb = new DataTable();
- for (int c = 0; c < 5; c++)
- {
- dtb.Columns.Add(c.ToString());
- }
- // 单位
- DataRow dataRow = dtb.NewRow();
- dataRow[0] = "单位";
- dataRow[1] = this.appWorkspace.GetPxPerUnit()[2];
- dtb.Rows.Add(dataRow);
- // 标题
- dataRow = dtb.NewRow();
- dataRow[0] = "图片名称";
- dataRow[1] = "分组";
- dataRow[2] = "测量工具名称";
- dataRow[3] = "测量属性名称";
- dataRow[4] = "值";
- dtb.Rows.Add(dataRow);
- // 所有图片
- for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
- {
- // 图片名称
- string imgName = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
- List<string> measures = new List<string>();
- // 所有测量工具
- for (int g = this.appWorkspace.DocumentWorkspaces[i].GraphicsList.Count - 1; g >= 0; g--)
- {
- if (this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g].objectType == DrawClass.Measure)
- {
- if (comboBox1.SelectedIndex != 0)
- {
- //判断是单值还是多值,能否通过
- if (!isOddOrven(this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g]))
- {
- continue;
- }
- }
- measures.Add(this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g].drawToolType.ToString());
- // 测量数据
- Dictionary<System.Enum, object> data = ((MeasureDrawObject)this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g]).GetData();
- // 测量工具名称
- string drawName = PdnResources.GetString("Menu.MeasureAction." + this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g].drawToolType.ToString() + ".Text");
- List<string> drawingPropertiesList = new List<string>();
- var name = this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g].drawToolType.ToString();
- foreach (var item in measureListSetModel.AttributeMapDataNodes)
- {
- var tool = item.Attribute.Where(m => m.Name.Equals(name)).FirstOrDefault();
- if (tool != null)
- {
- foreach (var str in tool.Attribute)
- {
- drawingPropertiesList.Add(str.Name);
- }
- }
- }
- //((MeasureDrawObject)this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g]).drawingProperties.TryGetValue(this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g].drawToolType, out drawingPropertiesList);
- int addCount = 0;
- foreach (var measure in measures)
- {
- if (measure.Equals(this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g].drawToolType.ToString()))
- addCount++;
- }
- int round = Convert.ToInt32(this.numericUpDown5.Value);
- // 所有可见的属性
- foreach (var item in drawingPropertiesList)
- {
- dataRow = dtb.NewRow();
- string itemFirst = item.Substring(0, 1);
- string itemToLower = item.Substring(1, item.Length - 1).ToLower();
- string itemAll = itemFirst + itemToLower;
- // 测量属性名称
- string attributeName = PdnResources.GetString("Menu." + itemAll + ".text");
- // 属性值
- object value;
- MeasureAttributes type = (MeasureAttributes)System.Enum.Parse(typeof(MeasureAttributes), item);
- data.TryGetValue(type, out value);
- dataRow[0] = imgName;
- dataRow[1] = addCount;
- dataRow[2] = drawName;
- dataRow[3] = attributeName;
- dataRow[4] = Math.Round(Convert.ToDouble(value), round);
- dtb.Rows.Add(dataRow);
- }
- if (((MeasureDrawObject)this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g]).lengthParagraphs != null
- && ((MeasureDrawObject)this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g]).lengthParagraphs.Count > 0)
- {
- int length = 0;
- foreach (var lengthParagraph in ((MeasureDrawObject)this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g]).lengthParagraphs)
- {
- length++;
- dataRow = dtb.NewRow();
- dataRow[0] = imgName;
- dataRow[1] = addCount;
- dataRow[2] = drawName;
- dataRow[3] = "物理长度(段" + length + ")";
- dataRow[4] = Math.Round(Convert.ToDouble(lengthParagraph), round);
- dtb.Rows.Add(dataRow);
- }
- }
- }
- }
- }
- MeasureListSettingDialog measureListSettingDialog = new MeasureListSettingDialog(this, "Template.Manager.item1.MeasureListAll", this.appWorkspace, dtb);
- if (measureListSettingDialog.hasModule)
- {
- measureListSettingDialog.StartPosition = FormStartPosition.CenterScreen;
- measureListSettingDialog.ShowDialog();
- }
- else
- {
- measureListSettingDialog = null;
- }
- }
- /// <summary>
- /// 判断是单值还是多值
- /// </summary>
- /// <param name="drawObject"></param>
- /// <returns></returns>
- private bool isOddOrven(DrawObject drawObject)
- {
- int index = this.comboBox1.SelectedIndex;
- switch (index)
- {
- case 1:
- if (moreTypeList.Contains(drawObject.drawToolType.ToString()))
- {
- return false;
- }
- break;
- case 2:
- if (!moreTypeList.Contains(drawObject.drawToolType.ToString()))
- {
- return false;
- }
- break;
- }
- return true;
- }
- /// <summary>
- /// 判断是否含有属性
- /// </summary>
- /// <returns></returns>
- private bool hasAttributes(string enMapName, string AttributesName)
- {
- foreach (var item in measureListSetModel.AttributeMapDataNodes)
- {
- var tool = item.Attribute.Where(m => m.Name.Equals(enMapName)).FirstOrDefault();
- if (tool != null)
- {
- var hasAttr = tool.Attribute.Where(m => m.Name.Equals(AttributesName)).FirstOrDefault();
- if (hasAttr != null)
- {
- return true;
- }
- }
- }
- return false;
- }
- /// <summary>
- /// 筛选
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- this.listView1.Items.Clear();
- switch (comboBox1.SelectedIndex)
- {
- case 0:
- foreach (var item in filterDict)
- {
- listView1.Items.AddRange(item.Value.ToArray());
- }
- break;
- case 1:
- List<ListViewItem> list;
- filterDict.TryGetValue(1, out list);
- if (list != null)
- {
- listView1.Items.AddRange(list.ToArray());
- }
- break;
- case 2:
- List<ListViewItem> list2;
- filterDict.TryGetValue(2, out list2);
- if (list2 != null)
- {
- listView1.Items.AddRange(list2.ToArray());
- }
- break;
- }
- }
- private void saveLastData(object sender, EventArgs e)
- {
- #region [树状信息保存]
- // 数据属性树状图保存
- measureListSetModel.AttributeMapDataNodes = new List<MeasureListSetModel.FirstNode>();
- for (int i = 0; i < this.treeView1.Nodes.Count; i++)
- {
- MeasureListSetModel.FirstNode firstNode = new MeasureListSetModel.FirstNode();
- firstNode.Attribute = new List<MeasureListSetModel.FirstNode.SecondNode>();
- firstNode.Name = this.treeView1.Nodes[i].Text;
- if (this.treeView1.Nodes[i].Nodes.Count > 0)
- {
- for (int j = 0; j < this.treeView1.Nodes[i].Nodes.Count; j++)
- {
- MeasureListSetModel.FirstNode.SecondNode second = new MeasureListSetModel.FirstNode.SecondNode();
- second.Attribute = new List<MeasureListSetModel.FirstNode.SecondNode.Item>();
- second.Text = this.treeView1.Nodes[i].Nodes[j].Text;
- second.Name = this.treeView1.Nodes[i].Nodes[j].Name;
- foreach (TreeNode Node in this.treeView1.Nodes[i].Nodes[j].Nodes)
- {
- MeasureListSetModel.FirstNode.SecondNode.Item item = new MeasureListSetModel.FirstNode.SecondNode.Item();
- item.Text = Node.Text;
- item.Name = Node.Name;
- second.Attribute.Add(item);
- }
- firstNode.Attribute.Add(second);
- }
- }
- measureListSetModel.AttributeMapDataNodes.Add(firstNode);
- }
- // 数据属性(元素)树状图保存
- measureListSetModel.AttributeMapAllDataNodes = new List<MeasureListSetModel.FirstNode>();
- for (int i = 0; i < this.treeView2.Nodes.Count; i++)
- {
- MeasureListSetModel.FirstNode firstNode = new MeasureListSetModel.FirstNode();
- firstNode.Attribute = new List<MeasureListSetModel.FirstNode.SecondNode>();
- firstNode.Name = this.treeView2.Nodes[i].Text;
- if (this.treeView2.Nodes[i].Nodes.Count > 0)
- {
- for (int j = 0; j < this.treeView2.Nodes[i].Nodes.Count; j++)
- {
- MeasureListSetModel.FirstNode.SecondNode second = new MeasureListSetModel.FirstNode.SecondNode();
- second.Attribute = new List<MeasureListSetModel.FirstNode.SecondNode.Item>();
- second.Text = this.treeView2.Nodes[i].Nodes[j].Text;
- second.Name = this.treeView2.Nodes[i].Nodes[j].Name;
- foreach (TreeNode Node in this.treeView2.Nodes[i].Nodes[j].Nodes)
- {
- MeasureListSetModel.FirstNode.SecondNode.Item item = new MeasureListSetModel.FirstNode.SecondNode.Item();
- item.Text = Node.Text;
- item.Name = Node.Name;
- second.Attribute.Add(item);
- }
- firstNode.Attribute.Add(second);
- }
- }
- measureListSetModel.AttributeMapAllDataNodes.Add(firstNode);
- }
- string configXml = XmlSerializeHelper.XmlSerialize(measureListSetModel);
- string filePath = System.Windows.Forms.Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\MeasureListInteractiveModel.xml";
- FileOperationHelper.WriteStringToFile(configXml, filePath, FileMode.Create);
- #endregion
- #region [保存参数]
- if (measureListInteractiveDataModel == null)
- {
- measureListInteractiveDataModel = new MeasureListInteractiveDataModel();
- }
- measureListInteractiveDataModel.FastToolList = new List<FastTool>();
- foreach (var item in toolNameList)
- {
- var index = toolNameList.IndexOf(item);
- string enName = string.Empty;
- foreach (var item1 in measureListSetModel.AttributeMapAllDataNodes)
- {
- var tool = item1.Attribute.Where(m => m.Text.Equals(item)).FirstOrDefault();
- if (tool == null)
- {
- continue;
- }
- enName = tool.Name;
- }
- var fastTool = new FastTool();
- fastTool.name = item;
- fastTool.enName = enName;
- fastTool.nickName = toolNickNameList[index];
- measureListInteractiveDataModel.FastToolList.Add(fastTool);
- }
- measureListInteractiveDataModel.hasUsed = true;
- measureListInteractiveDataModel.num = Convert.ToInt32(this.numericUpDown5.Value);
- measureListInteractiveDataModel.selectIndex = comboBox1.SelectedIndex;
- filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\ParameterSaving\\MeasureListInteractiveDataModel.xml";
- string porosityInfoXml = XmlSerializeHelper.XmlSerialize<MeasureListInteractiveDataModel>(measureListInteractiveDataModel);
- FileOperationHelper.WriteStringToFile(porosityInfoXml, filePath, FileMode.Create);
- #endregion
- }
- private void GeometryMeasureDialog_FormClosing(object sender, FormClosingEventArgs e)
- {
- this.appWorkspace.toolBar.RefreshBtnSelect(false, "Geometry");
- this.appWorkspace.toolsPanel.RefreshBtnSelect(false, "Geometry");
- }
- }
- }
|