From cf3d4880046912f8b46c9e54769986a179faa26c Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期四, 08 四月 2021 18:01:13 +0800
Subject: [PATCH] 2021-04-08 1.更新音箱功能
---
HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs | 274 ++++++++++++++----------------------------------------
1 files changed, 72 insertions(+), 202 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs
index 3b77f9e..6a062db 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs
@@ -21,22 +21,14 @@
/// </summary>
Button btnFloor;
- /// <summary>
- /// 绛涢�夐�夋嫨涓嬫媺鍥炬爣
- /// </summary>
- Button btnScreenIcon;
+ ///// <summary>
+ ///// 绛涢�夐�夋嫨涓嬫媺鍥炬爣
+ ///// </summary>
+ //Button btnScreenIcon;
/// <summary>
/// 绛涢�夋枃鏈樉绀�
/// </summary>
Button btnScreenText;
- /// <summary>
- /// 绛涢�夋潯浠�1
- /// </summary>
- string screen1;
- /// <summary>
- /// 绛涢�夋潯浠�2
- /// </summary>
- string screen2;
VerticalScrolViewLayout functionListView;
@@ -102,28 +94,28 @@
showdFunctionTypeRow.AddChidren(btnFloor);
- btnScreenIcon = new Button()
- {
- Width = Application.GetMinRealAverage(16),
- Height = Application.GetMinRealAverage(16),
- X = Application.GetRealWidth(122),
- Y = Application.GetRealHeight(18),
- UnSelectedImagePath = "Public/DownIcon.png",
- };
- showdFunctionTypeRow.AddChidren(btnScreenIcon);
+ //btnScreenIcon = new Button()
+ //{
+ // Width = Application.GetMinRealAverage(16),
+ // Height = Application.GetMinRealAverage(16),
+ // X = Application.GetRealWidth(122),
+ // Y = Application.GetRealHeight(18),
+ // UnSelectedImagePath = "Public/DownIcon.png",
+ //};
+ //showdFunctionTypeRow.AddChidren(btnScreenIcon);
- btnScreenText = new Button()
- {
- X = btnScreenIcon.Right,
- Y = Application.GetRealHeight(18),
- Width = Application.GetRealWidth(200),
- Height = Application.GetMinRealAverage(16),
- TextColor = CSS_Color.FirstLevelTitleColor,
- TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- TextAlignment = TextAlignment.CenterLeft,
- TextID = StringId.Screen
- };
- showdFunctionTypeRow.AddChidren(btnScreenText);
+ //btnScreenText = new Button()
+ //{
+ // X = btnScreenIcon.Right,
+ // Y = Application.GetRealHeight(18),
+ // Width = Application.GetRealWidth(200),
+ // Height = Application.GetMinRealAverage(16),
+ // TextColor = CSS_Color.FirstLevelTitleColor,
+ // TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ // TextAlignment = TextAlignment.CenterLeft,
+ // TextID = StringId.Screen
+ //};
+ //showdFunctionTypeRow.AddChidren(btnScreenText);
#endregion
@@ -153,7 +145,7 @@
}
}
- LoadFunctionListRow();
+ LoadFunctionListRow(null);
LoadEventList();
}
@@ -162,36 +154,25 @@
/// 鏄剧ず鍔熻兘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 &&
- function.functionCategory != FunctionCategory.Thermostat &&
- function.functionCategory != FunctionCategory.Curtain
+ if (function.Spk_Prefix != FunctionCategory.Light &&
+ function.Spk_Prefix != FunctionCategory.AC &&
+ function.Spk_Prefix != FunctionCategory.FloorHeat &&
+ function.Spk_Prefix != FunctionCategory.Curtain
)
{
continue;
- }
- //鎸夋ゼ灞傜瓫閫�
- if (!string.IsNullOrEmpty(screen1))
- {
- if (!function.roomIds.Contains(screen1))
- {
- continue;
- }
- }
- //鎸夌被鍨嬬瓫閫�
- if (!string.IsNullOrEmpty(screen2))
- {
- //if (!function.functionType!= screen2)
- //{
- // continue;
- //}
}
functionListView.AddChidren(new Button()
{
@@ -229,15 +210,20 @@
Height = Application.GetMinRealAverage(28),
};
functionRow.AddChidren(btnFunctionIcon);
- switch (function.functionCategory)
+ switch (function.Spk_Prefix)
{
- case FunctionCategory.Thermostat:
- switch (function.functionType)
+ case FunctionCategory.AC:
+ switch (function.spk)
{
- case FunctionType.AC:
+ case SPK.AcStandard:
btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon1.png";
break;
- case FunctionType.FloorHeating:
+ }
+ break;
+ case FunctionCategory.FloorHeat:
+ switch (function.spk)
+ {
+ case SPK.FloorHeatStandard:
btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/FloorHeatingThinIcon.png";
break;
}
@@ -248,28 +234,23 @@
case FunctionCategory.Light:
btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Light/LightThinIcon.png";
break;
- case FunctionCategory.SwitchDevice:
- switch (function.functionType)
+ case FunctionCategory.Electric:
+ switch (function.spk)
{
- case FunctionType.Socket:
+ case SPK.ElectricSocket:
btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Socket/SocketThinIcon.png";
break;
- }
- break;
- case FunctionCategory.Electrical:
- switch (function.functionType)
- {
- case FunctionType.Fan:
+ case SPK.ElectricFan:
btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Electrical/FanThinIcon.png";
break;
- case FunctionType.TV:
+ case SPK.ElectricTV:
btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Electrical/TVThinIcon.png";
break;
}
break;
- case FunctionCategory.Scene:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Scene/SceneIcon.png";
- break;
+ //case FunctionCategory.Scene:
+ // btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Scene/SceneIcon.png";
+ //break;
case FunctionCategory.Music:
btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Music/MusicThinIcon.png";
break;
@@ -319,135 +300,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