using Autofac; using BRS.Common.Base; using BRS.Common.Model.Helper; using BRS.Common.Interface; using BRS.Common.Model; using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Drawing.Design; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BRS.Process.A020 { [Process("A020", EnumHelper.DeviceAttributeType.InitialConfig)] public class A020Config : ProcessConfigBase { //[Category("全局配置")] //[DisplayName("数据过期天数")] //[Description("OverdueDay:数据库保存天数,超出该值,则认为数据过期,会被清理")] //public int OverdueDay { get; set; } = 14; // [Category("触发配置")] //[Description("检测取像相关设置")] //[DisplayName("检测取像触发")] //[TypeConverter(typeof(CollectionCountConvert))] //[Editor(typeof(ComplexCollectionEditor), typeof(UITypeEditor))] //public List DetectionTriggerConfigCollection { get; set; } = new List(); //[Category("触发配置")] //[Description("其他触发设置,包括结果获取等")] //[DisplayName("其他触发设置")] //[TypeConverter(typeof(CollectionCountConvert))] //[Editor(typeof(ComplexCollectionEditor), typeof(UITypeEditor))] //public List TriggerConfigCollection { get; set; } = new List(); //[Category("触发配置")] //[Description("产品振盘翻面配置")] //[DisplayName("产品振盘翻面配置")] //[TypeConverter(typeof(ComplexObjectConvert))] //[Editor(typeof(PropertyObjectEditor), typeof(UITypeEditor))] //public TurnOverConfig TurnOverConfig { get; set; } = new TurnOverConfig(); //[Category("产品信息配置")] //[Description("产品信息配置")] //[DisplayName("产品信息配置")] //[TypeConverter(typeof(ComplexObjectConvert))] //[Editor(typeof(PropertyObjectEditor), typeof(UITypeEditor))] //public ProductInfoConfig ProductInfo { get; set; } = new ProductInfoConfig(); //[Category("检测结果配置")] //[DisplayName("TBD优先")] //[Description("检测结果数量不足时,true:按TBD处理 false:按当前结果计算")] //public bool IsTBDPriority { get; set; } = true; //[Category("流程动作配置")] //[Description("流程开始操作配置")] //[DisplayName("流程开始操作配置")] //[TypeConverter(typeof(CollectionCountConvert))] //[Editor(typeof(ComplexCollectionEditor), typeof(UITypeEditor))] //public List ProcessInitialOps { get; set; } = new List(); //[Category("流程动作配置")] //[Description("流程关闭操作配置")] //[DisplayName("流程关闭操作配置")] //[TypeConverter(typeof(CollectionCountConvert))] //[Editor(typeof(ComplexCollectionEditor), typeof(UITypeEditor))] //public List ProcessCloseOps { get; set; } = new List(); //[Category("检测保存设置")] //[DisplayName("检测图片保存目录")] //[Description("ImgDirectory:采图保存目录")] //[Editor(typeof(FoldDialogEditor), typeof(UITypeEditor))] //public string ImgDirectory { get; set; } //[Category("产品数据保存设置")] //[DisplayName("产品CSV数据保存")] //[Description("true:保存CSV产品数据 false:不保存CSV产品数据")] //public bool IsSaveCSVData { get; set; } = false; //[Category("产品数据保存设置")] //[DisplayName("产品数据库保存")] //[Description("true:保存产品数据到数据库 false:不保存产品数据到数据库")] //public bool IsSaveDataBase { get; set; } = true; //[Category("屏蔽配置")] //[DisplayName("安全门屏蔽")] //[Description("true:屏蔽安全门 false:启用安全门")] //[ReadOnly(true)] //public bool IsSafetyDoorBlocked { get; set; } = false; //[Category("屏蔽配置")] //[DisplayName("气源感知屏蔽")] //[Description("true:屏蔽气源感知 false:启用气源感知")] //[ReadOnly(true)] //public bool IsAirSensorBlocked { get; set; } = false; //private bool isBeepBlocked = false; //[Category("屏蔽配置")] //[DisplayName("蜂鸣器屏蔽")] //[Description("true:屏蔽蜂鸣器 false:启用蜂鸣器")] //public bool IsBeepBlocked //{ // get => isBeepBlocked; // set => Set(ref isBeepBlocked, value); //} //[Category("全局配置")] //[DisplayName("大复位时间")] //[Description("大复位时间,单位:s")] //public int FullResetRequiredDuration { get; set; } = 3; } //public class TurnOverConfig : IComplexDisplay //{ // [Category("取像相机设置")] // [Description("取像相机")] // [DisplayName("取像相机")] // [TypeConverter(typeof(DeviceIdSelectorConverter))] // public string CameraId { get; set; } // [Category("输出设置")] // [DisplayName("需要操作的IO")] // [Description("需要操作的IO")] // public int IOIndex { get; set; } // [Category("触发设置")] // [DisplayName("启用触发")] // [Description("true:启用触发 false:关闭触发")] // public bool IsEnableTrigger { get; set; } // [Category("输出设置")] // [Description("翻面触发吹气等待,从相机取像完成开始,超过该时间后触发正反吹气,单位ms")] // [DisplayName("翻面触发吹气等待")] // public int TurnOverWaitTime { get; set; } = 500; // [Category("输出设置")] // [Description("翻面触发吹气标签,检测结果为该标签时,触发吹气停止,请设置小写")] // [DisplayName("翻面触发吹气标签")] // public string TurnOverLabel { get; set; } = "up"; // [Category("输出设置")] // [DisplayName("吹气持续时间")] // [Description("吹气持续时间,单位:ms")] // public int OutputElapsed { get; set; } = 100; // public string GetDisplayText() // { // return $"{(IsEnableTrigger ? "启用" : "禁用")} --翻面检测触发IO:{IOIndex}"; // } //} ///// ///// 产品配置 ///// //public class ProductInfoConfig : IComplexDisplay //{ // [Category("产品信息配置")] // [Description("产品外径,单位 mm")] // [DisplayName("产品外径")] // public double OutsideDiameter { get; set; } = 27.00; // [Category("产品信息配置")] // [Description("产品高度,单位 mm")] // [DisplayName("产品高度")] // public double Height { get; set; } = 5.00; // [Category("产品配方配置")] // [Description("产品外径PLC配方地址")] // [DisplayName("产品外径PLC配方地址")] // public string OutsideDiameterPLCAddress { get; set; } // [Category("产品配方配置")] // [Description("产品高度PLC配方地址")] // [DisplayName("产品高度PLC配方地址")] // public string HeightPLCAddress { get; set; } // [Category("产品配方配置")] // [Description("产品号PLC配方地址")] // [DisplayName("产品号PLC配方地址")] // public string PCodePLCAddress { get; set; } // [Category("产品配方配置")] // [Description("PLC配方完成地址")] // [DisplayName("PLC配方完成地址")] // public string FormulasDonePLCAddress { get; set; } // public string GetDisplayText() // { // return $"产品外径:{OutsideDiameter} 高度:{Height}"; // } //} //public class OutputTriggerConfig : OperationConfigBase //{ // [Category("触发后输出配置")] // [Description("输出索引")] // public int OutputIndex { get; set; } = 1; // [Category("触发后输出配置")] // [Description("输出值")] // public int OutputValue { get; set; } = 0; // [Category("触发后输出配置")] // [Description("触发时间,单位:ms")] // public int OutputElapsed { get; set; } = 0; //} }