From 3c44ecc78187fc6ca2e3ec72a294e4740fded7ef Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期二, 23 三月 2021 15:34:52 +0800
Subject: [PATCH] 上传个东西
---
HDL_ON/UI/UI0-Stan/Form/Base/CommonFormBase.cs | 18 +
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs | 665 +++++++++++++++++++++++++++++++++++++++++++++++
HDL-ON_Android/Assets/Language.ini | 28 +
HDL_ON/UI/UI0-Stan/Form/Base/EditorCommonForm.cs | 36 ++
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/TempAndHumiBack.png | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan2.png | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/ComfortableSelect.png | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan3Select.png | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan2Select.png | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/VentilateSelect.png | 0
HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs | 11
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Comfortable.png | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/HumidificationSelect.png | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan1Select.png | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan3.png | 0
HDL_ON/UI/UI0-Stan/Controls/FrameLayoutControls/FrameRowControl.cs | 5
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Energy.png | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Humidification.png | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/Electrical/Fan/DialogTitleMenuGroud2.png | 0
HDL_ON/Common/R.cs | 42 ++
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan1.png | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Ventilate.png | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/EnergySelect.png | 0
23 files changed, 794 insertions(+), 11 deletions(-)
diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index d1df129..cd38ac2 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -423,11 +423,11 @@
437=Device List
438=humidity:{0}% air:{1} wind:{2}
-1000=Indoor Humidity
+1000=Room Humidity
1001=V-chip
1002=Anion
1003=Sterilization
-1004=Humidification
+1004=Humidify
1005=Filter Element Reset
1006=Lighting
1007=Automatic
@@ -499,7 +499,18 @@
1073=Please turn on Bluetooth
1074=Location information(GBS) unavailable
1075=Network unavailable
-1076=Select infrared remote control
+1076=Select infrared remote control
+1077=Air Fresh
+1078=Residual filter screen
+1079=Energy
+1080=Ventilated
+;鍒湅涓嬮潰閮戒竴鏍�,閮芥槸UI鐗规畩瑕佹眰鏁寸殑,鍐嶅姞涓婅�冭檻鑻辨枃闀垮害
+1081=1st Gear
+1082=2nd Gear
+1083=3rd Gear
+1084=1st Gear
+1085=2nd Gear
+1086=3rd Gear
5000=Music
5001=Group
@@ -1264,6 +1275,17 @@
1074=浣嶇疆淇℃伅(GBS)涓嶅彲鐢�
1075=缃戠粶涓嶅彲鐢�
1076=閫夋嫨绾㈠閬ユ帶鍣�
+1077=鏂伴
+1078=褰撳墠婊ょ綉鍓╀綑
+1079=鑺傝兘
+1080=閫氶
+1081=1妗�
+1082=2妗�
+1083=3妗�
+1084=椋庨��1妗�
+1085=椋庨��2妗�
+1086=椋庨��3妗�
+
5000=闊充箰
5001=缁勫悎
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Comfortable.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Comfortable.png
new file mode 100644
index 0000000..6c6a80c
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Comfortable.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/ComfortableSelect.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/ComfortableSelect.png
new file mode 100644
index 0000000..e154c5e
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/ComfortableSelect.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Energy.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Energy.png
new file mode 100644
index 0000000..181f206
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Energy.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/EnergySelect.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/EnergySelect.png
new file mode 100644
index 0000000..69ed7d0
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/EnergySelect.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan1.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan1.png
new file mode 100644
index 0000000..6509e14
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan1.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan1Select.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan1Select.png
new file mode 100644
index 0000000..92931d6
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan1Select.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan2.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan2.png
new file mode 100644
index 0000000..84b91c9
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan2.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan2Select.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan2Select.png
new file mode 100644
index 0000000..aa86194
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan2Select.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan3.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan3.png
new file mode 100644
index 0000000..05a3e27
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan3.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan3Select.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan3Select.png
new file mode 100644
index 0000000..5cf8062
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan3Select.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Humidification.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Humidification.png
new file mode 100644
index 0000000..193072a
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Humidification.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/HumidificationSelect.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/HumidificationSelect.png
new file mode 100644
index 0000000..b027922
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/HumidificationSelect.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/TempAndHumiBack.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/TempAndHumiBack.png
new file mode 100644
index 0000000..b50509a
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/TempAndHumiBack.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Ventilate.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Ventilate.png
new file mode 100644
index 0000000..22d7028
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Ventilate.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/VentilateSelect.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/VentilateSelect.png
new file mode 100644
index 0000000..6760350
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/VentilateSelect.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Electrical/Fan/DialogTitleMenuGroud2.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Electrical/Fan/DialogTitleMenuGroud2.png
new file mode 100644
index 0000000..efb85b7
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Electrical/Fan/DialogTitleMenuGroud2.png
Binary files differ
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index 7ae6f60..668179d 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -738,7 +738,47 @@
/// <summary>
/// 閫夋嫨绾㈠閬ユ帶鍣�
/// </summary>
- public const int ChooseInfraredRemoteControl = 1076;
+ public const int ChooseInfraredRemoteControl = 1076;
+ /// <summary>
+ /// 鏂伴
+ /// </summary>
+ public const int AirFresh = 1077;
+ /// <summary>
+ /// 褰撳墠婊ょ綉鍓╀綑
+ /// </summary>
+ public const int ResidualFilterScreen = 1078;
+ /// <summary>
+ /// 鑺傝兘
+ /// </summary>
+ public const int Energy = 1079;
+ /// <summary>
+ /// 閫氶
+ /// </summary>
+ public const int Ventilated = 1080;
+ /// <summary>
+ /// 1妗�
+ /// </summary>
+ public const int OneGear = 1081;
+ /// <summary>
+ /// 2妗�
+ /// </summary>
+ public const int TwoGear = 1082;
+ /// <summary>
+ /// 3妗�
+ /// </summary>
+ public const int ThreeGear = 1083;
+ /// <summary>
+ /// 椋庨��1妗�
+ /// </summary>
+ public const int FanOneGear = 1084;
+ /// <summary>
+ /// 椋庨��2妗�
+ /// </summary>
+ public const int FanTwoGear = 1085;
+ /// <summary>
+ /// 椋庨��3妗�
+ /// </summary>
+ public const int FanThreeGear = 1086;
diff --git a/HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs b/HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs
index 60c8d0a..fe412fb 100644
--- a/HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs
+++ b/HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs
@@ -360,13 +360,18 @@
/// <summary>
/// 鏍规嵁鏂囨湰,璁$畻瀹冮渶瑕佺殑鎬昏鏁�
/// </summary>
+ /// <param name="i_width">褰撳�间负-1鏃�,闇�瑕佺埗鎺т欢,鐪熷疄鍊�</param>
/// <returns></returns>
- public int GetRealRowCountByText()
+ public int GetRealRowCountByText(int i_width = -1)
{
+ if (i_width == -1)
+ {
+ i_width = this.Width;
+ }
//鍏堣幏鍙栧畠鐨勭湡瀹炲搴�
int realWidth = this.GetRealWidthByText();
- int row = realWidth / this.Width;
- if (realWidth % this.Width > 0)
+ int row = realWidth / i_width;
+ if (realWidth % i_width > 0)
{
row++;
}
diff --git a/HDL_ON/UI/UI0-Stan/Controls/FrameLayoutControls/FrameRowControl.cs b/HDL_ON/UI/UI0-Stan/Controls/FrameLayoutControls/FrameRowControl.cs
index d88f1c0..ad91a5a 100644
--- a/HDL_ON/UI/UI0-Stan/Controls/FrameLayoutControls/FrameRowControl.cs
+++ b/HDL_ON/UI/UI0-Stan/Controls/FrameLayoutControls/FrameRowControl.cs
@@ -126,7 +126,8 @@
}
var btnCaption = new NormalViewControl(i_width, i_height, real);
btnCaption.X = XX;
-
+ //2021.03.18 鏁磋嫳鏂囩増,鍔犱笂鑷姩鎹㈣
+ btnCaption.IsMoreLines = true;
btnCaption.Text = i_caption;
return btnCaption;
@@ -329,6 +330,8 @@
btnContr.TextColor = CSS_Color.PromptingColor1;
btnContr.Text = i_text;
btnContr.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
+ //2021.03.18 鏁磋嫳鏂囩増,鍔犱笂鑷姩鎹㈣
+ btnContr.IsMoreLines = true;
return btnContr;
}
diff --git a/HDL_ON/UI/UI0-Stan/Form/Base/CommonFormBase.cs b/HDL_ON/UI/UI0-Stan/Form/Base/CommonFormBase.cs
index 814f7d7..6e906ef 100644
--- a/HDL_ON/UI/UI0-Stan/Form/Base/CommonFormBase.cs
+++ b/HDL_ON/UI/UI0-Stan/Form/Base/CommonFormBase.cs
@@ -215,6 +215,24 @@
return Application.GetRealWidth(i_size);
}
+ /// <summary>
+ /// 鑾峰彇鍥剧墖閲岄潰,瀛愭帶浠舵枃鏈殑楂樺害
+ /// </summary>
+ /// <param name="i_height">楂樺害</param>
+ /// <returns></returns>
+ public int GetPicChidrenTextHeight(int i_height)
+ {
+ int value1 = Application.GetRealHeight(i_height);
+ int value2 = Application.GetRealWidth(i_height);
+ //褰撳搴︽瘮鐜囧ぇ浜庨珮搴︽椂锛岀敤瀹藉害
+ if (value2 > value1)
+ {
+ return value2;
+ }
+ //鍚﹀垯,鑰冭檻鍒版樉绀哄畬鍏ㄧ殑闂,闇�瑕佷娇鐢ㄩ珮搴︽瘮鐜�
+ return value1;
+ }
+
#endregion
#region 鈻� 鍙嶅皠鏂规硶___________________________
diff --git a/HDL_ON/UI/UI0-Stan/Form/Base/EditorCommonForm.cs b/HDL_ON/UI/UI0-Stan/Form/Base/EditorCommonForm.cs
index 31bdbe3..a592744 100644
--- a/HDL_ON/UI/UI0-Stan/Form/Base/EditorCommonForm.cs
+++ b/HDL_ON/UI/UI0-Stan/Form/Base/EditorCommonForm.cs
@@ -290,7 +290,7 @@
#region 鈻� 娣诲姞鍒楄〃娑堟伅鏄剧ず鎺т欢_______________
/// <summary>
- /// 娣诲姞鍒楄〃娑堟伅鏄剧ず鎺т欢,杩斿洖鐨勬槸鏈�鍚庝竴涓帶浠剁殑搴曢儴鍧愭爣
+ /// 娣诲姞鍒楄〃娑堟伅鏄剧ず鎺т欢,杩斿洖鐨勬槸鏈�鍚庝竴涓帶浠剁殑搴曢儴鍧愭爣(娌$湅鎳傝繖涓嚱鏁板墠,璇峰嬁浣跨敤)
/// </summary>
/// <param name="frameTable">妗屽竷瀹瑰櫒鎺т欢</param>
/// <param name="i_msg">鏄剧ず鐨勬秷鎭�(鎹㈣璇蜂娇鐢ㄣ�恵0}銆戣繘琛屽垎鍓�)</param>
@@ -303,12 +303,37 @@
/// <para>娉細闄や簡鏂板缓杩欎釜鍑芥暟鐨勫紑鍙戣�呬互澶栵紝閮戒笉寤鸿鎶婅繖涓�间笉璁剧疆涓簍rue</para>
/// <para>璇存槑锛氫互鏈�闀跨殑鎺т欢鐨刋杞翠负鍩哄噯,鎵�鏈夋帶浠剁殑X杞撮兘鍙樻垚涓�鑷�</para>
/// </param>
+ /// <param name="i_width">鏂囨湰瀹藉害,鐪熷疄鍊�,褰撲负-1鏃�,鍐呴儴鑷姩璁$畻</param>
/// <returns></returns>
public int AddListMsgControls(FrameLayout frameTable, string i_msg, int i_fontSize, uint i_fontColor, int i_height,
- int i_yy, TextAlignment alignment = TextAlignment.Center, bool special = false)
+ int i_yy, TextAlignment alignment = TextAlignment.Center, bool special = false, int i_width = -1)
{
var listMsg = i_msg.Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
- int defultWidth = this.bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2;
+ int defultWidth = 0;
+ if (this.bodyFrameLayout != null)
+ {
+ defultWidth = i_width == -1 ? this.bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2 : i_width;
+ }
+ else
+ {
+ defultWidth = i_width == -1 ? frameTable.Width - HdlControlResourse.XXLeft * 2 : i_width;
+ }
+
+ //濡傛灉鍙槸涓�琛岀殑鏃跺��
+ bool isMoreLine = false;
+ if (listMsg.Length == 1)
+ {
+ var btnTemp = new ButtonCtrBase();
+ btnTemp.TextSize = i_fontSize;
+ btnTemp.Text = i_msg;
+ int rowCount = btnTemp.GetRealRowCountByText(defultWidth);
+ //瀹冪殑楂樺害鐢辫鏁板喅瀹�(鐞嗚涓婂簲璇ラ兘鏄�1琛�,杩欓噷鍋氱壒娈婂鐞嗚�屽凡)
+ if (rowCount > 1)
+ {
+ i_height = i_height * rowCount;
+ isMoreLine = true;
+ }
+ }
var listContr = new List<NormalViewControl>();
int minXX = 10086;//鎺т欢闆嗗悎鏈�灏忕殑X杞�
@@ -322,6 +347,11 @@
btnMsg.TextColor = i_fontColor;
btnMsg.TextSize = i_fontSize;
btnMsg.Text = strMsg;
+ if (isMoreLine == true)
+ {
+ //鍙互鎹㈣
+ btnMsg.IsMoreLines = isMoreLine;
+ }
//鐗规畩澶勭悊
if (special == true && alignment == TextAlignment.Center)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs
new file mode 100644
index 0000000..9a6c5c9
--- /dev/null
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs
@@ -0,0 +1,665 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using HDL_ON.DriverLayer;
+using HDL_ON.Entity;
+using HDL_ON.Stan;
+using HDL_ON.UI.CSS;
+using Shared;
+
+namespace HDL_ON.UI
+{
+ /// <summary>
+ /// 閲戣寕鏂伴璁惧鐨勬帶鍒剁晫闈�
+ /// </summary>
+ public class AirFreshControlPage : DeviceFunctionCardCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 瀹ゅ唴婀垮害鎺т欢
+ /// </summary>
+ private NormalViewControl btnHumidity = null;
+ /// <summary>
+ /// %鎺т欢
+ /// </summary>
+ private NormalViewControl btnHumidityUnit = null;
+ /// <summary>
+ /// 瀹ゅ唴娓╁害鎺т欢
+ /// </summary>
+ private NormalViewControl btnTemperature = null;
+ /// <summary>
+ /// 鈩冩帶浠�
+ /// </summary>
+ private NormalViewControl btnTemperatureUnit = null;
+ /// <summary>
+ /// 褰撳墠婊ょ綉鍓╀綑鎺т欢
+ /// </summary>
+ private NormalViewControl btnFilterScreen = null;
+ /// <summary>
+ /// 鑺傝兘/鑸掗�傚浘鏍囨帶浠�
+ /// </summary>
+ private IconViewControl btnMode1 = null;
+ /// <summary>
+ /// 鑺傝兘/鑸掗�傛枃鏈帶浠�
+ /// </summary>
+ private NormalViewControl btnMode1View = null;
+ /// <summary>
+ /// 閫氶/鍔犳箍鍥炬爣鎺т欢
+ /// </summary>
+ private IconViewControl btnMode2 = null;
+ /// <summary>
+ /// 閫氶/鍔犳箍鏂囨湰鎺т欢
+ /// </summary>
+ private NormalViewControl btnMode2View = null;
+ /// <summary>
+ /// 椋庨�熷浘鏍囨帶浠�
+ /// </summary>
+ private IconViewControl btnFan = null;
+ /// <summary>
+ /// 椋庨�熸枃鏈帶浠�
+ /// </summary>
+ private NormalViewControl btnFanView = null;
+ /// <summary>
+ /// 寮�鍏冲浘鏍�
+ /// </summary>
+ private IconViewControl btnSwitch = null;
+ /// <summary>
+ /// 鏂伴鏁版嵁
+ /// </summary>
+ private AirFreshData airFreshData = new AirFreshData();
+ /// <summary>
+ /// 鍚勭鏂囨湰
+ /// </summary>
+ private Dictionary<string, string> dicText = new Dictionary<string, string>();
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒濆鍖栫櫧鑹插尯鍩熺殑鍐呭
+ /// </summary>
+ public override void InitFrameWhiteContent()
+ {
+ base.SetTitleText(Language.StringByID(StringId.AirFresh));
+ //杩欎釜涓滆タ鍔犱釜绌烘牸
+ this.dicText["婊ょ綉鍓╀綑"] = Language.StringByID(StringId.ResidualFilterScreen) + " ";
+ this.dicText["鑺傝兘"] = Language.StringByID(StringId.Energy);
+ this.dicText["鑸掗��"] = Language.StringByID(StringId.Comfortable);
+ this.dicText["閫氶"] = Language.StringByID(StringId.Ventilated);
+ this.dicText["鍔犳箍"] = Language.StringByID(StringId.Humidification);
+ this.dicText["1妗�"] = Language.StringByID(StringId.OneGear);
+ this.dicText["2妗�"] = Language.StringByID(StringId.TwoGear);
+ this.dicText["3妗�"] = Language.StringByID(StringId.ThreeGear);
+
+ //鍒锋柊褰撳墠璁惧鐨勭姸鎬佺紦瀛�
+ this.RefreshNowDeviceStatuMemory(this.device);
+ //鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹�
+ this.InitFrameWhiteContent1();
+ }
+
+ /// <summary>
+ /// 鍒濆鍖栫涓�涓储寮曢〉鐨勫唴瀹�
+ /// </summary>
+ private void InitFrameWhiteContent1()
+ {
+ //涓�涓儗鏅浘鐗�
+ var framePic = new FrameLayout();
+ framePic.Y = Application.GetRealHeight(120);
+ framePic.Width = this.GetPictrueRealSize(303);
+ framePic.Height = this.GetPictrueRealSize(175);
+ framePic.Gravity = Gravity.CenterHorizontal;
+ framePic.BackgroundImagePath = "FunctionIcon/AirFresh/TempAndHumiBack.png";
+ this.FrameWhiteCentet1.AddChidren(framePic);
+
+ //瀹ゅ唴婀垮害 鐨勫鍣�(涓轰簡閲嶆柊璁$畻鍧愭爣浣跨敤)
+ int frameWidth = framePic.Width / 2 - this.GetPictrueRealSize(21);
+ var frameHumidity = new FrameLayout();
+ frameHumidity.X = this.GetPictrueRealSize(21);
+ frameHumidity.Y = this.GetPictrueRealSize(12);
+ frameHumidity.Width = frameWidth;
+ frameHumidity.Height = frameWidth;
+ framePic.AddChidren(frameHumidity);
+ //瀹ゅ唴婀垮害鍊�
+ this.btnHumidity = new NormalViewControl(20, this.GetPicChidrenTextHeight(30), false);
+ btnHumidity.Y = this.GetPictrueRealSize(39);
+ btnHumidity.TextSize = 30;
+ btnHumidity.TextColor = CSS_Color.FirstLevelTitleColor;
+ btnHumidity.TextAlignment = TextAlignment.TopCenter;
+ frameHumidity.AddChidren(btnHumidity);
+ //%
+ this.btnHumidityUnit = new NormalViewControl(10, 10, true);
+ btnHumidityUnit.Y = btnHumidity.Y + this.GetPictrueRealSize(8);
+ btnHumidityUnit.TextColor = CSS_Color.TextualColor;
+ btnHumidityUnit.Text = "%";
+ btnHumidityUnit.TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel;
+ btnHumidityUnit.Width = btnHumidityUnit.GetRealWidthByText();
+ frameHumidity.AddChidren(btnHumidityUnit);
+ //瀹ゅ唴婀垮害
+ var btnHumidityView = new NormalViewControl(frameHumidity.Width, this.GetPicChidrenTextHeight(18), false);
+ btnHumidityView.Y = btnHumidity.Bottom + this.GetPictrueRealSize(8);
+ btnHumidityView.TextAlignment = TextAlignment.Center;
+ btnHumidityView.TextColor = CSS_Color.TextualColor;
+ btnHumidityView.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
+ btnHumidityView.TextID = StringId.IndoorHumidity;
+ frameHumidity.AddChidren(btnHumidityView);
+
+ //瀹ゅ唴娓╁害 鐨勫鍣�(涓轰簡閲嶆柊璁$畻鍧愭爣浣跨敤)
+ var frameTemperature = new FrameLayout();
+ frameTemperature.Y = frameHumidity.Y;
+ frameTemperature.X = frameHumidity.Right;
+ frameTemperature.Width = frameWidth;
+ frameTemperature.Height = frameWidth;
+ framePic.AddChidren(frameTemperature);
+ //瀹ゅ唴娓╁害鍊�
+ this.btnTemperature = new NormalViewControl(20, this.GetPicChidrenTextHeight(30), false);
+ btnTemperature.Y = btnHumidity.Y;
+ btnTemperature.TextSize = 30;
+ btnTemperature.TextColor = CSS_Color.FirstLevelTitleColor;
+ btnTemperature.TextAlignment = TextAlignment.TopCenter;
+ btnTemperature.GetRealWidthByText();
+ frameTemperature.AddChidren(btnTemperature);
+ //鈩�
+ this.btnTemperatureUnit = new NormalViewControl(10, 10, true);
+ btnTemperatureUnit.Y = btnTemperature.Y + this.GetPictrueRealSize(8);
+ btnTemperatureUnit.TextColor = CSS_Color.TextualColor;
+ btnTemperatureUnit.Text = "鈩�";
+ btnTemperatureUnit.TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel;
+ btnTemperatureUnit.Width = btnTemperatureUnit.GetRealWidthByText();
+ frameTemperature.AddChidren(btnTemperatureUnit);
+ //瀹ゅ唴娓╁害
+ var btnTemperatureView = new NormalViewControl(frameTemperature.Width, this.GetPicChidrenTextHeight(18), false);
+ btnTemperatureView.Y = btnTemperature.Bottom + this.GetPictrueRealSize(8);
+ btnTemperatureView.TextAlignment = TextAlignment.Center;
+ btnTemperatureView.TextColor = CSS_Color.TextualColor;
+ btnTemperatureView.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
+ btnTemperatureView.TextID = StringId.IndoorTemp;
+ frameTemperature.AddChidren(btnTemperatureView);
+
+ //褰撳墠婊ょ綉鍓╀綑0%
+ this.btnFilterScreen = new NormalViewControl(this.FrameWhiteCentet1.Width, Application.GetRealHeight(18), false);
+ btnFilterScreen.Y = framePic.Bottom;
+ btnFilterScreen.TextAlignment = TextAlignment.Center;
+ btnFilterScreen.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
+ btnFilterScreen.TextColor = CSS_Color.MainColor;
+ this.FrameWhiteCentet1.AddChidren(btnFilterScreen);
+
+ //鑺傝兘/鑸掗�傚浘鏍�
+ this.btnMode1 = new IconViewControl(28);
+ btnMode1.X = Application.GetRealWidth(42);
+ btnMode1.Y = btnFilterScreen.Bottom + Application.GetRealHeight(61);
+ this.FrameWhiteCentet1.AddChidren(btnMode1);
+ btnMode1.ButtonClickEvent += (sender, e) =>
+ {
+ //鏄剧ず鑺傝兘/鑸掗�傞�夋嫨鐣岄潰
+ this.ShowMode1SelectView();
+ };
+ //鑺傝兘/鑸掗�傛枃鏈�
+ this.btnMode1View = new NormalViewControl(this.FrameWhiteCentet1.Width / 3, Application.GetRealHeight(18), false);
+ btnMode1View.Y = btnMode1.Bottom + Application.GetRealHeight(6);
+ btnMode1View.TextAlignment = TextAlignment.Center;
+ btnMode1View.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
+ btnMode1View.TextColor = CSS_Color.TextualColor;
+ this.FrameWhiteCentet1.AddChidren(btnMode1View);
+
+ //閫氶/鍔犳箍鍥炬爣
+ this.btnMode2 = new IconViewControl(28);
+ btnMode2.Y = btnMode1.Y;
+ btnMode2.Gravity = Gravity.CenterHorizontal;
+ this.FrameWhiteCentet1.AddChidren(btnMode2);
+ btnMode2.ButtonClickEvent += (sender, e) =>
+ {
+ //鏄剧ず閫氶/鍔犳箍閫夋嫨鐣岄潰
+ this.ShowMode2SelectView();
+ };
+ //閫氶/鍔犳箍鏂囨湰
+ this.btnMode2View = new NormalViewControl(this.FrameWhiteCentet1.Width / 3, Application.GetRealHeight(18), false);
+ btnMode2View.X = btnMode1View.Right;
+ btnMode2View.Y = btnMode2.Bottom + Application.GetRealHeight(6);
+ btnMode2View.TextAlignment = TextAlignment.Center;
+ btnMode2View.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
+ btnMode2View.TextColor = CSS_Color.TextualColor;
+ this.FrameWhiteCentet1.AddChidren(btnMode2View);
+
+ //椋庨�熷浘鏍�
+ this.btnFan = new IconViewControl(28);
+ btnFan.X = this.FrameWhiteCentet1.Width - btnMode1.X - btnFan.IconSize;
+ btnFan.Y = btnMode1.Y;
+ this.FrameWhiteCentet1.AddChidren(btnFan);
+ btnFan.ButtonClickEvent += (sender, e) =>
+ {
+ //鏄剧ず椋庨�熼�夋嫨鐣岄潰
+ this.ShowFanSelectView();
+ };
+ //椋庨�熸枃鏈�
+ this.btnFanView = new NormalViewControl(this.FrameWhiteCentet1.Width / 3, Application.GetRealHeight(18), false);
+ btnFanView.X = btnMode2View.Right;
+ btnFanView.Y = btnFan.Bottom + Application.GetRealHeight(6);
+ btnFanView.TextAlignment = TextAlignment.Center;
+ btnFanView.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
+ btnFanView.TextColor = CSS_Color.TextualColor;
+ this.FrameWhiteCentet1.AddChidren(btnFanView);
+
+ //寮�鍏冲浘鏍�
+ this.btnSwitch = new IconViewControl(40);
+ btnSwitch.Gravity = Gravity.CenterHorizontal;
+ btnSwitch.Y = Application.GetRealHeight(468);
+ btnSwitch.UnSelectedImagePath = "Public/PowerClose.png";
+ btnSwitch.SelectedImagePath = "Public/PowerOpen.png";
+ FrameWhiteCentet1.AddChidren(btnSwitch);
+ btnSwitch.ButtonClickEvent += (sender, e) =>
+ {
+ //鍙戦�佸紑鍏冲懡浠�
+ this.SendSwitchComand();
+ };
+
+ //鍒锋柊鐣岄潰鐘舵��
+ this.RefreshFormStatu();
+ }
+
+ #endregion
+
+ #region 鈻� 鏄剧ず鑺傝兘/鑸掗�傞�夋嫨鐣岄潰______________
+
+ /// <summary>
+ /// 鏄剧ず鑺傝兘/鑸掗�傞�夋嫨鐣岄潰
+ /// </summary>
+ private void ShowMode1SelectView()
+ {
+ //鏁翠釜鐏拌壊鐣岄潰
+ var frameBack = new Dialog();
+
+ var dialogBody = new NormalFrameLayout();
+ frameBack.AddChidren(dialogBody);
+ dialogBody.ButtonClickEvent = (sender, e) =>
+ {
+ frameBack.Close();
+ };
+ frameBack.Show();
+
+ //鑿滃崟鎺т欢(妯″紡)
+ var menuContr = new DialogTitleMenuControl(2, Language.StringByID(StringId.Mode));
+ menuContr.X = Application.GetRealWidth(6);
+ menuContr.Y = Application.GetRealHeight(277);
+ menuContr.Width = Application.GetRealWidth(160);
+ menuContr.Height = Application.GetRealHeight(154);
+ dialogBody.AddChidren(menuContr);
+
+ //鑺傝兘
+ var iconPath = this.airFreshData.Energy == "true" ? "FunctionIcon/AirFresh/EnergySelect.png" : "FunctionIcon/AirFresh/Energy.png";
+ menuContr.AddRowMenu(this.dicText["鑺傝兘"], iconPath, this.airFreshData.Energy == "true", () =>
+ {
+ frameBack.Close();
+ //鍙戦�佽妭鑳藉懡浠�
+ this.SendOtherComand(this.btnMode1, "energy", "true");
+ });
+
+ //鑸掗��
+ iconPath = this.airFreshData.Energy == "false" ? "FunctionIcon/AirFresh/ComfortableSelect.png" : "FunctionIcon/AirFresh/Comfortable.png";
+ menuContr.AddRowMenu(this.dicText["鑸掗��"], iconPath, this.airFreshData.Energy == "false", () =>
+ {
+ frameBack.Close();
+ //鍙戦�佽垝閫傚懡浠�
+ this.SendOtherComand(this.btnMode1, "energy", "false");
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 鏄剧ず閫氶/鍔犳箍閫夋嫨鐣岄潰______________
+
+ /// <summary>
+ /// 鏄剧ず閫氶/鍔犳箍閫夋嫨鐣岄潰
+ /// </summary>
+ private void ShowMode2SelectView()
+ {
+ //鏁翠釜鐏拌壊鐣岄潰
+ var frameBack = new Dialog();
+
+ var dialogBody = new NormalFrameLayout();
+ frameBack.AddChidren(dialogBody);
+ dialogBody.ButtonClickEvent = (sender, e) =>
+ {
+ frameBack.Close();
+ };
+ frameBack.Show();
+
+ //鑿滃崟鎺т欢(妯″紡)
+ var menuContr = new DialogTitleMenuControl(2, Language.StringByID(StringId.Mode));
+ menuContr.Y = Application.GetRealHeight(277);
+ menuContr.Gravity = Gravity.CenterHorizontal;
+ menuContr.Width = Application.GetRealWidth(160);
+ menuContr.Height = Application.GetRealHeight(154);
+ dialogBody.AddChidren(menuContr);
+
+ //閫氶
+ var iconPath = this.airFreshData.Mode == "fan" ? "FunctionIcon/AirFresh/VentilateSelect.png" : "FunctionIcon/AirFresh/Ventilate.png";
+ menuContr.AddRowMenu(this.dicText["閫氶"], iconPath, this.airFreshData.Mode == "fan", () =>
+ {
+ frameBack.Close();
+ //鍙戦�侀�氶鍛戒护
+ this.SendOtherComand(this.btnMode2, "mode", "fan");
+ });
+
+ //鍔犳箍
+ iconPath = this.airFreshData.Mode == "humidification" ? "FunctionIcon/AirFresh/HumidificationSelect.png" : "FunctionIcon/AirFresh/Humidification.png";
+ menuContr.AddRowMenu(this.dicText["鍔犳箍"], iconPath, this.airFreshData.Mode == "humidification", () =>
+ {
+ frameBack.Close();
+ //鍙戦�佸姞婀垮懡浠�
+ this.SendOtherComand(this.btnMode2, "mode", "humidification");
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 鏄剧ず椋庨�熼�夋嫨鐣岄潰___________________
+
+ /// <summary>
+ /// 鏄剧ず椋庨�熼�夋嫨鐣岄潰
+ /// </summary>
+ private void ShowFanSelectView()
+ {
+ //鏁翠釜鐏拌壊鐣岄潰
+ var frameBack = new Dialog();
+
+ var dialogBody = new NormalFrameLayout();
+ frameBack.AddChidren(dialogBody);
+ dialogBody.ButtonClickEvent = (sender, e) =>
+ {
+ frameBack.Close();
+ };
+ frameBack.Show();
+
+ //鑿滃崟鎺т欢(椋庨��)
+ var menuContr = new DialogTitleMenuControl(3, Language.StringByID(StringId.FanSpeed));
+ menuContr.X = Application.GetRealWidth(209);
+ menuContr.Y = Application.GetRealHeight(231);
+ menuContr.Width = Application.GetRealWidth(160);
+ menuContr.Height = Application.GetRealHeight(199);
+ dialogBody.AddChidren(menuContr);
+
+ //1妗�
+ var iconPath = this.airFreshData.Fan == "level_1" ? "FunctionIcon/AirFresh/Fan1Select.png" : "FunctionIcon/AirFresh/Fan1.png";
+ menuContr.AddRowMenu(Language.StringByID(StringId.FanOneGear), iconPath, this.airFreshData.Fan == "level_1", () =>
+ {
+ frameBack.Close();
+ //鍙戦�佹。浣嶅懡浠�
+ this.SendOtherComand(this.btnFan, "fan", "level_1");
+ });
+
+ //2妗�
+ iconPath = this.airFreshData.Fan == "level_2" ? "FunctionIcon/AirFresh/Fan2Select.png" : "FunctionIcon/AirFresh/Fan2.png";
+ menuContr.AddRowMenu(Language.StringByID(StringId.FanTwoGear), iconPath, this.airFreshData.Fan == "level_2", () =>
+ {
+ frameBack.Close();
+ //鍙戦�佹。浣嶅懡浠�
+ this.SendOtherComand(this.btnFan, "fan", "level_2");
+ });
+
+ //3妗�
+ iconPath = this.airFreshData.Fan == "level_3" ? "FunctionIcon/AirFresh/Fan3Select.png" : "FunctionIcon/AirFresh/Fan3.png";
+ menuContr.AddRowMenu(Language.StringByID(StringId.FanThreeGear), iconPath, this.airFreshData.Fan == "level_3", () =>
+ {
+ frameBack.Close();
+ //鍙戦�佹。浣嶅懡浠�
+ this.SendOtherComand(this.btnFan, "fan", "level_3");
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 璁惧鐘舵�佸弽棣坃______________________
+
+ /// <summary>
+ /// 璁惧鐘舵�佸弽棣�
+ /// </summary>
+ /// <param name="i_LocalDevice"></param>
+ public override void DeviceStatuPush(Function i_LocalDevice)
+ {
+ //涓嶆槸鍚屼竴涓笢瑗�
+ if (this.device.sid != i_LocalDevice.sid) { return; }
+
+ //鍒锋柊褰撳墠璁惧鐨勭姸鎬佺紦瀛�
+ this.RefreshNowDeviceStatuMemory(i_LocalDevice);
+ //鍒锋柊鐣岄潰鐘舵��
+ this.RefreshFormStatu();
+ }
+
+ #endregion
+
+ #region 鈻� 鍒锋柊鐣岄潰鐘舵�乢______________________
+
+ /// <summary>
+ /// 鍒锋柊鐣岄潰鐘舵��
+ /// </summary>
+ private void RefreshFormStatu()
+ {
+ //寮�鍏�
+ this.btnSwitch.IsSelected = this.airFreshData.Open;
+ //婊ょ綉鍓╀綑
+ this.btnFilterScreen.Text = this.dicText["婊ょ綉鍓╀綑"] + this.airFreshData.Filter_remain + "%";
+
+ //瀹ゅ唴婀垮害
+ if (this.btnHumidity.Text == string.Empty || Convert.ToDecimal(this.btnHumidity.Text) != this.airFreshData.Indoor_humidity)
+ {
+ //鍙樻洿浜嗘墠鏀�
+ this.btnHumidity.Text = this.airFreshData.Indoor_humidity == 0 ? "0.0" : this.airFreshData.Indoor_humidity.ToString();
+ this.btnHumidity.Width = this.btnHumidity.GetRealWidthByText();
+ //閲嶆柊璁$畻鍧愭爣,璁╁畠浠眳涓�
+ this.btnHumidity.X = (btnHumidity.Parent.Width - btnHumidity.Width - btnHumidityUnit.Width) / 2;
+ this.btnHumidityUnit.X = btnHumidity.Right;
+ }
+ //瀹ゅ唴娓╁害
+ if (this.btnTemperature.Text == string.Empty || Convert.ToDecimal(this.btnTemperature.Text) != this.airFreshData.Indoor_temp)
+ {
+ //鍙樻洿浜嗘墠鏀�
+ this.btnTemperature.Text = this.airFreshData.Indoor_temp == 0 ? "0.0" : this.airFreshData.Indoor_temp.ToString();
+ this.btnTemperature.Width = this.btnTemperature.GetRealWidthByText();
+ //閲嶆柊璁$畻鍧愭爣,璁╁畠浠眳涓�
+ this.btnTemperature.X = (btnHumidity.Parent.Width - btnTemperature.Width - btnTemperatureUnit.Width) / 2;
+ this.btnTemperatureUnit.X = btnTemperature.Right;
+ }
+
+ //鑺傝兘/鑸掗��
+ if (this.airFreshData.Energy == "true")
+ {
+ this.btnMode1.UnSelectedImagePath = "FunctionIcon/AirFresh/Energy.png";
+ this.btnMode1.SelectedImagePath = "FunctionIcon/AirFresh/EnergySelect.png";
+ this.btnMode1View.Text = this.dicText["鑺傝兘"];
+ }
+ else
+ {
+ this.btnMode1.UnSelectedImagePath = "FunctionIcon/AirFresh/Comfortable.png";
+ this.btnMode1.SelectedImagePath = "FunctionIcon/AirFresh/ComfortableSelect.png";
+ this.btnMode1View.Text = this.dicText["鑸掗��"];
+ }
+ this.btnMode1.IsSelected = this.airFreshData.Open;
+ this.btnMode1.CanClick = this.airFreshData.Open;
+
+ //閫氶/鍔犳箍
+ if (this.airFreshData.Mode == "fan")
+ {
+ this.btnMode2.UnSelectedImagePath = "FunctionIcon/AirFresh/Ventilate.png";
+ this.btnMode2.SelectedImagePath = "FunctionIcon/AirFresh/VentilateSelect.png";
+ this.btnMode2View.Text = this.dicText["閫氶"];
+ }
+ else
+ {
+ this.btnMode2.UnSelectedImagePath = "FunctionIcon/AirFresh/Humidification.png";
+ this.btnMode2.SelectedImagePath = "FunctionIcon/AirFresh/HumidificationSelect.png";
+ this.btnMode2View.Text = this.dicText["鍔犳箍"];
+ }
+ this.btnMode2.IsSelected = this.airFreshData.Open;
+ this.btnMode2.CanClick = this.airFreshData.Open;
+
+ //椋庨��
+ if (this.airFreshData.Fan == "level_3")
+ {
+ this.btnFan.UnSelectedImagePath = "FunctionIcon/AirFresh/Fan3.png";
+ this.btnFan.SelectedImagePath = "FunctionIcon/AirFresh/Fan3Select.png";
+ this.btnFanView.Text = this.dicText["3妗�"];
+ }
+ else if(this.airFreshData.Fan == "level_2")
+ {
+ this.btnFan.UnSelectedImagePath = "FunctionIcon/AirFresh/Fan2.png";
+ this.btnFan.SelectedImagePath = "FunctionIcon/AirFresh/Fan2Select.png";
+ this.btnFanView.Text = this.dicText["2妗�"];
+ }
+ else
+ {
+ this.btnFan.UnSelectedImagePath = "FunctionIcon/AirFresh/Fan1.png";
+ this.btnFan.SelectedImagePath = "FunctionIcon/AirFresh/Fan1Select.png";
+ this.btnFanView.Text = this.dicText["1妗�"];
+ }
+ this.btnFan.IsSelected = this.airFreshData.Open;
+ this.btnFan.CanClick = this.airFreshData.Open;
+ }
+
+ #endregion
+
+ #region 鈻� 鍙戦�佸悇绉嶅懡浠______________________
+
+ /// <summary>
+ /// 鍙戦�佸叾浠栧懡浠�
+ /// </summary>
+ /// <param name="btnIcon">鎸夐挳</param>
+ /// <param name="comadKey">鍛戒护涓婚敭</param>
+ /// <param name="comadValue">鍛戒护</param>
+ private void SendOtherComand(IconViewControl btnIcon, string comadKey, string comadValue)
+ {
+ btnIcon.CanClick = false;
+
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ var dic = new Dictionary<string, string>();
+ dic.Add(comadKey, comadValue);
+ Control.Ins.SendWriteCommand(this.device, dic, true);
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ btnIcon.CanClick = true;
+ });
+ });
+ }
+
+ /// <summary>
+ /// 鍙戦�佸紑鍏冲懡浠�
+ /// </summary>
+ private void SendSwitchComand()
+ {
+ this.btnSwitch.CanClick = false;
+
+ string statu = this.btnSwitch.IsSelected == true ? "off" : "on";
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ var dic = new Dictionary<string, string>();
+ dic.Add(FunctionAttributeKey.OnOff, statu);
+ Control.Ins.SendWriteCommand(this.device, dic, true);
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ this.btnSwitch.CanClick = true;
+ });
+ });
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 鍒锋柊褰撳墠璁惧鐨勭姸鎬佺紦瀛�
+ /// </summary>
+ private void RefreshNowDeviceStatuMemory(Function i_LocalDevice)
+ {
+ for (int i = 0; i < i_LocalDevice.attributes.Count; i++)
+ {
+ var data = i_LocalDevice.attributes[i];
+ //寮�鍏�
+ if (data.key == "on_off") { this.airFreshData.Open = data.state == "on"; }
+ //妯″紡
+ else if (data.key == "mode") { this.airFreshData.Mode = data.state; }
+ //鑺傝兘
+ else if (data.key == "energy") { this.airFreshData.Energy = data.state; }
+ //椋庨��
+ else if (data.key == "fan") { this.airFreshData.Fan = data.state; }
+ //婀垮害
+ else if (data.key == "humidity")
+ {
+ if (data.state != string.Empty)
+ {
+ this.airFreshData.Humidity = Convert.ToInt32(data.state);
+ }
+ }
+ //瀹ゅ唴娓╁害
+ else if (data.key == "indoor_temp")
+ {
+ if (data.state != string.Empty)
+ {
+ this.airFreshData.Indoor_temp = Math.Round(Convert.ToDecimal(data.state), 1);
+ }
+ }
+ //瀹ゅ唴婀垮害
+ else if (data.key == "indoor_humidity")
+ {
+ if (data.state != string.Empty)
+ {
+ this.airFreshData.Indoor_humidity = Math.Round(Convert.ToDecimal(data.state), 1);
+ }
+ }
+ //杩囨护缃戝墿浣欓噺
+ else if (data.key == "filter_remain")
+ {
+ if (data.state != string.Empty)
+ {
+ this.airFreshData.Filter_remain = Convert.ToInt32(data.state);
+ }
+ }
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 缁撴瀯浣揰____________________________
+
+ /// <summary>
+ /// 鏂伴鐨勬暟鎹�
+ /// </summary>
+ private class AirFreshData
+ {
+ /// <summary>
+ /// 鏄惁鎵撳紑
+ /// </summary>
+ public bool Open = false;
+ /// <summary>
+ /// humidification:鍔犳箍 fan:閫侀
+ /// </summary>
+ public string Mode = string.Empty;
+ /// <summary>
+ /// true:鑺傝兘 false:鑸掗�� 杩欎釜鏈夐棶棰樼殑
+ /// </summary>
+ public string Energy = string.Empty;
+ /// <summary>
+ /// level_1:1妗� level_2:2妗� level_3:3妗� auto:鑷姩(鐩墠杩欎釜涓嶇敤)
+ /// </summary>
+ public string Fan = string.Empty;
+ /// <summary>
+ /// 婀垮害(%)
+ /// </summary>
+ public int Humidity = 0;
+ /// <summary>
+ /// 瀹ゅ唴娓╁害(淇濈暀涓�浣嶅皬鏁�)
+ /// </summary>
+ public decimal Indoor_temp = 0;
+ /// <summary>
+ /// 瀹ゅ唴婀垮害(淇濈暀涓�浣嶅皬鏁�)
+ /// </summary>
+ public decimal Indoor_humidity = 0;
+ /// <summary>
+ /// 鍓╀綑婊ょ綉(%)
+ /// </summary>
+ public int Filter_remain = 0;
+ }
+
+ #endregion
+ }
+}
--
Gitblit v1.8.0