using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace VisionEditTest { /// /// 工具信息类 /// [Serializable] public class ToolInfo { public enum DataType { String, Region, Image, Point, Line, Circle, Pose, } /// /// 工具的输入输出类 /// [Serializable] public class ToolIO { public ToolIO() { } public ToolIO(string IOName1, object value1, DataType ioType1) { this.IOName = IOName1; this.value = value1; this.ioType = ioType1; } public string IOName; public object value; public DataType ioType; } public ToolInfo() { enable = true; toolType = ToolType.None; toolName = string.Empty; tool = new object(); input = new List(); output = new List(); } /// /// 工具是否启用 /// public bool enable; /// /// 工具名称 /// public string toolName; /// /// 工具类型 /// public ToolType toolType; /// /// 工具对象 /// public object tool; /// /// 工具描述信息 /// public string toolTipInfo = string.Empty; /// /// 工具输入字典集合 /// public List input; /// /// 工具输出字典集合 /// public List output; /// /// 以IO名获取IO对象 /// /// /// public ToolIO GetInput(string IOName) { for (int i = 0; i < input.Count; i++) { if (input[i].IOName == IOName) return input[i]; } return new ToolIO(); } /// /// 以IO名获取IO对象 /// /// /// public ToolIO GetOutput(string IOName) { for (int i = 0; i < output.Count; i++) { if (output[i].IOName == IOName) return output[i]; } return new ToolIO(); } /// /// 移除工具输入项 /// /// public void RemoveInputIO(string IOName) { for (int i = 0; i < input.Count; i++) { if (input[i].IOName == toolName) input.RemoveAt(i); } } /// /// 移除工具输出项 /// /// public void RemoveOutputIO(string IOName) { for (int i = 0; i < output.Count; i++) { if (output[i].IOName == toolName) output.RemoveAt(i); } } } /// /// 工具类型 /// public enum ToolType { None, HalconInterface, SDK_Basler, SDK_Congex, SDK_PointGray, SDK_IMAVision, SDK_MindVision, SDK_HIKVision, ShapeMatch, EyeHandCalibration, CircleCalibration, SubImage, BlobAnalyse, FindLine, FindCircle, CreateROI, CreatePosition, CoorTrans, OCR, Barcode, RegionFeature, RegionOperation, QRCode, KeyenceSR1000, DownCamAlign, ColorToRGB, DistancePL, DistanceSS, LLPoint, CodeEdit, Label, Logic, Output, CreateLine, } }