From 73e6bfcd3eed1b4aa714af538891a3a62864b516 Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期四, 05 十二月 2019 14:34:59 +0800 Subject: [PATCH] 2019-12-05-1 --- ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs | 46 +++++++++++--- ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs | 50 ++++++++++++---- ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml | 17 ++++- ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs | 28 +++++++-- ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide | 0 ZigbeeApp/Shared/Phone/Device/Category/Category.cs | 39 +++++++++--- 6 files changed, 134 insertions(+), 46 deletions(-) diff --git a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml index 9b054e7..a246d9a 100644 --- a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml +++ b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml @@ -1,19 +1,28 @@ 锘�<Properties StartupConfiguration="{F1296E2C-3777-4385-85B2-DA77617E3178}|Default"> <MonoDevelop.Ide.ItemProperties.GateWay.Droid PreferredExecutionTarget="Android.SelectDevice" /> <MonoDevelop.Ide.ItemProperties.ShardLib PreferredExecutionTarget="Android.SelectDevice" /> - <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/Category/Category.cs"> + <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs"> <Files> - <File FileName="Shared/Phone/Device/Category/Category.cs" Line="1" Column="1" /> + <File FileName="Shared/Phone/Device/Category/Category.cs" Line="1908" Column="11" /> + <File FileName="Shared/Phone/Device/Logic/DeviceStateCondition.cs" Line="1435" Column="38" /> + <File FileName="Shared/Phone/Device/Logic/MemberList.cs" Line="122" Column="20" /> + <File FileName="Shared/Phone/Device/Logic/Send.cs" Line="798" Column="37" /> + <File FileName="Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs" Line="1" Column="1" /> </Files> <Pads> <Pad Id="ProjectPad"> <State name="__root__"> <Node name="GateWay" expanded="True"> + <Node name="Home.IOS" expanded="True" /> <Node name="Shared" expanded="True"> + <Node name="Common" expanded="True" /> <Node name="Phone" expanded="True"> <Node name="Device" expanded="True"> - <Node name="Category" expanded="True"> - <Node name="Category.cs" selected="True" /> + <Node name="Category" expanded="True" /> + <Node name="Logic" expanded="True"> + <Node name="DoorLockLogic" expanded="True"> + <Node name="AddCondition.cs" selected="True" /> + </Node> </Node> </Node> </Node> diff --git a/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide b/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide index 0bc6e77..8104690 100644 --- a/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide +++ b/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide Binary files differ diff --git a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs index 8ca5e13..3c06a98 100644 --- a/ZigbeeApp/Shared/Phone/Device/Category/Category.cs +++ b/ZigbeeApp/Shared/Phone/Device/Category/Category.cs @@ -1740,9 +1740,9 @@ #endregion #region 鈼� 鑷姩鍖朹_________________________ - + /// <summary> - /// 鑷姩鍖� + /// 鑷姩鍖栧姛鑳戒唬鐮佸叆鍙� /// </summary> private async void ShowAutotion() { @@ -1758,7 +1758,7 @@ Y = Application.GetRealHeight(30), }; functionSceneAutoBodyView.AddChidren(bjFrameLayout); - bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58),HDLUtils.RectCornerBottomLeft); + bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft); var sigBtn = new Button { Width = Application.GetMinRealAverage(84), @@ -1779,7 +1779,7 @@ TextID = MyInternationalizationString.logictemplate, Gravity = Gravity.CenterVertical, TextColor = ZigbeeColor.Current.LogicBtnSelectedColor, - TextSize=15, + TextSize = 15, }; bjFrameLayout.AddChidren(recommendtextBtn); @@ -1804,7 +1804,7 @@ }; functionSceneAutoBodyView.AddChidren(scenehorizontalScrol); - var logicScrolView = new VerticalScrolViewLayout + var logicScrolView = new VerticalRefreshLayout//VerticalScrolViewLayout { Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30), BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, @@ -1905,14 +1905,31 @@ logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight; Automationview(logicScrolView); }; + logicScrolView.BeginHeaderRefreshingAction += () => + { + //閲嶆柊鍒锋柊logic鍒楄〃 + Common.Logic.LogicList.Clear(); + Read(logicScrolView); + //鍏抽棴鍒锋柊View锛� + logicScrolView.EndHeaderRefreshing(); + }; + + Read(logicScrolView); + } + /// <summary> + /// 璇诲彇鑷姩鍖栧垪琛ㄦ暟鎹紱 + /// </summary> + /// <param name="logicScrolView"></param> + private async void Read(VerticalRefreshLayout logicScrolView) + { CommonPage.Loading.Start(); if (Common.Logic.LogicList.Count == 0) { var Idlist = await Logic.Send.GetLogicId(0); if (Idlist.Count != 0) { - var listlogic = await Logic.Send.ReadList(Idlist.Count,0); + var listlogic = await Logic.Send.ReadList(Idlist.Count, 0); //foreach鍙兘闆嗗悎宸茶淇敼,鏋氫妇鎿嶄綔鍙兘涓嶄細鎵ц,鍙兘鍑虹幇宕╂簝(寤鸿for)銆� for (int j = 0; j < listlogic.Count; j++) { @@ -1928,14 +1945,13 @@ //鑷姩鍖� Automationview(logicScrolView); CommonPage.Loading.Hide(); - - } + } /// <summary> - /// 鑷姩鍖栧垪琛ㄧ晫闈� + /// 鍔犺浇鑷姩鍖栧垪琛ㄧ晫闈� /// </summary> /// <param name="refresview">Refresview.</param> - private async void Automationview(VerticalScrolViewLayout refresview) + private async void Automationview(VerticalRefreshLayout refresview) { refresview.RemoveAll(); foreach (var logic in Common.Logic.LogicList) @@ -2064,7 +2080,7 @@ } /// <summary> - /// 鏄剧ず鍥炬爣鐨勯鑹� + /// 鏄剧ず鑷姩鍖栬緭鍑哄姛鑳芥ā鍧楀浘鏍囩殑棰滆壊 /// </summary> /// <param name="logic"></param> /// <param name="logicRowlayout"></param> @@ -2463,6 +2479,7 @@ } } } + #endregion #region 鈼� 鎺у埗鐘舵�乢________________________ diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs index 0c174e4..fa4eb0b 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs @@ -12,10 +12,10 @@ Tag = "LockLogic"; } Button selectedIcon = new Button(); - VerticalScrolViewLayout middle; + VerticalRefreshLayout middle; public int conditionsIndex = -1; - public async void Show() + public void Show() { #region 鏈�涓婇潰鐨勫竷灞�浠g爜 var topRowLayout = new RowLayout @@ -69,14 +69,37 @@ #endregion - middle = new VerticalScrolViewLayout + middle = new VerticalRefreshLayout { Y = topRowLayout.Bottom, Height = Application.GetRealHeight(1920 - 184), BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, }; this.AddChidren(middle); + middle.BeginHeaderRefreshingAction += () => + { + //閲嶆柊鍒锋柊logic鍒楄〃 + string macport = Send.CurrentDoorLock.DeviceAddr + "_" + Send.CurrentDoorLock.DeviceEpoint.ToString(); + for (int i = 0; i < Send.LockList.Count; i++) + { + if (Send.LockList[i].DoorLockMacPort == macport) + { + ///浠庡垪琛ㄧЩ闄ゅ綋鍓嶉棬閿佸叏閮ㄧ殑鏃ф暟鎹紱 + Send.LockList.Remove(Send.LockList[i]); + } + } + Read(); + //鍏抽棴鍒锋柊View锛� + middle.EndHeaderRefreshing(); + }; + Read(); + } + /// <summary> + /// 璇诲彇褰撳墠闂ㄩ攣鐨勪簯绔暟鎹紱 + /// </summary> + public async void Read() + { bool d = false; string macport = Send.CurrentDoorLock.DeviceAddr + "_" + Send.CurrentDoorLock.DeviceEpoint.ToString(); for (int i = 0; i < Send.LockList.Count; i++) @@ -96,12 +119,11 @@ } UserAllView(macport); CommonPage.Loading.Hide(); - } /// <summary> /// 鏄剧ず鎵�鏈夌敤鎴� /// </summary> - void UserAllView(string macport) + public void UserAllView(string macport) { for (int i = 0; i < Send.LockList.Count; i++) @@ -167,10 +189,10 @@ /// 閫夋嫨鏌愪釜鐢ㄦ埛 /// </summary> /// <param name="membershipIfon">瑙﹀彂婧愬垪琛�</param> - /// <param name="userName">鐢ㄦ埛鍚嶅瓧</param> - void SelectedUserID(Send.MembershipIfon membershipIfon) { + public void SelectedUserID(Send.MembershipIfon membershipIfon) + { - var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; + var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; this.AddChidren(flMain); flMain.MouseUpEventHandler += (sender1, e1) => @@ -178,7 +200,7 @@ flMain.RemoveFromParent(); }; - + var lockcolorfra1 = new FrameLayout { @@ -279,7 +301,7 @@ TextSize = 14, }; doorlockRow.AddChidren(doorlockBtn); - + var doorlockSelected = new Button { X = Application.GetRealWidth(860), @@ -320,11 +342,11 @@ selectedIcon = doorlockSelected; doorlockSelected.Visible = true; } - + } } - + Btncomplete.MouseUpEventHandler += (sender, e) => { var lockConditionsInfo = new Dictionary<string, string>(); @@ -339,7 +361,7 @@ lockConditionsInfo.Add("Range", "0"); var accounts = new Dictionary<string, string>(); accounts.Add("Type", "1"); - accounts.Add("Account", membershipIfon.UserName+ modeName); + accounts.Add("Account", membershipIfon.UserName + modeName); accounts.Add("UserId", attriButeData2); if (SelectedLockStatus != "") { @@ -422,6 +444,6 @@ lockLogicCommunalPage.Show(() => { }); }; } - + } } diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs index ebf8d23..46746f5 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs @@ -12,8 +12,8 @@ { Tag = "LockLogicList"; } - VerticalScrolViewLayout middle; - public async void Show() + VerticalRefreshLayout middle; + public void Show() { #region 鏈�涓婇潰鐨勫竷灞�浠g爜 @@ -89,14 +89,29 @@ }; #endregion - middle = new VerticalScrolViewLayout + middle = new VerticalRefreshLayout { Y = topRowLayout.Bottom, Height = Application.GetRealHeight(1920 - 184), BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, }; this.AddChidren(middle); + middle.BeginHeaderRefreshingAction += () => + { + //閲嶆柊鍒锋柊logic鍒楄〃 + Common.Logic.LockLogicList.Clear(); + Read(); + //鍏抽棴鍒锋柊View锛� + middle.EndHeaderRefreshing(); + }; + Read(); + } + /// <summary> + /// 璇诲彇鑷姩鍖栨暟鎹� + /// </summary> + public async void Read() + { CommonPage.Loading.Start(); if (Common.Logic.LockLogicList.Count == 0) { @@ -129,12 +144,13 @@ } } } - //鑷姩鍖� Automationview(); CommonPage.Loading.Hide(); } - - void Automationview() + /// <summary> + /// 鍔犺浇鑷姩鍖栧垪琛ㄧ殑鐣岄潰 + /// </summary> + public void Automationview() { middle.RemoveAll(); for (int i = 0; i < Common.Logic.LockLogicList.Count; i++) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs index edb61d2..c387b1c 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs @@ -15,12 +15,14 @@ } Button selectedIcon = new Button(); public static bool edit = false; - VerticalScrolViewLayout middle; + VerticalRefreshLayout middle; + CommonDevice common; + Dictionary<string, string> editdeviceConditionsInfo; - public async void Show(CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo = null) + public void Show(CommonDevice commondevice, Dictionary<string, string> editdeviceConditions = null) { - - + common = commondevice; + editdeviceConditionsInfo = editdeviceConditions; UserView.HomePage.Instance.ScrollEnabled = false; this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor; #region 鏈�涓婇潰鐨勫竷灞�浠g爜 @@ -73,14 +75,36 @@ }; #endregion - middle = new VerticalScrolViewLayout + middle = new VerticalRefreshLayout { Y = topRowLayout.Bottom, Height = Application.GetRealHeight(1920 - 184), BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, }; this.AddChidren(middle); - + middle.BeginHeaderRefreshingAction += () => + { + //閲嶆柊鍒锋柊logic鍒楄〃 + string macport = common.DeviceAddr + "_" + common.DeviceEpoint.ToString(); + for (int i = 0; i < Send.LockList.Count; i++) + { + if (Send.LockList[i].DoorLockMacPort == macport) + { + ///浠庡垪琛ㄧЩ闄ゅ綋鍓嶉棬閿佸叏閮ㄧ殑鏃ф暟鎹紱 + Send.LockList.Remove(Send.LockList[i]); + } + } + Read(); + //鍏抽棴鍒锋柊View锛� + middle.EndHeaderRefreshing(); + }; + Read(); + } + /// <summary> + /// 璇诲彇褰撳墠闂ㄩ攣鐨勪簯绔暟鎹紱 + /// </summary> + public async void Read() + { bool d = false; string macport = common.DeviceAddr + "_" + common.DeviceEpoint.ToString(); @@ -100,14 +124,14 @@ var allMemberslist = await Send.AllMembers(common.DeviceAddr); Send.LockList.AddRange(allMemberslist); } - UserList(macport, common, editdeviceConditionsInfo); + UserList(macport); CommonPage.Loading.Hide(); } /// <summary> /// 鎴愬憳鍒楄〃鐨勬柟娉� /// </summary> /// <param name="macport"></param> - void UserList(string macport, CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo) + public void UserList(string macport) { foreach (var user in Send.LockList) @@ -156,7 +180,7 @@ EventHandler<MouseEventArgs> useridclick = (sender, e) => { - User(user, common, editdeviceConditionsInfo); + User(user); }; userBtn.MouseUpEventHandler += useridclick; @@ -167,12 +191,12 @@ } - } + } /// <summary> /// 褰撳墠鎴愬憳淇℃伅鐨勬柟娉� /// </summary> /// <param name="user"></param> - void User(Send.MembershipIfon user, CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo) + public void User(Send.MembershipIfon user) { var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor }; this.AddChidren(flMain); -- Gitblit v1.8.0