From 2450c12c825ad4d78d1572da2fa421706db2df2f Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 18 六月 2020 16:01:14 +0800
Subject: [PATCH] 新代码
---
ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs | 39 ++++++++++++++++++++++++++-------------
1 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs
index 2f0cac5..dc07bcb 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/LookRoomSettionForm.cs
@@ -68,7 +68,7 @@
bodyFrameLayout.AddChidren(tabControl);
tabControl.SelectTabEvent += (tabIndex) =>
{
- if (tabIndex == 1)
+ if (tabIndex == 0)
{
//鏄剧ず鍦烘櫙鍒楄〃
this.ShowSceneList();
@@ -79,7 +79,11 @@
this.ShowFunctionList();
}
};
- tabControl.InitControl();
+ var listTitle = new List<string>();
+ //鍦烘櫙,鍔熻兘
+ listTitle.Add(Language.StringByID(R.MyInternationalizationString.uScence));
+ listTitle.Add(Language.StringByID(R.MyInternationalizationString.uFunction));
+ tabControl.InitControl(listTitle);
}
#endregion
@@ -95,7 +99,7 @@
this.frameTable.RemoveAll();
HdlThreadLogic.Current.RunMainInThread(() =>
{
- if (lookRoom.SceneUIList.Count == 0)
+ if (lookRoom.ListSceneId.Count == 0)
{
//杩樻病鏈夋坊鍔犲満鏅摝
this.ShowNotDataImage(frameTable, Language.StringByID(R.MyInternationalizationString.uDoNotHadAddScenceMsg));
@@ -105,11 +109,16 @@
listView.Height = frameTable.Height;
frameTable.AddChidren(listView);
- foreach (var data in lookRoom.SceneUIList)
+ foreach (var dataId in lookRoom.ListSceneId)
{
+ var data = HdlSceneLogic.Current.GetSceneUIBySceneId(dataId);
+ if (data == null)
+ {
+ continue;
+ }
//鍦烘櫙鎺т欢
var frameContr = new ScenePictrueControl();
- listView.AddChidrenFrame(frameContr);
+ listView.AddChidren(frameContr);
frameContr.InitControl(data);
}
});
@@ -170,8 +179,12 @@
}
}
listView.AdjustRealHeight(Application.GetRealHeight(23));
- //寮�鍚澶囧湪绾跨洃娴�
- this.StartCheckDeviceOnline(listView, listGwId, dicData);
+ //濡傛灉涓嶆槸铏氭嫙浣忓畢
+ if (Common.Config.Instance.Home.IsVirtually == false)
+ {
+ //寮�鍚澶囧湪绾跨洃娴�
+ this.StartCheckDeviceOnline(listView, listGwId, dicData);
+ }
});
}
@@ -223,7 +236,7 @@
private Dictionary<int, DeviceRowInfo> GetAllGroupDevice()
{
//鍏ㄩ儴鐨勮澶�
- var listDevice = lookRoom.GetRoomListDevice();
+ var listDevice = HdlRoomLogic.Current.GetRoomListDevice(lookRoom);
var dic = new Dictionary<int, DeviceRowInfo>();
foreach (var device in listDevice)
{
@@ -235,7 +248,7 @@
string path1 = string.Empty;
string path2 = string.Empty;
//鑾峰彇鍥剧墖
- Common.LocalDevice.Current.GetDeviceObjectIcon(typeInfo.ConcreteType, ref path1, ref path2);
+ Common.LocalDevice.Current.GetDeviceFunctionTypeMenuIcon(typeInfo.ConcreteType, ref path1, ref path2);
dic[typeInfo.BeloneTextId].IconPath = path1;
}
dic[typeInfo.BeloneTextId].listDeviceKeys.Add(Common.LocalDevice.Current.GetDeviceMainKeys(device));
@@ -274,7 +287,7 @@
{
for (int j = 0; j < list.Count; j++)
{
- string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(list[i]);
+ string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(list[j]);
if (listView.Parent == null || dicData.ContainsKey(mainkeys) == false || listCheck.Contains(mainkeys) == true)
{
return;
@@ -282,13 +295,13 @@
listCheck.Add(mainkeys);
var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys);
- if (localDevice != null && localDevice.IsOnline != list[i].IsOnline)
+ if (localDevice != null && localDevice.IsOnline != list[j].IsOnline)
{
//鍦ㄧ嚎鐘舵�佷竴鏍风殑璇濓紝涓嶉渶瑕佸埛鏂�
- localDevice.IsOnline = list[i].IsOnline;
+ localDevice.IsOnline = list[j].IsOnline;
localDevice.ReSave();
}
- if (list[i].IsOnline == 1)
+ if (Common.LocalDevice.Current.CheckDeviceIsOnline(list[j]) == true)
{
dicData[mainkeys].OnlineCount += 1;
dicData[mainkeys].btnOnline.Text = dicData[mainkeys].OnlineCount + "/" + dicData[mainkeys].listDeviceKeys.Count;
--
Gitblit v1.8.0