From 4a9318077bd095fbc7c57c593e5ca8185603dac4 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期六, 19 十二月 2020 18:35:31 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev-tzy' into NewFilePath
---
HDL-ON_Android/HDL-ON_Android.csproj | 10
HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs | 8
HDL-ON_iOS/Resources/Phone/Public/PopupDialog.png | 0
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs | 181 ++-------------
HDL_ON/UI/UI2/2-Classification/FunctionPage.cs | 150 -----------
HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs | 49 +++
HDL-ON_iOS/HDL-ON_iOS.csproj | 8
HDL-ON_Android/Assets/Phone/Public/PopupDialog.png | 0
HDL_ON/Common/Utlis/FloorRoomSelectPopupView.cs | 305 +++++++++++++++++++++++++
HDL_ON/HDL_ON.projitems | 3
10 files changed, 407 insertions(+), 307 deletions(-)
diff --git a/HDL-ON_Android/Assets/Phone/Public/PopupDialog.png b/HDL-ON_Android/Assets/Phone/Public/PopupDialog.png
old mode 100644
new mode 100755
Binary files differ
diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj
index 5ba138a..366fa8d 100644
--- a/HDL-ON_Android/HDL-ON_Android.csproj
+++ b/HDL-ON_Android/HDL-ON_Android.csproj
@@ -654,6 +654,16 @@
<AndroidAsset Include="Assets\Phone\FunctionIcon\Light\ColorWheelTip.png" />
<AndroidAsset Include="Assets\Phone\LogicIcon\time.png" />
<AndroidAsset Include="Assets\Phone\Public\ClearIcon.png" />
+ <AndroidAsset Include="Assets\Phone\ErrorIcon.png" />
+ <AndroidAsset Include="Assets\Phone\oRobot.png" />
+ <AndroidAsset Include="Assets\Phone\RoomListBg.png" />
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\ColorTemperatrueQuick.png" />
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\ColorTemperatrueQuickBack.png" />
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\ColorTemperatureBar.png" />
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\CozyIcon.png" />
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\MeetingGuestsIcon.png" />
+ <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\ReadIcon.png" />
+ <AndroidAsset Include="Assets\Phone\Public\PopupDialog.png" />
</ItemGroup>
<ItemGroup>
<AndroidNativeLibrary Include="libs\armeabi-v7a\libelianjni.so" />
diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj
index ff0a671..849af29 100644
--- a/HDL-ON_iOS/HDL-ON_iOS.csproj
+++ b/HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -630,6 +630,14 @@
<BundleResource Include="Resources\Phone\PersonalCenter\AppUnlockSetting\FingerIconBlue.png" />
<BundleResource Include="Resources\Phone\Public\ClearIcon.png" />
<BundleResource Include="Resources\Phone\LogicIcon\time.png" />
+ <BundleResource Include="Resources\Phone\ErrorIcon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\Light\ColorTemperatrueQuick.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\Light\ColorTemperatrueQuickBack.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\Light\ColorTemperatureBar.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\Light\CozyIcon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\Light\MeetingGuestsIcon.png" />
+ <BundleResource Include="Resources\Phone\FunctionIcon\Light\ReadIcon.png" />
+ <BundleResource Include="Resources\Phone\Public\PopupDialog.png" />
</ItemGroup>
<ItemGroup>
<ITunesArtwork Include="iTunesArtwork" />
diff --git a/HDL-ON_iOS/Resources/Phone/Public/PopupDialog.png b/HDL-ON_iOS/Resources/Phone/Public/PopupDialog.png
old mode 100644
new mode 100755
Binary files differ
diff --git a/HDL_ON/Common/Utlis/FloorRoomSelectPopupView.cs b/HDL_ON/Common/Utlis/FloorRoomSelectPopupView.cs
new file mode 100755
index 0000000..e0f3720
--- /dev/null
+++ b/HDL_ON/Common/Utlis/FloorRoomSelectPopupView.cs
@@ -0,0 +1,305 @@
+锘縰sing HDL_ON.Entity;
+using Shared;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace HDL_ON
+{
+ /// <summary>
+ /// 妤煎眰鍙婃埧闂寸殑閫夋嫨鐣岄潰
+ /// </summary>
+ public class FloorRoomSelectPopupView
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 褰撳墠閫夋嫨鏄剧ず鐨刄ID(妤煎眰,鎴栬�呮埧闂�,鎴栬�呭叏閮�)
+ /// </summary>
+ private string nowShowSelectId = DiySelectPopupDialog.ALLSELECT;
+ /// <summary>
+ /// 鍏ㄩ儴鐨勫姛鑳�(璁惧鏄剧ず鍒嗘敮浣跨敤)
+ /// </summary>
+ private List<Function> listAllFun = null;
+
+ #endregion
+
+ #region 鈻� 鍦烘櫙鏄剧ず___________________________
+
+ /// <summary>
+ /// 鏄剧ず閫夋嫨鍦烘櫙鐨勭晫闈�
+ /// </summary>
+ /// <param name="btnFloor">妤煎眰鍚嶅瓧鏄剧ず鐨勬帶浠�,閫夋嫨鍚�,鍐呴儴浼氳嚜鍔ㄥ彉鏇存樉绀烘枃瀛�,鍙互璁剧疆涓簄ull</param>
+ /// <param name="SelectEvent">鏍规嵁閫夋嫨鐨勬潯浠�,绛涢�変箣鍚庣殑鍦烘櫙鍒楄〃(绗竴涓弬鏁版槸閫夋嫨鐨刄ID,涓嶇鏈夋病鏈夌敤,鎬讳箣鍏堣繑鍥�)</param>
+ /// <param name="i_defultSelectId">榛樿鍝釜涓洪�夋嫨鐘舵��</param>
+ public void ShowSceneView(Button btnFloor, Action<string, List<Scene>> SelectEvent, string i_defultSelectId = null)
+ {
+ //娓呯紦瀛�
+ this.ClearMemory();
+
+ if (string.IsNullOrEmpty(i_defultSelectId) == true)
+ {
+ i_defultSelectId = DiySelectPopupDialog.ALLSELECT;
+ }
+
+ //杩斿洖鐨刬d鏄疷ID
+ new FloorSelectPopupDialog().ShowView((selectValue) =>
+ {
+ this.nowShowSelectId = selectValue;
+ //鍒锋柊妤煎眰鐨勬樉绀哄悕瀛�
+ this.RefreshFloorShowName(btnFloor);
+
+ //鑾峰彇鍙互鏄剧ず鐨勫満鏅垪琛�
+ var listScene = this.GetCanShowListScene();
+ SelectEvent?.Invoke(this.nowShowSelectId, listScene);
+ SelectEvent = null;
+
+ }, i_defultSelectId);
+ }
+
+ /// <summary>
+ /// 鑾峰彇鑳藉鏄剧ず鐨勫満鏅�
+ /// </summary>
+ /// <returns></returns>
+ public List<Scene> GetCanShowListScene()
+ {
+ var listScene = new List<Scene>();
+
+ //鍏堢湅鐪嬪綋鍓嶉�夋嫨鐨勬樉绀虹被鍨� 1:鍏ㄩ儴 2:妤煎眰 3:鎴块棿
+ var selectType = this.CheckSelectFloorIdType();
+ if (selectType == 1)
+ {
+ return FunctionList.List.scenes;
+ }
+
+ //鎴块棿鐨刄ID (key:uid value:roomId)
+ var dicRoomUid = new Dictionary<string, string>();
+ foreach (var roomInfo in SpatialInfo.CurrentSpatial.RoomList)
+ {
+ dicRoomUid[roomInfo.uid] = roomInfo.roomId;
+ }
+ //鎴块棿
+ if (selectType == 3)
+ {
+ //鐢║ID杞崲涓簉oomId
+ string roomId = dicRoomUid.ContainsKey(this.nowShowSelectId) == true ? dicRoomUid[this.nowShowSelectId] : string.Empty;
+ foreach (var scene in FunctionList.List.scenes)
+ {
+ //鍒ゆ柇杩欎釜鍦烘櫙鏄惁鏄繖涓埧闂寸殑
+ if (scene.roomIds.Contains(roomId) == true)
+ {
+ listScene.Add(scene);
+ }
+ }
+ }
+ //妤煎眰
+ else if (selectType == 2)
+ {
+ //鑾峰彇杩欎釜妤煎眰涓嬮潰鐨勫叏閮ㄦ埧闂碔D
+ var listRoomId = new List<string>();
+ foreach (var roomInfo in SpatialInfo.CurrentSpatial.RoomList)
+ {
+ //鍒ゆ柇鏄笉鏄繖涓ゼ灞傜殑
+ if (roomInfo.parentId == this.nowShowSelectId)
+ {
+ listRoomId.Add(roomInfo.roomId);
+ }
+ }
+ foreach (var scene in FunctionList.List.scenes)
+ {
+ //鍒ゆ柇杩欎釜鍦烘櫙鏄惁鏄繖涓埧闂寸殑
+ foreach (var roomid in listRoomId)
+ {
+ if (scene.roomIds.Contains(roomid) == true)
+ {
+ listScene.Add(scene);
+ }
+ }
+ }
+ }
+ return listScene;
+ }
+
+ #endregion
+
+ #region 鈻� 璁惧鏄剧ず___________________________
+
+ /// <summary>
+ /// 鏄剧ず閫夋嫨鍦烘櫙鐨勭晫闈�
+ /// </summary>
+ /// <param name="btnFloor">妤煎眰鍚嶅瓧鏄剧ず鐨勬帶浠�,閫夋嫨鍚�,鍐呴儴浼氳嚜鍔ㄥ彉鏇存樉绀烘枃瀛�,鍙互璁剧疆涓簄ull</param>
+ /// <param name="i_listAllFun">鍏ㄩ儴鐨勮澶囧垪琛�,闇�瑕佹墜鍔ㄦ寚瀹�</param>
+ /// <param name="SelectEvent">鏍规嵁閫夋嫨鐨勬潯浠�,绛涢�変箣鍚庣殑璁惧鍒楄〃(绗竴涓弬鏁版槸閫夋嫨鐨刄ID,涓嶇鏈夋病鏈夌敤,鎬讳箣鍏堣繑鍥�)</param>
+ /// <param name="i_defultSelectId">榛樿鍝釜涓洪�夋嫨鐘舵��</param>
+ public void ShowDeviceFunctionView(Button btnFloor, List<Function> i_listAllFun, Action<string, List<Function>> SelectEvent, string i_defultSelectId = null)
+ {
+ //娓呯紦瀛�
+ this.ClearMemory();
+ this.listAllFun = new List<Function>();
+ this.listAllFun.AddRange(i_listAllFun);
+
+ if (string.IsNullOrEmpty(i_defultSelectId) == true)
+ {
+ i_defultSelectId = DiySelectPopupDialog.ALLSELECT;
+ }
+
+ //杩斿洖鐨刬d鏄疷ID
+ new FloorSelectPopupDialog().ShowView((selectValue) =>
+ {
+ this.nowShowSelectId = selectValue;
+ //鍒锋柊妤煎眰鐨勬樉绀哄悕瀛�
+ this.RefreshFloorShowName(btnFloor);
+
+ //鑾峰彇鍙互鏄剧ず鐨勮澶囧垪琛�
+ var listDevice = this.GetCanShowListDevice();
+ SelectEvent?.Invoke(this.nowShowSelectId, listDevice);
+ SelectEvent = null;
+
+ }, i_defultSelectId);
+ }
+
+ /// <summary>
+ /// 鑾峰彇鑳藉鏄剧ず鐨勮澶�
+ /// </summary>
+ /// <returns></returns>
+ public List<Function> GetCanShowListDevice()
+ {
+ var listFunction = new List<Function>();
+
+ //鍏堢湅鐪嬪綋鍓嶉�夋嫨鐨勬樉绀虹被鍨� 1:鍏ㄩ儴 2:妤煎眰 3:鎴块棿
+ var selectType = this.CheckSelectFloorIdType();
+ if (selectType == 1)
+ {
+ return this.listAllFun;
+ }
+
+ //鎴块棿鐨刄ID (key:uid value:roomId)
+ var dicRoomUid = new Dictionary<string, string>();
+ foreach (var roomInfo in SpatialInfo.CurrentSpatial.RoomList)
+ {
+ dicRoomUid[roomInfo.uid] = roomInfo.roomId;
+ }
+ //鎴块棿
+ if (selectType == 3)
+ {
+ //鐢║ID杞崲涓簉oomId
+ string roomId = dicRoomUid.ContainsKey(this.nowShowSelectId) == true ? dicRoomUid[this.nowShowSelectId] : string.Empty;
+ foreach (var func in this.listAllFun)
+ {
+ //鍒ゆ柇杩欎釜鍦烘櫙鏄惁鏄繖涓埧闂寸殑
+ if (func.roomIds.Contains(roomId) == true)
+ {
+ listFunction.Add(func);
+ }
+ }
+ }
+ //妤煎眰
+ else if (selectType == 2)
+ {
+ //鑾峰彇杩欎釜妤煎眰涓嬮潰鐨勫叏閮ㄦ埧闂碔D
+ var listRoomId = new List<string>();
+ foreach (var roomInfo in SpatialInfo.CurrentSpatial.RoomList)
+ {
+ //鍒ゆ柇鏄笉鏄繖涓ゼ灞傜殑
+ if (roomInfo.parentId == this.nowShowSelectId)
+ {
+ listRoomId.Add(roomInfo.roomId);
+ }
+ }
+ foreach (var func in this.listAllFun)
+ {
+ //鍒ゆ柇杩欎釜鍦烘櫙鏄惁鏄繖涓埧闂寸殑
+ foreach (var roomid in listRoomId)
+ {
+ if (func.roomIds.Contains(roomid) == true)
+ {
+ listFunction.Add(func);
+ }
+ }
+ }
+ }
+ return listFunction;
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 鍒锋柊妤煎眰鐨勬樉绀哄悕瀛�
+ /// </summary>
+ /// <param name="btnFloorName"></param>
+ private void RefreshFloorShowName(Button btnFloorName)
+ {
+ if (btnFloorName == null)
+ {
+ return;
+ }
+ //鍏堢湅鐪嬪綋鍓嶉�夋嫨鐨勬樉绀虹被鍨� 1:鍏ㄩ儴 2:妤煎眰 3:鎴块棿
+ var selectType = this.CheckSelectFloorIdType();
+ if (selectType == 1)
+ {
+ //鍏ㄩ儴
+ btnFloorName.Text = Language.StringByID(StringId.All);
+ }
+ //鎴块棿
+ else if (selectType == 3)
+ {
+ foreach (var roomInfo in SpatialInfo.CurrentSpatial.RoomList)
+ {
+ if (roomInfo.uid == this.nowShowSelectId)
+ {
+ btnFloorName.Text = roomInfo.floorName + roomInfo.roomName;
+ return;
+ }
+ }
+ }
+ //妤煎眰
+ else if (selectType == 2)
+ {
+ foreach (var floorInfo in SpatialInfo.CurrentSpatial.FloorList)
+ {
+ if (floorInfo.uid == this.nowShowSelectId)
+ {
+ btnFloorName.Text = floorInfo.roomName;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// 鍒ゆ柇褰撳墠鎵�閫夌殑ID鐨勭被鍨� 1:鍏ㄩ儴 2:妤煎眰 3:鎴块棿
+ /// </summary>
+ /// <returns></returns>
+ private int CheckSelectFloorIdType()
+ {
+ if (this.nowShowSelectId == DiySelectPopupDialog.ALLSELECT)
+ {
+ //鍏ㄩ儴
+ return 1;
+ }
+ foreach (var floorInfo in SpatialInfo.CurrentSpatial.FloorList)
+ {
+ if (floorInfo.uid == this.nowShowSelectId)
+ {
+ //褰撳墠閫夋嫨鐨勬槸妤煎眰ID
+ return 2;
+ }
+ }
+ //涓嶅嚭鎰忓,搴旇鏄埧闂翠簡
+ return 3;
+ }
+
+ /// <summary>
+ /// 娓呴櫎缂撳瓨
+ /// </summary>
+ public void ClearMemory()
+ {
+ //鍒濆鍊�
+ this.nowShowSelectId = DiySelectPopupDialog.ALLSELECT;
+ this.listAllFun = null;
+ }
+
+ #endregion
+ }
+}
diff --git a/HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs b/HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs
index 19708a4..58130ee 100644
--- a/HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs
+++ b/HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs
@@ -40,7 +40,7 @@
mFirstList.Clear();
foreach (var room in roomList)
{
- mFirstList.Add(new RoomCellInfo() { Title = room.roomName, TagId = room.roomId });
+ mFirstList.Add(new RoomCellInfo() { Title = room.roomName, TagId = room.uid });
}
var roomSelectPopupDialog = new DiySelectPopupDialog();
roomSelectPopupDialog.ShowView(mFirstList, null, selectAction, selectTag);
@@ -52,12 +52,12 @@
//涓�绾ф暟缁勪负妤煎眰
foreach (var floor in floorList)
{
- mFirstList.Add(new RoomCellInfo() { Title = floor.roomName, TagId = floor.roomId });
+ mFirstList.Add(new RoomCellInfo() { Title = floor.roomName, TagId = floor.uid });
var mList = new List<RoomCellInfo>();
- var allRoom = roomList.FindAll((room) => room.parentId == floor.roomId);
+ var allRoom = roomList.FindAll((room) => room.parentId == floor.uid);
foreach (var mRoom in allRoom)
{
- mList.Add(new RoomCellInfo() { Title = mRoom.roomName, TagId = mRoom.roomId });
+ mList.Add(new RoomCellInfo() { Title = mRoom.roomName, TagId = mRoom.uid });
}
if(mList == null)
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index 775ff70..6a8815a 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -265,6 +265,9 @@
<Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\Widget\DiySelectPopupDialog.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Light\ColorTureLampPage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Light\ColorTureLampPageBLL.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Common\Utlis\FloorRoomSelectPopupView.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)Common\Utlis\FloorSelectPopupDialog.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\Widget\DiySelectPopupDialog.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)UI\" />
diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
index cac5d2c..c140558 100755
--- a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
@@ -163,146 +163,18 @@
/// </summary>
void LoadDialog_ChangeFloor()
{
- EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
- {
- var dialog = new Dialog();
- var dialogBody = new FrameLayout();
- dialog.AddChidren(dialogBody);
- dialogBody.MouseUpEventHandler += (sender1, e1) =>
- {
- dialog.Close();
- };
-
- var dispalyView = new FrameLayout()
- {
- X = Application.GetRealWidth(10),
- Y = Application.GetRealHeight(100),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(110),
- BackgroundImagePath = "PersonalCenter/HomeList1bg.png",
- };
- dialogBody.AddChidren(dispalyView);
-
- var contentView = new VerticalScrolViewLayout()
- {
- X = Application.GetRealWidth(8),
- Y = Application.GetRealHeight(15),
- Width = Application.GetRealWidth(150),
- Height = Application.GetRealHeight(45 * 2),
- ScrollEnabled = false
- };
- dispalyView.AddChidren(contentView);
-
- if (SpatialInfo.CurrentSpatial.RoomList.Count < 2)
- {
- }
- else if (SpatialInfo.CurrentSpatial.RoomList.Count < 3)
- {
- dispalyView = new FrameLayout()
- {
- X = Application.GetRealWidth(10),
- Y = Application.GetRealHeight(100),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(155),
- BackgroundImagePath = "PersonalCenter/HomeList2bg.png",
- };
- dialogBody.AddChidren(dispalyView);
-
- contentView.Height = Application.GetRealHeight(45 * 3);
- dispalyView.AddChidren(contentView);
- }
- else if (SpatialInfo.CurrentSpatial.RoomList.Count < 4)
- {
- dispalyView = new FrameLayout()
- {
- X = Application.GetRealWidth(10),
- Y = Application.GetRealHeight(100),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(200),
- BackgroundImagePath = "PersonalCenter/HomeList3bg.png",
- };
- dialogBody.AddChidren(dispalyView);
-
- contentView.Height = Application.GetRealHeight(45 * 4);
- dispalyView.AddChidren(contentView);
- }
- else
- {
- dispalyView = new FrameLayout()
- {
- X = Application.GetRealWidth(10),
- Y = Application.GetRealHeight(100),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(245),
- BackgroundImagePath = "PersonalCenter/HomeList4bg.png",
- };
- dialogBody.AddChidren(dispalyView);
-
- contentView.Height = Application.GetRealHeight(45 * 5);
- contentView.ScrollEnabled = true;
- dispalyView.AddChidren(contentView);
- }
-
-
- List<Room> roomList = new List<Room>();
- roomList.Add(new Room() { roomName = Language.StringByID(StringId.All) });
- roomList.AddRange(SpatialInfo.CurrentSpatial.RoomList);
- foreach (var tempRoom in roomList)
- {
- var roomName = tempRoom.roomName;
- if (roomName != Language.StringByID(StringId.All))
- {
- contentView.AddChidren(new Button()
- {
- Gravity = Gravity.CenterHorizontal,
- Width = Application.GetRealWidth(112),
- Height = Application.GetRealHeight(1),
- BackgroundColor = CSS_Color.BackgroundColor
- });
- }
- var btnHomeName = new Button()
- {
- Gravity = Gravity.CenterHorizontal,
- Width = Application.GetRealWidth(112),
- Height = Application.GetRealHeight(44),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = CSS_Color.FirstLevelTitleColor,
- SelectedTextColor = CSS_Color.MainColor,
- Text = roomName,
- TextSize = CSS_FontSize.SubheadingFontSize,
- IsSelected = btnFloor.Text == roomName,
- IsMoreLines = true,
- };
- contentView.AddChidren(btnHomeName);
-
- btnHomeName.MouseUpEventHandler += (senderH, en) =>
- {
- dialog.Close();
- btnFloor.Text = roomName;
- if (roomName == Language.StringByID(StringId.All))
- {
- ShowFunctionRow(functionList);
- }
- else
- {
- var showList = new List<Function>();
- foreach (var sf in functionList)
- {
- if(sf.roomIds.Contains(tempRoom.roomId))
- {
- showList.Add(sf);
- }
- }
- ShowFunctionRow(showList);
- }
- };
- }
-
- dialog.Show();
+ string nowSelectId = null;
+ btnFloor.MouseUpEventHandler += (sender, e) =>
+ {
+ //鏄剧ず涓嬫媺鍒楄〃
+ var form = new FloorRoomSelectPopupView();
+ form.ShowDeviceFunctionView(btnFloor, this.functionList, (selectId, listFunc) =>
+ {
+ nowSelectId = selectId;
+ //閲嶆柊鍔犺浇鐣岄潰
+ ShowFunctionRow(listFunc);
+ }, nowSelectId);
};
-
- btnFloor.MouseUpEventHandler = eventHandler;
- btnFloorDownIcon.MouseUpEventHandler = eventHandler;
}
}
}
\ No newline at end of file
diff --git a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
index 8ac9bfb..efac389 100755
--- a/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/IntelligencePage.cs
@@ -1,4 +1,5 @@
锘縰sing System;
+using System.Collections.Generic;
using HDL_ON.DriverLayer;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
@@ -20,6 +21,10 @@
/// 鍦烘櫙鍐呭鏄剧ず鍖哄煙
/// </summary>
FrameLayout floorChangeView;
+ /// <summary>
+ /// 妤煎眰鎴块棿閫夋嫨鐨勪笅鎷夊璞�
+ /// </summary>
+ FloorRoomSelectPopupView floorRoomSelectView = null;
Button btnSceneTilte;
#region 鍦烘櫙搴曢儴鍒囨崲鏄剧ず鍖哄煙
@@ -208,23 +213,40 @@
TextAlignment = TextAlignment.CenterLeft,
Text = DB_ResidenceData.Instance.CurFloor.roomName,
};
- floorChangeView.AddChidren(btnFloor);
+ floorChangeView.AddChidren(btnFloor);
+
+ string nowSelectId = null;
+ btnFloor.MouseUpEventHandler += (sender, e) =>
+ {
+ if (this.floorRoomSelectView == null)
+ {
+ //鍏堝垵濮嬪寲
+ this.floorRoomSelectView = new FloorRoomSelectPopupView();
+ }
+ //鏄剧ず涓嬫媺鍒楄〃
+ this.floorRoomSelectView.ShowSceneView(btnFloor, (selectId, listScene) =>
+ {
+ nowSelectId = selectId;
+ //閲嶆柊鍒锋柊鍦烘櫙鍒楄〃
+ this.LoadSceneFunctionControlZone(listScene);
+ }, nowSelectId);
+ };
#endregion
-
+
sceneFunctionView = new VerticalScrolViewLayout()
{
Y = floorChangeView.Bottom,
Height = Application.GetRealHeight(667 - 64 - 49 - 52 + 30),
};
scenePageView.AddChidren(sceneFunctionView);
- LoadSceneFunctionControlZone();
+ LoadSceneFunctionControlZone(null);
}
/// <summary>
/// 鍔犺浇鍦烘櫙鍔熻兘鏄剧ず鍖哄煙
/// </summary>
- void LoadSceneFunctionControlZone()
+ void LoadSceneFunctionControlZone(List<Scene> listScene)
{
//topView.AddChidren(btnAddIcon);
@@ -233,7 +255,18 @@
try
{
int index = 0;
- foreach (var scene in FunctionList.List.scenes)
+ //鑾峰彇鑳藉鏄剧ず鐨勫満鏅�
+ if (listScene == null)
+ {
+ //鍒濆鍊�
+ if (this.floorRoomSelectView == null)
+ {
+ //鍏堝垵濮嬪寲
+ this.floorRoomSelectView = new FloorRoomSelectPopupView();
+ }
+ listScene = this.floorRoomSelectView.GetCanShowListScene();
+ }
+ foreach (var scene in listScene)
{
//if (scene.roomIds.Count == 0)//濡備綍鍦ㄦ埧闂村凡缁忕Щ闄や簡杩欎釜鍔熻兘锛屽垯鏀惰棌鐣岄潰涔熶笉浼氬啀鏄剧ず
//{
@@ -380,7 +413,7 @@
LoadEvent_ControlScene(btnCoverd,btnName,btnZone, scene);
btnSettingIcon.MouseUpEventHandler = (sender, e) => {
Action backAction = () => {
- LoadSceneFunctionControlZone();
+ LoadSceneFunctionControlZone(null);
};
Action refreshAction = () => {
btnName.Text = scene.name;
@@ -412,7 +445,7 @@
contentPageView.AddChidren(automationPage);
UI2.Intelligence.Automation.MainView.automationPage = automationPage;
UI2.Intelligence.Automation.MainView.MainShow();
- }
+ }
#endregion
}
@@ -505,7 +538,7 @@
Action action = () =>
{
- LoadSceneFunctionControlZone();
+ LoadSceneFunctionControlZone(null);
};
var aep = new NewSceneMenuListPage(action);
MainPage.BasePageView.AddChidren(aep);
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs
index 3df6926..0ad5aaf 100755
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs
@@ -29,14 +29,6 @@
/// 绛涢�夋枃鏈樉绀�
/// </summary>
Button btnScreenText;
- /// <summary>
- /// 绛涢�夋潯浠�1
- /// </summary>
- string screen1;
- /// <summary>
- /// 绛涢�夋潯浠�2
- /// </summary>
- string screen2;
VerticalScrolViewLayout functionListView;
@@ -153,7 +145,7 @@
}
}
- LoadFunctionListRow();
+ LoadFunctionListRow(null);
LoadEventList();
}
@@ -162,12 +154,16 @@
/// 鏄剧ず鍔熻兘Row
/// </summary>
/// <param name="showUnallocated">鏄惁鏄樉绀烘湭鍒嗛厤</param>
- void LoadFunctionListRow()
+ void LoadFunctionListRow(List<Function> functions)
{
functionListView.RemoveAll();
- List<Function> functions = new List<Function>();
- functions.AddRange(unallocatedList);
- functions.AddRange(allocatedList);
+ if (functions == null)
+ {
+ //鍒濆鍊�
+ functions = new List<Function>();
+ functions.AddRange(unallocatedList);
+ functions.AddRange(allocatedList);
+ }
foreach (var function in functions)
{
if (function.functionCategory != FunctionCategory.Light &&
@@ -176,22 +172,6 @@
)
{
continue;
- }
- //鎸夋ゼ灞傜瓫閫�
- if (!string.IsNullOrEmpty(screen1))
- {
- if (!function.roomIds.Contains(screen1))
- {
- continue;
- }
- }
- //鎸夌被鍨嬬瓫閫�
- if (!string.IsNullOrEmpty(screen2))
- {
- //if (!function.functionType!= screen2)
- //{
- // continue;
- //}
}
functionListView.AddChidren(new Button()
{
@@ -319,135 +299,24 @@
/// 浣忓畢鍒楄〃鐐瑰嚮浜嬩欢
/// </summary>
void LoadDialog_ChangeFloor()
- {
- EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
- var dialog = new Dialog();
- var dialogBody = new FrameLayout();
- dialog.AddChidren(dialogBody);
- dialogBody.MouseUpEventHandler += (sender1, e1) => {
- dialog.Close();
- };
-
- var dispalyView = new FrameLayout()
- {
- X = Application.GetRealWidth(10),
- Y = Application.GetRealHeight(100),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(110),
- BackgroundImagePath = "PersonalCenter/HomeList1bg.png",
- };
- dialogBody.AddChidren(dispalyView);
-
- var contentView = new VerticalScrolViewLayout()
- {
- X = Application.GetRealWidth(8),
- Y = Application.GetRealHeight(15),
- Width = Application.GetRealWidth(150),
- Height = Application.GetRealHeight(45 * 2),
- ScrollEnabled = false
- };
- dispalyView.AddChidren(contentView);
-
- if (SpatialInfo.CurrentSpatial.FloorList.Count < 2)
- {
- }
- else if (SpatialInfo.CurrentSpatial.FloorList.Count < 3)
- {
- dispalyView = new FrameLayout()
- {
- X = Application.GetRealWidth(10),
- Y = Application.GetRealHeight(100),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(155),
- BackgroundImagePath = "PersonalCenter/HomeList2bg.png",
- };
- dialogBody.AddChidren(dispalyView);
-
- contentView.Height = Application.GetRealHeight(45 * 3);
- dispalyView.AddChidren(contentView);
- }
- else if (SpatialInfo.CurrentSpatial.FloorList.Count < 4)
- {
- dispalyView = new FrameLayout()
- {
- X = Application.GetRealWidth(10),
- Y = Application.GetRealHeight(100),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(200),
- BackgroundImagePath = "PersonalCenter/HomeList3bg.png",
- };
- dialogBody.AddChidren(dispalyView);
-
- contentView.Height = Application.GetRealHeight(45 * 4);
- dispalyView.AddChidren(contentView);
- }
- else
- {
- dispalyView = new FrameLayout()
- {
- X = Application.GetRealWidth(10),
- Y = Application.GetRealHeight(100),
- Width = Application.GetRealWidth(160),
- Height = Application.GetRealHeight(245),
- BackgroundImagePath = "PersonalCenter/HomeList4bg.png",
- };
- dialogBody.AddChidren(dispalyView);
-
- contentView.Height = Application.GetRealHeight(45 * 5);
- contentView.ScrollEnabled = true;
- dispalyView.AddChidren(contentView);
- }
-
-
- List<string> chooseList = new List<string>();
- chooseList.Add(Language.StringByID(StringId.All));
- foreach (var f in SpatialInfo.CurrentSpatial.FloorList)
- {
- chooseList.Add(f.roomName);
- }
-
- foreach (var floor in chooseList)
- {
- if (floor != Language.StringByID(StringId.All))
- {
- contentView.AddChidren(new Button()
- {
- Gravity = Gravity.CenterHorizontal,
- Width = Application.GetRealWidth(112),
- Height = Application.GetRealHeight(1),
- BackgroundColor = CSS.CSS_Color.BackgroundColor
- });
- }
- var btnHomeName = new Button()
- {
- Gravity = Gravity.CenterHorizontal,
- Width = Application.GetRealWidth(112),
- Height = Application.GetRealHeight(44),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = CSS.CSS_Color.FirstLevelTitleColor,
- SelectedTextColor = CSS.CSS_Color.MainColor,
- Text = floor,
- TextSize = CSS.CSS_FontSize.SubheadingFontSize,
- IsSelected = btnFloor.Text == floor,
- IsMoreLines = true,
- Tag = floor
- };
- contentView.AddChidren(btnHomeName);
-
- btnHomeName.MouseUpEventHandler += (senderH, en) =>
- {
- dialog.Close();
- btnFloor.Text = floor;
- };
- }
-
- dialog.Show();
+ {
+ string nowSelectId = null;
+ btnFloor.MouseUpEventHandler += (sender, e) =>
+ {
+ var listAllFun = new List<Function>();
+ listAllFun.AddRange(unallocatedList);
+ listAllFun.AddRange(allocatedList);
+
+ //鏄剧ず涓嬫媺鐣岄潰
+ var form = new FloorRoomSelectPopupView();
+ form.ShowDeviceFunctionView(btnFloor, listAllFun, (selectId, listFun) =>
+ {
+ nowSelectId = selectId;
+ //閲嶆柊鍒锋柊璁惧鍒楄〃
+ this.LoadFunctionListRow(listFun);
+ }, nowSelectId);
};
-
- btnFloor.MouseUpEventHandler = eventHandler;
- btnFloorDownIcon.MouseUpEventHandler = eventHandler;
}
-
}
//---------------------------------------
--
Gitblit v1.8.0