wxr
2022-06-13 da1a17600b9ca8c8980ba64447688ee0a6718756
HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs
@@ -360,6 +360,7 @@
                //tvoc
                case SPK.SensorTVOC:
                    {
                        ///tvoc
                        LogicView.FunTypeView tvocView = new LogicView.FunTypeView();
                        tvocView.btnText.TextID = StringId.tvoc;
@@ -386,6 +387,23 @@
                            PmCo2TvocAction(this, device, "hcho", StringId.Formaldehyde, index, edit);
                        };
                    }
                    break;
                //门锁
                case SPK.DoorLock:
                    {
                        LogicView.FunTypeView view = new LogicView.FunTypeView();
                        view.btnText.TextID = StringId.shifoukaisuoshi;
                        fLayout.AddChidren(view.FLayoutView());
                        view.btnClick.MouseUpEventHandler += (sender, e) =>
                        {
                            DeviceView(device, view.btnState, StringId.shi, StringId.offLogic,1);
                        };
                        if (edit)
                        {
                            GetEditState(device, index, view.btnState, null, null, null);
                        }
                    }
                    break;
            }
@@ -465,12 +483,13 @@
        /// <param name="button">选中状态显示文本Btn控件</param>
        /// <param name="btnText1">属性状态值文本1</param>
        /// <param name="btnText2">属性状态值文本2</param>
        private void DeviceView(Entity.Function device, Button button, int btnText1, int btnText2)
        /// <param name="viewCount">view数量</param>
        private void DeviceView(Entity.Function device, Button button, int btnText1, int btnText2,int viewCount=2)
        {
            FrameLayout frame = new FrameLayout { BackgroundColor = CSS.CSS_Color.viewTrans60lucence };
            this.AddChidren(frame);
            LogicView.SwitchView switchView = new LogicView.SwitchView();
            switchView.FLayoutView(frame, btnText1, btnText2, button.Text, (intValue) =>
            switchView.FLayoutView(frame, btnText1, btnText2, button.Text, viewCount,(intValue) =>
            {
                //设备属性值,云雀上定义好的;
                string keyVlaue = "on_off";
@@ -522,6 +541,11 @@
                            }
                        }
                        break;
                    case SPK.DoorLock:
                        {
                            keyVlaue = "door_status";
                        }
                        break;
                }
                switch (intValue)
@@ -565,6 +589,7 @@
                            }
                        }
                        break;
                    case StringId.shi:
                    case StringId.kaiqi:
                        {
                            value = "open";
@@ -589,6 +614,8 @@
                        {
                            value = "fall";
                        }; break;
                }
                //显示文本
                button.TextID = intValue;
@@ -665,7 +692,7 @@
        /// <param name="stateValue">编辑之前的状态值,默认为""</param>
        public void PmCo2TvocAction(FrameLayout frame, Entity.Function device, string key, int title, int index, bool edit, string stateValue = "")
        {
            if (edit)
            if (edit)
            {
                ///
                this.function = device;
@@ -679,12 +706,14 @@
                }
            }
            PublicInterface view = new PublicInterface();
            var listStr = view.GetViewList(key);
            view.SingleSelectionShow(frame, listStr, Language.StringByID(title), view.GetString(key, stateValue)
            //var listStr = view.GetViewList(key);
            var listStr = view.GetSensorLevelList(device);//2022年05月25日10:01:33 产品经理君煌要求改成动态
            view.SingleSelectionShow(frame, listStr, Language.StringByID(title), view.GetSensorLevelText(device, stateValue,true)
               , (text) =>
               {
                  
                   var value = view.GetValue(key, text);
                   //var value = view.GetValue(key, text);
                   var values = view.GetSensorLevelText(device,text,false);
                   selectedState = device.spk + "_" + key;
                   switch (device.spk)
                   {
@@ -702,7 +731,7 @@
                           }
                           break;
                   }
                   AddDictionary(key, value, "integer", "in");
                   AddDictionary(key, values, "integer", "in");
                   Save(device, index, edit);
               });
        }