InvariantData.cs 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676
  1. using PaintDotNet.Annotation.Enum;
  2. using PaintDotNet.Annotation.relationModel;
  3. using PaintDotNet.Base.Enum;
  4. using PaintDotNet.Base.SettingModel;
  5. using System;
  6. using System.Collections.Generic;
  7. namespace PaintDotNet
  8. {
  9. /// <summary>
  10. /// 存储系统中用到的一些可以放在程序里的下拉的数据
  11. /// </summary>
  12. public static class InvariantData
  13. {
  14. /// <summary>
  15. /// 标注测量程序集
  16. /// </summary>
  17. public static readonly string assembly_Annotation = "PaintDotNet.Annotation";
  18. /// <summary>
  19. /// 标注路径
  20. /// </summary>
  21. public static readonly string path_Label = "PaintDotNet.Annotation.Label";
  22. /// <summary>
  23. /// 测量路径
  24. /// </summary>
  25. public static readonly string path_Measure = "PaintDotNet.Annotation.Measure";
  26. /// <summary>
  27. /// 其他路径
  28. /// </summary>
  29. public static readonly string path_Other = "PaintDotNet.Annotation.Other";
  30. /// <summary>
  31. /// 程序集
  32. /// </summary>
  33. public static readonly string assembly_Data = "PaintDotNet.Data";
  34. /// <summary>
  35. /// 命名空间
  36. /// </summary>
  37. public static readonly string path_Action = "PaintDotNet.Data.Action";
  38. /// <summary>
  39. /// 【预处理】【交互操作】分割线宽
  40. /// </summary>
  41. public static int segmentation = 1;
  42. /// <summary>
  43. /// 【预处理】【交互操作】连接线宽
  44. /// </summary>
  45. public static int connection = 1;
  46. /// <summary>
  47. /// 绘制端点时的减去的值
  48. /// </summary>
  49. public static int rectless = 6;
  50. /// <summary>
  51. /// 绘制端点时加上的值
  52. /// </summary>
  53. public static int rectplus = 12;
  54. /// <summary>
  55. /// 单位集合
  56. /// </summary>
  57. public static Dictionary<int, string> unitsDictionary = new Dictionary<int, string>()
  58. {
  59. //{(int)MeasurementUnit.Pixel, PdnResources.GetString("MeasurementUnit.Pixel")},
  60. {(int)MeasurementUnit.Inch, PdnResources.GetString("MeasurementUnit.Inch")},
  61. {(int)MeasurementUnit.Mil, PdnResources.GetString("MeasurementUnit.Mil")},
  62. {(int)MeasurementUnit.Centimeter, PdnResources.GetString("MeasurementUnit.Centimeter")},
  63. {(int)MeasurementUnit.Millimeter,PdnResources.GetString("Menu.Mm.text")},
  64. {(int)MeasurementUnit.Micron,PdnResources.GetString("Menu.Micron.text")},
  65. {(int)MeasurementUnit.Nano,PdnResources.GetString("Menu.nanometer.text")}
  66. };
  67. /// <summary>
  68. /// 单位集合(针对标尺标定)
  69. /// </summary>
  70. public static Dictionary<int, string> ruleUnitsDictionary = new Dictionary<int, string>()
  71. {
  72. //{(int)MeasurementUnit.Pixel, PdnResources.GetString("MeasurementUnit.Pixel")},
  73. {(int)MeasurementUnit.Inch, PdnResources.GetString("MeasurementUnit.Inch") + "/Inch"},
  74. {(int)MeasurementUnit.Mil, PdnResources.GetString("MeasurementUnit.Mil")+ "/Mil"},
  75. {(int)MeasurementUnit.Centimeter, PdnResources.GetString("MeasurementUnit.Centimeter")+ "/Centimeter"},
  76. {(int)MeasurementUnit.Millimeter,PdnResources.GetString("Menu.Mm.text")+ "/Millimeter"},
  77. {(int)MeasurementUnit.Micron,PdnResources.GetString("Menu.Micron.text")+ "/Micron"},
  78. {(int)MeasurementUnit.Nano,PdnResources.GetString("Menu.nanometer.text")+ "/Nanometer"}
  79. };
  80. /// <summary>
  81. /// 单位符号集合
  82. /// </summary>
  83. public static Dictionary<int, string> unitSymbolsDictionary = new Dictionary<int, string>()
  84. {
  85. //{(int)MeasurementUnit.Pixel, "px"},
  86. {(int)MeasurementUnit.Inch, "in"},
  87. {(int)MeasurementUnit.Mil, "mil"},
  88. {(int)MeasurementUnit.Centimeter, "cm"},
  89. {(int)MeasurementUnit.Millimeter,"mm"},
  90. {(int)MeasurementUnit.Micron,"μm"},
  91. {(int)MeasurementUnit.Nano,"nm"}
  92. };
  93. /// <summary>
  94. /// 常规设置->窗口里面的类型数组
  95. /// </summary>
  96. public static string[] settingName = new string[11] { PdnResources.GetString("Menu.Set.Generalsettings.Namingrules.text"), PdnResources.GetString("Menu.UserInfo.text"), PdnResources.GetString("Menu.Set.Generalsettings.dotspacingsetting.text"), PdnResources.GetString("Menu.Set.Generalsettings.Softwarelanguage.text"), PdnResources.GetString("Menu.Set.Generalsettings.Systemreset.text"), PdnResources.GetString("Menu.BasicSettings.text"), PdnResources.GetString("Menu.ImageCollection.CameraSetting.Text"), PdnResources.GetString("Menu.Directionsetting.text"), PdnResources.GetString("Menu.Auxiliarylinesettings.text") , PdnResources.GetString("Menu.CaptureSave.text"),"拼图设置" };
  97. /// <summary>
  98. /// 常规设置->窗口里面的数值位数数组
  99. /// </summary>
  100. public static string[] numberNum = new string[9] {"1", "2", "3", "4", "5", "6", "7", "8", "9" };
  101. /// <summary>
  102. /// 常规设置->窗口里面的参数说明
  103. /// </summary>
  104. public static Dictionary<string, string> parameterList = new Dictionary<string, string>()
  105. {
  106. {"%P",PdnResources.GetString("Menu.Nameprefix.text") },
  107. {"%I",PdnResources.GetString("Menu.Set.Generalsettings.Thevalueo001.text") },
  108. {"%h",PdnResources.GetString("Menu.Set.Generalsettings.thehourpanttime.text")+"(00-59)" },
  109. {"%m",PdnResources.GetString("Menu.Set.Generalsettings.theminrenttime.text")+"(00-59)" },
  110. {"%s",PdnResources.GetString("Menu.Set.Generalsettings.Thesecondnttime.text")+"(00-59)" },
  111. {"%Y",PdnResources.GetString("Menu.Set.Generalsettings.Theannualparate.Suchas.text")+":2010" },
  112. {"%M",PdnResources.GetString("Menu.Set.Generalsettings.themonrentdate.text")+"(01-12)" },
  113. {"%D",PdnResources.GetString("Menu.Set.Generalsettings.Thedaypartentdate.text")+"(01-31)" },
  114. {"%G",PdnResources.GetString("Menu.CreateaGUIDidentifier.text") },
  115. {"%U",PdnResources.GetString("Menu.Windowsusercurrentlyloggedin.text") },
  116. {"%N",PdnResources.GetString("Menu.NowRuleName.text") },
  117. {"%E",PdnResources.GetString("Menu.NowRuleFangDa.text") },
  118. {"%T1",PdnResources.GetString("Menu.Set.CustomText.text") },
  119. {"%T2",PdnResources.GetString("Menu.Set.CustomText.text") },
  120. {"%T3",PdnResources.GetString("Menu.Set.CustomText.text") },
  121. {"%Z1",PdnResources.GetString("Menu.Set.NamedRuleCharacter.text") + 1},
  122. {"%Z2",PdnResources.GetString("Menu.Set.NamedRuleCharacter.text") + 2},
  123. {"%R",PdnResources.GetString("Menu.Set.SavePosition.text") }
  124. };
  125. /// <summary>
  126. /// 线形的集合
  127. /// 需要改成多语言版本
  128. /// </summary>
  129. public static object[] dashStyles = new object[5] {
  130. PdnResources.GetString("DashStyle.Solid"),
  131. PdnResources.GetString("DashStyle.Dash"),
  132. PdnResources.GetString("DashStyle.Dot"),
  133. PdnResources.GetString("DashStyle.DashDot"),
  134. PdnResources.GetString("DashStyle.DashDotDot")
  135. };
  136. /// <summary>
  137. /// 线的粗细
  138. /// </summary>
  139. public static object[] thinkness = new object[10] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
  140. /// <summary>
  141. /// 脚本,里面的自动执行和交互执行
  142. /// </summary>
  143. public static Dictionary<int, string> scriptDictionary = new Dictionary<int, string>()
  144. {
  145. {1, PdnResources.GetString("Menu.automated.text")},
  146. {2, PdnResources.GetString("Menu.Interactiveexecution.text")}
  147. };
  148. public static Dictionary<int, string> scriptManualDictionary = new Dictionary<int, string>()
  149. {
  150. {2, PdnResources.GetString("Menu.Interactiveexecution.text")}
  151. };
  152. /// <summary>
  153. /// 构建标注分类关系
  154. /// </summary>
  155. public static List<LabelRelationModel> GetLabelRelations()
  156. {
  157. List<LabelRelationModel> list = new List<LabelRelationModel>();
  158. //文本
  159. LabelRelationModel modelText = new LabelRelationModel();
  160. modelText.id = 1;
  161. modelText.name = PdnResources.GetString("Menu.LabelAction.DrawTextString.Text");
  162. modelText.childLabel = new List<LabelRelationModel.ChildLabel>();
  163. modelText.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawTextString.Text"), DrawToolType.DrawTextString, typeof(LabelStyleModel.Text)));
  164. list.Add(modelText);
  165. //标记
  166. LabelRelationModel modelMark = new LabelRelationModel();
  167. modelMark.id = 2;
  168. modelMark.name = PdnResources.GetString("Menu.LabelAction.MarkAction.Text");
  169. modelMark.childLabel = new List<LabelRelationModel.ChildLabel>();
  170. modelMark.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawDateMark.Text"), DrawToolType.DrawDateMark, typeof(LabelStyleModel.DateMark)));
  171. modelMark.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawTimeMark.Text"), DrawToolType.DrawTimeMark, typeof(LabelStyleModel.TimeMark)));
  172. modelMark.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawNumberMark.Text"), DrawToolType.DrawNumberMark, typeof(LabelStyleModel.NumberMark)));
  173. modelMark.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawPointMark.Text"), DrawToolType.DrawPointMark, typeof(LabelStyleModel.PointMark)));
  174. modelMark.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawGainNumber.Text"), DrawToolType.DrawGainNumber, typeof(LabelStyleModel.GainNumber)));
  175. list.Add(modelMark);
  176. //直线
  177. LabelRelationModel modelLine = new LabelRelationModel();
  178. modelLine.id = 3;
  179. modelLine.name = PdnResources.GetString("Menu.LabelAction.DrawLine.Text");
  180. modelLine.childLabel = new List<LabelRelationModel.ChildLabel>();
  181. modelLine.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawLine.Text"), DrawToolType.DrawLine, typeof(LabelStyleModel.LineChildLine)));
  182. modelLine.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawLineSegment.Text"), DrawToolType.DrawLineSegment, typeof(LabelStyleModel.LineChildLineSegment)));
  183. list.Add(modelLine);
  184. //曲线
  185. LabelRelationModel modelCurve = new LabelRelationModel();
  186. modelCurve.id = 4;
  187. modelCurve.name = PdnResources.GetString("Menu.LabelAction.DrawCurve.Text");
  188. modelCurve.childLabel = new List<LabelRelationModel.ChildLabel>();
  189. modelCurve.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawPencil.Text"), DrawToolType.DrawPencil, typeof(LabelStyleModel.Pencil)));
  190. modelCurve.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureBrokenLine.Text"), DrawToolType.DrawPolygonLine, typeof(LabelStyleModel.Polyline)));
  191. modelCurve.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawCurve.Text"), DrawToolType.DrawCurve, typeof(LabelStyleModel.CurveModel)));
  192. modelCurve.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawClosedCurve.Text"), DrawToolType.DrawClosedCurve, typeof(LabelStyleModel.ClosedCurve)));
  193. list.Add(modelCurve);
  194. //箭头
  195. LabelRelationModel modelArrow = new LabelRelationModel();
  196. modelArrow.id = 5;
  197. modelArrow.name = PdnResources.GetString("Menu.LabelAction.ArrowAction.Text");
  198. modelArrow.childLabel = new List<LabelRelationModel.ChildLabel>();
  199. modelArrow.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawOneArrowLine.Text"), DrawToolType.DrawOneArrowLine, typeof(LabelStyleModel.OneWayArrow)));
  200. modelArrow.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawTwoArrowLine.Text"), DrawToolType.DrawTwoArrowLine, typeof(LabelStyleModel.TwoWayArrow)));
  201. list.Add(modelArrow);
  202. //圆
  203. LabelRelationModel modelCircle = new LabelRelationModel();
  204. modelCircle.id = 6;
  205. modelCircle.name = PdnResources.GetString("Menu.LabelAction.DrawCircle.Text");
  206. modelCircle.childLabel = new List<LabelRelationModel.ChildLabel>();
  207. modelCircle.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawCircle.Text"), DrawToolType.DrawCircle, typeof(LabelStyleModel.CircleModel)));
  208. modelCircle.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawEllipse.Text"), DrawToolType.DrawEllipse, typeof(LabelStyleModel.Oval)));
  209. list.Add(modelCircle);
  210. //多边形
  211. LabelRelationModel modelPolygon = new LabelRelationModel();
  212. modelPolygon.id = 7;
  213. modelPolygon.name = PdnResources.GetString("Menu.LabelAction.DrawPolygon.Text");
  214. modelPolygon.childLabel = new List<LabelRelationModel.ChildLabel>();
  215. modelPolygon.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text"), DrawToolType.DrawRectangle, typeof(LabelStyleModel.PolygonRectangle)));
  216. modelPolygon.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawPolygon.Text"), DrawToolType.DrawPolygon, typeof(LabelStyleModel.PolygonPolygon)));
  217. modelPolygon.childLabel.Add(CreateLabelChildModel(PdnResources.GetString("Menu.LabelAction.DrawRoundRectangle.Text"), DrawToolType.DrawRoundRectangle, typeof(LabelStyleModel.RoundedRectangle)));
  218. list.Add(modelPolygon);
  219. //标注大小
  220. LabelRelationModel model = new LabelRelationModel();
  221. model.id = 8;
  222. model.name = PdnResources.GetString("Markpointsetting.Text");
  223. model.childLabel = new List<LabelRelationModel.ChildLabel>();
  224. list.Add(model);
  225. return list;
  226. }
  227. /// <summary>
  228. /// 构建测量分类关系
  229. /// </summary>
  230. public static List<MeasureRelationModel> GetMeasureRelations()
  231. {
  232. List<MeasureRelationModel> list = new List<MeasureRelationModel>();
  233. MeasureRelationModel pleaseChoise = new MeasureRelationModel();
  234. pleaseChoise.id = 0;
  235. pleaseChoise.name = PdnResources.GetString("Menu.Pleaseselect.Text");
  236. list.Add(pleaseChoise);
  237. //长度测量
  238. MeasureRelationModel lengthMeasure = new MeasureRelationModel();
  239. lengthMeasure.id = 1;
  240. lengthMeasure.name = PdnResources.GetString("Menu.MeasureAction.LengthMeasurement.Text");
  241. lengthMeasure.childLabel = new List<MeasureRelationModel.ChildLabel>();
  242. lengthMeasure.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.Pleaseselect.Text"), DrawToolType.Pointer, null));
  243. lengthMeasure.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.LabelAction.DrawLine.Text"), DrawToolType.MeasureLine, typeof(MeasureStyleModel.MeasureLine)));
  244. lengthMeasure.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureLength.Text"), DrawToolType.MeasureLength, typeof(MeasureStyleModel.MeasureLength)));
  245. lengthMeasure.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureHLine.Text"), DrawToolType.MeasureHLine, typeof(MeasureStyleModel.MeasureHLine)));
  246. lengthMeasure.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureVLine.Text"), DrawToolType.MeasureVLine, typeof(MeasureStyleModel.MeasureVLine)));
  247. lengthMeasure.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureDistanceLine.Text"), DrawToolType.MeasureDistanceLine, typeof(MeasureStyleModel.MeasureDistanceLine)));
  248. list.Add(lengthMeasure);
  249. //多点线段
  250. MeasureRelationModel multLine = new MeasureRelationModel();
  251. multLine.id = 2;
  252. multLine.name = PdnResources.GetString("Menu.MeasureAction.MultiPointLineSegment.Text");
  253. multLine.childLabel = new List<MeasureRelationModel.ChildLabel>();
  254. multLine.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.Pleaseselect.Text"), DrawToolType.Pointer, null));
  255. multLine.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureMulLine.Text"), DrawToolType.MeasureMulLine, typeof(MeasureStyleModel.MeasureMulLine)));
  256. multLine.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureMulHVLine.Text"), DrawToolType.MeasureMulHVLine, typeof(MeasureStyleModel.MeasureMulHVLine)));
  257. multLine.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MultiPointLineSegment.Text"), DrawToolType.MeasureMulSegment, typeof(MeasureStyleModel.MeasureMulSegment)));
  258. multLine.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureMulVLine.Text"), DrawToolType.MeasureMulVLine, typeof(MeasureStyleModel.MeasureMulVLine)));
  259. list.Add(multLine);
  260. //曲线长度
  261. MeasureRelationModel curveLength = new MeasureRelationModel();
  262. curveLength.id = 3;
  263. curveLength.name = PdnResources.GetString("Menu.MeasureAction.CurveLength.Text");
  264. curveLength.childLabel = new List<MeasureRelationModel.ChildLabel>();
  265. curveLength.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.Pleaseselect.Text"), DrawToolType.Pointer, null));
  266. curveLength.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureBrokenLine.Text"), DrawToolType.MeasureBrokenLine, typeof(MeasureStyleModel.MeasureBrokenLine)));
  267. curveLength.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureTraceCurve.Text"), DrawToolType.MeasureTraceCurve, typeof(MeasureStyleModel.MeasureTraceCurve)));
  268. curveLength.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.LabelAction.DrawCurve.Text"), DrawToolType.MeasureCurveLine, typeof(MeasureStyleModel.MeasureCurveLine)));
  269. list.Add(curveLength);
  270. //点垂线
  271. MeasureRelationModel pointVertical = new MeasureRelationModel();
  272. pointVertical.id = 4;
  273. pointVertical.name = PdnResources.GetString("Menu.MeasureAction.MeasurePLine.Text");
  274. pointVertical.childLabel = new List<MeasureRelationModel.ChildLabel>();
  275. pointVertical.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.Pleaseselect.Text"), DrawToolType.Pointer, null));
  276. pointVertical.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasurePLine.Text"), DrawToolType.MeasurePLine, typeof(MeasureStyleModel.MeasurePLine)));
  277. pointVertical.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureMulPLine.Text"), DrawToolType.MeasureMulPLine, typeof(MeasureStyleModel.MeasureMulPLine)));
  278. pointVertical.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureHMulPLine.Text"), DrawToolType.MeasureHMulPLine, typeof(MeasureStyleModel.MeasureHMulPLine)));
  279. pointVertical.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureVMulPLine.Text"), DrawToolType.MeasureVMulPLine, typeof(MeasureStyleModel.MeasureVMulPLine)));
  280. pointVertical.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasurePointHLine.Text"), DrawToolType.MeasurePointHLine, typeof(MeasureStyleModel.MeasurePointHLine)));
  281. list.Add(pointVertical);
  282. //平行线测量
  283. MeasureRelationModel parallelLine = new MeasureRelationModel();
  284. parallelLine.id = 5;
  285. parallelLine.name = PdnResources.GetString("Menu.MeasureAction.ParallelLines.Text");
  286. parallelLine.childLabel = new List<MeasureRelationModel.ChildLabel>();
  287. parallelLine.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.Pleaseselect.Text"), DrawToolType.Pointer, null));
  288. parallelLine.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureParallelLine.Text"), DrawToolType.MeasureParallelLine, typeof(MeasureStyleModel.MeasureParallelLine)));
  289. parallelLine.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureMulParallelLine.Text"), DrawToolType.MeasureMulParallelLine, typeof(MeasureStyleModel.MeasureMulParallelLine)));
  290. parallelLine.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureVMulParallelLine.Text"), DrawToolType.MeasureVMulParallelLine, typeof(MeasureStyleModel.MeasureVMulParallelLine)));
  291. parallelLine.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureHMulParallelLine.Text"), DrawToolType.MeasureHMulParallelLine, typeof(MeasureStyleModel.MeasureHMulParallelLine)));
  292. list.Add(parallelLine);
  293. //多边形测量
  294. MeasureRelationModel modelPolygon = new MeasureRelationModel();
  295. modelPolygon.id = 6;
  296. modelPolygon.name = PdnResources.GetString("Menu.MeasureAction.PolygonMeasurement.Text");
  297. modelPolygon.childLabel = new List<MeasureRelationModel.ChildLabel>();
  298. modelPolygon.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.Pleaseselect.Text"), DrawToolType.Pointer, null));
  299. modelPolygon.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.LabelAction.DrawClosedCurve.Text"), DrawToolType.MeasureClosedCurve, typeof(MeasureStyleModel.MeasureClosedCurve)));
  300. modelPolygon.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.LabelAction.DrawPolygon.Text"), DrawToolType.MeasurePolygon, typeof(MeasureStyleModel.MeasurePolygon)));
  301. modelPolygon.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text"), DrawToolType.MeasureRectangle, typeof(MeasureStyleModel.MeasureRectangle)));
  302. modelPolygon.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureRandRectangle.Text"), DrawToolType.MeasureRandRectangle, typeof(MeasureStyleModel.MeasureRandRectangle)));
  303. modelPolygon.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureSquare.Text"), DrawToolType.MeasureSquare, typeof(MeasureStyleModel.MeasureSquare)));
  304. modelPolygon.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureRandSquare.Text"), DrawToolType.MeasureRandSquare, typeof(MeasureStyleModel.MeasureRandSquare)));
  305. modelPolygon.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureTracePolygon.Text"), DrawToolType.MeasureTracePolygon, typeof(MeasureStyleModel.MeasureTracePolygon)));
  306. list.Add(modelPolygon);
  307. //圆形测量
  308. MeasureRelationModel modelCircular = new MeasureRelationModel();
  309. modelCircular.id = 7;
  310. modelCircular.name = PdnResources.GetString("Menu.MeasureAction.CircularMeasurement.Text");
  311. modelCircular.childLabel = new List<MeasureRelationModel.ChildLabel>();
  312. modelCircular.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.Pleaseselect.Text"), DrawToolType.Pointer, null));
  313. modelCircular.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureCircle.Text"), DrawToolType.MeasureCircle, typeof(MeasureStyleModel.MeasureCircle)));
  314. modelCircular.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureInnerCircle.Text"), DrawToolType.MeasureInnerCircle, typeof(MeasureStyleModel.MeasureInnerCircle)));
  315. modelCircular.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureOuterCircle.Text"), DrawToolType.MeasureOuterCircle, typeof(MeasureStyleModel.MeasureOuterCircle)));
  316. modelCircular.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureDiameterCircle.Text"), DrawToolType.MeasureDiameterCircle, typeof(MeasureStyleModel.MeasureDiameterCircle)));
  317. modelCircular.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasurePointEdgeSize.Text"), DrawToolType.MeasurePointEdgeSize, typeof(MeasureStyleModel.MeasurePointEdgeSize)));
  318. modelCircular.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasurePointCenterSize.Text"), DrawToolType.MeasurePointCenterSize, typeof(MeasureStyleModel.MeasurePointCenterSize)));
  319. modelCircular.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasurePointArcSize.Text"), DrawToolType.MeasurePointArcSize, typeof(MeasureStyleModel.MeasurePointArcSize)));
  320. //modelCircular.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureCenterCenterSize.Text"), DrawToolType.MeasureCenterCenterSize, typeof(MeasureStyleModel.MeasureCenterCenterSize)));
  321. list.Add(modelCircular);
  322. //角度测量
  323. MeasureRelationModel modelAngle = new MeasureRelationModel();
  324. modelAngle.id = 8;
  325. modelAngle.name = PdnResources.GetString("Menu.MeasureAction.AngleMeasurement.Text");
  326. modelAngle.childLabel = new List<MeasureRelationModel.ChildLabel>();
  327. modelAngle.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.Pleaseselect.Text"), DrawToolType.Pointer, null));
  328. modelAngle.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureThreePointAngle.Text"), DrawToolType.MeasureThreePointAngle, typeof(MeasureStyleModel.MeasureThreePointAngle)));
  329. modelAngle.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureFourPointAngle.Text"), DrawToolType.MeasureFourPointAngle, typeof(MeasureStyleModel.MeasureFourPointAngle)));
  330. modelAngle.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureThreePointArc.Text"), DrawToolType.MeasureThreePointArc, typeof(MeasureStyleModel.MeasureThreePointArc)));
  331. list.Add(modelAngle);
  332. //对准度测量
  333. MeasureRelationModel modelRegistration = new MeasureRelationModel();
  334. modelRegistration.id = 9;
  335. modelRegistration.name = PdnResources.GetString("Menu.MeasureAction.RegistrationMeasurement.Text");
  336. modelRegistration.childLabel = new List<MeasureRelationModel.ChildLabel>();
  337. modelRegistration.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.Pleaseselect.Text"), DrawToolType.Pointer, null));
  338. modelRegistration.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureCenterCenterSize.Text"), DrawToolType.MeasureCenterCenterSize, typeof(MeasureStyleModel.MeasureCenterCenterSize)));
  339. modelRegistration.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.MeasureAction.MeasureTwoLineVLDistance.Text"), DrawToolType.MeasureTwoLineVLDistance, typeof(MeasureStyleModel.MeasureTwoLineVLDistance)));
  340. list.Add(modelRegistration);
  341. //标记点测量
  342. MeasureRelationModel model = new MeasureRelationModel();
  343. model.id = 10;
  344. model.name = PdnResources.GetString("Markpointsetting.Text");
  345. model.childLabel = new List<MeasureRelationModel.ChildLabel>();
  346. model.childLabel.Add(CreateMeasureChildModel(PdnResources.GetString("Menu.Pleaseselect.Text"), DrawToolType.Pointer, null));
  347. list.Add(model);
  348. return list;
  349. }
  350. /// <summary>
  351. /// 测量属性的全部集合
  352. /// </summary>
  353. public static Dictionary<Enum, Object> measureAttributes = new Dictionary<Enum, object>()
  354. {
  355. { MeasureAttributes.ALL, PdnResources.GetString("Menu.Pleaseselect.Text") },//0
  356. { MeasureAttributes.MeasureMethod, PdnResources.GetString("Menu.Measuringway.text") },//1
  357. { MeasureAttributes.MeasureUnitCN, PdnResources.GetString("Menu.Unitsofmeasurement.text")+"("+PdnResources.GetString("Menu.Set.Generalsettings.Chinese.text")+")" },//2
  358. { MeasureAttributes.MeasureUnitEN, PdnResources.GetString("Menu.Imagement.Measurementlist.Unitofmeasurement(English).text") },//3
  359. { MeasureAttributes.PixelStartX, PdnResources.GetString("Menu.Pixelstartingpoint.text")+"X" },//4
  360. { MeasureAttributes.PixelStartY, PdnResources.GetString("Menu.Pixelstartingpoint.text")+"Y" },//5
  361. { MeasureAttributes.PhysicalStartX, PdnResources.GetString("Menu.Physicalstartingpoint.text")+"X" },//6
  362. { MeasureAttributes.PhysicalStartY, PdnResources.GetString("Menu.Physicalstartingpoint.text")+"Y" },//7
  363. { MeasureAttributes.PixelLength, PdnResources.GetString("Menu.Pixellength.text") },//8
  364. { MeasureAttributes.PhysicalLength, PdnResources.GetString("Menu.Physicallength.text") },//9
  365. { MeasureAttributes.PixelAverageIntercept, PdnResources.GetString("Menu.Pixelaverageintercept.text") },//10
  366. { MeasureAttributes.PhysicalAverage, PdnResources.GetString("Menu.Physicalmeanintercept.text") },//11
  367. { MeasureAttributes.NumberOfSegments, PdnResources.GetString("Menu.Linenumber.text") },//12
  368. { MeasureAttributes.PixelDistance, PdnResources.GetString("Menu.Pixeldistance.text") },//13
  369. { MeasureAttributes.PhysicalDistance, PdnResources.GetString("Menu.Physicaldistance.text") },//14
  370. { MeasureAttributes.PixelAverageDistance, PdnResources.GetString("Menu.Averagepixeldistance.text") },//15
  371. { MeasureAttributes.PhysicalAverageDistance, PdnResources.GetString("Menu.Physicaleandistance.text") },//16
  372. { MeasureAttributes.NumberOfEdges, PdnResources.GetString("Menu.Numberofedges.text") },//17
  373. { MeasureAttributes.PixelArea, PdnResources.GetString("Menu.Thepixelarea.text") },//18
  374. { MeasureAttributes.PhysicalArea, PdnResources.GetString("Menu.Physicalarea.text") },//19
  375. { MeasureAttributes.PixelCircumference, PdnResources.GetString("Menu.Pixelcircumference.text") },//20
  376. { MeasureAttributes.PhysicalCircumference, PdnResources.GetString("Menu.Physicalperimeter.text") },//21
  377. { MeasureAttributes.PixelCenterX, PdnResources.GetString("Menu.Pixelcircle.text")+"X" },//22
  378. { MeasureAttributes.PixelCenterY, PdnResources.GetString("Menu.Pixelcircle.text")+"Y" },//23
  379. { MeasureAttributes.PhysicalCenterX, PdnResources.GetString("Menu.Thphysicalenterofcircle.text")+"X" },//24
  380. { MeasureAttributes.PhysicalCenterY, PdnResources.GetString("Menu.Thphysicalenterofcircle.text")+"Y" },//25
  381. { MeasureAttributes.PixelRadius, PdnResources.GetString("Menu.Pixelsradius.text") },//26
  382. { MeasureAttributes.PhysicalRadius, PdnResources.GetString("Menu.Physicalradius.text") },//27
  383. { MeasureAttributes.PixelDiameter, PdnResources.GetString("Menu.Pixeldiameter.text") },//28
  384. { MeasureAttributes.PhysicalDiameter, PdnResources.GetString("Menu.Physicaldiameter.text") },//29
  385. { MeasureAttributes.Angle, PdnResources.GetString("Menu.TheAngle.text") },//30
  386. { MeasureAttributes.PixelArcLength, PdnResources.GetString("Menu.Pixelarclength.text") },//31
  387. { MeasureAttributes.PhysicalArcLength, PdnResources.GetString("Menu.Physicalarclength.text") }//32
  388. };
  389. /// <summary>
  390. /// 测量和属性关系的集合
  391. /// </summary>
  392. public static Dictionary<Enum, int[]> measureRelationAttributes = new Dictionary<Enum, int[]>()
  393. {
  394. //长度测量
  395. { DrawToolType.MeasureLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } },
  396. { DrawToolType.MeasureLength, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } },
  397. { DrawToolType.MeasureHLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } },
  398. { DrawToolType.MeasureVLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } },
  399. { DrawToolType.MeasureDistanceLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } },
  400. //多点线段
  401. { DrawToolType.MeasureMulLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } },
  402. { DrawToolType.MeasureMulHVLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } },
  403. { DrawToolType.MeasureMulSegment, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } },
  404. { DrawToolType.MeasureMulVLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } },
  405. //曲线
  406. { DrawToolType.MeasureBrokenLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12 } },
  407. { DrawToolType.MeasureTraceCurve, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } },
  408. { DrawToolType.MeasureCurveLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } },
  409. //点垂线
  410. { DrawToolType.MeasurePLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } },
  411. { DrawToolType.MeasureMulPLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } },
  412. { DrawToolType.MeasureHMulPLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } },
  413. { DrawToolType.MeasureVMulPLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } },
  414. { DrawToolType.MeasurePointHLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } },
  415. //平行线
  416. { DrawToolType.MeasureParallelLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } },
  417. { DrawToolType.MeasureMulParallelLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16 } },
  418. { DrawToolType.MeasureVMulParallelLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16 } },
  419. { DrawToolType.MeasureHMulParallelLine, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16 } },
  420. //多边形
  421. { DrawToolType.MeasureClosedCurve, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 18, 19 } },
  422. { DrawToolType.MeasurePolygon, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 18, 19 } },
  423. { DrawToolType.MeasureTracePolygon, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 18, 19 } },
  424. { DrawToolType.MeasureRectangle, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 18, 19, 20, 21 } },
  425. { DrawToolType.MeasureRandRectangle, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 18, 19, 20, 21 } },
  426. { DrawToolType.MeasureSquare, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 18, 19, 20, 21 } },
  427. { DrawToolType.MeasureRandSquare, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 18, 19, 20, 21 } },
  428. //圆形
  429. { DrawToolType.MeasureCircle, new int[]{ 0, 1, 2, 3, 18, 19, 20, 21,22,23,24,25,26,27,28,29 } },
  430. { DrawToolType.MeasureInnerCircle, new int[]{ 0, 1, 2, 3, 18, 19, 20, 21,22,23,24,25,26,27,28,29 } },
  431. { DrawToolType.MeasureOuterCircle, new int[]{ 0, 1, 2, 3, 18, 19, 20, 21,22,23,24,25,26,27,28,29 } },
  432. { DrawToolType.MeasureDiameterCircle, new int[]{ 0, 1, 2, 3, 18, 19, 20, 21,22,23,24,25,26,27,28,29 } },
  433. { DrawToolType.MeasurePointEdgeSize, new int[]{ 0, 1, 2, 3, 13, 14, 18, 19, 20, 21,22,23,24,25,26,27,28,29 } },
  434. { DrawToolType.MeasurePointCenterSize, new int[]{ 0, 1, 2, 3, 13, 14, 18, 19, 20, 21,22,23,24,25,26,27,28,29 } },
  435. { DrawToolType.MeasurePointArcSize, new int[]{ 0, 1, 2, 3, 13, 14, 18, 19, 20, 21,22,23,24,25,26,27,28,29 } },
  436. //角度
  437. { DrawToolType.MeasureThreePointAngle, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 30 } },
  438. { DrawToolType.MeasureFourPointAngle, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 30 } },
  439. { DrawToolType.MeasureThreePointArc, new int[]{ 0, 1, 2, 3, 18, 19, 22,23,24,25,26,27, 30,31, 32 } },
  440. //对准度测量
  441. { DrawToolType.MeasureCenterCenterSize, new int[]{ 0, 1, 2, 3, 13, 14, 18, 19, 20, 21,22,23,24,25,26,27,28,29 } },
  442. { DrawToolType.MeasureTwoLineVLDistance, new int[]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } },
  443. };
  444. /// <summary>
  445. /// 创建标记的子类
  446. /// </summary>
  447. /// <param name="name">标记名称</param>
  448. /// <param name="num">对应的工具枚举</param>
  449. /// <param name="type">对应的配置类型</param>
  450. /// <returns></returns>
  451. public static LabelRelationModel.ChildLabel CreateLabelChildModel(string name, DrawToolType num, Type type)
  452. {
  453. LabelRelationModel.ChildLabel label = new LabelRelationModel.ChildLabel();
  454. label.name = name;
  455. label.drawToolType = num;
  456. label.type = type;
  457. return label;
  458. }
  459. /// <summary>
  460. /// 创建测量的子类
  461. /// </summary>
  462. /// <param name="name">测量名称</param>
  463. /// <param name="num">对应的工具枚举</param>
  464. /// <param name="type">对应的配置类型</param>
  465. /// <returns></returns>
  466. public static MeasureRelationModel.ChildLabel CreateMeasureChildModel(string name, DrawToolType num, Type type)
  467. {
  468. MeasureRelationModel.ChildLabel measure = new MeasureRelationModel.ChildLabel();
  469. measure.name = name;
  470. measure.drawToolType = num;
  471. measure.type = type;
  472. return measure;
  473. }
  474. /// <summary>
  475. /// 文件-批量保存,里面文件格式
  476. /// </summary>
  477. public static Dictionary<string, string> fileFormatDictionary = new Dictionary<string, string>()
  478. {
  479. {".jpg", PdnResources.GetString("Menu.JointPhotographicExpertsGroup.text")+".jpg/jpeg"},
  480. {".bmp", PdnResources.GetString("Menu.Bitmapfile.text")+".bmp"},
  481. {".tiff", PdnResources.GetString("Menu.markingimagefileformat.text")+".tiff"}
  482. };
  483. /// <summary>
  484. /// 腐蚀/膨胀的结构元素
  485. /// </summary>
  486. public static Dictionary<Enum, Object> structures = new Dictionary<Enum, object>()
  487. {
  488. { Structure.conventional, PdnResources.GetString("ColorsForm.MoreLessButton.Text.Less") },
  489. { Structure.horizon, PdnResources.GetString("Menu.Level.text") },
  490. { Structure.angle45, PdnResources.GetString("Menu.45°.text") },
  491. { Structure.vertical, PdnResources.GetString("Menu.vertical.text") },
  492. { Structure.angle135, PdnResources.GetString("Menu.135°.text") },
  493. { Structure.cross, PdnResources.GetString("Menu.cross.text") },
  494. { Structure.square, PdnResources.GetString("Menu.Image.Square.Text") },
  495. { Structure.octagon, PdnResources.GetString("Menu.octagon.text") }
  496. };
  497. /// <summary>
  498. /// 去碎屑的筛选的参数
  499. /// </summary>
  500. public static Dictionary<Enum, Object> filterparameters = new Dictionary<Enum, object>()
  501. {
  502. { FilterParameters.Area, PdnResources.GetString("Menu.area.text") },
  503. { FilterParameters.AreaRatio, PdnResources.GetString("Menu.Arearatio.text") },
  504. { FilterParameters.LongTrail, PdnResources.GetString("Menu.Maximumcaliperdiameter.text") },
  505. { FilterParameters.AspectRatio, PdnResources.GetString("Menu.Aspectratio.text") }
  506. };
  507. /// <summary>
  508. /// 单位筛选
  509. /// </summary>
  510. public static Dictionary<Enum, Object> unitparameters = new Dictionary<Enum, object>()
  511. {
  512. { MeasurementUnit.Micron, PdnResources.GetString("Menu.Micron.text") },
  513. { MeasurementUnit.Pixel, PdnResources.GetString("Menu.Pixel.text") }
  514. };
  515. /// <summary>
  516. /// 去碎屑方式
  517. /// </summary>
  518. public static Dictionary<Enum, Object> functionparameters = new Dictionary<Enum, object>()
  519. {
  520. { FunctionParameters.Remove, PdnResources.GetString("Menu.Binaryoperation.Removedebris.Remove.text") },
  521. { FunctionParameters.Choise, PdnResources.GetString("Menu.MeasureAction.MeasureSelect.Text") }
  522. };
  523. /// <summary>
  524. /// 物相提取->定义物体->轮廓
  525. /// </summary>
  526. public static Dictionary<Enum, Object> contourparameters = new Dictionary<Enum, object>()
  527. {
  528. { ContourParameters.Polygon, PdnResources.GetString("Menu.LabelAction.DrawPolygon.Text") },
  529. { ContourParameters.Rectangle, PdnResources.GetString("Menu.LabelAction.DrawRectangle.Text") },
  530. { ContourParameters.Oval, PdnResources.GetString("Menu.LabelAction.DrawEllipse.Text") }
  531. };
  532. public static Dictionary<Enum, Object> styleparameters = new Dictionary<Enum, object>()
  533. {
  534. { StyleParameters.Solid, PdnResources.GetString("Menu.solid.text") },
  535. { StyleParameters.Sideline, PdnResources.GetString("Menu.Sideline.text") }
  536. };
  537. public static Dictionary<Enum, Object> processingparameters = new Dictionary<Enum, object>()
  538. {
  539. { ProcessingParameters.Add, PdnResources.GetString("Menu.Binaryoperation.Phaseextraction.append.text") },
  540. { ProcessingParameters.Delete, PdnResources.GetString("Menu.Edit.Delete.Text") }
  541. };
  542. public static Dictionary<Enum, Object> fieldofviewparameters = new Dictionary<Enum, object>()
  543. {
  544. { FieldOfViewParameters.One, PdnResources.GetString("Menu.style.text")+"1" },
  545. { FieldOfViewParameters.Two, PdnResources.GetString("Menu.style.text")+"2" },
  546. { FieldOfViewParameters.Three, PdnResources.GetString("Menu.style.text")+"3" }
  547. };
  548. public static Dictionary<Enum, Object> debrisSelectionparameters = new Dictionary<Enum, object>()
  549. {
  550. { DebrisSelectionParameters.area, PdnResources.GetString("Menu.area.text") },
  551. { DebrisSelectionParameters.areaRatio, PdnResources.GetString("Menu.Arearatio.text") },
  552. { DebrisSelectionParameters.perimeter, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.perimeter.text") },
  553. { DebrisSelectionParameters.longAxis, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.Longaxis.text") },
  554. { DebrisSelectionParameters.shortAxis, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.Shortaxis.text") },
  555. { DebrisSelectionParameters.centerX, PdnResources.GetString("Menu.Thecentercoordinates.text")+"x" },
  556. { DebrisSelectionParameters.centerY, PdnResources.GetString("Menu.Thecentercoordinates.text")+"y" },
  557. { DebrisSelectionParameters.inclinationAngle, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.angleofinclination.text") },
  558. { DebrisSelectionParameters.objectAppearance, PdnResources.GetString("Menu.Objectappearance.text") },
  559. { DebrisSelectionParameters.height, PdnResources.GetString("Menu.height.text") },
  560. { DebrisSelectionParameters.width, PdnResources.GetString("Menu.width.text") },
  561. { DebrisSelectionParameters.aspectRatio, PdnResources.GetString("Menu.Aspectratio.text") },
  562. { DebrisSelectionParameters.redDensity, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.Reddensity.text") },
  563. { DebrisSelectionParameters.greenDensity, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.Greendensity.text") },
  564. { DebrisSelectionParameters.blueDensity, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.Bluedensity.text") },
  565. /*{ DebrisSelectionParameters.maxDensity, "最大密度" },
  566. { DebrisSelectionParameters.avgDensity, "平均密度" },
  567. { DebrisSelectionParameters.minDensity, "最小密度" },
  568. { DebrisSelectionParameters.sumDensity, "密度和" },*/
  569. { DebrisSelectionParameters.majorAxis, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.majoraxis.text") },
  570. { DebrisSelectionParameters.minorAxis, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.short trail.text") },
  571. { DebrisSelectionParameters.circumcircleDiameter, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.Circumscribedcirclediameter.text") },
  572. { DebrisSelectionParameters.nodularity, PdnResources.GetString("Menu.nodularity.text") },
  573. { DebrisSelectionParameters.equalCircleDiameter, PdnResources.GetString("Menu.Diameterofequalareacircle.text") },
  574. { DebrisSelectionParameters.maxCaliperDiameter, PdnResources.GetString("Menu.Maximumcaliperdiameter.text") },
  575. { DebrisSelectionParameters.minCaliperDiameter, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.MinimumCaliperDiameter.text") },
  576. { DebrisSelectionParameters.avgCaliperDiameter, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.AverageCaliperDiameter.text") },
  577. { DebrisSelectionParameters.maxGray, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.Maximumgrayscale.text") },
  578. { DebrisSelectionParameters.minGray, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.grayscaleminimization.text") },
  579. { DebrisSelectionParameters.avgGray, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.Averagegray.text") },
  580. { DebrisSelectionParameters.fiberLength, PdnResources.GetString("Menu.Generalanalysis.Particlestatistics.Fiberlength.text") },
  581. { DebrisSelectionParameters.fillArea, "填充面积" },
  582. { DebrisSelectionParameters.waistDepth, "腰宽" },
  583. { DebrisSelectionParameters.waistDepthShort, "腰深" },
  584. };
  585. /// <summary>
  586. /// 颗粒统计-判断条件集合
  587. /// </summary>
  588. public static string[] judgeCondition = new string[] { ">", "<", ">=", "<=" };
  589. /// <summary>
  590. /// 颗粒统计-关联条件集合
  591. /// </summary>
  592. public static string[] joinCondition = new string[] { "and", "or" };
  593. /// <summary>
  594. /// 标注设置-点标记-点样式
  595. /// </summary>
  596. public static Dictionary<Enum, Object> someStyle = new Dictionary<Enum, object>()
  597. {
  598. { SomeStyle.Arrow, PdnResources.GetString("Menu.LabelAction.ArrowAction.Text")},
  599. { SomeStyle.Dot, PdnResources.GetString("Menu.Set.Labelsettings.Dots.text") },
  600. { SomeStyle.Triangle,PdnResources.GetString("Menu.Set.Labelsettings.triangle.text")}
  601. };
  602. /// <summary>
  603. /// 标注设置-标记-位置
  604. /// </summary>
  605. public static Dictionary<Enum, Object> tagLocation = new Dictionary<Enum, object>()
  606. {
  607. { TagLocation.UpLeft, PdnResources.GetString("Menu.Upperleft.text")},
  608. { TagLocation.UpRight, PdnResources.GetString("Menu.Upperright.text")},
  609. { TagLocation.DownLeft, PdnResources.GetString("Menu.Lowerleft.text") },
  610. { TagLocation.DownRight,PdnResources.GetString("Menu.Lowerright.text")}
  611. };
  612. }
  613. }