InvariantData.cs 47 KB

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