领胜LDS 键盘AOI检测项目
wells.liu
2020-09-07 1491846b4736bc2e79604086acfd8544aa3ba384
src/Bro.Common.Model/Forms/FrmDeviceOpConfigEditor.cs
@@ -29,7 +29,7 @@
        IOperationConfig backOpConfig = new OperationConfigBase();
        List<IDevice> deviceList = null;
        IDevice currentDevice = null;
        public FrmDeviceOpConfigEditor(DeviceOpBind bind)
        public FrmDeviceOpConfigEditor(DeviceOpBind bind, bool isEnableSelectDevice = true)
        {
            InitializeComponent();
@@ -56,7 +56,15 @@
                    cboDevice.SelectedIndex = 0;
            }
            cboDevice.SelectedIndexChanged += CboDevice_SelectedIndexChanged;
            if (isEnableSelectDevice)
            {
                cboDevice.Enabled = true;
                cboDevice.SelectedIndexChanged += CboDevice_SelectedIndexChanged;
            }
            else
            {
                cboDevice.Enabled = false;
            }
            if (bind.OpConfig == null)
            {
@@ -91,7 +99,7 @@
                var attr = device.GetType().GetCustomAttribute<DeviceAttribute>();
                if (attr != null)
                {
                    var opConfig= ConfigFactory.GetOperationConfig(attr.TypeCode);
                    var opConfig = ConfigFactory.GetOperationConfig(attr.TypeCode);
                    opConfig.DeviceId = device.Id;
                    propGrid.SelectedObject = opConfig;
                }
@@ -120,6 +128,7 @@
        {
            Bind.Device = cboDevice.SelectedValue.ToString();
            Bind.OpConfig = propGrid.SelectedObject as IOperationConfig;
            Bind.OpConfig.DeviceId = Bind.Device;
            this.DialogResult = DialogResult.OK;
        }