From 2be70a32d2a8c517bd9868fb60913fcc843e66fe Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 13 五月 2020 11:21:32 +0800
Subject: [PATCH] 上传代码
---
ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs | 136 +++++++++++++++++++++++++++------------------
1 files changed, 81 insertions(+), 55 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
index ca15989..2e68b30 100755
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
@@ -8,7 +8,7 @@
namespace Shared.Phone.Device.Logic
{
- public class SkipView
+ public class SkipView:FrameLayout
{
/// <summary>
/// 鍏跺畠鐣岄潰璺宠繘鏉ョ殑鍏ュ彛
@@ -60,40 +60,19 @@
doorLockLogicList.Show();
}
break;
- case 2:
- {
- ///Sone闂ㄩ攣涓诲叆鍙�
- if (doorLock == null)
- {
- ///闃叉鎶涘紓甯�
- doorLock = new DoorLock();
- }
- Send.CurrentDoorLock = doorLock;
- ///杩涙潵鍒锋柊涓�娆¤澶囧垪琛紱
- Common.Logic.LogicDviceList.Clear();
- if (Common.Logic.LogicDviceList.Count == 0)
- {
- Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray());
- }
- var addLogicPage = new SoneLogicList();
- UserView.HomePage.Instance.AddChidren(addLogicPage);
- UserView.HomePage.Instance.PageIndex += 1;
- addLogicPage.Show();
-
- }
- break;
+
}
}
-
+
#region 鈼� 鑷姩鍖朹_________________________
/// <summary>
/// 鑷姩鍖栧姛鑳戒唬鐮佸叆鍙�
/// </summary>
public static void ShowAutotionView(FrameLayout functionSceneAutoBodyView)
{
- // functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
+ //functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
#region ---鎺ㄨ崘妯℃澘鐨勭粍浠�
//鎺ㄨ崘妯℃澘鑳屾櫙鎺т欢
var bjFrameLayout = new FrameLayout
@@ -261,10 +240,13 @@
};
//涓嬫媺鍒锋柊鑷姩鍖栧垪琛ㄧ殑浜嬩欢
logicScrolView.BeginHeaderRefreshingAction += () =>
- {
- //閲嶆柊鍒锋柊logic鍒楄〃
- Common.Logic.LogicList.Clear();
- Read(logicScrolView, no);
+ {
+ if (!Config.Instance.Home.IsVirtually)
+ {//铏氭嫙鐨勪笉鑾峰彇缃戝叧閫昏緫鍒楄〃
+ //閲嶆柊鍒锋柊logic鍒楄〃
+ Common.Logic.LogicList.Clear();
+ Read(logicScrolView, no);
+ }
//鍏抽棴鍒锋柊View锛�
logicScrolView.EndHeaderRefreshing();
};
@@ -279,37 +261,48 @@
/// <param name="logicScrolView"></param>
private static async void Read(VerticalRefreshLayout logicScrolView, bool no)
{
+ //if (Config.Instance.HomeId != UserCenter.UserCenterResourse.AccountOption.OldHomeStringId)
+ //{
+ // //鍒囨崲浣忓畢娓呴櫎涔嬪墠缂撳瓨鏁版嵁;
+ // Common.Logic.LogicList.Clear();
+ // Common.Logic.LockLogicList.Clear();
+ // Common.Logic.SoneLogicList.Clear();
+ //}
+
CommonPage.Loading.Start();
try
{
- if (Common.Logic.LogicList.Count == 0)
+ if (!Config.Instance.Home.IsVirtually)//铏氭嫙鐨勪笉鑾峰彇缃戝叧閫昏緫鍒楄〃
{
- var Idlist1 = await Send.GetLogicId(0);//
- var Idlist2 = await Send.GetLogicId(2);//闂ㄩ攣甯稿紑妯″紡
- if (Idlist1.Count != 0)
+ if (Common.Logic.LogicList.Count == 0)
{
- var listlogic1 = await Send.ReadList(Idlist1.Count, 0);
- for (int j = 0; j < listlogic1.Count; j++)
+ var Idlist1 = await Send.GetLogicId(0);//
+ var Idlist2 = await Send.GetLogicId(2);//闂ㄩ攣甯稿紑妯″紡
+ if (Idlist1.Count != 0)
{
- var logic = listlogic1[j];
- if (logic.LogicType != 0)
+ var listlogic1 = await Send.ReadList(Idlist1.Count, 0);
+ for (int j = 0; j < listlogic1.Count; j++)
{
- continue;
+ var logic = listlogic1[j];
+ if (logic.LogicType != 0)
+ {
+ continue;
+ }
+ Common.Logic.LogicList.Add(logic);
}
- Common.Logic.LogicList.Add(logic);
}
- }
- if (Idlist2.Count != 0)
- {
- var listlogic2 = await Send.ReadList(Idlist2.Count, 2);
- for (int j = 0; j < listlogic2.Count; j++)
+ if (Idlist2.Count != 0)
{
- var logic = listlogic2[j];
- if (logic.LogicType != 2)
+ var listlogic2 = await Send.ReadList(Idlist2.Count, 2);
+ for (int j = 0; j < listlogic2.Count; j++)
{
- continue;
+ var logic = listlogic2[j];
+ if (logic.LogicType != 2)
+ {
+ continue;
+ }
+ Common.Logic.LogicList.Add(logic);
}
- Common.Logic.LogicList.Add(logic);
}
}
}
@@ -329,6 +322,7 @@
/// <param name="refresview">Refresview.</param>
private static async void Automationview(VerticalRefreshLayout refresview, bool no)
{
+
refresview.RemoveAll();
if (Common.Logic.LogicList.Count == 0 && no == false)
{
@@ -460,7 +454,10 @@
logic.IsEnable = 0;
StatusColor(logic, logicRowlayout, 0);
}
- Send.LogicControlSwitch(logic);
+ if (!Config.Instance.Home.IsVirtually)
+ {
+ Send.LogicControlSwitch(logic);
+ }
//Logic.Send.AddModifyLogic(logic);
};
if (logic.IsEnable == 1)
@@ -522,7 +519,10 @@
{
Common.Logic.LogicList.Remove(logic);
Automationview(refresview, no);
- Send.DelLogic(logic.LogicId);
+ if (!Config.Instance.Home.IsVirtually)
+ {
+ Send.DelLogic(logic.LogicId);
+ }
};
};
@@ -698,12 +698,12 @@
#endregion
/// <summary>
- /// 闂ㄩ攣鍙栨秷璁剧疆鐢ㄧ殑鏂规硶(鐩稿綋涓�涓叧闂父寮�妯″紡鎸夐挳,鍒嗙被-鑷姩鍖�-涓嶉渶瑕佹樉绀鸿鑷姩鍖�)
+ /// 闂ㄩ攣澶辨晥璁剧疆鐢ㄧ殑鏂规硶(鐩稿綋涓�涓叧闂父寮�妯″紡鎸夐挳,鍒嗙被-鑷姩鍖�-涓嶉渶瑕佹樉绀鸿鑷姩鍖�)
/// </summary>
/// <param name="timeVlaue">鏃堕棿鍊�</param>
/// <param name="common">璁惧</param>
/// <returns></returns>
- public static async System.Threading.Tasks.Task<bool> LockAddModifyLogic(int timeVlaue, CommonDevice common)
+ public static async System.Threading.Tasks.Task<int> LockAddModifyLogic(int timeVlaue, CommonDevice common)
{
//璇诲彇绯荤粺褰撳墠鏃堕棿锛氭椂-鍒�
var h = DateTime.Now.ToString("HH");
@@ -736,9 +736,9 @@
{
//娣诲姞闂ㄩ攣澶辨晥鏃堕棿鐨勫巻鍙茶褰�
UserCenter.HdlDeviceDoorLockLogic.Current.AddDoorHistoryLog((DoorLock)common, 9003, timeVlaue.ToString());
- return true;//琛ㄧず娣诲姞鎴愬姛;
+ return logicIfon.LogicId;//琛ㄧず娣诲姞鎴愬姛;
}
- return false;//琛ㄧず娣诲姞澶辫触;
+ return 0;//琛ㄧず娣诲姞澶辫触;
}
@@ -759,7 +759,7 @@
}
return exist;
}
-
+
///<summary>
///鑾峰彇閫昏緫淇℃伅
/// 杩斿洖鍊硷細null涓嶅瓨鍦�;鍏跺畠鍊奸兘瀛樺湪;
@@ -776,6 +776,32 @@
}
return logic;
}
+
+ ///<summary>
+ ///鍒犻櫎鎵�鏈夋椂鏁堟�ц嚜鍔ㄥ寲
+ /// 杩斿洖鍊硷細true鎴愬姛;false澶辫触;
+ /// </summary>
+ public static async System.Threading.Tasks.Task<bool> GetLogicAll()
+ {
+ bool _if = false;
+ var Idlist = await Send.GetLogicId(3);
+ if (Idlist.Count != 0)
+ {
+ _if = true;
+
+ for (int i = 0; i < Idlist.Count; i++)
+ {
+ int id = Idlist[i];
+ //鏈潵鍙湁涓�鏉℃椂鏁堟�ц嚜鍔ㄥ寲锛�
+ //闃叉鐗规畩鎯呭喌,鎵惧埌灏卞垹闄ゆ帀;
+ Send.DelLogic(id);
+ }
+ }
+ return _if;
+ }
+
+
+
}
}
--
Gitblit v1.8.0