From 27e6f7742991170672feba0f4fd8d693b333ba0e Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期三, 15 一月 2020 17:08:06 +0800 Subject: [PATCH] 2020.1.15 --- ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml | 30 +++++---- ZigbeeApp/Shared/Phone/Device/Room/RoomManagement.cs | 10 +- ZigbeeApp/Shared/Common/Room.cs | 101 ++++++++++++++++----------------- 3 files changed, 72 insertions(+), 69 deletions(-) diff --git a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml index 6cb7120..b4bd14f 100644 --- a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml +++ b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml @@ -1,16 +1,20 @@ 锘�<Properties StartupConfiguration="{28EDE1FF-20EF-476B-8AF8-24A3EEB69F45}|Default"> - <MonoDevelop.Ide.ItemProperties.GateWay.Droid PreferredExecutionTarget="Android.SelectDevice" /> + <MonoDevelop.Ide.ItemProperties.GateWay.Droid PreferredExecutionTarget="Android.M7BBB18B19152766" /> <MonoDevelop.Ide.ItemProperties.GateWay.Ios automaticSigning="False" PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.8c0bdb303f25d82c2a42fb8bfca449bfaca00260" /> <MonoDevelop.Ide.ItemProperties.ShardLib PreferredExecutionTarget="Android.M7BBB18B19152766" /> - <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/Room/RoomManagement.cs"> + <MonoDevelop.Ide.Workbench ActiveDocument="Shared/Phone/Device/CommonForm/SceneCategoryView.cs"> <Files> <File FileName="Shared/R.cs" Line="1364" Column="1" /> <File FileName="GateWay.Droid/Assets/Language.ini" /> - <File FileName="Shared/Phone/Device/Category/SelectFloor.cs" /> - <File FileName="Shared/Phone/Device/Category/SelectHouse.cs" /> + <File FileName="Shared/Phone/Device/CommonForm/SelectedStatuButton.cs" /> + <File FileName="Shared/Phone/Device/CommonForm/CategoryFunctionForWinRow.cs" /> <File FileName="Shared/Phone/Device/Room/UnallocatedRoom.cs" /> - <File FileName="Shared/Phone/Device/Room/RoomManagement.cs" Line="155" Column="19" /> - <File FileName="Shared/Common/Room.cs" Line="1" Column="1" /> + <File FileName="Shared/Common/Room.cs" Line="1414" Column="51" /> + <File FileName="Shared/Phone/Device/Room/RoomManagement.cs" /> + <File FileName="Shared/Common/House.cs" /> + <File FileName="Shared/Phone/ZigBee/Device/Scene.cs" /> + <File FileName="Shared/Phone/Device/Category/Category.cs" Line="1" Column="1" /> + <File FileName="Shared/Phone/Device/CommonForm/SceneCategoryView.cs" Line="190" Column="22" /> </Files> <Pads> <Pad Id="ProjectPad"> @@ -18,23 +22,23 @@ <Node name="GateWay" expanded="True"> <Node name="GateWay.Droid" expanded="True"> <Node name="Assets" expanded="True"> - <Node name="Phone" expanded="True"> - <Node name="Floor" expanded="True" /> - </Node> + <Node name="Phone" expanded="True" /> </Node> </Node> <Node name="Shared" expanded="True"> <Node name="Common" expanded="True" /> <Node name="Phone" expanded="True"> <Node name="Device" expanded="True"> - <Node name="AC" expanded="True" /> <Node name="Category" expanded="True" /> - <Node name="CommonForm" expanded="True" /> - <Node name="Room" expanded="True"> - <Node name="RoomManagement.cs" selected="True" /> + <Node name="CommonForm" expanded="True"> + <Node name="SceneCategoryView.cs" selected="True" /> </Node> + <Node name="Room" expanded="True" /> </Node> <Node name="UserView" expanded="True" /> + <Node name="ZigBee" expanded="True"> + <Node name="Device" expanded="True" /> + </Node> </Node> </Node> </Node> diff --git a/ZigbeeApp/Shared/Common/Room.cs b/ZigbeeApp/Shared/Common/Room.cs index d324988..e5c8d07 100644 --- a/ZigbeeApp/Shared/Common/Room.cs +++ b/ZigbeeApp/Shared/Common/Room.cs @@ -448,6 +448,7 @@ } Save(); HdlAutoBackupLogic.AddOrEditorFile(room.FileName); + CurrentRoom.RefreshRoomListView(); return true; } @@ -701,6 +702,10 @@ { foreach (var r in Lists) { + if(r.IsLove) + { + continue; + } foreach (var scene in r.SceneUIList) { if (scene.Id == sceneId) @@ -1114,14 +1119,10 @@ List<DeviceUI> deviceUIs = new List<DeviceUI> { }; var dList = AllRoomDeviceUIList; var commonDeviceList = Common.LocalDevice.Current.listAllDevice; - - if (dList.Count == 0) - { - return null; - } + foreach (var device in commonDeviceList) { - if (dList.Find((obj) => obj.CommonDevice == device) == null) + if (dList.Find((obj) => obj.CommonDevice.DeviceEpoint == device.DeviceEpoint && obj.CommonDevice.DeviceAddr == device.DeviceAddr) == null) { deviceUIs.Add(Common.LocalDevice.Current.GetDeviceUI(device)); } @@ -1435,6 +1436,10 @@ { foreach (var r in Lists) { + if (r.IsLove) + { + continue; + } foreach (var sceneUI in r.SceneUIList) { if (sceneUI.Id == sceneId) @@ -1538,51 +1543,45 @@ /// </summary> public async System.Threading.Tasks.Task<bool> RefreshSceneUIList() { - return false; - //System.Console.WriteLine($"寮�濮嬭姹傜綉鍏冲満鏅�****{DateTime.Now.ToString("yyMMdd hhmmss fff")}*****"); - //bool result = true; - //var sceneList = await ZigBee.Device.Scene.GetSceneListAsync(); - //System.Console.WriteLine($"缁撴潫璇锋眰缃戝叧鍦烘櫙****{DateTime.Now.ToString("yyMMdd hhmmss fff")}*****"); - //if (sceneList == null) - //{ - // return false; - //} - //List<int> sceneIDList = new List<int> { }; - //System.Console.WriteLine($"寮�濮嬫湰鍦板満鏅�****{DateTime.Now.ToString("yyMMdd hhmmss fff")}*****"); - //foreach (var scene in sceneList) - //{ - // if (scene == null) - // { - // continue; - // } - // sceneIDList.Add(scene.ScenesId); - //} - //foreach(var r in Lists) - //{ - // if(r.SceneUIList==null || r.SceneUIList.Count==0) - // { - // continue; - // } - // foreach(var rScene in r.SceneUIList) - // { - // if(rScene==null) - // { - // continue; - // } - // //var scene = sceneList.Find((obj) => rScene.ScenesId == obj.ScenesId); - // if(sceneIDList.Contains(rScene.ScenesId)==false) - // { - // var removeResult = r.SceneUIList.Remove(rScene); - // r.Save(); - // if (removeResult == false) - // { - // result = false; - // } - // } - // } - //} - //System.Console.WriteLine($"缁撴潫鏈湴鍦烘櫙****{DateTime.Now.ToString("yyMMdd hhmmss fff")}*****"); - //return result; + bool result = true; + var sceneList = await ZigBee.Device.Scene.GetSceneListAsync(); + if (sceneList == null) + { + return false; + } + List<int> sceneIDList = new List<int> { }; + foreach (var scene in sceneList) + { + if (scene == null) + { + continue; + } + sceneIDList.Add(scene.ScenesId); + } + foreach (var r in Lists) + { + if(r.IsLove) + { + continue; + } + if (r.SceneUIList == null || r.SceneUIList.Count == 0) + { + continue; + } + foreach (var rScene in r.SceneUIList) + { + if (rScene == null) + { + continue; + } + if (sceneIDList.Contains(rScene.Id) == false) + { + r.RemoveScene(rScene); + result = true; + } + } + } + return result; } #endregion diff --git a/ZigbeeApp/Shared/Phone/Device/Room/RoomManagement.cs b/ZigbeeApp/Shared/Phone/Device/Room/RoomManagement.cs index 6005e89..3fa6ec0 100644 --- a/ZigbeeApp/Shared/Phone/Device/Room/RoomManagement.cs +++ b/ZigbeeApp/Shared/Phone/Device/Room/RoomManagement.cs @@ -84,14 +84,14 @@ floorBtn = new Button() { - X = Application.GetRealWidth(750), - Width = Application.GetRealWidth(200), + X = Application.GetRealWidth(650), + Width = Application.GetRealWidth(300), Height = Application.GetRealHeight(60), Gravity = Gravity.CenterVertical, TextAlignment = TextAlignment.CenterRight, TextColor = ZigbeeColor.Current.GXCTextBlackColor, - TextSize=14, - IsBold=true + TextSize = 14, + IsBold = true }; var selectFloorBtn = new Button() @@ -149,7 +149,7 @@ try { - if (Common.Room.Lists.Count == 1) + if (Common.Room.Lists.Count <= 1) { return; } -- Gitblit v1.8.0