wxr
2022-12-01 132dc0402e0c5e22a7d54cdddc1700a1842304bd
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>