From 0891d90cd0d435338cc2851fd0830cd318a17fff Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 23 十二月 2020 14:25:55 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/WJC' into NewFilePath
---
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs | 222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 222 insertions(+), 0 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs
index 77f686c..c9b08eb 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSciencePageBLL.cs
@@ -1,4 +1,6 @@
锘縰sing System;
+using HDL_ON.Entity;
+using Shared;
namespace HDL_ON.UI
{
public partial class EnvironmentalSciencePage
@@ -8,5 +10,225 @@
{
}
+
+ public static void LoadEvent_UpdataStatus(Sensor sensor)
+ {
+ Application.RunOnMainThread(() =>{
+ if (bodyView != null)
+ {
+ for (int i = 0; i < bodyView.sensorListView.ChildrenCount; i++)
+ {
+ var sensorTag = sensor.sid;
+ var view = bodyView.sensorListView.GetChildren(i);
+ if (view.GetType() == typeof(FrameLayout))
+ {
+ if(view.Tag.ToString() != sensorTag)
+ {
+ continue;
+ }
+ for (int j = 0; j < (view as FrameLayout).ChildrenCount; j++)
+ {
+ var btn = (view as FrameLayout).GetChildren(j);
+ if (btn.GetType() == typeof(Button))
+ {
+ if (btn.Tag!=null)
+ {
+ var tag = btn.Tag.ToString();
+ if (tag == "SensorValues")
+ {
+ (btn as Button).Text = sensor.values.ToString();
+ }
+ else if (tag == "SensorLevel")
+ {
+ (btn as Button).TextID = sensor.levelTextList[sensor.curLevel - 1];
+ (btn as Button).TextColor = sensor.levelColorList[sensor.curLevel - 1];
+ }
+ }
+ }
+ else if (btn.GetType() == typeof(ArcSeekBar))
+ {
+ (btn as ArcSeekBar).ProgressBarColor = sensor.levelColorList[sensor.curLevel - 1];
+
+ (btn as ArcSeekBar).Progress = (96 / sensor.levelColorList.Count) * sensor.curLevel;
+ }
+ }
+ }
+ }
+ }
+ });
+ }
+
+ void LoadEvent_ChangeWeatherIcon(Button btnWeatherIcon)
+ {
+
+ switch (MainPage.cityInfo.weather)
+ {
+ case "鏅�":
+ case "Sunny":
+ case "鏅村ぉ":
+ case "澶╂櫞":
+ case "Clear":
+ case "澶ч儴鏅存湕":
+ case "Mostly Sunny":
+ case "鏅存檪澶氶洸":
+ case "闄藉厜鍏呮矝":
+ case "Mostly Clear":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/0.png";
+ break;
+ case "澶氫簯":
+ case "Cloudy":
+ case "澶氶洸":
+ case "灏戜簯":
+ case "Partly Cloudy":
+ case "灏戦洸":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/1.png";
+ break;
+ case "闃�":
+ case "Overcast":
+ case "闄板ぉ":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/2.png";
+ break;
+ case "闃甸洦":
+ case "Showers":
+ case "闄i洦":
+ case "椹熼洦":
+ case "灞�閮ㄩ樀闆�":
+ case "Scattered Showers":
+ case "灞�鍦伴櫍闆�":
+ case "灞�閮ㄥ湴鍗�鎬ч闆�":
+ case "灏忛樀闆�":
+ case "Light Showers":
+ case "灏忛櫍闆�":
+ case "闆舵暎椹熼洦":
+ case "寮洪樀闆�":
+ case "Heavy Showers":
+ case "寮烽櫍闆�":
+ case "闁撲腑鏈夐闆�":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png";
+ break;
+ case "闃甸洩":
+ case "Snow Showers":
+ case "闄i洩":
+ case "椹熼洩":
+ case "灏忛樀闆�":
+ case "Light Snow Showers":
+ case "灏忛櫍闆�":
+ case "闆舵暎椹熼洩":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png";
+ break;
+ case "闆�":
+ case "Fog":
+ case "闇�":
+ case "钖勯湩":
+ case "鍐婚浘":
+ case "Freezing Fog":
+ case "鍑嶉湩":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/18.png";
+ break;
+ case "娌欏皹鏆�":
+ case "Sandstorm":
+ case "娌欏〉鏆�":
+ case "寮烘矙灏樻毚":
+ case "Heavy Sandstorm":
+ case "寮锋矙濉垫毚":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/20.png";
+ break;
+ case "娴皹":
+ case "Dust":
+ case "娴〉":
+ case "灏樺嵎椋�":
+ case "Dust Storm":
+ case "濉垫嵅棰�":
+ case "鎵矙":
+ case "Sand":
+ case "鎻氭矙":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/29.png";
+ break;
+ case "闇�":
+ case "Haze":
+ case "鐓欓湠":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/45.png";
+ break;
+ case "闆烽樀闆�":
+ case "Thundershower":
+ case "闆烽櫍闆�":
+ case "闆烽洦":
+ case "闆风數":
+ case "Lightning":
+ case "闆烽浕":
+ case "闆锋毚":
+ case "Thunderstorm":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/4.png";
+ break;
+ case "闆烽樀闆ㄤ即鏈夊啺闆�":
+ case "Thundershower with Hail":
+ case "闆烽櫍闆ㄤ即鏈夊啺闆�":
+ case "闆烽洦浼存湁鍐伴浌":
+ case "鍐伴浌":
+ case "Hail":
+ case "鍐伴拡":
+ case "Needle Ice":
+ case "鍐伴嚌":
+ case "鍐扮矑":
+ case "Icy":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/5.png";
+ break;
+ case "闆ㄥす闆�":
+ case "Sleet":
+ case "闆ㄥぞ闆�":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/6.png";
+ break;
+ case "灏忛洦":
+ case "Light Rain":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png";
+ break;
+ case "涓洦":
+ case "Rain":
+ case "灏忓埌涓洦":
+ case "闆�":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png";
+ break;
+ case "澶ч洦":
+ case "Heavy Rain":
+ case "涓埌澶ч洦":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png";
+ break;
+ case "鏆撮洦":
+ case "Rainstorm":
+ case "璞洦":
+ case "澶ф毚闆�":
+ case "Heavy Rainstorm":
+ case "澶ц豹闆�":
+ case "鐗瑰ぇ鏆撮洦":
+ case "Extreme Rainstorm":
+ case "瓒呭ぇ璞洦":
+ case "澶у埌鏆撮洦":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png";
+ break;
+ case "灏忛洩":
+ case "Light Snow":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png";
+ break;
+ case "闆�":
+ case "涓洩":
+ case "灏忓埌涓洩":
+ case "Snow":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png";
+ break;
+ case "澶ч洩":
+ case "Heavy Snow":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png";
+ break;
+ case "鏆撮洩":
+ case "Blizzard":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png";
+ break;
+ case "鍐婚洦":
+ case "Freezing Rain":
+ case "鍑嶉洦":
+ btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/6.png";
+ break;
+ }
+ }
}
}
--
Gitblit v1.8.0