kingno
5 天以前 e41fb4bea3afa879caaf6c9f316f01bacf262545
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("位置度设置")]
@@ -931,10 +963,6 @@
        [Editor(typeof(FoldDialogEditor), typeof(UITypeEditor))]
        public string ImageFolder { get; set; }
        [Category("启动配置")]
        [Description("true:启动离线测试 false:停止离线测试")]
        [DisplayName("测试开关")]
        public bool IsStart { get; set; } = true;
        [Category("检测功能")]