ActionAnalysis.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. using PaintDotNet.Data.Param;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Drawing;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace PaintDotNet.Data.Action
  9. {
  10. /// <summary>
  11. /// 通用分析 专用分析父类
  12. /// </summary>
  13. public class ActionAnalysis: ParamObject
  14. {
  15. public ActionAnalysis() {
  16. this.OpenImage = "current";
  17. //默认1个颜色区间
  18. BooleanObject colorInterval = new BooleanObject();
  19. colorInterval.key = "colorInterval";
  20. colorInterval.name = PdnResources.GetString("Menu.inverse.text");
  21. colorInterval.initialValue = false;
  22. colorInterval.value = false;
  23. lists.Add(colorInterval);
  24. //第一个参数
  25. List<double> oneL = new List<double>();
  26. oneL.Add(0);
  27. oneL.Add(0);
  28. DecimalScope one = new DecimalScope(0, 255);
  29. one.key = "scope1";
  30. one.name = PdnResources.GetString("Menu.Colorinterval.text");
  31. one.value = oneL;
  32. lists.Add(one);
  33. List<double> threeL = new List<double>();
  34. threeL.Add(0);
  35. threeL.Add(0);
  36. DecimalScope three = new DecimalScope(0, 255);
  37. three.key = "scope3";
  38. three.name = "反选" + PdnResources.GetString("Menu.Colorinterval.text");
  39. three.value = threeL;
  40. lists.Add(three);
  41. List<double> twoL = new List<double>();
  42. twoL.Add(0);
  43. twoL.Add(0);
  44. DecimalScope two = new DecimalScope(0, 255);
  45. two.key = "scope2";
  46. two.name = "反选" + PdnResources.GetString("Menu.Colorinterval.text");
  47. two.value = twoL;
  48. lists.Add(two);
  49. BooleanObject autoThreshold = new BooleanObject();
  50. autoThreshold.key = "autoThreshold";
  51. autoThreshold.name = PdnResources.GetString("Menu.Automaticthreshold.text");
  52. autoThreshold.initialValue = false;
  53. autoThreshold.value = false;
  54. lists.Add(autoThreshold);
  55. //重要说明:binaryMat和Original两个参数顺序不能颠倒
  56. BooleanObject Original = new BooleanObject();
  57. Original.key = "binarization";
  58. Original.name = PdnResources.GetString("Menu.Binarization.text");
  59. Original.initialValue = false;
  60. Original.value = false;
  61. lists.Add(Original);
  62. BooleanObject binaryMat = new BooleanObject();
  63. binaryMat.key = "theoriginalcolor";
  64. binaryMat.name = PdnResources.GetString("Menu.Theoriginalcolor.text");
  65. binaryMat.initialValue = false;
  66. binaryMat.value = false;
  67. lists.Add(binaryMat);
  68. //二值样式
  69. ChoiseArray binaryType = new ChoiseArray("binaryStyle", PdnResources.GetString("Menu.Binarystyle.text"),
  70. new BooleanObject[]
  71. {
  72. new BooleanObject("1", PdnResources.GetString("Menu.solid.text"), true, null),//fill
  73. new BooleanObject("2", PdnResources.GetString("Menu.Sideline.text"), false, null)//solid
  74. }
  75. );
  76. binaryType.initialValue = 1;
  77. binaryType.value = 1;
  78. lists.Add(binaryType);
  79. ColorNumber phaseColor = new ColorNumber();
  80. phaseColor.key = "phaseColor";
  81. phaseColor.name = PdnResources.GetString("Menu.Phasecolor.text");
  82. phaseColor.Value = Color.Red.ToArgb();
  83. lists.Add(phaseColor);
  84. IntegerNumber seven = new IntegerNumber(0, 10);
  85. seven.key = "CalculatorDecimalDigits";
  86. seven.name = "小数点位数";
  87. seven.initialValue = 2;
  88. seven.value = 2;
  89. lists.Add(seven);
  90. lists.Add(new BooleanObject("OpenWhileExportReport", "生成报告时打开设置", true, null));
  91. lists.Add(new BooleanObject("ExportResults", "导出结果", true, null));
  92. lists.Add(new BooleanObject("ExportReports", "生成报告", true, null));
  93. lists.Add(new BooleanObject("ExportProjects", "导出项目", true, null));
  94. }
  95. }
  96. }