wxr
2023-10-17 46a177eb1acf7ce91af7fe9ff57af87228de938d
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
@@ -392,6 +392,10 @@
                        imagePath = "FunctionIcon/EnvirSensor/HchoBg.png";
                        iconPath = "FunctionIcon/EnvirSensor/HchoIcon.png";
                        break;
                    case SPK.SensorLight:
                        imagePath = "FunctionIcon/EnvirSensor/IlluminationBg.png";
                        iconPath = "FunctionIcon/EnvirSensor/IlluminationIcon.png";
                        break;
                }
                sensorView.BackgroundImagePath = imagePath;
@@ -413,6 +417,10 @@
                btnIcon.MouseUpEventHandler = (sender, e) =>
                {
                    if (!IsSupportClick(sensor))
                    {
                        return;
                    }
                    #region 
                    var esp = new EnvironmentalSensorPage(sensor);
                    MainPage.BasePageView.AddChidren(esp);
@@ -432,6 +440,10 @@
                sensorView.AddChidren(btnInfoIcon);
                btnInfoIcon.MouseUpEventHandler = (sender, e) =>
                {
                    if (!IsSupportClick(sensor))
                    {
                        return;
                    }
                    LoadInfo(sensor);
                };
@@ -442,15 +454,17 @@
                    Width = Application.GetRealWidth(100),
                    Height = Application.GetRealWidth(32),
                    TextAlignment = TextAlignment.CenterLeft,
                    TextColor = sensorTemp.GetLevelColorList(sensor.spk)[sensorTemp.GetCurLevel(sensor) - 1],
                    TextSize = CSS_FontSize.SubheadingFontSize,
                    TextID = levelTextList[sensorTemp.GetCurLevel(sensor) - 1],
                    Tag = "SensorLevel",
                };
                sensorView.AddChidren(btnLevel);
                btnLevel.MouseUpEventHandler = (sender, e) =>
                {
                    if (!IsSupportClick(sensor))
                    {
                        return;
                    }
                    #region 
                    var esp = new EnvironmentalSensorPage(sensor);
                    MainPage.BasePageView.AddChidren(esp);
@@ -476,6 +490,11 @@
                sensorView.AddChidren(btnSensorValues);
                btnSensorValues.MouseUpEventHandler = (sender, e) =>
                {
                    if (!IsSupportClick(sensor))
                    {
                        return;
                    }
                    #region 
                    var esp = new EnvironmentalSensorPage(sensor);
                    MainPage.BasePageView.AddChidren(esp);
@@ -483,7 +502,18 @@
                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    #endregion
                };
                if (!IsSupportClick(sensor))
                {
                    btnLevel.TextID = StringId.guangzhao;
                    btnLevel.TextColor = 0xFF1B2D4D;
                    btnSensorValues.Text = sensor.GetAttrState("illuminance");
                }
                else
                {
                    btnLevel.TextID = levelTextList[sensorTemp.GetCurLevel(sensor) - 1];
                    btnLevel.TextColor = sensorTemp.GetLevelColorList(sensor.spk)[sensorTemp.GetCurLevel(sensor) - 1];
                    btnSensorValues.Text = sensor.GetAttrState(FunctionAttributeKey.Value);
                }
            }
        }
@@ -805,8 +835,24 @@
        }
        /// <summary>
        /// 是否支持事件
        /// </summary>
        /// <param name="device"></param>
        /// <returns></returns>
        bool IsSupportClick(Function device)
        {
            if (device == null)
            {
                return false;
            }
            if (device.spk == SPK.SensorLight)
            {
                //先过滤掉光照传感器
                return false;
            }
            return true;
        }
        #region event