wxr
2024-01-08 22288c2816f39348316a961806dc41bbe0ab6822
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
@@ -91,7 +91,7 @@
                TextAlignment = TextAlignment.CenterLeft,
                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                TextColor = CSS_Color.FirstLevelTitleColor,
                Text = MainPage.cityInfo.location,
                Text = MainPage.cityInfo.city,
            };
            topWeatherView.AddChidren(btnLocationText);
@@ -274,10 +274,7 @@
            int index = 0;
            foreach (var sensor in FunctionList.List.GetEnvirSensorsList())
            {
                if (sensor.spk == SPK.SensorPm10)
                {
                    continue;
                }
                if(SPK.EvironmentSensorList().Contains(sensor.spk) )
                {
                    foreach (var seTemp in sensor.attributes)
@@ -375,6 +372,10 @@
                    case SPK.SensorPm25:
                        imagePath = "FunctionIcon/EnvirSensor/Pm25Bg.png";
                        iconPath = "FunctionIcon/EnvirSensor/Pm25Icon.png";
                        break;
                    case SPK.SensorPm10:
                        imagePath = "FunctionIcon/EnvirSensor/Pm25Bg.png";
                        iconPath = "FunctionIcon/EnvirSensor/Pm10Icon.png";
                        break;
                    case SPK.SensorTVOC:
                        imagePath = "FunctionIcon/EnvirSensor/TvocBg.png";
@@ -588,6 +589,9 @@
            {
                case SPK.SensorPm25:
                    btnTitle.Text = "PM2.5(ug/m³)";//²
                    break;
                case SPK.SensorPm10:
                    btnTitle.Text = "PM10(ug/m³)";//²
                    break;
                case SPK.SensorTemperature:
                    btnTitle.Text = Language.StringByID(StringId.Temp) + "(°C)";
@@ -903,6 +907,7 @@
                            }
                        }
                        Console.WriteLine(updateTemp.spk);
                        for (int i = 0; i < bodyView.sensorListView.ChildrenCount; i++)
                        {
                            var sensorTag = updateTemp.spk + updateTemp.sid + updateTemp.deviceId;
@@ -921,12 +926,15 @@
                                        if (btn.Tag != null)
                                        {
                                            FunctionAttributes attr = updateTemp.GetAttribute(FunctionAttributeKey.Value);
                                            if(attr == null)
                                            if (attr == null)
                                            {
                                                switch(updateTemp.spk)
                                                switch (updateTemp.spk)
                                                {
                                                    case SPK.SensorCO2:
                                                        attr = updateTemp.GetAttribute(FunctionAttributeKey.Co2);
                                                        break;
                                                    case SPK.SensorPm10:
                                                        attr = updateTemp.GetAttribute(FunctionAttributeKey.Pm10);
                                                        break;
                                                    case SPK.SensorTemperature:
                                                        attr = updateTemp.GetAttribute(FunctionAttributeKey.Temperature);
@@ -943,6 +951,10 @@
                                                    case SPK.SensorHumidity:
                                                        attr = updateTemp.GetAttribute(FunctionAttributeKey.Humidity);
                                                        break;
                                                    case SPK.SensorLight:
                                                        attr = updateTemp.GetAttribute(FunctionAttributeKey.Illuminance);
                                                        break;
                                                }
                                            }
@@ -953,8 +965,11 @@
                                            }
                                            else if (tag == "SensorLevel")
                                            {
                                                (btn as Button).TextID = bodyView.sensorTemp.GetLevelTextList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1];
                                                (btn as Button).TextColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1];
                                                if (updateTemp.spk != SPK.SensorLight)
                                                {
                                                    (btn as Button).TextID = bodyView.sensorTemp.GetLevelTextList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1];
                                                    (btn as Button).TextColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1];
                                                }
                                            }
                                        }
                                    }