From e44926acb6ab99ea0d5baf758773a0f383e441a9 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期五, 25 十一月 2022 14:23:54 +0800
Subject: [PATCH] 2022年11月25日14:23:44

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs |   55 +++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 43 insertions(+), 12 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
index 7554d49..064ddef 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -540,8 +540,8 @@
                         fLayout.AddChidren(view1.FLayoutView());
                         view1.btnClick.MouseUpEventHandler += (sender, e) =>
                         {
-                            identifier = "door_call_cloud_event";
-                            DeviceView(device, view1.btnState, StringId.shi, StringId.offLogic, 1);
+                            this.identifier = "door_call_cloud_event";
+                            this.DeviceView(device, view1.btnState, StringId.shi, StringId.offLogic, 1);
                         };
 
                         LogicView.FunTypeView view2 = new LogicView.FunTypeView();
@@ -550,7 +550,7 @@
                         fLayout.AddChidren(view2.FLayoutView());
                         view2.btnClick.MouseUpEventHandler += (sender, e) =>
                         {
-                            identifier = "door_pedestrian_records";
+                            this.identifier = "door_pedestrian_records";
                             this.FaceAction(this, device, view2.btnState);
                         };
 
@@ -580,10 +580,30 @@
                         }
                         if (edit)
                         {
-                            GetEditState(device, index, view1.btnState, view2.btnState, null, null);
+                            this.GetEditState(device, index, view1.btnState, view2.btnState, null, null);
                         }
                     }
                     break;
+                //澶у崕鎽勫儚澶�
+                case SPK.IpCam_Imou:
+                    {
+                        LogicView.FunTypeView view = new LogicView.FunTypeView(); 
+                        view.btnText.TextID = StringId.quyuruqingaojing;
+                        view.btnText.Name = Language.StringByID(StringId.shipintonghuahujiao);
+                        fLayout.AddChidren(view.FLayoutView());
+                        view.btnClick.MouseUpEventHandler += (sender, e) =>
+                        {
+                            this.identifier = "ipcam_region_alram_event";
+                            this.DeviceView(device, view.btnState, StringId.shi, StringId.offLogic, 1);
+                        };
+
+                        if (edit)
+                        {
+                            this.GetEditState(device, index, view.btnState, null, null, null);
+                        }
+                    }
+                    break;
+                    
             }
             #region  淇濆瓨
             ///淇濆瓨View
@@ -593,7 +613,7 @@
             this.AddChidren(saveView.FLayoutView());
             saveView.btnClick.MouseUpEventHandler += (sen, e) =>
             {
-                Save(device,index, edit);
+                this.SaveInput(device,index, edit);
             };
 
             #endregion
@@ -604,7 +624,7 @@
         /// </summary>
         /// <param name="index">绱㈠紩鍊�</param>
         /// <param name="edit"></param>
-        private void Save(Entity.Function device,int index, bool edit)
+        private void SaveInput(Entity.Function device,int index, bool edit) 
         {
             
             if (selectedState != "unknown")
@@ -623,8 +643,19 @@
                         inputDevice.condition = new List<Dictionary<string, string>>();
                     }
                 }
-               
-               
+                else if (device.spk == SPK.IpCam_Imou)
+                {
+                    //澶у崕鎽勫儚澶�
+                    inputDevice.condition_type = "9";
+                    inputDevice.identifier = this.identifier;
+                    if (this.identifier == "ipcam_region_alram_event")
+                    {
+                        //condition榛樿[]
+                        inputDevice.condition = new List<Dictionary<string, string>>();
+                    }
+                }
+
+
                 if (edit)
                 {
                     //绉婚櫎鏃ф暟鎹�
@@ -855,11 +886,11 @@
                     || (button.Name == Language.StringByID(StringId.diedaobaojing)))
                     {
                         //鍙湁姣背娉紶鎰熷櫒(鑷爺)
-                        Save(device, mIndex, mEdit);
+                        SaveInput(device, mIndex, mEdit);
                     }
                     else if (button.Name == Language.StringByID(StringId.shipintonghuahujiao)) {
                         //鍙湁姣背娉紶鎰熷櫒(鑷爺)
-                        Save(device, mIndex, mEdit);
+                        SaveInput(device, mIndex, mEdit);
                     }
                 }
             
@@ -921,7 +952,7 @@
                 }
                 selectedState = device.spk + "_" + value;
                 AddDictionary(keyValue, value, data_type, comparator);
-                Save(device,index, edit);
+                SaveInput(device,index, edit);
             });
         }
         /// PM2.5,Co2,Tvoc璁剧疆鍊�
@@ -979,7 +1010,7 @@
                            break;
                    }
                    AddDictionary(key, values, "integer", "in");
-                   Save(device, index, edit);
+                   SaveInput(device, index, edit);
                });
         }
         /// <summary>

--
Gitblit v1.8.0