From fdc47d950498e088260a3b04028703adc0f878e0 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期一, 30 三月 2020 10:54:27 +0800
Subject: [PATCH] 2020-03-30-1
---
ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetAddMenuForm.cs | 68 ++++++++++------------------------
1 files changed, 20 insertions(+), 48 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetAddMenuForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetAddMenuForm.cs
index 3a1f691..f600532 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;
@@ -156,7 +156,7 @@
btnIconContr.ButtonClickEvent += (sender, e) =>
{
//妤煎眰鑿滃崟
- var contr = new TopRightMenuControl(dicFloor.Count, 449, Language.StringByID(R.MyInternationalizationString.SelectFloor));
+ var contr = new TopRightMenuControl(dicFloor.Count, 2, Language.StringByID(R.MyInternationalizationString.SelectFloor));
foreach (var floorId in dicFloor.Keys)
{
contr.AddRowMenu(dicFloor[floorId], "Floor/Floor.png", "Floor/FloorSelected.png", () =>
@@ -242,7 +242,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 +271,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 +288,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.GetDeviceObjectIcon(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 +317,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