IVisionJobInterface.cs 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows.Forms;
  8. using HalconDotNet;
  9. namespace CommonMethods
  10. {
  11. [Serializable]
  12. public abstract class IVisionJob
  13. {
  14. /// <summary>
  15. /// 当前流程树是否处于折叠状态
  16. /// </summary>
  17. public bool jobTreeFold = true;
  18. /// <summary>
  19. /// Job名
  20. /// </summary>
  21. public string JobName { get; set; }
  22. /// <summary>
  23. /// 需要连线的节点对,不停的画连线,注意键值对中第一个为连线的结束节点,第二个为起始节点,一个输出可能连接多个输入,而键值对中的键不能重复,
  24. /// 所以把源作为值,输入作为键
  25. /// </summary>
  26. public Dictionary<TreeNode, TreeNode> D_itemAndSource { get; set; } = new Dictionary<TreeNode, TreeNode>();
  27. /// <summary>
  28. /// JOB上的树结构,取消该参数,TreeView无法二进制序列化
  29. /// </summary>
  30. //public TreeView tvwOnWorkJob { get; set; } = new TreeView();
  31. /// <summary>
  32. /// 工具输入项个数
  33. /// </summary>
  34. public int inputItemNum = 0;
  35. /// <summary>
  36. /// 工具输出项个数
  37. /// </summary>
  38. public int outputItemNum = 0;
  39. /// <summary>
  40. /// 流程运行结果图像,取消,无法序列化
  41. /// </summary>
  42. public static HObject jobResultImage { get; set; } = new HObject();
  43. /// <summary>
  44. /// 流程树中节点的最大长度
  45. /// </summary>
  46. public int maxLength { get; set; }
  47. /// <summary>
  48. /// 工具对象集合
  49. /// </summary>
  50. public List<IToolInfo> L_toolList { get; set; } = new List<IToolInfo>();
  51. /// <summary>
  52. /// 正在绘制输入输出指向线
  53. /// </summary>
  54. public bool isDrawing { get; set; }
  55. /// <summary>
  56. /// 记录本工具执行完的耗时,用于计算各工具耗时
  57. /// </summary>
  58. public double recordElapseTime { get; set; }
  59. /// <summary>
  60. /// 编辑节点前节点文本,用于修改工具名称
  61. /// </summary>
  62. public string nodeTextBeforeEdit { get; set; } = string.Empty;
  63. /// <summary>
  64. /// 标准图像字典,用于存储标准图像路径和图像对象
  65. /// </summary>
  66. public Dictionary<string, HObject> D_standardImage { get; set; } = new Dictionary<string, HObject>();
  67. /// <summary>
  68. /// 记录起始节点和此节点的列坐标值
  69. /// </summary>
  70. public Dictionary<TreeNode, Color> startNodeAndColor { get; set; } = new Dictionary<TreeNode, Color>();
  71. /// <summary>
  72. /// 记录前面的划线所跨越的列段,
  73. /// </summary>
  74. public Dictionary<int, Dictionary<TreeNode, TreeNode>> list { get; set; } = new Dictionary<int, Dictionary<TreeNode, TreeNode>>();
  75. /// <summary>
  76. /// 每一个列坐标值对应一种颜色
  77. /// </summary>
  78. public Dictionary<int, Color> colValueAndColor { get; set; } = new Dictionary<int, Color>();
  79. /// <summary>
  80. /// 输入输出指向线的颜色数组
  81. /// </summary>
  82. public Color[] color { get; set; } = new Color[] { Color.Blue, Color.Orange, Color.Black, Color.Red, Color.Green,
  83. Color.Brown, Color.Blue, Color.Black, Color.Red, Color.Green, Color.Orange, Color.Brown, Color.Blue, Color.Black,
  84. Color.Red, Color.Green, Color.Orange, Color.Brown, Color.Blue, Color.Black, Color.Red, Color.Green, Color.Orange,
  85. Color.Brown, Color.Blue, Color.Black, Color.Red, Color.Green, Color.Orange, Color.Brown};
  86. /// <summary>
  87. /// 流程编辑时的右击菜单
  88. /// </summary>
  89. public static ContextMenuStrip rightClickMenu { get; set; } = new ContextMenuStrip();
  90. /// <summary>
  91. /// 在空白除右击菜单
  92. /// </summary>
  93. public static ContextMenuStrip rightClickMenuAtBlank { get; set; }
  94. }
  95. }