From 78289c64a16dd02cc9fec595bf758a9e30a30926 Mon Sep 17 00:00:00 2001
From: patrick.xu <patrick.xu@broconcentric.com>
Date: 星期六, 20 二月 2021 10:51:11 +0800
Subject: [PATCH] gocator修改异步模式下图片获取操作

---
 src/Bro.Common.Model/Model/MonitorSet.cs |  107 +++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 83 insertions(+), 24 deletions(-)

diff --git a/src/Bro.Common.Model/Model/MonitorSet.cs b/src/Bro.Common.Model/Model/MonitorSet.cs
index 74d5a8f..c666168 100644
--- a/src/Bro.Common.Model/Model/MonitorSet.cs
+++ b/src/Bro.Common.Model/Model/MonitorSet.cs
@@ -11,10 +11,11 @@
 using System.Linq;
 using System.Windows.Forms;
 using System.Windows.Forms.Design;
+using static Bro.Common.Helper.EnumHelper;
 
 namespace Bro.Common.Model
 {
-    public class SimpleMonitorSet : IMonitorSet, IComplexDisplay
+    public class MonitorSetBase : IMonitorSet, IComplexDisplay
     {
         [Browsable(false)]
         public string Id { get; set; } = Guid.NewGuid().ToString();
@@ -63,6 +64,10 @@
         public string Name { get; set; } = "";
 
         [Browsable(false)]
+        [JsonIgnore]
+        public ProcessResponse Response { get; set; } = new ProcessResponse();
+
+        [Browsable(false)]
         public string DisplayText
         {
             get
@@ -71,7 +76,7 @@
             }
         }
 
-        public SimpleMonitorSet() { }
+        public MonitorSetBase() { }
 
         public virtual string GetDisplayText()
         {
@@ -117,13 +122,13 @@
     /// <summary>
     /// PLC鐩戝惉璁剧疆
     /// </summary>
-    public class MonitorSet : SimpleMonitorSet
+    public class PLCMonitorSet : MonitorSetBase
     {
         /// <summary>
-        /// 鐩戝惉鍦板潃绱㈠紩 鎸夌収PLC鐩戝惉鍦板潃浠�0寮�濮嬬殑绱㈠紩
+        /// 鐩戝惉鍦板潃绱㈠紩 鎸夌収鐩戝惉鍦板潃浠�0寮�濮嬬殑绱㈠紩
         /// </summary>
         [Category("鐩戝惉璁剧疆")]
-        [Description("鐩戝惉鍦板潃绱㈠紩 鎸夌収PLC鐩戝惉鍦板潃浠�0寮�濮嬬殑绱㈠紩")]
+        [Description("鐩戝惉鍦板潃绱㈠紩 鎸夌収鐩戝惉鍦板潃浠�0寮�濮嬬殑绱㈠紩")]
         [DisplayName("瑙﹀彂绱㈠紩")]
         public int TriggerIndex { get; set; } = -1;
 
@@ -136,16 +141,16 @@
         public int TriggerValue { get; set; } = -1;
 
         /// <summary>
-        /// 浼犲叆鏁版嵁鍦板潃鐨勭储寮� 鎸夌収PLC鐩戝惉鍦板潃浠�0寮�濮嬬殑绱㈠紩闆嗗悎
+        /// 浼犲叆鏁版嵁鍦板潃鐨勭储寮� 鎸夌収鐩戝惉鍦板潃浠�0寮�濮嬬殑绱㈠紩闆嗗悎
         /// </summary>
         [Category("鐩戝惉璁剧疆")]
-        [Description("浼犲叆鏁版嵁鍦板潃鐨勭储寮� 鎸夌収PLC鐩戝惉鍦板潃浠�0寮�濮嬬殑绱㈠紩")]
+        [Description("浼犲叆鏁版嵁鍦板潃鐨勭储寮� 鎸夌収鐩戝惉鍦板潃浠�0寮�濮嬬殑绱㈠紩")]
         [DisplayName("浼犲叆鏁版嵁绱㈠紩")]
         [TypeConverter(typeof(SimpleCollectionConvert<int>))]
         public List<int> InputDataIndex { get; set; } = new List<int>();
 
         /// <summary>
-        /// 鏁版嵁鍦板潃 瀹為檯PLC瀵勫瓨鍣ㄧ殑鍦板潃锛屼緥濡� 40012
+        /// 鏁版嵁鍦板潃 瀹為檯瀵勫瓨鍣ㄧ殑鍦板潃锛屼緥濡� 40012
         /// </summary>
         [Category("鍥炰紶璁剧疆")]
         [Description("鍥炰紶鏁版嵁鍦板潃 瀹為檯PLC瀵勫瓨鍣ㄧ殑鍦板潃,10杩涘埗锛屼緥濡� 40012")]
@@ -153,18 +158,14 @@
         public int ReplyDataAddress { get; set; } = -1;
 
         /// <summary>
-        /// 閫氱煡鍦板潃 瀹為檯PLC瀵勫瓨鍣ㄧ殑鍦板潃锛屼緥濡� 40012
+        /// 閫氱煡鍦板潃 瀹為檯瀵勫瓨鍣ㄧ殑鍦板潃锛屼緥濡� 40012
         /// </summary>
         [Category("鍥炰紶璁剧疆")]
-        [Description("閫氱煡鍦板潃 瀹為檯PLC瀵勫瓨鍣ㄧ殑鍦板潃,10杩涘埗锛屼緥濡� 40012")]
+        [Description("閫氱煡鍦板潃 瀹為檯瀵勫瓨鍣ㄧ殑鍦板潃,10杩涘埗锛屼緥濡� 40012")]
         [DisplayName("閫氱煡鍦板潃")]
         public int NoticeAddress { get; set; } = -1;
 
-        [Browsable(false)]
-        [JsonIgnore]
-        public ProcessResponse Response { get; set; } = new ProcessResponse();
-
-        public MonitorSet() { }
+        public PLCMonitorSet() { }
 
         public override string GetDisplayText()
         {
@@ -174,6 +175,55 @@
 
             return desc;
         }
+    }
+
+    /// <summary>
+    /// 杩愬姩鏉垮崱IO鐩戝惉閰嶇疆瀵硅薄
+    /// </summary>
+    public class MotionCardMonitorSet : MonitorSetBase
+    {
+        /// <summary>
+        /// 鐩戝惉绫诲瀷
+        /// </summary>
+        [Category("鐩戝惉璁剧疆")]
+        [DisplayName("鐩戝惉绫诲瀷")]
+        [Description("鐩戝惉杩愬姩鏉垮崱 IO 绫诲瀷锛圛N OUT锛�")]
+        public IOType MonitorIOModel { get; set; }
+
+        /// <summary>
+        /// 鐩戝惉鍦板潃绱㈠紩
+        /// </summary>
+        [Category("鐩戝惉璁剧疆")]
+        [Description("鐩戝惉鍦板潃绱㈠紩")]
+        [DisplayName("瑙﹀彂绱㈠紩")]
+        public int TriggerIndex { get; set; } = -1;
+
+        /// <summary>
+        /// 瑙﹀彂鍊�
+        /// </summary>
+        [Category("鐩戝惉璁剧疆")]
+        [Description("瑙﹀彂鍊硷紝璁剧疆涓�-999鏃跺彉鍖栧嵆瑙﹀彂")]
+        [DisplayName("瑙﹀彂鍊�")]
+        public int TriggerValue { get; set; } = -1;
+
+        ///// <summary>
+        ///// 浼犲叆鏁版嵁鍦板潃鐨勭储寮� 鎸夌収鐩戝惉鍦板潃浠�0寮�濮嬬殑绱㈠紩闆嗗悎
+        ///// </summary>
+        //[Category("鐩戝惉璁剧疆")]
+        //[Description("浼犲叆鏁版嵁鍦板潃鐨勭储寮� 鎸夌収鐩戝惉鍦板潃浠�0寮�濮嬬殑绱㈠紩")]
+        //[DisplayName("浼犲叆鏁版嵁绱㈠紩")]
+        //[TypeConverter(typeof(SimpleCollectionConvert<int>))]
+        //public List<int> InputDataIndex { get; set; } = new List<int>();
+
+        /// <summary>
+        /// 鐩戝惉鍥炰紶
+        /// </summary>
+        //[Category("鍥炰紶璁剧疆")]
+        //[DisplayName("鐩戝惉鍥炰紶")]
+        //[Description("鐩戝惉杩愬姩鏉垮崱锛屽苟寰�鎸囧畾鐨処O鍐欏叆鏁版嵁")]
+        //[TypeConverter(typeof(CollectionCountConvert))]
+        //[Editor(typeof(ComplexCollectionEditor<IOItem>), typeof(UITypeEditor))]
+        //public List<IOItem> ReplyIODatas { get; set; } = new List<IOItem>();
     }
 
     public class IOperationConfigEditor : UITypeEditor
@@ -205,18 +255,27 @@
                     }
                 }
 
-                FrmOpConfigEdit frm = new FrmOpConfigEdit(ms.MethodCode, ms.Id, value as IOperationConfig)
+                FrmDeviceOpConfigEditor frmDeviceOpEditor = new FrmDeviceOpConfigEditor(new DeviceOpBind() { Device = ms.InvokeDevice, OpConfig = value as IOperationConfig }, false)
                 {
                     StartPosition = FormStartPosition.CenterScreen
                 };
-                if (frm.ShowDialog() == DialogResult.OK)
-                {
-                    return frm.OpConfig;
-                }
-                else
-                {
-                    return frm.BackupConfig;
-                }
+                frmDeviceOpEditor.ShowDialog();
+                frmDeviceOpEditor.Bind.OpConfig.MonitorSetId = ms.Id;
+                frmDeviceOpEditor.Bind.OpConfig.DeviceId = ms.InvokeDevice;
+
+                return frmDeviceOpEditor.Bind.OpConfig;
+                //FrmOpConfigEdit frm = new FrmOpConfigEdit(ms.MethodCode, ms.Id, value as IOperationConfig)
+                //{
+                //    StartPosition = FormStartPosition.CenterScreen
+                //};
+                //if (frm.ShowDialog() == DialogResult.OK)
+                //{
+                //    return frm.OpConfig;
+                //}
+                //else
+                //{
+                //    return frm.BackupConfig;
+                //}
             }
 
             return base.EditValue(context, provider, value);

--
Gitblit v1.8.0