mac
2023-09-01 0a11352dffeb8d5f31dd40b9728fe1abf4537f04
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -38,12 +38,18 @@
        /// 是否在调光
        /// </summary>
        bool onDimmerBar;
        /// <summary>
        /// 删除设备后回调给界面刷新
        /// </summary>
        Action action;
        #endregion
        public FunctionControlZone(Function func)
        public FunctionControlZone(Function func,Action action)
        {
            bodyDiv = this;
            bodyDiv.Tag = func.sid;
            function = func;
            this.action = action;
        }
        public override void RemoveFromParent()
@@ -72,7 +78,11 @@
            }
            btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png";
            if(function.spk == SPK.GroupControl || function.spk == SPK.CommonSeries)
            {
                //btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/lightswitch.png";
                btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/groupControl.png";
            }
            if (SPK.CurtainSpkList().Contains(function.spk))
            {//窗帘没有开关按钮
                CurtainFragment();
@@ -188,8 +198,14 @@
            }
            else if (function.spk == SPK.VideoDoorLock)
            {
                btnIcon.UnSelectedImagePath = UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.GetVideoDoorLockIcon(Comerom.function);
                btnIcon.UnSelectedImagePath =UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.GetVideoDoorLockIcon(UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom.function);
            }
            else if (function.spk == SPK.AvZkAiks)
            {
                //隐藏开关按钮
                btnIcon.UnSelectedImagePath = "AksIcon/aks.png";
            }
            else if(function.spk == SPK.GroupControl) { }
            else if (function.spk == SPK.HvacCac)
            {
                var btnHumidityIcon = new Button()
@@ -260,7 +276,7 @@
                {
                    ClothesHangerFragment();
                }
                else if(function.spk == SPK.IpCam_Imou)
                else if(function.spk == SPK.IpCam_Imou || function.spk == SPK.ElectricEnergy || function.spk ==SPK.AirSwitch || function.spk == SPK.AirSwitchP3)
                {
                }
@@ -272,7 +288,7 @@
                    /// 开关按钮
                    /// </summary>
                    Button btnSwitch;
                    if (function.spk == SPK.LightRGB || function.spk == SPK.LightDimming)
                    if (function.spk == SPK.LightRGBW || function.spk == SPK.LightCCT || function.spk == SPK.LightRGB || function.spk == SPK.LightDimming)
                    {
                        btnSwitch = new Button()
                        {
@@ -435,6 +451,7 @@
            };
            if ( !SPK.ArmSensorSpkList().Contains(function.spk)
                && function.spk != SPK.DoorLock
                && function.spk != SPK.GroupControl
                && !SPK.EnvironDeviceSpkList().Contains( function.spk))//!DB_ResidenceData.Instance.CurrentRegion.isOtherShare &&
            {
                bodyDiv.AddChidren(btnCollectionIcon);
@@ -445,7 +462,7 @@
                bodyDiv.AddChidren(btnCollectionIcon);
            }
            if (!function.online)
            if (!function.isOnline())
            {
                bodyDiv.BackgroundColor = CSS_Color.PromptingColor2;
                btnOffline = new Button()
@@ -460,6 +477,19 @@
                };
                bodyDiv.AddChidren(btnOffline);
            }
            //排序
            //btnIcon.MouseLongEventHandler = (sender, e) => {
            //    OrderEvent();
            //};
            //btnName.MouseLongEventHandler = (sender, e) => {
            //    OrderEvent();
            //};
            //btnFromFloor.MouseLongEventHandler = (sender, e) => {
            //    OrderEvent();
            //};
            //bodyDiv.MouseLongEventHandler = (sender, e) => {
            //    OrderEvent();
            //};
        }
        /// <summary>
@@ -472,6 +502,7 @@
                case SPK.LightDimming:
                case SPK.LightRGBW:
                case SPK.LightRGB:
                case SPK.LightCCT:
                    #region Dimmer
                    var btnDimmerMinValues = new Button()
                    {
@@ -622,6 +653,11 @@
        }
        /// <summary>
        /// 排序事件
        /// </summary>
        public Action OrderEvent;
        /// <summary>
        /// 加载音乐功能控制卡片
        /// </summary>
        void MusicFragment()