From b562a582ac3a288193e6e4f57c5eff8a344305a4 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期五, 27 九月 2024 13:52:17 +0800
Subject: [PATCH] Update AndroidManifest.xml
---
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs | 100 +++++++++++++++++++++++++++++---------------------
1 files changed, 58 insertions(+), 42 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
index e6f5b27..07f386f 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
@@ -1,5 +1,6 @@
锘縰sing System;
using System.Collections.Generic;
+using System.Reflection;
using HDL_ON.DriverLayer;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
@@ -91,7 +92,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 +275,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)
@@ -351,8 +349,8 @@
/// </summary>
void LoadSensorDiv(Function sensor,int index)
{
- var levelColorList = sensorTemp.GetLevelColorList(sensor.spk);
- var levelTextList = sensorTemp.GetLevelTextList(sensor.spk);
+ var levelColorList = sensorTemp.GetLevelColorList(sensor);
+ var levelTextList = sensorTemp.GetLevelTextList(sensor);
{
var sensorTag = sensor.spk + sensor.sid + sensor.deviceId;
FrameLayout sensorView = new FrameLayout()
@@ -375,6 +373,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";
@@ -510,8 +512,8 @@
}
else
{
- btnLevel.TextID = levelTextList[sensorTemp.GetCurLevel(sensor) - 1];
- btnLevel.TextColor = sensorTemp.GetLevelColorList(sensor.spk)[sensorTemp.GetCurLevel(sensor) - 1];
+ btnLevel.Text = levelTextList[sensorTemp.GetCurLevel(sensor) - 1];
+ btnLevel.TextColor = sensorTemp.GetLevelColorList(sensor)[sensorTemp.GetCurLevel(sensor) - 1];
btnSensorValues.Text = sensor.GetAttrState(FunctionAttributeKey.Value);
}
}
@@ -523,34 +525,34 @@
void LoadInfo(Function sensor)
{
List<uint> levelColorList = new List<uint>();
- List<int> levelTextList = new List<int>();
- List<string> levelText = new List<string>();
+ List<string> levelTextList = new List<string>();
+ //List<string> levelText = new List<string>();
List<string> intervalList = new List<string>();
var configs = sensor.GetAttrKeyConfigs(sensor.SpkClassification);
- int i = 0;
- foreach(var info in configs)
+ //int i = 0;
+ //foreach(var info in configs)
+ //{
+ // foreach(var config in info.configs)
+ // {
+ // var color = Convert.ToUInt32(config.color,16);
+ // var text = config.desc;
+ // levelColorList.Add(color);
+ // //levelText.Add(text);
+ // levelTextList.Add(i++);
+ // intervalList.Add(config.start + " ~ " + config.end);
+ // }
+ //}
+ //if (levelColorList.Count == 0)
{
- foreach(var config in info.configs)
- {
- var color = Convert.ToUInt32(config.color,16);
- var text = config.desc;
- levelColorList.Add(color);
- levelText.Add(text);
- levelTextList.Add(i++);
- }
- }
- if (levelColorList.Count == 0)
- {
- levelColorList = sensorTemp.GetLevelColorList(sensor.spk);
- levelTextList = sensorTemp.GetLevelTextList(sensor.spk);
- intervalList = sensorTemp.GetIntervalValue(sensor.spk);
-
- foreach (var iii in levelTextList)
- {
- levelText.Add(Language.StringByID(iii));
- }
+ levelColorList = sensorTemp.GetLevelColorList(sensor);
+ levelTextList = sensorTemp.GetLevelTextList(sensor);
+ intervalList = sensorTemp.GetIntervalValue(sensor);
+ //foreach (var iii in levelTextList)
+ //{
+ // levelText.Add(Language.StringByID(iii));
+ //}
}
Dialog dialog = new Dialog();
@@ -589,11 +591,14 @@
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)";
break;
case SPK.SensorTVOC:
- btnTitle.Text = "TVOC(PPB)";
+ btnTitle.Text = "TVOC(mg/m鲁)";
break;
case SPK.SensorCO2:
btnTitle.Text = "CO2(PPM)";
@@ -646,7 +651,7 @@
});
try
{
- for (int index = 0; index < levelText.Count; index++)
+ for (int index = 0; index < levelTextList.Count; index++)
{
//if(sensorTemp.GetIntervalValue(sensor.spk).Count >= index)
//{
@@ -674,7 +679,7 @@
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = CSS_FontSize.TextFontSize,
IsBold = true,
- Text = sensorTemp.GetIntervalValue(sensor.spk)[index]
+ Text = intervalList[index]
});
subInfoView.AddChidren(new Button()
@@ -685,7 +690,7 @@
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = CSS_FontSize.TextFontSize,
IsBold = true,
- Text = levelText[index]
+ Text = levelTextList[index]
});
subInfoView.AddChidren(new Button()
@@ -903,6 +908,7 @@
}
}
+ Console.WriteLine(updateTemp.spk);
for (int i = 0; i < bodyView.sensorListView.ChildrenCount; i++)
{
var sensorTag = updateTemp.spk + updateTemp.sid + updateTemp.deviceId;
@@ -921,12 +927,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 +952,10 @@
case SPK.SensorHumidity:
attr = updateTemp.GetAttribute(FunctionAttributeKey.Humidity);
break;
+ case SPK.SensorLight:
+ attr = updateTemp.GetAttribute(FunctionAttributeKey.Illuminance);
+ break;
+
}
}
@@ -953,16 +966,19 @@
}
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).Text = bodyView.sensorTemp.GetLevelTextList(updateTemp)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1];
+ (btn as Button).TextColor = bodyView.sensorTemp.GetLevelColorList(updateTemp)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1];
+ }
}
}
}
else if (btn.GetType() == typeof(ArcSeekBar))
{
- (btn as ArcSeekBar).ProgressBarColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1];
+ (btn as ArcSeekBar).ProgressBarColor = bodyView.sensorTemp.GetLevelColorList(updateTemp)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1];
- (btn as ArcSeekBar).Progress = (96 / bodyView.sensorTemp.GetLevelColorList(updateTemp.spk).Count) * bodyView.sensorTemp.GetCurLevel(updateTemp);
+ (btn as ArcSeekBar).Progress = (96 / bodyView.sensorTemp.GetLevelColorList(updateTemp).Count) * bodyView.sensorTemp.GetCurLevel(updateTemp);
}
}
}
--
Gitblit v1.8.0