kingno
5 天以前 caf4dd3c752f5982adcd3708d2e8f976f81ff49f
src/Bro.M141.Process/M141Config.cs
@@ -19,17 +19,18 @@
{
    public class M141Config : ProcessConfigBase
    {
        [Category("打印机配置")]
        [Description("打印机配置集合")]
        [DisplayName("打印机配置集合")]
        [TypeConverter(typeof(CollectionCountConvert))]
        [Editor(typeof(ComplexCollectionEditor<Printer>), typeof(UITypeEditor))]
        public List<Printer> Printers { get; set; } = new List<Printer>();
@@ -72,8 +73,39 @@
        [Category("检测异常指示")]
        [Description("选择某个Spec,其表示检测过程中异常")]
        [DisplayName("异常指示标准")]
        [TypeConverter(typeof(SpecCodeSelectorConverter))]
        [TypeConverter(typeof(SpecCodeSelectorConverter))]
        public string CheckErrorSpecCode { get; set; } = "";
        [Category("特定缺陷配置")]
        [Description("S3和S5共同判断缺陷")]
        [DisplayName("缺陷名称")]
        [TypeConverter(typeof(GlobalDefectNameConverter))]
        public string defectname { get; set; } = "";
        private class GlobalDefectNameConverter : StringConverter
        {
            public override bool GetStandardValuesExclusive(ITypeDescriptorContext? context)
            {
                return false;
            }
            public override bool GetStandardValuesSupported(ITypeDescriptorContext? context)
            {
                return true;
            }
            public override StandardValuesCollection? GetStandardValues(ITypeDescriptorContext? context)
            {
                using (var scope = GlobalVar.Container.BeginLifetimeScope())
                {
                    var config = scope.Resolve<IProcessConfig>();
                    return new StandardValuesCollection((config as IDefectSwitcher).DefectSwitchCollection.Select(u => u.DefectName).ToList());
                }
            }
        }
        [Category("位置度设置")]
@@ -935,6 +967,20 @@
        [Description("true:启动离线测试 false:停止离线测试")]
        [DisplayName("测试开关")]
        public bool IsStart { get; set; } = true;
        [Category("检测功能")]
        [Description("图片在批量测试过程中最终图片结果会存储较慢需要设置延时确保图片不被资源自动释放")]
        [DisplayName("图片存图延时")]
        public int SaveImageTime { get; set; } = 0;
        [Category("检测功能")]
        [Description("true:启动OK测试 false:启动NG测试")]
        [DisplayName("是否测试OK图片")]
        public bool IsOK { get; set; } = true;
    }
    public class RealTimeAdjustDataDetail : IComplexDisplay