xm
2021-12-01 6d73bf6e816570291865674bef8bce8972e4de3f
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -63,40 +63,32 @@
            btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png";
            if (function.Spk_Prefix == FunctionCategory.Curtain//窗帘没有开关按钮
                || function.Spk_Prefix == FunctionCategory.Music//音乐没有开关按钮
                || function.Spk_Prefix == FunctionCategory.Sensor//传感器没有开关按钮
                )
            if (SPK.CurtainSpkList().Contains(function.spk))
            {//窗帘没有开关按钮
                CurtainFragment();
            }
            else if (SPK.MusicSpkList().Contains(function.spk))
            {//音乐没有开关按钮
                MusicFragment();
            }
            else if (SPK.EvironmentSensorList().Contains(function.spk) || SPK.ArmSensorSpkList().Contains(function.spk)) //传感器没有开关按钮)
            {
                switch (function.Spk_Prefix)
                var powerLowTipAttr = function.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState);
                if (powerLowTipAttr != null)
                {
                    case FunctionCategory.Curtain:
                        CurtainFragment();
                        break;
                    case FunctionCategory.Sensor:
                        var powerLowTipAttr = function.attributes.Find((obj) => obj.key == FunctionAttributeKey.BatteryState);
                        if (powerLowTipAttr != null)
                    if (powerLowTipAttr.state.ToLower() == "low")
                    {
                        Button btnTipPowerLow = new Button()
                        {
                            if (powerLowTipAttr.state.ToLower() == "low")
                            {
                                Button btnTipPowerLow = new Button()
                                {
                                    X = Application.GetRealWidth(307),
                                    Y = Application.GetRealHeight(25),
                                    Width = Application.GetRealWidth(24),
                                    Height = Application.GetRealWidth(24),
                                    UnSelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png",
                                    SelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png",
                                };
                                this.AddChidren(btnTipPowerLow);
                            }
                        }
                        break;
                    case FunctionCategory.Music:
                        MusicFragment();
                        break;
                            X = Application.GetRealWidth(307),
                            Y = Application.GetRealHeight(25),
                            Width = Application.GetRealWidth(24),
                            Height = Application.GetRealWidth(24),
                            UnSelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png",
                            SelectedImagePath = "FunctionIcon/ArmSensor/PowerLowIcon.png",
                        };
                        this.AddChidren(btnTipPowerLow);
                    }
                }
            }
            else
@@ -148,24 +140,19 @@
                        LoadEvent_SwitchFunction(btnSwitch);
                    }
                    switch (function.Spk_Prefix)
                    if (SPK.AcSpkList().Contains(function.spk) ||
                        SPK.FhSpkList().Contains(function.spk))
                    {
                        case FunctionCategory.AC:
                            LoadLastStatesButton();
                            break;
                        case FunctionCategory.IR:
                            LoadLastStatesButton();
                            break;
                        case FunctionCategory.FloorHeat:
                            LoadLastStatesButton();
                            break;
                        case FunctionCategory.Light:
                            btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on";
                            LoadLightControl();
                            break;
                        case FunctionCategory.Electric:
                            btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on";
                            break;
                        LoadLastStatesButton();
                    }
                    else if (SPK.LightSpkList().Contains(function.spk))
                    {
                        btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on";
                        LoadLightControl();
                    }
                    else if (SPK.ElectricalSpkList().Contains(function.spk))
                    {
                        btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on";
                    }
                    #endregion
                }
@@ -225,9 +212,7 @@
                UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
                IsSelected = function.collect
            };
            //bodyDiv.AddChidren(btnCollectionIcon);
            //2020-12-16 如果是成员隐藏收藏功能
            if ( function.Spk_Prefix != FunctionCategory.Sensor)//!DB_ResidenceData.Instance.CurrentRegion.isOtherShare &&
            if ( !SPK.ArmSensorSpkList().Contains(function.spk) && !SPK.EnvironDeviceSpkList().Contains( function.spk))//!DB_ResidenceData.Instance.CurrentRegion.isOtherShare &&
            {
                bodyDiv.AddChidren(btnCollectionIcon);
            }