From 48ba446936b51fffafa7c3600c0dadc6ac0e8c20 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期五, 10 七月 2020 10:52:13 +0800 Subject: [PATCH] 2020-07-10-01 --- ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetAddMenuForm.cs | 71 +++++++++++------------------------ 1 files changed, 22 insertions(+), 49 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetAddMenuForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetAddMenuForm.cs index 3a1f691..4ed7043 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetAddMenuForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetAddMenuForm.cs @@ -93,7 +93,7 @@ var listRoom = new List<Common.Room>(); foreach (string roomId in this.dicAllData.Keys) { - listRoom.Add(Common.Room.CurrentRoom.GetRoomById(roomId)); + listRoom.Add(HdlRoomLogic.Current.GetRoomById(roomId)); } //鍒濆鍖栨埧闂磋彍鍗曟帶浠� @@ -129,7 +129,7 @@ private void InitTopRightMenuControl() { //鑾峰彇妤煎眰 - var dicFloor = Common.Room.CurrentRoom.GetFloorSortList(); + var dicFloor = HdlRoomLogic.Current.GetFloorSortList(); if (dicFloor.Count == 0) { return; @@ -143,6 +143,7 @@ btnFloor.Gravity = Gravity.CenterVertical; btnFloor.X = btnIconContr.X + btnIconContr.btnIcon.X - Application.GetRealWidth(300); btnFloor.TextAlignment = TextAlignment.CenterRight; + btnFloor.IsBold = true; topFrameLayout.AddChidren(btnFloor); foreach (var floorId in dicFloor.Keys) @@ -156,10 +157,10 @@ btnIconContr.ButtonClickEvent += (sender, e) => { //妤煎眰鑿滃崟 - var contr = new TopRightMenuControl(dicFloor.Count, 449, Language.StringByID(R.MyInternationalizationString.SelectFloor)); + var contr = new TopRightFloorMenuControl(dicFloor.Count, 2, Language.StringByID(R.MyInternationalizationString.SelectFloor)); foreach (var floorId in dicFloor.Keys) { - contr.AddRowMenu(dicFloor[floorId], "Floor/Floor.png", "Floor/FloorSelected.png", () => + contr.AddRowMenu(floorId, () => { //璁板綍璧烽�夋嫨鐨処D this.nowSelectFloorId = floorId; @@ -242,7 +243,7 @@ var dicData = new Dictionary<string, Dictionary<int, uRowInformation>>(); //鑾峰彇鏈湴瀹夐槻鐨勫満鏅� Dictionary<int, string> dicScene = HdlSafeguardLogic.Current.GetLocalSceneByZoneID(this.zoonID); - var listRoom = Common.Room.CurrentRoom.GetFloorSortRoom(this.nowSelectFloorId); + var listRoom = HdlRoomLogic.Current.GetFloorSortRoom(this.nowSelectFloorId); for (int i = 0; i < listRoom.Count; i++) { @@ -271,9 +272,9 @@ } var dicRoomData = new Dictionary<int, uRowInformation>(); - for (int j = 0; j < i_room.DeviceUIList.Count; j++) + for (int j = 0; j < i_room.ListDevice.Count; j++) { - var device = i_room.DeviceUIList[j].CommonDevice; + var device = Common.LocalDevice.Current.GetDevice(i_room.ListDevice[j]); //濡傛灉閭d釜璁惧宸茬粡娣诲姞浜嗭紝鍒欎笉鍐嶆樉绀� if (device == null || HdlSafeguardLogic.Current.IsAlarmDeviceExist(this.zoonID, device) == true) { @@ -288,54 +289,26 @@ string unSelectPath = string.Empty; string selectPath = string.Empty; - var typeInfo = Common.LocalDevice.Current.GetNotHdlMyDeviceEnumInfo(new List<CommonDevice>() { device }); - if (device.Type == DeviceType.OnOffOutput) + var typeInfo = Common.LocalDevice.Current.GetDeviceBelongEnumInfo(device); + //鑾峰彇鍥剧墖 + Common.LocalDevice.Current.GetDeviceFunctionTypeMenuIcon(typeInfo.ConcreteType, ref unSelectPath, ref selectPath); + if (dicRoomData.ContainsKey(typeInfo.BeloneTextId) == false) { - //缁х數鍣ㄧ殑鏃跺��,闇�瑕佺壒娈婂鐞� - if (device.DfunctionType == DeviceFunctionType.A寮�鍏�) - { - typeInfo.BeloneTextId = R.MyInternationalizationString.uSwitch; - unSelectPath = "Device/Switch.png"; - } - else if (device.DfunctionType == DeviceFunctionType.A鎻掑骇) - { - typeInfo.BeloneTextId = R.MyInternationalizationString.uSocket1; - unSelectPath = "Device/Socket1.png"; - } - else if (device.DfunctionType == DeviceFunctionType.A鐏厜) - { - typeInfo.BeloneTextId = R.MyInternationalizationString.uLight; - unSelectPath = "Device/Light.png"; - } - else - { - //缁х數鍣� - typeInfo.BeloneTextId = R.MyInternationalizationString.uDeviceBelongId2300; - unSelectPath = "Device/Relay.png"; - } - if (dicRoomData.ContainsKey(typeInfo.BeloneTextId) == false) - { - dicRoomData[typeInfo.BeloneTextId] = new uRowInformation(); - dicRoomData[typeInfo.BeloneTextId].IconPath = unSelectPath; - } - } - else - { - //鑾峰彇鍥剧墖 - Common.LocalDevice.Current.GetDeviceBeloneIcon(typeInfo.ConcreteType, ref unSelectPath, ref selectPath); - if (dicRoomData.ContainsKey(typeInfo.BeloneTextId) == false) - { - dicRoomData[typeInfo.BeloneTextId] = new uRowInformation(); - dicRoomData[typeInfo.BeloneTextId].IconPath = unSelectPath; - } + dicRoomData[typeInfo.BeloneTextId] = new uRowInformation(); + dicRoomData[typeInfo.BeloneTextId].IconPath = unSelectPath; } dicRoomData[typeInfo.BeloneTextId].listDevice.Add(device); } } - for (int j = 0; j < i_room.SceneUIList.Count; j++) + for (int j = 0; j < i_room.ListSceneId.Count; j++) { //濡傛灉閭d釜鍦烘櫙宸茬粡娣诲姞浜嗭紝鍒欎笉鍐嶆樉绀� - if (dicScene.ContainsKey(i_room.SceneUIList[j].Id) == true) + if (dicScene.ContainsKey(i_room.ListSceneId[j]) == true) + { + continue; + } + var sceneUi = HdlSceneLogic.Current.GetSceneUIBySceneId(i_room.ListSceneId[j]); + if (sceneUi == null) { continue; } @@ -345,7 +318,7 @@ dicRoomData[R.MyInternationalizationString.uScence].IconPath = "Scene/SceneIcon.png"; dicRoomData[R.MyInternationalizationString.uScence].listScene = new List<Common.SceneUI>(); } - dicRoomData[R.MyInternationalizationString.uScence].listScene.Add(i_room.SceneUIList[j]); + dicRoomData[R.MyInternationalizationString.uScence].listScene.Add(sceneUi); } return dicRoomData; } -- Gitblit v1.8.0