From dc6493db59dcb0893eac50b72122f94c24056b3f Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 12 十月 2020 14:35:39 +0800
Subject: [PATCH] 新版本
---
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs | 611 +++++++++++++++++++++++++++++-------------------------
1 files changed, 328 insertions(+), 283 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
index 953f73e..f36a132 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
@@ -5,19 +5,8 @@
using static ZigBee.Device.BindObj;
namespace Shared.Phone.UserCenter.DeviceBind
{
- public class ChooseKeyModePage : BindCommonLayout, ZigBee.Common.IStatus
+ public class ChooseKeyModePage : BindCommonLayout
{
- /// <summary>
- /// 鎸夐敭妯″紡鎺ユ敹
- /// </summary>
- /// <param name="common">Common.</param>
- public void Changed(CommonDevice common)
- {
- Shared.Application.RunOnMainThread(() =>
- {
- });
- }
-
/// 鏋勯�犲嚱鏁�
/// </summary>
/// <param name="doorLock"></param>
@@ -29,23 +18,46 @@
this.targetList = targetSelectList;
}
- #region 鈼� 鍙橀噺鐢虫槑__________________________
- ZigBee.Device.Panel currentKey;//褰撳墠鎸夐敭
- //鏄剧ず琚粦瀹氳澶囨垨鍦烘櫙鐨剉iew
- VerticalScrolViewLayout midVerticalScrolViewLayout;//涓儴鍒锋柊鍒楄〃
- HorizontalScrolViewLayout btnHorizontalScrolViewLayout;//鎴块棿鍒楄〃宸﹀彸婊戝姩甯冨眬
+ #region 鍙橀噺鐢虫槑
+ /// <summary>
+ /// 褰撳墠鎸夐敭
+ /// </summary>
+ ZigBee.Device.Panel currentKey;
+ /// <summary>
+ /// 涓儴鍒锋柊鍒楄〃
+ /// </summary>
+ VerticalScrolViewLayout midVerticalScrolViewLayout;
+ /// <summary>
+ /// 鎴块棿鍒楄〃宸﹀彸婊戝姩甯冨眬
+ /// </summary>
+ HorizontalScrolViewLayout btnHorizontalScrolViewLayout;
/// <summary>
/// 鎸夐敭閰嶇疆鐨勭洰鏍囧垪琛�
/// </summary>
- List<CommonDevice> targetList = new List<CommonDevice>();//鏈湴涓存椂閫変腑鍒楄〃
+ List<CommonDevice> targetList = new List<CommonDevice>();
/// <summary>
- /// 鏂扮殑鎸夐敭閰嶇疆鐩爣鍒楄〃涓紝鐩爣瀹為檯瀛樺湪鎸夐敭涓紝姝ゆ椂瑕佸垹鎺夌殑鏁版嵁
+ /// 鏈湴鏃х殑閫変腑鍒楄〃
/// </summary>
- List<CommonDevice> oldTargetList = new List<CommonDevice>();//鏈湴鏃х殑閫変腑鍒楄〃
- int currentClusterID = 6;//褰撳墠绨嘔D
- public Action<List<BindListResponseObj>> action;//鍥炶皟缁戝畾鐩爣椤甸潰鍒锋柊
- int currentModeID = 0;//褰撳墠妯″紡ID
- string curDeviceBindType = "";//褰撳墠璁惧缁戝畾绫诲瀷
+ List<CommonDevice> oldTargetList = new List<CommonDevice>();
+ /// <summary>
+ /// 褰撳墠绨嘔D
+ /// </summary>
+ int currentClusterID = 6;
+ /// <summary>
+ /// 鍥炶皟缁戝畾鐩爣椤甸潰鍒锋柊
+ /// </summary>
+ public Action<List<BindListResponseObj>> action;
+ /// <summary>
+ /// 褰撳墠妯″紡ID
+ /// </summary>
+ int currentModeID = 0;
+ /// <summary>
+ /// 褰撳墠璁惧缁戝畾绫诲瀷
+ /// </summary>
+ string curDeviceBindType = "";
+ /// <summary>
+ /// 绫诲瀷鐨勫叿浣撴ā寮忓垪琛�
+ /// </summary>
List<int> typeDetailModeList = new List<int> { };
#endregion
@@ -103,241 +115,255 @@
#region 鏁版嵁澶勭悊
KeyModeList();
- btnFinifh.MouseUpEventHandler += async (sender, e) =>
- {
- oldTargetList.Clear();
- bool isFinish = false;
- btnFinifh.Enable = false;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
- try
- {
- CommonPage.Loading.Start("");
- //1銆佹竻绌烘墍鏈夌洰鏍�
- if (currentKey.bindList != null)
- {
- var bindResult = await currentKey.ClearBindInfoAsync();
- if (bindResult != null && bindResult.clearBindInfoResponseData != null)
- {
- if (bindResult.clearBindInfoResponseData.Result != 0)
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- else
- {
- currentKey.bindList.Clear();
- }
- }
- else
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- }
+ btnFinifh.MouseUpEventHandler += (sender, e) =>
+ {
+ oldTargetList.Clear();
+ btnFinifh.Enable = false;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
+ System.Threading.Tasks.Task.Run(() =>
+ {
+ try
+ {
+ Application.RunOnMainThread(() =>
+ {
+ CommonPage.Loading.Start("");
+ });
+ //1銆佹竻绌烘墍鏈夌洰鏍�
+ if (currentKey.bindList != null)
+ {
+ var bindResult = HdlDeviceBindLogic.Current.ClearBindInfoAsync(currentKey);
+ if (bindResult != null && bindResult.clearBindInfoResponseData != null)
+ {
+ if (bindResult.clearBindInfoResponseData.Result != 0)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
+ });
+ return;
+ }
+ else
+ {
+ currentKey.bindList.Clear();
+ }
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "5006" + ")", Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
+ });
+ return;
+ }
+ }
- //2銆侀厤缃ā寮�
- Panel.SetWritableValueResponAllData temp = null;
- switch (currentModeID)
- {
- case 100:
- temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.OnOff_On);
- break;
- case 101:
- temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.OnOff_oFF);
- break;
- case 102:
- temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.OnOff_OnOff);
- break;
- case 200:
- temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Level_Step_Up);
- break;
- case 201:
- temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Level_Step_Down);
- break;
- case 203:
- temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Level_Up);
- break;
- case 204:
- temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Level_Down);
- break;
- case 205:
- temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Level_Up_Down);
- break;
- case 300:
- temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Wcd_Up);
- break;
- case 301:
- temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Wcd_Down);
- break;
- case 302:
- temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Wcd_Stop);
- break;
- case 303:
- temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Wcd_Up_Stop);
- break;
- case 304:
- temp = await currentKey.ConfigureHdlKeyValueAsync(Panel.KeyMode.Wcd_Down_Stop);
- break;
- }
- if (temp != null && temp.setWritableValueResponData != null)
- {
- if (temp.setWritableValueResponData.Status == 0)
- {
- //3銆佺粦瀹氭柊鐨勬暟鎹�
- var addBindeDev = new AddBindData();
- addBindeDev.DeviceAddr = currentKey.DeviceAddr;
- addBindeDev.Epoint = currentKey.DeviceEpoint;
+ //2銆侀厤缃ā寮�
+ Panel.SetWritableValueResponAllData temp = null;
+ switch (currentModeID)
+ {
+ case 100:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.OnOff_On);
+ break;
+ case 101:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.OnOff_oFF);
+ break;
+ case 102:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.OnOff_OnOff);
+ break;
+ case 200:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Step_Up);
+ break;
+ case 201:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Step_Down);
+ break;
+ case 203:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Up);
+ break;
+ case 204:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Down);
+ break;
+ case 205:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Level_Up_Down);
+ break;
+ case 300:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Up);
+ break;
+ case 301:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Down);
+ break;
+ case 302:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Stop);
+ break;
+ case 303:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Up_Stop);
+ break;
+ case 304:
+ temp = HdlDeviceBindLogic.Current.ConfigureHdlKeyValueAsync(currentKey, Panel.KeyMode.Wcd_Down_Stop);
+ break;
+ }
+ if (temp != null && temp.setWritableValueResponData != null)
+ {
+ if (temp.setWritableValueResponData.Status == 0)
+ {
+ //3銆佺粦瀹氭柊鐨勬暟鎹�
+ var addBindeDev = new AddBindData();
+ addBindeDev.DeviceAddr = currentKey.DeviceAddr;
+ addBindeDev.Epoint = currentKey.DeviceEpoint;
- foreach (var de in targetList)
- {
- if (de.DeviceAddr != null)
- {
- var addBindInfo = new AddBindListObj();
- addBindInfo.BindType = 0;
- addBindInfo.BindCluster = currentClusterID;
- addBindInfo.BindMacAddr = de.DeviceAddr;
- addBindInfo.BindEpoint = de.DeviceEpoint;
- addBindeDev.BindList.Add(addBindInfo);
- }
- }
+ foreach (var de in targetList)
+ {
+ if (de.DeviceAddr != null)
+ {
+ var addBindInfo = new AddBindListObj();
+ addBindInfo.BindType = 0;
+ addBindInfo.BindCluster = currentClusterID;
+ addBindInfo.BindMacAddr = de.DeviceAddr;
+ addBindInfo.BindEpoint = de.DeviceEpoint;
+ addBindeDev.BindList.Add(addBindInfo);
+ }
+ }
- //鏄寒搴﹀啀娆″彂6鍛戒护
- if (currentClusterID == 8)
- {
- foreach (var de in targetList)
- {
- if (de.DeviceAddr != null)
- {
- var addBindInfo = new AddBindListObj();
- addBindInfo.BindType = 0;
- addBindInfo.BindCluster = 6;
- addBindInfo.BindMacAddr = de.DeviceAddr;
- addBindInfo.BindEpoint = de.DeviceEpoint;
- addBindeDev.BindList.Add(addBindInfo);
- }
- }
- }
+ //鏄寒搴﹀啀娆″彂6鍛戒护
+ if (currentClusterID == 8)
+ {
+ foreach (var de in targetList)
+ {
+ if (de.DeviceAddr != null)
+ {
+ var addBindInfo = new AddBindListObj();
+ addBindInfo.BindType = 0;
+ addBindInfo.BindCluster = 6;
+ addBindInfo.BindMacAddr = de.DeviceAddr;
+ addBindInfo.BindEpoint = de.DeviceEpoint;
+ addBindeDev.BindList.Add(addBindInfo);
+ }
+ }
+ }
- var dev = new AddedDeviceBindResponseAllData();
- dev = await currentKey.AddDeviceBindAsync(addBindeDev);
- if (dev.addedDeviceBindResponseData == null)
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- else
- {
- if (dev.addedDeviceBindResponseData.Result == 0)
- {
- if (currentClusterID == 8)
- {
- foreach (var de in dev.addedDeviceBindResponseData.BindList)
- {
- if (de.BindCluster == 8)
- {
- currentKey.bindList.Add(de);
- }
- }
- }
- else
- {
- currentKey.bindList = dev.addedDeviceBindResponseData.BindList;
- }
- if (action != null)
- {
- action(currentKey.bindList);
- }
- this.RemoveFromParent();
- targetList.Clear();
- CommonPage.Loading.Hide();
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- }
- else if (dev.addedDeviceBindResponseData.Result == 1)
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip()
- {
- MaxWidth = 150,
- Text = Language.StringByID(R.MyInternationalizationString.BindFailed),
- Direction = AMPopTipDirection.Up,
- CloseTime = 1
- }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- else
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip()
- {
- MaxWidth = 150,
- Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError),
- Direction = AMPopTipDirection.Up,
- CloseTime = 1
- }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- }
- }
- else
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- }
- else
- {
- Application.RunOnMainThread(() =>
- {
- CommonPage.Loading.Hide();
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnFinifh);
- });
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- return;
- }
- }
- catch
- {
- CommonPage.Loading.Hide();
- btnFinifh.Enable = true;
- btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
- }
- };
+ var dev = new AddedDeviceBindResponseAllData();
+ dev = HdlDeviceBindLogic.Current.AddDeviceBindAsync(addBindeDev);
+ if (dev != null && dev.addedDeviceBindResponseData != null)
+ {
+ if (dev.addedDeviceBindResponseData.Result == 0)
+ {
+ if (currentClusterID == 8)
+ {
+ foreach (var de in dev.addedDeviceBindResponseData.BindList)
+ {
+ if (de.BindCluster == 8)
+ {
+ currentKey.bindList.Add(de);
+ }
+ }
+ }
+ else
+ {
+ currentKey.bindList = dev.addedDeviceBindResponseData.BindList;
+ }
+
+ Application.RunOnMainThread(() =>
+ {
+ if (action != null)
+ {
+ action(currentKey.bindList);
+ }
+ targetList.Clear();
+ this.RemoveFromParent();
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ });
+
+ }
+ else if (dev.addedDeviceBindResponseData.Result == 1)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip()
+ {
+ MaxWidth = 150,
+ Text = Language.StringByID(R.MyInternationalizationString.BindFailed),
+ Direction = AMPopTipDirection.Up,
+ CloseTime = 1
+ }.Show(btnFinifh);
+ });
+ return;
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip()
+ {
+ MaxWidth = 150,
+ Text = Language.StringByID(R.MyInternationalizationString.BindUnknownError),
+ Direction = AMPopTipDirection.Up,
+ CloseTime = 1
+ }.Show(btnFinifh);
+ });
+
+ return;
+ }
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "5001" + ")", Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
+ });
+ return;
+ }
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnFinifh);
+ });
+ return;
+ }
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "120_ 6533" + ")", Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnFinifh);
+ });
+ return;
+ }
+ }
+ catch
+ {
+ Application.RunOnMainThread(() =>
+ {
+ btnFinifh.Enable = true;
+ btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
+ CommonPage.Loading.Hide();
+ });
+ }
+ });
+ };
#endregion
}
@@ -356,7 +382,7 @@
typeDetailModeList = await GetAddSwitchMode();
if (typeDetailModeList == null)
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "0003_switch" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
}
else
{
@@ -368,7 +394,7 @@
typeDetailModeList = await GetAddDimmerMode();
if (typeDetailModeList == null)
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "0003_dimmer" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
}
else
{
@@ -380,7 +406,7 @@
typeDetailModeList = await GetAddCurtainMode();
if (typeDetailModeList == null)
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "0003_curtain" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
}
else
{
@@ -398,6 +424,13 @@
{
return System.Threading.Tasks.Task.Run(async () =>
{
+ //濡傛灉褰撳墠鏄櫄鎷熶綇瀹�
+ if (Common.Config.Instance.Home.IsVirtually == true)
+ {
+ typeDetailModeList.Clear();
+ return new List<int>() { 100, 101, 102 };
+ }
+
Application.RunOnMainThread(() =>
{
CommonPage.Loading.Start();
@@ -454,6 +487,13 @@
{
return System.Threading.Tasks.Task.Run(async () =>
{
+ //濡傛灉褰撳墠鏄櫄鎷熶綇瀹�
+ if (Common.Config.Instance.Home.IsVirtually == true)
+ {
+ typeDetailModeList.Clear();
+ return new List<int>() { 200, 201, 203, 204, 205 };
+ }
+
Application.RunOnMainThread(() =>
{
CommonPage.Loading.Start();
@@ -525,6 +565,17 @@
return System.Threading.Tasks.Task.Run(async () =>
{
typeDetailModeList.Clear();
+ //濡傛灉褰撳墠鏄櫄鎷熶綇瀹�
+ if (Common.Config.Instance.Home.IsVirtually == true)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ CommonPage.Loading.Hide();
+ });
+ typeDetailModeList.Clear();
+ return new List<int>() { 300, 301, 302, 303, 304 };
+ }
+
List<int> result3 = new List<int> { };
try
{
@@ -578,6 +629,9 @@
});
}
+ /// <summary>
+ /// 娣诲姞寮�鍏虫ā寮�
+ /// </summary>
async private void AddSwitchMode()
{
if (typeDetailModeList == null)
@@ -588,7 +642,7 @@
{
Application.RunOnMainThread(() =>
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "0003_switch" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
});
return;
}
@@ -619,8 +673,8 @@
var btnChoose = new Button()
{
- Width = Application.GetRealWidth(60),
- Height = Application.GetRealHeight(60),
+ Width = Application.GetMinReal(60),
+ Height = Application.GetMinReal(60),
X = Application.GetRealWidth(861 + 81),
Y = Application.GetRealHeight(35),
SelectedImagePath = "DoorLock/SelectedIcon.png",
@@ -697,7 +751,6 @@
oldMode = btnChoose;
oldMode.IsSelected = true;
oldMode.Visible = true;
- currentKey.CurrentSwitchMode = btnModeText.Text;
if (btnModeText.Text == Language.StringByID(R.MyInternationalizationString.OnOffOn))
{
currentModeID = 100;
@@ -723,6 +776,9 @@
}
}
+ /// <summary>
+ /// 娣诲姞璋冨厜妯″紡
+ /// </summary>
async private void AddDimmerMode()
{
if (typeDetailModeList == null)
@@ -733,7 +789,7 @@
{
Application.RunOnMainThread(() =>
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "0003_dimmer" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
});
return;
}
@@ -775,8 +831,8 @@
var btnChoose = new Button()
{
- Width = Application.GetRealWidth(60),
- Height = Application.GetRealHeight(60),
+ Width = Application.GetMinReal(60),
+ Height = Application.GetMinReal(60),
X = Application.GetRealWidth(861 + 81),
Y = Application.GetRealHeight(35),
SelectedImagePath = "DoorLock/SelectedIcon.png",
@@ -870,7 +926,6 @@
oldMode = btnChoose;
oldMode.IsSelected = true;
oldMode.Visible = true;
- currentKey.CurrentSwitchMode = btnModeText.Text;
if (btnModeText.Text == Language.StringByID(R.MyInternationalizationString.DimmerMode1))
{
currentModeID = 200;
@@ -905,17 +960,20 @@
}
}
+ /// <summary>
+ /// 娣诲姞绐楀笜妯″紡
+ /// </summary>
async private void AddCurtainMode()
{
if (typeDetailModeList == null)
{
//鍐嶆鍔ㄦ�佽幏鍙栨寜閿敮鎸佺殑绫�
- typeDetailModeList = await GetAddSwitchMode();
+ typeDetailModeList = await GetAddCurtainMode();
if (typeDetailModeList == null)
{
Application.RunOnMainThread(() =>
{
- new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
+ new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime) + "(" + "0003_curtain" + ")", Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
});
return;
}
@@ -946,8 +1004,8 @@
var btnChoose = new Button()
{
- Width = Application.GetRealWidth(60),
- Height = Application.GetRealHeight(60),
+ Width = Application.GetMinReal(60),
+ Height = Application.GetMinReal(60),
X = Application.GetRealWidth(861 + 81),
Y = Application.GetRealHeight(35),
SelectedImagePath = "DoorLock/SelectedIcon.png",
@@ -1041,7 +1099,6 @@
oldMode = btnChoose;
oldMode.IsSelected = true;
oldMode.Visible = true;
- currentKey.CurrentSwitchMode = btnModeText.Text;
if (btnModeText.Text == Language.StringByID(R.MyInternationalizationString.WcdUp))
{
currentModeID = 300;
@@ -1074,18 +1131,6 @@
btnChoose.MouseUpEventHandler += hander;
i++;
}
- }
-
- public void DeviceInfoChange(CommonDevice common, string typeTag)
- {
- }
-
- public void ChangedILogicStatus(ZigBee.Device.Logic logic)
- {
- }
-
- public void ChangedISceneStatus(Scene scene)
- {
}
}
}
--
Gitblit v1.8.0