From 627093aca723d4bfb971b97c828e8b3a22dbda78 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 17 七月 2020 17:26:19 +0800
Subject: [PATCH] 2020-07-17-1
---
ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs | 113 ++++++++++++++++++++++++++++++++------------------------
1 files changed, 65 insertions(+), 48 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
index cf1beba..624f08f 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
@@ -10,10 +10,11 @@
{
public class SkipView:FrameLayout
{
+
/// <summary>
/// 鍏跺畠鐣岄潰璺宠繘鏉ョ殑鍏ュ彛
/// </summary>
- public static void SkipAddLogic(int intvalue, DoorLock doorLock = null, UserCenter.MemberInfoRes accountObj = null)
+ public async static void SkipAddLogic(int intvalue, DoorLock doorLock = null, UserCenter.MemberInfoRes accountObj = null)
{
/// 0.姝e父鑷姩鍖�;1.闂ㄩ攣鑷姩鍖�;2.Sone闂ㄩ攣;
switch (intvalue)
@@ -30,7 +31,6 @@
UserView.HomePage.Instance.AddChidren(addLogicPage);
UserView.HomePage.Instance.PageIndex += 1;
addLogicPage.Show();
-
}
break;
case 1:
@@ -60,13 +60,12 @@
doorLockLogicList.Show();
}
break;
-
+
}
}
-
-
#region 鈼� 鑷姩鍖朹_________________________
+ public static bool If_once = true;//杩涙潵鍙涓�娆℃爣璇�;
/// <summary>
/// 鑷姩鍖栧姛鑳戒唬鐮佸叆鍙�
/// </summary>
@@ -240,10 +239,11 @@
};
//涓嬫媺鍒锋柊鑷姩鍖栧垪琛ㄧ殑浜嬩欢
logicScrolView.BeginHeaderRefreshingAction += () =>
- {
+ {
if (!Config.Instance.Home.IsVirtually)
{//铏氭嫙鐨勪笉鑾峰彇缃戝叧閫昏緫鍒楄〃
- //閲嶆柊鍒锋柊logic鍒楄〃
+ //閲嶆柊鍒锋柊logic鍒楄〃
+ If_once = true;
Common.Logic.LogicList.Clear();
Read(logicScrolView, no);
}
@@ -274,35 +274,40 @@
{
if (!Config.Instance.Home.IsVirtually)//铏氭嫙鐨勪笉鑾峰彇缃戝叧閫昏緫鍒楄〃
{
- if (Common.Logic.LogicList.Count == 0)
+ if (If_once)
{
- 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++)
+ If_once = false;
+ 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);
}
+
}
}
}
@@ -316,6 +321,7 @@
CommonPage.Loading.Hide();
}
static RowLayout selectedRow = new RowLayout() { Tag = "0" };//璁板綍宸︽粦鐘舵��
+
/// <summary>
/// 鍔犺浇鑷姩鍖栧垪琛ㄧ晫闈�
/// </summary>
@@ -716,9 +722,16 @@
timeConditionsInfo.Add("EnDelay", "0");
timeConditionsInfo.Add("DelayTime", "0");
timeConditionsInfo.Add("StartHour", h);
- timeConditionsInfo.Add("StartMin", m);
- timeConditionsInfo.Add("DoorLockOpenDelayTime", (timeVlaue*60*60).ToString());
- //timeConditionsInfo.Add("DoorLockOpenDelayTime", (timeVlaue * 3600).ToString());
+ timeConditionsInfo.Add("StartMin", m);
+ if (UserCenter.UserCenterResourse.HideOption.DoorLockNomallyOpenTimeMode == 1)
+ {
+ //寮哄埗鍙樻洿鏃堕棿妯″紡涓哄垎閽�
+ timeConditionsInfo.Add("DoorLockOpenDelayTime", (timeVlaue * 60).ToString());
+ }
+ else
+ {
+ timeConditionsInfo.Add("DoorLockOpenDelayTime", (timeVlaue * 3600).ToString());
+ }
Dictionary<string, object> actionsInfo = new Dictionary<string, object>();
actionsInfo.Add("LinkType", 8);
actionsInfo.Add("DeviceAddr", common.DeviceAddr);
@@ -756,37 +769,32 @@
/// </summary>
public static async System.Threading.Tasks.Task<int> Exist(int valueInt, ZigBee.Device.DoorLock doorLock)
{
+
int exist = 0;
- var Idlist = await Send.GetLogicId(valueInt);
- if (Idlist.Count != 0)
+ var IdList = await Send.GetLogicId(valueInt);
+ if (IdList.Count != 0)
{
- //榛樿鍙栫涓�涓�昏緫ID
- var id = Idlist[0];
- if (valueInt != 3)
+ for (int i = 0; i < IdList.Count; i++)
{
- exist = id;
- }
- else
- {
- var logic = await Send.GetLogic(id, 3);
+ var id = IdList[i];
+ var logic = await Send.GetLogic(id, valueInt);
if (logic != null)
{
if (ExistLogic(logic, doorLock))
{
exist = id;
- }
- else
- {
- exist = 0;
+ ///鎵惧埌閫�鍑�
+ break;
}
}
+
}
}
return exist;
}
///<summary>
- ///鑾峰彇闂ㄩ攣閫昏緫淇℃伅
+ ///鑾峰彇闂ㄩ攣鏃舵晥鎬ч�昏緫淇℃伅
/// 杩斿洖鍊硷細null涓嶅瓨鍦�;鍏跺畠鍊奸兘瀛樺湪;
/// </summary>
public static async System.Threading.Tasks.Task<Common.Logic> GetLogicIfon(ZigBee.Device.DoorLock doorLock)
@@ -810,14 +818,12 @@
///鍒犻櫎璇ラ棬閿佹墍鏈夋椂鏁堟�ц嚜鍔ㄥ寲
/// 杩斿洖鍊硷細true鎴愬姛;false澶辫触;
/// </summary>
- public static async System.Threading.Tasks.Task<bool> GetLogicAll(ZigBee.Device.DoorLock doorLock)
+ public static async System.Threading.Tasks.Task<bool> DelAllLogic(ZigBee.Device.DoorLock doorLock)
{
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];
@@ -828,7 +834,16 @@
{
//鏈潵鍙湁涓�鏉℃椂鏁堟�ц嚜鍔ㄥ寲锛�
//闃叉鐗规畩鎯呭喌,鎵惧埌灏卞垹闄ゆ帀;
+ //var valueInt = await Send.DelLogic(id);
+ //if (valueInt == 0)
+ //{
+ // _if = true;
+ //}
+ //(鑰冭檻鎬ц兘榛樿鍒犻櫎鎴愬姛锛岀洿鎺ヨ繑鍥炴垚鍔熺粨鏋渢rue)
+ _if = true;
Send.DelLogic(id);
+
+
}
}
}
@@ -844,7 +859,7 @@
{
for (int j = 0; j < logic.Accounts.Count; j++)
{
- //Option4鏄澶噈ac锛汷ption2鏄澶囩鍙o紱
+ //Option4鏄澶噈ac锛�
if (logic.Accounts[j]["Option4"].ToString() == doorLock.DeviceAddr)
{
//鏌ユ壘鏄惁鏄偅涓棬閿侊紱
@@ -856,6 +871,8 @@
return false;
}
+
+
}
}
--
Gitblit v1.8.0