From 39cf2411b59772d56ee731f229f09ff472889bad Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期四, 22 九月 2022 15:12:04 +0800
Subject: [PATCH] Merge branch 'Dev-Branch' into hxb
---
HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs | 136 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 134 insertions(+), 2 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
index 4973f51..b0b6876 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs
@@ -70,6 +70,9 @@
case FunctionAttributeKey.RGB:
LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.RGB));
break;
+ case "angle"://瑙掑害
+ LoadFunctionRow(sceneFunction.status.Find((obj) => obj.key == "angle"));
+ break;
}
}
@@ -148,7 +151,15 @@
if (temp != null)
{
- temp = sceneFunction;
+ temp.delay = sceneFunction.delay;
+ foreach(var attr in sceneFunction.status)
+ {
+ var keva = temp.status.Find((obj) => obj.key == attr.key);
+ if (keva != null)
+ {
+ keva.value = attr.value;
+ }
+ }
}
else
{
@@ -343,6 +354,11 @@
LoadEditDialog_Temp(sceneStatus, btnFunctionText);
break;
case FunctionAttributeKey.FadeTime:
+
+ break;
+ case "angle":
+ //鍛堢幇鐨勫脊绐�
+ LoadEditDialog_Angle(sceneStatus, btnFunctionText);
break;
case "cct":
@@ -623,7 +639,8 @@
var btnConfrim = new Button()
{
- Width = Application.GetRealWidth(320),
+ X = Application.GetRealWidth(160),
+ Width = Application.GetRealWidth(160),
TextAlignment = TextAlignment.CenterRight,
TextColor = CSS_Color.MainColor,
TextSize = CSS_FontSize.TextFontSize,
@@ -671,6 +688,120 @@
};
}
+
+ /// <summary>
+ /// 鍔犺浇娓╁害閫夋嫨寮圭獥
+ /// </summary>
+ /// <param name="function"></param>
+ /// <param name="btn"></param>
+ void LoadEditDialog_Angle (SceneFunctionStatus trait, Button btn)
+ {
+ double temp = trait.min;
+ double.TryParse(trait.value, out temp);
+ trait.value = temp.ToString();
+
+ List<string> pickerItems = new List<string>();
+ if (trait == null)
+ {
+ return;
+ }
+
+ Dialog dialog = new Dialog();
+
+ var pView = new FrameLayout()
+ {
+ BackgroundColor = CSS_Color.DialogTransparentColor1,
+ };
+ dialog.AddChidren(pView);
+
+ var optionBaseView = new FrameLayout()
+ {
+ Y = Application.GetRealHeight(456 - 60),
+ Gravity = Gravity.CenterHorizontal,
+ Width = Application.GetRealWidth(343),
+ Height = Application.GetRealHeight(260),
+ AnimateSpeed = 0.3f,
+ Animate = Animate.DownToUp,
+ BackgroundColor = CSS_Color.MainBackgroundColor,
+ Radius = (uint)Application.GetRealWidth(12),
+ };
+ pView.AddChidren(optionBaseView);
+
+ var topView = new FrameLayout()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Width = Application.GetRealWidth(343),
+ Height = Application.GetRealHeight(40),
+ BackgroundColor = CSS_Color.MainBackgroundColor,
+ Radius = (uint)Application.GetRealWidth(12),
+ };
+ optionBaseView.AddChidren(topView);
+ topView.AddChidren(new Button() { Y = Application.GetRealHeight(39), Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor });
+
+ var btnCancel = new Button()
+ {
+ X = Application.GetRealWidth(21),
+ Width = Application.GetRealWidth(100),
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = CSS_Color.PromptingColor1,
+ TextSize = CSS_FontSize.TextFontSize,
+ TextID = StringId.Cancel,
+ };
+ topView.AddChidren(btnCancel);
+
+
+ var btnConfrim = new Button()
+ {
+ X = Application.GetRealWidth(160),
+ Width = Application.GetRealWidth(160),
+ TextAlignment = TextAlignment.CenterRight,
+ TextColor = CSS_Color.MainColor,
+ TextSize = CSS_FontSize.TextFontSize,
+ TextID = StringId.Confirm,
+ };
+ topView.AddChidren(btnConfrim);
+
+ UIPickerView uIPickerView = new UIPickerView()
+ {
+ Y = Application.GetRealHeight(40),
+ Height = Application.GetRealHeight(210),
+ Radius = (uint)Application.GetRealWidth(12),
+ };
+ for (int i = trait.min; i <= trait.max; i += 1)
+ {
+ pickerItems.Add(i.ToString() + trait.GetUintString());
+ }
+ uIPickerView.setNPicker(pickerItems, null, null);
+ optionBaseView.AddChidren(uIPickerView);
+ uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.value.ToString()+ "掳"), 0, 0);
+
+ string selectItem = pickerItems[pickerItems.IndexOf(trait.value.ToString() + "掳")];
+ if (pickerItems.Contains(trait.value + trait.GetUintString()))
+ {
+ selectItem = trait.value.ToString() + trait.GetUintString();
+ }
+ //uIPickerView.setCurrentItems
+ dialog.Show();
+
+ pView.MouseUpEventHandler = (sender, e) => {
+ dialog.Close();
+ };
+
+ btnCancel.MouseUpEventHandler = (sender, e) => {
+ dialog.Close();
+ };
+ uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => {
+ selectItem = pickerItems[int1];
+ };
+ btnConfrim.MouseUpEventHandler = (sender, e) => {
+ dialog.Close();
+ btn.Text = selectItem;
+ //sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.value.ToString() ;
+ trait.value = selectItem.Replace(trait.GetUintString(), "");
+ };
+
+ }
+
/// <summary>
/// 鍔犺浇浜害閫夋嫨寮圭獥
@@ -828,6 +959,7 @@
};
}
+
/// <summary>
/// 鍔犺浇cct閫夋嫨寮圭獥
/// </summary>
--
Gitblit v1.8.0