wxr
2020-06-15 b8e94316e41eba72d927d5ca7d931b26139ee8ff
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePage.cs
@@ -19,8 +19,29 @@
        /// 房间选择下拉图标
        /// </summary>
        Button btnFoorDownIcon;
        /// <summary>
        /// 天气名称文本
        /// </summary>
        Button btnWatherText;
        /// <summary>
        /// 湿度数据文本
        /// </summary>
        Button btnHumidityText;
        /// <summary>
        /// pm25数据文本
        /// </summary>
        Button btnPm25Values;
        /// <summary>
        /// 风速数据文本
        /// </summary>
        Button btnFanSpeedValues;
        #endregion
        #region 区域变量
        List<System.Threading.Thread> threads = new List<System.Threading.Thread>();
        uint level1Color = 0xFF2172FF;
        uint level2Color = 0xCC4484F4;
        uint level3Color = 0x664484F4;
@@ -37,6 +58,16 @@
        public EnvironmentalSciencePage()
        {
            bodyView = this;
        }
        public override void RemoveFromParent()
        {
            foreach(var thread in threads)
            {
                thread.Abort();
            }
            threads.Clear();
            base.RemoveFromParent();
        }
        /// <summary>
@@ -70,8 +101,7 @@
                IsBold = true,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = CSS_Color.MainBackgroundColor,
                Text = "28",
                Text = MainPage.cityInfo.temperature,
            };
            topWeatherView.AddChidren(btnTemp);
@@ -96,8 +126,9 @@
                UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/SmogIcon.png",
            };
            topWeatherView.AddChidren(btnWeatherIcon);
            LoadEvent_ChangeWeatherIcon(btnWeatherIcon);
            var btnWatherText = new Button()
            btnWatherText = new Button()
            {
                X = Application.GetRealWidth(139),
                Y = Application.GetRealHeight(16),
@@ -106,10 +137,9 @@
                TextColor = CSS_Color.MainBackgroundColor,
                TextSize = CSS_FontSize.TextFontSize,
                TextAlignment = TextAlignment.CenterLeft,
                Text = "雾霾"
                Text = MainPage.cityInfo.weather
            };
            topWeatherView.AddChidren(btnWatherText);
            var btnTempUpperLimit = new Button()
            {
@@ -159,8 +189,6 @@
            };
            topWeatherView.AddChidren(btnTempLowerLimitText);
            var btnLocationText = new Button()
            {
                X = Application.GetRealWidth(233),
@@ -170,7 +198,7 @@
                TextAlignment = TextAlignment.CenterRight,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextColor = CSS_Color.MainBackgroundColor,
                Text = "广州",
                Text = MainPage.cityInfo.location,
            };
            topWeatherView.AddChidren(btnLocationText);
@@ -194,7 +222,7 @@
            };
            topWeatherView.AddChidren(btnHumidityIcon);
            Button btnHumidityText = new Button()
            btnHumidityText = new Button()
            {
                X = Application.GetRealWidth(15),
                Y = btnHumidityIcon.Bottom,
@@ -203,7 +231,7 @@
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.MainBackgroundColor,
                Text = "--%",
                Text = MainPage.cityInfo.humidity + "%",
            };
            topWeatherView.AddChidren(btnHumidityText);
@@ -217,7 +245,7 @@
            };
            topWeatherView.AddChidren(btnPm25Icon);
            Button btnPm25Values = new Button()
            btnPm25Values = new Button()
            {
                X = Application.GetRealWidth(90),
                Y = btnHumidityIcon.Bottom,
@@ -226,7 +254,7 @@
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.MainBackgroundColor,
                Text = "--",
                Text = MainPage.cityInfo.pm25,
            };
            topWeatherView.AddChidren(btnPm25Values);
@@ -240,7 +268,7 @@
            };
            topWeatherView.AddChidren(btnFanSpeedIcon);
            Button btnFanSpeedValues = new Button()
            btnFanSpeedValues = new Button()
            {
                X = Application.GetRealWidth(162),
                Y = btnFanSpeedIcon.Bottom,
@@ -249,7 +277,7 @@
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.MainBackgroundColor,
                Text = "--",
                Text = MainPage.cityInfo.windLevel,
            };
            topWeatherView.AddChidren(btnFanSpeedValues);
            #endregion
@@ -310,7 +338,6 @@
            };
            contentView.AddChidren(sensorListView);
            int index = 0;
            foreach(var sensor in  DB_ResidenceData.residenceData.functionList.sensorsEnvironmentalScience)
            {
@@ -330,7 +357,7 @@
                        BackgroundColor = CSS_Color.MainBackgroundColor,
                        Y = Application.GetRealWidth(92 * (index / 2))
                    };
                    if(index%2!=0)
                    if (index % 2 != 0)
                    {
                        sensorView.X = Application.GetRealWidth(160);
                    }
@@ -343,7 +370,7 @@
                        Gravity = Gravity.CenterVertical,
                        Width = Application.GetRealWidth(48),
                        Height = Application.GetRealWidth(48),
                        Angle = 1,
                        OpenAngle = 1,
                        ThumbColor = 0x00000000,
                        ThumbModeFill = true,
                        ProgressBarColor = sensor.levelColorList[sensor.curLevel - 1],