From 6817ec660fcf032ed94a4197b145ad1e96c2aeed Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期三, 06 五月 2020 17:40:34 +0800 Subject: [PATCH] 2020-05-06-2 --- ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs | 88 ++++++++++++++++++++------------------------ 1 files changed, 40 insertions(+), 48 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs index ed6a13b..374b643 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs @@ -20,34 +20,16 @@ { case 0: { - ///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(); + //new涓�涓柊閫昏緫瀵硅薄锛� + //鏂板姝e父鑷姩鍖栧叆鍙� + Common.Logic.CurrentLogic = new Common.Logic(); + Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑 + Common.Logic.CurrentLogic.LogicType = 0;//鏍囪閫昏緫绫诲瀷 + Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1); + var addLogicPage = new AddLogicPage(); UserView.HomePage.Instance.AddChidren(addLogicPage); UserView.HomePage.Instance.PageIndex += 1; - addLogicPage.Show(()=> { },false); - - ////new涓�涓柊閫昏緫瀵硅薄锛� - ////鏂板姝e父鑷姩鍖栧叆鍙� - //Common.Logic.CurrentLogic = new Common.Logic(); - //Common.Logic.CurrentLogic.IsEnable = 1;//榛樿涓哄紑 - //Common.Logic.CurrentLogic.LogicType = 0;//鏍囪閫昏緫绫诲瀷 - //Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1); - //var addLogicPage = new AddLogicPage(); - //UserView.HomePage.Instance.AddChidren(addLogicPage); - //UserView.HomePage.Instance.PageIndex += 1; - //addLogicPage.Show(); + addLogicPage.Show(); } break; @@ -82,8 +64,8 @@ } } - + #region 鈼� 鑷姩鍖朹_________________________ /// <summary> /// 鑷姩鍖栧姛鑳戒唬鐮佸叆鍙� @@ -279,34 +261,37 @@ 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); } } } @@ -326,6 +311,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) { @@ -457,7 +443,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) @@ -519,7 +508,10 @@ { Common.Logic.LogicList.Remove(logic); Automationview(refresview, no); - Send.DelLogic(logic.LogicId); + if (!Config.Instance.Home.IsVirtually) + { + Send.DelLogic(logic.LogicId); + } }; }; -- Gitblit v1.8.0