From 30458c0bca8066d98ca901b5065832a44a7e970e Mon Sep 17 00:00:00 2001
From: wells.liu <wells.liu@broconcentric.com>
Date: 星期四, 16 七月 2020 15:47:22 +0800
Subject: [PATCH] 测量结果 查询+导出功能

---
 src/Bro.Common.Model/Forms/FrmDeviceOpConfigEditor.cs |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/Bro.Common.Model/Forms/FrmDeviceOpConfigEditor.cs b/src/Bro.Common.Model/Forms/FrmDeviceOpConfigEditor.cs
index 26b8303..4ae9e2e 100644
--- a/src/Bro.Common.Model/Forms/FrmDeviceOpConfigEditor.cs
+++ b/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;
         }
 

--
Gitblit v1.8.0