GeometryMeasureDialog.cs 140 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392
  1. using Metis.ParameterSet;
  2. using PaintDotNet;
  3. using PaintDotNet.Annotation;
  4. using PaintDotNet.Annotation.Enum;
  5. using PaintDotNet.Annotation.Measure;
  6. using PaintDotNet.Base.CommTool;
  7. using PaintDotNet.Base.SettingModel;
  8. using PaintDotNet.Menus;
  9. using System;
  10. using System.Collections;
  11. using System.Collections.Generic;
  12. using System.ComponentModel;
  13. using System.Data;
  14. using System.Drawing;
  15. using System.IO;
  16. using System.Linq;
  17. using System.Text;
  18. using System.Threading.Tasks;
  19. using System.Windows.Forms;
  20. namespace Metis.Measuring
  21. {
  22. internal partial class GeometryMeasureDialog : FloatingToolForm
  23. {
  24. /// <summary>
  25. /// 展开前宽度
  26. /// </summary>
  27. private int smallHeight = 339;
  28. /// <summary>
  29. /// 展开后宽度
  30. /// </summary>
  31. private int bigHelght = 996;
  32. /// <summary>
  33. /// 是否展开
  34. /// </summary>
  35. private bool isEnlarge = false;
  36. /// <summary>
  37. /// 测量属性实体
  38. /// </summary>
  39. private MeasureListSetModel measureListSetModel;
  40. private ImageList imageList1 = new ImageList();
  41. /// <summary>
  42. /// 工具集合
  43. /// </summary>
  44. private List<string> toolNameList = new List<string>();
  45. /// <summary>
  46. /// 工具别名集合
  47. /// </summary>
  48. private List<string> toolNickNameList = new List<string>();
  49. private Dictionary<int, List<ListViewItem>> filterDict = new Dictionary<int, List<ListViewItem>>();
  50. private AppWorkspace appWorkspace;
  51. DocumentWorkspaceWindow _p2Document => MeasureActionMenu._p2Form?._document;
  52. private MeasureListInteractiveDataModel measureListInteractiveDataModel;
  53. private MeasureStyleModel measureStyleModel = Startup.instance.measureStyleModel;
  54. /// <summary>
  55. /// 多值类型
  56. /// </summary>
  57. private List<string> moreTypeList = new List<string>() { "MeasureMulLine", "MeasureMulHVLine", "MeasureMulSegment", "MeasureMulVLine",
  58. "MeasureMulPLine", "MeasureHMulPLine","MeasureVMulPLine","MeasureMulParallelLine","MeasureVMulParallelLine","MeasureHMulParallelLine", };
  59. #region 控件
  60. private GroupBox groupBox2;
  61. private GroupBox groupBox3;
  62. private Label label1;
  63. private ComboBox comboBox1;
  64. private Label label6;
  65. private Label label5;
  66. private Label label4;
  67. private Label label3;
  68. private Label label2;
  69. public NumericUpDown numericUpDown5;
  70. private Button button3;
  71. private Button button2;
  72. private Button button1;
  73. private GroupBox groupBox4;
  74. private GroupBox groupBox5;
  75. private GroupBox groupBox6;
  76. private GroupBox groupBox7;
  77. private GroupBox groupBox8;
  78. private Button button4;
  79. private PaintDotNet.CustomControl.TreeViewEnhanced treeView1;
  80. private PaintDotNet.CustomControl.TreeViewEnhanced treeView2;
  81. private Button button8;
  82. private Button button7;
  83. private Button button6;
  84. private Button button5;
  85. private Button button12;
  86. private Button button11;
  87. private Button button10;
  88. private Button button9;
  89. private ListView listView2;
  90. private RadioButton radioButton8;
  91. private RadioButton radioButton7;
  92. private RadioButton radioButton6;
  93. private RadioButton radioButton5;
  94. private RadioButton radioButton4;
  95. private RadioButton radioButton3;
  96. private RadioButton radioButton2;
  97. private RadioButton radioButton1;
  98. private TextBox textBox2;
  99. private TextBox textBox1;
  100. private TextBox textBox4;
  101. private TextBox textBox3;
  102. private TextBox textBox8;
  103. private TextBox textBox7;
  104. private TextBox textBox6;
  105. private TextBox textBox5;
  106. private ListView listView1;
  107. private GroupBox groupBox1;
  108. #endregion
  109. public GeometryMeasureDialog(AppWorkspace appWorkspace)
  110. {
  111. InitializeComponent();
  112. InitializeLanguageText();
  113. this.Width = this.smallHeight;
  114. this.textBox1.Focus();
  115. this.appWorkspace = appWorkspace;
  116. this.comboBox1.SelectedIndex = 0;
  117. #region [初始化listView1]
  118. this.listView1.View = View.Details;
  119. ColumnHeader header1 = new ColumnHeader();
  120. header1.Text = PdnResources.GetString("Menu.params.text");
  121. header1.TextAlign = HorizontalAlignment.Center;
  122. header1.Width = 0;
  123. this.listView1.Columns.Add(header1);
  124. ColumnHeader header5 = new ColumnHeader();
  125. header5.Text = PdnResources.GetString("Menu.params.text");
  126. header5.TextAlign = HorizontalAlignment.Center;
  127. header5.Width = 73;
  128. this.listView1.Columns.Add(header5);
  129. ColumnHeader header2 = new ColumnHeader();
  130. header2.Text = PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text");
  131. header2.TextAlign = HorizontalAlignment.Center;
  132. header2.Width = 73;
  133. this.listView1.Columns.Add(header2);
  134. ColumnHeader header3 = new ColumnHeader();
  135. header3.Text = PdnResources.GetString("Menu.TheAngle.text");
  136. header3.TextAlign = HorizontalAlignment.Center;
  137. header3.Width = 73;
  138. this.listView1.Columns.Add(header3);
  139. ColumnHeader header4 = new ColumnHeader();
  140. header4.Text = PdnResources.GetString("Menu.area.text");
  141. header4.TextAlign = HorizontalAlignment.Center;
  142. header4.Width = 73;
  143. this.listView1.Columns.Add(header4);
  144. this.imageList1.ImageSize = new System.Drawing.Size(2, 30);
  145. this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
  146. this.listView1.SmallImageList = this.imageList1;
  147. #endregion
  148. #region [初始化listView2]
  149. this.listView2.View = View.Details;
  150. ColumnHeader header = new ColumnHeader();
  151. header.Text = PdnResources.GetString("Menu.Type.text");
  152. header.TextAlign = HorizontalAlignment.Center;
  153. header.Width = 70;
  154. this.listView2.Columns.Add(header);
  155. this.imageList1.ImageSize = new System.Drawing.Size(2, 30);
  156. this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
  157. this.listView2.SmallImageList = this.imageList1;
  158. #endregion
  159. #region [获取测量属性实体]
  160. measureListSetModel = XmlSerializeHelper.DESerializer<MeasureListSetModel>(FileOperationHelper.ReadStringFromFile(System.Windows.Forms.Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\MeasureListInteractiveModel.xml", FileMode.Open));
  161. #endregion
  162. #region [数据属性初始化]
  163. this.treeView1.ItemHeight = 18;
  164. this.treeView2.ItemHeight = 18;
  165. this.allDataTree();
  166. #endregion
  167. #region [元素属性初始化]
  168. this.allToolTree();
  169. #endregion
  170. #region [默认展示长度及角度]
  171. if (this.appWorkspace.Units == null)
  172. {
  173. label3.Text = "µm";
  174. }
  175. else
  176. {
  177. switch (this.appWorkspace.Units)
  178. {
  179. case MeasurementUnit.Inch://英寸
  180. label3.Text = "in";
  181. break;
  182. case MeasurementUnit.Mil://米尔
  183. label3.Text = "mil";
  184. break;
  185. case MeasurementUnit.Centimeter://厘米
  186. label3.Text = "cm";
  187. break;
  188. case MeasurementUnit.Millimeter://毫米
  189. label3.Text = "mm";
  190. break;
  191. case MeasurementUnit.Micron://微米
  192. label3.Text = "µm";
  193. break;
  194. case MeasurementUnit.Nano://纳米
  195. label3.Text = "nm";
  196. break;
  197. default:
  198. label3.Text = "µm";
  199. break;
  200. }
  201. }
  202. MeasureStyleModel model = XmlSerializeHelper.DESerializer<MeasureStyleModel>(FileOperationHelper.ReadStringFromFile(Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\Measure\\" + Startup.instance.configModel.MeasurementStyle, FileMode.Open));
  203. label5.Text = model.measureThreePointAngle.isAngle ? PdnResources.GetString("GeometryMeasure.mil") : PdnResources.GetString("Menu.degree.Text");
  204. #endregion
  205. #region [获取参数]
  206. this.getLastData();
  207. #endregion
  208. this.appWorkspace.ActiveDocumentWorkspaceChanged += new EventHandler(RefreshListView);
  209. this.FormClosing += new FormClosingEventHandler(this.saveLastData);
  210. }
  211. private new void InitializeLanguageText()
  212. {
  213. //this.groupBox13.Text = PdnResources.GetString("Menu.Puzzleeffect.text");
  214. this.groupBox8.Text = PdnResources.GetString("Menu.imagecapture.Imagestitching.Focus.text");
  215. this.comboBox1.Items.AddRange(new object[] {
  216. PdnResources.GetString("GeometryMeasure.Whole"),
  217. PdnResources.GetString("GeometryMeasure.SingleValue"),
  218. PdnResources.GetString("GeometryMeasure.Multivalued")});
  219. this.groupBox1.Text = PdnResources.GetString("Menu.Tools.ToolsFast.Text");
  220. this.radioButton8.Text = PdnResources.GetString("Menu.Isnotset.Text");
  221. this.radioButton7.Text = PdnResources.GetString("Menu.Isnotset.Text");
  222. this.radioButton6.Text = PdnResources.GetString("Menu.Isnotset.Text");
  223. this.radioButton5.Text = PdnResources.GetString("Menu.Isnotset.Text");
  224. this.radioButton4.Text = PdnResources.GetString("Menu.Isnotset.Text");
  225. this.radioButton3.Text = PdnResources.GetString("Menu.Isnotset.Text");
  226. this.radioButton2.Text = PdnResources.GetString("Menu.Isnotset.Text");
  227. this.radioButton1.Text = PdnResources.GetString("Menu.Isnotset.Text");
  228. this.groupBox2.Text = PdnResources.GetString("MeasureAction.DataSheet");
  229. this.label1.Text = PdnResources.GetString("Menu.filter.text") + ":";
  230. this.groupBox3.Text = PdnResources.GetString("Menu.operation.text");
  231. this.button3.Text = PdnResources.GetString("Menu.Edit.Delete.Text");
  232. this.button2.Text = PdnResources.GetString("Menu.Empty.text");
  233. this.button1.Text = PdnResources.GetString("MeasureAction.output");
  234. this.label6.Text = PdnResources.GetString("MeasureAction.DecimalPlaces") + ":";
  235. this.label5.Text = PdnResources.GetString("Menu.degree.Text");
  236. this.label4.Text = PdnResources.GetString("Menu.TheAngle.text") + ":";
  237. this.label2.Text = PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text") + ":";
  238. this.groupBox4.Text = PdnResources.GetString("Menu.Tools.ToolsFast.Text");
  239. this.groupBox5.Text = PdnResources.GetString("Menu.Dataattrs.text");
  240. this.groupBox6.Text = PdnResources.GetString("Menu.Tools.Text");
  241. this.button8.Text = PdnResources.GetString("Menu.down.Text");
  242. this.button7.Text = PdnResources.GetString("Menu.upward.Text");
  243. this.button6.Text = ">" + PdnResources.GetString("MeasureAction.Remove");
  244. this.button5.Text = "<" + PdnResources.GetString("Menu.Addto.text");
  245. this.groupBox7.Text = PdnResources.GetString("MeasureAction.Data");
  246. this.button12.Text = PdnResources.GetString("Menu.down.Text");
  247. this.button11.Text = PdnResources.GetString("Menu.upward.Text");
  248. this.button10.Text = ">" + PdnResources.GetString("MeasureAction.Remove");
  249. this.button9.Text = "<" + PdnResources.GetString("Menu.Addto.text");
  250. this.groupBox8.Text = PdnResources.GetString("Menu.Imagement.Measurementlist.Elementattributes.text");
  251. this.Text = PdnResources.GetString("MeasureAction.InteractiveMeasurement");
  252. }
  253. private void InitializeComponent()
  254. {
  255. this.groupBox1 = new System.Windows.Forms.GroupBox();
  256. this.textBox8 = new System.Windows.Forms.TextBox();
  257. this.textBox7 = new System.Windows.Forms.TextBox();
  258. this.textBox6 = new System.Windows.Forms.TextBox();
  259. this.textBox5 = new System.Windows.Forms.TextBox();
  260. this.textBox2 = new System.Windows.Forms.TextBox();
  261. this.textBox1 = new System.Windows.Forms.TextBox();
  262. this.textBox4 = new System.Windows.Forms.TextBox();
  263. this.textBox3 = new System.Windows.Forms.TextBox();
  264. this.radioButton8 = new System.Windows.Forms.RadioButton();
  265. this.radioButton7 = new System.Windows.Forms.RadioButton();
  266. this.radioButton6 = new System.Windows.Forms.RadioButton();
  267. this.radioButton5 = new System.Windows.Forms.RadioButton();
  268. this.radioButton4 = new System.Windows.Forms.RadioButton();
  269. this.radioButton3 = new System.Windows.Forms.RadioButton();
  270. this.radioButton2 = new System.Windows.Forms.RadioButton();
  271. this.radioButton1 = new System.Windows.Forms.RadioButton();
  272. this.groupBox2 = new System.Windows.Forms.GroupBox();
  273. this.listView1 = new System.Windows.Forms.ListView();
  274. this.comboBox1 = new System.Windows.Forms.ComboBox();
  275. this.label1 = new System.Windows.Forms.Label();
  276. this.groupBox3 = new System.Windows.Forms.GroupBox();
  277. this.button4 = new System.Windows.Forms.Button();
  278. this.button3 = new System.Windows.Forms.Button();
  279. this.button2 = new System.Windows.Forms.Button();
  280. this.button1 = new System.Windows.Forms.Button();
  281. this.numericUpDown5 = new System.Windows.Forms.NumericUpDown();
  282. this.label6 = new System.Windows.Forms.Label();
  283. this.label5 = new System.Windows.Forms.Label();
  284. this.label4 = new System.Windows.Forms.Label();
  285. this.label3 = new System.Windows.Forms.Label();
  286. this.label2 = new System.Windows.Forms.Label();
  287. this.groupBox4 = new System.Windows.Forms.GroupBox();
  288. this.listView2 = new System.Windows.Forms.ListView();
  289. this.groupBox5 = new System.Windows.Forms.GroupBox();
  290. this.treeView1 = new PaintDotNet.CustomControl.TreeViewEnhanced();
  291. this.groupBox6 = new System.Windows.Forms.GroupBox();
  292. this.button8 = new System.Windows.Forms.Button();
  293. this.button7 = new System.Windows.Forms.Button();
  294. this.button6 = new System.Windows.Forms.Button();
  295. this.button5 = new System.Windows.Forms.Button();
  296. this.groupBox7 = new System.Windows.Forms.GroupBox();
  297. this.button12 = new System.Windows.Forms.Button();
  298. this.button11 = new System.Windows.Forms.Button();
  299. this.button10 = new System.Windows.Forms.Button();
  300. this.button9 = new System.Windows.Forms.Button();
  301. this.groupBox8 = new System.Windows.Forms.GroupBox();
  302. this.treeView2 = new PaintDotNet.CustomControl.TreeViewEnhanced();
  303. this.groupBox1.SuspendLayout();
  304. this.groupBox2.SuspendLayout();
  305. this.groupBox3.SuspendLayout();
  306. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).BeginInit();
  307. this.groupBox4.SuspendLayout();
  308. this.groupBox5.SuspendLayout();
  309. this.groupBox6.SuspendLayout();
  310. this.groupBox7.SuspendLayout();
  311. this.groupBox8.SuspendLayout();
  312. this.SuspendLayout();
  313. //
  314. // groupBox1
  315. //
  316. this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  317. | System.Windows.Forms.AnchorStyles.Left)));
  318. this.groupBox1.Controls.Add(this.textBox8);
  319. this.groupBox1.Controls.Add(this.textBox7);
  320. this.groupBox1.Controls.Add(this.textBox6);
  321. this.groupBox1.Controls.Add(this.textBox5);
  322. this.groupBox1.Controls.Add(this.textBox2);
  323. this.groupBox1.Controls.Add(this.textBox1);
  324. this.groupBox1.Controls.Add(this.textBox4);
  325. this.groupBox1.Controls.Add(this.textBox3);
  326. this.groupBox1.Controls.Add(this.radioButton8);
  327. this.groupBox1.Controls.Add(this.radioButton7);
  328. this.groupBox1.Controls.Add(this.radioButton6);
  329. this.groupBox1.Controls.Add(this.radioButton5);
  330. this.groupBox1.Controls.Add(this.radioButton4);
  331. this.groupBox1.Controls.Add(this.radioButton3);
  332. this.groupBox1.Controls.Add(this.radioButton2);
  333. this.groupBox1.Controls.Add(this.radioButton1);
  334. this.groupBox1.Location = new System.Drawing.Point(8, 3);
  335. this.groupBox1.Name = "groupBox1";
  336. this.groupBox1.Size = new System.Drawing.Size(310, 181);
  337. this.groupBox1.TabIndex = 3;
  338. this.groupBox1.TabStop = false;
  339. this.groupBox1.Text = "快捷工具";
  340. //
  341. // textBox8
  342. //
  343. this.textBox8.Location = new System.Drawing.Point(238, 130);
  344. this.textBox8.Name = "textBox8";
  345. this.textBox8.ReadOnly = true;
  346. this.textBox8.Size = new System.Drawing.Size(61, 21);
  347. this.textBox8.TabIndex = 15;
  348. this.textBox8.Leave += new System.EventHandler(this.textBox1_TextChanged);
  349. //
  350. // textBox7
  351. //
  352. this.textBox7.Location = new System.Drawing.Point(83, 130);
  353. this.textBox7.Name = "textBox7";
  354. this.textBox7.ReadOnly = true;
  355. this.textBox7.Size = new System.Drawing.Size(70, 21);
  356. this.textBox7.TabIndex = 14;
  357. this.textBox7.Leave += new System.EventHandler(this.textBox1_TextChanged);
  358. //
  359. // textBox6
  360. //
  361. this.textBox6.Location = new System.Drawing.Point(238, 96);
  362. this.textBox6.Name = "textBox6";
  363. this.textBox6.ReadOnly = true;
  364. this.textBox6.Size = new System.Drawing.Size(61, 21);
  365. this.textBox6.TabIndex = 13;
  366. this.textBox6.Leave += new System.EventHandler(this.textBox1_TextChanged);
  367. //
  368. // textBox5
  369. //
  370. this.textBox5.Location = new System.Drawing.Point(84, 96);
  371. this.textBox5.Name = "textBox5";
  372. this.textBox5.ReadOnly = true;
  373. this.textBox5.Size = new System.Drawing.Size(69, 21);
  374. this.textBox5.TabIndex = 12;
  375. this.textBox5.Leave += new System.EventHandler(this.textBox1_TextChanged);
  376. //
  377. // textBox2
  378. //
  379. this.textBox2.Location = new System.Drawing.Point(238, 26);
  380. this.textBox2.Name = "textBox2";
  381. this.textBox2.ReadOnly = true;
  382. this.textBox2.Size = new System.Drawing.Size(61, 21);
  383. this.textBox2.TabIndex = 11;
  384. this.textBox2.Leave += new System.EventHandler(this.textBox1_TextChanged);
  385. //
  386. // textBox1
  387. //
  388. this.textBox1.Location = new System.Drawing.Point(84, 26);
  389. this.textBox1.Name = "textBox1";
  390. this.textBox1.ReadOnly = true;
  391. this.textBox1.Size = new System.Drawing.Size(69, 21);
  392. this.textBox1.TabIndex = 10;
  393. this.textBox1.Leave += new System.EventHandler(this.textBox1_TextChanged);
  394. //
  395. // textBox4
  396. //
  397. this.textBox4.Location = new System.Drawing.Point(238, 61);
  398. this.textBox4.Name = "textBox4";
  399. this.textBox4.ReadOnly = true;
  400. this.textBox4.Size = new System.Drawing.Size(61, 21);
  401. this.textBox4.TabIndex = 9;
  402. this.textBox4.Leave += new System.EventHandler(this.textBox1_TextChanged);
  403. //
  404. // textBox3
  405. //
  406. this.textBox3.Location = new System.Drawing.Point(84, 62);
  407. this.textBox3.Name = "textBox3";
  408. this.textBox3.ReadOnly = true;
  409. this.textBox3.Size = new System.Drawing.Size(69, 21);
  410. this.textBox3.TabIndex = 8;
  411. this.textBox3.Leave += new System.EventHandler(this.textBox1_TextChanged);
  412. //
  413. // radioButton8
  414. //
  415. this.radioButton8.AutoSize = true;
  416. this.radioButton8.Location = new System.Drawing.Point(165, 132);
  417. this.radioButton8.Name = "radioButton8";
  418. this.radioButton8.Size = new System.Drawing.Size(59, 16);
  419. this.radioButton8.TabIndex = 7;
  420. this.radioButton8.TabStop = true;
  421. this.radioButton8.Text = "未设置";
  422. this.radioButton8.UseVisualStyleBackColor = true;
  423. this.radioButton8.Click += new System.EventHandler(this.radioButton_SelectedChanged);
  424. //
  425. // radioButton7
  426. //
  427. this.radioButton7.AutoSize = true;
  428. this.radioButton7.Location = new System.Drawing.Point(11, 132);
  429. this.radioButton7.Name = "radioButton7";
  430. this.radioButton7.Size = new System.Drawing.Size(59, 16);
  431. this.radioButton7.TabIndex = 6;
  432. this.radioButton7.TabStop = true;
  433. this.radioButton7.Text = "未设置";
  434. this.radioButton7.UseVisualStyleBackColor = true;
  435. this.radioButton7.Click += new System.EventHandler(this.radioButton_SelectedChanged);
  436. //
  437. // radioButton6
  438. //
  439. this.radioButton6.AutoSize = true;
  440. this.radioButton6.Location = new System.Drawing.Point(165, 97);
  441. this.radioButton6.Name = "radioButton6";
  442. this.radioButton6.Size = new System.Drawing.Size(59, 16);
  443. this.radioButton6.TabIndex = 5;
  444. this.radioButton6.TabStop = true;
  445. this.radioButton6.Text = "未设置";
  446. this.radioButton6.UseVisualStyleBackColor = true;
  447. this.radioButton6.Click += new System.EventHandler(this.radioButton_SelectedChanged);
  448. //
  449. // radioButton5
  450. //
  451. this.radioButton5.AutoSize = true;
  452. this.radioButton5.Location = new System.Drawing.Point(11, 97);
  453. this.radioButton5.Name = "radioButton5";
  454. this.radioButton5.Size = new System.Drawing.Size(59, 16);
  455. this.radioButton5.TabIndex = 4;
  456. this.radioButton5.TabStop = true;
  457. this.radioButton5.Text = "未设置";
  458. this.radioButton5.UseVisualStyleBackColor = true;
  459. this.radioButton5.Click += new System.EventHandler(this.radioButton_SelectedChanged);
  460. //
  461. // radioButton4
  462. //
  463. this.radioButton4.AutoSize = true;
  464. this.radioButton4.Location = new System.Drawing.Point(163, 62);
  465. this.radioButton4.Name = "radioButton4";
  466. this.radioButton4.Size = new System.Drawing.Size(59, 16);
  467. this.radioButton4.TabIndex = 3;
  468. this.radioButton4.TabStop = true;
  469. this.radioButton4.Text = "未设置";
  470. this.radioButton4.UseVisualStyleBackColor = true;
  471. this.radioButton4.Click += new System.EventHandler(this.radioButton_SelectedChanged);
  472. //
  473. // radioButton3
  474. //
  475. this.radioButton3.AutoSize = true;
  476. this.radioButton3.Location = new System.Drawing.Point(11, 62);
  477. this.radioButton3.Name = "radioButton3";
  478. this.radioButton3.Size = new System.Drawing.Size(59, 16);
  479. this.radioButton3.TabIndex = 2;
  480. this.radioButton3.TabStop = true;
  481. this.radioButton3.Text = "未设置";
  482. this.radioButton3.UseVisualStyleBackColor = true;
  483. this.radioButton3.Click += new System.EventHandler(this.radioButton_SelectedChanged);
  484. //
  485. // radioButton2
  486. //
  487. this.radioButton2.AutoSize = true;
  488. this.radioButton2.Location = new System.Drawing.Point(163, 27);
  489. this.radioButton2.Name = "radioButton2";
  490. this.radioButton2.Size = new System.Drawing.Size(59, 16);
  491. this.radioButton2.TabIndex = 1;
  492. this.radioButton2.TabStop = true;
  493. this.radioButton2.Text = "未设置";
  494. this.radioButton2.UseVisualStyleBackColor = true;
  495. this.radioButton2.Click += new System.EventHandler(this.radioButton_SelectedChanged);
  496. //
  497. // radioButton1
  498. //
  499. this.radioButton1.AutoSize = true;
  500. this.radioButton1.Location = new System.Drawing.Point(11, 27);
  501. this.radioButton1.Name = "radioButton1";
  502. this.radioButton1.Size = new System.Drawing.Size(59, 16);
  503. this.radioButton1.TabIndex = 0;
  504. this.radioButton1.TabStop = true;
  505. this.radioButton1.Text = "未设置";
  506. this.radioButton1.UseVisualStyleBackColor = true;
  507. this.radioButton1.Click += new System.EventHandler(this.radioButton_SelectedChanged);
  508. //
  509. // groupBox2
  510. //
  511. this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  512. | System.Windows.Forms.AnchorStyles.Left)));
  513. this.groupBox2.Controls.Add(this.listView1);
  514. this.groupBox2.Controls.Add(this.comboBox1);
  515. this.groupBox2.Controls.Add(this.label1);
  516. this.groupBox2.Location = new System.Drawing.Point(8, 190);
  517. this.groupBox2.Name = "groupBox2";
  518. this.groupBox2.Size = new System.Drawing.Size(310, 305);
  519. this.groupBox2.TabIndex = 4;
  520. this.groupBox2.TabStop = false;
  521. this.groupBox2.Text = "数据表";
  522. //
  523. // listView1
  524. //
  525. this.listView1.FullRowSelect = true;
  526. this.listView1.GridLines = true;
  527. this.listView1.HideSelection = false;
  528. this.listView1.Location = new System.Drawing.Point(6, 56);
  529. this.listView1.Name = "listView1";
  530. this.listView1.Size = new System.Drawing.Size(293, 243);
  531. this.listView1.TabIndex = 2;
  532. this.listView1.UseCompatibleStateImageBehavior = false;
  533. //
  534. // comboBox1
  535. //
  536. this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  537. this.comboBox1.FormattingEnabled = true;
  538. this.comboBox1.Location = new System.Drawing.Point(45, 30);
  539. this.comboBox1.Name = "comboBox1";
  540. this.comboBox1.Size = new System.Drawing.Size(254, 20);
  541. this.comboBox1.TabIndex = 1;
  542. this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
  543. //
  544. // label1
  545. //
  546. this.label1.AutoSize = true;
  547. this.label1.Location = new System.Drawing.Point(6, 33);
  548. this.label1.Name = "label1";
  549. this.label1.Size = new System.Drawing.Size(41, 12);
  550. this.label1.TabIndex = 0;
  551. this.label1.Text = "筛选:";
  552. //
  553. // groupBox3
  554. //
  555. this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  556. | System.Windows.Forms.AnchorStyles.Left)));
  557. this.groupBox3.Controls.Add(this.button4);
  558. this.groupBox3.Controls.Add(this.button3);
  559. this.groupBox3.Controls.Add(this.button2);
  560. this.groupBox3.Controls.Add(this.button1);
  561. this.groupBox3.Controls.Add(this.numericUpDown5);
  562. this.groupBox3.Controls.Add(this.label6);
  563. this.groupBox3.Controls.Add(this.label5);
  564. this.groupBox3.Controls.Add(this.label4);
  565. this.groupBox3.Controls.Add(this.label3);
  566. this.groupBox3.Controls.Add(this.label2);
  567. this.groupBox3.Location = new System.Drawing.Point(8, 501);
  568. this.groupBox3.Name = "groupBox3";
  569. this.groupBox3.Size = new System.Drawing.Size(310, 110);
  570. this.groupBox3.TabIndex = 5;
  571. this.groupBox3.TabStop = false;
  572. this.groupBox3.Text = "操作";
  573. //
  574. // button4
  575. //
  576. this.button4.Location = new System.Drawing.Point(259, 18);
  577. this.button4.Name = "button4";
  578. this.button4.Size = new System.Drawing.Size(40, 23);
  579. this.button4.TabIndex = 10;
  580. this.button4.Text = ">>";
  581. this.button4.UseVisualStyleBackColor = true;
  582. this.button4.Click += new System.EventHandler(this.button4_Click);
  583. //
  584. // button3
  585. //
  586. this.button3.Location = new System.Drawing.Point(165, 18);
  587. this.button3.Name = "button3";
  588. this.button3.Size = new System.Drawing.Size(38, 23);
  589. this.button3.TabIndex = 9;
  590. this.button3.Text = "删除";
  591. this.button3.UseVisualStyleBackColor = true;
  592. this.button3.Click += new System.EventHandler(this.Delete_Click);
  593. //
  594. // button2
  595. //
  596. this.button2.Location = new System.Drawing.Point(211, 18);
  597. this.button2.Name = "button2";
  598. this.button2.Size = new System.Drawing.Size(40, 23);
  599. this.button2.TabIndex = 8;
  600. this.button2.Text = "清空";
  601. this.button2.UseVisualStyleBackColor = true;
  602. this.button2.Click += new System.EventHandler(this.Clear_Click);
  603. //
  604. // button1
  605. //
  606. this.button1.Location = new System.Drawing.Point(259, 63);
  607. this.button1.Name = "button1";
  608. this.button1.Size = new System.Drawing.Size(40, 23);
  609. this.button1.TabIndex = 7;
  610. this.button1.Text = "输出";
  611. this.button1.UseVisualStyleBackColor = true;
  612. this.button1.Click += new System.EventHandler(this.button1_Click);
  613. //
  614. // numericUpDown5
  615. //
  616. this.numericUpDown5.Location = new System.Drawing.Point(165, 64);
  617. this.numericUpDown5.Maximum = new decimal(new int[] {
  618. 10,
  619. 0,
  620. 0,
  621. 0});
  622. this.numericUpDown5.Minimum = new decimal(new int[] {
  623. 2,
  624. 0,
  625. 0,
  626. 0});
  627. this.numericUpDown5.Name = "numericUpDown5";
  628. this.numericUpDown5.Size = new System.Drawing.Size(86, 21);
  629. this.numericUpDown5.TabIndex = 6;
  630. this.numericUpDown5.Value = new decimal(new int[] {
  631. 2,
  632. 0,
  633. 0,
  634. 0});
  635. this.numericUpDown5.ValueChanged += new System.EventHandler(this.numericUpDown5_ValueChanged);
  636. //
  637. // label6
  638. //
  639. this.label6.AutoSize = true;
  640. this.label6.Location = new System.Drawing.Point(82, 68);
  641. this.label6.Name = "label6";
  642. this.label6.Size = new System.Drawing.Size(77, 12);
  643. this.label6.TabIndex = 4;
  644. this.label6.Text = "小数点位数:";
  645. //
  646. // label5
  647. //
  648. this.label5.AutoSize = true;
  649. this.label5.Location = new System.Drawing.Point(113, 23);
  650. this.label5.Name = "label5";
  651. this.label5.Size = new System.Drawing.Size(17, 12);
  652. this.label5.TabIndex = 3;
  653. this.label5.Text = "度";
  654. //
  655. // label4
  656. //
  657. this.label4.AutoSize = true;
  658. this.label4.Location = new System.Drawing.Point(76, 23);
  659. this.label4.Name = "label4";
  660. this.label4.Size = new System.Drawing.Size(41, 12);
  661. this.label4.TabIndex = 2;
  662. this.label4.Text = "角度:";
  663. //
  664. // label3
  665. //
  666. this.label3.AutoSize = true;
  667. this.label3.Location = new System.Drawing.Point(43, 23);
  668. this.label3.Name = "label3";
  669. this.label3.Size = new System.Drawing.Size(17, 12);
  670. this.label3.TabIndex = 1;
  671. this.label3.Text = "mm";
  672. //
  673. // label2
  674. //
  675. this.label2.AutoSize = true;
  676. this.label2.Location = new System.Drawing.Point(6, 23);
  677. this.label2.Name = "label2";
  678. this.label2.Size = new System.Drawing.Size(41, 12);
  679. this.label2.TabIndex = 0;
  680. this.label2.Text = "长度:";
  681. //
  682. // groupBox4
  683. //
  684. this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  685. | System.Windows.Forms.AnchorStyles.Left)));
  686. this.groupBox4.Controls.Add(this.listView2);
  687. this.groupBox4.Location = new System.Drawing.Point(324, 3);
  688. this.groupBox4.Name = "groupBox4";
  689. this.groupBox4.Size = new System.Drawing.Size(83, 608);
  690. this.groupBox4.TabIndex = 6;
  691. this.groupBox4.TabStop = false;
  692. this.groupBox4.Text = "快捷工具";
  693. //
  694. // listView2
  695. //
  696. this.listView2.FullRowSelect = true;
  697. this.listView2.GridLines = true;
  698. this.listView2.HideSelection = false;
  699. this.listView2.Location = new System.Drawing.Point(6, 20);
  700. this.listView2.Name = "listView2";
  701. this.listView2.Size = new System.Drawing.Size(71, 578);
  702. this.listView2.TabIndex = 0;
  703. this.listView2.UseCompatibleStateImageBehavior = false;
  704. //
  705. // groupBox5
  706. //
  707. this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  708. | System.Windows.Forms.AnchorStyles.Left)));
  709. this.groupBox5.Controls.Add(this.treeView1);
  710. this.groupBox5.Location = new System.Drawing.Point(413, 3);
  711. this.groupBox5.Name = "groupBox5";
  712. this.groupBox5.Size = new System.Drawing.Size(220, 608);
  713. this.groupBox5.TabIndex = 7;
  714. this.groupBox5.TabStop = false;
  715. this.groupBox5.Text = "数据属性";
  716. //
  717. // treeView1
  718. //
  719. this.treeView1.Location = new System.Drawing.Point(6, 20);
  720. this.treeView1.Name = "treeView1";
  721. this.treeView1.Size = new System.Drawing.Size(208, 578);
  722. this.treeView1.TabIndex = 17;
  723. //
  724. // groupBox6
  725. //
  726. this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  727. | System.Windows.Forms.AnchorStyles.Left)));
  728. this.groupBox6.Controls.Add(this.button8);
  729. this.groupBox6.Controls.Add(this.button7);
  730. this.groupBox6.Controls.Add(this.button6);
  731. this.groupBox6.Controls.Add(this.button5);
  732. this.groupBox6.Location = new System.Drawing.Point(639, 3);
  733. this.groupBox6.Name = "groupBox6";
  734. this.groupBox6.Size = new System.Drawing.Size(107, 301);
  735. this.groupBox6.TabIndex = 8;
  736. this.groupBox6.TabStop = false;
  737. this.groupBox6.Text = "工具";
  738. //
  739. // button8
  740. //
  741. this.button8.Location = new System.Drawing.Point(16, 219);
  742. this.button8.Name = "button8";
  743. this.button8.Size = new System.Drawing.Size(75, 23);
  744. this.button8.TabIndex = 3;
  745. this.button8.Text = "向下";
  746. this.button8.UseVisualStyleBackColor = true;
  747. this.button8.Click += new System.EventHandler(this.button8_Click);
  748. //
  749. // button7
  750. //
  751. this.button7.Location = new System.Drawing.Point(16, 164);
  752. this.button7.Name = "button7";
  753. this.button7.Size = new System.Drawing.Size(75, 23);
  754. this.button7.TabIndex = 2;
  755. this.button7.Text = "向上";
  756. this.button7.UseVisualStyleBackColor = true;
  757. this.button7.Click += new System.EventHandler(this.button7_Click);
  758. //
  759. // button6
  760. //
  761. this.button6.Location = new System.Drawing.Point(16, 109);
  762. this.button6.Name = "button6";
  763. this.button6.Size = new System.Drawing.Size(75, 23);
  764. this.button6.TabIndex = 1;
  765. this.button6.Text = ">移除";
  766. this.button6.UseVisualStyleBackColor = true;
  767. this.button6.Click += new System.EventHandler(this.button6_Click);
  768. //
  769. // button5
  770. //
  771. this.button5.Location = new System.Drawing.Point(16, 54);
  772. this.button5.Name = "button5";
  773. this.button5.Size = new System.Drawing.Size(75, 23);
  774. this.button5.TabIndex = 0;
  775. this.button5.Text = "<添加";
  776. this.button5.UseVisualStyleBackColor = true;
  777. this.button5.Click += new System.EventHandler(this.button5_Click);
  778. //
  779. // groupBox7
  780. //
  781. this.groupBox7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  782. | System.Windows.Forms.AnchorStyles.Left)));
  783. this.groupBox7.Controls.Add(this.button12);
  784. this.groupBox7.Controls.Add(this.button11);
  785. this.groupBox7.Controls.Add(this.button10);
  786. this.groupBox7.Controls.Add(this.button9);
  787. this.groupBox7.Location = new System.Drawing.Point(639, 310);
  788. this.groupBox7.Name = "groupBox7";
  789. this.groupBox7.Size = new System.Drawing.Size(107, 301);
  790. this.groupBox7.TabIndex = 9;
  791. this.groupBox7.TabStop = false;
  792. this.groupBox7.Text = "数据";
  793. //
  794. // button12
  795. //
  796. this.button12.Location = new System.Drawing.Point(16, 214);
  797. this.button12.Name = "button12";
  798. this.button12.Size = new System.Drawing.Size(75, 23);
  799. this.button12.TabIndex = 3;
  800. this.button12.Text = "向下";
  801. this.button12.UseVisualStyleBackColor = true;
  802. this.button12.Click += new System.EventHandler(this.button12_Click);
  803. //
  804. // button11
  805. //
  806. this.button11.Location = new System.Drawing.Point(16, 159);
  807. this.button11.Name = "button11";
  808. this.button11.Size = new System.Drawing.Size(75, 23);
  809. this.button11.TabIndex = 2;
  810. this.button11.Text = "向上";
  811. this.button11.UseVisualStyleBackColor = true;
  812. this.button11.Click += new System.EventHandler(this.button11_Click);
  813. //
  814. // button10
  815. //
  816. this.button10.Location = new System.Drawing.Point(16, 104);
  817. this.button10.Name = "button10";
  818. this.button10.Size = new System.Drawing.Size(75, 23);
  819. this.button10.TabIndex = 1;
  820. this.button10.Text = ">移除";
  821. this.button10.UseVisualStyleBackColor = true;
  822. this.button10.Click += new System.EventHandler(this.button10_Click);
  823. //
  824. // button9
  825. //
  826. this.button9.Location = new System.Drawing.Point(16, 49);
  827. this.button9.Name = "button9";
  828. this.button9.Size = new System.Drawing.Size(75, 23);
  829. this.button9.TabIndex = 0;
  830. this.button9.Text = "<添加";
  831. this.button9.UseVisualStyleBackColor = true;
  832. this.button9.Click += new System.EventHandler(this.button9_Click);
  833. //
  834. // groupBox8
  835. //
  836. this.groupBox8.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
  837. | System.Windows.Forms.AnchorStyles.Left)));
  838. this.groupBox8.Controls.Add(this.treeView2);
  839. this.groupBox8.Location = new System.Drawing.Point(752, 3);
  840. this.groupBox8.Name = "groupBox8";
  841. this.groupBox8.Size = new System.Drawing.Size(220, 608);
  842. this.groupBox8.TabIndex = 10;
  843. this.groupBox8.TabStop = false;
  844. this.groupBox8.Text = "元素属性";
  845. //
  846. // treeView2
  847. //
  848. this.treeView2.Location = new System.Drawing.Point(6, 20);
  849. this.treeView2.Name = "treeView2";
  850. this.treeView2.Size = new System.Drawing.Size(208, 578);
  851. this.treeView2.TabIndex = 18;
  852. //
  853. // GeometryMeasureDialog
  854. //
  855. this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
  856. this.BackColor = System.Drawing.SystemColors.Control;
  857. this.ClientSize = new System.Drawing.Size(980, 621);
  858. this.Controls.Add(this.groupBox8);
  859. this.Controls.Add(this.groupBox7);
  860. this.Controls.Add(this.groupBox6);
  861. this.Controls.Add(this.groupBox5);
  862. this.Controls.Add(this.groupBox4);
  863. this.Controls.Add(this.groupBox3);
  864. this.Controls.Add(this.groupBox2);
  865. this.Controls.Add(this.groupBox1);
  866. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  867. this.Name = "GeometryMeasureDialog";
  868. this.Text = "交互测量";
  869. this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.GeometryMeasureDialog_FormClosing);
  870. this.Controls.SetChildIndex(this.groupBox1, 0);
  871. this.Controls.SetChildIndex(this.groupBox2, 0);
  872. this.Controls.SetChildIndex(this.groupBox3, 0);
  873. this.Controls.SetChildIndex(this.groupBox4, 0);
  874. this.Controls.SetChildIndex(this.groupBox5, 0);
  875. this.Controls.SetChildIndex(this.groupBox6, 0);
  876. this.Controls.SetChildIndex(this.groupBox7, 0);
  877. this.Controls.SetChildIndex(this.groupBox8, 0);
  878. this.groupBox1.ResumeLayout(false);
  879. this.groupBox1.PerformLayout();
  880. this.groupBox2.ResumeLayout(false);
  881. this.groupBox2.PerformLayout();
  882. this.groupBox3.ResumeLayout(false);
  883. this.groupBox3.PerformLayout();
  884. ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).EndInit();
  885. this.groupBox4.ResumeLayout(false);
  886. this.groupBox5.ResumeLayout(false);
  887. this.groupBox6.ResumeLayout(false);
  888. this.groupBox7.ResumeLayout(false);
  889. this.groupBox8.ResumeLayout(false);
  890. this.ResumeLayout(false);
  891. }
  892. /// <summary>
  893. /// 刷新别名
  894. /// </summary>
  895. public void RefreshAliasName()
  896. {
  897. this.measureStyleModel = Startup.instance.measureStyleModel;
  898. for (int i = 1; i <= 8; i++)
  899. {
  900. if (i > this.toolNameList.Count)
  901. {
  902. break;
  903. }
  904. string toolName = this.toolNameList[i - 1];
  905. string enName = string.Empty;
  906. foreach (var item in measureListSetModel.AttributeMapAllDataNodes)
  907. {
  908. var tool = item.Attribute.Where(m => m.Text.Equals(toolName)).FirstOrDefault();
  909. if (tool == null)
  910. {
  911. continue;
  912. }
  913. enName = tool.Name;
  914. }
  915. if (!string.IsNullOrEmpty(enName))
  916. {
  917. string name;
  918. getAliasName(out name, enName);
  919. this.toolNickNameList[i - 1] = name;
  920. #region [文本赋值]
  921. switch (i)
  922. {
  923. case 1:
  924. textBox1.Text = name;
  925. break;
  926. case 2:
  927. textBox2.Text = name;
  928. break;
  929. case 3:
  930. textBox3.Text = name;
  931. break;
  932. case 4:
  933. textBox4.Text = name;
  934. break;
  935. case 5:
  936. textBox5.Text = name;
  937. break;
  938. case 6:
  939. textBox6.Text = name;
  940. break;
  941. case 7:
  942. textBox7.Text = name;
  943. break;
  944. case 8:
  945. textBox8.Text = name;
  946. break;
  947. }
  948. #endregion
  949. }
  950. }
  951. RefreshListView(null, null);
  952. }
  953. /// <summary>
  954. /// 获取参数保存
  955. /// </summary>
  956. private void getLastData()
  957. {
  958. string filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\ParameterSaving\\MeasureListInteractiveDataModel.xml";
  959. if (!File.Exists(filePath))
  960. {
  961. measureListInteractiveDataModel = new MeasureListInteractiveDataModel();
  962. }
  963. else
  964. {
  965. measureListInteractiveDataModel = XmlSerializeHelper.DESerializer<MeasureListInteractiveDataModel>(FileOperationHelper.ReadStringFromFile(filePath, FileMode.Open));
  966. if (measureListInteractiveDataModel != null)
  967. {
  968. this.numericUpDown5.Value = measureListInteractiveDataModel.num;
  969. this.comboBox1.SelectedIndex = measureListInteractiveDataModel.selectIndex;
  970. foreach (var item in measureListInteractiveDataModel.FastToolList)
  971. {
  972. var index = measureListInteractiveDataModel.FastToolList.IndexOf(item) + 1;
  973. string name = item.name;
  974. if (name.Length >= 5)
  975. {
  976. name = $"{name.Substring(0, 4)}\r\n{name.Substring(4, name.Length - 4)}";
  977. }
  978. switch (index)
  979. {
  980. case 1:
  981. radioButton1.Text = name;
  982. textBox1.Text = item.nickName;
  983. break;
  984. case 2:
  985. radioButton2.Text = name;
  986. textBox2.Text = item.nickName;
  987. break;
  988. case 3:
  989. radioButton3.Text = name;
  990. textBox3.Text = item.nickName;
  991. break;
  992. case 4:
  993. radioButton4.Text = name;
  994. textBox4.Text = item.nickName;
  995. break;
  996. case 5:
  997. radioButton5.Text = name;
  998. textBox5.Text = item.nickName;
  999. break;
  1000. case 6:
  1001. radioButton6.Text = name;
  1002. textBox6.Text = item.nickName;
  1003. break;
  1004. case 7:
  1005. radioButton7.Text = name;
  1006. textBox7.Text = item.nickName;
  1007. break;
  1008. case 8:
  1009. radioButton8.Text = name;
  1010. textBox8.Text = item.nickName;
  1011. break;
  1012. }
  1013. toolNameList.Add(item.name);
  1014. toolNickNameList.Add(item.nickName);
  1015. ListViewItem lvi = new ListViewItem();
  1016. lvi.Text = item.name;
  1017. this.listView2.Items.Add(lvi);
  1018. }
  1019. if (measureListInteractiveDataModel.FastToolList.Count > 0)
  1020. {
  1021. radioButton_SelectedChanged(radioButton1, null);
  1022. }
  1023. }
  1024. }
  1025. }
  1026. /// <summary>
  1027. /// 数据属性初始化
  1028. /// </summary>
  1029. private void allDataTree()
  1030. {
  1031. if (measureListSetModel != null && measureListSetModel.AttributeMapAllDataNodes != null)
  1032. {
  1033. for (int i = 0; i < measureListSetModel.AttributeMapAllDataNodes.Count; i++)
  1034. {
  1035. TreeNode firstNode = new TreeNode();
  1036. firstNode.Text = measureListSetModel.AttributeMapAllDataNodes[i].Name;
  1037. for (int j = 0; j < measureListSetModel.AttributeMapAllDataNodes[i].Attribute.Count; j++)
  1038. {
  1039. TreeNode scondNode = new TreeNode();
  1040. scondNode.Text = measureListSetModel.AttributeMapAllDataNodes[i].Attribute[j].Text;
  1041. scondNode.Name = measureListSetModel.AttributeMapAllDataNodes[i].Attribute[j].Name;
  1042. for (int k = 0; k < measureListSetModel.AttributeMapAllDataNodes[i].Attribute[j].Attribute.Count; k++)
  1043. {
  1044. if (measureListSetModel.AttributeMapAllDataNodes[i].Attribute[j].Attribute.Count > 0)
  1045. {
  1046. TreeNode thirdNode = new TreeNode();
  1047. thirdNode.Text = measureListSetModel.AttributeMapAllDataNodes[i].Attribute[j].Attribute[k].Text;
  1048. thirdNode.Name = measureListSetModel.AttributeMapAllDataNodes[i].Attribute[j].Attribute[k].Name;
  1049. scondNode.Nodes.Add(thirdNode);
  1050. }
  1051. }
  1052. firstNode.Nodes.Add(scondNode);
  1053. }
  1054. this.treeView2.Nodes.Add(firstNode);
  1055. }
  1056. }
  1057. }
  1058. /// <summary>
  1059. /// 元素属性初始化
  1060. /// </summary>
  1061. private void allToolTree()
  1062. {
  1063. if (measureListSetModel != null && measureListSetModel.AttributeMapDataNodes != null)
  1064. {
  1065. for (int i = 0; i < measureListSetModel.AttributeMapDataNodes.Count; i++)
  1066. {
  1067. TreeNode firstNode = new TreeNode();
  1068. firstNode.Text = measureListSetModel.AttributeMapDataNodes[i].Name;
  1069. for (int j = 0; j < measureListSetModel.AttributeMapDataNodes[i].Attribute.Count; j++)
  1070. {
  1071. TreeNode scondNode = new TreeNode();
  1072. scondNode.Text = measureListSetModel.AttributeMapDataNodes[i].Attribute[j].Text;
  1073. scondNode.Name = measureListSetModel.AttributeMapDataNodes[i].Attribute[j].Name;
  1074. for (int k = 0; k < measureListSetModel.AttributeMapDataNodes[i].Attribute[j].Attribute.Count; k++)
  1075. {
  1076. if (measureListSetModel.AttributeMapDataNodes[i].Attribute[j].Attribute.Count > 0)
  1077. {
  1078. TreeNode thirdNode = new TreeNode();
  1079. thirdNode.Text = measureListSetModel.AttributeMapDataNodes[i].Attribute[j].Attribute[k].Text;
  1080. thirdNode.Name = measureListSetModel.AttributeMapDataNodes[i].Attribute[j].Attribute[k].Name;
  1081. scondNode.Nodes.Add(thirdNode);
  1082. }
  1083. }
  1084. firstNode.Nodes.Add(scondNode);
  1085. }
  1086. this.treeView1.Nodes.Add(firstNode);
  1087. }
  1088. }
  1089. }
  1090. /// <summary>
  1091. /// 面板伸缩事件
  1092. /// </summary>
  1093. /// <param name="sender"></param>
  1094. /// <param name="e"></param>
  1095. private void button4_Click(object sender, EventArgs e)
  1096. {
  1097. if (isEnlarge)
  1098. {
  1099. this.Width = this.smallHeight;
  1100. this.button4.Text = ">>";
  1101. }
  1102. else
  1103. {
  1104. this.Width = this.bigHelght;
  1105. this.button4.Text = "<<";
  1106. }
  1107. this.isEnlarge = !isEnlarge;
  1108. }
  1109. #region [数据面板操作]
  1110. /// <summary>
  1111. /// 数据添加
  1112. /// </summary>
  1113. /// <param name="sender"></param>
  1114. /// <param name="e"></param>
  1115. private void button9_Click(object sender, EventArgs e)
  1116. {
  1117. if (this.treeView2.SelectedNode != null && this.treeView2.SelectedNode.Level == 2)
  1118. {
  1119. string name = string.Empty;
  1120. string orName = this.treeView2.SelectedNode.Name;
  1121. if (this.treeView2.SelectedNode.Parent != null)
  1122. name = this.treeView2.SelectedNode.Parent.Name;
  1123. TreeNode treeNode = this.treeView2.SelectedNode;
  1124. int count = treeView1.Nodes.Count;
  1125. for (int i = 0; i < count; i++)
  1126. {
  1127. foreach (TreeNode node in this.treeView1.Nodes[i].Nodes)
  1128. {
  1129. if (node.Name == name)
  1130. {
  1131. this.treeView2.SelectedNode.Remove();
  1132. node.Nodes.Add(treeNode);
  1133. }
  1134. }
  1135. }
  1136. MeasureListSetModel.FirstNode.SecondNode.Item hasAttr = null;
  1137. foreach (var item in measureListSetModel.AttributeMapAllDataNodes)
  1138. {
  1139. var tool = item.Attribute.Where(m => m.Name.Equals(name)).FirstOrDefault();
  1140. if (tool != null)
  1141. {
  1142. hasAttr = tool.Attribute.Where(m => m.Name.Equals(orName)).FirstOrDefault();
  1143. if (hasAttr != null)
  1144. {
  1145. tool.Attribute.Remove(hasAttr);
  1146. }
  1147. }
  1148. }
  1149. foreach (var item in measureListSetModel.AttributeMapDataNodes)
  1150. {
  1151. var tool = item.Attribute.Where(m => m.Name.Equals(name)).FirstOrDefault();
  1152. if (tool != null)
  1153. {
  1154. if (hasAttr != null)
  1155. {
  1156. tool.Attribute.Add(hasAttr);
  1157. }
  1158. }
  1159. }
  1160. RefreshListView(null, null);
  1161. }
  1162. }
  1163. /// <summary>
  1164. /// 数据移除
  1165. /// </summary>
  1166. /// <param name="sender"></param>
  1167. /// <param name="e"></param>
  1168. private void button10_Click(object sender, EventArgs e)
  1169. {
  1170. if (this.treeView1.SelectedNode != null && this.treeView1.SelectedNode.Level == 2)
  1171. {
  1172. string name = string.Empty;
  1173. string orName = this.treeView1.SelectedNode.Name;
  1174. if (this.treeView1.SelectedNode.Parent != null)
  1175. name = this.treeView1.SelectedNode.Parent.Name;
  1176. TreeNode treeNode = this.treeView1.SelectedNode;
  1177. int count = treeView2.Nodes.Count;
  1178. for (int i = 0; i < count; i++)
  1179. {
  1180. foreach (TreeNode node in this.treeView2.Nodes[i].Nodes)
  1181. {
  1182. if (node.Name == name)
  1183. {
  1184. this.treeView1.SelectedNode.Remove();
  1185. node.Nodes.Add(treeNode);
  1186. }
  1187. }
  1188. }
  1189. MeasureListSetModel.FirstNode.SecondNode.Item hasAttr = null;
  1190. foreach (var item in measureListSetModel.AttributeMapDataNodes)
  1191. {
  1192. var tool = item.Attribute.Where(m => m.Name.Equals(name)).FirstOrDefault();
  1193. if (tool != null)
  1194. {
  1195. hasAttr = tool.Attribute.Where(m => m.Name.Equals(orName)).FirstOrDefault();
  1196. if (hasAttr != null)
  1197. {
  1198. tool.Attribute.Remove(hasAttr);
  1199. }
  1200. }
  1201. }
  1202. foreach (var item in measureListSetModel.AttributeMapAllDataNodes)
  1203. {
  1204. var tool = item.Attribute.Where(m => m.Name.Equals(name)).FirstOrDefault();
  1205. if (tool != null)
  1206. {
  1207. if (hasAttr != null)
  1208. {
  1209. tool.Attribute.Add(hasAttr);
  1210. }
  1211. }
  1212. }
  1213. RefreshListView(null, null);
  1214. }
  1215. }
  1216. /// <summary>
  1217. /// 数据向上
  1218. /// </summary>
  1219. /// <param name="sender"></param>
  1220. /// <param name="e"></param>
  1221. private void button11_Click(object sender, EventArgs e)
  1222. {
  1223. if (this.treeView1.SelectedNode == null || this.treeView1.SelectedNode.Level != 2)
  1224. {
  1225. return;
  1226. }
  1227. #region [树状图信息向上]
  1228. string name = string.Empty;
  1229. if (this.treeView1.SelectedNode.Parent != null)
  1230. {
  1231. name = this.treeView1.SelectedNode.Parent.Name;
  1232. }
  1233. TreeNode treeNode = this.treeView1.SelectedNode;
  1234. int count = treeView1.Nodes.Count;
  1235. for (int i = 0; i < count; i++)
  1236. {
  1237. foreach (TreeNode node in this.treeView1.Nodes[i].Nodes)
  1238. {
  1239. if (node.Name != name)
  1240. {
  1241. continue;
  1242. }
  1243. int index = node.Nodes.IndexOf(treeNode);
  1244. if (index != 0)
  1245. {
  1246. TreeNode lastNode = node.Nodes[index - 1];
  1247. node.Nodes.RemoveAt(index);
  1248. node.Nodes.RemoveAt(index - 1);
  1249. node.Nodes.Insert(index, lastNode);
  1250. node.Nodes.Insert(index - 1, treeNode);
  1251. treeView1.Focus();
  1252. treeView1.SelectedNode = treeNode;
  1253. }
  1254. }
  1255. }
  1256. #endregion
  1257. #region [表格信息向上]
  1258. #endregion
  1259. }
  1260. /// <summary>
  1261. /// 数据向下
  1262. /// </summary>
  1263. /// <param name="sender"></param>
  1264. /// <param name="e"></param>
  1265. private void button12_Click(object sender, EventArgs e)
  1266. {
  1267. if (this.treeView1.SelectedNode == null || this.treeView1.SelectedNode.Level != 2)
  1268. {
  1269. return;
  1270. }
  1271. #region [树状图信息向下]
  1272. string name = string.Empty;
  1273. if (this.treeView1.SelectedNode.Parent != null)
  1274. {
  1275. name = this.treeView1.SelectedNode.Parent.Name;
  1276. }
  1277. TreeNode treeNode = this.treeView1.SelectedNode;
  1278. int count = treeView1.Nodes.Count;
  1279. for (int i = 0; i < count; i++)
  1280. {
  1281. foreach (TreeNode node in this.treeView1.Nodes[i].Nodes)
  1282. {
  1283. if (node.Name != name)
  1284. {
  1285. continue;
  1286. }
  1287. int index = node.Nodes.IndexOf(treeNode);
  1288. if (index != node.Nodes.Count - 1)
  1289. {
  1290. TreeNode lastNode = node.Nodes[index + 1];
  1291. node.Nodes.RemoveAt(index + 1);
  1292. node.Nodes.RemoveAt(index);
  1293. node.Nodes.Insert(index, lastNode);
  1294. node.Nodes.Insert(index + 1, treeNode);
  1295. treeView1.Focus();
  1296. treeView1.SelectedNode = treeNode;
  1297. }
  1298. }
  1299. }
  1300. #endregion
  1301. #region [表格信息向下]
  1302. #endregion
  1303. }
  1304. #endregion
  1305. #region [工具面板操作]
  1306. /// <summary>
  1307. /// 工具添加
  1308. /// </summary>
  1309. /// <param name="sender"></param>
  1310. /// <param name="e"></param>
  1311. private void button5_Click(object sender, EventArgs e)
  1312. {
  1313. if (this.treeView2.SelectedNode == null || this.treeView2.SelectedNode.Level != 1)
  1314. {
  1315. return;
  1316. }
  1317. if (this.listView2.Items.Count >= 8)
  1318. {
  1319. MessageBox.Show("最多只能添加8个快捷工具!");
  1320. return;
  1321. }
  1322. if (this.toolNameList.Contains(this.treeView2.SelectedNode.Text))
  1323. {
  1324. MessageBox.Show("不可添加重复的快捷工具!");
  1325. return;
  1326. }
  1327. #region [快捷工具列表中添加]
  1328. ListViewItem lvi = new ListViewItem();
  1329. lvi.Text = this.treeView2.SelectedNode.Text;
  1330. this.listView2.Items.Add(lvi);
  1331. #endregion
  1332. #region [快捷工具中添加]
  1333. string measureTpye = this.treeView2.SelectedNode.Name;
  1334. #region [通过类型 获取别名]
  1335. string name;
  1336. getAliasName(out name, measureTpye);
  1337. #endregion
  1338. this.addToolName(this.listView2.Items.Count, this.treeView2.SelectedNode.Text, name);
  1339. this.toolNameList.Add(this.treeView2.SelectedNode.Text);
  1340. this.toolNickNameList.Add(name);
  1341. if (toolNameList.Count == 1)
  1342. {
  1343. radioButton_SelectedChanged(radioButton1, e);
  1344. }
  1345. #endregion
  1346. }
  1347. /// <summary>
  1348. ///
  1349. /// </summary>
  1350. private void getAliasName(out string name, string typeName)
  1351. {
  1352. switch (typeName)
  1353. {
  1354. case "MeasureLine":
  1355. name = this.measureStyleModel.measureLine.aliasName;
  1356. break;
  1357. case "MeasureLength":
  1358. name = this.measureStyleModel.measureLength.aliasName;
  1359. break;
  1360. case "MeasureDistanceLine":
  1361. name = this.measureStyleModel.measureDistanceLine.aliasName;
  1362. break;
  1363. case "MeasureHLine":
  1364. name = this.measureStyleModel.measureHLine.aliasName;
  1365. break;
  1366. case "MeasureVLine":
  1367. name = this.measureStyleModel.measureVLine.aliasName;
  1368. break;
  1369. case "MeasureMulLine":
  1370. name = this.measureStyleModel.measureMulLine.aliasName;
  1371. break;
  1372. case "MeasureMulHVLine":
  1373. name = this.measureStyleModel.measureMulHVLine.aliasName;
  1374. break;
  1375. case "MeasureMulSegment":
  1376. name = this.measureStyleModel.measureMulSegment.aliasName;
  1377. break;
  1378. case "MeasureMulVLine":
  1379. name = this.measureStyleModel.measureMulVLine.aliasName;
  1380. break;
  1381. case "MeasureBrokenLine":
  1382. name = this.measureStyleModel.measureBrokenLine.aliasName;
  1383. break;
  1384. case "MeasureTraceCurve":
  1385. name = this.measureStyleModel.measureTraceCurve.aliasName;
  1386. break;
  1387. case "MeasureCurveLine":
  1388. name = this.measureStyleModel.measureCurveLine.aliasName;
  1389. break;
  1390. case "MeasurePLine":
  1391. name = this.measureStyleModel.measurePLine.aliasName;
  1392. break;
  1393. case "MeasureMulPLine":
  1394. name = this.measureStyleModel.measureMulPLine.aliasName;
  1395. break;
  1396. case "MeasureHMulPLine":
  1397. name = this.measureStyleModel.measureHMulPLine.aliasName;
  1398. break;
  1399. case "MeasureVMulPLine":
  1400. name = this.measureStyleModel.measureVMulPLine.aliasName;
  1401. break;
  1402. case "MeasurePointHLine":
  1403. name = this.measureStyleModel.measurePointHLine.aliasName;
  1404. break;
  1405. case "MeasureParallelLine":
  1406. name = this.measureStyleModel.measureParallelLine.aliasName;
  1407. break;
  1408. case "MeasureMulParallelLine":
  1409. name = this.measureStyleModel.measureMulParallelLine.aliasName;
  1410. break;
  1411. case "MeasureVMulParallelLine":
  1412. name = this.measureStyleModel.measureVMulParallelLine.aliasName;
  1413. break;
  1414. case "MeasureHMulParallelLine":
  1415. name = this.measureStyleModel.measureHMulParallelLine.aliasName;
  1416. break;
  1417. case "MeasureClosedCurve":
  1418. name = this.measureStyleModel.measureClosedCurve.aliasName;
  1419. break;
  1420. case "MeasurePolygon":
  1421. name = this.measureStyleModel.measurePolygon.aliasName;
  1422. break;
  1423. case "MeasureRectangle":
  1424. name = this.measureStyleModel.measureRectangle.aliasName;
  1425. break;
  1426. case "MeasureRandRectangle":
  1427. name = this.measureStyleModel.measureRandRectangle.aliasName;
  1428. break;
  1429. case "MeasureSquare":
  1430. name = this.measureStyleModel.measureSquare.aliasName;
  1431. break;
  1432. case "MeasureRandSquare":
  1433. name = this.measureStyleModel.measureRandSquare.aliasName;
  1434. break;
  1435. case "MeasureTracePolygon":
  1436. name = this.measureStyleModel.measureTracePolygon.aliasName;
  1437. break;
  1438. case "MeasureCircle":
  1439. name = this.measureStyleModel.measureCircle.aliasName;
  1440. break;
  1441. case "MeasureInnerCircle":
  1442. name = this.measureStyleModel.measureInnerCircle.aliasName;
  1443. break;
  1444. case "MeasureOuterCircle":
  1445. name = this.measureStyleModel.measureOuterCircle.aliasName;
  1446. break;
  1447. case "MeasureDiameterCircle":
  1448. name = this.measureStyleModel.measureDiameterCircle.aliasName;
  1449. break;
  1450. case "MeasurePointCenterSize":
  1451. name = this.measureStyleModel.measurePointCenterSize.aliasName;
  1452. break;
  1453. case "MeasureCenterCenterSize":
  1454. name = this.measureStyleModel.measureCenterCenterSize.aliasName;
  1455. break;
  1456. case "MeasurePointArcSize":
  1457. name = this.measureStyleModel.measurePointArcSize.aliasName;
  1458. break;
  1459. case "MeasureTwoLineVLDistance":
  1460. name = this.measureStyleModel.measureTwoLineVLDistance.aliasName;
  1461. break;
  1462. case "MeasurePointEdgeSize":
  1463. name = this.measureStyleModel.measurePointEdgeSize.aliasName;
  1464. break;
  1465. case "MeasureThreePointAngle":
  1466. name = this.measureStyleModel.measureThreePointAngle.aliasName;
  1467. break;
  1468. case "MeasureFourPointAngle":
  1469. name = this.measureStyleModel.measureFourPointAngle.aliasName;
  1470. break;
  1471. case "MeasureThreePointArc":
  1472. name = this.measureStyleModel.measureThreePointArc.aliasName;
  1473. break;
  1474. default:
  1475. name = string.Empty;
  1476. break;
  1477. }
  1478. }
  1479. /// <summary>
  1480. /// 工具移除
  1481. /// </summary>
  1482. /// <param name="sender"></param>
  1483. /// <param name="e"></param>
  1484. private void button6_Click(object sender, EventArgs e)
  1485. {
  1486. if (this.listView2.FocusedItem != null && this.listView2.FocusedItem.Selected)
  1487. {
  1488. int index = this.listView2.FocusedItem.Index;
  1489. this.removeToolName(index, this.listView2.FocusedItem.Text);
  1490. this.listView2.Items.RemoveAt(index);
  1491. }
  1492. }
  1493. /// <summary>
  1494. /// 工具向上
  1495. /// </summary>
  1496. /// <param name="sender"></param>
  1497. /// <param name="e"></param>
  1498. private void button7_Click(object sender, EventArgs e)
  1499. {
  1500. if (this.treeView2.SelectedNode == null || this.treeView2.SelectedNode.Level != 1)
  1501. {
  1502. return;
  1503. }
  1504. #region [快捷工具列表中向上]
  1505. if (this.listView2.FocusedItem != null && this.listView2.FocusedItem.Selected)
  1506. {
  1507. int index = this.listView2.FocusedItem.Index;
  1508. if (index != 0)
  1509. {
  1510. ListViewItem item = this.listView2.FocusedItem;
  1511. ListViewItem lastItem = this.listView2.Items[index - 1];
  1512. this.listView2.Items.RemoveAt(index);
  1513. this.listView2.Items.RemoveAt(index - 1);
  1514. this.listView2.Items.Insert(index - 1, item);
  1515. this.listView2.Items.Insert(index, lastItem);
  1516. moveToolName(index, 1);
  1517. }
  1518. }
  1519. #endregion
  1520. }
  1521. /// <summary>
  1522. /// 工具向下
  1523. /// </summary>
  1524. /// <param name="sender"></param>
  1525. /// <param name="e"></param>
  1526. private void button8_Click(object sender, EventArgs e)
  1527. {
  1528. if (this.treeView2.SelectedNode == null || this.treeView2.SelectedNode.Level != 1)
  1529. {
  1530. return;
  1531. }
  1532. #region [快捷工具列表中向下]
  1533. if (this.listView2.FocusedItem != null && this.listView2.FocusedItem.Selected)
  1534. {
  1535. int index = this.listView2.FocusedItem.Index;
  1536. if (index != this.listView2.Items.Count - 1)
  1537. {
  1538. ListViewItem item = this.listView2.FocusedItem;
  1539. ListViewItem lastItem = this.listView2.Items[index + 1];
  1540. this.listView2.Items.RemoveAt(index + 1);
  1541. this.listView2.Items.RemoveAt(index);
  1542. this.listView2.Items.Insert(index, lastItem);
  1543. this.listView2.Items.Insert(index + 1, item);
  1544. moveToolName(index, 2);
  1545. }
  1546. }
  1547. #endregion
  1548. }
  1549. /// <summary>
  1550. /// 添加快捷工具面板
  1551. /// </summary>
  1552. private void addToolName(int index, string name, string textName = "")
  1553. {
  1554. if (name.Length >= 5)
  1555. {
  1556. name = $"{name.Substring(0, 4)}\r\n{name.Substring(4, name.Length - 4)}";
  1557. }
  1558. switch (index)
  1559. {
  1560. case 1:
  1561. this.radioButton1.Text = name;
  1562. if (!string.IsNullOrEmpty(textName))
  1563. textBox1.Text = textName;
  1564. break;
  1565. case 2:
  1566. this.radioButton2.Text = name;
  1567. if (!string.IsNullOrEmpty(textName))
  1568. textBox2.Text = textName;
  1569. break;
  1570. case 3:
  1571. this.radioButton3.Text = name;
  1572. if (!string.IsNullOrEmpty(textName))
  1573. textBox3.Text = textName;
  1574. break;
  1575. case 4:
  1576. this.radioButton4.Text = name;
  1577. if (!string.IsNullOrEmpty(textName))
  1578. textBox4.Text = textName;
  1579. break;
  1580. case 5:
  1581. this.radioButton5.Text = name;
  1582. if (!string.IsNullOrEmpty(textName))
  1583. textBox5.Text = textName;
  1584. break;
  1585. case 6:
  1586. this.radioButton6.Text = name;
  1587. if (!string.IsNullOrEmpty(textName))
  1588. textBox6.Text = textName;
  1589. break;
  1590. case 7:
  1591. this.radioButton7.Text = name;
  1592. if (!string.IsNullOrEmpty(textName))
  1593. textBox7.Text = textName;
  1594. break;
  1595. case 8:
  1596. this.radioButton8.Text = name;
  1597. if (!string.IsNullOrEmpty(textName))
  1598. textBox8.Text = textName;
  1599. break;
  1600. }
  1601. }
  1602. /// <summary>
  1603. /// 移除快捷工具面板
  1604. /// </summary>
  1605. private void removeToolName(int index, string name)
  1606. {
  1607. this.toolNameList.RemoveAt(index);
  1608. this.toolNickNameList.RemoveAt(index);
  1609. this.resetButton();
  1610. for (int i = 0; i < toolNameList.Count; i++)
  1611. {
  1612. addToolName(i + 1, toolNameList[i], toolNickNameList[i]);
  1613. }
  1614. }
  1615. /// <summary>
  1616. /// 重置状态
  1617. /// </summary>
  1618. private void resetButton()
  1619. {
  1620. this.radioButton1.Text = "未设置";
  1621. this.radioButton2.Text = "未设置";
  1622. this.radioButton3.Text = "未设置";
  1623. this.radioButton4.Text = "未设置";
  1624. this.radioButton5.Text = "未设置";
  1625. this.radioButton6.Text = "未设置";
  1626. this.radioButton7.Text = "未设置";
  1627. this.radioButton8.Text = "未设置";
  1628. this.textBox1.Text = "";
  1629. this.textBox2.Text = "";
  1630. this.textBox3.Text = "";
  1631. this.textBox4.Text = "";
  1632. this.textBox5.Text = "";
  1633. this.textBox6.Text = "";
  1634. this.textBox7.Text = "";
  1635. this.textBox8.Text = "";
  1636. #region [取消选中状态]
  1637. if (radioButton1.Checked)
  1638. {
  1639. radioButton1.Checked = false;
  1640. }
  1641. else if (radioButton2.Checked)
  1642. {
  1643. radioButton2.Checked = false;
  1644. }
  1645. else if (radioButton3.Checked)
  1646. {
  1647. radioButton3.Checked = false;
  1648. }
  1649. else if (radioButton4.Checked)
  1650. {
  1651. radioButton4.Checked = false;
  1652. }
  1653. else if (radioButton5.Checked)
  1654. {
  1655. radioButton5.Checked = false;
  1656. }
  1657. else if (radioButton6.Checked)
  1658. {
  1659. radioButton6.Checked = false;
  1660. }
  1661. else if (radioButton7.Checked)
  1662. {
  1663. radioButton7.Checked = false;
  1664. }
  1665. else if (radioButton8.Checked)
  1666. {
  1667. radioButton8.Checked = false;
  1668. }
  1669. #endregion
  1670. if (this.appWorkspace.ActiveDocumentWorkspace != null)
  1671. {
  1672. this.appWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.Pointer;
  1673. }
  1674. }
  1675. /// <summary>
  1676. /// 向上/向下移动快捷工具面板
  1677. /// </summary>
  1678. private void moveToolName(int index, int type)
  1679. {
  1680. switch (type)
  1681. {
  1682. case 1:
  1683. string toolName = this.toolNameList[index];
  1684. string lastToolName = this.toolNameList[index - 1];
  1685. string toolNickName = this.toolNickNameList[index];
  1686. string lastNickName = this.toolNickNameList[index - 1];
  1687. this.toolNameList.RemoveAt(index);
  1688. this.toolNameList.RemoveAt(index - 1);
  1689. this.toolNickNameList.RemoveAt(index);
  1690. this.toolNickNameList.RemoveAt(index - 1);
  1691. this.toolNameList.Insert(index - 1, toolName);
  1692. this.toolNameList.Insert(index, lastToolName);
  1693. this.toolNickNameList.Insert(index - 1, toolNickName);
  1694. this.toolNickNameList.Insert(index, lastNickName);
  1695. break;
  1696. case 2:
  1697. string toolName1 = this.toolNameList[index];
  1698. string lastToolName1 = this.toolNameList[index + 1];
  1699. string toolNickName1 = this.toolNickNameList[index];
  1700. string lastNickName1 = this.toolNickNameList[index + 1];
  1701. this.toolNameList.RemoveAt(index + 1);
  1702. this.toolNameList.RemoveAt(index);
  1703. this.toolNickNameList.RemoveAt(index + 1);
  1704. this.toolNickNameList.RemoveAt(index);
  1705. this.toolNameList.Insert(index, lastToolName1);
  1706. this.toolNameList.Insert(index + 1, toolName1);
  1707. this.toolNickNameList.Insert(index, lastNickName1);
  1708. this.toolNickNameList.Insert(index + 1, toolNickName1);
  1709. break;
  1710. }
  1711. for (int i = 0; i < toolNameList.Count; i++)
  1712. {
  1713. addToolName(i + 1, toolNameList[i], toolNickNameList[i]);
  1714. }
  1715. }
  1716. #endregion
  1717. /// <summary>
  1718. /// 修改别名
  1719. /// </summary>
  1720. /// <param name="sender"></param>
  1721. /// <param name="e"></param>
  1722. private void textBox1_TextChanged(object sender, EventArgs e)
  1723. {
  1724. var textbox = (TextBox)sender;
  1725. int type = Convert.ToInt32(textbox.Name.Substring(textbox.Name.Length - 1, 1));
  1726. if (toolNickNameList.Count > 0 && toolNickNameList.Count >= type)
  1727. {
  1728. toolNickNameList[type - 1] = textbox.Text;
  1729. RefreshListView(null, null);
  1730. }
  1731. }
  1732. /// <summary>
  1733. /// 选择快捷工具
  1734. /// </summary>
  1735. /// <param name="sender"></param>
  1736. /// <param name="e"></param>
  1737. private void radioButton_SelectedChanged(object sender, EventArgs e)
  1738. {
  1739. if (this.appWorkspace.ActiveDocumentWorkspace == null)
  1740. {
  1741. return;
  1742. }
  1743. var radioButto = (RadioButton)sender;
  1744. if (!radioButto.Checked)
  1745. {
  1746. return;
  1747. }
  1748. int type = Convert.ToInt32(radioButto.Name.Substring(radioButto.Name.Length - 1, 1));
  1749. if (toolNameList.Count < type)
  1750. {
  1751. this.appWorkspace.ActiveDocumentWorkspace.ActiveTool = new DrawToolType();
  1752. return;
  1753. }
  1754. var toolName = toolNameList[type - 1];
  1755. //获取工具英文
  1756. string enName = string.Empty;
  1757. foreach (var item in measureListSetModel.AttributeMapAllDataNodes)
  1758. {
  1759. var tool = item.Attribute.Where(m => m.Text.Equals(toolName)).FirstOrDefault();
  1760. if (tool == null)
  1761. {
  1762. continue;
  1763. }
  1764. enName = tool.Name;
  1765. }
  1766. if (!string.IsNullOrEmpty(enName))
  1767. {
  1768. if (this.appWorkspace.ActiveDocumentWorkspace != null)
  1769. {
  1770. this.appWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1771. this.appWorkspace.ActiveDocumentWorkspace.ActiveTool = (DrawToolType)Enum.Parse(typeof(DrawToolType), enName);
  1772. if (this.appWorkspace.Widgets != null && this.appWorkspace.Widgets.GeometryMeasureDialog.Visible)
  1773. {
  1774. ContinuousDrawingAction();
  1775. }
  1776. }
  1777. }
  1778. }
  1779. /// <summary>
  1780. /// 连续绘制
  1781. /// </summary>
  1782. /// <param name="sender"></param>
  1783. /// <param name="e"></param>
  1784. private void ContinuousDrawingAction()
  1785. {
  1786. if (this.appWorkspace.ActiveDocumentWorkspace != null)
  1787. {
  1788. DocumentView.ContinuousDrawing = true;
  1789. this.appWorkspace.continuousDrawingMeasure = true;
  1790. for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
  1791. {
  1792. this.appWorkspace.DocumentWorkspaces[i].ContinuousDrawingMeasure = true;
  1793. }
  1794. this.appWorkspace.toolBar.RefreshBtnSelect(DocumentView.ContinuousDrawing, "ContinuousDrawingMeasure");
  1795. this.appWorkspace.toolsPanel.RefreshBtnSelect(DocumentView.ContinuousDrawing, "ContinuousDrawingMeasure");
  1796. if (!DocumentView.ContinuousDrawing
  1797. && this.appWorkspace.ActiveDocumentWorkspace.ActiveTool >= DrawToolType.MeasureLine && this.appWorkspace.ActiveDocumentWorkspace.ActiveTool <= DrawToolType.MeasureThreePointArc)
  1798. {
  1799. this.appWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1800. this.appWorkspace.ActiveDocumentWorkspace.ActiveTool = DrawToolType.Pointer;
  1801. }
  1802. DocumentView.ContinuousDrawing = true;
  1803. }
  1804. if (this.appWorkspace.cameraPreviewDialog != null && !this.appWorkspace.cameraPreviewDialog.IsDisposed)
  1805. {
  1806. this.appWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure = true;
  1807. if (this.appWorkspace.ActiveDocumentWorkspace != null) this.appWorkspace.continuousDrawingMeasure = true;
  1808. for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
  1809. {
  1810. this.appWorkspace.DocumentWorkspaces[i].ContinuousDrawingMeasure = true;
  1811. }
  1812. this.appWorkspace.toolBar.RefreshBtnSelect(this.appWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure, "ContinuousDrawingMeasure");
  1813. this.appWorkspace.toolsPanel.RefreshBtnSelect(this.appWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure, "ContinuousDrawingMeasure");
  1814. if (!this.appWorkspace.cameraPreviewDialog.documentWorkspace.ContinuousDrawingMeasure)
  1815. {
  1816. this.appWorkspace.cameraPreviewDialog.documentWorkspace.ActiveTool = DrawToolType.Pointer;
  1817. }
  1818. if (this.appWorkspace.ActiveDocumentWorkspace != null
  1819. && this.appWorkspace.ActiveDocumentWorkspace.ActiveTool >= DrawToolType.MeasureLine
  1820. && this.appWorkspace.ActiveDocumentWorkspace.ActiveTool <= DrawToolType.MeasureThreePointArc)
  1821. {
  1822. this.appWorkspace.ActiveDocumentWorkspace.ToolNumber = -1;
  1823. }
  1824. DocumentView.ContinuousDrawing = true;
  1825. }
  1826. }
  1827. /// <summary>
  1828. /// 删除一条数据
  1829. /// </summary>
  1830. /// <param name="sender"></param>
  1831. /// <param name="e"></param>
  1832. private void Delete_Click(object sender, EventArgs e)
  1833. {
  1834. if (this.listView1.FocusedItem != null && this.listView1.FocusedItem.Selected)
  1835. {
  1836. var index = this.listView1.FocusedItem.Index;
  1837. DrawObject drawObject = (DrawObject)this.listView1.Items[index].Tag;
  1838. _p2Document?.GraphicsList.RemoveObj(drawObject);
  1839. this.listView1.Items.RemoveAt(index);
  1840. if (this.appWorkspace.DocumentWorkspaces != null && this.appWorkspace.DocumentWorkspaces.Length > 0)
  1841. {
  1842. for (int k = 0; k <= this.appWorkspace.DocumentWorkspaces.Length - 1; k++)
  1843. {
  1844. for (int i = 0; i < this.appWorkspace.DocumentWorkspaces[k].GraphicsList.Count; i++)
  1845. {
  1846. if (!this.appWorkspace.DocumentWorkspaces[k].GraphicsList[i].Equals(drawObject))
  1847. {
  1848. continue;
  1849. }
  1850. this.appWorkspace.DocumentWorkspaces[k].GraphicsList.RemoveObj(drawObject);
  1851. this.appWorkspace.DocumentWorkspaces[k].Refresh();
  1852. }
  1853. }
  1854. }
  1855. }
  1856. }
  1857. /// <summary>
  1858. /// 清空数据
  1859. /// </summary>
  1860. /// <param name="sender"></param>
  1861. /// <param name="e"></param>
  1862. private void Clear_Click(object sender, EventArgs e)
  1863. {
  1864. this.listView1.Items.Clear();
  1865. if (this.appWorkspace.DocumentWorkspaces != null && this.appWorkspace.DocumentWorkspaces.Length > 0)
  1866. {
  1867. for (int k = 0; k <= this.appWorkspace.DocumentWorkspaces.Length - 1; k++)
  1868. {
  1869. this.appWorkspace.DocumentWorkspaces[k].GraphicsList.Clear();
  1870. this.appWorkspace.DocumentWorkspaces[k].Refresh();
  1871. }
  1872. }
  1873. _p2Document?.GraphicsList.Clear();
  1874. }
  1875. /// <summary>
  1876. /// 获取别名
  1877. /// </summary>
  1878. /// <returns></returns>
  1879. private string getNickName(DrawObject measureDrawObject)
  1880. {
  1881. try
  1882. {
  1883. var enName = measureDrawObject.drawToolType.ToString();
  1884. string name;
  1885. getAliasName(out name, enName);
  1886. if (string.IsNullOrEmpty(name))
  1887. {
  1888. foreach (var item in measureListSetModel.AttributeMapAllDataNodes)
  1889. {
  1890. var tool = item.Attribute.Where(m => m.Name.Equals(enName)).FirstOrDefault();
  1891. if (tool == null)
  1892. {
  1893. continue;
  1894. }
  1895. if (toolNameList.Contains(tool.Text))
  1896. {
  1897. var index = toolNameList.IndexOf(tool.Text);
  1898. return string.IsNullOrEmpty(toolNickNameList[index]) ? toolNameList[index] : toolNickNameList[index];
  1899. }
  1900. return tool.Text;
  1901. }
  1902. }
  1903. return name;
  1904. }
  1905. catch (Exception)
  1906. {
  1907. return "默认";
  1908. }
  1909. }
  1910. /// <summary>
  1911. /// 获取数据
  1912. /// </summary>
  1913. /// <param name="drawToolType"></param>
  1914. /// <returns></returns>
  1915. private void getLstViewItem(DrawObject measureDrawObject, int index)
  1916. {
  1917. double length;
  1918. double area;
  1919. double angle;
  1920. string name = getNickName(measureDrawObject) + index;
  1921. MeasureDrawObject measureData = (MeasureDrawObject)measureDrawObject;
  1922. Dictionary<System.Enum, object> data = measureData.GetData();
  1923. switch (measureDrawObject.drawToolType)
  1924. {
  1925. case DrawToolType.MeasureLine:
  1926. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  1927. {
  1928. object val;
  1929. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  1930. length = Convert.ToDouble(val);
  1931. }
  1932. else
  1933. {
  1934. length = 0;
  1935. }
  1936. area = 0;
  1937. angle = 0;
  1938. addListViewData(name, length, area, angle, measureDrawObject, 1);
  1939. break;
  1940. case DrawToolType.MeasureDistanceLine:
  1941. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  1942. {
  1943. object val;
  1944. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  1945. length = Convert.ToDouble(val);
  1946. }
  1947. else
  1948. {
  1949. length = 0;
  1950. }
  1951. area = 0;
  1952. angle = 0;
  1953. addListViewData(name, length, area, angle, measureDrawObject, 1);
  1954. break;
  1955. case DrawToolType.MeasureLength:
  1956. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  1957. {
  1958. object val;
  1959. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  1960. length = Convert.ToDouble(val);
  1961. }
  1962. else
  1963. {
  1964. length = 0;
  1965. }
  1966. area = 0;
  1967. angle = 0;
  1968. addListViewData(name, length, area, angle, measureDrawObject, 1);
  1969. break;
  1970. case DrawToolType.MeasureHLine:
  1971. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  1972. {
  1973. object val;
  1974. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  1975. length = Convert.ToDouble(val);
  1976. }
  1977. else
  1978. {
  1979. length = 0;
  1980. }
  1981. area = 0;
  1982. angle = 0;
  1983. addListViewData(name, length, area, angle, measureDrawObject, 1);
  1984. break;
  1985. case DrawToolType.MeasureVLine:
  1986. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  1987. {
  1988. object val;
  1989. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  1990. length = Convert.ToDouble(val);
  1991. }
  1992. else
  1993. {
  1994. length = 0;
  1995. }
  1996. area = 0;
  1997. angle = 0;
  1998. addListViewData(name, length, area, angle, measureDrawObject, 1);
  1999. break;
  2000. case DrawToolType.MeasureMulLine:
  2001. MeasureMulLine line = (MeasureMulLine)measureDrawObject;
  2002. area = 0;
  2003. angle = 0;
  2004. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2005. {
  2006. for (int i = 0; i <= line.lengthParagraphs.Count - 1; i++)
  2007. {
  2008. addListViewData(name, Convert.ToDouble(line.lengthParagraphs[i]), area, angle, measureDrawObject);
  2009. }
  2010. }
  2011. else
  2012. {
  2013. for (int i = 0; i <= line.lengthParagraphs.Count - 1; i++)
  2014. {
  2015. addListViewData(name, 0, area, angle, measureDrawObject);
  2016. }
  2017. }
  2018. break;
  2019. case DrawToolType.MeasureMulHVLine:
  2020. MeasureMulHVLine measureMulHVLine = (MeasureMulHVLine)measureDrawObject;
  2021. area = 0;
  2022. angle = 0;
  2023. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2024. {
  2025. for (int i = 0; i <= measureMulHVLine.lengthParagraphs.Count - 1; i++)
  2026. {
  2027. addListViewData(name, Convert.ToDouble(measureMulHVLine.lengthParagraphs[i]), area, angle, measureDrawObject);
  2028. }
  2029. }
  2030. else
  2031. {
  2032. for (int i = 0; i <= measureMulHVLine.lengthParagraphs.Count - 1; i++)
  2033. {
  2034. addListViewData(name, 0, area, angle, measureDrawObject);
  2035. }
  2036. }
  2037. break;
  2038. case DrawToolType.MeasureMulSegment:
  2039. MeasureMulSegment measureMulSegment = (MeasureMulSegment)measureDrawObject;
  2040. area = 0;
  2041. angle = 0;
  2042. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2043. {
  2044. for (int i = 0; i <= measureMulSegment.lengthParagraphs.Count - 1; i++)
  2045. {
  2046. addListViewData(name, Convert.ToDouble(measureMulSegment.lengthParagraphs[i]), area, angle, measureDrawObject);
  2047. }
  2048. }
  2049. else
  2050. {
  2051. for (int i = 0; i <= measureMulSegment.lengthParagraphs.Count - 1; i++)
  2052. {
  2053. addListViewData(name, 0, area, angle, measureDrawObject);
  2054. }
  2055. }
  2056. break;
  2057. case DrawToolType.MeasureMulVLine:
  2058. MeasureMulVLine measureMulVLine = (MeasureMulVLine)measureDrawObject;
  2059. area = 0;
  2060. angle = 0;
  2061. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2062. {
  2063. for (int i = 0; i <= measureMulVLine.lengthParagraphs.Count - 1; i++)
  2064. {
  2065. addListViewData(name, Convert.ToDouble(measureMulVLine.lengthParagraphs[i]), area, angle, measureDrawObject);
  2066. }
  2067. }
  2068. else
  2069. {
  2070. for (int i = 0; i <= measureMulVLine.lengthParagraphs.Count - 1; i++)
  2071. {
  2072. addListViewData(name, 0, area, angle, measureDrawObject);
  2073. }
  2074. }
  2075. break;
  2076. case DrawToolType.MeasureBrokenLine:
  2077. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2078. {
  2079. object val;
  2080. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  2081. length = Convert.ToDouble(val);
  2082. }
  2083. else
  2084. {
  2085. length = 0;
  2086. }
  2087. area = 0;
  2088. angle = 0;
  2089. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2090. break;
  2091. case DrawToolType.MeasureTraceCurve:
  2092. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2093. {
  2094. object val;
  2095. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  2096. length = Convert.ToDouble(val);
  2097. }
  2098. else
  2099. {
  2100. length = 0;
  2101. }
  2102. area = 0;
  2103. angle = 0;
  2104. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2105. break;
  2106. case DrawToolType.MeasureCurveLine:
  2107. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2108. {
  2109. object val;
  2110. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  2111. length = Convert.ToDouble(val);
  2112. }
  2113. else
  2114. {
  2115. length = 0;
  2116. }
  2117. area = 0;
  2118. angle = 0;
  2119. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2120. break;
  2121. case DrawToolType.MeasurePLine:
  2122. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2123. {
  2124. object val;
  2125. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  2126. length = Convert.ToDouble(val);
  2127. }
  2128. else
  2129. {
  2130. length = 0;
  2131. }
  2132. area = 0;
  2133. angle = 0;
  2134. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2135. break;
  2136. case DrawToolType.MeasureMulPLine:
  2137. MeasureMulPLine measureMulPLine = (MeasureMulPLine)measureDrawObject;
  2138. area = 0;
  2139. angle = 0;
  2140. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2141. {
  2142. for (int i = 0; i <= measureMulPLine.lengthParagraphs.Count - 1; i++)
  2143. {
  2144. addListViewData(name, Convert.ToDouble(measureMulPLine.lengthParagraphs[i]), area, angle, measureDrawObject);
  2145. }
  2146. }
  2147. else
  2148. {
  2149. for (int i = 0; i <= measureMulPLine.lengthParagraphs.Count - 1; i++)
  2150. {
  2151. addListViewData(name, 0, area, angle, measureDrawObject);
  2152. }
  2153. }
  2154. break;
  2155. case DrawToolType.MeasureHMulPLine:
  2156. MeasureHMulPLine measureHMulPLine = (MeasureHMulPLine)measureDrawObject;
  2157. area = 0;
  2158. angle = 0;
  2159. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2160. {
  2161. for (int i = 0; i <= measureHMulPLine.lengthParagraphs.Count - 1; i++)
  2162. {
  2163. addListViewData(name, Convert.ToDouble(measureHMulPLine.lengthParagraphs[i]), area, angle, measureDrawObject);
  2164. }
  2165. }
  2166. else
  2167. {
  2168. for (int i = 0; i <= measureHMulPLine.lengthParagraphs.Count - 1; i++)
  2169. {
  2170. addListViewData(name, 0, area, angle, measureDrawObject);
  2171. }
  2172. }
  2173. break;
  2174. case DrawToolType.MeasureVMulPLine:
  2175. MeasureVMulPLine measureVMulPLine = (MeasureVMulPLine)measureDrawObject;
  2176. area = 0;
  2177. angle = 0;
  2178. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2179. {
  2180. for (int i = 0; i <= measureVMulPLine.lengthParagraphs.Count - 1; i++)
  2181. {
  2182. addListViewData(name, Convert.ToDouble(measureVMulPLine.lengthParagraphs[i]), area, angle, measureDrawObject);
  2183. }
  2184. }
  2185. else
  2186. {
  2187. for (int i = 0; i <= measureVMulPLine.lengthParagraphs.Count - 1; i++)
  2188. {
  2189. addListViewData(name, 0, area, angle, measureDrawObject);
  2190. }
  2191. }
  2192. break;
  2193. case DrawToolType.MeasurePointHLine:
  2194. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2195. {
  2196. object val;
  2197. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  2198. length = Convert.ToDouble(val);
  2199. }
  2200. else
  2201. {
  2202. length = 0;
  2203. }
  2204. area = 0;
  2205. angle = 0;
  2206. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2207. break;
  2208. case DrawToolType.MeasureParallelLine:
  2209. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2210. {
  2211. object val;
  2212. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  2213. length = Convert.ToDouble(val);
  2214. }
  2215. else
  2216. {
  2217. length = 0;
  2218. }
  2219. area = 0;
  2220. angle = 0;
  2221. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2222. break;
  2223. case DrawToolType.MeasureMulParallelLine:
  2224. MeasureMulParallelLine measureVMulPLine1 = (MeasureMulParallelLine)measureDrawObject;
  2225. area = 0;
  2226. angle = 0;
  2227. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2228. {
  2229. for (int i = 0; i <= measureVMulPLine1.lengthParagraphs.Count - 1; i++)
  2230. {
  2231. addListViewData(name, Convert.ToDouble(measureVMulPLine1.lengthParagraphs[i]), area, angle, measureDrawObject);
  2232. }
  2233. }
  2234. else
  2235. {
  2236. for (int i = 0; i <= measureVMulPLine1.lengthParagraphs.Count - 1; i++)
  2237. {
  2238. addListViewData(name, 0, area, angle, measureDrawObject);
  2239. }
  2240. }
  2241. break;
  2242. case DrawToolType.MeasureVMulParallelLine:
  2243. MeasureVMulParallelLine measureVMulParallelLine = (MeasureVMulParallelLine)measureDrawObject;
  2244. area = 0;
  2245. angle = 0;
  2246. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2247. {
  2248. for (int i = 0; i <= measureVMulParallelLine.lengthParagraphs.Count - 1; i++)
  2249. {
  2250. addListViewData(name, Convert.ToDouble(measureVMulParallelLine.lengthParagraphs[i]), area, angle, measureDrawObject);
  2251. }
  2252. }
  2253. else
  2254. {
  2255. for (int i = 0; i <= measureVMulParallelLine.lengthParagraphs.Count - 1; i++)
  2256. {
  2257. addListViewData(name, 0, area, angle, measureDrawObject);
  2258. }
  2259. }
  2260. break;
  2261. case DrawToolType.MeasureHMulParallelLine:
  2262. MeasureHMulParallelLine measureHMulParallelLine = (MeasureHMulParallelLine)measureDrawObject;
  2263. area = 0;
  2264. angle = 0;
  2265. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2266. {
  2267. for (int i = 0; i <= measureHMulParallelLine.lengthParagraphs.Count - 1; i++)
  2268. {
  2269. addListViewData(name, Convert.ToDouble(measureHMulParallelLine.lengthParagraphs[i]), area, angle, measureDrawObject);
  2270. }
  2271. }
  2272. else
  2273. {
  2274. for (int i = 0; i <= measureHMulParallelLine.lengthParagraphs.Count - 1; i++)
  2275. {
  2276. addListViewData(name, 0, area, angle, measureDrawObject);
  2277. }
  2278. }
  2279. break;
  2280. case DrawToolType.MeasureClosedCurve:
  2281. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2282. {
  2283. object val;
  2284. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  2285. length = Convert.ToDouble(val);
  2286. }
  2287. else
  2288. {
  2289. length = 0;
  2290. }
  2291. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2292. {
  2293. object val;
  2294. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2295. area = Convert.ToDouble(val);
  2296. }
  2297. else
  2298. {
  2299. area = 0;
  2300. }
  2301. angle = 0;
  2302. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2303. break;
  2304. case DrawToolType.MeasurePolygon:
  2305. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2306. {
  2307. object val;
  2308. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  2309. length = Convert.ToDouble(val);
  2310. }
  2311. else
  2312. {
  2313. length = 0;
  2314. }
  2315. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2316. {
  2317. object val;
  2318. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2319. area = Convert.ToDouble(val);
  2320. }
  2321. else
  2322. {
  2323. area = 0;
  2324. }
  2325. angle = 0;
  2326. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2327. break;
  2328. case DrawToolType.MeasureRectangle:
  2329. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2330. {
  2331. object val;
  2332. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  2333. length = Convert.ToDouble(val);
  2334. }
  2335. else
  2336. {
  2337. length = 0;
  2338. }
  2339. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2340. {
  2341. object val;
  2342. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2343. area = Convert.ToDouble(val);
  2344. }
  2345. else
  2346. {
  2347. area = 0;
  2348. }
  2349. angle = 0;
  2350. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2351. break;
  2352. case DrawToolType.MeasureRandRectangle:
  2353. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2354. {
  2355. object val;
  2356. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  2357. length = Convert.ToDouble(val);
  2358. }
  2359. else
  2360. {
  2361. length = 0;
  2362. }
  2363. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2364. {
  2365. object val;
  2366. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2367. area = Convert.ToDouble(val);
  2368. }
  2369. else
  2370. {
  2371. area = 0;
  2372. }
  2373. angle = 0;
  2374. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2375. break;
  2376. case DrawToolType.MeasureSquare:
  2377. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2378. {
  2379. object val;
  2380. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  2381. length = Convert.ToDouble(val);
  2382. }
  2383. else
  2384. {
  2385. length = 0;
  2386. }
  2387. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2388. {
  2389. object val;
  2390. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2391. area = Convert.ToDouble(val);
  2392. }
  2393. else
  2394. {
  2395. area = 0;
  2396. }
  2397. angle = 0;
  2398. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2399. break;
  2400. case DrawToolType.MeasureRandSquare:
  2401. MeasureDrawObject measureRandSquare = (MeasureDrawObject)measureDrawObject;
  2402. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2403. {
  2404. object val;
  2405. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  2406. length = Convert.ToDouble(val);
  2407. }
  2408. else
  2409. {
  2410. length = 0;
  2411. }
  2412. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2413. {
  2414. object val;
  2415. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2416. area = Convert.ToDouble(val);
  2417. }
  2418. else
  2419. {
  2420. area = 0;
  2421. }
  2422. angle = 0;
  2423. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2424. break;
  2425. case DrawToolType.MeasureTracePolygon:
  2426. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2427. {
  2428. object val;
  2429. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  2430. length = Convert.ToDouble(val);
  2431. }
  2432. else
  2433. {
  2434. length = 0;
  2435. }
  2436. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2437. {
  2438. object val;
  2439. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2440. area = Convert.ToDouble(val);
  2441. }
  2442. else
  2443. {
  2444. area = 0;
  2445. }
  2446. angle = 0;
  2447. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2448. break;
  2449. case DrawToolType.MeasureCircle:
  2450. if (data.ContainsKey(MeasureAttributes.PhysicalRadius))
  2451. {
  2452. object val;
  2453. data.TryGetValue(MeasureAttributes.PhysicalRadius, out val);
  2454. length = Convert.ToDouble(val);
  2455. }
  2456. else
  2457. {
  2458. length = 0;
  2459. }
  2460. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2461. {
  2462. object val;
  2463. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2464. area = Convert.ToDouble(val);
  2465. }
  2466. else
  2467. {
  2468. area = 0;
  2469. }
  2470. angle = 0;
  2471. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2472. break;
  2473. case DrawToolType.MeasureInnerCircle:
  2474. if (data.ContainsKey(MeasureAttributes.PhysicalRadius))
  2475. {
  2476. object val;
  2477. data.TryGetValue(MeasureAttributes.PhysicalRadius, out val);
  2478. length = Convert.ToDouble(val);
  2479. }
  2480. else
  2481. {
  2482. length = 0;
  2483. }
  2484. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2485. {
  2486. object val;
  2487. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2488. area = Convert.ToDouble(val);
  2489. }
  2490. else
  2491. {
  2492. area = 0;
  2493. }
  2494. angle = 0;
  2495. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2496. break;
  2497. case DrawToolType.MeasureOuterCircle:
  2498. if (data.ContainsKey(MeasureAttributes.PhysicalRadius))
  2499. {
  2500. object val;
  2501. data.TryGetValue(MeasureAttributes.PhysicalRadius, out val);
  2502. length = Convert.ToDouble(val);
  2503. }
  2504. else
  2505. {
  2506. length = 0;
  2507. }
  2508. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2509. {
  2510. object val;
  2511. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2512. area = Convert.ToDouble(val);
  2513. }
  2514. else
  2515. {
  2516. area = 0;
  2517. }
  2518. angle = 0;
  2519. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2520. break;
  2521. case DrawToolType.MeasureDiameterCircle:
  2522. if (data.ContainsKey(MeasureAttributes.PhysicalRadius))
  2523. {
  2524. object val;
  2525. data.TryGetValue(MeasureAttributes.PhysicalRadius, out val);
  2526. length = Convert.ToDouble(val);
  2527. }
  2528. else
  2529. {
  2530. length = 0;
  2531. }
  2532. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2533. {
  2534. object val;
  2535. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2536. area = Convert.ToDouble(val);
  2537. }
  2538. else
  2539. {
  2540. area = 0;
  2541. }
  2542. angle = 0;
  2543. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2544. break;
  2545. case DrawToolType.MeasurePointCenterSize:
  2546. if (data.ContainsKey(MeasureAttributes.PhysicalDistance))
  2547. {
  2548. object val;
  2549. data.TryGetValue(MeasureAttributes.PhysicalDistance, out val);
  2550. length = Convert.ToDouble(val);
  2551. }
  2552. else
  2553. {
  2554. length = 0;
  2555. }
  2556. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2557. {
  2558. object val;
  2559. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2560. area = Convert.ToDouble(val);
  2561. }
  2562. else
  2563. {
  2564. area = 0;
  2565. }
  2566. angle = 0;
  2567. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2568. break;
  2569. case DrawToolType.MeasureCenterCenterSize:
  2570. if (data.ContainsKey(MeasureAttributes.PhysicalDistance))
  2571. {
  2572. object val;
  2573. data.TryGetValue(MeasureAttributes.PhysicalDistance, out val);
  2574. length = Convert.ToDouble(val);
  2575. }
  2576. else
  2577. {
  2578. length = 0;
  2579. }
  2580. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2581. {
  2582. object val;
  2583. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2584. area = Convert.ToDouble(val);
  2585. }
  2586. else
  2587. {
  2588. area = 0;
  2589. }
  2590. angle = 0;
  2591. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2592. break;
  2593. case DrawToolType.MeasurePointArcSize:
  2594. if (data.ContainsKey(MeasureAttributes.PhysicalDistance))
  2595. {
  2596. object val;
  2597. data.TryGetValue(MeasureAttributes.PhysicalDistance, out val);
  2598. length = Convert.ToDouble(val);
  2599. }
  2600. else
  2601. {
  2602. length = 0;
  2603. }
  2604. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2605. {
  2606. object val;
  2607. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2608. area = Convert.ToDouble(val);
  2609. }
  2610. else
  2611. {
  2612. area = 0;
  2613. }
  2614. angle = 0;
  2615. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2616. break;
  2617. case DrawToolType.MeasureTwoLineVLDistance:
  2618. if (data.ContainsKey(MeasureAttributes.PhysicalLength))
  2619. {
  2620. object val;
  2621. data.TryGetValue(MeasureAttributes.PhysicalLength, out val);
  2622. length = Convert.ToDouble(val);
  2623. }
  2624. else
  2625. {
  2626. length = 0;
  2627. }
  2628. area = 0;
  2629. angle = 0;
  2630. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2631. break;
  2632. case DrawToolType.MeasurePointEdgeSize:
  2633. if (data.ContainsKey(MeasureAttributes.PhysicalDistance))
  2634. {
  2635. object val;
  2636. data.TryGetValue(MeasureAttributes.PhysicalDistance, out val);
  2637. length = Convert.ToDouble(val);
  2638. }
  2639. else
  2640. {
  2641. length = 0;
  2642. }
  2643. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2644. {
  2645. object val;
  2646. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2647. area = Convert.ToDouble(val);
  2648. }
  2649. else
  2650. {
  2651. area = 0;
  2652. }
  2653. angle = 0;
  2654. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2655. break;
  2656. case DrawToolType.MeasureThreePointAngle:
  2657. length = 0;
  2658. area = 0;
  2659. if (data.ContainsKey(MeasureAttributes.Angle))
  2660. {
  2661. object val;
  2662. data.TryGetValue(MeasureAttributes.Angle, out val);
  2663. angle = Convert.ToDouble(val);
  2664. }
  2665. else
  2666. {
  2667. angle = 0;
  2668. }
  2669. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2670. break;
  2671. case DrawToolType.MeasureFourPointAngle:
  2672. length = 0;
  2673. area = 0;
  2674. if (data.ContainsKey(MeasureAttributes.Angle))
  2675. {
  2676. object val;
  2677. data.TryGetValue(MeasureAttributes.Angle, out val);
  2678. angle = Convert.ToDouble(val);
  2679. }
  2680. else
  2681. {
  2682. angle = 0;
  2683. }
  2684. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2685. break;
  2686. case DrawToolType.MeasureThreePointArc:
  2687. if (data.ContainsKey(MeasureAttributes.PhysicalRadius))
  2688. {
  2689. object val;
  2690. data.TryGetValue(MeasureAttributes.PhysicalRadius, out val);
  2691. length = Convert.ToDouble(val);
  2692. }
  2693. else
  2694. {
  2695. length = 0;
  2696. }
  2697. if (data.ContainsKey(MeasureAttributes.PhysicalArea))
  2698. {
  2699. object val;
  2700. data.TryGetValue(MeasureAttributes.PhysicalArea, out val);
  2701. area = Convert.ToDouble(val);
  2702. }
  2703. else
  2704. {
  2705. area = 0;
  2706. }
  2707. if (data.ContainsKey(MeasureAttributes.Angle))
  2708. {
  2709. object val;
  2710. data.TryGetValue(MeasureAttributes.Angle, out val);
  2711. angle = Convert.ToDouble(val);
  2712. }
  2713. else
  2714. {
  2715. angle = 0;
  2716. }
  2717. addListViewData(name, length, area, angle, measureDrawObject, 1);
  2718. break;
  2719. }
  2720. }
  2721. /// <summary>
  2722. /// 添加数据
  2723. /// </summary>
  2724. /// <param name="name"></param>
  2725. /// <param name="length"></param>
  2726. /// <param name="area"></param>
  2727. /// <param name="angle"></param>
  2728. /// <param name="drawObject"></param>
  2729. /// <param name="type"></param>
  2730. private void addListViewData(string name, double length, double area, double angle, DrawObject drawObject, int type = 2)
  2731. {
  2732. if (!hasAttributes(drawObject.drawToolType.ToString(), "PhysicalLength") && !hasAttributes(drawObject.drawToolType.ToString(), "PhysicalRadius") && !hasAttributes(drawObject.drawToolType.ToString(), "PhysicalDistance") && !hasAttributes(drawObject.drawToolType.ToString(), "PhysicalCircumference"))
  2733. {
  2734. length = 0;
  2735. }
  2736. if (!hasAttributes(drawObject.drawToolType.ToString(), "PhysicalArea"))
  2737. {
  2738. area = 0;
  2739. }
  2740. if (!hasAttributes(drawObject.drawToolType.ToString(), "Angle"))
  2741. {
  2742. angle = 0;
  2743. }
  2744. int round = Convert.ToInt32(this.numericUpDown5.Value);
  2745. length = Math.Round(length, round);
  2746. area = Math.Round(area, round);
  2747. angle = Math.Round(angle, round);
  2748. ListViewItem lvi = new ListViewItem();
  2749. lvi.Text = name;
  2750. lvi.SubItems.Add(name);
  2751. lvi.SubItems.Add(length == 0 ? "-" : length.ToString());
  2752. lvi.SubItems.Add(angle == 0 ? "-" : angle.ToString());
  2753. lvi.SubItems.Add(area == 0 ? "-" : area.ToString());
  2754. lvi.Tag = drawObject;
  2755. if (comboBox1.SelectedIndex == 0 || comboBox1.SelectedIndex == type)
  2756. {
  2757. this.listView1.Items.Add(lvi);
  2758. }
  2759. if (this.filterDict.ContainsKey(type))
  2760. {
  2761. this.filterDict[type].Add(lvi);
  2762. }
  2763. else
  2764. {
  2765. this.filterDict.Add(type, new List<ListViewItem>() { lvi });
  2766. }
  2767. }
  2768. /// <summary>
  2769. /// 刷新列表数据
  2770. /// </summary>
  2771. /// <param name="sender"></param>
  2772. /// <param name="e"></param>
  2773. public void RefreshListView(object sender, EventArgs e)
  2774. {
  2775. this.listView1.Items.Clear();
  2776. this.filterDict.Clear();
  2777. if (this.appWorkspace.DocumentWorkspaces != null && this.appWorkspace.DocumentWorkspaces.Length > 0)
  2778. {
  2779. for (int k = 0; k <= this.appWorkspace.DocumentWorkspaces.Length - 1; k++)
  2780. {
  2781. int index = 1;
  2782. for (int i = this.appWorkspace.DocumentWorkspaces[k].GraphicsList.Count - 1; i >= 0; i--)
  2783. {
  2784. if (this.appWorkspace.DocumentWorkspaces[k].GraphicsList[i].objectType == DrawClass.Measure)
  2785. {
  2786. var drawTool = (MeasureDrawObject)this.appWorkspace.DocumentWorkspaces[k].GraphicsList[i];
  2787. getLstViewItem(drawTool, index);
  2788. index++;
  2789. }
  2790. }
  2791. }
  2792. }
  2793. if (_p2Document != null)
  2794. {
  2795. for (int i = 0; i < _p2Document.GraphicsList.Count; i++)
  2796. {
  2797. if (_p2Document.GraphicsList[i].objectType == DrawClass.Measure)
  2798. {
  2799. var drawTool = (MeasureDrawObject)_p2Document.GraphicsList[i];
  2800. getLstViewItem(drawTool, i + 1);
  2801. }
  2802. }
  2803. }
  2804. }
  2805. /// <summary>
  2806. /// 小数位数修改
  2807. /// </summary>
  2808. /// <param name="sender"></param>
  2809. /// <param name="e"></param>
  2810. private void numericUpDown5_ValueChanged(object sender, EventArgs e)
  2811. {
  2812. if (this.appWorkspace.Widgets != null)
  2813. this.appWorkspace.Widgets.MeasureListDialog.numericUpDown1.Value = numericUpDown5.Value;
  2814. RefreshListView(null, null);
  2815. }
  2816. /// <summary>
  2817. /// 输出
  2818. /// </summary>
  2819. /// <param name="sender"></param>
  2820. /// <param name="e"></param>
  2821. private void button1_Click(object sender, EventArgs e)
  2822. {
  2823. if (this.listView1.Items.Count > 0)
  2824. {
  2825. this.InitialDataExcel();
  2826. }
  2827. else
  2828. MessageBox.Show("暂无数据可导出");
  2829. }
  2830. /// <summary>
  2831. /// 导出Excel
  2832. /// </summary>
  2833. private void InitialDataExcel()
  2834. {
  2835. DataTable dtb = new DataTable();
  2836. for (int c = 0; c < 5; c++)
  2837. {
  2838. dtb.Columns.Add(c.ToString());
  2839. }
  2840. // 单位
  2841. DataRow dataRow = dtb.NewRow();
  2842. dataRow[0] = "单位";
  2843. dataRow[1] = this.appWorkspace.GetPxPerUnit()[2];
  2844. dtb.Rows.Add(dataRow);
  2845. // 标题
  2846. dataRow = dtb.NewRow();
  2847. dataRow[0] = "图片名称";
  2848. dataRow[1] = "分组";
  2849. dataRow[2] = "测量工具名称";
  2850. dataRow[3] = "测量属性名称";
  2851. dataRow[4] = "值";
  2852. dtb.Rows.Add(dataRow);
  2853. // 所有图片
  2854. for (int i = 0; i < this.appWorkspace.DocumentWorkspaces.Length; i++)
  2855. {
  2856. // 图片名称
  2857. string imgName = this.appWorkspace.DocumentWorkspaces[i].GetFriendlyName();
  2858. List<string> measures = new List<string>();
  2859. // 所有测量工具
  2860. for (int g = this.appWorkspace.DocumentWorkspaces[i].GraphicsList.Count - 1; g >= 0; g--)
  2861. {
  2862. if (this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g].objectType == DrawClass.Measure)
  2863. {
  2864. if (comboBox1.SelectedIndex != 0)
  2865. {
  2866. //判断是单值还是多值,能否通过
  2867. if (!isOddOrven(this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g]))
  2868. {
  2869. continue;
  2870. }
  2871. }
  2872. measures.Add(this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g].drawToolType.ToString());
  2873. // 测量数据
  2874. Dictionary<System.Enum, object> data = ((MeasureDrawObject)this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g]).GetData();
  2875. // 测量工具名称
  2876. string drawName = PdnResources.GetString("Menu.MeasureAction." + this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g].drawToolType.ToString() + ".Text");
  2877. List<string> drawingPropertiesList = new List<string>();
  2878. var name = this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g].drawToolType.ToString();
  2879. foreach (var item in measureListSetModel.AttributeMapDataNodes)
  2880. {
  2881. var tool = item.Attribute.Where(m => m.Name.Equals(name)).FirstOrDefault();
  2882. if (tool != null)
  2883. {
  2884. foreach (var str in tool.Attribute)
  2885. {
  2886. drawingPropertiesList.Add(str.Name);
  2887. }
  2888. }
  2889. }
  2890. //((MeasureDrawObject)this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g]).drawingProperties.TryGetValue(this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g].drawToolType, out drawingPropertiesList);
  2891. int addCount = 0;
  2892. foreach (var measure in measures)
  2893. {
  2894. if (measure.Equals(this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g].drawToolType.ToString()))
  2895. addCount++;
  2896. }
  2897. int round = Convert.ToInt32(this.numericUpDown5.Value);
  2898. // 所有可见的属性
  2899. foreach (var item in drawingPropertiesList)
  2900. {
  2901. dataRow = dtb.NewRow();
  2902. string itemFirst = item.Substring(0, 1);
  2903. string itemToLower = item.Substring(1, item.Length - 1).ToLower();
  2904. string itemAll = itemFirst + itemToLower;
  2905. // 测量属性名称
  2906. string attributeName = PdnResources.GetString("Menu." + itemAll + ".text");
  2907. // 属性值
  2908. object value;
  2909. MeasureAttributes type = (MeasureAttributes)System.Enum.Parse(typeof(MeasureAttributes), item);
  2910. data.TryGetValue(type, out value);
  2911. dataRow[0] = imgName;
  2912. dataRow[1] = addCount;
  2913. dataRow[2] = drawName;
  2914. dataRow[3] = attributeName;
  2915. dataRow[4] = Math.Round(Convert.ToDouble(value), round);
  2916. dtb.Rows.Add(dataRow);
  2917. }
  2918. if (((MeasureDrawObject)this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g]).lengthParagraphs != null
  2919. && ((MeasureDrawObject)this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g]).lengthParagraphs.Count > 0)
  2920. {
  2921. int length = 0;
  2922. foreach (var lengthParagraph in ((MeasureDrawObject)this.appWorkspace.DocumentWorkspaces[i].GraphicsList[g]).lengthParagraphs)
  2923. {
  2924. length++;
  2925. dataRow = dtb.NewRow();
  2926. dataRow[0] = imgName;
  2927. dataRow[1] = addCount;
  2928. dataRow[2] = drawName;
  2929. dataRow[3] = "物理长度(段" + length + ")";
  2930. dataRow[4] = Math.Round(Convert.ToDouble(lengthParagraph), round);
  2931. dtb.Rows.Add(dataRow);
  2932. }
  2933. }
  2934. }
  2935. }
  2936. }
  2937. MeasureListSettingDialog measureListSettingDialog = new MeasureListSettingDialog(this, "Template.Manager.item1.MeasureListAll", this.appWorkspace, dtb);
  2938. if (measureListSettingDialog.hasModule)
  2939. {
  2940. measureListSettingDialog.StartPosition = FormStartPosition.CenterScreen;
  2941. measureListSettingDialog.ShowDialog();
  2942. }
  2943. else
  2944. {
  2945. measureListSettingDialog = null;
  2946. }
  2947. }
  2948. /// <summary>
  2949. /// 判断是单值还是多值
  2950. /// </summary>
  2951. /// <param name="drawObject"></param>
  2952. /// <returns></returns>
  2953. private bool isOddOrven(DrawObject drawObject)
  2954. {
  2955. int index = this.comboBox1.SelectedIndex;
  2956. switch (index)
  2957. {
  2958. case 1:
  2959. if (moreTypeList.Contains(drawObject.drawToolType.ToString()))
  2960. {
  2961. return false;
  2962. }
  2963. break;
  2964. case 2:
  2965. if (!moreTypeList.Contains(drawObject.drawToolType.ToString()))
  2966. {
  2967. return false;
  2968. }
  2969. break;
  2970. }
  2971. return true;
  2972. }
  2973. /// <summary>
  2974. /// 判断是否含有属性
  2975. /// </summary>
  2976. /// <returns></returns>
  2977. private bool hasAttributes(string enMapName, string AttributesName)
  2978. {
  2979. foreach (var item in measureListSetModel.AttributeMapDataNodes)
  2980. {
  2981. var tool = item.Attribute.Where(m => m.Name.Equals(enMapName)).FirstOrDefault();
  2982. if (tool != null)
  2983. {
  2984. var hasAttr = tool.Attribute.Where(m => m.Name.Equals(AttributesName)).FirstOrDefault();
  2985. if (hasAttr != null)
  2986. {
  2987. return true;
  2988. }
  2989. }
  2990. }
  2991. return false;
  2992. }
  2993. /// <summary>
  2994. /// 筛选
  2995. /// </summary>
  2996. /// <param name="sender"></param>
  2997. /// <param name="e"></param>
  2998. private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  2999. {
  3000. this.listView1.Items.Clear();
  3001. switch (comboBox1.SelectedIndex)
  3002. {
  3003. case 0:
  3004. foreach (var item in filterDict)
  3005. {
  3006. listView1.Items.AddRange(item.Value.ToArray());
  3007. }
  3008. break;
  3009. case 1:
  3010. List<ListViewItem> list;
  3011. filterDict.TryGetValue(1, out list);
  3012. if (list != null)
  3013. {
  3014. listView1.Items.AddRange(list.ToArray());
  3015. }
  3016. break;
  3017. case 2:
  3018. List<ListViewItem> list2;
  3019. filterDict.TryGetValue(2, out list2);
  3020. if (list2 != null)
  3021. {
  3022. listView1.Items.AddRange(list2.ToArray());
  3023. }
  3024. break;
  3025. }
  3026. }
  3027. private void saveLastData(object sender, EventArgs e)
  3028. {
  3029. #region [树状信息保存]
  3030. // 数据属性树状图保存
  3031. measureListSetModel.AttributeMapDataNodes = new List<MeasureListSetModel.FirstNode>();
  3032. for (int i = 0; i < this.treeView1.Nodes.Count; i++)
  3033. {
  3034. MeasureListSetModel.FirstNode firstNode = new MeasureListSetModel.FirstNode();
  3035. firstNode.Attribute = new List<MeasureListSetModel.FirstNode.SecondNode>();
  3036. firstNode.Name = this.treeView1.Nodes[i].Text;
  3037. if (this.treeView1.Nodes[i].Nodes.Count > 0)
  3038. {
  3039. for (int j = 0; j < this.treeView1.Nodes[i].Nodes.Count; j++)
  3040. {
  3041. MeasureListSetModel.FirstNode.SecondNode second = new MeasureListSetModel.FirstNode.SecondNode();
  3042. second.Attribute = new List<MeasureListSetModel.FirstNode.SecondNode.Item>();
  3043. second.Text = this.treeView1.Nodes[i].Nodes[j].Text;
  3044. second.Name = this.treeView1.Nodes[i].Nodes[j].Name;
  3045. foreach (TreeNode Node in this.treeView1.Nodes[i].Nodes[j].Nodes)
  3046. {
  3047. MeasureListSetModel.FirstNode.SecondNode.Item item = new MeasureListSetModel.FirstNode.SecondNode.Item();
  3048. item.Text = Node.Text;
  3049. item.Name = Node.Name;
  3050. second.Attribute.Add(item);
  3051. }
  3052. firstNode.Attribute.Add(second);
  3053. }
  3054. }
  3055. measureListSetModel.AttributeMapDataNodes.Add(firstNode);
  3056. }
  3057. // 数据属性(元素)树状图保存
  3058. measureListSetModel.AttributeMapAllDataNodes = new List<MeasureListSetModel.FirstNode>();
  3059. for (int i = 0; i < this.treeView2.Nodes.Count; i++)
  3060. {
  3061. MeasureListSetModel.FirstNode firstNode = new MeasureListSetModel.FirstNode();
  3062. firstNode.Attribute = new List<MeasureListSetModel.FirstNode.SecondNode>();
  3063. firstNode.Name = this.treeView2.Nodes[i].Text;
  3064. if (this.treeView2.Nodes[i].Nodes.Count > 0)
  3065. {
  3066. for (int j = 0; j < this.treeView2.Nodes[i].Nodes.Count; j++)
  3067. {
  3068. MeasureListSetModel.FirstNode.SecondNode second = new MeasureListSetModel.FirstNode.SecondNode();
  3069. second.Attribute = new List<MeasureListSetModel.FirstNode.SecondNode.Item>();
  3070. second.Text = this.treeView2.Nodes[i].Nodes[j].Text;
  3071. second.Name = this.treeView2.Nodes[i].Nodes[j].Name;
  3072. foreach (TreeNode Node in this.treeView2.Nodes[i].Nodes[j].Nodes)
  3073. {
  3074. MeasureListSetModel.FirstNode.SecondNode.Item item = new MeasureListSetModel.FirstNode.SecondNode.Item();
  3075. item.Text = Node.Text;
  3076. item.Name = Node.Name;
  3077. second.Attribute.Add(item);
  3078. }
  3079. firstNode.Attribute.Add(second);
  3080. }
  3081. }
  3082. measureListSetModel.AttributeMapAllDataNodes.Add(firstNode);
  3083. }
  3084. string configXml = XmlSerializeHelper.XmlSerialize(measureListSetModel);
  3085. string filePath = System.Windows.Forms.Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\MeasureListInteractiveModel.xml";
  3086. FileOperationHelper.WriteStringToFile(configXml, filePath, FileMode.Create);
  3087. #endregion
  3088. #region [保存参数]
  3089. if (measureListInteractiveDataModel == null)
  3090. {
  3091. measureListInteractiveDataModel = new MeasureListInteractiveDataModel();
  3092. }
  3093. measureListInteractiveDataModel.FastToolList = new List<FastTool>();
  3094. foreach (var item in toolNameList)
  3095. {
  3096. var index = toolNameList.IndexOf(item);
  3097. string enName = string.Empty;
  3098. foreach (var item1 in measureListSetModel.AttributeMapAllDataNodes)
  3099. {
  3100. var tool = item1.Attribute.Where(m => m.Text.Equals(item)).FirstOrDefault();
  3101. if (tool == null)
  3102. {
  3103. continue;
  3104. }
  3105. enName = tool.Name;
  3106. }
  3107. var fastTool = new FastTool();
  3108. fastTool.name = item;
  3109. fastTool.enName = enName;
  3110. fastTool.nickName = toolNickNameList[index];
  3111. measureListInteractiveDataModel.FastToolList.Add(fastTool);
  3112. }
  3113. measureListInteractiveDataModel.hasUsed = true;
  3114. measureListInteractiveDataModel.num = Convert.ToInt32(this.numericUpDown5.Value);
  3115. measureListInteractiveDataModel.selectIndex = comboBox1.SelectedIndex;
  3116. filePath = Application.StartupPath + "\\Config\\" + Startup.instance.SettingPrefix + "\\ParameterSaving\\MeasureListInteractiveDataModel.xml";
  3117. string porosityInfoXml = XmlSerializeHelper.XmlSerialize<MeasureListInteractiveDataModel>(measureListInteractiveDataModel);
  3118. FileOperationHelper.WriteStringToFile(porosityInfoXml, filePath, FileMode.Create);
  3119. #endregion
  3120. }
  3121. private void GeometryMeasureDialog_FormClosing(object sender, FormClosingEventArgs e)
  3122. {
  3123. this.appWorkspace.toolBar.RefreshBtnSelect(false, "Geometry");
  3124. this.appWorkspace.toolsPanel.RefreshBtnSelect(false, "Geometry");
  3125. }
  3126. }
  3127. }